You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
1.0 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";var M6=Object.defineProperty;var k6=(e,t,n)=>t in e?M6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ye=(e,t,n)=>(k6(e,typeof t!="symbol"?t+"":t,n),n);const N=require("obsidian"),u0=require("@codemirror/language"),Wp=require("@codemirror/state"),bi=require("@codemirror/view");var Vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var B2={exports:{}},Ep={},Y2={exports:{}},kt={},Tb;function N6(){if(Tb)return kt;Tb=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.iterator;function w(V){return V===null||typeof V!="object"?null:(V=m&&V[m]||V["@@iterator"],typeof V=="function"?V:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,E={};function k(V,G,le){this.props=V,this.context=G,this.refs=E,this.updater=le||b}k.prototype.isReactComponent={},k.prototype.setState=function(V,G){if(typeof V!="object"&&typeof V!="function"&&V!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,V,G,"setState")},k.prototype.forceUpdate=function(V){this.updater.enqueueForceUpdate(this,V,"forceUpdate")};function C(){}C.prototype=k.prototype;function I(V,G,le){this.props=V,this.context=G,this.refs=E,this.updater=le||b}var B=I.prototype=new C;B.constructor=I,T(B,k.prototype),B.isPureReactComponent=!0;var F=Array.isArray,_=Object.prototype.hasOwnProperty,R={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function z(V,G,le){var we,ue={},Se=null,Re=null;if(G!=null)for(we in G.ref!==void 0&&(Re=G.ref),G.key!==void 0&&(Se=""+G.key),G)_.call(G,we)&&!j.hasOwnProperty(we)&&(ue[we]=G[we]);var Ye=arguments.length-2;if(Ye===1)ue.children=le;else if(1<Ye){for(var Be=Array(Ye),yt=0;yt<Ye;yt++)Be[yt]=arguments[yt+2];ue.children=Be}if(V&&V.defaultProps)for(we in Ye=V.defaultProps,Ye)ue[we]===void 0&&(ue[we]=Ye[we]);return{$$typeof:e,type:V,key:Se,ref:Re,props:ue,_owner:R.current}}function q(V,G){return{$$typeof:e,type:V.type,key:G,ref:V.ref,props:V.props,_owner:V._owner}}function $(V){return typeof V=="object"&&V!==null&&V.$$typeof===e}function J(V){var G={"=":"=0",":":"=2"};return"$"+V.replace(/[=:]/g,function(le){return G[le]})}var ae=/\/+/g;function ie(V,G){return typeof V=="object"&&V!==null&&V.key!=null?J(""+V.key):G.toString(36)}function ge(V,G,le,we,ue){var Se=typeof V;(Se==="undefined"||Se==="boolean")&&(V=null);var Re=!1;if(V===null)Re=!0;else switch(Se){case"string":case"number":Re=!0;break;case"object":switch(V.$$typeof){case e:case t:Re=!0}}if(Re)return Re=V,ue=ue(Re),V=we===""?"."+ie(Re,0):we,F(ue)?(le="",V!=null&&(le=V.replace(ae,"$&/")+"/"),ge(ue,G,le,"",function(yt){return yt})):ue!=null&&($(ue)&&(ue=q(ue,le+(!ue.key||Re&&Re.key===ue.key?"":(""+ue.key).replace(ae,"$&/")+"/")+V)),G.push(ue)),1;if(Re=0,we=we===""?".":we+":",F(V))for(var Ye=0;Ye<V.length;Ye++){Se=V[Ye];var Be=we+ie(Se,Ye);Re+=ge(Se,G,le,Be,ue)}else if(Be=w(V),typeof Be=="function")for(V=Be.call(V),Ye=0;!(Se=V.next()).done;)Se=Se.value,Be=we+ie(Se,Ye++),Re+=ge(Se,G,le,Be,ue);else if(Se==="object")throw G=String(V),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(V).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.");return Re}function pe(V,G,le){if(V==null)return V;var we=[],ue=0;return ge(V,we,"","",function(Se){return G.call(le,Se,ue++)}),we}function fe(V){if(V._status===-1){var G=V._result;G=G(),G.then(function(le){(V._status===0||V._status===-1)&&(V._status=1,V._result=le)},function(le){(V._status===0||V._status===-1)&&(V._status=2,V._result=le)}),V._status===-1&&(V._status=0,V._result=G)}if(V._status===1)return V._result.default;throw V._result}var De={current:null},re={transition:null},be={ReactCurrentDispatcher:De,ReactCurrentBatchConfig:re,ReactCurrentOwner:R};return kt.Children={map:pe,forEach:function(V,G,le){pe(V,function(){G.apply(this,arguments)},le)},count:function(V){var G=0;return pe(V,function(){G++}),G},toArray:function(V){return pe(V,function(G){return G})||[]},only:function(V){if(!$(V))throw Error("React.Children.only expected to receive a single React element child.");return V}},kt.Component=k,kt.Fragment=n,kt.Profiler=o,kt.PureComponent=I,kt.StrictMode=r,kt.Suspense=d,kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=be,kt.cloneElement=function(V,G,le){if(V==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+V+".");var we=T({},V.props),ue=V.key,Se=V.ref,Re=V._owner;if(G!=null){if(G.ref!==void 0&&(Se=G.ref,Re=R.current),G.key!==void 0&&(ue=""+G.key),V.type&&V.type.defaultProps)var Ye=V.type.defaultProps;for(Be in G)_.call(G,Be)&&!j.hasOwnProperty(Be)&&(we[Be]=G[Be]===void 0&&Ye!==void 0?Ye[Be]:G[Be])}var Be=arguments.length-2;if(Be===1)we.children=le;else if(1<Be){Ye=Array(Be);for(var yt=0;yt<Be;yt++)Ye[yt]=arguments[yt+2];we.children=Ye}return{$$typeof:e,type:V.type,key:ue,ref:Se,props:we,_owner:Re}},kt.createContext=function(V){return V={$$typeof:s,_currentValue:V,_currentValue2:V,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},V.Provider={$$typeof:i,_context:V},V.Consumer=V},kt.createElement=z,kt.createFactory=function(V){var G=z.bind(null,V);return G.type=V,G},kt.createRef=function(){return{current:null}},kt.forwardRef=function(V){return{$$typeof:c,render:V}},kt.isValidElement=$,kt.lazy=function(V){return{$$typeof:g,_payload:{_status:-1,_result:V},_init:fe}},kt.memo=function(V,G){return{$$typeof:h,type:V,compare:G===void 0?null:G}},kt.startTransition=function(V){var G=re.transition;re.transition={};try{V()}finally{re.transition=G}},kt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},kt.useCallback=function(V,G){return De.current.useCallback(V,G)},kt.useContext=function(V){return De.current.useContext(V)},kt.useDebugValue=function(){},kt.useDeferredValue=function(V){return De.current.useDeferredValue(V)},kt.useEffect=function(V,G){return De.current.useEffect(V,G)},kt.useId=function(){return De.current.useId()},kt.useImperativeHandle=function(V,G,le){return De.current.useImperativeHandle(V,G,le)},kt.useInsertionEffect=function(V,G){return De.current.useInsertionEffect(V,G)},kt.useLayoutEffect=function(V,G){return De.current.useLayoutEffect(V,G)},kt.useMemo=function(V,G){return De.current.useMemo(V,G)},kt.useReducer=function(V,G,le){return De.current.useReducer(V,G,le)},kt.useRef=function(V){return De.current.useRef(V)},kt.useState=function(V){return De.current.useState(V)},kt.useSyncExternalStore=function(V,G,le){return De.current.useSyncExternalStore(V,G,le)},kt.useTransition=function(){return De.current.useTransition()},kt.version="18.2.0",kt}Y2.exports=N6();var A=Y2.exports;const Q=qn(A);var Cb;function F6(){if(Cb)return Ep;Cb=1;var e=A,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(c,d,h){var g,m={},w=null,b=null;h!==void 0&&(w=""+h),d.key!==void 0&&(w=""+d.key),d.ref!==void 0&&(b=d.ref);for(g in d)r.call(d,g)&&!i.hasOwnProperty(g)&&(m[g]=d[g]);if(c&&c.defaultProps)for(g in d=c.defaultProps,d)m[g]===void 0&&(m[g]=d[g]);return{$$typeof:t,type:c,key:w,ref:b,props:m,_owner:o.current}}return Ep.Fragment=n,Ep.jsx=s,Ep.jsxs=s,Ep}B2.exports=F6();var D=B2.exports;const If=e=>{const{children:t,store:n,context:r}=e,[o,i]=A.useState(n.getState());return A.useEffect(()=>{const s=n.subscribe(c=>{i(c)});return()=>{s()}},[]),D.jsx(r.Provider,{value:o,children:t})};function I6(e){const t=Object.keys(e),n={};for(const r of t)typeof e[r]=="function"&&(n[r]=e[r]);return(r={},o)=>{let i=!1;const s={};for(const c of t){const d=r[c],h=n[c](d,o);s[c]=h,i=i||h!==d}return i?s:r}}function A6(e,t){const n=[];let r=e;return{dispatch:c=>{const d=t(r,c),h=r;r=d;for(const g of n)g(r,h)},getState:()=>r,subscribe:c=>{let d=!0;return n.push(c),()=>{if(!d)return;const h=n.indexOf(c);n.splice(h,1),d=!1}}}}function O6(e,t){switch(t.type){case"SET_MARK_MEMO_ID":return t.payload.markMemoId===e.markMemoId?e:{...e,markMemoId:t.payload.markMemoId};case"SET_EDIT_MEMO_ID":return t.payload.editMemoId===e.editMemoId?e:{...e,editMemoId:t.payload.editMemoId};case"SET_GLOBAL_EDITOR_SHOWN":return t.payload.globalEditorShown===e.globalEditorShown?e:{...e,globalEditorShown:t.payload.globalEditorShown};case"SET_COMMENT_MEMO_ID":return t.payload.commentMemoId===e.commentMemoId?e:{...e,commentMemoId:t.payload.commentMemoId};case"SET_MOBILE_VIEW":return t.payload.isMobileView===e.isMobileView?e:{...e,isMobileView:t.payload.isMobileView};case"SET_CHANGED_BY_MEMOS":return t.payload.changedByMemos===e.changedByMemos?e:{...e,changedByMemos:t.payload.changedByMemos};case"SET_REFRESH":return t.payload.refresh===e.refresh?e:{...e,refresh:t.payload.refresh};case"SET_INSTANCE":return e.instanceList.has(t.payload.id)?e:{...e,instanceList:e.instanceList.set(t.payload.id,t.payload.instance)};case"SET_SHOW_SIDEBAR_IN_MOBILE_VIEW":return t.payload.showSiderbarInMobileView===e.showSiderbarInMobileView?e:{...e,showSiderbarInMobileView:t.payload.showSiderbarInMobileView};case"SET_MEMO_LIST_VIEW":return t.payload.memoListView===e.memoListView?e:{...e,memoListView:t.payload.memoListView};case"SET_MEMO_PLUGIN_MANIFEST":return{...e,manifest:t.payload.manifest};case"SET_LOADED":return{...e,loaded:t.payload.loaded};case"SET_APP_SETTING":return{...e,...t.payload};default:return e}}const R6={markMemoId:"",editMemoId:"",commentMemoId:"",shouldSplitMemoWord:!0,shouldHideImageUrl:!0,shouldUseMarkdownParser:!0,useTinyUndoHistoryCache:!1,isMobileView:!1,showSiderbarInMobileView:!1,changedByMemos:!1,memoListView:"list",manifest:null,refresh:!1,loaded:!1,globalEditorShown:!1,instanceList:new Map};function L6(e,t){switch(t.type){case"RELOAD":return H2;case"SET_LOCATION":return t.payload;case"SET_PATHNAME":return t.payload.pathname===e.pathname?e:{...e,pathname:t.payload.pathname};case"SET_HASH":return t.payload.hash===e.hash?e:{...e,hash:t.payload.hash};case"SET_QUERY":return{...e,query:{...t.payload}};case"SET_TAG_QUERY":return t.payload.tag===e.query.tag?e:{...e,query:{...e.query,tag:t.payload.tag}};case"SET_DURATION_QUERY":return t.payload.duration===e.query.duration?e:{...e,query:{...e.query,duration:{...e.query.duration,...t.payload.duration}}};case"SET_TYPE":return t.payload.type===e.query.type?e:{...e,query:{...e.query,type:t.payload.type}};case"SET_TEXT":return t.payload.text===e.query.text?e:{...e,query:{...e.query,text:t.payload.text}};case"SET_QUERY_FILTER":return t.payload===e.query.filter?e:{...e,query:{...e.query,filter:t.payload}};default:return e}}const H2={pathname:"/",hash:"",query:{tag:"",duration:null,type:"",text:"",filter:""}};var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});var yn=N;const J0="YYYY-MM-DD",X0="gggg-[W]ww",U2="YYYY-MM",V2="YYYY-[Q]Q",z2="YYYY";function uh(e){var n,r;const t=window.app.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n[e])==null?void 0:r.enabled)}function ch(){var e,t,n,r;try{const{internalPlugins:o,plugins:i}=window.app;if(uh("daily")){const{format:h,folder:g,template:m}=((t=(e=i.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.daily)||{};return{format:h||J0,folder:(g==null?void 0:g.trim())||"",template:(m==null?void 0:m.trim())||""}}const{folder:s,format:c,template:d}=((r=(n=o.getPluginById("daily-notes"))==null?void 0:n.instance)==null?void 0:r.options)||{};return{format:c||J0,folder:(s==null?void 0:s.trim())||"",template:(d==null?void 0:d.trim())||""}}catch{}}function fh(){var e,t,n,r,o,i,s;try{const c=window.app.plugins,d=(e=c.getPlugin("calendar"))==null?void 0:e.options,h=(n=(t=c.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.weekly;if(uh("weekly"))return{format:h.format||X0,folder:((r=h.folder)==null?void 0:r.trim())||"",template:((o=h.template)==null?void 0:o.trim())||""};const g=d||{};return{format:g.weeklyNoteFormat||X0,folder:((i=g.weeklyNoteFolder)==null?void 0:i.trim())||"",template:((s=g.weeklyNoteTemplate)==null?void 0:s.trim())||""}}catch{}}function dh(){var t,n,r,o;const e=window.app.plugins;try{const i=uh("monthly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.monthly)||{};return{format:i.format||U2,folder:((r=i.folder)==null?void 0:r.trim())||"",template:((o=i.template)==null?void 0:o.trim())||""}}catch{}}function ph(){var t,n,r,o;const e=window.app.plugins;try{const i=uh("quarterly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.quarterly)||{};return{format:i.format||V2,folder:((r=i.folder)==null?void 0:r.trim())||"",template:((o=i.template)==null?void 0:o.trim())||""}}catch{}}function hh(){var t,n,r,o;const e=window.app.plugins;try{const i=uh("yearly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.yearly)||{};return{format:i.format||z2,folder:((r=i.folder)==null?void 0:r.trim())||"",template:((o=i.template)==null?void 0:o.trim())||""}}catch{}}function $2(...e){let t=[];for(let r=0,o=e.length;r<o;r++)t=t.concat(e[r].split("/"));const n=[];for(let r=0,o=t.length;r<o;r++){const i=t[r];!i||i==="."||n.push(i)}return t[0]===""&&n.unshift(""),n.join("/")}function _6(e){let t=e.substring(e.lastIndexOf("/")+1);return t.lastIndexOf(".")!=-1&&(t=t.substring(0,t.lastIndexOf("."))),t}async function P6(e){const t=e.replace(/\\/g,"/").split("/");if(t.pop(),t.length){const n=$2(...t);window.app.vault.getAbstractFileByPath(n)||await window.app.vault.createFolder(n)}}async function mh(e,t){t.endsWith(".md")||(t+=".md");const n=yn.normalizePath($2(e,t));return await P6(n),n}async function Af(e){const{metadataCache:t,vault:n}=window.app,r=yn.normalizePath(e);if(r==="/")return Promise.resolve(["",null]);try{const o=t.getFirstLinkpathDest(r,""),i=await n.cachedRead(o),s=window.app.foldManager.load(o);return[i,s]}catch(o){return console.error(`Failed to read the daily note template '${r}'`,o),new yn.Notice("Failed to read the daily note template"),["",null]}}function La(e,t="day"){const n=e.clone().startOf(t).format();return`${t}-${n}`}function q2(e){return e.replace(/\[[^\]]*\]/g,"")}function j6(e,t){if(t==="week"){const n=q2(e);return/w{1,2}/i.test(n)&&(/M{1,4}/.test(n)||/D{1,4}/.test(n))}return!1}function Of(e,t){return W2(e.basename,t)}function B6(e,t){return W2(_6(e),t)}function W2(e,t){const r={day:ch,week:fh,month:dh,quarter:ph,year:hh}[t]().format.split("/").pop(),o=window.moment(e,r,!0);if(!o.isValid())return null;if(j6(r,t)&&t==="week"){const i=q2(r);if(/w{1,2}/i.test(i))return window.moment(e,r.replace(/M{1,4}/g,"").replace(/D{1,4}/g,""),!1)}return o}class Y6 extends Error{}async function G2(e){const t=window.app,{vault:n}=t,r=window.moment,{template:o,format:i,folder:s}=ch(),[c,d]=await Af(o),h=e.format(i),g=await mh(s,h);try{const m=await n.create(g,c.replace(/{{\s*date\s*}}/gi,h).replace(/{{\s*time\s*}}/gi,r().format("HH:mm")).replace(/{{\s*title\s*}}/gi,h).replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(w,b,T,E,k,C)=>{const I=r(),B=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return T&&B.add(parseInt(E,10),k),C?B.format(C.substring(1).trim()):B.format(i)}).replace(/{{\s*yesterday\s*}}/gi,e.clone().subtract(1,"day").format(i)).replace(/{{\s*tomorrow\s*}}/gi,e.clone().add(1,"d").format(i)));return t.foldManager.save(m,d),m}catch(m){console.error(`Failed to create file: '${g}'`,m),new yn.Notice("Unable to create new file.")}}function H6(e,t){return t[La(e,"day")]??null}function U6(){const{vault:e}=window.app,{folder:t}=ch(),n=e.getAbstractFileByPath(yn.normalizePath(t));if(!n)throw new Y6("Failed to find daily notes folder");const r={};return yn.Vault.recurseChildren(n,o=>{if(o instanceof yn.TFile){const i=Of(o,"day");if(i){const s=La(i,"day");r[s]=o}}}),r}class V6 extends Error{}function z6(){const{moment:e}=window;let t=e.localeData()._week.dow;const n=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)n.push(n.shift()),t--;return n}function $6(e){return z6().indexOf(e.toLowerCase())}async function K2(e){const{vault:t}=window.app,{template:n,format:r,folder:o}=fh(),[i,s]=await Af(n),c=e.format(r),d=await mh(o,c);try{const h=await t.create(d,i.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(g,m,w,b,T,E)=>{const k=window.moment(),C=e.clone().set({hour:k.get("hour"),minute:k.get("minute"),second:k.get("second")});return w&&C.add(parseInt(b,10),T),E?C.format(E.substring(1).trim()):C.format(r)}).replace(/{{\s*title\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(g,m,w)=>{const b=$6(m);return e.weekday(b).format(w.trim())}));return window.app.foldManager.save(h,s),h}catch(h){console.error(`Failed to create file: '${d}'`,h),new yn.Notice("Unable to create new file.")}}function q6(e,t){return t[La(e,"week")]??null}function W6(){const e={};if(!Z2())return e;const{vault:t}=window.app,{folder:n}=fh(),r=t.getAbstractFileByPath(yn.normalizePath(n));if(!r)throw new V6("Failed to find weekly notes folder");return yn.Vault.recurseChildren(r,o=>{if(o instanceof yn.TFile){const i=Of(o,"week");if(i){const s=La(i,"week");e[s]=o}}}),e}class G6 extends Error{}async function Q2(e){const{vault:t}=window.app,{template:n,format:r,folder:o}=dh(),[i,s]=await Af(n),c=e.format(r),d=await mh(o,c);try{const h=await t.create(d,i.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(g,m,w,b,T,E)=>{const k=window.moment(),C=e.clone().set({hour:k.get("hour"),minute:k.get("minute"),second:k.get("second")});return w&&C.add(parseInt(b,10),T),E?C.format(E.substring(1).trim()):C.format(r)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(h,s),h}catch(h){console.error(`Failed to create file: '${d}'`,h),new yn.Notice("Unable to create new file.")}}function K6(e,t){return t[La(e,"month")]??null}function Q6(){const e={};if(!J2())return e;const{vault:t}=window.app,{folder:n}=dh(),r=t.getAbstractFileByPath(yn.normalizePath(n));if(!r)throw new G6("Failed to find monthly notes folder");return yn.Vault.recurseChildren(r,o=>{if(o instanceof yn.TFile){const i=Of(o,"month");if(i){const s=La(i,"month");e[s]=o}}}),e}class Z6 extends Error{}async function J6(e){const{vault:t}=window.app,{template:n,format:r,folder:o}=ph(),[i,s]=await Af(n),c=e.format(r),d=await mh(o,c);try{const h=await t.create(d,i.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(g,m,w,b,T,E)=>{const k=window.moment(),C=e.clone().set({hour:k.get("hour"),minute:k.get("minute"),second:k.get("second")});return w&&C.add(parseInt(b,10),T),E?C.format(E.substring(1).trim()):C.format(r)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(h,s),h}catch(h){console.error(`Failed to create file: '${d}'`,h),new yn.Notice("Unable to create new file.")}}function X6(e,t){return t[La(e,"quarter")]??null}function e8(){const e={};if(!X2())return e;const{vault:t}=window.app,{folder:n}=ph(),r=t.getAbstractFileByPath(yn.normalizePath(n));if(!r)throw new Z6("Failed to find quarterly notes folder");return yn.Vault.recurseChildren(r,o=>{if(o instanceof yn.TFile){const i=Of(o,"quarter");if(i){const s=La(i,"quarter");e[s]=o}}}),e}class t8 extends Error{}async function n8(e){const{vault:t}=window.app,{template:n,format:r,folder:o}=hh(),[i,s]=await Af(n),c=e.format(r),d=await mh(o,c);try{const h=await t.create(d,i.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(g,m,w,b,T,E)=>{const k=window.moment(),C=e.clone().set({hour:k.get("hour"),minute:k.get("minute"),second:k.get("second")});return w&&C.add(parseInt(b,10),T),E?C.format(E.substring(1).trim()):C.format(r)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(h,s),h}catch(h){console.error(`Failed to create file: '${d}'`,h),new yn.Notice("Unable to create new file.")}}function r8(e,t){return t[La(e,"year")]??null}function o8(){const e={};if(!eE())return e;const{vault:t}=window.app,{folder:n}=hh(),r=t.getAbstractFileByPath(yn.normalizePath(n));if(!r)throw new t8("Failed to find yearly notes folder");return yn.Vault.recurseChildren(r,o=>{if(o instanceof yn.TFile){const i=Of(o,"year");if(i){const s=La(i,"year");e[s]=o}}}),e}function a8(){var r,o;const{app:e}=window,t=e.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;const n=e.plugins.getPlugin("periodic-notes");return n&&((o=(r=n.settings)==null?void 0:r.daily)==null?void 0:o.enabled)}function Z2(){var n,r;const{app:e}=window;if(e.plugins.getPlugin("calendar"))return!0;const t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.weekly)==null?void 0:r.enabled)}function J2(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.monthly)==null?void 0:r.enabled)}function X2(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.quarterly)==null?void 0:r.enabled)}function eE(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.yearly)==null?void 0:r.enabled)}function i8(e){const t={day:ch,week:fh,month:dh,quarter:ph,year:hh}[e];return t()}function s8(e,t){return{day:G2,month:Q2,week:K2}[e](t)}Ft.DEFAULT_DAILY_NOTE_FORMAT=J0;Ft.DEFAULT_MONTHLY_NOTE_FORMAT=U2;Ft.DEFAULT_QUARTERLY_NOTE_FORMAT=V2;Ft.DEFAULT_WEEKLY_NOTE_FORMAT=X0;Ft.DEFAULT_YEARLY_NOTE_FORMAT=z2;var tE=Ft.appHasDailyNotesPluginLoaded=a8;Ft.appHasMonthlyNotesPluginLoaded=J2;Ft.appHasQuarterlyNotesPluginLoaded=X2;Ft.appHasWeeklyNotesPluginLoaded=Z2;Ft.appHasYearlyNotesPluginLoaded=eE;var nE=Ft.createDailyNote=G2;Ft.createMonthlyNote=Q2;Ft.createPeriodicNote=s8;Ft.createQuarterlyNote=J6;Ft.createWeeklyNote=K2;Ft.createYearlyNote=n8;var Au=Ft.getAllDailyNotes=U6;Ft.getAllMonthlyNotes=Q6;Ft.getAllQuarterlyNotes=e8;Ft.getAllWeeklyNotes=W6;Ft.getAllYearlyNotes=o8;var Sv=Ft.getDailyNote=H6,Kg=Ft.getDailyNoteSettings=ch,Bp=Ft.getDateFromFile=Of;Ft.getDateFromPath=B6;Ft.getDateUID=La;Ft.getMonthlyNote=K6;Ft.getMonthlyNoteSettings=dh;Ft.getPeriodicNoteSettings=i8;Ft.getQuarterlyNote=X6;Ft.getQuarterlyNoteSettings=ph;Ft.getTemplateInfo=Af;Ft.getWeeklyNote=q6;Ft.getWeeklyNoteSettings=fh;Ft.getYearlyNote=r8;Ft.getYearlyNoteSettings=hh;const l8={},u8={},c8={},f8={},rE={welcome:"Welcome to Thino",ribbonIconTitle:"Thino",to:"to",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],weekDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekDaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],year:null,month:null,"Basic Options":"Basic options","User name in Memos":"User name in Thino","Set your user name here. 'Memos 😏' By default":"Set your user name here. 'Thino 😏' By default","Insert after heading":"Insert after heading","You should set the same heading below if you want to insert and process memos below the same heading.":"You should set the same heading below if you want to insert and process thino below the same heading.","Allows admonitions to be created using ":"Allows admonitions to be created using ","Process Memos below":"Process thino below","Only entries below this string/section in your notes will be processed. If it does not exist no notes will be processed for that file.":"Only entries below this string/section in your notes will be processed. If it does not exist no notes will be processed for that file.","Save Memo button label":"Save thino button label","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"The text shown on the save Thino button in the UI. 'NOTEIT' by default.","Focus on editor when open memos":"Focus on editor when open thino","Focus on editor when open memos. Focus by default.":"Focus on editor when open thino. Focus by default.","Open daily memos with open memos":"Open daily thino with open thino","Open daily memos with open memos. Open by default.":"Open daily thino with open thino. Open by default.","Open Memos when obsidian opens":"Open Thino when obsidian opens","When enable this, Memos will open when Obsidian opens. False by default.":"When enable this, Thino will open when Obsidian opens. False by default.","Hide done tasks in Memo list":"Hide done tasks in Thino list","Hide all done tasks in Memo list. Show done tasks by default.":"Hide all done tasks in Thino list. Show done tasks by default.","Advanced Options":"Advanced Options","UI language for date":"UI language for date","Translates the date UI language. Only 'en' and 'zh' are available.":"Translates the date UI language. Only 'en' and 'zh' are available.","Default prefix":"Default prefix","Set the default prefix when create memo, 'List' by default.":"Set the default prefix when create thino, 'List' by default.","Default insert date format":"Default insert date format","Set the default date format when insert date by @, 'Tasks' by default.":"Set the default date format when insert date by @, 'Tasks' by default.","Default editor position on mobile":"Default editor position on mobile","Set the default editor position on Mobile, 'Top' by default.":"Set the default editor position on Mobile, 'Top' by default.","Use button to show editor on mobile":"Use button to show editor on mobile","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Set a float button to call editor on mobile. Only when editor located at the bottom works.","Show Time When Copy Results":"Show Time When Copy Results","Show time when you copy results, like 12:00. Copy time by default.":"Show time when you copy results, like 12:00. Copy time by default.","Show Date When Copy Results":"Show Date When Copy Results","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"Show date when you copy results, like [[2022-01-01]]. Copy date by default.","Add Blank Line Between Different Date":"Add Blank Line Between Different Date","Add blank line when copy result with date. No blank line by default.":"Add blank line when copy result with date. No blank line by default.","Share Options":"Share Options","Share Memos Image Footer Start":"Share Thino Image Footer Start","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default","Share Memos Image Footer End":"Share Thino Image Footer End","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default","Save Shared Image To Folder For Mobile":"Save Shared Image To Folder For Mobile","Save image to folder for mobile. False by Default":"Save image to folder for mobile. False by Default","Say Thank You":"Say Thank You",Donate:"Donate","If you like this plugin, consider donating to support continued development:":"If you like this plugin, consider donating to support continued development:","File Name of Recycle Bin":"File Name of Recycle Bin","Set the filename for recycle bin. 'delete' By default":"Set the filename for recycle bin. 'delete' By default","File Name of Query File":"File Name of Query File","Set the filename for query file. 'query' By default":"Set the filename for query file. 'query' By default","Use Tags In Vault":"Use Tags In Vault","Use tags in vault rather than only in Memos. False by default.":"Use tags in vault rather than only in Thino. False by default.","Ready to convert image into background":"Ready to convert image into background",List:"List",Task:"Task",Top:"Top",Bottom:"Bottom",TAG:"TAG",DAY:"DAY",QUERY:"QUERY",EDIT:"EDIT",PIN:"PIN",UNPIN:"UNPIN",DELETE:"DELETE","CONFIRM":"CONFIRM","CREATE FILTER":"CREATE FILTER","Comment it...":"Comment it...",Settings:"Settings","Recycle bin":"Recycle bin","About Me":"About Me","Fetching data...":"Fetching data...","Here is No Memos.":"Here is No Thino.","Frequently Used Tags":"Frequently Used Tags","What do you think now...":"What do you think now...",READ:"READ",MARK:"MARK",SHARE:"SHARE",SOURCE:"SOURCE",RESTORE:"RESTORE",ARCHIVE:"Archive","DELETE AT":"DELETE AT","Noooop!":"Noooop!","All Data is Loaded 🎉":"All Data is Loaded 🎉","Quick filter":"Quick filter",TYPE:"TYPE",LINKED:"LINKED","NO TAGS":"NO TAGS","HAS LINKS":"HAS LINKS","HAS IMAGES":"HAS IMAGES",INCLUDE:"INCLUDE",EXCLUDE:"EXCLUDE",TEXT:"TEXT",IS:"IS",AND:"AND",OR:"OR",LIST:"LIST",ISNOT:"ISNOT",SELECT:"SELECT","ADD FILTER TERMS":"ADD FILTER TERMS",FILTER:"FILTER",Filter:"Filter",TITLE:"TITLE","CREATE QUERY":"CREATE QUERY","EDIT QUERY":"EDIT QUERY",MATCH:"MATCH",TIMES:"TIMES","Share Memo Image":"Share Thino Image","↗Click the button to save":"↗Click the button to save","Image is generating...":"Image is generating...","Image is loading...":"Image is loading...","Loading...":"Loading...","😟 Cannot load image, image link maybe broken":"😟 Cannot load image, image link maybe broken","Daily Memos":"Daily Thino","CANCEL EDIT":"CANCEL EDIT","LINK TO THE":"LINK TO THE","Mobile Options":"Mobile Options","Experimental Options":"Experimental Options","Don't support web image yet, please input image path in vault":"Don't support web image yet, please input image path in vault","Background Image in Dark Theme":"Background Image in Dark Theme","Background Image in Light Theme":"Background Image in Light Theme",'Set background image in dark theme. Set something like "Daily/one.png"':'Set background image in dark theme. Set something like "Daily/one.png"','Set background image in light theme. Set something like "Daily/one.png"':'Set background image in light theme. Set something like "Daily/one.png"','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Set default thino composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default',"Default Memo Composition":"[Deprecated] Default Thino Composition","Show Tasks Label":"Show Tasks Label","Show tasks label near the time text. False by default":"Show tasks label near the time text. False by default","Please Open Memos First":"Please Open Thino First",DATE:"DATE",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"BEFORE",AFTER:"AFTER","Allow Comments On Memos":"Allow Comments On Thino","You can comment on memos. False by default":"You can comment on thino. False by default",Import:"Import","TITLE CANNOT BE NULL!":"TITLE CANNOT BE NULL!","FILTER CANNOT BE NULL!":"FILTER CANNOT BE NULL!","Comments In Original DailyNotes/Notes":"Comments In Original DailyNotes/Notes","You should install Dataview Plugin ver 0.5.9 or later to use this feature.":"You should install Dataview Plugin ver 0.5.9 or later to use this feature.","Open Memos Successfully":"Open Thino Successfully","Fetch Memos Error":"😭 Fetch Error","Copied to clipboard Successfully":"Copied to clipboard Successfully","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin","Please finish the last filter setting first":"Please finish the last filter setting first","Close Memos Successfully":"Close Thino Successfully","Insert as Memo":"Insert as Thino","Insert file as memo content":"Insert file as thino content","Image load failed":"Image load failed","Content cannot be empty":"Content cannot be empty","Unable to create new file.":"Unable to create new file.","Failed to fetch deleted memos: ":"Failed to fetch deleted thino: ","RESTORE SUCCEED":"RESTORE SUCCEED","Save Memo button icon":"Save Thino button icon","The icon shown on the save Memo button in the UI.":"The icon shown on the save Thino button in the UI.","Fetch Memos From Particular Notes":"Fetch Thino From Particular Notes",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'You can set any Dataview Query for thino to fetch it. All thino in those notes will show on list. "#memo" by default',"Allow Memos to Fetch Memo from Notes":"Allow Thino to Fetch Thino from Notes","Use Memos to manage all memos in your notes, not only in daily notes. False by default":"Use Thino to manage all thino in your notes, not only in daily notes. False by default","Always Show Memo Comments":"Always Show Thino Comments","Always show memo comments on memos. False by default":"Always show thino comments on thino. False by default","You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.","Please check your daily note plugin OR periodic notes plugin settings":"Please check your daily note plugin OR periodic notes plugin settings","Use which plugin's default configuration":"Use which plugin's default configuration","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"Thino use the plugin's default configuration to fetch thino from daily, 'Daily' by default.",Daily:"Daily","Always Show Leaf Sidebar on PC":"Always Show Leaf Sidebar on PC","Show left sidebar on PC even when the leaf width is less than 875px. False by default.":"Show left sidebar on PC even when the leaf width is less than 875px. False by default.","You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.","fetch more":"fetch more","Search all settings":"Search all settings",General:"General",Theme:"Theme",Share:"Share",Advanced:"Advanced",Thino:"Thino","Random Review":"Random Review","ARCHIVED AT":"ARCHIVED AT","Failed to get memos from daily notes":"Failed to get thino from daily notes","Failed to delete memo":"Failed to delete thino","CTRL + ENTER to save":"CTRL + ENTER to save","Started from":"Started from","Custom Background Image":"Custom Background Image","Set custom background image.":"Set custom background image.","Custom Memo Footer":"Custom Thino Footer","Set custom memo footer.":"Set custom thino footer.","Heatmap Color Scheme":"Heatmap Color Scheme","Set different color scheme for heatmap.":"Set different color scheme for heatmap.","Enable Local Http Server":"Enable Local Http Server","Memos Http Server Port":"Thino Http Server Port","Set memos http server port to listen. '43999' by default":"Set thino http server port to listen. '43999' by default","Default Editor Mode":"Default Editor Mode","Live-Preview Mode OR Source Mode.":"Live-Preview Mode/Source Mode.","Save Location for Memos":"Save Location for Thino",DAILY:"DAILY",MULTI:"MULTI",CANVAS:"CANVAS",FILE:"FILE",TODO:"TODO",DONE:"DONE",JOURNAL:"JOURNAL",OTHER:"OTHER","Failed to create daily note, check if it exists.":"Failed to create daily note, check if it exists.","Failed to create daily note. Please check if you created a folder for daily notes.":"Failed to create daily note. Please check if you created a folder for daily notes.","After you verify your account, please refresh this page.":"After you verify your account, please refresh this page.",Verify:"Verify","Oops! You forget to verify insider account":"Oops! You forget to verify insider account","If you have any questions, please contact us.":"If you have any questions, please contact us.","Delete Thino Directly":"Delete Thino Directly","When delete thino directly, it will not be moved to trash. False by default.":"When delete thino directly, it will not be moved to trash. False by default.","Enable opening thino globally":"Enable opening thino globally","Enable opening thino globally. False by default.":"Enable opening thino globally. False by default.","Key for opening thino globally":"Key for opening thino globally","Set key for opening thino globally. CTRL + SHIFT + T by default.":"Set key for opening thino globally. CTRL + SHIFT + T by default.","Key for showing thino globally":"Key for showing thino globally","Set key for showing thino globally. CTRL + SHIFT + E by default.":"Set key for showing thino globally. CTRL + SHIFT + E by default.","Get activation code":"Get activation code","Input activation code here":"Input activation code here","Copy Thino id":"Copy Thino id","Activate Pro Version":"Activate Pro Version","Please copy Thino id first":"Please copy Thino id first",'You can set folder name with file name like "folder/file"':'You can set folder name with file name like "folder/file"','You can set folder name like "folder1/folder2/folder3" to create sub-folder':'You can set folder name like "folder1/folder2/folder3" to create sub-folder',"Default save location":"Default save location",'Set the default save location for thino. "DAILY" by default':'Set the default save location for thino. "DAILY" by default',"Sync Thino via PKMer":"Sync Thino via PKMer",Unlink:"Unlink",Link:"Link","Connect to PKMer Sync, you can check it in ":"Connect to PKMer Sync, you can check it in ","PKMer Sync":"PKMer Sync","Remove successfully":"Remove successfully",Deactivate:"Deactivate",Remove:"Remove","Confirm?":"Confirm?","Sync Status":"Sync Status","Start or stop sync":"Start or stop sync","Stop sync successfully":"Stop sync successfully","Start sync successfully":"Start sync successfully",Stop:"Stop",Start:"Start","Show thino near mouse":"Show thino near mouse","Query not found":"Query not found","Send to clipboard successfully":"Send to clipboard successfully","Thino - Failed to start HTTP server, please check the port is available.":"Thino - Failed to start HTTP server, please check the port is available.","Thino - Started HTTP server on port":"Thino - Started HTTP server on port","Thino - Terminated HTTP server":"Thino - Terminated HTTP server","File not exist":"File not exist","Thino not found":"Thino not found","File not found for the given thino path, is creating a new file":"File not found for the given thino path, is creating a new file","Saved sync token successfully":"Saved sync token successfully","Failed to find daily notes folder":"Failed to find daily notes folder","Please install obsidian-hover-editor plugin first":"Please install obsidian-hover-editor plugin first","Copied app id successfully":"Copied app id successfully","Please input token first":"Please input token first","Please enable sync first":"Please enable sync first","Init Failed":"Init Failed","Verify successfully":"Verify successfully","Failed to verify":"Failed to verify","Folder not found for the given thino path, is creating a new folder":"Folder not found for the given thino path, is creating a new folder","File not found for the given thino path":"File not found for the given thino path","Failed to read current daily note, check if it exists.":"Failed to read current daily note, check if it exists.","Failed to save":"Failed to save","Failed to login, please login again":"Failed to login, please login again","COPY FAILED":"COPY FAILED","COPY SUCCEED":"COPY SUCCEED",COPY:"COPY","This is a pro feature, please upgrade to pro version to use it.":"This is a pro feature, please upgrade to pro version to use it.","You can get pro version from: ":"You can get pro version from: ",Save:"Save",Cancel:"Cancel","Thino Daily Target":"Thino Daily Target",Input:"Input","#Tag":"#Tag","to create tag":"to create tag","You have verified your account. Congrats!":"You have verified your account. Congrats!","Pro Features":"Pro Features","Target Thino Count":"Target Thino Count",on:"on","Switch waterfall view":"Switch waterfall view","Switch view":"Switch view","Switch list view":"Switch list view","Set daily target":"Set daily target","Thino Save To: ":"Thino Save To: ","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",words:"words","Return To Home Page":"Return To Home Page","Open thino in center window":"Open thino in center window","Open thino in float window":"Open thino in float window","Open thino in right sidebar":"Open thino in right sidebar","Open thino in left sidebar":"Open thino in left sidebar","Show thino editor":"Show thino editor","Toggle minimal mode":"Toggle minimal mode","Focus on thino editor":"Focus on thino editor","ReSync web thinos to local":"ReSync web thinos to local","Sync local thinos to web":"Sync local thinos to web","Show daily thino view":"Show daily thino view","Focus on search bar":"Focus on search bar","Show-thino in popover(Hover editor)":"Show-thino in popover(Hover editor)","Center window":"Center window","Float window":"Float window","Right sidebar":"Right sidebar","Left sidebar":"Left sidebar","Save thino type when sync local":"Save thino type when sync local","Set the default save thino type when sync local, FILE by default.":"Set the default save thino type when sync local, FILE by default.","Sync service":"Sync service","Pro verification status":"Pro verification status","Live-preview":"Live-preview",Source:"Source","Global copy":"Global copy","Set the folder name":"Set the folder name","Set the filename":"Set the filename","Set the filename for current location file":"Set the filename for current location file","Switch calendar type":"Switch calendar type",alphabetical:"alphabetical",alphabeticalReverse:"alphabeticalReverse",byCount:"byCount",byCountReverse:"byCountReverse","Type here":"Type here",Today:"Today",Yesterday:"Yesterday","Last 7 days":"Last 7 days","Last 30 days":"Last 30 days","Last 90 days":"Last 90 days","Last 180 days":"Last 180 days","Last 365 days":"Last 365 days",Found:"Found","Copy filtered thinos to clipboard":"Copy filtered thinos to clipboard","If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.":"If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.",Preview:"Preview","Set and save":"Set and save","Show day mark on list mode":"Show day mark on list mode","Show day mark on the top of daily range thino. False by default.":"Show day mark on the top of daily range thino. False by default.","Click to expand or fold, Cmd+Click to show all thinos of the day":"Click to expand or fold, Cmd+Click to show all thinos of the day","You can buy a license from":"You can buy a license from","No thinos in range":"No thinos in range",Month:"Month",Week:"Week",Day:"Day",Agenda:"Agenda",Tomorrow:"Tomorrow",Previous:"Previous",Next:"Next","Search all columns...":"Search all columns...","Basic Info":"Basic Info","Additional Info":"Additional Info","Created At":"Created At",Content:"Content","Thino Type":"Thino Type","Source Type":"Source Type","Row status":"Row status",Path:"Path","Pinned Status":"Pinned Status",Table:"Table",Waterfall:"Waterfall",Calendar:"Calendar","Go to page":"Go to page",Page:"Page",Show:"Show",rows:"rows","Temp Filter":"Temp Filter","Allow navigation from view to Thino or Thino to view":"Allow navigation from view to Thino or Thino to view"},d8={},p8={},h8={welcome:"Bienvenue dans Mémo !",ribbonIconTitle:"Mémos",months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],weekDays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],weekDaysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],to:"à",year:null,month:null,"Basic Options":"Options basique","User name in Memos":"Username dans Mémos","Set your user name here. 'Memos 😏' By default":"Définissez votre username ici. Défaut : 'Memo 😏'","Insert after heading":"Insérer après le titre","You should set the same heading below if you want to insert and process memos below the same heading.":"Vous devez définir le même titre en-dessous si vous voulez insérer et traiter des mémos sous le même titre.","Allows admonitions to be created using ":"Permet de créer des admonitions en utilisant","Process Memos below":"Insérer Mémo sous","Only entries below this string/section in your notes will be processed. If it does not exist no notes will be processed for that file.":"Seulement les entrée sous cette section/phrase dans vos notes seront considérés. S'il n'existe pas, aucune notes ne sera traité pour ce fichier.","Save Memo button label":"Titre du bouton de sauvegarde","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"Le texte affiché sur le bouton de sauvegarde dans l'UI. Défaut : 'NOTEIT'","Focus on editor when open memos":"Focus sur l'éditeur lors de l'ouverture du mémo.","Focus on editor when open memos. Focus by default.":"Focus sur l'éditeur lors de l'ouverture du mémo. Focus par défaut.","Open daily memos with open memos":"Ouvrir les mémos quotidiens quand mémo est ouvert.","Open daily memos with open memos. Open by default.":"Ouvrir les mémos quotidiens quand mémo est ouvert.","Open Memos when obsidian opens":"Ouvrir Mémo quand Obsidian est ouvert.","When enable this, Memos will open when Obsidian opens. False by default.":"Quand activé, Memo sera ouvert quand Obsidian à l'ouverture d'Obsidian. Désactivé par défaut.","Hide done tasks in Memo list":"Masquer les tâches accomplies dans la liste des mémos.","Hide all done tasks in Memo list. Show done tasks by default.":"Masquer les tâches accomplies dans les mémos. Affiche les tâches accomplies par défaut.","Advanced Options":"Options avancées","UI language for date":"Langue de l'UI pour la date","Translates the date UI language. Only 'en' and 'zh' are available.":"Traduit la langue des dates dans l'UI. Seuls 'en', 'fr' et 'zh' sont disponibles. ","Default prefix":"Préfix par défaut.","Set the default prefix when create memo, 'List' by default.":"Définit le préfix par défaut lors de la création d'un mémo. Défault : 'Liste'","Default insert date format":"Format de la date insérée par défaut.","Default editor position on mobile":"Position par défaut de l'éditeur sur mobile.","Set the default date format when insert date by @, 'Tasks' by default.":"Définit le format de la date par défaut lors de l'insertion de la date par @. Défaut : 'Tâches'.","Set the default editor position on Mobile, 'Top' by default.":"Position par défaut de l'éditeur sur le mobile. Défaut : 'Haut'.","Use button to show editor on mobile":"Utilisation du bouton pour afficher l'éditeur sur le mobile.","Show Time When Copy Results":"Aficher l'heure quand les résultats sont copiés","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Place un bouton flottant pour appeler l'éditeur sur mobile. Fonctionne uniquement quand l'éditeur est placé en bas.","Show time when you copy results, like 12:00. Copy time by default.":"Affiche l'heure quand les résultats sont copiés, comme '12:00'. Copie l'heure par défaut","Show Date When Copy Results":"Affiche la date quand les résultats sont copiés","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"Affiche la date quand les résultats sont copiés, comme [[2022-01-01]]. Par défaut, copie la date.","Add Blank Line Between Different Date":"Ajoute une ligne entre les différentes dates.","Add blank line when copy result with date. No blank line by default.":"Ajoute une ligne lors de la copie du résultat avec la date. Pas de ligne par défaut.","Share Options":"Options de partage","Share Memos Image Footer Start":"Début du pied de page — Partage de mémo de mémos","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Définissez ce que vous voulez ici, utilisez {ThinoNum} pour afficher le nombre de thino, {UsedDay} pour les jours. Par défaut : '{ThinoNum} Thino {UsedDay} Days.","Share Memos Image Footer End":"Fin du pied de page — Partage de mémo","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Définissez ce que vous voulez ici. Utilisez {UserName} comme username. Par défaut : '✍️ By {UserName}'","Save Shared Image To Folder For Mobile":"Sauvegarde des images partagés dans un dossier sur mobile.","Save image to folder for mobile. False by Default":"Sauvegarder les images dans un dossier sur mobile. Désactivé par défaut.","Say Thank You":"Dites Merci",Donate:"Faire un don","If you like this plugin, consider donating to support continued development:":"Si vous aimez ce plugin, envisagez de faire un don pour soutenir le développement continu :","File Name of Recycle Bin":"Nom de la corbeille","Set the filename for recycle bin. 'delete' By default":"Définition du nom de la poubelle. Défaut : 'Delete'","Set the filename for query file. 'query' By default":"Définit le nom de fichier pour les requête. Défaut : 'Query'","Use Tags In Vault":"Utiliser des tags dans le Coffre","Use tags in vault rather than only in Memos. False by default.":"Utiliser des tags du coffre plutôt que ceux que seulement dans Mémo. Désactivé par défaut.","Ready to convert image into background":"Prêt pour convertir des image en arrière-plan.",List:"Liste",Task:"Tâche",Top:"Haut",Bottom:"Bas",TAG:"TAG",DAY:"JOUR",QUERY:"RECHERCHE",EDIT:"EDITER",PIN:"PIN",UNPIN:"ÉPINGLER",DELETE:"DESÉPINGLER","CONFIRM":"CONFIRMER ","CREATE FILTER":"CRÉER FILTRE",Settings:"Paramètres","Recycle bin":"Corbeille","About Me":"À propos de moi","Fetching data...":"Récupération des données...","Here is No Memos.":"Il n'y a pas de Memos.","Frequently Used Tags":"Tags fréquemment utilisés","What do you think now...":"Que pensez-vous maintenant...",READ:"LU",MARK:"MARQUER",SHARE:"PARTAGER",SOURCE:"SOURCE",RESTORE:"RESTAURER","DELETE AT":"SUPPRIMER","Noooop!":"Noooop!","All Data is Loaded 🎉":"Toutes les données sont chargées 🎉","Quick filter":"Filtre rapide",TYPE:"TYPE",LINKED:"LIEN","NO TAGS":"PAS DE TAGS","HAS LINKS":"A DES LIENS","HAS IMAGES":"A DES IMAGES",INCLUDE:"INCLUS",EXCLUDE:"EXCLUS",TEXT:"TEXTE",IS:"EST",ISNOT:"N'EST PAS",SELECT:"SELECTION","ADD FILTER TERMS":"AJOUTER DES TERMES FILTRÉ",FILTER:"FILTRE",TITLE:"TITRE","CREATE QUERY":"CRÉER UNE RECHERCHE","EDIT QUERY":"ÉDITER UNE RECHERCHE",MATCH:"MATCH",TIMES:"HEURE","Share Memo Image":"Partager un mémo image","↗Click the button to save":"↗Clique pour sauvegarder","Image is generating...":"Génération de l'image...","Image is loading...":"Image en chargement...","Loading...":"Chargement...","😟 Cannot load image, image link maybe broken":"😟 Impossible de charger l'image, le lien peut être brisé","Daily Memos":"Mémo quotidien","CANCEL EDIT":"ANNULER L'ÉDITION","LINK TO THE":"LIENS À","Mobile Options":"Options mobile","Don't support web image yet, please input image path in vault":"Ne supporte pas les images webs. Merci d'insérer le chemin de l'image depuis le coffre.","Background Image in Dark Theme":"Image de fond en thème sombre","Background Image in Light Theme":"Image de fond en thème clair",'Set background image in dark theme. Set something like "Daily/one.png"':"Définir l'image de fond en thème sombre. Définir 'Daily/one.png' par exemple.",'Set background image in light theme. Set something like "Daily/one.png"':"Définir l'image de fond en thème clair. Définir 'Daily/one.png' par exemple.",'Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Définir la composition par défaut du mémo, vous devez utiliser {TIME} comme "HH:mm" et {CONTENT} comme contenu. "{TIME} {CONTENT}" par défaut',"Default Memo Composition":"Composition par défaut du mémo","Show Tasks Label":"Afficher les étiquettes des tâches","Show tasks label near the time text. False by default":"Afficher les étiquettes des tâches à côté du texte horaire. Désactivé par défaut.","Please Open Memos First":"Merci d'ouvrir les mémos en premier"},m8={},g8={},v8={},y8={},w8={},b8={},D8={},S8={},E8={welcome:"Bem-vindo ao Thino!",ribbonIconTitle:"Thino",months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan.","Fev.","Mar.","Abr.","Maio","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."],weekDays:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],weekDaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],to:"para",year:null,month:null,"Basic Options":"Opções Básicas","User name in Memos":"Nome de Usuário no Thino","Set your user name here. 'Memos 😏' By default":"Defina o nome de usuário. Padrão: 'Thino 😏'.","Insert after heading":"Inserir após o cabeçalho","You should set the same heading below if you want to insert and process memos below the same heading.":"Deve definir o mesmo cabeçalho na configuração posterior se pretende inserir e processar memorandos abaixo do cabeçalho aqui definido.","Allows admonitions to be created using ":"Permitir que Admonitions sejam criadas usando ","Process Memos below":"Processar Memorandos abaixo do Cabeçalho","Only entries below this string/section in your notes will be processed. If it does not exist no notes will be processed for that file.":"Somente as entradas abaixo deste cabeçalho serão processadas nas suas notas. Se não configurar esta funcionalidade, nenhuma nota será processada para o ficheiro respetivo.","Save Memo button label":"Legenda do Botão de Guardar Memorandos","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":'Define o texto apresentado na UI do botão guardar memorandos. Padrão: "NOTEIT".',"Focus on editor when open memos":"Focar no Editor ao iniciar o Thino","Focus on Editor when open memos. Focus by default.":'Focar no editor ao iniciar o Thino. Padrão: "Focar".',"Open daily memos with open memos":"Abrir memorandos diários ao iniciar o Thino","Open daily memos with open memos. Open by default.":'Abrir memorandos diários ao iniciar o Thino. Padrão: "Abrir".',"Open Memos when obsidian opens":"Abrir Thino quando o Obsidian inicia","When enable this, Memos will open when Obsidian opens. False by default.":'Quando esta opção está activa, o Memos abrirá quando o Obsidian inicia. Padrão: "Falso".',"Hide done tasks in Memo list":"Ocultar tarefas concluídas na lista de memorandos","Hide all done tasks in Memo list. Show done tasks by default.":'Ocultar todas as tarefas concluídas na lista de memorandos. Padrão: "Mostrar tarefas concluídas".',"Advanced Options":"Opções Avançadas","UI language for date":"Idioma na UI da Data ","Translates the date UI language. Only 'en' and 'zh' are available.":"Define o idioma na UI da Data. De momento, apenas 'en', 'fr', 'pt' e 'zh' estão disponíveis.","Default prefix":"Prefixo Padrão","Set the default prefix when create memo, 'List' by default.":"Define o prefixo padrão quando um memorando é criado. Padrão: 'Lista'.","Default insert date format":"Formato Padrão para Inserção de Data","Set the default date format when insert date by @, 'Tasks' by default.":"Define o formato de Data padrão ao inserir a data usando '@'. Padrão: 'Tarefas'.","Default editor position on mobile":"Posição Padrão do Editor de Memorandos na Versão Móvel","Set the default editor position on Mobile, 'Top' by default.":"Define a posição padrão do editor de memorandos na versão móvel. Padrão: 'Topo'.","Use button to show editor on mobile":"Usar Botão para Mostrar o Editor na Versão Móvel","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Define um botão flutuante para abrir o editor na versão móvel. Opção disponível somente quando a posição do editor está definida para 'Fundo'.","Show Time When Copy Results":"Mostrar a Hora ao Copiar os Resultados","Show time when you copy results, like 12:00. Copy time by default.":"Mostrar a Hora, no formato '12:00', ao copiar os resultados. Padrão: 'Copiar a hora'.","Show Date When Copy Results":"Mostrar a Data ao Copiar os Resultados","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":'Mostrar a Data, no formato [[2022-01-01]], ao copiar os resultados. Padrão: "Copiar a hora".',"Add Blank Line Between Different Date":"Adicionar Linha em Branco entre Datas Diferentes.","Add blank line when copy result with date. No blank line by default.":'Adicionar linha em branco ao copiar resultados com Data. Padrão: "Não adicionar linha."',"Share Options":"Opções de Partilha","Share Memos Image Footer Start":"Partilhar a Imagem de um memorando - Início do Rodapé","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Defina como preferir, use {ThinoNum} para mostrar o número de thinorandos e use {UsedDay} para dias. 'Padrão: {ThinoNum} Thinorandos {UsedDay} Dias'.","Share Memos Image Footer End":"Partilhar a Imagem de um memorando - Fim do Rodapé","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Defina como preferir, use {UserName} como o seu nome de usuário. Padrão: '✍️ Por {UserName}'.","Save Shared Image To Folder For Mobile":"Guardar a Imagem Partilhada para Pasta na Versão Móvel","Save image to folder for mobile. False by Default":'Guardar a imagem partilhada para pasta na versão móvel. Padrão: "Falso".',"Say Thank You":"Agradeça",Donate:"Doar","If you like this plugin, consider donating to support continued development:":"Se gosta deste plugin, considere doar para apoiar o seu desenvolvimento contínuo:","File Name of Recycle Bin":"Nome da Reciclagem","Set the filename for recycle bin. 'delete' By default":"Define o nome do ficheiro para a Reciclagem. Padrão: 'delete'.","File Name of Query File":"Nome do Ficheiro de Query","Set the filename for query file. 'query' By default":"Define o nome do ficheiro de Query. Padrão: 'Query'.","Use Tags In Vault":"Usar Tags no Vault","Use tags in vault rather than only in Memos. False by default.":'Usar as Tags do Vault e não somente dos memorandos. Padrão: "Falso".',"Ready to convert image into background":"Pronto para converter imagem em fundo",List:"Lista",Task:"Tarefa",Top:"Topo",Bottom:"Fundo",TAG:"TAG",DAY:"DIA",QUERY:"QUERY",EDIT:"EDITAR",PIN:"FIXAR",UNPIN:"DESAFIXAR",DELETE:"ELIMINAR","CONFIRM":"CONFIRMAR","CREATE FILTER":"CRIAR FILTRO",Settings:"Definições","Recycle bin":"Reciclagem","About Me":"Acerca de mim","Fetching data...":"A obter dados...","Here is No Memos.":"Não existem Thino.","Frequently Used Tags":"Tags Usadas Frequentemente","What do you think now...":"Em que está a pensar...",READ:"LER",MARK:"ASSINALAR",SHARE:"PARTILHAR",SOURCE:"ORIGEM",RESTORE:"RESTAURAR","DELETE AT":"ELIMINADO EM","Noooop!":"Noooop!","All Data is Loaded 🎉":"Todos os Dados foram Carregados 🎉","Quick filter":"Filtro rápido",TYPE:"TIPO",LINKED:"LINKED","NO TAGS":"SEM TAGS","HAS LINKS":"TEM LINKS","HAS IMAGES":"TEM IMAGENS",INCLUDE:"INCLUIR",EXCLUDE:"EXCLUIR",TEXT:"TEXTO",IS:"É",ISNOT:"NÃO É",SELECT:"SELECCIONAR","ADD FILTER TERMS":"ADICIONAR TERMOS DE FILTRAGEM",FILTER:"FILTRAR",TITLE:"TÍTULO","CREATE QUERY":"CRIAR QUERY","EDIT QUERY":"EDITAR QUERY",MATCH:"IGUALA",TIMES:"VEZES","Share Memo Image":"Partilhar Imagem de Memo","↗Click the button to save":"↗Clique no botão para guardar","Image is generating...":"A gerar Imagem..","Image is loading...":"A carregar Imagem...","Loading...":"Carregando...","😟 Cannot load image, image link maybe broken":"😟 Não é possível carregar a imagem, o link da imagem pode estar incorrecto","Daily Memos":"Thino Diários","CANCEL EDIT":"CANCELAR EDIÇÃO","LINK TO THE":"LINK PARA O","Mobile Options":"Opções Móveis","Don't support web image yet, please input image path in vault":"Ainda não existe suporte para imagens de web. Por favor, insira o link para uma imagem do vault","Experimental Options":"Opções Experimentais","Background Image in Dark Theme":"Imagem de Fundo no Tema Escuro","Background Image in Light Theme":"Imagem de Fundo no Tema Claro",'Set background image in dark theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema escuro. Defina da seguinte forma: "Daily/one.png".','Set background image in light theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema claro. Defina da seguinte forma: "Daily/one.png".','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Defina a composição padrão do memorando, deve usar {TIME} como "HH:mm" e {CONTENT} como conteúdo. Padrão: "{TIME} {CONTENT}".',"Default Memo Composition":"Composição Padrão de um Memorando","Show Tasks Label":"Mostrar Etiquetas de Tarefas","Show tasks label near the time text. False by default":'Mostrar etiquetas de tarefas próximas do texto de tempo. Padrão: "Falso".',"Please Open Memos First":"Por favor, abra o Thino primeiro",DATE:"DATA",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"ANTES",AFTER:"DEPOIS","Allow Comments On Memos":"Permitir Comentários nos Memorandos","You can comment on memos. False by default":'Permite que comente os memorandos. Padrão: "Falso".',Import:"Importar","TITLE CANNOT BE NULL!":"O TÍTULO NÃO PODE SER NULO!","FILTER CANNOT BE NULL!":"O FILTRO NÃO PODE SER NULO!","Comments In Original DailyNotes/Notes":"Comentários nas Notas/Notas Diárias Originais","You should install Dataview Plug-in ver 0.5.9 or later to use this feature.":"Deve instalar a versão 0.5.9 ou posterior do plugin Dataview para usar esta funcionalidade.","Open Memos Successfully":"Thino Iniciado com Sucesso","Fetch Memos Error":"😭 Erro de Fetch","Copied to clipboard Successfully":"Copiado para a área de transferência com sucesso","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Verifique se abriu o plugin de Notas Diárias ou de Notas Periódicas","Please finish the last filter setting first":"Por favor, termine primeiro a configuração do último filtro","Close Memos Successfully":"Thino Fechado com Sucesso","Insert as Memo":"Inserir como um Memorando","Insert file as memo content":"Inserir ficheiro como conteúdo de um memorando","Image load failed":"Falha no carregamento da imagem","Content cannot be empty":"O Conteúdo não pode estar vazio","Unable to create new file.":"Não foi possível criar um novo ficheiro.","Failed to fetch deleted memos: ":"Falha no fetch dos memorandos removidos: ","RESTORE SUCCEED":"RESTAURO BEM SUCEDIDO","Save Memo button icon":"Ícone do Botão para Guardar Memorandos","The icon shown on the save Memo button in the UI.":"O ícone exibido na UI do botão para guardar memorandos.","Fetch Memos From Particular Notes":"Obter Memorandos de Notas Específicas",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'Pode definir qualquer Query de Dataview para o Memos procurar. Todos os memorandos nessas notas serão mostrados na lista. Padrão: "#memo".',"Allow Memos to Fetch Memo from Notes":"Permitir que o Thino Obtenha memorandos das Notas","Use Memos to manage all memos in your notes, not only in daily notes. False by default":'Use o Memos para gerir todos os memorandos nas suas notas e não apenas nas notas diárias. Padrão: "Falso".',"Always Show Memo Comments":"Mostrar Comentários dos Memorandos","Always show memo comments on memos. False by default":'Mostrar sempre os comentários dos memorandos. Padrão: "Falso".',"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"Não definiu a pasta para as notas diárias, quer no plugin the Notas Periódicas ou de Notas Diárias.","Please check your daily note plugin OR periodic notes plugin settings":"Por favor, verifique as configurações dos plugins de Notas Diárias OU de Notas Periódicas","Use Which Plugin's Default Configuration":"Usar a Configuração Padrão do Plugin","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"O Memos usa a configuração padrão do plugin seleccionado para obter memorandos diariamente. Padrão: 'Notas Diárias'.",Daily:"Diário"},T8={welcome:"Bem-vindo ao Memos!",ribbonIconTitle:"Thino",months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan.","Fev.","Mar.","Abr.","Maio","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."],weekDays:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],weekDaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],to:"para",year:null,month:null,"Basic Options":"Opções Básicas","User name in Memos":"Nome de Usuário no Thino","Set your user name here. 'Memos 😏' By default":"Defina o nome de usuário. Padrão: 'Thino 😏'.","Insert after heading":"Inserir após o cabeçalho","You should set the same heading below if you want to insert and process memos below the same heading.":"Deve definir o mesmo cabeçalho na configuração posterior se pretende inserir e processar memorandos abaixo do cabeçalho aqui definido.","Allows admonitions to be created using ":"Permitir que Admonitions sejam criadas usando ","Process Memos below":"Processar Memorandos abaixo do Cabeçalho","Only entries below this string/section in your notes will be processed. If it does not exist no notes will be processed for that file.":"Somente as entradas abaixo deste cabeçalho serão processadas nas suas notas. Se não configurar esta funcionalidade, nenhuma nota será processada para o ficheiro respetivo.","Save Memo button label":"Legenda do Botão de Guardar Memorandos","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":'Define o texto apresentado na UI do botão guardar memorandos. Padrão: "NOTEIT".',"Focus on editor when open memos":"Focar no Editor ao iniciar o Thino","Focus on Editor when open memos. Focus by default.":'Focar no editor ao iniciar o Thino. Padrão: "Focar".',"Open daily memos with open memos":"Abrir memorandos diários ao iniciar o Thino","Open daily memos with open memos. Open by default.":'Abrir memorandos diários ao iniciar o Thino. Padrão: "Abrir".',"Open Memos when obsidian opens":"Abrir Thino quando o Obsidian inicia","When enable this, Memos will open when Obsidian opens. False by default.":'Quando esta opção está activa, o Memos abrirá quando o Obsidian inicia. Padrão: "Falso".',"Hide done tasks in Memo list":"Ocultar tarefas concluídas na lista de memorandos","Hide all done tasks in Memo list. Show done tasks by default.":'Ocultar todas as tarefas concluídas na lista de memorandos. Padrão: "Mostrar tarefas concluídas".',"Advanced Options":"Opções Avançadas","UI language for date":"Idioma na UI da Data ","Translates the date UI language. Only 'en' and 'zh' are available.":"Define o idioma na UI da Data. De momento, apenas 'en', 'fr', 'pt' e 'zh' estão disponíveis.","Default prefix":"Prefixo Padrão","Set the default prefix when create memo, 'List' by default.":"Define o prefixo padrão quando um memorando é criado. Padrão: 'Lista'.","Default insert date format":"Formato Padrão para Inserção de Data","Set the default date format when insert date by @, 'Tasks' by default.":"Define o formato de Data padrão ao inserir a data usando '@'. Padrão: 'Tarefas'.","Default editor position on mobile":"Posição Padrão do Editor de Memorandos na Versão Móvel","Set the default editor position on Mobile, 'Top' by default.":"Define a posição padrão do editor de memorandos na versão móvel. Padrão: 'Topo'.","Use button to show editor on mobile":"Usar Botão para Mostrar o Editor na Versão Móvel","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Define um botão flutuante para abrir o editor na versão móvel. Opção disponível somente quando a posição do editor está definida para 'Fundo'.","Show Time When Copy Results":"Mostrar a Hora ao Copiar os Resultados","Show time when you copy results, like 12:00. Copy time by default.":"Mostrar a Hora, no formato '12:00', ao copiar os resultados. Padrão: 'Copiar a hora'.","Show Date When Copy Results":"Mostrar a Data ao Copiar os Resultados","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":'Mostrar a Data, no formato [[2022-01-01]], ao copiar os resultados. Padrão: "Copiar a hora".',"Add Blank Line Between Different Date":"Adicionar Linha em Branco entre Datas Diferentes.","Add blank line when copy result with date. No blank line by default.":'Adicionar linha em branco ao copiar resultados com Data. Padrão: "Não adicionar linha."',"Share Options":"Opções de Partilha","Share Memos Image Footer Start":"Partilhar a Imagem de um memorando - Início do Rodapé","Set anything you want here, use {ThinoNum} to display Number of memos, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Defina como preferir, use {ThinoNum} para mostrar o número de thinorandos e use {UsedDay} para dias. 'Padrão: {ThinoNum} Thinorandos {UsedDay} Dias'.","Share Memos Image Footer End":"Partilhar a Imagem de um memorando - Fim do Rodapé","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Defina como preferir, use {UserName} como o seu nome de usuário. Padrão: '✍️ Por {UserName}'.","Save Shared Image To Folder For Mobile":"Guardar a Imagem Partilhada para Pasta na Versão Móvel","Save image to folder for mobile. False by Default":'Guardar a imagem partilhada para pasta na versão móvel. Padrão: "Falso".',"Say Thank You":"Agradeça",Donate:"Doar","If you like this plugin, consider donating to support continued development:":"Se gosta deste plugin, considere doar para apoiar o seu desenvolvimento contínuo:","File Name of Recycle Bin":"Nome da Reciclagem","Set the filename for recycle bin. 'delete' By default":"Define o nome do ficheiro para a Reciclagem. Padrão: 'delete'.","File Name of Query File":"Nome do Ficheiro de Query","Set the filename for query file. 'query' By default":"Define o nome do ficheiro de Query. Padrão: 'Query'.","Use Tags In Vault":"Usar Tags no Vault","Use tags in vault rather than only in Memos. False by default.":'Usar as Tags do Vault e não somente dos memorandos. Padrão: "Falso".',"Ready to convert image into background":"Pronto para converter imagem em fundo",List:"Lista",Task:"Tarefa",Top:"Topo",Bottom:"Fundo",TAG:"TAG",DAY:"DIA",QUERY:"QUERY",EDIT:"EDITAR",PIN:"FIXAR",UNPIN:"DESAFIXAR",DELETE:"ELIMINAR","CONFIRM":"CONFIRMAR","CREATE FILTER":"CRIAR FILTRO",Settings:"Definições","Recycle bin":"Reciclagem","About Me":"Acerca de mim","Fetching data...":"A obter dados...","Here is No Memos.":"Não existem Thino.","Frequently Used Tags":"Tags Usadas Frequentemente","What do you think now...":"Em que está a pensar...",READ:"LER",MARK:"ASSINALAR",SHARE:"PARTILHAR",SOURCE:"ORIGEM",RESTORE:"RESTAURAR","DELETE AT":"ELIMINADO EM","Noooop!":"Noooop!","All Data is Loaded 🎉":"Todos os Dados foram Carregados 🎉","Quick filter":"Filtro rápido",TYPE:"TIPO",LINKED:"LINKED","NO TAGS":"SEM TAGS","HAS LINKS":"TEM LINKS","HAS IMAGES":"TEM IMAGENS",INCLUDE:"INCLUIR",EXCLUDE:"EXCLUIR",TEXT:"TEXTO",IS:"É",ISNOT:"NÃO É",SELECT:"SELECCIONAR","ADD FILTER TERMS":"ADICIONAR TERMOS DE FILTRAGEM",FILTER:"FILTRAR",TITLE:"TÍTULO","CREATE QUERY":"CRIAR QUERY","EDIT QUERY":"EDITAR QUERY",MATCH:"IGUALA",TIMES:"VEZES","Share Memo Image":"Partilhar Imagem de Memo","↗Click the button to save":"↗Clique no botão para guardar","Image is generating...":"A gerar Imagem..","Image is loading...":"A carregar Imagem...","Loading...":"Carregando...","😟 Cannot load image, image link maybe broken":"😟 Não é possível carregar a imagem, o link da imagem pode estar incorrecto","Daily Memos":"Thino Diários","CANCEL EDIT":"CANCELAR EDIÇÃO","LINK TO THE":"LINK PARA O","Mobile Options":"Opções Móveis","Don't support web image yet, please input image path in vault":"Ainda não existe suporte para imagens de web. Por favor, insira o link para uma imagem do vault","Experimental Options":"Opções Experimentais","Background Image in Dark Theme":"Imagem de Fundo no Tema Escuro","Background Image in Light Theme":"Imagem de Fundo no Tema Claro",'Set background image in dark theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema escuro. Defina da seguinte forma: "Daily/one.png".','Set background image in light theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema claro. Defina da seguinte forma: "Daily/one.png".','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Defina a composição padrão do memorando, deve usar {TIME} como "HH:mm" e {CONTENT} como conteúdo. Padrão: "{TIME} {CONTENT}".',"Default Memo Composition":"Composição Padrão de um Memorando","Show Tasks Label":"Mostrar Etiquetas de Tarefas","Show tasks label near the time text. False by default":'Mostrar etiquetas de tarefas próximas do texto de tempo. Padrão: "Falso".',"Please Open Memos First":"Por favor, abra o Thino primeiro",DATE:"DATA",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"ANTES",AFTER:"DEPOIS","Allow Comments On Memos":"Permitir Comentários nos Memorandos","You can comment on memos. False by default":'Permite que comente os memorandos. Padrão: "Falso".',Import:"Importar","TITLE CANNOT BE NULL!":"O TÍTULO NÃO PODE SER NULO!","FILTER CANNOT BE NULL!":"O FILTRO NÃO PODE SER NULO!","Comments In Original DailyNotes/Notes":"Comentários nas Notas/Notas Diárias Originais","You should install Dataview Plug-in ver 0.5.9 or later to use this feature.":"Deve instalar a versão 0.5.9 ou posterior do plugin Dataview para usar esta funcionalidade.","Open Memos Successfully":"Thino Iniciado com Sucesso","Fetch Memos Error":"😭 Erro de Fetch","Copied to clipboard Successfully":"Copiado para a área de transferência com sucesso","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Verifique se abriu o plugin de Notas Diárias ou de Notas Periódicas","Please finish the last filter setting first":"Por favor, termine primeiro a configuração do último filtro","Close Memos Successfully":"Thino Fechado com Sucesso","Insert as Memo":"Inserir como um Memorando","Insert file as memo content":"Inserir ficheiro como conteúdo de um memorando","Image load failed":"Falha no carregamento da imagem","Content cannot be empty":"O Conteúdo não pode estar vazio","Unable to create new file.":"Não foi possível criar um novo ficheiro.","Failed to fetch deleted memos: ":"Falha no fetch dos memorandos removidos: ","RESTORE SUCCEED":"RESTAURO BEM SUCEDIDO","Save Memo button icon":"Ícone do Botão para Guardar Memorandos","The icon shown on the save Memo button in the UI.":"O ícone exibido na UI do botão para guardar memorandos.","Fetch Memos From Particular Notes":"Obter Memorandos de Notas Específicas",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'Pode definir qualquer Query de Dataview para o Memos procurar. Todos os memorandos nessas notas serão mostrados na lista. Padrão: "#memo".',"Allow Memos to Fetch Memo from Notes":"Permitir que o Thino Obtenha memorandos das Notas","Use Memos to manage all memos in your notes, not only in daily notes. False by default":'Use o Memos para gerir todos os memorandos nas suas notas e não apenas nas notas diárias. Padrão: "Falso".',"Always Show Memo Comments":"Mostrar Comentários dos Memorandos","Always show memo comments on memos. False by default":'Mostrar sempre os comentários dos memorandos. Padrão: "Falso".',"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"Não definiu a pasta para as notas diárias, quer no plugin the Notas Periódicas ou de Notas Diárias.","Please check your daily note plugin OR periodic notes plugin settings":"Por favor, verifique as configurações dos plugins de Notas Diárias OU de Notas Periódicas","Use Which Plugin's Default Configuration":"Usar a Configuração Padrão do Plugin","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"O Memos usa a configuração padrão do plugin seleccionado para obter memorandos diariamente. Padrão: 'Notas Diárias'.",Daily:"Diário"},C8={},x8={},M8={},k8={welcome:"欢迎使用 Thino ",ribbonIconTitle:"Thino",months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:[null,null,null,null,null,null,null,null,null,null,null,null],weekDays:["周日","周一","周二","周三","周四","周五","周六"],weekDaysShort:["周日","周一","周二","周三","周四","周五","周六"],to:"至",year:"年",month:"月","Basic Options":"基础选项","User name in Memos":"在 Thino 中显示的用户名","Set your user name here. 'Memos 😏' By default":"在这里设置你喜欢的用户名。 默认为 'Thino 😏'","Insert after heading":"在指定标题后插入 Thino","You should set the same heading below if you want to insert and process memos below the same heading.":"你如果想要插入标题的同时显示对应标题下的 Memo你必须保证当前设置与下方的解析设置是一致的。当为空时插入到文末","Process Memos below":"解析指定标题后的 Thino","Only entries below this string/section in your notes will be processed. If it does not exist no notes will be processed for that file.":"只有在设置的标题后的 Memo 才会被解析。当为空时解析全文的 Memo","Save Memo button label":"保存按钮上的文本","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"在保存按钮上展示的文本。默认为 'NOTEIT'","Focus on editor when open memos":"自动聚焦到 Thino 输入框","Focus on editor when open memos. Focus by default.":"当打开 Thino 的时候自动聚焦到 Thino 输入框。默认开启","Open daily memos with open memos":"打开每日 Thino 的时候打开 Thino 界面","Open daily memos with open memos. Open by default.":"打开每日 Thino 的时候打开 Thino 界面。默认开启","Open Memos when obsidian opens":"当开启 Obsidian 的时候自动打开 Thino","When enable this, Memos will open when Obsidian opens. False by default.":"当开启该选项, Thino 会在 Obsidian 打开时自动打开。默认不开启。","Hide done tasks in Memo list":"在 Thino 列表中隐藏已完成 Thino","Hide all done tasks in Memo list. Show done tasks by default.":"在 Thino 列表中隐藏已完成 Thino。默认不开启","Advanced Options":"进阶选项","UI language for date":"针对日期展示的语言界面","Translates the date UI language. Only 'en' and 'zh' are available.":"对日期的不同翻译。目前只能选择 'en' 和 'zh'(未来会废置)","Default prefix":"默认前缀","Set the default prefix when create memo, 'List' by default.":"设置默认的前缀样式。默认为列表","Default insert date format":"插入日期附带的样式","Set the default date format when insert date by @, 'Tasks' by default.":"当使用 @ 来快速插入日期时,插入日期附带的样式,默认为 'Tasks' 样式","Default editor position on mobile":"在移动端上的默认编辑器位置","Set the default editor position on Mobile, 'Top' by default.":"设置在移动端上的默认编辑器位置,默认在顶部。","Use button to show editor on mobile":"当编辑器位置在底部时,用按钮来唤出编辑器","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"设置一个浮动按钮来唤出编辑器。当在移动端上启用该选项才会生效","Show Time When Copy Results":"当复制检索结果时附带时间","Show time when you copy results, like 12:00. Copy time by default.":"在复制检索结果时附带其时间,例如 12:00 。默认开启","Show Date When Copy Results":"当复制检索结果时附带日期","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"在复制检索结果时附带其日期,例如 [[2022-01-01]]。默认开启","Add Blank Line Between Different Date":"在复制日期的时候加上空行","Add blank line when copy result with date. No blank line by default.":"在复制日期的时候在相邻的日期之间加上空行。默认无空行","Share Options":"分享选项","Share Memos Image Footer Start":"分享 Thino 图片的左边页脚","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"你可以在这里设置你想要的任意文本,用 {ThinoNum} 来展示你记录的 thino 数量,{UsedDay} 来展示使用日期。默认为'{ThinoNum} Thino {UsedDay} Days'","Share Memos Image Footer End":"分享 Thino 图片的右边页脚","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"你可以在这里设置你想要的任意文本,用 {UserName} 来展示你的用户名。默认为 '✍️ By {UserName}'","Save Shared Image To Folder For Mobile":"当在移动端上时保存图片到文件夹","Save image to folder for mobile. False by Default":"当在移动端上时,保存生成的图片到文件夹","Say Thank You":"感谢开发",Donate:"捐赠","If you like this plugin, consider donating to support continued development:":"如果你喜欢这个插件,而且也希望给我买鸡腿,那么可以考虑 Github 页面右边的 Sponsor~","File Name of Recycle Bin":"回收站的文件名","Set the filename for recycle bin. 'delete' By default":"给回收站设置一个文件名。默认为'delete'","File Name of Query File":"检索文件的文件名","Set the filename for query file. 'query' By default":"设置存放检索式的文件的文件名。默认为'query'","Use Tags In Vault":"使用在库内的所有标签","Use tags in vault rather than only in Memos. False by default.":"使用在库内的而不是 Thino 内的标签。默认关闭","Don't support web image yet, please input image path in vault":"暂不支持网络图片,请使用本地图片","Ready to convert image into background":"正在将图片转换为背景图",List:"列表",Task:"任务",Top:"顶部",Bottom:"底部",TAG:"标签",DAY:"天",QUERY:"检索式",EDIT:"编辑",PIN:"置顶",UNPIN:"取消置顶",DELETE:"删除","CONFIRM":"确定删除","CREATE FILTER":"创建检索式",Filter:"筛选",Settings:"设置","Recycle bin":"回收站","About Me":"关于","Fetching data...":"获取数据中...","Here is No Memos.":"没有找到 Thino","Frequently Used Tags":"常用标签","What do you think now...":"你现在在想什么?",READ:"阅读",MARK:"引用",SHARE:"分享",SOURCE:"来源",RESTORE:"恢复",ARCHIVE:"归档","DELETE AT":"删除于","Noooop!":"啥都没有!","All Data is Loaded 🎉":"所有数据都加载好啦 🎉","Quick filter":"快速筛选",TYPE:"类型",LINKED:"有链接","NO TAGS":"无标签","HAS LINKS":"有超链接","HAS IMAGES":"有图片",INCLUDE:"包括",EXCLUDE:"排除",TEXT:"文本",IS:"是",AND:"和",OR:"或",LIST:"状态",ISNOT:"不是",SELECT:"选择","ADD FILTER TERMS":"添加检索条件",FILTER:"筛选器",TITLE:"标题","CREATE QUERY":"创建检索式","EDIT QUERY":"编辑检索式",MATCH:"匹配",TIMES:"次","Share Memo Image":"分享 Thino 图片","↗Click the button to save":"↗点击右上角的按钮来保存","Image is generating...":"图片正在生成中...","Image is loading...":"图片正在加载中...","😟 Cannot load image, image link maybe broken":"😟 无法加载图片,图片链接也许不存在","Loading...":"努力加载中...","Daily Memos":"每日 Thino","CANCEL EDIT":"取消编辑","LINK TO THE":"链接到","Mobile Options":"移动端选项","Experimental Options":"实验性选项","Background Image in Dark Theme":"深色主题的背景图","Background Image in Light Theme":"浅色主题的背景图",'Set background image in dark theme. Set something like "Daily/one.png"':'设置深色主题的背景图。请设置类似"Daily/one.png"的路径','Set background image in light theme. Set something like "Daily/one.png"':'设置浅色主题的背景图。请设置类似"Daily/one.png"的路径','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'设置默认 Thino 组成,你必须要使用 {TIME} 作为 "HH:mm" 而且要设置 {CONTENT} 作为内容识别。默认情况下, Thino 基于 "{TIME} {CONTENT}" 识别',"Default Memo Composition":"【已弃置】默认 Thino 组成","Show Tasks Label":"展示任务标签","Show tasks label near the time text. False by default":"在 Thino 的时间旁展示任务标签。默认情况下不展示","Please Open Memos First":"请先打开 Thino","Comment it...":"评论...",DATE:"日期",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"Obsidian Natrual DATES language 插件没启动",BEFORE:"在之前",AFTER:"在之后","Allow Comments On Memos":"允许在 Thino 上评论","You can comment on memos. False by default":"你可以在 Thino 点击图标进行评论了。默认不开启",Import:"导入","TITLE CANNOT BE NULL!":"标题不可以为空!","FILTER CANNOT BE NULL!":"筛选器不可以为空!","Comments In Original DailyNotes/Notes":"在原文件中进行评论","You should install Dataview Plugin ver 0.5.9 or later to use this feature.":"你需要安装 0.5.9 版本以上的 Dataview 插件来使用该功能","Open Memos Successfully":"成功打开 Thino ","Fetch Memos Error":"😭 Thino 获取失败","Copied to clipboard Successfully":"复制成功","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"请检查你有没有开启日记插件或者 Periodic Notes 插件且启用了日记模式","Please finish the last filter setting first":"先完善上一个过滤器吧","Close Memos Successfully":"成功关闭 Thino ","Insert as Memo":"插入内容为 Thino","Insert file as memo content":"插入文件为 Thino","Image load failed":"有个图片加载失败了😟","Content cannot be empty":"内容不能为空呀","Unable to create new file.":"无法新建文件","Failed to fetch deleted memos: ":"无法获取已删除的 Thino ","RESTORE SUCCEED":"成功恢复 Thino","Save Memo button icon":"保存按钮上的图标","The icon shown on the save Memo button in the UI.":"你可以设置保存按钮上的图标","Fetch Memos From Particular Notes":"从指定的文件中获取 Thino",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'你可以给笔记设置指定检索式来让 Memos 可以索引到它。默认为 "#memo" ',"Allow Memos to Fetch Memo from Notes":"允许 Thino 从笔记中获取 Thino","Use Memos to manage all memos in your notes, not only in daily notes. False by default":"使用 Memos 来管理你笔记中的 Memos不单只 DailyNotes 中的内容。默认为关闭","Always Show Memo Comments":"评论将总是可见","Always show memo comments on memos. False by default":"当开启后评论总是会在 Thino 的下方展示。默认为关闭","You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"你在 Periodic Notes 插件和日记插件都没设置日记的所在文件夹","Please check your daily note plugin OR periodic notes plugin settings":"请检查你的日记插件和/或 Periodic Notes 插件的设置","Use which plugin's default configuration":"使用哪个插件的默认日记配置","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"Thino 采用指定插件的默认配置来获取 Thino。默认为日记插件。",Daily:"日记插件","Always Show Leaf Sidebar on PC":"在 PC 上总是展示左侧栏","Show left sidebar on PC even when the leaf width is less than 875px. False by default.":"在 PC 上即使页面宽度小于 875px 时都展示左侧栏。默认为关闭","You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":"你在 Periodic Notes 插件和日记插件都没设置日记的格式","fetch more":"加载更多","Search all settings":"搜索所有设置","Random Review":"随机回顾","ARCHIVED AT":"归档于","Failed to get memos from daily notes":"无法从日记中获取 Thino","Failed to delete memo":"无法删除 Thino","CTRL + ENTER to save":"CTRL + ENTER 保存","Started from":"开始于","Custom Background Image":"自定义背景图","Set custom background image.":"设置自定义背景图","Custom Memo Footer":"自定义 Thino 页脚","Set custom memo footer.":"设置自定义 Thino 页脚","Heatmap Color Scheme":"热力图颜色","Set different color scheme for heatmap.":"设置热力图的颜色","Enable Local Http Server":"启用本地 HTTP 服务器","Memos Http Server Port":"Thino HTTP 服务器端口","Set memos http server port to listen. '43999' by default":"设置 Thino HTTP 服务器端口。默认为 '43999'","Live-Preview Mode OR Source Mode.":"基于 Thino 的所见即所得模式(默认) 或者 源码模式,你可以自己选择适合自己的输入体验。","Default Editor Mode":"默认编辑器模式","Save Location for Memos":"Thino 保存位置",DAILY:"日记",MULTI:"多文件",CANVAS:"画布",FILE:"单文件","Failed to create daily note, check if it exists.":"无法创建日记,请检查是否存在文件夹","Failed to create daily note. Please check if you created a folder for daily notes.":"无法创建日记,请检查是否存在日记文件夹","After you verify your account, please refresh this page.":"验证成功后,请刷新页面。",Verify:"去验证","Oops! You forget to verify insider account":"内测账户验证失败","If you have any questions, please contact us.":"如果你有任何问题,请联系我们。","Delete Thino Directly":"直接删除 Thino","When delete thino directly, it will not be moved to trash. False by default.":"当直接删除 Thino 时,不会移动到回收站。默认为关闭","Get activation code":"获取激活码","Input activation code here":"在这里输入激活码","Copy Thino id":"获取 Thino id","Activate Pro Version":"激活专业版","Please copy Thino id first":"请先获取 Thino id",'You can set folder name with file name like "folder/file"':'你可以设置例如 "folder/file" 的文件夹名+文件名的搭配来存放在指定文件夹','You can set folder name like "folder1/folder2/folder3" to create sub-folder':'你可以设置例如 "folder1/folder2/folder3" 的文件夹名来创建子文件夹',"Default save location":"默认保存位置",'Set the default save location for thino. "DAILY" by default':'设置 Thino 的默认保存位置。默认为 "DAILY"',"Enable opening thino globally":"全局唤醒 Thino","Enable opening thino globally. False by default.":"全局唤醒 Thino。默认为关闭","Key for opening thino globally":"全局唤醒 Thino 的快捷键","Set key for opening thino globally. CTRL + SHIFT + T by default.":"设置全局唤醒 Thino 的快捷键。默认为 CTRL + SHIFT + T","Sync Thino via PKMer":"通过 PKMer 同步 Thino",Unlink:"取消链接",Link:"链接","Connect to PKMer Sync, you can check it in ":"连接到 PKMer 同步,你可以在该链接中查看:","PKMer Sync":"PKMer 同步","Remove successfully":"移除成功",Deactivate:"取消激活",Remove:"移除","Confirm?":"确认?","Sync Status":"同步状态","Start or stop sync":"开始或停止同步","Stop sync successfully":"停止同步成功","Start sync successfully":"开始同步成功",Stop:"停止",Start:"开始","Show thino near mouse":"在鼠标附近展示 Thino","Query not found":"检索式未找到","Send to clipboard successfully":"发送到剪贴板成功","Thino - Failed to start HTTP server, please check the port is available.":"Thino - 启动 HTTP 服务器失败,请检查端口是否可用。","Thino - Started HTTP server on port":"Thino - 启动 HTTP 服务器成功,端口为","Thino - Terminated HTTP server":"Thino - 终止 HTTP 服务器","File not exist":"文件不存在","Thino not found":"Thino 未找到","File not found for the given thino path, is creating a new file":"未找到承载指定 Thino 的文件,正在创建新文件","Saved sync token successfully":"保存同步令牌成功","Failed to find daily notes folder":"未找到日记文件夹","Please install obsidian-hover-editor plugin first":"请先安装 obsidian-hover-editor 插件","Copied app id successfully":"复制 app id 成功","Please input token first":"请先输入 token","Please enable sync first":"请先启用同步","Init Failed":"初始化失败","Folder not found for the given thino path, is creating a new folder":"未找到承载指定 Thino 的文件夹,正在创建新文件夹","File not found for the given thino path":"未找到承载指定 Thino 的文件","Failed to read current daily note, check if it exists.":"无法读取日记文件,请检查是否存在","Verify successfully":"验证成功","Failed to verify":"验证失败","Failed to save":"保存失败","Failed to login, please login again":"登录已过期,请重新登录","COPY FAILED":"复制失败","COPY SUCCEED":"复制成功",COPY:"复制","This is a pro feature, please upgrade to pro version to use it.":"这是专业版功能,请升级到专业版来使用它。","You can get pro version from: ":"你可以从这里获取专业版:",Save:"保存",Cancel:"取消","Thino Daily Target":"Thino 每日目标",Input:"输入","#Tag":"#标签","to create tag":"来创建标签","You have verified your account. Congrats!":"你已经验证了你的账户。恭喜!","Pro Features":"专业版功能","Target Thino Count":"目标 Thino 数量",on:"在","Switch waterfall view":"切换瀑布流视图","Switch view":"切换视图","Switch list view":"切换列表视图","Set daily target":"设置每日目标","Thino Save To: ":"Thino 保存到:","Enter fullscreen mode":"进入全屏模式","Exit fullscreen mode":"退出全屏模式",words:"字","Return To Home Page":"返回首页","Open thino in center window":"在中心窗口打开 thino","Open thino in float window":"在浮动窗口打开 thino","Open thino in right sidebar":"在右侧边栏打开 thino","Open thino in left sidebar":"在左侧边栏打开 thino","Show thino editor":"显示 thino 编辑器","Toggle minimal mode":"切换 Minimal 模式","Focus on thino editor":"聚焦到 thino 编辑器","ReSync web thinos to local":"重新同步 web 上的 thino 到本地","Sync local thinos to web":"同步本地的 thino 到 web","Show daily thino view":"显示每日 thino 视图","Focus on search bar":"聚焦到搜索栏","Show-thino in popover(Hover editor)":"在弹出框中显示 thino","Center window":"中心窗口","Float window":"浮动窗口","Right sidebar":"右侧边栏","Left sidebar":"左侧边栏","Save thino type when sync local":"同步本地时保存的 thino 类型","Set the default save thino type when sync local, FILE by default.":"设置同步本地时保存的 thino 类型,默认为单文件。","Sync service":"同步服务","Pro verification status":"专业版激活状态","Live-preview":"所见即所得",Source:"源码",General:"通用",Thino:"Thino",Theme:"主题",Share:"分享",Advanced:"进阶","Global copy":"全局复制","Set the folder name":"设置文件夹名","Set the filename":"设置文件名","Set the filename for current location file":"设置当前位置文件的文件名","Switch calendar type":"切换日历类型",alphabetical:"标签名称A-Z",alphabeticalReverse:"标签名称Z-A",byCount:"按使用次数(从高到低)",byCountReverse:"按使用次数(从低到高)","Type here":"在这里输入",Today:"今天",Yesterday:"昨天","Last 7 days":"最近 7 天","Last 30 days":"最近 30 天","Last 90 days":"最近 90 天","Last 180 days":"最近 180 天","Last 365 days":"最近 365 天",Found:"被找到","Copy filtered thinos to clipboard":"复制筛选的 thino 到剪贴板","If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.":"如果你禁用了日记插件,可能会导致 thino 无法被正确删除。请启用插件后再试一次。",Preview:"预览","Set and save":"设置并保存","Show day mark on list mode":"在列表模式中展示日期标记","Show day mark on the top of daily range thino. False by default.":"在列表模式中展示日期标记。默认为关闭","Click to expand or fold, Cmd+Click to show all thinos of the day":"点击展开或折叠Cmd+点击展示当天所有 thino","You can buy a license from":"你可以从这里购买许可证","No thinos in range":"该范围内没有 thino",Month:"月视图",Week:"周视图",Day:"日视图",Agenda:"日程视图",Tomorrow:"明天",Previous:"往前",Next:"往后","Search all columns...":"搜索所有的列...","Basic Info":"基础信息","Additional Info":"附加信息","Created At":"创建于",Content:"内容","Thino Type":"Thino 类型","Source Type":"来源类型","Row status":"归档状态",Path:"路径","Pinned Status":"置顶状态",Table:"表格",Waterfall:"瀑布流",Calendar:"日历","Go to page":"跳转到页",Page:"页",Show:"展示",rows:"行","Temp Filter":"临时筛选器","Allow navigation from view to Thino or Thino to view":"允许从视图到 Thino 或者从 Thino 到视图的导航"},N8={},F8={ar:l8,cs:u8,da:c8,de:f8,en:rE,"en-gb":d8,es:p8,fr:h8,hi:m8,id:g8,it:v8,ja:y8,ko:w8,nl:b8,nn:D8,pl:S8,pt:E8,"pt-br":T8,ro:C8,ru:x8,tr:M8,"zh-cn":k8,"zh-tw":N8},xb=F8[N.moment.locale()];function O(e){return xb&&xb[e]||rE[e]}const I8=/```([\s\S]*?)```/g,A8=/\*\*(.+?)\*\*/g,O8=/\*(.+?)\*/g,R8=/\[ \] /g,L8=/\[.{1}\] /g,_8=/^[*-]/g,P8=/(\d+)\. /g,Mb=/\[\[([^\]]+)\]\]/g,e1=/\[([^\]]+)\]\((([^\]]+).md)\)/g,j8=(e,t)=>{const n=e.replace(I8,"<pre lang=''>$1</pre>").replace(_8,"<span class='counter-block'>•</span>").replace(P8,"<span class='counter-block'>$1.</span>").replace(R8,"<span class='todo-block' data-type='todo'>⬜</span>").replace(L8,"<span class='todo-block' data-type='done'>✅</span>").replace(A8,"<strong>$1</strong>").replace(O8,"<em>$1</em>").replace(/&lt;br&gt;/g,"</p><p>").replace(/&amp;/g,"&");let r=n;if(t){if(Mb.test(n)){const o=n.match(Mb);for(let i=0;i<o.length;i++)if(!/(jpeg|jpg|gif|png|svg|bmp|wepg)/g.test(o[i])){const s=B8(o[i]);if(/\|/g.test(s)){const[c,d]=s.split("|"),h=c0(c,d);r=n.replace(o[i],h)}else{const h=c0(s,"");r=r.replace(o[i],h)}}}if(e1.test(n)){const o=n.match(e1);for(let i=0;i<o.length;i++)if(!/(jpeg|jpg|gif|png|svg|bmp|wepg)/g.test(o[i])){const s=H8(o[i]),c=Y8(o[i]),d=c0(s,c);r=n.replace(o[i],d)}}}return r},c0=(e,t)=>{const{metadataCache:n}=xe.getState().dailyNotesState.app;return n.getFirstLinkpathDest(decodeURIComponent(e),"")instanceof N.TFile?t?`<a data-href="${e}" data-type="link" data-filepath="${e}" class="internal-link">${t}</a>`:`<a data-href="${e}" data-type="link" data-filepath="${e}" class="internal-link">${e}</a>`:t?`<a data-href="${e}" data-type="link" data-filepath="${e}" class="internal-link is-unresolved">${t}</a>`:`<a data-href="${e}" data-type="link" data-filepath="${e}" class="internal-link is-unresolved">${e}</a>`},B8=e=>{var t;return(t=/\[\[([^\]]+)\]\]/g.exec(e))==null?void 0:t[1]},Y8=e=>{var t;return(t=e1.exec(e))==null?void 0:t[1]},H8=e=>{var t;return(t=/\[([^\]]+)\]\((([^\]]+).md)\)/g.exec(e))==null?void 0:t[3]},kb=e=>{const t=document.createElement("div");return t.className="memo-content-text",t.innerHTML=e,t.innerText},U8=e=>e.replace(/\n/g,"<br>"),V8=e=>{const t=document.createElement("div");return t.textContent=e,t.innerHTML},Nb="mobile-show-sidebar",oE=200,Si=3600*24*1e3,ir=/\s#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,_o=/(<p>|<br>)#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,Lr=/^#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/gu,Rf=/(\s||\(|>|^)((http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-]))/g,z8=/\[([\s\S]*?)\]\(([\s\S]*?)\)/gu,Lf=/([^\s<\\*>'(]+\.(jpeg|jpg|gif|png|svg))(\]\])?(\))?/g,Ou=/\[@(.+?)\]\((.+?)\)/g,$8=/^(-|\*|\d\.)\s(\[.\]\s)?(\d{1,2}:\d{2})\s(.*)$/g,Df=[{title:"DAILY",icon:"list"},{title:"CANVAS",icon:"layout-dashboard"},{title:"MULTI",icon:"file-text"},{title:"FILE",icon:"edit"}];var t1;(e=>{function t(){return parseInt(N.moment().format("x"))}e.getNowTimeStamp=t;function n(){const R=navigator.userAgent;let j="Unknown";return R.indexOf("Win")!=-1?j="Windows":R.indexOf("Mac")!=-1?j="MacOS":R.indexOf("Linux")!=-1&&(j="Linux"),j}e.getOSVersion=n;function r(R){return typeof R=="string"&&(R=R.replaceAll("-","/")),new Date(R).getTime()}e.getTimeStampByDate=r;function o(R){const j=new Date(r(R));return new Date(j.getFullYear(),j.getMonth(),j.getDate()).getTime()}e.getDateStampByDate=o;function i(R){const j=new Date(r(R)),z=j.getFullYear(),q=j.getMonth()+1,$=j.getDate();return`${z}/${q}/${$}`}e.getDateString=i;function s(R){const j=new Date(r(R)),z=j.getHours(),q=j.getMinutes(),$=z<10?"0"+z:z,J=q<10?"0"+q:q;return`${$}:${J}`}e.getTimeString=s;function c(R){const j=new Date(r(R)),z=j.getFullYear(),q=j.getMonth()+1,$=j.getDate(),J=j.getHours(),ae=j.getMinutes(),ie=j.getSeconds(),ge=q<10?"0"+q:q,pe=$<10?"0"+$:$,fe=J<10?"0"+J:J,De=ae<10?"0"+ae:ae,re=ie<10?"0"+ie:ie;return`${z}/${ge}/${pe} ${fe}:${De}:${re}`}e.getDateTimeString=c;function d(R){return Array.from(new Set(R))}e.dedupe=d;function h(R){const j=new Set,z=[];for(const q of R)j.has(q.id)||(j.add(q.id),z.push(q));return z}e.dedupeObjectWithId=h;function g(R,j){let z=null;return()=>{z&&clearTimeout(z),z=setTimeout(R,j)}}e.debounce=g;function m(R,j,z=!1,q){let $=null,J=!1;function ae(...ie){if($&&clearTimeout($),z&&!J){const ge=R.apply(this,ie);q&&typeof q=="function"&&q(ge),J=!0}else $=setTimeout(()=>{const ge=R.apply(this,ie);q&&typeof q=="function"&&q(ge),J=!1,$=null},j)}return ae.cancel=function(){$&&clearTimeout($),$=null,J=!1},ae}e.debouncePlus=m;function w(R,j){let z=!0;return()=>{if(!z)return!1;z=!1,setTimeout(()=>{R(),z=!0},j)}}e.throttle=w;function b(R){const j=[],z=Object.keys(R).sort();for(const q of z){const $=R[q];$&&(typeof $=="object"?j.push(...b($).split("&")):j.push(`${q}=${$}`))}return j.join("&")}e.transformObjectToParamsString=b;function T(R){const j={},z=R.split("&");for(const q of z){const[$,J]=q.split("=");$&&J&&(j[$]=J)}return j}e.transformParamsStringToObject=T;function E(R){if(!R)return{};const j={},z=Object.keys(R).sort();for(const q of z){const $=R[q];if(typeof $=="object"){const J=E(JSON.parse(JSON.stringify($)));J&&Object.keys(J).length>0&&(j[q]=J)}else $&&(j[q]=$)}return j}e.filterObjectNullKeys=E;async function k(R){if(navigator.clipboard&&navigator.clipboard.writeText)try{await navigator.clipboard.writeText(R)}catch(j){console.warn("Copy to clipboard failed.",j)}else console.warn("Copy to clipboard failed, methods not supports.")}e.copyTextToClipboard=k;function C(R){return new Promise(j=>{const z=new Image;z.onload=()=>{const{width:q,height:$}=z;q>0&&$>0?j({width:q,height:$}):j({width:0,height:0})},z.onerror=()=>{j({width:0,height:0})},z.className="hidden",z.src=R,document.body.appendChild(z),z.remove()})}e.getImageSize=C;async function I(R){var $,J,ae,ie;let j;const q=app.plugins.getPlugin("obsidian-memos").settings.UseDailyOrPeriodic==="Daily";try{return!q&&((ie=(ae=(J=($=window.app.plugins)==null?void 0:$.getPlugin("periodic-notes"))==null?void 0:J.calendarSetManager)==null?void 0:ae.getActiveConfig("day"))!=null&&ie.enabled)?(j=await window.app.plugins.getPlugin("periodic-notes").createPeriodicNote("day",R),j):(j=await nE(R),j)}catch(ge){return console.error(ge),new N.Notice(O("Failed to create daily note. Please check if you created a folder for daily notes.")),null}}e.createDailyNoteCheck=I;function B(R){const j=[];let z=0;for(;z<R;z++)j.push((16*Math.random()|0).toString(16));return j.join("")}e.randomId=B;function F(R){return R.replace(/[\p{P}\p{Z}\p{S}]/gu,"").length}e.countWords=F;async function _(R){try{const j=await N.requestUrl(R),z=new Uint8Array(j.arrayBuffer);return new Blob([z],{type:"image/png"})}catch(j){return console.error("error in grabImageFromUrl",R,j),new Blob}}e.grabImageFromUrl=_})(t1||(t1={}));const Ue=t1;function q8(){var i,s,c,d,h,g;let e="";const t=app.plugins.getPlugin("obsidian-memos").settings;let n="";const r=(c=(s=(i=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:i.calendarSetManager)==null?void 0:s.getActiveConfig("day"))==null?void 0:c.folder,o=(g=(h=(d=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:d.settings)==null?void 0:h.daily)==null?void 0:g.format;switch(r===void 0?n=o:n=r,(t==null?void 0:t.UseDailyOrPeriodic)||"Daily"){case"Daily":e=Kg().format||"YYYY-MM-DD";break;case"Periodic":e=n||"YYYY-MM-DD";break;default:e=Kg().format||"YYYY-MM-DD";break}return e===void 0&&new N.Notice(O("You didn't set format for daily notes in both periodic-notes and daily-notes plugins.")),e}function aE(){var i,s,c,d,h,g;let e="";const t=app.plugins.getPlugin("obsidian-memos").settings;let n="";const r=(c=(s=(i=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:i.calendarSetManager)==null?void 0:s.getActiveConfig("day"))==null?void 0:c.folder,o=(g=(h=(d=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:d.settings)==null?void 0:h.daily)==null?void 0:g.folder;switch(r===void 0?n=o:n=r,(t==null?void 0:t.UseDailyOrPeriodic)||"Daily"){case"Daily":e=Kg().folder||"";break;case"Periodic":e=n||"";break;default:e=Kg().folder||"";break}return e===void 0&&new N.Notice(O("You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.")),e}function n1(e,t){var r;e=V8(e),e=U8(e).split("<br>").map(o=>`<p>${o!==""?o:"<br>"}</p>`).join(""),e=j8(e,t),e=e.replace(ir,"<span class='tag-span'>#$1</span>").replace(_o,"<p><span class='tag-span'>#$2</span>").replace(Rf,"$1<a class='link' target='_blank' rel='noreferrer' href='$2'>$2</a>").replace(z8,"<a class='link' target='_blank' rel='noreferrer' href='$2'>$1</a>").replace(Ou,"<span class='memo-link-text' data-value='$2'>$1</span>").replace(/\^\S{6}/g,"");const n=document.createElement("div");n.innerHTML=e;for(let o=0;o<n.children.length;o++){const i=n.children[o];if(i.tagName==="P"&&i.textContent===""&&((r=i.firstElementChild)==null?void 0:r.tagName)!=="BR"){i.remove(),o--;continue}}return n.innerHTML}function W8(e,t){switch(t.type){case"SET_MEMOS":{const n=t.payload.memos.sort((o,i)=>{const s=Ue.getTimeStampByDate(o.createdAt),c=Ue.getTimeStampByDate(i.createdAt);return s===c?i.id.localeCompare(o.id):Ue.getTimeStampByDate(i.createdAt)-Ue.getTimeStampByDate(o.createdAt)}),r=Ue.dedupeObjectWithId(n);return{...e,memos:[...r]}}case"SET_COMMENT_MEMOS":{const n=Ue.dedupeObjectWithId(t.payload.commentMemos.sort((r,o)=>Ue.getTimeStampByDate(o.createdAt)-Ue.getTimeStampByDate(r.createdAt)));return{...e,commentMemos:[...n]}}case"SET_TAGS":return{...e,tags:t.payload.tags,tagsNum:t.payload.tagsNum};case"INSERT_MEMO":{const n=Ue.dedupeObjectWithId([t.payload.memo,...e.memos].sort((r,o)=>Ue.getTimeStampByDate(o.createdAt)-Ue.getTimeStampByDate(r.createdAt)));return{...e,memos:n}}case"INSERT_COMMENT_MEMO":{const n=Ue.dedupeObjectWithId([t.payload.memo,...e.commentMemos].sort((r,o)=>Ue.getTimeStampByDate(o.createdAt)-Ue.getTimeStampByDate(r.createdAt)));return{...e,commentMemos:[...n]}}case"DELETE_MEMO_BY_ID":return{...e,memos:[...e.memos].filter(n=>n.id!==t.payload.id)};case"DELETE_MEMO_BY_ID_BATCH":{const n=[...e.memos];return t.payload.ids.forEach(r=>{n.splice(n.findIndex(o=>o.id===r),1)}),{...e,memos:[...n]}}case"CLEAR_MEMOS":return{...iE};case"EDIT_MEMO":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"EDIT_MEMO_PATH":{const n=e.memos.map(r=>r.path===t.payload.path?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"UPDATE_MEMO_BATCH":{const n=e.memos.filter(o=>o.path!==t.payload.path),r=Ue.dedupeObjectWithId([...t.payload.memos,...n].sort((o,i)=>Ue.getTimeStampByDate(i.createdAt)-Ue.getTimeStampByDate(o.createdAt)));return{...e,memos:[...r]}}case"ARCHIVE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"UNARCHIVE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"PIN_MEMO":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,pinned:t.payload.pinned}:r);return{...e,memos:[...n]}}case"EDIT_COMMENT_MEMO":{const n=e.commentMemos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,commentMemos:[...n]}}default:return e}}const iE={memos:[],commentMemos:[],tags:[],tagsNum:{}};function G8(e,t){switch(t.type){case"SIGN_IN":return{user:t.payload.user};case"SIGN_OUT":return{user:null};default:return e}}const K8={user:null};function Q8(e,t){switch(t.type){case"SET_QUERIES":{const n=Ue.dedupeObjectWithId(t.payload.queries.sort((r,o)=>Ue.getTimeStampByDate(o.createdAt)-Ue.getTimeStampByDate(r.createdAt)).sort((r,o)=>Ue.getTimeStampByDate(o.pinnedAt??0)-Ue.getTimeStampByDate(r.pinnedAt??0)));return{...e,queries:n}}case"INSERT_QUERY":{const n=Ue.dedupeObjectWithId([t.payload.query,...e.queries].sort((r,o)=>Ue.getTimeStampByDate(o.createdAt)-Ue.getTimeStampByDate(r.createdAt)));return{...e,queries:n}}case"DELETE_QUERY_BY_ID":return{...e,queries:[...e.queries].filter(n=>n.id!==t.payload.id)};case"UPDATE_QUERY":{const n=e.queries.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,queries:n}}default:return e}}const Z8={queries:[]};function J8(e,t){var n,r,o,i;switch(t.type){case"SET_DAILY_NOTES":return{...e,dailyNotes:t.payload.dailyNotes};case"SET_APP":return e.app?{...e}:{...e,app:t.payload.app};case"SET_PLUGIN":return e.plugin?{...e}:{...e,plugin:t.payload.plugin};case"SET_EDITOR":return e.editor?{...e}:{...e,editor:t.payload.editor};case"SET_SETTINGS":return e.settings&&e.settings===t.payload.settings?{...e}:{...e,settings:t.payload.settings};case"SET_VIEW":return e.view&&((r=(n=e.view)==null?void 0:n.leaf)==null?void 0:r.id)===((i=(o=t.payload.view)==null?void 0:o.leaf)==null?void 0:i.id)?{...e}:{...e,view:t.payload.view};case"CLEAR_VIEW":return e.view&&e.view.unload(),{...e,view:null};case"CLEAR_FILES":return{...e,dailyNotes:null};case"SET_VERIFY_STATE":return{...e,verifyState:t.payload.verifyState};default:return e}}const X8={dailyNotes:null,app:null,view:null,settings:null,editor:null,plugin:null,verifyState:null},xe=A6({globalState:R6,locationState:H2,memoState:iE,userState:K8,queryState:Z8,dailyNotesState:X8},I6({globalState:O6,locationState:L6,memoState:W8,userState:G8,queryState:Q8,dailyNotesState:J8})),Nt=A.createContext(xe.getState());String.prototype.replaceAll||(String.prototype.replaceAll=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object regexp]"?this.replace(e,t):this.replace(new RegExp(e,"g"),t)});class eM{constructor(){ye(this,"initialized",!1)}getState(){return xe.getState().dailyNotesState}setApp(t){return xe.dispatch({type:"SET_APP",payload:{app:t}}),t}setPlugin(t){return xe.dispatch({type:"SET_PLUGIN",payload:{plugin:t}}),t}setSettings(t){return xe.dispatch({type:"SET_SETTINGS",payload:{settings:t}}),this.initialized||(this.initialized=!0),t}setView(t){return xe.dispatch({type:"SET_VIEW",payload:{view:t}}),t}setEditor(t){return xe.dispatch({type:"SET_EDITOR",payload:{editor:t}}),t}async updateDailyNotes(t,n){const r=this.getState().dailyNotes,o=Bp(t,"day");return n?delete r[`day-${o.format("YYYY-MM-DD")}T00:00:00+08:00}`]:r[`day-${o.format("YYYY-MM-DD")}T00:00:00+08:00}`]=t,xe.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:r}}),r}setVerifyState(t){return xe.dispatch({type:"SET_VERIFY_STATE",payload:{verifyState:t}}),t}async fechLocalDailyNotes(){const t=Au();return xe.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:t}}),t}}const ut=new eM;var zn;(e=>{function t(i){const s={};for(const c of i)try{const d=localStorage.getItem(c);if(d!==null){const h=JSON.parse(d);s[c]=h}}catch(d){console.error("Get storage failed in ",c,d)}return s}e.get=t;function n(i){for(const s in i)try{const c=JSON.stringify(i[s]);localStorage.setItem(s,c)}catch(c){console.error("Save storage failed in ",s,c)}}e.set=n;function r(i){for(const s of i)try{localStorage.removeItem(s)}catch(c){console.error("Remove storage failed in ",s,c)}}e.remove=r;function o(){var s;const i=document.createElement("iframe");i.style.display="none",document.body.appendChild(i),(s=i.contentWindow)==null||s.localStorage.setItem("t",Date.now().toString()),i.remove()}e.emitStorageChangedEvent=o})(zn||(zn={}));class tM{constructor(){ye(this,"getState",()=>xe.getState().globalState);ye(this,"setEditMemoId",t=>{xe.dispatch({type:"SET_EDIT_MEMO_ID",payload:{editMemoId:t}})});ye(this,"setRefresh",t=>{xe.dispatch({type:"SET_REFRESH",payload:{refresh:t}})});ye(this,"setCommentMemoId",t=>{xe.dispatch({type:"SET_COMMENT_MEMO_ID",payload:{commentMemoId:t}})});ye(this,"setMarkMemoId",t=>{xe.dispatch({type:"SET_MARK_MEMO_ID",payload:{markMemoId:t}})});ye(this,"setLoaded",t=>{xe.dispatch({type:"SET_LOADED",payload:{loaded:t}})});ye(this,"setGlobalEditorShown",t=>{xe.dispatch({type:"SET_GLOBAL_EDITOR_SHOWN",payload:{globalEditorShown:t}})});ye(this,"setIsMobileView",t=>{xe.dispatch({type:"SET_MOBILE_VIEW",payload:{isMobileView:t}})});ye(this,"setChangedByMemos",t=>{xe.dispatch({type:"SET_CHANGED_BY_MEMOS",payload:{changedByMemos:t}})});ye(this,"setShowSiderbarInMobileView",t=>{xe.dispatch({type:"SET_SHOW_SIDEBAR_IN_MOBILE_VIEW",payload:{showSiderbarInMobileView:t}})});ye(this,"setAppSetting",t=>{xe.dispatch({type:"SET_APP_SETTING",payload:t}),zn.set(t)});ye(this,"setMemoListView",t=>{xe.dispatch({type:"SET_MEMO_LIST_VIEW",payload:{memoListView:t}})});ye(this,"setInstance",(t,n)=>{xe.dispatch({type:"SET_INSTANCE",payload:{id:t,instance:n}})});ye(this,"setPluginManifest",t=>{xe.dispatch({type:"SET_MEMO_PLUGIN_MANIFEST",payload:{manifest:t}})});const t=zn.get(["shouldSplitMemoWord","shouldHideImageUrl","shouldUseMarkdownParser","useTinyUndoHistoryCache"]),n={shouldSplitMemoWord:t.shouldSplitMemoWord??!0,shouldHideImageUrl:t.shouldHideImageUrl??!0,shouldUseMarkdownParser:t.shouldUseMarkdownParser??!0,useTinyUndoHistoryCache:t.useTinyUndoHistoryCache??!1};this.setAppSetting(n)}}const rt=new tM;class nM{constructor(){ye(this,"updateStateWithLocation",()=>{const{pathname:t,search:n,hash:r}=window.location,o=new URLSearchParams(n),i={pathname:"/",hash:"",query:{tag:"",duration:null,text:"",type:"",filter:""}};i.query.tag=o.get("tag")??"",i.query.type=o.get("type")??"",i.query.text=o.get("text")??"",i.query.filter=o.get("filter")??"";const s=parseInt(o.get("from")??"0"),c=parseInt(o.get("to")??"0");c>s&&c!==0&&(i.query.duration={from:s,to:c}),i.hash=r,i.pathname=this.getValidPathname(t),xe.dispatch({type:"SET_LOCATION",payload:i})});ye(this,"getState",()=>xe.getState().locationState);ye(this,"clearQuery",()=>{xe.dispatch({type:"SET_QUERY",payload:{tag:"",duration:null,text:"",type:"",filter:""}})});ye(this,"setQuery",t=>{xe.dispatch({type:"SET_QUERY",payload:t})});ye(this,"reloadApp",()=>{xe.dispatch({type:"RELOAD"})});ye(this,"setHash",t=>{xe.dispatch({type:"SET_HASH",payload:{hash:t}})});ye(this,"setPathname",t=>{xe.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});ye(this,"pushHistory",t=>{xe.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});ye(this,"replaceHistory",t=>{xe.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});ye(this,"setMemoTypeQuery",(t="")=>{xe.dispatch({type:"SET_TYPE",payload:{type:t}})});ye(this,"setMemoFilter",t=>{xe.dispatch({type:"SET_QUERY_FILTER",payload:t})});ye(this,"setTextQuery",t=>{xe.dispatch({type:"SET_TEXT",payload:{text:t}})});ye(this,"setTimeQuery",t=>{xe.dispatch({type:"SET_DURATION_QUERY",payload:{duration:t}})});ye(this,"setTagQuery",t=>{xe.dispatch({type:"SET_TAG_QUERY",payload:{tag:t}})});ye(this,"setFromAndToQuery",(t,n)=>{xe.dispatch({type:"SET_DURATION_QUERY",payload:{duration:{from:t,to:n}}})});ye(this,"getValidPathname",t=>["/","/homeboard","/recycle","/setting"].includes(t)?t:"/");this.updateStateWithLocation(),window.onpopstate=()=>{this.updateStateWithLocation()}}}const it=new nM,Du=e=>`${e.vault.configDir}/query.json`,sE=async(e,t)=>{try{return await e.vault.adapter.read(t),!0}catch(n){return console.error(n),!1}},_f=async e=>(await sE(e,Du(e))||await lE(e),JSON.parse(await e.vault.adapter.read(Du(e))).queries||[]),gh=async(e,t)=>{await e.vault.adapter.write(Du(e),JSON.stringify({queries:t},null,2))},lE=async e=>{const t=rt.getState().manifest,n=e.plugins.getPlugin(t.id||"obsidian-memos").settings,r=e.metadataCache.getFirstLinkpathDest(n.QueryFileName,"");if(!r)await e.vault.adapter.write(Du(e),JSON.stringify({queries:[]},null,2));else{const i=(await e.vault.read(r)).split(`
`);i.length===0&&await e.vault.adapter.write(Du(e),JSON.stringify({queries:[]},null,2));const s=[];for(let c=0;c<i.length;c++){const d=c,h="Memos";let g="未命名";const m=i[c];let w=N.moment().format("YYYY/MM/DD HH:mm:ss"),b="[]";const T=m.match(/^\d{14,16}/);T&&(w=N.moment(T[0].slice(0,14),"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:ss"));const E=m.match(/\[\{(.+)\}\]/);E&&(b=E[0]);const k=m.match(/\s(.+)\s\[\{/);k&&(g=k[0].slice(1,-3)),s.push({id:d,pinnedAt:"",createdAt:w,updatedAt:w,title:g,querystring:b,userId:h})}await e.vault.adapter.write(Du(e),JSON.stringify({queries:s},null,2))}},rM=async()=>{const{app:e}=xe.getState().dailyNotesState;return await sE(e,Du(e))||await lE(e),await _f(e)||[]},oM=(e,t)=>({createdAt:N.moment().format("YYYY/MM/DD HH:mm:ss"),id:e,pinnedAt:"",querystring:t,title:O("Temp Filter"),updatedAt:N.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"}),aM=async(e,t)=>{const n=await _f(xe.getState().dailyNotesState.app)||[],r={createdAt:N.moment().format("YYYY/MM/DD HH:mm:ss"),id:N.moment().format("YYYYMMDDHHmmss")+n.length,pinnedAt:"",querystring:t,title:e,updatedAt:N.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"};return n.push(r),await gh(xe.getState().dailyNotesState.app,n),r};var Qg={exports:{}};Qg.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",c="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",h=500,g="__lodash_placeholder__",m=1,w=2,b=4,T=1,E=2,k=1,C=2,I=4,B=8,F=16,_=32,R=64,j=128,z=256,q=512,$=30,J="...",ae=800,ie=16,ge=1,pe=2,fe=3,De=1/0,re=9007199254740991,be=17976931348623157e292,V=NaN,G=4294967295,le=G-1,we=G>>>1,ue=[["ary",j],["bind",k],["bindKey",C],["curry",B],["curryRight",F],["flip",q],["partial",_],["partialRight",R],["rearg",z]],Se="[object Arguments]",Re="[object Array]",Ye="[object AsyncFunction]",Be="[object Boolean]",yt="[object Date]",Ee="[object DOMException]",Ve="[object Error]",Ke="[object Function]",Xe="[object GeneratorFunction]",Ge="[object Map]",tt="[object Number]",Dt="[object Null]",dt="[object Object]",Vt="[object Promise]",Yo="[object Proxy]",cn="[object RegExp]",en="[object Set]",br="[object String]",Dr="[object Symbol]",_a="[object Undefined]",yo="[object WeakMap]",la="[object WeakSet]",Qr="[object ArrayBuffer]",Sr="[object DataView]",gs="[object Float32Array]",ua="[object Float64Array]",ca="[object Int8Array]",Tl="[object Int16Array]",Mi="[object Int32Array]",ki="[object Uint8Array]",vs="[object Uint8ClampedArray]",Pa="[object Uint16Array]",Ni="[object Uint32Array]",U=/\b__p \+= '';/g,te=/\b(__p \+=) '' \+/g,he=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ce=/&(?:amp|lt|gt|quot|#39);/g,Le=/[&<>"']/g,je=RegExp(Ce.source),He=RegExp(Le.source),mt=/<%-([\s\S]+?)%>/g,Yt=/<%([\s\S]+?)%>/g,xn=/<%=([\s\S]+?)%>/g,mn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zr=/^\w*$/,Mn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ur=/[\\^$.*+?()[\]{}|]/g,Jr=RegExp(ur.source),Cl=/^\s+/,Gt=/\s/,wo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,bo=/\{\n\/\* \[wrapped with (.+)\] \*/,Do=/,? & /,ja=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ba=/[()=,{}\[\]\/\s]/,ly=/\\(\\)?/g,Fi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ed=/\w*$/,jh=/^[-+]0x[0-9a-f]+$/i,uy=/^0b[01]+$/i,Bh=/^\[object .+?Constructor\]$/,Yh=/^0o[0-7]+$/i,Hh=/^(?:0|[1-9]\d*)$/,Uh=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Pu=/($^)/,cy=/['\n\r\u2028\u2029\\]/g,tn="\\ud800-\\udfff",fy="\\u0300-\\u036f",td="\\ufe20-\\ufe2f",Vh="\\u20d0-\\u20ff",xl=fy+td+Vh,zh="\\u2700-\\u27bf",nd="a-z\\xdf-\\xf6\\xf8-\\xff",ju="\\xac\\xb1\\xd7\\xf7",Ho="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",dy="\\u2000-\\u206f",So=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$h="A-Z\\xc0-\\xd6\\xd8-\\xde",qh="\\ufe0e\\ufe0f",Wh=ju+Ho+dy+So,ys="[']",Bu="["+tn+"]",ws="["+Wh+"]",Ii="["+xl+"]",Gh="\\d+",py="["+zh+"]",Yu="["+nd+"]",rd="[^"+tn+Wh+Gh+zh+nd+$h+"]",Ml="\\ud83c[\\udffb-\\udfff]",kl="(?:"+Ii+"|"+Ml+")",Kh="[^"+tn+"]",Nl="(?:\\ud83c[\\udde6-\\uddff]){2}",Pt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ai="["+$h+"]",od="\\u200d",Hu="(?:"+Yu+"|"+rd+")",Qh="(?:"+Ai+"|"+rd+")",ad="(?:"+ys+"(?:d|ll|m|re|s|t|ve))?",id="(?:"+ys+"(?:D|LL|M|RE|S|T|VE))?",Uu=kl+"?",Fl="["+qh+"]?",Ya="(?:"+od+"(?:"+[Kh,Nl,Pt].join("|")+")"+Fl+Uu+")*",Ha="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ua="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bs=Fl+Uu+Ya,Il="(?:"+[py,Nl,Pt].join("|")+")"+bs,Va="(?:"+[Kh+Ii+"?",Ii,Nl,Pt,Bu].join("|")+")",hy=RegExp(ys,"g"),Zh=RegExp(Ii,"g"),Oi=RegExp(Ml+"(?="+Ml+")|"+Va+bs,"g"),my=RegExp([Ai+"?"+Yu+"+"+ad+"(?="+[ws,Ai,"$"].join("|")+")",Qh+"+"+id+"(?="+[ws,Ai+Hu,"$"].join("|")+")",Ai+"?"+Hu+"+"+ad,Ai+"+"+id,Ua,Ha,Gh,Il].join("|"),"g"),Jh=RegExp("["+od+tn+xl+qh+"]"),Vu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Xh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],gy=-1,Ht={};Ht[gs]=Ht[ua]=Ht[ca]=Ht[Tl]=Ht[Mi]=Ht[ki]=Ht[vs]=Ht[Pa]=Ht[Ni]=!0,Ht[Se]=Ht[Re]=Ht[Qr]=Ht[Be]=Ht[Sr]=Ht[yt]=Ht[Ve]=Ht[Ke]=Ht[Ge]=Ht[tt]=Ht[dt]=Ht[cn]=Ht[en]=Ht[br]=Ht[yo]=!1;var jt={};jt[Se]=jt[Re]=jt[Qr]=jt[Sr]=jt[Be]=jt[yt]=jt[gs]=jt[ua]=jt[ca]=jt[Tl]=jt[Mi]=jt[Ge]=jt[tt]=jt[dt]=jt[cn]=jt[en]=jt[br]=jt[Dr]=jt[ki]=jt[vs]=jt[Pa]=jt[Ni]=!0,jt[Ve]=jt[Ke]=jt[yo]=!1;var Ds={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},zu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},vy={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},yy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},sd=parseFloat,$u=parseInt,qu=typeof Vn=="object"&&Vn&&Vn.Object===Object&&Vn,em=typeof self=="object"&&self&&self.Object===Object&&self,nn=qu||em||Function("return this")(),Al=t&&!t.nodeType&&t,Uo=Al&&!0&&e&&!e.nodeType&&e,ld=Uo&&Uo.exports===Al,Ss=ld&&qu.process,cr=function(){try{var oe=Uo&&Uo.require&&Uo.require("util").types;return oe||Ss&&Ss.binding&&Ss.binding("util")}catch{}}(),ud=cr&&cr.isArrayBuffer,Er=cr&&cr.isDate,Ri=cr&&cr.isMap,Wu=cr&&cr.isRegExp,Es=cr&&cr.isSet,tm=cr&&cr.isTypedArray;function fr(oe,Te,me){switch(me.length){case 0:return oe.call(Te);case 1:return oe.call(Te,me[0]);case 2:return oe.call(Te,me[0],me[1]);case 3:return oe.call(Te,me[0],me[1],me[2])}return oe.apply(Te,me)}function cd(oe,Te,me,qe){for(var bt=-1,Ot=oe==null?0:oe.length;++bt<Ot;){var wn=oe[bt];Te(qe,wn,me(wn),oe)}return qe}function Wn(oe,Te){for(var me=-1,qe=oe==null?0:oe.length;++me<qe&&Te(oe[me],me,oe)!==!1;);return oe}function Gu(oe,Te){for(var me=oe==null?0:oe.length;me--&&Te(oe[me],me,oe)!==!1;);return oe}function fd(oe,Te){for(var me=-1,qe=oe==null?0:oe.length;++me<qe;)if(!Te(oe[me],me,oe))return!1;return!0}function za(oe,Te){for(var me=-1,qe=oe==null?0:oe.length,bt=0,Ot=[];++me<qe;){var wn=oe[me];Te(wn,me,oe)&&(Ot[bt++]=wn)}return Ot}function Ku(oe,Te){var me=oe==null?0:oe.length;return!!me&&Ts(oe,Te,0)>-1}function dd(oe,Te,me){for(var qe=-1,bt=oe==null?0:oe.length;++qe<bt;)if(me(Te,oe[qe]))return!0;return!1}function qt(oe,Te){for(var me=-1,qe=oe==null?0:oe.length,bt=Array(qe);++me<qe;)bt[me]=Te(oe[me],me,oe);return bt}function $a(oe,Te){for(var me=-1,qe=Te.length,bt=oe.length;++me<qe;)oe[bt+me]=Te[me];return oe}function pd(oe,Te,me,qe){var bt=-1,Ot=oe==null?0:oe.length;for(qe&&Ot&&(me=oe[++bt]);++bt<Ot;)me=Te(me,oe[bt],bt,oe);return me}function wy(oe,Te,me,qe){var bt=oe==null?0:oe.length;for(qe&&bt&&(me=oe[--bt]);bt--;)me=Te(me,oe[bt],bt,oe);return me}function hd(oe,Te){for(var me=-1,qe=oe==null?0:oe.length;++me<qe;)if(Te(oe[me],me,oe))return!0;return!1}var by=gd("length");function nm(oe){return oe.split("")}function Dy(oe){return oe.match(ja)||[]}function rm(oe,Te,me){var qe;return me(oe,function(bt,Ot,wn){if(Te(bt,Ot,wn))return qe=Ot,!1}),qe}function Qu(oe,Te,me,qe){for(var bt=oe.length,Ot=me+(qe?1:-1);qe?Ot--:++Ot<bt;)if(Te(oe[Ot],Ot,oe))return Ot;return-1}function Ts(oe,Te,me){return Te===Te?Xu(oe,Te,me):Qu(oe,om,me)}function md(oe,Te,me,qe){for(var bt=me-1,Ot=oe.length;++bt<Ot;)if(qe(oe[bt],Te))return bt;return-1}function om(oe){return oe!==oe}function am(oe,Te){var me=oe==null?0:oe.length;return me?vd(oe,Te)/me:V}function gd(oe){return function(Te){return Te==null?n:Te[oe]}}function Zu(oe){return function(Te){return oe==null?n:oe[Te]}}function im(oe,Te,me,qe,bt){return bt(oe,function(Ot,wn,zt){me=qe?(qe=!1,Ot):Te(me,Ot,wn,zt)}),me}function Sy(oe,Te){var me=oe.length;for(oe.sort(Te);me--;)oe[me]=oe[me].value;return oe}function vd(oe,Te){for(var me,qe=-1,bt=oe.length;++qe<bt;){var Ot=Te(oe[qe]);Ot!==n&&(me=me===n?Ot:me+Ot)}return me}function yd(oe,Te){for(var me=-1,qe=Array(oe);++me<oe;)qe[me]=Te(me);return qe}function Ey(oe,Te){return qt(Te,function(me){return[me,oe[me]]})}function sm(oe){return oe&&oe.slice(0,ec(oe)+1).replace(Cl,"")}function _r(oe){return function(Te){return oe(Te)}}function Ol(oe,Te){return qt(Te,function(me){return oe[me]})}function fa(oe,Te){return oe.has(Te)}function lm(oe,Te){for(var me=-1,qe=oe.length;++me<qe&&Ts(Te,oe[me],0)>-1;);return me}function wd(oe,Te){for(var me=oe.length;me--&&Ts(Te,oe[me],0)>-1;);return me}function um(oe,Te){for(var me=oe.length,qe=0;me--;)oe[me]===Te&&++qe;return qe}var cm=Zu(Ds),fm=Zu(zu);function dm(oe){return"\\"+yy[oe]}function Cs(oe,Te){return oe==null?n:oe[Te]}function xs(oe){return Jh.test(oe)}function Ty(oe){return Vu.test(oe)}function Cy(oe){for(var Te,me=[];!(Te=oe.next()).done;)me.push(Te.value);return me}function Ju(oe){var Te=-1,me=Array(oe.size);return oe.forEach(function(qe,bt){me[++Te]=[bt,qe]}),me}function bd(oe,Te){return function(me){return oe(Te(me))}}function Xr(oe,Te){for(var me=-1,qe=oe.length,bt=0,Ot=[];++me<qe;){var wn=oe[me];(wn===Te||wn===g)&&(oe[me]=g,Ot[bt++]=me)}return Ot}function qa(oe){var Te=-1,me=Array(oe.size);return oe.forEach(function(qe){me[++Te]=qe}),me}function xy(oe){var Te=-1,me=Array(oe.size);return oe.forEach(function(qe){me[++Te]=[qe,qe]}),me}function Xu(oe,Te,me){for(var qe=me-1,bt=oe.length;++qe<bt;)if(oe[qe]===Te)return qe;return-1}function My(oe,Te,me){for(var qe=me+1;qe--;)if(oe[qe]===Te)return qe;return qe}function Li(oe){return xs(oe)?hm(oe):by(oe)}function Pr(oe){return xs(oe)?mm(oe):nm(oe)}function ec(oe){for(var Te=oe.length;Te--&&Gt.test(oe.charAt(Te)););return Te}var pm=Zu(vy);function hm(oe){for(var Te=Oi.lastIndex=0;Oi.test(oe);)++Te;return Te}function mm(oe){return oe.match(Oi)||[]}function ky(oe){return oe.match(my)||[]}var Ny=function oe(Te){Te=Te==null?nn:Ms.defaults(nn.Object(),Te,Ms.pick(nn,Xh));var me=Te.Array,qe=Te.Date,bt=Te.Error,Ot=Te.Function,wn=Te.Math,zt=Te.Object,Rl=Te.RegExp,Fy=Te.String,eo=Te.TypeError,da=me.prototype,Dd=Ot.prototype,Vo=zt.prototype,ks=Te["__core-js_shared__"],Ll=Dd.toString,Rt=Vo.hasOwnProperty,Ns=0,tc=function(){var u=/[^.]+$/.exec(ks&&ks.keys&&ks.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),_l=Vo.toString,nc=Ll.call(zt),gm=nn._,vm=Rl("^"+Ll.call(Rt).replace(ur,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pl=ld?Te.Buffer:n,pa=Te.Symbol,jl=Te.Uint8Array,Sd=Pl?Pl.allocUnsafe:n,Eo=bd(zt.getPrototypeOf,zt),rc=zt.create,oc=Vo.propertyIsEnumerable,ac=da.splice,ym=pa?pa.isConcatSpreadable:n,ha=pa?pa.iterator:n,_i=pa?pa.toStringTag:n,Bl=function(){try{var u=ba(zt,"defineProperty");return u({},"",{}),u}catch{}}(),wm=Te.clearTimeout!==nn.clearTimeout&&Te.clearTimeout,Kt=qe&&qe.now!==nn.Date.now&&qe.now,Ed=Te.setTimeout!==nn.setTimeout&&Te.setTimeout,Pi=wn.ceil,Wa=wn.floor,ic=zt.getOwnPropertySymbols,Td=Pl?Pl.isBuffer:n,Fs=Te.isFinite,sc=da.join,Is=bd(zt.keys,zt),bn=wn.max,Gn=wn.min,Iy=qe.now,bm=Te.parseInt,Yl=wn.random,lc=da.reverse,Hl=ba(Te,"DataView"),ji=ba(Te,"Map"),Ul=ba(Te,"Promise"),Ga=ba(Te,"Set"),Vl=ba(Te,"WeakMap"),As=ba(zt,"create"),uc=Vl&&new Vl,Os={},Cd=li(Hl),Ka=li(ji),Dm=li(Ul),Rs=li(Ga),zo=li(Vl),Qa=pa?pa.prototype:n,jr=Qa?Qa.valueOf:n,cc=Qa?Qa.toString:n;function Y(u){if(Sn(u)&&!Tt(u)&&!(u instanceof St)){if(u instanceof Kn)return u;if(Rt.call(u,"__wrapped__"))return op(u)}return new Kn(u)}var Ls=function(){function u(){}return function(f){if(!vn(f))return{};if(rc)return rc(f);u.prototype=f;var y=new u;return u.prototype=n,y}}();function $o(){}function Kn(u,f){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}Y.templateSettings={escape:mt,evaluate:Yt,interpolate:xn,variable:"",imports:{_:Y}},Y.prototype=$o.prototype,Y.prototype.constructor=Y,Kn.prototype=Ls($o.prototype),Kn.prototype.constructor=Kn;function St(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=G,this.__views__=[]}function fc(){var u=new St(this.__wrapped__);return u.__actions__=hr(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=hr(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=hr(this.__views__),u}function xd(){if(this.__filtered__){var u=new St(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function _s(){var u=this.__wrapped__.value(),f=this.__dir__,y=Tt(u),M=f<0,L=y?u.length:0,H=$m(0,L,this.__views__),K=H.start,ee=H.end,se=ee-K,ke=M?ee:K-1,Ne=this.__iteratees__,Oe=Ne.length,ze=0,ot=Gn(se,this.__takeCount__);if(!y||!M&&L==se&&ot==se)return jd(u,this.__actions__);var gt=[];e:for(;se--&&ze<ot;){ke+=f;for(var xt=-1,vt=u[ke];++xt<Oe;){var Mt=Ne[xt],At=Mt.iteratee,Oo=Mt.type,$r=At(vt);if(Oo==pe)vt=$r;else if(!$r){if(Oo==ge)continue e;break e}}gt[ze++]=vt}return gt}St.prototype=Ls($o.prototype),St.prototype.constructor=St;function Tr(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;){var M=u[f];this.set(M[0],M[1])}}function Qt(){this.__data__=As?As(null):{},this.size=0}function Wt(u){var f=this.has(u)&&delete this.__data__[u];return this.size-=f?1:0,f}function Za(u){var f=this.__data__;if(As){var y=f[u];return y===d?n:y}return Rt.call(f,u)?f[u]:n}function Qn(u){var f=this.__data__;return As?f[u]!==n:Rt.call(f,u)}function Cr(u,f){var y=this.__data__;return this.size+=this.has(u)?0:1,y[u]=As&&f===n?d:f,this}Tr.prototype.clear=Qt,Tr.prototype.delete=Wt,Tr.prototype.get=Za,Tr.prototype.has=Qn,Tr.prototype.set=Cr;function dr(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;){var M=u[f];this.set(M[0],M[1])}}function Ps(){this.__data__=[],this.size=0}function xr(u){var f=this.__data__,y=Jn(f,u);if(y<0)return!1;var M=f.length-1;return y==M?f.pop():ac.call(f,y,1),--this.size,!0}function dc(u){var f=this.__data__,y=Jn(f,u);return y<0?n:f[y][1]}function Sm(u){return Jn(this.__data__,u)>-1}function Em(u,f){var y=this.__data__,M=Jn(y,u);return M<0?(++this.size,y.push([u,f])):y[M][1]=f,this}dr.prototype.clear=Ps,dr.prototype.delete=xr,dr.prototype.get=dc,dr.prototype.has=Sm,dr.prototype.set=Em;function to(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;){var M=u[f];this.set(M[0],M[1])}}function Tm(){this.size=0,this.__data__={hash:new Tr,map:new(ji||dr),string:new Tr}}function ma(u){var f=Bc(this,u).delete(u);return this.size-=f?1:0,f}function pc(u){return Bc(this,u).get(u)}function Md(u){return Bc(this,u).has(u)}function Cm(u,f){var y=Bc(this,u),M=y.size;return y.set(u,f),this.size+=y.size==M?0:1,this}to.prototype.clear=Tm,to.prototype.delete=ma,to.prototype.get=pc,to.prototype.has=Md,to.prototype.set=Cm;function Bi(u){var f=-1,y=u==null?0:u.length;for(this.__data__=new to;++f<y;)this.add(u[f])}function Ja(u){return this.__data__.set(u,d),this}function js(u){return this.__data__.has(u)}Bi.prototype.add=Bi.prototype.push=Ja,Bi.prototype.has=js;function Zn(u){var f=this.__data__=new dr(u);this.size=f.size}function hc(){this.__data__=new dr,this.size=0}function mc(u){var f=this.__data__,y=f.delete(u);return this.size=f.size,y}function no(u){return this.__data__.get(u)}function ro(u){return this.__data__.has(u)}function Yi(u,f){var y=this.__data__;if(y instanceof dr){var M=y.__data__;if(!ji||M.length<o-1)return M.push([u,f]),this.size=++y.size,this;y=this.__data__=new to(M)}return y.set(u,f),this.size=y.size,this}Zn.prototype.clear=hc,Zn.prototype.delete=mc,Zn.prototype.get=no,Zn.prototype.has=ro,Zn.prototype.set=Yi;function qo(u,f){var y=Tt(u),M=!y&&hu(u),L=!y&&!M&&tl(u),H=!y&&!M&&!L&&uf(u),K=y||M||L||H,ee=K?yd(u.length,Fy):[],se=ee.length;for(var ke in u)(f||Rt.call(u,ke))&&!(K&&(ke=="length"||L&&(ke=="offset"||ke=="parent")||H&&(ke=="buffer"||ke=="byteLength"||ke=="byteOffset")||ao(ke,se)))&&ee.push(ke);return ee}function Wo(u){var f=u.length;return f?u[Zl(0,f-1)]:n}function Hi(u,f){return Ur(hr(u),ga(f,0,u.length))}function xm(u){return Ur(hr(u))}function zl(u,f,y){(y!==n&&!Ea(u[f],y)||y===n&&!(f in u))&&Go(u,f,y)}function Ui(u,f,y){var M=u[f];(!(Rt.call(u,f)&&Ea(M,y))||y===n&&!(f in u))&&Go(u,f,y)}function Jn(u,f){for(var y=u.length;y--;)if(Ea(u[y][0],f))return y;return-1}function Br(u,f,y,M){return Qo(u,function(L,H,K){f(M,L,y(L),K)}),M}function Zt(u,f){return u&&No(f,ar(f),u)}function To(u,f){return u&&No(f,uo(f),u)}function Go(u,f,y){f=="__proto__"&&Bl?Bl(u,f,{configurable:!0,enumerable:!0,value:y,writable:!0}):u[f]=y}function gc(u,f){for(var y=-1,M=f.length,L=me(M),H=u==null;++y<M;)L[y]=H?n:e0(u,f[y]);return L}function ga(u,f,y){return u===u&&(y!==n&&(u=u<=y?u:y),f!==n&&(u=u>=f?u:f)),u}function Mr(u,f,y,M,L,H){var K,ee=f&m,se=f&w,ke=f&b;if(y&&(K=L?y(u,M,L,H):y(u)),K!==n)return K;if(!vn(u))return u;var Ne=Tt(u);if(Ne){if(K=qm(u),!ee)return hr(u,K)}else{var Oe=nr(u),ze=Oe==Ke||Oe==Xe;if(tl(u))return Yd(u,ee);if(Oe==dt||Oe==Se||ze&&!L){if(K=se||ze?{}:Ks(u),!ee)return se?Oy(u,To(K,u)):_m(u,Zt(K,u))}else{if(!jt[Oe])return L?u:{};K=rr(u,Oe,ee)}}H||(H=new Zn);var ot=H.get(u);if(ot)return ot;H.set(u,K),ub(u)?u.forEach(function(vt){K.add(Mr(vt,f,y,vt,u,H))}):sb(u)&&u.forEach(function(vt,Mt){K.set(Mt,Mr(vt,f,y,Mt,u,H))});var gt=ke?se?ou:jc:se?uo:ar,xt=Ne?n:gt(u);return Wn(xt||u,function(vt,Mt){xt&&(Mt=vt,vt=u[Mt]),Ui(K,Mt,Mr(vt,f,y,Mt,u,H))}),K}function Mm(u){var f=ar(u);return function(y){return $l(y,u,f)}}function $l(u,f,y){var M=y.length;if(u==null)return!M;for(u=zt(u);M--;){var L=y[M],H=f[L],K=u[L];if(K===n&&!(L in u)||!H(K))return!1}return!0}function kd(u,f,y){if(typeof u!="function")throw new eo(s);return Zs(function(){u.apply(n,y)},f)}function Ko(u,f,y,M){var L=-1,H=Ku,K=!0,ee=u.length,se=[],ke=f.length;if(!ee)return se;y&&(f=qt(f,_r(y))),M?(H=dd,K=!1):f.length>=o&&(H=fa,K=!1,f=new Bi(f));e:for(;++L<ee;){var Ne=u[L],Oe=y==null?Ne:y(Ne);if(Ne=M||Ne!==0?Ne:0,K&&Oe===Oe){for(var ze=ke;ze--;)if(f[ze]===Oe)continue e;se.push(Ne)}else H(f,Oe,M)||se.push(Ne)}return se}var Qo=Pm(oo),km=Pm(Xa,!0);function Co(u,f){var y=!0;return Qo(u,function(M,L,H){return y=!!f(M,L,H),y}),y}function Vi(u,f,y){for(var M=-1,L=u.length;++M<L;){var H=u[M],K=f(H);if(K!=null&&(ee===n?K===K&&!Ao(K):y(K,ee)))var ee=K,se=H}return se}function vc(u,f,y,M){var L=u.length;for(y=Ct(y),y<0&&(y=-y>L?0:L+y),M=M===n||M>L?L:Ct(M),M<0&&(M+=L),M=y>M?0:fb(M);y<M;)u[y++]=f;return u}function zi(u,f){var y=[];return Qo(u,function(M,L,H){f(M,L,H)&&y.push(M)}),y}function kn(u,f,y,M,L){var H=-1,K=u.length;for(y||(y=_y),L||(L=[]);++H<K;){var ee=u[H];f>0&&y(ee)?f>1?kn(ee,f-1,y,M,L):$a(L,ee):M||(L[L.length]=ee)}return L}var ql=$d(),yc=$d(!0);function oo(u,f){return u&&ql(u,f,ar)}function Xa(u,f){return u&&yc(u,f,ar)}function pr(u,f){return za(f,function(y){return Ji(u[y])})}function Yr(u,f){f=va(f,u);for(var y=0,M=f.length;u!=null&&y<M;)u=u[Fo(f[y++])];return y&&y==M?u:n}function wc(u,f,y){var M=f(u);return Tt(u)?M:$a(M,y(u))}function Xn(u){return u==null?u===n?_a:Dt:_i&&_i in zt(u)?zm(u):Qm(u)}function xo(u,f){return u>f}function ei(u,f){return u!=null&&Rt.call(u,f)}function Nd(u,f){return u!=null&&f in zt(u)}function Nm(u,f,y){return u>=Gn(f,y)&&u<bn(f,y)}function Mo(u,f,y){for(var M=y?dd:Ku,L=u[0].length,H=u.length,K=H,ee=me(H),se=1/0,ke=[];K--;){var Ne=u[K];K&&f&&(Ne=qt(Ne,_r(f))),se=Gn(Ne.length,se),ee[K]=!y&&(f||L>=120&&Ne.length>=120)?new Bi(K&&Ne):n}Ne=u[0];var Oe=-1,ze=ee[0];e:for(;++Oe<L&&ke.length<se;){var ot=Ne[Oe],gt=f?f(ot):ot;if(ot=y||ot!==0?ot:0,!(ze?fa(ze,gt):M(ke,gt,y))){for(K=H;--K;){var xt=ee[K];if(!(xt?fa(xt,gt):M(u[K],gt,y)))continue e}ze&&ze.push(gt),ke.push(ot)}}return ke}function ti(u,f,y,M){return oo(u,function(L,H,K){f(M,y(L),H,K)}),M}function ni(u,f,y){f=va(f,u),u=Uc(u,f);var M=u==null?u:u[Fo(On(f))];return M==null?n:fr(M,u,y)}function Fd(u){return Sn(u)&&Xn(u)==Se}function bc(u){return Sn(u)&&Xn(u)==Qr}function Fm(u){return Sn(u)&&Xn(u)==yt}function Bs(u,f,y,M,L){return u===f?!0:u==null||f==null||!Sn(u)&&!Sn(f)?u!==u&&f!==f:Id(u,f,y,M,Bs,L)}function Id(u,f,y,M,L,H){var K=Tt(u),ee=Tt(f),se=K?Re:nr(u),ke=ee?Re:nr(f);se=se==Se?dt:se,ke=ke==Se?dt:ke;var Ne=se==dt,Oe=ke==dt,ze=se==ke;if(ze&&tl(u)){if(!tl(f))return!1;K=!0,Ne=!1}if(ze&&!Ne)return H||(H=new Zn),K||uf(u)?Pc(u,f,y,M,L,H):Vm(u,f,se,y,M,L,H);if(!(y&T)){var ot=Ne&&Rt.call(u,"__wrapped__"),gt=Oe&&Rt.call(f,"__wrapped__");if(ot||gt){var xt=ot?u.value():u,vt=gt?f.value():f;return H||(H=new Zn),L(xt,vt,y,M,H)}}return ze?(H||(H=new Zn),Zd(u,f,y,M,L,H)):!1}function Dc(u){return Sn(u)&&nr(u)==Ge}function Sc(u,f,y,M){var L=y.length,H=L,K=!M;if(u==null)return!H;for(u=zt(u);L--;){var ee=y[L];if(K&&ee[2]?ee[1]!==u[ee[0]]:!(ee[0]in u))return!1}for(;++L<H;){ee=y[L];var se=ee[0],ke=u[se],Ne=ee[1];if(K&&ee[2]){if(ke===n&&!(se in u))return!1}else{var Oe=new Zn;if(M)var ze=M(ke,Ne,se,u,f,Oe);if(!(ze===n?Bs(Ne,ke,T|E,M,Oe):ze))return!1}}return!0}function Ad(u){if(!vn(u)||tp(u))return!1;var f=Ji(u)?vm:Bh;return f.test(li(u))}function Im(u){return Sn(u)&&Xn(u)==cn}function Od(u){return Sn(u)&&nr(u)==en}function Wl(u){return Sn(u)&&dg(u.length)&&!!Ht[Xn(u)]}function Gl(u){return typeof u=="function"?u:u==null?co:typeof u=="object"?Tt(u)?ko(u[0],u[1]):Ys(u):Sb(u)}function Ec(u){if(!su(u))return Is(u);var f=[];for(var y in zt(u))Rt.call(u,y)&&y!="constructor"&&f.push(y);return f}function Am(u){if(!vn(u))return Km(u);var f=su(u),y=[];for(var M in u)M=="constructor"&&(f||!Rt.call(u,M))||y.push(M);return y}function ri(u,f){return u<f}function Rd(u,f){var y=-1,M=lo(u)?me(u.length):[];return Qo(u,function(L,H,K){M[++y]=f(L,H,K)}),M}function Ys(u){var f=Yc(u);return f.length==1&&f[0][2]?lu(f[0][0],f[0][1]):function(y){return y===u||Sc(y,u,f)}}function ko(u,f){return ep(u)&&Qs(f)?lu(Fo(u),f):function(y){var M=e0(y,u);return M===n&&M===f?t0(y,u):Bs(f,M,T|E)}}function oi(u,f,y,M,L){u!==f&&ql(f,function(H,K){if(L||(L=new Zn),vn(H))Kl(u,f,K,y,oi,M,L);else{var ee=M?M(Hr(u,K),H,K+"",u,f,L):n;ee===n&&(ee=H),zl(u,K,ee)}},uo)}function Kl(u,f,y,M,L,H,K){var ee=Hr(u,y),se=Hr(f,y),ke=K.get(se);if(ke){zl(u,y,ke);return}var Ne=H?H(ee,se,y+"",u,f,K):n,Oe=Ne===n;if(Oe){var ze=Tt(se),ot=!ze&&tl(se),gt=!ze&&!ot&&uf(se);Ne=se,ze||ot||gt?Tt(ee)?Ne=ee:Rn(ee)?Ne=hr(ee):ot?(Oe=!1,Ne=Yd(se,!0)):gt?(Oe=!1,Ne=Ud(se,!0)):Ne=[]:Sp(se)||hu(se)?(Ne=ee,hu(ee)?Ne=db(ee):(!vn(ee)||Ji(ee))&&(Ne=Ks(se))):Oe=!1}Oe&&(K.set(se,Ne),L(Ne,se,M,H,K),K.delete(se)),zl(u,y,Ne)}function ai(u,f){var y=u.length;if(y)return f+=f<0?y:0,ao(f,y)?u[f]:n}function Tc(u,f,y){f.length?f=qt(f,function(H){return Tt(H)?function(K){return Yr(K,H.length===1?H[0]:H)}:H}):f=[co];var M=-1;f=qt(f,_r(st()));var L=Rd(u,function(H,K,ee){var se=qt(f,function(ke){return ke(H)});return{criteria:se,index:++M,value:H}});return Sy(L,function(H,K){return Lm(H,K,y)})}function Hs(u,f){return Ld(u,f,function(y,M){return t0(u,M)})}function Ld(u,f,y){for(var M=-1,L=f.length,H={};++M<L;){var K=f[M],ee=Yr(u,K);y(ee,K)&&an(H,va(K,u),ee)}return H}function _d(u){return function(f){return Yr(f,u)}}function Jt(u,f,y,M){var L=M?md:Ts,H=-1,K=f.length,ee=u;for(u===f&&(f=hr(f)),y&&(ee=qt(u,_r(y)));++H<K;)for(var se=0,ke=f[H],Ne=y?y(ke):ke;(se=L(ee,Ne,se,M))>-1;)ee!==u&&ac.call(ee,se,1),ac.call(u,se,1);return u}function Ql(u,f){for(var y=u?f.length:0,M=y-1;y--;){var L=f[y];if(y==M||L!==H){var H=L;ao(L)?ac.call(u,L,1):qi(u,L)}}return u}function Zl(u,f){return u+Wa(Yl()*(f-u+1))}function Pd(u,f,y,M){for(var L=-1,H=bn(Pi((f-u)/(y||1)),0),K=me(H);H--;)K[M?H:++L]=u,u+=y;return K}function Us(u,f){var y="";if(!u||f<1||f>re)return y;do f%2&&(y+=u),f=Wa(f/2),f&&(u+=u);while(f);return y}function Et(u,f){return Vc(Hc(u,f,co),u+"")}function $i(u){return Wo(cf(u))}function on(u,f){var y=cf(u);return Ur(y,ga(f,0,y.length))}function an(u,f,y,M){if(!vn(u))return u;f=va(f,u);for(var L=-1,H=f.length,K=H-1,ee=u;ee!=null&&++L<H;){var se=Fo(f[L]),ke=y;if(se==="__proto__"||se==="constructor"||se==="prototype")return u;if(L!=K){var Ne=ee[se];ke=M?M(Ne,se,ee):n,ke===n&&(ke=vn(Ne)?Ne:ao(f[L+1])?[]:{})}Ui(ee,se,ke),ee=ee[se]}return u}var Nn=uc?function(u,f){return uc.set(u,f),u}:co,Cc=Bl?function(u,f){return Bl(u,"toString",{configurable:!0,enumerable:!1,value:r0(f),writable:!0})}:co;function Jl(u){return Ur(cf(u))}function er(u,f,y){var M=-1,L=u.length;f<0&&(f=-f>L?0:L+f),y=y>L?L:y,y<0&&(y+=L),L=f>y?0:y-f>>>0,f>>>=0;for(var H=me(L);++M<L;)H[M]=u[M+f];return H}function Ay(u,f){var y;return Qo(u,function(M,L,H){return y=f(M,L,H),!y}),!!y}function Fn(u,f,y){var M=0,L=u==null?M:u.length;if(typeof f=="number"&&f===f&&L<=we){for(;M<L;){var H=M+L>>>1,K=u[H];K!==null&&!Ao(K)&&(y?K<=f:K<f)?M=H+1:L=H}return L}return Xl(u,f,co,y)}function Xl(u,f,y,M){var L=0,H=u==null?0:u.length;if(H===0)return 0;f=y(f);for(var K=f!==f,ee=f===null,se=Ao(f),ke=f===n;L<H;){var Ne=Wa((L+H)/2),Oe=y(u[Ne]),ze=Oe!==n,ot=Oe===null,gt=Oe===Oe,xt=Ao(Oe);if(K)var vt=M||gt;else ke?vt=gt&&(M||ze):ee?vt=gt&&ze&&(M||!ot):se?vt=gt&&ze&&!ot&&(M||!xt):ot||xt?vt=!1:vt=M?Oe<=f:Oe<f;vt?L=Ne+1:H=Ne}return Gn(H,le)}function xc(u,f){for(var y=-1,M=u.length,L=0,H=[];++y<M;){var K=u[y],ee=f?f(K):K;if(!y||!Ea(ee,se)){var se=ee;H[L++]=K===0?0:K}}return H}function Mc(u){return typeof u=="number"?u:Ao(u)?V:+u}function fn(u){if(typeof u=="string")return u;if(Tt(u))return qt(u,fn)+"";if(Ao(u))return cc?cc.call(u):"";var f=u+"";return f=="0"&&1/u==-De?"-0":f}function In(u,f,y){var M=-1,L=Ku,H=u.length,K=!0,ee=[],se=ee;if(y)K=!1,L=dd;else if(H>=o){var ke=f?null:mr(u);if(ke)return qa(ke);K=!1,L=fa,se=new Bi}else se=f?[]:ee;e:for(;++M<H;){var Ne=u[M],Oe=f?f(Ne):Ne;if(Ne=y||Ne!==0?Ne:0,K&&Oe===Oe){for(var ze=se.length;ze--;)if(se[ze]===Oe)continue e;f&&se.push(Oe),ee.push(Ne)}else L(se,Oe,y)||(se!==ee&&se.push(Oe),ee.push(Ne))}return ee}function qi(u,f){return f=va(f,u),u=Uc(u,f),u==null||delete u[Fo(On(f))]}function kc(u,f,y,M){return an(u,f,y(Yr(u,f)),M)}function Vs(u,f,y,M){for(var L=u.length,H=M?L:-1;(M?H--:++H<L)&&f(u[H],H,u););return y?er(u,M?0:H,M?H+1:L):er(u,M?H+1:0,M?L:H)}function jd(u,f){var y=u;return y instanceof St&&(y=y.value()),pd(f,function(M,L){return L.func.apply(L.thisArg,$a([M],L.args))},y)}function Nc(u,f,y){var M=u.length;if(M<2)return M?In(u[0]):[];for(var L=-1,H=me(M);++L<M;)for(var K=u[L],ee=-1;++ee<M;)ee!=L&&(H[L]=Ko(H[L]||K,u[ee],f,y));return In(kn(H,1),f,y)}function Bd(u,f,y){for(var M=-1,L=u.length,H=f.length,K={};++M<L;){var ee=M<H?f[M]:n;y(K,u[M],ee)}return K}function Fc(u){return Rn(u)?u:[]}function Ic(u){return typeof u=="function"?u:co}function va(u,f){return Tt(u)?u:ep(u,f)?[u]:Zm($t(u))}var Om=Et;function ya(u,f,y){var M=u.length;return y=y===n?M:y,!f&&y>=M?u:er(u,f,y)}var zs=wm||function(u){return nn.clearTimeout(u)};function Yd(u,f){if(f)return u.slice();var y=u.length,M=Sd?Sd(y):new u.constructor(y);return u.copy(M),M}function $s(u){var f=new u.constructor(u.byteLength);return new jl(f).set(new jl(u)),f}function Ac(u,f){var y=f?$s(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.byteLength)}function Rm(u){var f=new u.constructor(u.source,ed.exec(u));return f.lastIndex=u.lastIndex,f}function Hd(u){return jr?zt(jr.call(u)):{}}function Ud(u,f){var y=f?$s(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.length)}function Vd(u,f){if(u!==f){var y=u!==n,M=u===null,L=u===u,H=Ao(u),K=f!==n,ee=f===null,se=f===f,ke=Ao(f);if(!ee&&!ke&&!H&&u>f||H&&K&&se&&!ee&&!ke||M&&K&&se||!y&&se||!L)return 1;if(!M&&!H&&!ke&&u<f||ke&&y&&L&&!M&&!H||ee&&y&&L||!K&&L||!se)return-1}return 0}function Lm(u,f,y){for(var M=-1,L=u.criteria,H=f.criteria,K=L.length,ee=y.length;++M<K;){var se=Vd(L[M],H[M]);if(se){if(M>=ee)return se;var ke=y[M];return se*(ke=="desc"?-1:1)}}return u.index-f.index}function zd(u,f,y,M){for(var L=-1,H=u.length,K=y.length,ee=-1,se=f.length,ke=bn(H-K,0),Ne=me(se+ke),Oe=!M;++ee<se;)Ne[ee]=f[ee];for(;++L<K;)(Oe||L<H)&&(Ne[y[L]]=u[L]);for(;ke--;)Ne[ee++]=u[L++];return Ne}function Oc(u,f,y,M){for(var L=-1,H=u.length,K=-1,ee=y.length,se=-1,ke=f.length,Ne=bn(H-ee,0),Oe=me(Ne+ke),ze=!M;++L<Ne;)Oe[L]=u[L];for(var ot=L;++se<ke;)Oe[ot+se]=f[se];for(;++K<ee;)(ze||L<H)&&(Oe[ot+y[K]]=u[L++]);return Oe}function hr(u,f){var y=-1,M=u.length;for(f||(f=me(M));++y<M;)f[y]=u[y];return f}function No(u,f,y,M){var L=!y;y||(y={});for(var H=-1,K=f.length;++H<K;){var ee=f[H],se=M?M(y[ee],u[ee],ee,y,u):n;se===n&&(se=u[ee]),L?Go(y,ee,se):Ui(y,ee,se)}return y}function _m(u,f){return No(u,Gs(u),f)}function Oy(u,f){return No(u,Xo(u),f)}function eu(u,f){return function(y,M){var L=Tt(y)?cd:Br,H=f?f():{};return L(y,u,st(M,2),H)}}function qs(u){return Et(function(f,y){var M=-1,L=y.length,H=L>1?y[L-1]:n,K=L>2?y[2]:n;for(H=u.length>3&&typeof H=="function"?(L--,H):n,K&&Bt(y[0],y[1],K)&&(H=L<3?n:H,L=1),f=zt(f);++M<L;){var ee=y[M];ee&&u(f,ee,M,H)}return f})}function Pm(u,f){return function(y,M){if(y==null)return y;if(!lo(y))return u(y,M);for(var L=y.length,H=f?L:-1,K=zt(y);(f?H--:++H<L)&&M(K[H],H,K)!==!1;);return y}}function $d(u){return function(f,y,M){for(var L=-1,H=zt(f),K=M(f),ee=K.length;ee--;){var se=K[u?ee:++L];if(y(H[se],se,H)===!1)break}return f}}function jm(u,f,y){var M=f&k,L=tu(u);function H(){var K=this&&this!==nn&&this instanceof H?L:u;return K.apply(M?y:this,arguments)}return H}function qd(u){return function(f){f=$t(f);var y=xs(f)?Pr(f):n,M=y?y[0]:f.charAt(0),L=y?ya(y,1).join(""):f.slice(1);return M[u]()+L}}function wa(u){return function(f){return pd(bb(wb(f).replace(hy,"")),u,"")}}function tu(u){return function(){var f=arguments;switch(f.length){case 0:return new u;case 1:return new u(f[0]);case 2:return new u(f[0],f[1]);case 3:return new u(f[0],f[1],f[2]);case 4:return new u(f[0],f[1],f[2],f[3]);case 5:return new u(f[0],f[1],f[2],f[3],f[4]);case 6:return new u(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new u(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var y=Ls(u.prototype),M=u.apply(y,f);return vn(M)?M:y}}function Ry(u,f,y){var M=tu(u);function L(){for(var H=arguments.length,K=me(H),ee=H,se=ii(L);ee--;)K[ee]=arguments[ee];var ke=H<3&&K[0]!==se&&K[H-1]!==se?[]:Xr(K,se);if(H-=ke.length,H<y)return Hm(u,f,Ws,L.placeholder,n,K,ke,n,n,y-H);var Ne=this&&this!==nn&&this instanceof L?M:u;return fr(Ne,this,K)}return L}function Bm(u){return function(f,y,M){var L=zt(f);if(!lo(f)){var H=st(y,3);f=ar(f),y=function(ee){return H(L[ee],ee,L)}}var K=u(f,y,M);return K>-1?L[H?f[K]:K]:n}}function Wi(u){return Jo(function(f){var y=f.length,M=y,L=Kn.prototype.thru;for(u&&f.reverse();M--;){var H=f[M];if(typeof H!="function")throw new eo(s);if(L&&!K&&iu(H)=="wrapper")var K=new Kn([],!0)}for(M=K?M:y;++M<y;){H=f[M];var ee=iu(H),se=ee=="wrapper"?au(H):n;se&&si(se[0])&&se[1]==(j|B|_|z)&&!se[4].length&&se[9]==1?K=K[iu(se[0])].apply(K,se[3]):K=H.length==1&&si(H)?K[ee]():K.thru(H)}return function(){var ke=arguments,Ne=ke[0];if(K&&ke.length==1&&Tt(Ne))return K.plant(Ne).value();for(var Oe=0,ze=y?f[Oe].apply(this,ke):Ne;++Oe<y;)ze=f[Oe].call(this,ze);return ze}})}function Ws(u,f,y,M,L,H,K,ee,se,ke){var Ne=f&j,Oe=f&k,ze=f&C,ot=f&(B|F),gt=f&q,xt=ze?n:tu(u);function vt(){for(var Mt=arguments.length,At=me(Mt),Oo=Mt;Oo--;)At[Oo]=arguments[Oo];if(ot)var $r=ii(vt),Ro=um(At,$r);if(M&&(At=zd(At,M,L,ot)),H&&(At=Oc(At,H,K,ot)),Mt-=Ro,ot&&Mt<ke){var Ln=Xr(At,$r);return Hm(u,f,Ws,vt.placeholder,y,At,Ln,ee,se,ke-Mt)}var Ta=Oe?y:this,es=ze?Ta[u]:u;return Mt=At.length,ee?At=Yn(At,ee):gt&&Mt>1&&At.reverse(),Ne&&se<Mt&&(At.length=se),this&&this!==nn&&this instanceof vt&&(es=xt||tu(es)),es.apply(Ta,At)}return vt}function Rc(u,f){return function(y,M){return ti(y,u,f(M),{})}}function Lc(u,f){return function(y,M){var L;if(y===n&&M===n)return f;if(y!==n&&(L=y),M!==n){if(L===n)return M;typeof y=="string"||typeof M=="string"?(y=fn(y),M=fn(M)):(y=Mc(y),M=Mc(M)),L=u(y,M)}return L}}function _c(u){return Jo(function(f){return f=qt(f,_r(st())),Et(function(y){var M=this;return u(f,function(L){return fr(L,M,y)})})})}function nu(u,f){f=f===n?" ":fn(f);var y=f.length;if(y<2)return y?Us(f,u):f;var M=Us(f,Pi(u/Li(f)));return xs(f)?ya(Pr(M),0,u).join(""):M.slice(0,u)}function Ym(u,f,y,M){var L=f&k,H=tu(u);function K(){for(var ee=-1,se=arguments.length,ke=-1,Ne=M.length,Oe=me(Ne+se),ze=this&&this!==nn&&this instanceof K?H:u;++ke<Ne;)Oe[ke]=M[ke];for(;se--;)Oe[ke++]=arguments[++ee];return fr(ze,L?y:this,Oe)}return K}function Wd(u){return function(f,y,M){return M&&typeof M!="number"&&Bt(f,y,M)&&(y=M=n),f=Xi(f),y===n?(y=f,f=0):y=Xi(y),M=M===n?f<y?1:-1:Xi(M),Pd(f,y,M,u)}}function ru(u){return function(f,y){return typeof f=="string"&&typeof y=="string"||(f=ea(f),y=ea(y)),u(f,y)}}function Hm(u,f,y,M,L,H,K,ee,se,ke){var Ne=f&B,Oe=Ne?K:n,ze=Ne?n:K,ot=Ne?H:n,gt=Ne?n:H;f|=Ne?_:R,f&=~(Ne?R:_),f&I||(f&=~(k|C));var xt=[u,f,L,ot,Oe,gt,ze,ee,se,ke],vt=y.apply(n,xt);return si(u)&&Da(vt,xt),vt.placeholder=M,io(vt,u,f)}function tr(u){var f=wn[u];return function(y,M){if(y=ea(y),M=M==null?0:Gn(Ct(M),292),M&&Fs(y)){var L=($t(y)+"e").split("e"),H=f(L[0]+"e"+(+L[1]+M));return L=($t(H)+"e").split("e"),+(L[0]+"e"+(+L[1]-M))}return f(y)}}var mr=Ga&&1/qa(new Ga([,-0]))[1]==De?function(u){return new Ga(u)}:i0;function Gd(u){return function(f){var y=nr(f);return y==Ge?Ju(f):y==en?xy(f):Ey(f,u(f))}}function Zo(u,f,y,M,L,H,K,ee){var se=f&C;if(!se&&typeof u!="function")throw new eo(s);var ke=M?M.length:0;if(ke||(f&=~(_|R),M=L=n),K=K===n?K:bn(Ct(K),0),ee=ee===n?ee:Ct(ee),ke-=L?L.length:0,f&R){var Ne=M,Oe=L;M=L=n}var ze=se?n:au(u),ot=[u,f,y,M,L,Ne,Oe,H,K,ee];if(ze&&Gm(ot,ze),u=ot[0],f=ot[1],y=ot[2],M=ot[3],L=ot[4],ee=ot[9]=ot[9]===n?se?0:u.length:bn(ot[9]-ke,0),!ee&&f&(B|F)&&(f&=~(B|F)),!f||f==k)var gt=jm(u,f,y);else f==B||f==F?gt=Ry(u,f,ee):(f==_||f==(k|_))&&!L.length?gt=Ym(u,f,y,M):gt=Ws.apply(n,ot);var xt=ze?Nn:Da;return io(xt(gt,ot),u,f)}function Kd(u,f,y,M){return u===n||Ea(u,Vo[y])&&!Rt.call(M,y)?f:u}function Qd(u,f,y,M,L,H){return vn(u)&&vn(f)&&(H.set(f,u),oi(u,f,n,Qd,H),H.delete(f)),u}function Um(u){return Sp(u)?n:u}function Pc(u,f,y,M,L,H){var K=y&T,ee=u.length,se=f.length;if(ee!=se&&!(K&&se>ee))return!1;var ke=H.get(u),Ne=H.get(f);if(ke&&Ne)return ke==f&&Ne==u;var Oe=-1,ze=!0,ot=y&E?new Bi:n;for(H.set(u,f),H.set(f,u);++Oe<ee;){var gt=u[Oe],xt=f[Oe];if(M)var vt=K?M(xt,gt,Oe,f,u,H):M(gt,xt,Oe,u,f,H);if(vt!==n){if(vt)continue;ze=!1;break}if(ot){if(!hd(f,function(Mt,At){if(!fa(ot,At)&&(gt===Mt||L(gt,Mt,y,M,H)))return ot.push(At)})){ze=!1;break}}else if(!(gt===xt||L(gt,xt,y,M,H))){ze=!1;break}}return H.delete(u),H.delete(f),ze}function Vm(u,f,y,M,L,H,K){switch(y){case Sr:if(u.byteLength!=f.byteLength||u.byteOffset!=f.byteOffset)return!1;u=u.buffer,f=f.buffer;case Qr:return!(u.byteLength!=f.byteLength||!H(new jl(u),new jl(f)));case Be:case yt:case tt:return Ea(+u,+f);case Ve:return u.name==f.name&&u.message==f.message;case cn:case br:return u==f+"";case Ge:var ee=Ju;case en:var se=M&T;if(ee||(ee=qa),u.size!=f.size&&!se)return!1;var ke=K.get(u);if(ke)return ke==f;M|=E,K.set(u,f);var Ne=Pc(ee(u),ee(f),M,L,H,K);return K.delete(u),Ne;case Dr:if(jr)return jr.call(u)==jr.call(f)}return!1}function Zd(u,f,y,M,L,H){var K=y&T,ee=jc(u),se=ee.length,ke=jc(f),Ne=ke.length;if(se!=Ne&&!K)return!1;for(var Oe=se;Oe--;){var ze=ee[Oe];if(!(K?ze in f:Rt.call(f,ze)))return!1}var ot=H.get(u),gt=H.get(f);if(ot&&gt)return ot==f&&gt==u;var xt=!0;H.set(u,f),H.set(f,u);for(var vt=K;++Oe<se;){ze=ee[Oe];var Mt=u[ze],At=f[ze];if(M)var Oo=K?M(At,Mt,ze,f,u,H):M(Mt,At,ze,u,f,H);if(!(Oo===n?Mt===At||L(Mt,At,y,M,H):Oo)){xt=!1;break}vt||(vt=ze=="constructor")}if(xt&&!vt){var $r=u.constructor,Ro=f.constructor;$r!=Ro&&"constructor"in u&&"constructor"in f&&!(typeof $r=="function"&&$r instanceof $r&&typeof Ro=="function"&&Ro instanceof Ro)&&(xt=!1)}return H.delete(u),H.delete(f),xt}function Jo(u){return Vc(Hc(u,n,uu),u+"")}function jc(u){return wc(u,ar,Gs)}function ou(u){return wc(u,uo,Xo)}var au=uc?function(u){return uc.get(u)}:i0;function iu(u){for(var f=u.name+"",y=Os[f],M=Rt.call(Os,f)?y.length:0;M--;){var L=y[M],H=L.func;if(H==null||H==u)return L.name}return f}function ii(u){var f=Rt.call(Y,"placeholder")?Y:u;return f.placeholder}function st(){var u=Y.iteratee||o0;return u=u===o0?Gl:u,arguments.length?u(arguments[0],arguments[1]):u}function Bc(u,f){var y=u.__data__;return Qe(f)?y[typeof f=="string"?"string":"hash"]:y.map}function Yc(u){for(var f=ar(u),y=f.length;y--;){var M=f[y],L=u[M];f[y]=[M,L,Qs(L)]}return f}function ba(u,f){var y=Cs(u,f);return Ad(y)?y:n}function zm(u){var f=Rt.call(u,_i),y=u[_i];try{u[_i]=n;var M=!0}catch{}var L=_l.call(u);return M&&(f?u[_i]=y:delete u[_i]),L}var Gs=ic?function(u){return u==null?[]:(u=zt(u),za(ic(u),function(f){return oc.call(u,f)}))}:s0,Xo=ic?function(u){for(var f=[];u;)$a(f,Gs(u)),u=Eo(u);return f}:s0,nr=Xn;(Hl&&nr(new Hl(new ArrayBuffer(1)))!=Sr||ji&&nr(new ji)!=Ge||Ul&&nr(Ul.resolve())!=Vt||Ga&&nr(new Ga)!=en||Vl&&nr(new Vl)!=yo)&&(nr=function(u){var f=Xn(u),y=f==dt?u.constructor:n,M=y?li(y):"";if(M)switch(M){case Cd:return Sr;case Ka:return Ge;case Dm:return Vt;case Rs:return en;case zo:return yo}return f});function $m(u,f,y){for(var M=-1,L=y.length;++M<L;){var H=y[M],K=H.size;switch(H.type){case"drop":u+=K;break;case"dropRight":f-=K;break;case"take":f=Gn(f,u+K);break;case"takeRight":u=bn(u,f-K);break}}return{start:u,end:f}}function Jd(u){var f=u.match(bo);return f?f[1].split(Do):[]}function Xd(u,f,y){f=va(f,u);for(var M=-1,L=f.length,H=!1;++M<L;){var K=Fo(f[M]);if(!(H=u!=null&&y(u,K)))break;u=u[K]}return H||++M!=L?H:(L=u==null?0:u.length,!!L&&dg(L)&&ao(K,L)&&(Tt(u)||hu(u)))}function qm(u){var f=u.length,y=new u.constructor(f);return f&&typeof u[0]=="string"&&Rt.call(u,"index")&&(y.index=u.index,y.input=u.input),y}function Ks(u){return typeof u.constructor=="function"&&!su(u)?Ls(Eo(u)):{}}function rr(u,f,y){var M=u.constructor;switch(f){case Qr:return $s(u);case Be:case yt:return new M(+u);case Sr:return Ac(u,y);case gs:case ua:case ca:case Tl:case Mi:case ki:case vs:case Pa:case Ni:return Ud(u,y);case Ge:return new M;case tt:case br:return new M(u);case cn:return Rm(u);case en:return new M;case Dr:return Hd(u)}}function Ly(u,f){var y=f.length;if(!y)return u;var M=y-1;return f[M]=(y>1?"& ":"")+f[M],f=f.join(y>2?", ":" "),u.replace(wo,`{
/* [wrapped with `+f+`] */
`)}function _y(u){return Tt(u)||hu(u)||!!(ym&&u&&u[ym])}function ao(u,f){var y=typeof u;return f=f??re,!!f&&(y=="number"||y!="symbol"&&Hh.test(u))&&u>-1&&u%1==0&&u<f}function Bt(u,f,y){if(!vn(y))return!1;var M=typeof f;return(M=="number"?lo(y)&&ao(f,y.length):M=="string"&&f in y)?Ea(y[f],u):!1}function ep(u,f){if(Tt(u))return!1;var y=typeof u;return y=="number"||y=="symbol"||y=="boolean"||u==null||Ao(u)?!0:Zr.test(u)||!mn.test(u)||f!=null&&u in zt(f)}function Qe(u){var f=typeof u;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?u!=="__proto__":u===null}function si(u){var f=iu(u),y=Y[f];if(typeof y!="function"||!(f in St.prototype))return!1;if(u===y)return!0;var M=au(y);return!!M&&u===M[0]}function tp(u){return!!tc&&tc in u}var Wm=ks?Ji:l0;function su(u){var f=u&&u.constructor,y=typeof f=="function"&&f.prototype||Vo;return u===y}function Qs(u){return u===u&&!vn(u)}function lu(u,f){return function(y){return y==null?!1:y[u]===f&&(f!==n||u in zt(y))}}function np(u){var f=ne(u,function(M){return y.size===h&&y.clear(),M}),y=f.cache;return f}function Gm(u,f){var y=u[1],M=f[1],L=y|M,H=L<(k|C|j),K=M==j&&y==B||M==j&&y==z&&u[7].length<=f[8]||M==(j|z)&&f[7].length<=f[8]&&y==B;if(!(H||K))return u;M&k&&(u[2]=f[2],L|=y&k?0:I);var ee=f[3];if(ee){var se=u[3];u[3]=se?zd(se,ee,f[4]):ee,u[4]=se?Xr(u[3],g):f[4]}return ee=f[5],ee&&(se=u[5],u[5]=se?Oc(se,ee,f[6]):ee,u[6]=se?Xr(u[5],g):f[6]),ee=f[7],ee&&(u[7]=ee),M&j&&(u[8]=u[8]==null?f[8]:Gn(u[8],f[8])),u[9]==null&&(u[9]=f[9]),u[0]=f[0],u[1]=L,u}function Km(u){var f=[];if(u!=null)for(var y in zt(u))f.push(y);return f}function Qm(u){return _l.call(u)}function Hc(u,f,y){return f=bn(f===n?u.length-1:f,0),function(){for(var M=arguments,L=-1,H=bn(M.length-f,0),K=me(H);++L<H;)K[L]=M[f+L];L=-1;for(var ee=me(f+1);++L<f;)ee[L]=M[L];return ee[f]=y(K),fr(u,this,ee)}}function Uc(u,f){return f.length<2?u:Yr(u,er(f,0,-1))}function Yn(u,f){for(var y=u.length,M=Gn(f.length,y),L=hr(u);M--;){var H=f[M];u[M]=ao(H,y)?L[H]:n}return u}function Hr(u,f){if(!(f==="constructor"&&typeof u[f]=="function")&&f!="__proto__")return u[f]}var Da=rp(Nn),Zs=Ed||function(u,f){return nn.setTimeout(u,f)},Vc=rp(Cc);function io(u,f,y){var M=f+"";return Vc(u,Ly(M,Jm(Jd(M),y)))}function rp(u){var f=0,y=0;return function(){var M=Iy(),L=ie-(M-y);if(y=M,L>0){if(++f>=ae)return arguments[0]}else f=0;return u.apply(n,arguments)}}function Ur(u,f){var y=-1,M=u.length,L=M-1;for(f=f===n?M:f;++y<f;){var H=Zl(y,L),K=u[H];u[H]=u[y],u[y]=K}return u.length=f,u}var Zm=np(function(u){var f=[];return u.charCodeAt(0)===46&&f.push(""),u.replace(Mn,function(y,M,L,H){f.push(L?H.replace(ly,"$1"):M||y)}),f});function Fo(u){if(typeof u=="string"||Ao(u))return u;var f=u+"";return f=="0"&&1/u==-De?"-0":f}function li(u){if(u!=null){try{return Ll.call(u)}catch{}try{return u+""}catch{}}return""}function Jm(u,f){return Wn(ue,function(y){var M="_."+y[0];f&y[1]&&!Ku(u,M)&&u.push(M)}),u.sort()}function op(u){if(u instanceof St)return u.clone();var f=new Kn(u.__wrapped__,u.__chain__);return f.__actions__=hr(u.__actions__),f.__index__=u.__index__,f.__values__=u.__values__,f}function Py(u,f,y){(y?Bt(u,f,y):f===n)?f=1:f=bn(Ct(f),0);var M=u==null?0:u.length;if(!M||f<1)return[];for(var L=0,H=0,K=me(Pi(M/f));L<M;)K[H++]=er(u,L,L+=f);return K}function zc(u){for(var f=-1,y=u==null?0:u.length,M=0,L=[];++f<y;){var H=u[f];H&&(L[M++]=H)}return L}function ap(){var u=arguments.length;if(!u)return[];for(var f=me(u-1),y=arguments[0],M=u;M--;)f[M-1]=arguments[M];return $a(Tt(y)?hr(y):[y],kn(f,1))}var so=Et(function(u,f){return Rn(u)?Ko(u,kn(f,1,Rn,!0)):[]}),It=Et(function(u,f){var y=On(f);return Rn(y)&&(y=n),Rn(u)?Ko(u,kn(f,1,Rn,!0),st(y,2)):[]}),_n=Et(function(u,f){var y=On(f);return Rn(y)&&(y=n),Rn(u)?Ko(u,kn(f,1,Rn,!0),n,y):[]});function Dn(u,f,y){var M=u==null?0:u.length;return M?(f=y||f===n?1:Ct(f),er(u,f<0?0:f,M)):[]}function Hn(u,f,y){var M=u==null?0:u.length;return M?(f=y||f===n?1:Ct(f),f=M-f,er(u,0,f<0?0:f)):[]}function Vr(u,f){return u&&u.length?Vs(u,st(f,3),!0,!0):[]}function Js(u,f){return u&&u.length?Vs(u,st(f,3),!0):[]}function An(u,f,y,M){var L=u==null?0:u.length;return L?(y&&typeof y!="number"&&Bt(u,f,y)&&(y=0,M=L),vc(u,f,y,M)):[]}function Xs(u,f,y){var M=u==null?0:u.length;if(!M)return-1;var L=y==null?0:Ct(y);return L<0&&(L=bn(M+L,0)),Qu(u,st(f,3),L)}function ui(u,f,y){var M=u==null?0:u.length;if(!M)return-1;var L=M-1;return y!==n&&(L=Ct(y),L=y<0?bn(M+L,0):Gn(L,M-1)),Qu(u,st(f,3),L,!0)}function uu(u){var f=u==null?0:u.length;return f?kn(u,1):[]}function ip(u){var f=u==null?0:u.length;return f?kn(u,De):[]}function cu(u,f){var y=u==null?0:u.length;return y?(f=f===n?1:Ct(f),kn(u,f)):[]}function kr(u){for(var f=-1,y=u==null?0:u.length,M={};++f<y;){var L=u[f];M[L[0]]=L[1]}return M}function $c(u){return u&&u.length?u[0]:n}function el(u,f,y){var M=u==null?0:u.length;if(!M)return-1;var L=y==null?0:Ct(y);return L<0&&(L=bn(M+L,0)),Ts(u,f,L)}function Sa(u){var f=u==null?0:u.length;return f?er(u,0,-1):[]}var qc=Et(function(u){var f=qt(u,Fc);return f.length&&f[0]===u[0]?Mo(f):[]}),sp=Et(function(u){var f=On(u),y=qt(u,Fc);return f===On(y)?f=n:y.pop(),y.length&&y[0]===u[0]?Mo(y,st(f,2)):[]}),ci=Et(function(u){var f=On(u),y=qt(u,Fc);return f=typeof f=="function"?f:n,f&&y.pop(),y.length&&y[0]===u[0]?Mo(y,n,f):[]});function Wc(u,f){return u==null?"":sc.call(u,f)}function On(u){var f=u==null?0:u.length;return f?u[f-1]:n}function Gc(u,f,y){var M=u==null?0:u.length;if(!M)return-1;var L=M;return y!==n&&(L=Ct(y),L=L<0?bn(M+L,0):Gn(L,M-1)),f===f?My(u,f,L):Qu(u,om,L,!0)}function fu(u,f){return u&&u.length?ai(u,Ct(f)):n}var lp=Et(du);function du(u,f){return u&&u.length&&f&&f.length?Jt(u,f):u}function Kc(u,f,y){return u&&u.length&&f&&f.length?Jt(u,f,st(y,2)):u}function gr(u,f,y){return u&&u.length&&f&&f.length?Jt(u,f,n,y):u}var fi=Jo(function(u,f){var y=u==null?0:u.length,M=gc(u,f);return Ql(u,qt(f,function(L){return ao(L,y)?+L:L}).sort(Vd)),M});function Io(u,f){var y=[];if(!(u&&u.length))return y;var M=-1,L=[],H=u.length;for(f=st(f,3);++M<H;){var K=u[M];f(K,M,u)&&(y.push(K),L.push(M))}return Ql(u,L),y}function or(u){return u==null?u:lc.call(u)}function Xm(u,f,y){var M=u==null?0:u.length;return M?(y&&typeof y!="number"&&Bt(u,f,y)?(f=0,y=M):(f=f==null?0:Ct(f),y=y===n?M:Ct(y)),er(u,f,y)):[]}function up(u,f){return Fn(u,f)}function cp(u,f,y){return Xl(u,f,st(y,2))}function jy(u,f){var y=u==null?0:u.length;if(y){var M=Fn(u,f);if(M<y&&Ea(u[M],f))return M}return-1}function di(u,f){return Fn(u,f,!0)}function eg(u,f,y){return Xl(u,f,st(y,2),!0)}function fp(u,f){var y=u==null?0:u.length;if(y){var M=Fn(u,f,!0)-1;if(Ea(u[M],f))return M}return-1}function Gi(u){return u&&u.length?xc(u):[]}function dp(u,f){return u&&u.length?xc(u,st(f,2)):[]}function Ki(u){var f=u==null?0:u.length;return f?er(u,1,f):[]}function tg(u,f,y){return u&&u.length?(f=y||f===n?1:Ct(f),er(u,0,f<0?0:f)):[]}function ng(u,f,y){var M=u==null?0:u.length;return M?(f=y||f===n?1:Ct(f),f=M-f,er(u,f<0?0:f,M)):[]}function pp(u,f){return u&&u.length?Vs(u,st(f,3),!1,!0):[]}function Qc(u,f){return u&&u.length?Vs(u,st(f,3)):[]}var By=Et(function(u){return In(kn(u,1,Rn,!0))}),Yy=Et(function(u){var f=On(u);return Rn(f)&&(f=n),In(kn(u,1,Rn,!0),st(f,2))}),rg=Et(function(u){var f=On(u);return f=typeof f=="function"?f:n,In(kn(u,1,Rn,!0),n,f)});function og(u){return u&&u.length?In(u):[]}function Qi(u,f){return u&&u.length?In(u,st(f,2)):[]}function Hy(u,f){return f=typeof f=="function"?f:n,u&&u.length?In(u,n,f):[]}function pi(u){if(!(u&&u.length))return[];var f=0;return u=za(u,function(y){if(Rn(y))return f=bn(y.length,f),!0}),yd(f,function(y){return qt(u,gd(y))})}function hp(u,f){if(!(u&&u.length))return[];var y=pi(u);return f==null?y:qt(y,function(M){return fr(f,n,M)})}var dn=Et(function(u,f){return Rn(u)?Ko(u,f):[]}),Uy=Et(function(u){return Nc(za(u,Rn))}),ag=Et(function(u){var f=On(u);return Rn(f)&&(f=n),Nc(za(u,Rn),st(f,2))}),Vy=Et(function(u){var f=On(u);return f=typeof f=="function"?f:n,Nc(za(u,Rn),n,f)}),zy=Et(pi);function ig(u,f){return Bd(u||[],f||[],Ui)}function sg(u,f){return Bd(u||[],f||[],an)}var $y=Et(function(u){var f=u.length,y=f>1?u[f-1]:n;return y=typeof y=="function"?(u.pop(),y):n,hp(u,y)});function zr(u){var f=Y(u);return f.__chain__=!0,f}function mp(u,f){return f(u),u}function Zc(u,f){return f(u)}var hi=Jo(function(u){var f=u.length,y=f?u[0]:0,M=this.__wrapped__,L=function(H){return gc(H,u)};return f>1||this.__actions__.length||!(M instanceof St)||!ao(y)?this.thru(L):(M=M.slice(y,+y+(f?1:0)),M.__actions__.push({func:Zc,args:[L],thisArg:n}),new Kn(M,this.__chain__).thru(function(H){return f&&!H.length&&H.push(n),H}))});function Jc(){return zr(this)}function Zi(){return new Kn(this.value(),this.__chain__)}function Xc(){this.__values__===n&&(this.__values__=cb(this.value()));var u=this.__index__>=this.__values__.length,f=u?n:this.__values__[this.__index__++];return{done:u,value:f}}function gp(){return this}function vp(u){for(var f,y=this;y instanceof $o;){var M=op(y);M.__index__=0,M.__values__=n,f?L.__wrapped__=M:f=M;var L=M;y=y.__wrapped__}return L.__wrapped__=u,f}function qy(){var u=this.__wrapped__;if(u instanceof St){var f=u;return this.__actions__.length&&(f=new St(this)),f=f.reverse(),f.__actions__.push({func:Zc,args:[or],thisArg:n}),new Kn(f,this.__chain__)}return this.thru(or)}function yp(){return jd(this.__wrapped__,this.__actions__)}var Wy=eu(function(u,f,y){Rt.call(u,y)?++u[y]:Go(u,y,1)});function lg(u,f,y){var M=Tt(u)?fd:Co;return y&&Bt(u,f,y)&&(f=n),M(u,st(f,3))}function ug(u,f){var y=Tt(u)?za:zi;return y(u,st(f,3))}var ef=Bm(Xs),tf=Bm(ui);function cg(u,f){return kn(af(u,f),1)}function wp(u,f){return kn(af(u,f),De)}function Gy(u,f,y){return y=y===n?1:Ct(y),kn(af(u,f),y)}function bp(u,f){var y=Tt(u)?Wn:Qo;return y(u,st(f,3))}function nf(u,f){var y=Tt(u)?Gu:km;return y(u,st(f,3))}var rf=eu(function(u,f,y){Rt.call(u,y)?u[y].push(f):Go(u,y,[f])});function Dp(u,f,y,M){u=lo(u)?u:cf(u),y=y&&!M?Ct(y):0;var L=u.length;return y<0&&(y=bn(L+y,0)),pg(u)?y<=L&&u.indexOf(f,y)>-1:!!L&&Ts(u,f,y)>-1}var of=Et(function(u,f,y){var M=-1,L=typeof f=="function",H=lo(u)?me(u.length):[];return Qo(u,function(K){H[++M]=L?fr(f,K,y):ni(K,f,y)}),H}),fg=eu(function(u,f,y){Go(u,y,f)});function af(u,f){var y=Tt(u)?qt:Rd;return y(u,st(f,3))}function sf(u,f,y,M){return u==null?[]:(Tt(f)||(f=f==null?[]:[f]),y=M?n:y,Tt(y)||(y=y==null?[]:[y]),Tc(u,f,y))}var Ky=eu(function(u,f,y){u[y?0:1].push(f)},function(){return[[],[]]});function pu(u,f,y){var M=Tt(u)?pd:im,L=arguments.length<3;return M(u,st(f,4),y,L,Qo)}function Qy(u,f,y){var M=Tt(u)?wy:im,L=arguments.length<3;return M(u,st(f,4),y,L,km)}function lf(u,f){var y=Tt(u)?za:zi;return y(u,de(st(f,3)))}function a(u){var f=Tt(u)?Wo:$i;return f(u)}function l(u,f,y){(y?Bt(u,f,y):f===n)?f=1:f=Ct(f);var M=Tt(u)?Hi:on;return M(u,f)}function p(u){var f=Tt(u)?xm:Jl;return f(u)}function v(u){if(u==null)return 0;if(lo(u))return pg(u)?Li(u):u.length;var f=nr(u);return f==Ge||f==en?u.size:Ec(u).length}function S(u,f,y){var M=Tt(u)?hd:Ay;return y&&Bt(u,f,y)&&(f=n),M(u,st(f,3))}var x=Et(function(u,f){if(u==null)return[];var y=f.length;return y>1&&Bt(u,f[0],f[1])?f=[]:y>2&&Bt(f[0],f[1],f[2])&&(f=[f[0]]),Tc(u,kn(f,1),[])}),P=Kt||function(){return nn.Date.now()};function W(u,f){if(typeof f!="function")throw new eo(s);return u=Ct(u),function(){if(--u<1)return f.apply(this,arguments)}}function X(u,f,y){return f=y?n:f,f=u&&f==null?u.length:f,Zo(u,j,n,n,n,n,f)}function ve(u,f){var y;if(typeof f!="function")throw new eo(s);return u=Ct(u),function(){return--u>0&&(y=f.apply(this,arguments)),u<=1&&(f=n),y}}var Ae=Et(function(u,f,y){var M=k;if(y.length){var L=Xr(y,ii(Ae));M|=_}return Zo(u,M,f,y,L)}),_e=Et(function(u,f,y){var M=k|C;if(y.length){var L=Xr(y,ii(_e));M|=_}return Zo(f,M,u,y,L)});function Ie(u,f,y){f=y?n:f;var M=Zo(u,B,n,n,n,n,n,f);return M.placeholder=Ie.placeholder,M}function We(u,f,y){f=y?n:f;var M=Zo(u,F,n,n,n,n,n,f);return M.placeholder=We.placeholder,M}function Je(u,f,y){var M,L,H,K,ee,se,ke=0,Ne=!1,Oe=!1,ze=!0;if(typeof u!="function")throw new eo(s);f=ea(f)||0,vn(y)&&(Ne=!!y.leading,Oe="maxWait"in y,H=Oe?bn(ea(y.maxWait)||0,f):H,ze="trailing"in y?!!y.trailing:ze);function ot(Ln){var Ta=M,es=L;return M=L=n,ke=Ln,K=u.apply(es,Ta),K}function gt(Ln){return ke=Ln,ee=Zs(Mt,f),Ne?ot(Ln):K}function xt(Ln){var Ta=Ln-se,es=Ln-ke,Eb=f-Ta;return Oe?Gn(Eb,H-es):Eb}function vt(Ln){var Ta=Ln-se,es=Ln-ke;return se===n||Ta>=f||Ta<0||Oe&&es>=H}function Mt(){var Ln=P();if(vt(Ln))return At(Ln);ee=Zs(Mt,xt(Ln))}function At(Ln){return ee=n,ze&&M?ot(Ln):(M=L=n,K)}function Oo(){ee!==n&&zs(ee),ke=0,M=se=L=ee=n}function $r(){return ee===n?K:At(P())}function Ro(){var Ln=P(),Ta=vt(Ln);if(M=arguments,L=this,se=Ln,Ta){if(ee===n)return gt(se);if(Oe)return zs(ee),ee=Zs(Mt,f),ot(se)}return ee===n&&(ee=Zs(Mt,f)),K}return Ro.cancel=Oo,Ro.flush=$r,Ro}var et=Et(function(u,f){return kd(u,1,f)}),gn=Et(function(u,f,y){return kd(u,ea(f)||0,y)});function ce(u){return Zo(u,q)}function ne(u,f){if(typeof u!="function"||f!=null&&typeof f!="function")throw new eo(s);var y=function(){var M=arguments,L=f?f.apply(this,M):M[0],H=y.cache;if(H.has(L))return H.get(L);var K=u.apply(this,M);return y.cache=H.set(L,K)||H,K};return y.cache=new(ne.Cache||to),y}ne.Cache=to;function de(u){if(typeof u!="function")throw new eo(s);return function(){var f=arguments;switch(f.length){case 0:return!u.call(this);case 1:return!u.call(this,f[0]);case 2:return!u.call(this,f[0],f[1]);case 3:return!u.call(this,f[0],f[1],f[2])}return!u.apply(this,f)}}function Pe(u){return ve(2,u)}var nt=Om(function(u,f){f=f.length==1&&Tt(f[0])?qt(f[0],_r(st())):qt(kn(f,1),_r(st()));var y=f.length;return Et(function(M){for(var L=-1,H=Gn(M.length,y);++L<H;)M[L]=f[L].call(this,M[L]);return fr(u,this,M)})}),lt=Et(function(u,f){var y=Xr(f,ii(lt));return Zo(u,_,n,f,y)}),ct=Et(function(u,f){var y=Xr(f,ii(ct));return Zo(u,R,n,f,y)}),wt=Jo(function(u,f){return Zo(u,z,n,n,n,f)});function Pn(u,f){if(typeof u!="function")throw new eo(s);return f=f===n?f:Ct(f),Et(u,f)}function Lt(u,f){if(typeof u!="function")throw new eo(s);return f=f==null?0:bn(Ct(f),0),Et(function(y){var M=y[f],L=ya(y,0,f);return M&&$a(L,M),fr(u,this,L)})}function mi(u,f,y){var M=!0,L=!0;if(typeof u!="function")throw new eo(s);return vn(y)&&(M="leading"in y?!!y.leading:M,L="trailing"in y?!!y.trailing:L),Je(u,f,{leading:M,maxWait:f,trailing:L})}function Zy(u){return X(u,1)}function aC(u,f){return lt(Ic(f),u)}function iC(){if(!arguments.length)return[];var u=arguments[0];return Tt(u)?u:[u]}function sC(u){return Mr(u,b)}function lC(u,f){return f=typeof f=="function"?f:n,Mr(u,b,f)}function uC(u){return Mr(u,m|b)}function cC(u,f){return f=typeof f=="function"?f:n,Mr(u,m|b,f)}function fC(u,f){return f==null||$l(u,f,ar(f))}function Ea(u,f){return u===f||u!==u&&f!==f}var dC=ru(xo),pC=ru(function(u,f){return u>=f}),hu=Fd(function(){return arguments}())?Fd:function(u){return Sn(u)&&Rt.call(u,"callee")&&!oc.call(u,"callee")},Tt=me.isArray,hC=ud?_r(ud):bc;function lo(u){return u!=null&&dg(u.length)&&!Ji(u)}function Rn(u){return Sn(u)&&lo(u)}function mC(u){return u===!0||u===!1||Sn(u)&&Xn(u)==Be}var tl=Td||l0,gC=Er?_r(Er):Fm;function vC(u){return Sn(u)&&u.nodeType===1&&!Sp(u)}function yC(u){if(u==null)return!0;if(lo(u)&&(Tt(u)||typeof u=="string"||typeof u.splice=="function"||tl(u)||uf(u)||hu(u)))return!u.length;var f=nr(u);if(f==Ge||f==en)return!u.size;if(su(u))return!Ec(u).length;for(var y in u)if(Rt.call(u,y))return!1;return!0}function wC(u,f){return Bs(u,f)}function bC(u,f,y){y=typeof y=="function"?y:n;var M=y?y(u,f):n;return M===n?Bs(u,f,n,y):!!M}function Jy(u){if(!Sn(u))return!1;var f=Xn(u);return f==Ve||f==Ee||typeof u.message=="string"&&typeof u.name=="string"&&!Sp(u)}function DC(u){return typeof u=="number"&&Fs(u)}function Ji(u){if(!vn(u))return!1;var f=Xn(u);return f==Ke||f==Xe||f==Ye||f==Yo}function ib(u){return typeof u=="number"&&u==Ct(u)}function dg(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=re}function vn(u){var f=typeof u;return u!=null&&(f=="object"||f=="function")}function Sn(u){return u!=null&&typeof u=="object"}var sb=Ri?_r(Ri):Dc;function SC(u,f){return u===f||Sc(u,f,Yc(f))}function EC(u,f,y){return y=typeof y=="function"?y:n,Sc(u,f,Yc(f),y)}function TC(u){return lb(u)&&u!=+u}function CC(u){if(Wm(u))throw new bt(i);return Ad(u)}function xC(u){return u===null}function MC(u){return u==null}function lb(u){return typeof u=="number"||Sn(u)&&Xn(u)==tt}function Sp(u){if(!Sn(u)||Xn(u)!=dt)return!1;var f=Eo(u);if(f===null)return!0;var y=Rt.call(f,"constructor")&&f.constructor;return typeof y=="function"&&y instanceof y&&Ll.call(y)==nc}var Xy=Wu?_r(Wu):Im;function kC(u){return ib(u)&&u>=-re&&u<=re}var ub=Es?_r(Es):Od;function pg(u){return typeof u=="string"||!Tt(u)&&Sn(u)&&Xn(u)==br}function Ao(u){return typeof u=="symbol"||Sn(u)&&Xn(u)==Dr}var uf=tm?_r(tm):Wl;function NC(u){return u===n}function FC(u){return Sn(u)&&nr(u)==yo}function IC(u){return Sn(u)&&Xn(u)==la}var AC=ru(ri),OC=ru(function(u,f){return u<=f});function cb(u){if(!u)return[];if(lo(u))return pg(u)?Pr(u):hr(u);if(ha&&u[ha])return Cy(u[ha]());var f=nr(u),y=f==Ge?Ju:f==en?qa:cf;return y(u)}function Xi(u){if(!u)return u===0?u:0;if(u=ea(u),u===De||u===-De){var f=u<0?-1:1;return f*be}return u===u?u:0}function Ct(u){var f=Xi(u),y=f%1;return f===f?y?f-y:f:0}function fb(u){return u?ga(Ct(u),0,G):0}function ea(u){if(typeof u=="number")return u;if(Ao(u))return V;if(vn(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=vn(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=sm(u);var y=uy.test(u);return y||Yh.test(u)?$u(u.slice(2),y?2:8):jh.test(u)?V:+u}function db(u){return No(u,uo(u))}function RC(u){return u?ga(Ct(u),-re,re):u===0?u:0}function $t(u){return u==null?"":fn(u)}var LC=qs(function(u,f){if(su(f)||lo(f)){No(f,ar(f),u);return}for(var y in f)Rt.call(f,y)&&Ui(u,y,f[y])}),pb=qs(function(u,f){No(f,uo(f),u)}),hg=qs(function(u,f,y,M){No(f,uo(f),u,M)}),_C=qs(function(u,f,y,M){No(f,ar(f),u,M)}),PC=Jo(gc);function jC(u,f){var y=Ls(u);return f==null?y:Zt(y,f)}var BC=Et(function(u,f){u=zt(u);var y=-1,M=f.length,L=M>2?f[2]:n;for(L&&Bt(f[0],f[1],L)&&(M=1);++y<M;)for(var H=f[y],K=uo(H),ee=-1,se=K.length;++ee<se;){var ke=K[ee],Ne=u[ke];(Ne===n||Ea(Ne,Vo[ke])&&!Rt.call(u,ke))&&(u[ke]=H[ke])}return u}),YC=Et(function(u){return u.push(n,Qd),fr(hb,n,u)});function HC(u,f){return rm(u,st(f,3),oo)}function UC(u,f){return rm(u,st(f,3),Xa)}function VC(u,f){return u==null?u:ql(u,st(f,3),uo)}function zC(u,f){return u==null?u:yc(u,st(f,3),uo)}function $C(u,f){return u&&oo(u,st(f,3))}function qC(u,f){return u&&Xa(u,st(f,3))}function WC(u){return u==null?[]:pr(u,ar(u))}function GC(u){return u==null?[]:pr(u,uo(u))}function e0(u,f,y){var M=u==null?n:Yr(u,f);return M===n?y:M}function KC(u,f){return u!=null&&Xd(u,f,ei)}function t0(u,f){return u!=null&&Xd(u,f,Nd)}var QC=Rc(function(u,f,y){f!=null&&typeof f.toString!="function"&&(f=_l.call(f)),u[f]=y},r0(co)),ZC=Rc(function(u,f,y){f!=null&&typeof f.toString!="function"&&(f=_l.call(f)),Rt.call(u,f)?u[f].push(y):u[f]=[y]},st),JC=Et(ni);function ar(u){return lo(u)?qo(u):Ec(u)}function uo(u){return lo(u)?qo(u,!0):Am(u)}function XC(u,f){var y={};return f=st(f,3),oo(u,function(M,L,H){Go(y,f(M,L,H),M)}),y}function ex(u,f){var y={};return f=st(f,3),oo(u,function(M,L,H){Go(y,L,f(M,L,H))}),y}var tx=qs(function(u,f,y){oi(u,f,y)}),hb=qs(function(u,f,y,M){oi(u,f,y,M)}),nx=Jo(function(u,f){var y={};if(u==null)return y;var M=!1;f=qt(f,function(H){return H=va(H,u),M||(M=H.length>1),H}),No(u,ou(u),y),M&&(y=Mr(y,m|w|b,Um));for(var L=f.length;L--;)qi(y,f[L]);return y});function rx(u,f){return mb(u,de(st(f)))}var ox=Jo(function(u,f){return u==null?{}:Hs(u,f)});function mb(u,f){if(u==null)return{};var y=qt(ou(u),function(M){return[M]});return f=st(f),Ld(u,y,function(M,L){return f(M,L[0])})}function ax(u,f,y){f=va(f,u);var M=-1,L=f.length;for(L||(L=1,u=n);++M<L;){var H=u==null?n:u[Fo(f[M])];H===n&&(M=L,H=y),u=Ji(H)?H.call(u):H}return u}function ix(u,f,y){return u==null?u:an(u,f,y)}function sx(u,f,y,M){return M=typeof M=="function"?M:n,u==null?u:an(u,f,y,M)}var gb=Gd(ar),vb=Gd(uo);function lx(u,f,y){var M=Tt(u),L=M||tl(u)||uf(u);if(f=st(f,4),y==null){var H=u&&u.constructor;L?y=M?new H:[]:vn(u)?y=Ji(H)?Ls(Eo(u)):{}:y={}}return(L?Wn:oo)(u,function(K,ee,se){return f(y,K,ee,se)}),y}function ux(u,f){return u==null?!0:qi(u,f)}function cx(u,f,y){return u==null?u:kc(u,f,Ic(y))}function fx(u,f,y,M){return M=typeof M=="function"?M:n,u==null?u:kc(u,f,Ic(y),M)}function cf(u){return u==null?[]:Ol(u,ar(u))}function dx(u){return u==null?[]:Ol(u,uo(u))}function px(u,f,y){return y===n&&(y=f,f=n),y!==n&&(y=ea(y),y=y===y?y:0),f!==n&&(f=ea(f),f=f===f?f:0),ga(ea(u),f,y)}function hx(u,f,y){return f=Xi(f),y===n?(y=f,f=0):y=Xi(y),u=ea(u),Nm(u,f,y)}function mx(u,f,y){if(y&&typeof y!="boolean"&&Bt(u,f,y)&&(f=y=n),y===n&&(typeof f=="boolean"?(y=f,f=n):typeof u=="boolean"&&(y=u,u=n)),u===n&&f===n?(u=0,f=1):(u=Xi(u),f===n?(f=u,u=0):f=Xi(f)),u>f){var M=u;u=f,f=M}if(y||u%1||f%1){var L=Yl();return Gn(u+L*(f-u+sd("1e-"+((L+"").length-1))),f)}return Zl(u,f)}var gx=wa(function(u,f,y){return f=f.toLowerCase(),u+(y?yb(f):f)});function yb(u){return n0($t(u).toLowerCase())}function wb(u){return u=$t(u),u&&u.replace(Uh,cm).replace(Zh,"")}function vx(u,f,y){u=$t(u),f=fn(f);var M=u.length;y=y===n?M:ga(Ct(y),0,M);var L=y;return y-=f.length,y>=0&&u.slice(y,L)==f}function yx(u){return u=$t(u),u&&He.test(u)?u.replace(Le,fm):u}function wx(u){return u=$t(u),u&&Jr.test(u)?u.replace(ur,"\\$&"):u}var bx=wa(function(u,f,y){return u+(y?"-":"")+f.toLowerCase()}),Dx=wa(function(u,f,y){return u+(y?" ":"")+f.toLowerCase()}),Sx=qd("toLowerCase");function Ex(u,f,y){u=$t(u),f=Ct(f);var M=f?Li(u):0;if(!f||M>=f)return u;var L=(f-M)/2;return nu(Wa(L),y)+u+nu(Pi(L),y)}function Tx(u,f,y){u=$t(u),f=Ct(f);var M=f?Li(u):0;return f&&M<f?u+nu(f-M,y):u}function Cx(u,f,y){u=$t(u),f=Ct(f);var M=f?Li(u):0;return f&&M<f?nu(f-M,y)+u:u}function xx(u,f,y){return y||f==null?f=0:f&&(f=+f),bm($t(u).replace(Cl,""),f||0)}function Mx(u,f,y){return(y?Bt(u,f,y):f===n)?f=1:f=Ct(f),Us($t(u),f)}function kx(){var u=arguments,f=$t(u[0]);return u.length<3?f:f.replace(u[1],u[2])}var Nx=wa(function(u,f,y){return u+(y?"_":"")+f.toLowerCase()});function Fx(u,f,y){return y&&typeof y!="number"&&Bt(u,f,y)&&(f=y=n),y=y===n?G:y>>>0,y?(u=$t(u),u&&(typeof f=="string"||f!=null&&!Xy(f))&&(f=fn(f),!f&&xs(u))?ya(Pr(u),0,y):u.split(f,y)):[]}var Ix=wa(function(u,f,y){return u+(y?" ":"")+n0(f)});function Ax(u,f,y){return u=$t(u),y=y==null?0:ga(Ct(y),0,u.length),f=fn(f),u.slice(y,y+f.length)==f}function Ox(u,f,y){var M=Y.templateSettings;y&&Bt(u,f,y)&&(f=n),u=$t(u),f=hg({},f,M,Kd);var L=hg({},f.imports,M.imports,Kd),H=ar(L),K=Ol(L,H),ee,se,ke=0,Ne=f.interpolate||Pu,Oe="__p += '",ze=Rl((f.escape||Pu).source+"|"+Ne.source+"|"+(Ne===xn?Fi:Pu).source+"|"+(f.evaluate||Pu).source+"|$","g"),ot="//# sourceURL="+(Rt.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++gy+"]")+`
`;u.replace(ze,function(vt,Mt,At,Oo,$r,Ro){return At||(At=Oo),Oe+=u.slice(ke,Ro).replace(cy,dm),Mt&&(ee=!0,Oe+=`' +
__e(`+Mt+`) +
'`),$r&&(se=!0,Oe+=`';
`+$r+`;
__p += '`),At&&(Oe+=`' +
((__t = (`+At+`)) == null ? '' : __t) +
'`),ke=Ro+vt.length,vt}),Oe+=`';
`;var gt=Rt.call(f,"variable")&&f.variable;if(!gt)Oe=`with (obj) {
`+Oe+`
}
`;else if(Ba.test(gt))throw new bt(c);Oe=(se?Oe.replace(U,""):Oe).replace(te,"$1").replace(he,"$1;"),Oe="function("+(gt||"obj")+`) {
`+(gt?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(ee?", __e = _.escape":"")+(se?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Oe+`return __p
}`;var xt=Db(function(){return Ot(H,ot+"return "+Oe).apply(n,K)});if(xt.source=Oe,Jy(xt))throw xt;return xt}function Rx(u){return $t(u).toLowerCase()}function Lx(u){return $t(u).toUpperCase()}function _x(u,f,y){if(u=$t(u),u&&(y||f===n))return sm(u);if(!u||!(f=fn(f)))return u;var M=Pr(u),L=Pr(f),H=lm(M,L),K=wd(M,L)+1;return ya(M,H,K).join("")}function Px(u,f,y){if(u=$t(u),u&&(y||f===n))return u.slice(0,ec(u)+1);if(!u||!(f=fn(f)))return u;var M=Pr(u),L=wd(M,Pr(f))+1;return ya(M,0,L).join("")}function jx(u,f,y){if(u=$t(u),u&&(y||f===n))return u.replace(Cl,"");if(!u||!(f=fn(f)))return u;var M=Pr(u),L=lm(M,Pr(f));return ya(M,L).join("")}function Bx(u,f){var y=$,M=J;if(vn(f)){var L="separator"in f?f.separator:L;y="length"in f?Ct(f.length):y,M="omission"in f?fn(f.omission):M}u=$t(u);var H=u.length;if(xs(u)){var K=Pr(u);H=K.length}if(y>=H)return u;var ee=y-Li(M);if(ee<1)return M;var se=K?ya(K,0,ee).join(""):u.slice(0,ee);if(L===n)return se+M;if(K&&(ee+=se.length-ee),Xy(L)){if(u.slice(ee).search(L)){var ke,Ne=se;for(L.global||(L=Rl(L.source,$t(ed.exec(L))+"g")),L.lastIndex=0;ke=L.exec(Ne);)var Oe=ke.index;se=se.slice(0,Oe===n?ee:Oe)}}else if(u.indexOf(fn(L),ee)!=ee){var ze=se.lastIndexOf(L);ze>-1&&(se=se.slice(0,ze))}return se+M}function Yx(u){return u=$t(u),u&&je.test(u)?u.replace(Ce,pm):u}var Hx=wa(function(u,f,y){return u+(y?" ":"")+f.toUpperCase()}),n0=qd("toUpperCase");function bb(u,f,y){return u=$t(u),f=y?n:f,f===n?Ty(u)?ky(u):Dy(u):u.match(f)||[]}var Db=Et(function(u,f){try{return fr(u,n,f)}catch(y){return Jy(y)?y:new bt(y)}}),Ux=Jo(function(u,f){return Wn(f,function(y){y=Fo(y),Go(u,y,Ae(u[y],u))}),u});function Vx(u){var f=u==null?0:u.length,y=st();return u=f?qt(u,function(M){if(typeof M[1]!="function")throw new eo(s);return[y(M[0]),M[1]]}):[],Et(function(M){for(var L=-1;++L<f;){var H=u[L];if(fr(H[0],this,M))return fr(H[1],this,M)}})}function zx(u){return Mm(Mr(u,m))}function r0(u){return function(){return u}}function $x(u,f){return u==null||u!==u?f:u}var qx=Wi(),Wx=Wi(!0);function co(u){return u}function o0(u){return Gl(typeof u=="function"?u:Mr(u,m))}function Gx(u){return Ys(Mr(u,m))}function Kx(u,f){return ko(u,Mr(f,m))}var Qx=Et(function(u,f){return function(y){return ni(y,u,f)}}),Zx=Et(function(u,f){return function(y){return ni(u,y,f)}});function a0(u,f,y){var M=ar(f),L=pr(f,M);y==null&&!(vn(f)&&(L.length||!M.length))&&(y=f,f=u,u=this,L=pr(f,ar(f)));var H=!(vn(y)&&"chain"in y)||!!y.chain,K=Ji(u);return Wn(L,function(ee){var se=f[ee];u[ee]=se,K&&(u.prototype[ee]=function(){var ke=this.__chain__;if(H||ke){var Ne=u(this.__wrapped__),Oe=Ne.__actions__=hr(this.__actions__);return Oe.push({func:se,args:arguments,thisArg:u}),Ne.__chain__=ke,Ne}return se.apply(u,$a([this.value()],arguments))})}),u}function Jx(){return nn._===this&&(nn._=gm),this}function i0(){}function Xx(u){return u=Ct(u),Et(function(f){return ai(f,u)})}var e6=_c(qt),t6=_c(fd),n6=_c(hd);function Sb(u){return ep(u)?gd(Fo(u)):_d(u)}function r6(u){return function(f){return u==null?n:Yr(u,f)}}var o6=Wd(),a6=Wd(!0);function s0(){return[]}function l0(){return!1}function i6(){return{}}function s6(){return""}function l6(){return!0}function u6(u,f){if(u=Ct(u),u<1||u>re)return[];var y=G,M=Gn(u,G);f=st(f),u-=G;for(var L=yd(M,f);++y<u;)f(y);return L}function c6(u){return Tt(u)?qt(u,Fo):Ao(u)?[u]:hr(Zm($t(u)))}function f6(u){var f=++Ns;return $t(u)+f}var d6=Lc(function(u,f){return u+f},0),p6=tr("ceil"),h6=Lc(function(u,f){return u/f},1),m6=tr("floor");function g6(u){return u&&u.length?Vi(u,co,xo):n}function v6(u,f){return u&&u.length?Vi(u,st(f,2),xo):n}function y6(u){return am(u,co)}function w6(u,f){return am(u,st(f,2))}function b6(u){return u&&u.length?Vi(u,co,ri):n}function D6(u,f){return u&&u.length?Vi(u,st(f,2),ri):n}var S6=Lc(function(u,f){return u*f},1),E6=tr("round"),T6=Lc(function(u,f){return u-f},0);function C6(u){return u&&u.length?vd(u,co):0}function x6(u,f){return u&&u.length?vd(u,st(f,2)):0}return Y.after=W,Y.ary=X,Y.assign=LC,Y.assignIn=pb,Y.assignInWith=hg,Y.assignWith=_C,Y.at=PC,Y.before=ve,Y.bind=Ae,Y.bindAll=Ux,Y.bindKey=_e,Y.castArray=iC,Y.chain=zr,Y.chunk=Py,Y.compact=zc,Y.concat=ap,Y.cond=Vx,Y.conforms=zx,Y.constant=r0,Y.countBy=Wy,Y.create=jC,Y.curry=Ie,Y.curryRight=We,Y.debounce=Je,Y.defaults=BC,Y.defaultsDeep=YC,Y.defer=et,Y.delay=gn,Y.difference=so,Y.differenceBy=It,Y.differenceWith=_n,Y.drop=Dn,Y.dropRight=Hn,Y.dropRightWhile=Vr,Y.dropWhile=Js,Y.fill=An,Y.filter=ug,Y.flatMap=cg,Y.flatMapDeep=wp,Y.flatMapDepth=Gy,Y.flatten=uu,Y.flattenDeep=ip,Y.flattenDepth=cu,Y.flip=ce,Y.flow=qx,Y.flowRight=Wx,Y.fromPairs=kr,Y.functions=WC,Y.functionsIn=GC,Y.groupBy=rf,Y.initial=Sa,Y.intersection=qc,Y.intersectionBy=sp,Y.intersectionWith=ci,Y.invert=QC,Y.invertBy=ZC,Y.invokeMap=of,Y.iteratee=o0,Y.keyBy=fg,Y.keys=ar,Y.keysIn=uo,Y.map=af,Y.mapKeys=XC,Y.mapValues=ex,Y.matches=Gx,Y.matchesProperty=Kx,Y.memoize=ne,Y.merge=tx,Y.mergeWith=hb,Y.method=Qx,Y.methodOf=Zx,Y.mixin=a0,Y.negate=de,Y.nthArg=Xx,Y.omit=nx,Y.omitBy=rx,Y.once=Pe,Y.orderBy=sf,Y.over=e6,Y.overArgs=nt,Y.overEvery=t6,Y.overSome=n6,Y.partial=lt,Y.partialRight=ct,Y.partition=Ky,Y.pick=ox,Y.pickBy=mb,Y.property=Sb,Y.propertyOf=r6,Y.pull=lp,Y.pullAll=du,Y.pullAllBy=Kc,Y.pullAllWith=gr,Y.pullAt=fi,Y.range=o6,Y.rangeRight=a6,Y.rearg=wt,Y.reject=lf,Y.remove=Io,Y.rest=Pn,Y.reverse=or,Y.sampleSize=l,Y.set=ix,Y.setWith=sx,Y.shuffle=p,Y.slice=Xm,Y.sortBy=x,Y.sortedUniq=Gi,Y.sortedUniqBy=dp,Y.split=Fx,Y.spread=Lt,Y.tail=Ki,Y.take=tg,Y.takeRight=ng,Y.takeRightWhile=pp,Y.takeWhile=Qc,Y.tap=mp,Y.throttle=mi,Y.thru=Zc,Y.toArray=cb,Y.toPairs=gb,Y.toPairsIn=vb,Y.toPath=c6,Y.toPlainObject=db,Y.transform=lx,Y.unary=Zy,Y.union=By,Y.unionBy=Yy,Y.unionWith=rg,Y.uniq=og,Y.uniqBy=Qi,Y.uniqWith=Hy,Y.unset=ux,Y.unzip=pi,Y.unzipWith=hp,Y.update=cx,Y.updateWith=fx,Y.values=cf,Y.valuesIn=dx,Y.without=dn,Y.words=bb,Y.wrap=aC,Y.xor=Uy,Y.xorBy=ag,Y.xorWith=Vy,Y.zip=zy,Y.zipObject=ig,Y.zipObjectDeep=sg,Y.zipWith=$y,Y.entries=gb,Y.entriesIn=vb,Y.extend=pb,Y.extendWith=hg,a0(Y,Y),Y.add=d6,Y.attempt=Db,Y.camelCase=gx,Y.capitalize=yb,Y.ceil=p6,Y.clamp=px,Y.clone=sC,Y.cloneDeep=uC,Y.cloneDeepWith=cC,Y.cloneWith=lC,Y.conformsTo=fC,Y.deburr=wb,Y.defaultTo=$x,Y.divide=h6,Y.endsWith=vx,Y.eq=Ea,Y.escape=yx,Y.escapeRegExp=wx,Y.every=lg,Y.find=ef,Y.findIndex=Xs,Y.findKey=HC,Y.findLast=tf,Y.findLastIndex=ui,Y.findLastKey=UC,Y.floor=m6,Y.forEach=bp,Y.forEachRight=nf,Y.forIn=VC,Y.forInRight=zC,Y.forOwn=$C,Y.forOwnRight=qC,Y.get=e0,Y.gt=dC,Y.gte=pC,Y.has=KC,Y.hasIn=t0,Y.head=$c,Y.identity=co,Y.includes=Dp,Y.indexOf=el,Y.inRange=hx,Y.invoke=JC,Y.isArguments=hu,Y.isArray=Tt,Y.isArrayBuffer=hC,Y.isArrayLike=lo,Y.isArrayLikeObject=Rn,Y.isBoolean=mC,Y.isBuffer=tl,Y.isDate=gC,Y.isElement=vC,Y.isEmpty=yC,Y.isEqual=wC,Y.isEqualWith=bC,Y.isError=Jy,Y.isFinite=DC,Y.isFunction=Ji,Y.isInteger=ib,Y.isLength=dg,Y.isMap=sb,Y.isMatch=SC,Y.isMatchWith=EC,Y.isNaN=TC,Y.isNative=CC,Y.isNil=MC,Y.isNull=xC,Y.isNumber=lb,Y.isObject=vn,Y.isObjectLike=Sn,Y.isPlainObject=Sp,Y.isRegExp=Xy,Y.isSafeInteger=kC,Y.isSet=ub,Y.isString=pg,Y.isSymbol=Ao,Y.isTypedArray=uf,Y.isUndefined=NC,Y.isWeakMap=FC,Y.isWeakSet=IC,Y.join=Wc,Y.kebabCase=bx,Y.last=On,Y.lastIndexOf=Gc,Y.lowerCase=Dx,Y.lowerFirst=Sx,Y.lt=AC,Y.lte=OC,Y.max=g6,Y.maxBy=v6,Y.mean=y6,Y.meanBy=w6,Y.min=b6,Y.minBy=D6,Y.stubArray=s0,Y.stubFalse=l0,Y.stubObject=i6,Y.stubString=s6,Y.stubTrue=l6,Y.multiply=S6,Y.nth=fu,Y.noConflict=Jx,Y.noop=i0,Y.now=P,Y.pad=Ex,Y.padEnd=Tx,Y.padStart=Cx,Y.parseInt=xx,Y.random=mx,Y.reduce=pu,Y.reduceRight=Qy,Y.repeat=Mx,Y.replace=kx,Y.result=ax,Y.round=E6,Y.runInContext=oe,Y.sample=a,Y.size=v,Y.snakeCase=Nx,Y.some=S,Y.sortedIndex=up,Y.sortedIndexBy=cp,Y.sortedIndexOf=jy,Y.sortedLastIndex=di,Y.sortedLastIndexBy=eg,Y.sortedLastIndexOf=fp,Y.startCase=Ix,Y.startsWith=Ax,Y.subtract=T6,Y.sum=C6,Y.sumBy=x6,Y.template=Ox,Y.times=u6,Y.toFinite=Xi,Y.toInteger=Ct,Y.toLength=fb,Y.toLower=Rx,Y.toNumber=ea,Y.toSafeInteger=RC,Y.toString=$t,Y.toUpper=Lx,Y.trim=_x,Y.trimEnd=Px,Y.trimStart=jx,Y.truncate=Bx,Y.unescape=Yx,Y.uniqueId=f6,Y.upperCase=Hx,Y.upperFirst=n0,Y.each=bp,Y.eachRight=nf,Y.first=$c,a0(Y,function(){var u={};return oo(Y,function(f,y){Rt.call(Y.prototype,y)||(u[y]=f)}),u}(),{chain:!1}),Y.VERSION=r,Wn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){Y[u].placeholder=Y}),Wn(["drop","take"],function(u,f){St.prototype[u]=function(y){y=y===n?1:bn(Ct(y),0);var M=this.__filtered__&&!f?new St(this):this.clone();return M.__filtered__?M.__takeCount__=Gn(y,M.__takeCount__):M.__views__.push({size:Gn(y,G),type:u+(M.__dir__<0?"Right":"")}),M},St.prototype[u+"Right"]=function(y){return this.reverse()[u](y).reverse()}}),Wn(["filter","map","takeWhile"],function(u,f){var y=f+1,M=y==ge||y==fe;St.prototype[u]=function(L){var H=this.clone();return H.__iteratees__.push({iteratee:st(L,3),type:y}),H.__filtered__=H.__filtered__||M,H}}),Wn(["head","last"],function(u,f){var y="take"+(f?"Right":"");St.prototype[u]=function(){return this[y](1).value()[0]}}),Wn(["initial","tail"],function(u,f){var y="drop"+(f?"":"Right");St.prototype[u]=function(){return this.__filtered__?new St(this):this[y](1)}}),St.prototype.compact=function(){return this.filter(co)},St.prototype.find=function(u){return this.filter(u).head()},St.prototype.findLast=function(u){return this.reverse().find(u)},St.prototype.invokeMap=Et(function(u,f){return typeof u=="function"?new St(this):this.map(function(y){return ni(y,u,f)})}),St.prototype.reject=function(u){return this.filter(de(st(u)))},St.prototype.slice=function(u,f){u=Ct(u);var y=this;return y.__filtered__&&(u>0||f<0)?new St(y):(u<0?y=y.takeRight(-u):u&&(y=y.drop(u)),f!==n&&(f=Ct(f),y=f<0?y.dropRight(-f):y.take(f-u)),y)},St.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},St.prototype.toArray=function(){return this.take(G)},oo(St.prototype,function(u,f){var y=/^(?:filter|find|map|reject)|While$/.test(f),M=/^(?:head|last)$/.test(f),L=Y[M?"take"+(f=="last"?"Right":""):f],H=M||/^find/.test(f);L&&(Y.prototype[f]=function(){var K=this.__wrapped__,ee=M?[1]:arguments,se=K instanceof St,ke=ee[0],Ne=se||Tt(K),Oe=function(Mt){var At=L.apply(Y,$a([Mt],ee));return M&&ze?At[0]:At};Ne&&y&&typeof ke=="function"&&ke.length!=1&&(se=Ne=!1);var ze=this.__chain__,ot=!!this.__actions__.length,gt=H&&!ze,xt=se&&!ot;if(!H&&Ne){K=xt?K:new St(this);var vt=u.apply(K,ee);return vt.__actions__.push({func:Zc,args:[Oe],thisArg:n}),new Kn(vt,ze)}return gt&&xt?u.apply(this,ee):(vt=this.thru(Oe),gt?M?vt.value()[0]:vt.value():vt)})}),Wn(["pop","push","shift","sort","splice","unshift"],function(u){var f=da[u],y=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",M=/^(?:pop|shift)$/.test(u);Y.prototype[u]=function(){var L=arguments;if(M&&!this.__chain__){var H=this.value();return f.apply(Tt(H)?H:[],L)}return this[y](function(K){return f.apply(Tt(K)?K:[],L)})}}),oo(St.prototype,function(u,f){var y=Y[f];if(y){var M=y.name+"";Rt.call(Os,M)||(Os[M]=[]),Os[M].push({name:f,func:y})}}),Os[Ws(n,C).name]=[{name:"wrapper",func:n}],St.prototype.clone=fc,St.prototype.reverse=xd,St.prototype.value=_s,Y.prototype.at=hi,Y.prototype.chain=Jc,Y.prototype.commit=Zi,Y.prototype.next=Xc,Y.prototype.plant=vp,Y.prototype.reverse=qy,Y.prototype.toJSON=Y.prototype.valueOf=Y.prototype.value=yp,Y.prototype.first=Y.prototype.head,ha&&(Y.prototype[ha]=gp),Y},Ms=Ny();Uo?((Uo.exports=Ms)._=Ms,Al._=Ms):nn._=Ms}).call(Vn)})(Qg,Qg.exports);var uE=Qg.exports;function mg(e){const t=e.match(/^#+/);return t?t[0].length:0}function iM(e,t){const n=e.split(`
`);let r="",o=[],i=!1,s=1;for(let c=0;c<n.length;c++){const d=n[c];if(d.startsWith("#")){if(i&&mg(d)<=mg(t))break;r=d,r===t?(i=!0,s=c+1):i&&mg(d)>mg(t)?o.push(d):(i=!1,o=[])}else i&&o.push(d)}return t?uE.isEmpty(o)?{content:"",startLine:-1}:{content:o.join(`
`),startLine:s}:{content:e,startLine:0}}function sM(e){const t=e.split(/\r?\n/),n=[];for(let r=0;r<t.length;r++)new RegExp($8).test(t[r])&&n.push({line:t[r],index:r+1});return n}async function lM(e,t){let n=t.vault.getAbstractFileByPath(e);return n||(new N.Notice(O("File not found for the given thino path, is creating a new file")),n=await t.vault.create(e,'{"nodes": [], "edges": []}'),rt.setChangedByMemos(!0)),n}async function uM(e,t){let n;try{n=await t.vault.read(e)}catch(o){console.error(o),n=await t.vault.cachedRead(e)}const r=n.split(/---\n/);return r.length<3?n:r[2].trim()}function cM(e){const t=e.split(/\r?\n/),n=[];let r="",o=[],i=0;for(let s=0;s<t.length;s++){const c=t[s];c.startsWith("#")?(r&&n.push({header:r,content:o.join(`
`).trim(),pos:{start:i,end:s-1}}),r=c,o=[],i=s):o.push(c)}return r&&n.push({header:r,content:o.join(`
`).trim(),pos:{start:i,end:t.length-1}}),n}function fM(e){const t=e.split(/\r?\n/),n=[];let r=!1,o=[],i="";for(let s=0;s<t.length;s++){const c=t[s];c.startsWith("> [!thino]")?(r&&(n.push({metadata:i,content:o.join(`
`).trim()}),o=[]),r=!0,i=c.replace("> [!thino]","").trim()):r&&c.startsWith(">")?o.push(c.replace(/^> /,"")):r&&!c.startsWith(">")&&(r=!1,n.push({metadata:i,content:o.join(`
`).trim()}),o=[],i="")}return r&&n.push({metadata:i,content:o.join(`
`).trim()}),n}const dM=e=>{let t;switch(e){case" ":t="TASK-TODO";break;case"x":case"X":t="TASK-DONE";break;default:t="TASK-"+e;break}return t};async function pM(e,t){if(!t)return 0;const{vault:n}=xe.getState().dailyNotesState.app,r=e==null?void 0:e.DefaultMemoComposition,o=(e==null?void 0:e.ProcessEntriesBelow)||"";let i;try{i=await n.read(t)}catch(m){console.error(m),i=await n.cachedRead(t)}let s;r!=""&&/{TIME}/g.test(r)&&/{CONTENT}/g.test(r)?s="(-|\\*) (\\[(.{1})\\]\\s)?"+r.replace(/{TIME}/g,"((\\<time\\>)?\\d{1,2}:\\d{2})?").replace(/ {CONTENT}/g,""):s="(-|\\*) (\\[(.{1})\\]\\s)?((\\<time\\>)?\\d{1,2}\\:\\d{2})?";const c=new RegExp(s,"g"),d=(i.match(c)||[]).length,h=new RegExp(o.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g"),g=(i.match(h)||[]).length;return i=null,g?d:0}function hM(e){return e.replace(/^(-|\*|\d\.) (\d{1,2}:\d{2})\s(.*)$/g,"$3")}function mM(e,t){return gM(e,t)}const gM=(e,t)=>{var o;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*[\\-\\*]\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\<time\\>)?((\\d{1,2})\\:(\\d{2}))?(\\<\\/time\\>)?").replace(/{CONTENT}/g,"(.*)$"):n="^\\s*[\\-\\*]\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?((\\d{1,2})\\:(\\d{2}))?(\\<\\/time\\>)?\\s?(.*)$",(o=new RegExp(n,"").exec(t))==null?void 0:o[8]},vM=(e,t)=>{var o;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*[\\-\\*]\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\<\\/time\\>)?").replace(/{CONTENT}/g,"(.*)$"):n="^\\s*[\\-\\*]\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)$",(o=new RegExp(n,"").exec(t))==null?void 0:o[4]},yM=(e,t)=>{var o;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*[\\-\\*]\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\<\\/time\\>)?").replace(/{CONTENT}/g,"(.*)$"):n="^\\s*[\\-\\*]\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)$",(o=new RegExp(n,"").exec(t))==null?void 0:o[5]},wM=e=>{var t;return(t=/^\s*[\-\*]\s(\[(.{1})\])\s(.*)$/.exec(e))==null?void 0:t[2]},cE=()=>tE()?!0:(new N.Notice(O("Check if you opened Daily Notes Plugin Or Periodic Notes Plugin")),!1);async function fE(e,t){if(!e)return t;const n=xe.getState().dailyNotesState.app,r=await uM(e,n);if(!r.trim())return t;let o=N.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss");await n.fileManager.processFrontMatter(e,i=>{if(!i)return t;const s=!!i.pinned,c=!!i.archived,d=!!i.deletedAt;i.createdAt&&(o=N.moment(i.createdAt,"YYYY/MM/DD HH:mm:ss").isValid()?i.createdAt:o);const h=i.deletedAt?i.deletedAt:"",g=i.visibility?i.visibility:"PRIVATE",m=i.thinoType?i.thinoType:"JOURNAL",w=i.webId?i.webId:"";i.id||(i.id=Ue.randomId(16));const b=i.id?i.id:"",T=i.hasId?i.hasId:"",E=i.linkId?i.linkId:"",k=e.path,C="Memo",I="MULTI",B=[];return t.push({id:b,content:r,createdAt:o,updatedAt:o,deletedAt:d?N.moment(h,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:s,rowStatus:c?"ARCHIVED":"NORMAL",visibility:g,thinoType:m,hasId:T,linkId:E,path:k,creatorName:C,sourceType:I,resourceList:B,webId:w}),t})}async function r1(e,t){var b,T,E,k,C,I;if(!e)return t;const{vault:n}=xe.getState().dailyNotesState.app;let r;try{r=await n.read(e)}catch(B){console.error(B),r=await n.cachedRead(e)}if(!r)return;const o=N.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss"),i=N.moment(e.stat.mtime).format("YYYY/MM/DD HH:mm:ss"),s=e.path,c="Thino",d="FILE",h="",g="",m=[],w=await cM(r);for(const B of w){const F=fM(B.content);for(const _ of F){const R=_.metadata.match(/\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}/g);if(!R)continue;const j=(T=(b=_.metadata.match(/id::([^\]]*)/g))==null?void 0:b[0])==null?void 0:T.replace("id::","");if(!j)continue;const z=R?R[0]:o,q=R?R[0]:i,$=_.metadata.match(/webId::([^\]]*)/g)?(k=(E=_.metadata.match(/webId::([^\]]*)/g))==null?void 0:E[0])==null?void 0:k.replace("webId::",""):"",J=_.metadata.contains("[pinned::true]"),ae=_.metadata.contains("[archived::true]"),ie=_.metadata.contains("[deleted::"),ge=(C=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(_.metadata))==null?void 0:C[2],pe=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(_.metadata)?"PUBLIC":"PRIVATE",fe=(I=new RegExp(/\[(thinoType|THINOTYPE)::([^\]]*)\]/,"g").exec(_.metadata))==null?void 0:I[2];t.push({id:j,content:_.content,createdAt:z,updatedAt:q,deletedAt:ie?N.moment(ge,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:J,rowStatus:ae?"ARCHIVED":"NORMAL",visibility:pe,thinoType:fe||"JOURNAL",hasId:h,linkId:g,path:s,creatorName:c,sourceType:d,resourceList:m,webId:$})}}return t}async function o1(e,t){var m,w,b;if(!e)return[];const n=xe.getState().dailyNotesState.settings,{vault:r}=xe.getState().dailyNotesState.app;if(await pM(n,e)===0)return;const i=Bp(e,"day");let s,c;try{c=await r.read(e)}catch(T){console.error(T),c=await r.cachedRead(e)}const{content:d,startLine:h}=iM(c,n.ProcessEntriesBelow),g=sM(d);for(const T of g){const E=vM(n.DefaultMemoComposition,T.line),k=yM(n.DefaultMemoComposition,T.line);let C=hM(T.line);if(i.hours(parseInt(E)),i.minutes(parseInt(k)),/^\s*[-*]\s(\[(.)\])\s/g.test(T.line)){const $=wM(T.line);C=mM(n.DefaultMemoComposition,T.line),s=dM($)}else s="JOURNAL";let I=C;const B=new RegExp(/\[(pinned|PINNED)::true\]/,"g").test(C),F=new RegExp(/\[(archived|ARCHIVED)::true\]/,"g").test(C),_=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").test(C),R=(m=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(C))==null?void 0:m[2],j=(w=new RegExp(/\[(webId|WEBID)::([^\]]*)\]/,"g").exec(C))==null?void 0:w[2],z=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(C)?"PUBLIC":"PRIVATE",q=(b=new RegExp(/\s\^([0-9a-zA-Z-]+)$/).exec(C))==null?void 0:b[1];I=I.replace(/\s\[pinned::[^\]]+\]/g,"").replace(/\s\[visibility::[^\]]+\]/g,"").replace(/\s\[archived::[^\]]+\]/g,"").replace(/\s\[deleted::[^\]]+\]/g,"").replace(/\s\[webId::[^\]]+\]/g,"").replace(/\s\^([0-9a-zA-Z-]+)$/g,""),t.push({id:i.format("YYYYMMDDHHmmSS")+`${T.index+h-1}`,content:I,createdAt:i.format("YYYY/MM/DD HH:mm:SS"),updatedAt:i.format("YYYY/MM/DD HH:mm:SS"),thinoType:s,hasId:q||"",linkId:"",path:e.path,deletedAt:_?N.moment(R,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",rowStatus:F?"ARCHIVED":"NORMAL",visibility:z,pinned:B,creatorName:"Memo",resourceList:[],sourceType:"DAILY",webId:j})}}async function a1(e,t){const{app:n}=xe.getState().dailyNotesState;if(!(e instanceof N.TFile))return;let r;try{r=await n.vault.read(e)}catch(s){console.error(s),r=await n.vault.cachedRead(e)}if(!r)return;const o=JSON.parse(r),i=o==null?void 0:o.nodes;for(const s of i){if(s.type==="group"||s.createdAt===void 0||s.text.trim()==="")continue;const c=N.moment(s==null?void 0:s.createdAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),d=N.moment(s==null?void 0:s.updatedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),h=s!=null&&s.deletedAt?N.moment(s==null?void 0:s.deletedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",g=!!(s!=null&&s.pinned),m=s!=null&&s.archived?"ARCHIVED":"NORMAL",w=s!=null&&s.visibility?s==null?void 0:s.visibility:"PRIVATE",b=s!=null&&s.thinoType?s==null?void 0:s.thinoType:"JOURNAL",T=s!=null&&s.text?s==null?void 0:s.text:"",E=s!=null&&s.id?s==null?void 0:s.id:"",k=s!=null&&s.hasId?s==null?void 0:s.hasId:"",C=s!=null&&s.linkId?s==null?void 0:s.linkId:"",I=e.path,B="Memo",F="CANVAS",_=[],R=s!=null&&s.webId?s==null?void 0:s.webId:void 0;t.push({id:E,content:T,createdAt:c,updatedAt:d,deletedAt:h,pinned:g,rowStatus:m,visibility:w,thinoType:b,hasId:k,linkId:C,path:I,creatorName:B,sourceType:F,resourceList:_,webId:R})}}async function Fb(e=[]){const t=[],n=[],r=xe.getState().dailyNotesState.app,{vault:o}=r,{settings:i}=xe.getState().dailyNotesState,s=r.loadLocalStorage("tokenForSync"),c=async(d,h)=>{for(const g of d)try{await h(g,t)}catch(m){console.error(m),new N.Notice(m)}};if(e.includes("CANVAS")){const d=bM(o);await c(d,a1)}if(e.includes("MULTI")){const d=DM(o,i);await c(d,fE)}if(e.includes("DAILY")){const d=await SM(o);await c(d,o1)}if(e.includes("FILE")||s){const d=EM(o);await c(d,r1)}return{memos:t,commentMemos:n}}function bM(e){return e.getAllLoadedFiles().filter(t=>t instanceof N.TFile&&t.extension==="canvas"&&t.name.includes(".thino"))}function DM(e,t){return e.getMarkdownFiles().filter(n=>{var r;return n instanceof N.TFile&&((r=n.parent)==null?void 0:r.path.includes(t.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim()))})}async function SM(e){const t=aE();t===void 0&&new N.Notice(O("Please check your daily note plugin OR periodic notes plugin settings")+"folder path is empty or undefined"),e.getAbstractFileByPath(N.normalizePath(t))||new N.Notice(O("Failed to find daily notes folder"));const r=Au();return Object.values(r).filter(o=>o instanceof N.TFile&&o.extension==="md")}function EM(e){return e.getMarkdownFiles().filter(t=>t instanceof N.TFile&&t.name.trim().includes("thino"))}const TM=async(e,t,n)=>{const r=await _f(xe.getState().dailyNotesState.app)||[],o=r.find(c=>c.id===e),i={...o,title:t,querystring:n},s=r.findIndex(c=>c.id===e);return r[s]=i,await gh(xe.getState().dailyNotesState.app,r),[o]};function CM(e){return(e==null?void 0:e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"))||e}function xM(e){const t=[];let n=e;for(;n.contains(`
`);){const r=n.indexOf(`
`);t.push(n.slice(0,r)),n=n.slice(r+1)}return t.push(n),t}async function MM({content:e,isList:t}){const n=xe.getState().dailyNotesState.settings,r=N.moment(),o=Ue.randomId(16),i=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",s=`${i}/${r.format("YYYYMMDD")}-${o}.md`,c={id:o,content:e,deletedAt:"",path:s,createdAt:r.format("YYYY/MM/DD HH:mm:ss"),updatedAt:r.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"MULTI"},d=ut.getState().app,{vault:h,fileManager:g}=d,m=h.getAbstractFileByPath(i);(!m||!(m instanceof N.TFolder))&&(new N.Notice(O("Folder not found for the given thino path, is creating a new folder")),await h.createFolder(i)),rt.setChangedByMemos(!0);const w=await h.create(s,e);return await g.processFrontMatter(w,b=>{b.id=o,b.createdAt=r.format("YYYY/MM/DD HH:mm:ss"),b.updatedAt=r.format("YYYY/MM/DD HH:mm:ss"),b.thinoType=t?"JOURNAL":"TASK-TODO",b.pinned=!1,b.visibility="PUBLIC",b.rowStatus="NORMAL"}),c}async function kM({content:e,isList:t}){const n=xe.getState().dailyNotesState.settings,r=N.moment(),o=Ue.randomId(16),i=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",s={id:o,content:e,deletedAt:"",path:i,createdAt:r.format("YYYY/MM/DD HH:mm:ss"),updatedAt:r.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE"},c=ut.getState().app,{vault:d}=c;let h=d.getAbstractFileByPath(i);(!h||!(h instanceof N.TFile))&&(new N.Notice(O("File not found for the given thino path, is creating a new file")),h=await d.create(i,""));let g="";try{g=await d.read(h)||await d.cachedRead(h)}catch(C){console.error(C),new N.Notice(O("Failed to read current daily note, check if it exists."))}const m=g.indexOf(`# ${r.format("YYYY-MM-DD")}`);let w=g.indexOf(`
#`,m+1);w===-1&&(w=g.length);const b=`> [!thino] ${r.format("YYYY/MM/DD HH:mm:ss")} %% [id::${o}] [thinoType::${t?"JOURNAL":"TASK-TODO"}] %%`,T=e.replace(/\n/g,`
> `),E=`
${b}
> ${T}
`;let k;if(m===-1){const C=`# ${r.format("YYYY-MM-DD")}`;k=`${g.substring(0,w)}
${C}${E}
${g.substring(w)}`}else k=`${g.substring(0,w)}${E}${g.substring(w)}`;return setTimeout(async()=>{rt.setChangedByMemos(!0),await d.modify(h,k)},200),s}async function Ib(e){const t=xe.getState().dailyNotesState.settings,n=N.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),r=e.id,o=(t==null?void 0:t.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",i={id:r,content:e.content,deletedAt:e.deletedAt??"",path:o,createdAt:n.format("YYYY/MM/DD HH:mm:ss"),updatedAt:n.format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",hasId:"",linkId:"",pinned:e.pinned,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE",webId:e.id},s=ut.getState().app,{vault:c}=s;let d=c.getAbstractFileByPath(o);(!d||!(d instanceof N.TFile))&&(new N.Notice(O("File not found for the given thino path, is creating a new file")),d=await c.create(o,""));let h="";try{h=await c.read(d)||await c.cachedRead(d)}catch(k){console.error(k),new N.Notice(O("Failed to read current daily note, check if it exists."))}const g=h.indexOf(`# ${n.format("YYYY-MM-DD")}`);let m=h.indexOf(`
#`,g+1);m===-1&&(m=h.length);const w=`> [!thino] ${n.format("YYYY/MM/DD HH:mm:ss")} %% [id::${r}] [thinoType::JOURNAL]${e.rowStatus==="ARCHIVED"?" [archived::true]":""}${e.pinned===!0?" [pinned::true]":""}${e.deletedAt?` [deleted::${e.deletedAt}]`:""}${e.id?` [webId::${e.id}]`:""} %%`,b=e.content.replace(/\n/g,`
> `),T=`
${w}
> ${b}
`;let E;if(g===-1){const k=`# ${n.format("YYYY-MM-DD")}`;E=`${h.substring(0,m)}
${k}${T}
${h.substring(m)}`}else E=`${h.substring(0,m)}${T}${h.substring(m)}`;return rt.setChangedByMemos(!0),await c.modify(d,E),i}async function NM({content:e,isList:t}){const n=xe.getState().dailyNotesState.settings,r=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultCanvasPath)||"basic.thino.canvas",o=N.moment(),i=Ue.randomId(16),s={id:i,content:e,deletedAt:"",path:r,createdAt:o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:o.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"CANVAS"},c=ut.getState().app,{vault:d}=c,h=await lM(r,c);if(!h||!(h instanceof N.TFile)){new N.Notice(O("File not found for the given thino path, is creating a new file"));return}const g=await d.read(h),m=JSON.parse(g);if(m.nodes.find(k=>k.id===s.id))return;let b;m.nodes.length>0&&(b=[...m.nodes].reduce((k,C)=>{if(!k.createdAt)return C;const I=N.moment(k.createdAt,"YYYY/MM/DD HH:mm:ss"),B=N.moment(C.createdAt,"YYYY/MM/DD HH:mm:ss");return I.isAfter(B)?k:C}));const T=b?{x:b.x,y:b.y+100,width:b.width,height:b.height}:{x:0,y:0,width:200,height:100};m.nodes.push({...T,type:"text",id:i,text:e,deletedAt:"",createdAt:o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:o.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[]}),rt.setChangedByMemos(!0);const E=JSON.stringify(m,null,2);return await d.modify(h,E),s}async function Ab(e,t,n){var I;const{vault:r}=xe.getState().dailyNotesState.app??app,o=xe.getState().dailyNotesState.settings,i=e.replace(/\n/g,"<br>"),s=n??N.moment(),c=s.format("HH"),d=s.format("mm"),h=`${c}:${d}`,g=t?"- ":"- [ ] ",m=o!=null&&o.DefaultMemoComposition?`${g}${(I=o==null?void 0:o.DefaultMemoComposition)==null?void 0:I.replace(/{TIME}/g,h).replace(/{CONTENT}/g,i)}`:`${g}${h} ${i}`,w=Au(),b=Sv(s,w);let T;if(b?T=b:T=await Ue.createDailyNoteCheck(s),!T){new N.Notice(O("Failed to create daily note, check if it exists."));return}b||await ut.fechLocalDailyNotes();let E="";try{E=await r.read(T)||await r.cachedRead(T)}catch(B){console.error(B),new N.Notice(O("Failed to read current daily note, check if it exists."))}const k=await dE(o==null?void 0:o.InsertAfter,m,E);n?await r.modify(T,k.content):setTimeout(async()=>{await r.modify(T,k.content)},200);const C=k.posNum===-1?pE(k.content).length-1:k.posNum+1;return rt.setChangedByMemos(!0),{id:s.format("YYYYMMDDHHmm")+"00"+C,content:e,deletedAt:"",createdAt:s.format("YYYY/MM/DD HH:mm:ss"),updatedAt:s.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"":"TASK-TODO",path:T.path,hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"DAILY"}}async function FM(e){const{vault:t}=xe.getState().dailyNotesState.app??app,{DefaultMemoComposition:n,InsertAfter:r}=xe.getState().dailyNotesState.settings;let o=(e.pinned?" [pinned::true]":"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.visibility==="PRIVATE"?' [visibility::"PRIVATE"]':"");if(e.id){const B=" [webId::"+e.id+"]";o+=B}const i=N.moment();if(e.deletedAt){const B=" [deleted::"+i.format("YYYYMMDDHHmmss")+"]";o+=B}const s=e.content.replace(/\n/g,"<br>")+o,c=N.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),d=c.format("HH"),h=c.format("mm"),g=`${d}:${h}`,m=e.thinoType?"- [ ] ":"- ",w=n?`${m}${n==null?void 0:n.replace(/{TIME}/g,g).replace(/{CONTENT}/g,s)}`:`${m}${g} ${s}`,b=Au(),T=Sv(c,b);let E;if(T?E=T:E=await Ue.createDailyNoteCheck(c),!E){new N.Notice(O("Failed to create daily note, check if it exists."));return}T||await ut.fechLocalDailyNotes();let k="";try{k=await t.read(E)||await t.cachedRead(E)}catch(B){console.error(B),new N.Notice(O("Failed to read current daily note, check if it exists."))}const C=await dE(r,w,k);await t.modify(E,C.content);const I=C.posNum===-1?pE(C.content).length-1:C.posNum+1;return rt.setChangedByMemos(!0),{id:c.format("YYYYMMDDHHmm")+"00"+I,content:e.content,deletedAt:e.deletedAt??"",createdAt:c.format("YYYY/MM/DD HH:mm:ss"),updatedAt:c.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType??"JOURNAL",path:E.path,hasId:"",linkId:"",pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY"}}async function dE(e,t,n){const r=new RegExp(`s*${await CM(e)}s*`),o=xM(n),i=o.findIndex(h=>r.test(h)),s=(e==null?void 0:e.trim())===""?!0:i===-1,c=o.slice(i+1).findIndex(h=>/^#+ |---/.test(h)),d=c!==-1;if(d){let h;for(let g=c+i;g>i;g--)if(!/^[\s\n ]*$/.test(o[g])){h=g;break}return h||(h=i),await Ob(t,n,s?-1:h,d)}else return await Ob(t,n,o.length-1,d)}async function Ob(e,t,n,r){if(n<-1)throw new Error("Invalid position");if(n===-1)return{content:`${t}
${e}`,posNum:-1};const o=t.split(`
`),i=o.slice(0,n+1).join(`
`),s=o.slice(n+1).join(`
`),c=s.trim().length>0;return{content:`${i}${!c&&!r||!i.endsWith(`
`)?`
`:""}${e}${(c||r?`
`:"")+s}`,posNum:n}}const pE=e=>e.split(/\r?\n/);async function IM(e){const t=xe.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof N.TFile)){new N.Notice(O("File not found for the given thino path"));return}await t.vault.delete(n)}async function AM(e){const t=xe.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof N.TFile)){new N.Notice(O("File not found for the given thino path"));return}const o=(await t.vault.read(n)).split(`
`),i=o.findIndex(d=>d.includes(e.id));if(i===-1){new N.Notice(O("Thino not found"));return}const s=o.findIndex((d,h)=>h>i&&d.trim()==="");s===-1?o.splice(i,o.length-i):o.splice(i,s-i);const c=o.join(`
`);if(!c){new N.Notice(O("Thino not found"));return}rt.setChangedByMemos(!0),await t.vault.modify(n,c)}async function OM(e){const t=xe.getState().dailyNotesState.app,n=t.metadataCache.getFirstLinkpathDest("",e.path);if(!n){new N.Notice(O("File not found for the given thino path"));return}const r=await t.vault.read(n),o=JSON.parse(r),i=o.nodes,s=i.findIndex(g=>g.id===e.id);if(s===-1){new N.Notice(O("Thino not found"));return}i.splice(s,1);const c=o.edges;c.filter(g=>g.fromNode===e.id||g.toNode===e.id).forEach(g=>{const m=c.findIndex(w=>w.id===g.id);m!==-1&&c.splice(m,1)}),rt.setChangedByMemos(!0);const h=JSON.stringify(o,null,2);await t.vault.modify(n,h)}async function RM(e){cE()||new N.Notice(O("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."),5e3);const{vault:t}=xe.getState().dailyNotesState.app,n=e.id.toString().slice(0,14),r=N.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(N.moment(n,"YYYYMMDDHHmmss"))?N.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):N.moment(n,"YYYYMMDDHHmmss"),o=N.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(r,"day"),i=e.path,s=t.getAbstractFileByPath(i);if(!s){new N.Notice(O("Please check your daily note plugin OR periodic notes plugin settings"));return}const c=await t.read(s),d=c.split(`
`),h=o?N.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm"):(parseInt(e.id.toString().slice(10,12))+24).toString()+":"+e.id.toString().slice(12,14),g=d.findIndex(T=>T.includes(e.content.replace(/\n/g,"<br>").trim())&&T.includes(h)),m=parseInt(e.id.slice(14));let w=g;g===-1&&(w=m-1);const b=d[g]||d[m-1];if(!c){new N.Notice(O("Thino not found"));return}if(b===d[w]){rt.setChangedByMemos(!0),d.splice(w,1),await t.modify(s,d.join(`
`));return}}async function LM(){const{vault:e,metadataCache:t}=xe.getState().dailyNotesState.app,n=xe.getState().dailyNotesState.settings,o=aE()+"/"+n.DeleteFileName+".md",i=[],s=t.getFirstLinkpathDest("",o);if(s instanceof N.TFile){let c=await e.read(s),d=_M(c);if(d.length===0)return i;for(let h=0;h<d.length;h++){const g=d[h];if(/- /.test(g)){const w=PM(g).slice(0,13),b=N.moment(w,"YYYYMMDDHHmmss"),T=BM(d[h]),E=N.moment(T.slice(0,13),"YYYYMMDDHHmmss"),k=jM(d[h]);i.push({id:T,content:k,user_id:1,createdAt:b.format("YYYY/MM/DD HH:mm:SS"),updatedAt:b.format("YYYY/MM/DD HH:mm:SS"),deletedAt:E})}else continue}d=null,c=null}return i}const _M=e=>e.split(/\r?\n/),PM=e=>{var t;return(t=/^- (\d{14})(\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[1]},jM=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[2]},BM=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[4]};async function YM(e){const t=await _f(xe.getState().dailyNotesState.app)||[],n=t.findIndex(r=>r.id===e);t.splice(n,1),await gh(xe.getState().dailyNotesState.app,t)}const HM=async e=>{const{app:t}=xe.getState().dailyNotesState,n=await _f(t)||[],r=n.find(o=>o.id===e);if(r){const o=N.moment().format("YYYY/MM/DD HH:mm:ss");return r.pinnedAt=o,await gh(t,n),o}else{new N.Notice(O("Query not found"));return}},UM=async e=>{const{app:t}=xe.getState().dailyNotesState,n=await _f(t)||[],r=n.find(o=>o.id===e);if(r){r.pinnedAt="",await gh(t,n);return}else{new N.Notice(O("Query not found"));return}};function VM(e,t){const n=/%%(.*?)%%/,r=e.match(n);if(!r)return e;const o=r[1].trim(),i={};o.split(" ").forEach(c=>{const[d,h]=c.slice(1,-1).split("::");i[d]=h});for(const c of Object.keys(t))if(c!=="id"&&c!=="content"){if(c==="rowStatus"&&t.rowStatus==="ARCHIVED"){i.archived="true";continue}else if(c==="rowStatus"&&t.rowStatus==="NORMAL"){delete i.archived;continue}if(c==="deleted"&&t.deleted){const d=N.moment().format("YYYYMMDDHHmmss");i.deleted=d}else typeof t[c]=="boolean"?t[c]?i[c]="true":delete i[c]:t[c]&&(i[c]=t[c])}const s=Object.entries(i).map(([c,d])=>`[${c}::${d}]`).join(" ");return e.replace(n,`%% ${s} %%`)}async function os(e,t){if(!e.sourceType||e.sourceType!=="MULTI")return e;const{vault:n,fileManager:r}=xe.getState().dailyNotesState.app,o=n.getAbstractFileByPath(e.path);if(!o)return e;const i=N.moment();if(await r.processFrontMatter(o,s=>{(t.pinned||t.thinoType||t.rowStatus||t.visibility||t.deleted)&&rt.setChangedByMemos(!0),t.id&&(s.id=t.id),t.thinoType&&(s.thinoType=t.thinoType),t.rowStatus&&(s.rowStatus=t.rowStatus),t.visibility&&(s.visibility=t.visibility),t.webId&&(s.webId=t.webId),t.pinned!==void 0&&(s.pinned=t.pinned),t.deleted!==void 0&&(s.deletedAt=t.deleted?i.format("YYYY/MM/DD HH:mm:ss"):""),s.createdAt||(s.createdAt=i.format("YYYY/MM/DD HH:mm:ss")),s.updatedAt=i.format("YYYY/MM/DD HH:mm:ss")}),t.content){const s=await n.read(o);let c=s;const d=t.content.replace(/\$/g,"$$$$");c=s.replace(e.content,d),await n.modify(o,c)}return rt.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||i.format("YYYY/MM/DD HH:mm:ss"),updatedAt:e.updatedAt,content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?i.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function cl(e,t){if(!e.sourceType||e.sourceType!=="FILE")return e;const{vault:n}=xe.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const o=N.moment();let i="";try{i=await n.read(r)}catch(C){console.error(C),i=await n.cachedRead(r)}const s=i.split(/\r?\n/),c=s.findIndex(C=>C.includes(e.id)||e.webId&&C.includes(e.webId)),d=s[c];if(!d)return e;const h=VM(d,t);if(!d)return e;const g=h+`
`,m=s.findIndex((C,I)=>I>c&&C.trim()==="");let w="";m===-1&&(w=s.slice(c+1).join(`
`)),m!==-1&&(w=s.slice(c+1,m).join(`
`));let b=w;t!=null&&t.content&&(b=t.content.split(/\r?\n/).map(F=>"> "+F).join(`
`));const E=(g+b).split(/\r?\n/);s.splice(c,m?m-c:s.length-c,...E);const k=s.join(`
`);return await n.modify(r,k),rt.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:e.updatedAt,content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?o.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function fl(e,t){if(!e.sourceType||e.sourceType!=="CANVAS")return e;const{vault:n}=xe.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const o=await n.read(r),i=JSON.parse(o),s=i.nodes.find(h=>h.id===e.id);if(!s)return e;t.content&&(s.text=t.content),t.thinoType&&(s.thinoType=t.thinoType),t.rowStatus&&(s.rowStatus=t.rowStatus),t.visibility&&(s.visibility=t.visibility),t.pinned!==void 0&&(s.pinned=t.pinned),t.webId&&(s.webId=t.webId);const c=N.moment();t.deleted!==void 0&&(s.deletedAt=t.deleted?c.format("YYYY/MM/DD HH:mm:ss"):""),s.updatedAt=c.format("YYYY/MM/DD HH:mm:ss");const d=JSON.stringify(i,null,2);return await n.modify(r,d),rt.setChangedByMemos(!0),{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:e.updatedAt,content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?c.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function dl(e,t){cE()||new N.Notice(O("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."));const{vault:n}=xe.getState().dailyNotesState.app,r=e.id.toString().slice(0,14),o=N.moment(e.createdAt,"YYYY-MM-DD HH:mm:ss").isSame(N.moment(r,"YYYYMMDDHHmmss"))?N.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):N.moment(r,"YYYYMMDDHHmmss"),i=N.moment(e.createdAt,"YYYY-MM-DD HH:mm:ss").isSame(o,"day"),s=e.path,c=n.getAbstractFileByPath(s)||n.getAbstractFileByPath(e.path);if(!c)return new N.Notice(O("Please check your daily note plugin OR periodic notes plugin settings")),e;const h=(await n.read(c)).split(`
`),g=i?N.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm"):(parseInt(e.id.toString().slice(10,12))+24).toString()+":"+e.id.toString().slice(12,14);let m,w,b;try{m=h.findIndex(C=>{const I=C.replace(/^(-|\*|\d\.|-\s\[.?\])\s\d{2}:\d{2}/,"").trim(),B=e.content.replace(/\n/g,"<br>").trim(),F=C.includes(g),_=I.includes(B);return F&&(_||I===B)}),b=!1,w=parseInt(e.id.slice(14))}catch(C){console.error(C)}let T=m!==-1&&m===w?m:w;m===-1&&(T=w,h[w-1]&&(b=!0));let E=h[w]||h[m];if(E=E.replace(/\s\^([0-9a-zA-Z-]+)$/g,""),!E)return new N.Notice(O("Thino not found")),e;if(t.content)if(b){const C=e.thinoType==="TASK-TODO"?"- [ ] ":e.thinoType==="TASK-DONE"?"- [x] ":e.thinoType.startsWith("TASK")?`- [${e.thinoType.slice(5)}] `:"- ",I=(e.pinned?" [pinned::true]":"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.visibility==="PUBLIC"?' [visibility::"PUBLIC"]':"");E=`${C}${g} ${t.content.trim()} ${I}`}else{const C=/^(((-|\*)|(\d\.)|(-\s\[.?\]))\s\d{2}:\d{2})/.exec(E)[1];E=E.replace(/^(((-|\*)|(\d\.)|(-\s\[.?\]))\s\d{2}:\d{2})/,"").replace(e.content.trim().replace(/\n/g,"<br>"),t.content.trim().replace(/\n/g,"<br>")).trim(),E=C+" "+E}if(t.thinoType){const C=t.thinoType==="TASK-TODO"?"- [ ] ":t.thinoType==="TASK-DONE"?"- [x] ":t.thinoType.startsWith("TASK")?`- [${t.thinoType.slice(5)}] `:"- ";E=E.replace(/^((- \[.\] )|((-|\*) ))/,C)}if(t.rowStatus){const C=t.rowStatus==="ARCHIVED"?"[archived::"+(t.rowStatus==="ARCHIVED"?"true":"false")+"]":"";E=E.includes("[archived::")?E.replace(/\[archived::(true|false)\]/,C):E+" "+C}if(t.visibility){const C='[visibility::"'+t.visibility+'"]';E=E.includes("[visibility::")?E.replace(/\[visibility::"(PUBLIC|PROTECTED)"\]/g,C):E+" "+C}if(t.pinned!==void 0){const C=t.pinned?"[pinned::"+(t.pinned?"true":"false")+"]":"";E=E.includes("[pinned::")?E.replace(/\[pinned::(true|false)\]/,t.pinned===!1?"":C):E+" "+C}if(t.webId!==void 0){const C="[webId::"+t.webId+"]";E=E.includes("[webId::")?E.replace(/\[webId::([^\]]+)\]/,t.webId===""?"":C):E+" "+C}const k=N.moment();if(t.deleted!==void 0){const C="[deleted::"+k.format("YYYYMMDDHHmmss")+"]";t.deleted?(E=E.replace(/\[deleted::([^\]]+)\]/,""),E=E+" "+C):t.deleted===!1&&(E=E.replace(/\[deleted::([^\]]+)\]/,""))}if(e.hasId){const C=" ^"+e.hasId;E=E.replace(/\s\^([0-9a-zA-Z-]+)$/g,"")+C}return E!==h[T]?(h.splice(T,1,E),await n.modify(c,h.join(`
`)),rt.setChangedByMemos(!0),{...e,thinoType:t.thinoType??e.thinoType,createdAt:e.createdAt,updatedAt:e.updatedAt,content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?k.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}):e}const zM=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return fl(e,{id:e.id,pinned:!0});case"DAILY":return dl(e,{id:e.id,pinned:!0});case"MULTI":return os(e,{id:e.id,pinned:!0});case"FILE":return cl(e,{id:e.id,pinned:!0})}},$M=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return fl(e,{id:e.id,pinned:!1});case"DAILY":return dl(e,{id:e.id,pinned:!1});case"MULTI":return os(e,{id:e.id,pinned:!1});case"FILE":return cl(e,{id:e.id,pinned:!1})}};var i1;(e=>{async function t(E){return await Fb(E)}e.getMyMemos=t;async function n(E){return await Fb([E])}e.updateSpecificTypeMemo=n;function r(){return LM()}e.getMyDeletedMemos=r;function o(E){const k=Me.getMemoById(E);if(k)switch(k==null?void 0:k.sourceType){case"DAILY":return dl(k,{id:k.id,deleted:!1});case"CANVAS":return fl(k,{id:k.id,deleted:!1});case"MULTI":return os(k,{id:k.id,deleted:!1});case"FILE":return cl(k,{id:k.id,deleted:!1})}}e.restoreMemo=o;function i(E){return AM(E)}e.deleteMemoInSingleFile=i;function s(E){return IM(E)}e.deleteMemoInMultiFiles=s;function c(E){return RM(E)}e.deleteMemoInDailyNote=c;function d(E){return OM(E)}e.deleteMemoInCanvas=d;function h(){return rM()}e.getMyQueries=h;async function g(E,k){return await aM(E,k)}e.createQuery=g;function m(E,k,C){return TM(E,k,C)}e.updateQuery=m;function w(E){return YM(E)}e.deleteQueryById=w;function b(E){return HM(E)}e.pinQuery=b;function T(E){return UM(E)}e.unpinQuery=T})(i1||(i1={}));const po=i1;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});class Ru extends Error{}class qM extends Ru{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class WM extends Ru{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class GM extends Ru{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Lp extends Ru{}class hE extends Ru{constructor(t){super(`Invalid unit ${t}`)}}class na extends Ru{}class nl extends Ru{constructor(){super("Zone is an abstract class")}}const $e="numeric",Aa="short",Po="long",Zg={year:$e,month:$e,day:$e},mE={year:$e,month:Aa,day:$e},KM={year:$e,month:Aa,day:$e,weekday:Aa},gE={year:$e,month:Po,day:$e},vE={year:$e,month:Po,day:$e,weekday:Po},yE={hour:$e,minute:$e},wE={hour:$e,minute:$e,second:$e},bE={hour:$e,minute:$e,second:$e,timeZoneName:Aa},DE={hour:$e,minute:$e,second:$e,timeZoneName:Po},SE={hour:$e,minute:$e,hourCycle:"h23"},EE={hour:$e,minute:$e,second:$e,hourCycle:"h23"},TE={hour:$e,minute:$e,second:$e,hourCycle:"h23",timeZoneName:Aa},CE={hour:$e,minute:$e,second:$e,hourCycle:"h23",timeZoneName:Po},xE={year:$e,month:$e,day:$e,hour:$e,minute:$e},ME={year:$e,month:$e,day:$e,hour:$e,minute:$e,second:$e},kE={year:$e,month:Aa,day:$e,hour:$e,minute:$e},NE={year:$e,month:Aa,day:$e,hour:$e,minute:$e,second:$e},QM={year:$e,month:Aa,day:$e,weekday:Aa,hour:$e,minute:$e},FE={year:$e,month:Po,day:$e,hour:$e,minute:$e,timeZoneName:Aa},IE={year:$e,month:Po,day:$e,hour:$e,minute:$e,second:$e,timeZoneName:Aa},AE={year:$e,month:Po,day:$e,weekday:Po,hour:$e,minute:$e,timeZoneName:Po},OE={year:$e,month:Po,day:$e,weekday:Po,hour:$e,minute:$e,second:$e,timeZoneName:Po};class vh{get type(){throw new nl}get name(){throw new nl}get ianaName(){return this.name}get isUniversal(){throw new nl}offsetName(t,n){throw new nl}formatOffset(t,n){throw new nl}offset(t){throw new nl}equals(t){throw new nl}get isValid(){throw new nl}}let f0=null;class Ev extends vh{static get instance(){return f0===null&&(f0=new Ev),f0}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return LE(t,n,r)}formatOffset(t,n){return Hp(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let jg={};function ZM(e){return jg[e]||(jg[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),jg[e]}const JM={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function XM(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,o,i,s,c,d,h,g]=r;return[s,o,i,c,d,h,g]}function ek(e,t){const n=e.formatToParts(t),r=[];for(let o=0;o<n.length;o++){const{type:i,value:s}=n[o],c=JM[i];i==="era"?r[c]=s:_t(c)||(r[c]=parseInt(s,10))}return r}let gg={};class ss extends vh{static create(t){return gg[t]||(gg[t]=new ss(t)),gg[t]}static resetCache(){gg={},jg={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=ss.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return LE(t,n,r,this.name)}formatOffset(t,n){return Hp(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=ZM(this.name);let[o,i,s,c,d,h,g]=r.formatToParts?ek(r,n):XM(r,n);c==="BC"&&(o=-Math.abs(o)+1);const w=G1({year:o,month:i,day:s,hour:d===24?0:d,minute:h,second:g,millisecond:0});let b=+n;const T=b%1e3;return b-=T>=0?T:1e3+T,(w-b)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Rb={};function tk(e,t={}){const n=JSON.stringify([e,t]);let r=Rb[n];return r||(r=new Intl.ListFormat(e,t),Rb[n]=r),r}let s1={};function l1(e,t={}){const n=JSON.stringify([e,t]);let r=s1[n];return r||(r=new Intl.DateTimeFormat(e,t),s1[n]=r),r}let u1={};function nk(e,t={}){const n=JSON.stringify([e,t]);let r=u1[n];return r||(r=new Intl.NumberFormat(e,t),u1[n]=r),r}let c1={};function rk(e,t={}){const{base:n,...r}=t,o=JSON.stringify([e,r]);let i=c1[o];return i||(i=new Intl.RelativeTimeFormat(e,t),c1[o]=i),i}let _p=null;function ok(){return _p||(_p=new Intl.DateTimeFormat().resolvedOptions().locale,_p)}function ak(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,o;try{r=l1(e).resolvedOptions(),o=e}catch{const d=e.substring(0,n);r=l1(d).resolvedOptions(),o=d}const{numberingSystem:i,calendar:s}=r;return[o,i,s]}}function ik(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function sk(e){const t=[];for(let n=1;n<=12;n++){const r=at.utc(2016,n,1);t.push(e(r))}return t}function lk(e){const t=[];for(let n=1;n<=7;n++){const r=at.utc(2016,11,13+n);t.push(e(r))}return t}function vg(e,t,n,r,o){const i=e.listingMode(n);return i==="error"?null:i==="en"?r(t):o(t)}function uk(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class ck{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:o,floor:i,...s}=r;if(!n||Object.keys(s).length>0){const c={useGrouping:!1,...r};r.padTo>0&&(c.minimumIntegerDigits=r.padTo),this.inf=nk(t,c)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):W1(t,3);return Bn(n,this.padTo)}}}class fk{constructor(t,n,r){this.opts=r;let o;if(t.zone.isUniversal){const s=-1*(t.offset/60),c=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&ss.create(c).valid?(o=c,this.dt=t):(o="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:at.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,o=t.zone.name);const i={...this.opts};i.timeZone=i.timeZone||o,this.dtf=l1(n,i)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class dk{constructor(t,n,r){this.opts={style:"long",...r},!n&&RE()&&(this.rtf=rk(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Nk(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class un{static fromOpts(t){return un.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,o=!1){const i=t||jn.defaultLocale,s=i||(o?"en-US":ok()),c=n||jn.defaultNumberingSystem,d=r||jn.defaultOutputCalendar;return new un(s,c,d,i)}static resetCache(){_p=null,s1={},u1={},c1={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return un.create(t,n,r)}constructor(t,n,r,o){const[i,s,c]=ak(t);this.locale=i,this.numberingSystem=n||s||null,this.outputCalendar=r||c||null,this.intl=ik(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=o,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=uk(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:un.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return vg(this,t,r,jE,()=>{const o=n?{month:t,day:"numeric"}:{month:t},i=n?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=sk(s=>this.extract(s,o,"month"))),this.monthsCache[i][t]})}weekdays(t,n=!1,r=!0){return vg(this,t,r,HE,()=>{const o=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=n?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=lk(s=>this.extract(s,o,"weekday"))),this.weekdaysCache[i][t]})}meridiems(t=!0){return vg(this,void 0,t,()=>UE,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[at.utc(2016,11,13,9),at.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return vg(this,t,n,VE,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[at.utc(-40,1,1),at.utc(2017,1,1)].map(o=>this.extract(o,r,"era"))),this.eraCache[t]})}extract(t,n,r){const o=this.dtFormatter(t,n),i=o.formatToParts(),s=i.find(c=>c.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new ck(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new fk(t,this.intl,n)}relFormatter(t={}){return new dk(this.intl,this.isEnglish(),t)}listFormatter(t={}){return tk(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}let d0=null;class Wr extends vh{static get utcInstance(){return d0===null&&(d0=new Wr(0)),d0}static instance(t){return t===0?Wr.utcInstance:new Wr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Wr(Cv(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Hp(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Hp(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Hp(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class pk extends vh{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function pl(e,t){if(_t(e)||e===null)return t;if(e instanceof vh)return e;if(hk(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Ev.instance:n==="utc"||n==="gmt"?Wr.utcInstance:Wr.parseSpecifier(n)||ss.create(e)}else return Su(e)?Wr.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new pk(e)}let Lb=()=>Date.now(),_b="system",Pb=null,jb=null,Bb=null,Yb=60,Hb;class jn{static get now(){return Lb}static set now(t){Lb=t}static set defaultZone(t){_b=t}static get defaultZone(){return pl(_b,Ev.instance)}static get defaultLocale(){return Pb}static set defaultLocale(t){Pb=t}static get defaultNumberingSystem(){return jb}static set defaultNumberingSystem(t){jb=t}static get defaultOutputCalendar(){return Bb}static set defaultOutputCalendar(t){Bb=t}static get twoDigitCutoffYear(){return Yb}static set twoDigitCutoffYear(t){Yb=t%100}static get throwOnInvalid(){return Hb}static set throwOnInvalid(t){Hb=t}static resetCaches(){un.resetCache(),ss.resetCache()}}function _t(e){return typeof e>"u"}function Su(e){return typeof e=="number"}function Tv(e){return typeof e=="number"&&e%1===0}function hk(e){return typeof e=="string"}function mk(e){return Object.prototype.toString.call(e)==="[object Date]"}function RE(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function gk(e){return Array.isArray(e)?e:[e]}function Ub(e,t,n){if(e.length!==0)return e.reduce((r,o)=>{const i=[t(o),o];return r&&n(r[0],i[0])===r[0]?r:i},null)[1]}function vk(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Sf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function is(e,t,n){return Tv(e)&&e>=t&&e<=n}function yk(e,t){return e-t*Math.floor(e/t)}function Bn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function ul(e){if(!(_t(e)||e===null||e===""))return parseInt(e,10)}function mu(e){if(!(_t(e)||e===null||e===""))return parseFloat(e)}function q1(e){if(!(_t(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function W1(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function yh(e){return e%4===0&&(e%100!==0||e%400===0)}function Yp(e){return yh(e)?366:365}function Jg(e,t){const n=yk(t-1,12)+1,r=e+(t-n)/12;return n===2?yh(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function G1(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function Xg(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function f1(e){return e>99?e:e>jn.twoDigitCutoffYear?1900+e:2e3+e}function LE(e,t,n,r=null){const o=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const s={timeZoneName:t,...i},c=new Intl.DateTimeFormat(n,s).formatToParts(o).find(d=>d.type.toLowerCase()==="timezonename");return c?c.value:null}function Cv(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,o=n<0||Object.is(n,-0)?-r:r;return n*60+o}function _E(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new na(`Invalid unit value ${e}`);return t}function ev(e,t){const n={};for(const r in e)if(Sf(e,r)){const o=e[r];if(o==null)continue;n[t(r)]=_E(o)}return n}function Hp(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return`${o}${Bn(n,2)}:${Bn(r,2)}`;case"narrow":return`${o}${n}${r>0?`:${r}`:""}`;case"techie":return`${o}${Bn(n,2)}${Bn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function xv(e){return vk(e,["hour","minute","second","millisecond"])}const wk=["January","February","March","April","May","June","July","August","September","October","November","December"],PE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],bk=["J","F","M","A","M","J","J","A","S","O","N","D"];function jE(e){switch(e){case"narrow":return[...bk];case"short":return[...PE];case"long":return[...wk];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const BE=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],YE=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Dk=["M","T","W","T","F","S","S"];function HE(e){switch(e){case"narrow":return[...Dk];case"short":return[...YE];case"long":return[...BE];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const UE=["AM","PM"],Sk=["Before Christ","Anno Domini"],Ek=["BC","AD"],Tk=["B","A"];function VE(e){switch(e){case"narrow":return[...Tk];case"short":return[...Ek];case"long":return[...Sk];default:return null}}function Ck(e){return UE[e.hour<12?0:1]}function xk(e,t){return HE(t)[e.weekday-1]}function Mk(e,t){return jE(t)[e.month-1]}function kk(e,t){return VE(t)[e.year<0?0:1]}function Nk(e,t,n="always",r=!1){const o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&i){const m=e==="days";switch(t){case 1:return m?"tomorrow":`next ${o[e][0]}`;case-1:return m?"yesterday":`last ${o[e][0]}`;case 0:return m?"today":`this ${o[e][0]}`}}const s=Object.is(t,-0)||t<0,c=Math.abs(t),d=c===1,h=o[e],g=r?d?h[1]:h[2]||h[1]:d?o[e][0]:e;return s?`${c} ${g} ago`:`in ${c} ${g}`}function Vb(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Fk={D:Zg,DD:mE,DDD:gE,DDDD:vE,t:yE,tt:wE,ttt:bE,tttt:DE,T:SE,TT:EE,TTT:TE,TTTT:CE,f:xE,ff:kE,fff:FE,ffff:AE,F:ME,FF:NE,FFF:IE,FFFF:OE};class Rr{static create(t,n={}){return new Rr(t,n)}static parseFormat(t){let n=null,r="",o=!1;const i=[];for(let s=0;s<t.length;s++){const c=t.charAt(s);c==="'"?(r.length>0&&i.push({literal:o,val:r}),n=null,r="",o=!o):o||c===n?r+=c:(r.length>0&&i.push({literal:!1,val:r}),r=c,n=c)}return r.length>0&&i.push({literal:o,val:r}),i}static macroTokenToFormatOpts(t){return Fk[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}formatInterval(t,n={}){return this.loc.dtFormatter(t.start,{...this.opts,...n}).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Bn(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",o=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(b,T)=>this.loc.extract(t,b,T),s=b=>t.isOffsetFixed&&t.offset===0&&b.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,b.format):"",c=()=>r?Ck(t):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),d=(b,T)=>r?Mk(t,b):i(T?{month:b}:{month:b,day:"numeric"},"month"),h=(b,T)=>r?xk(t,b):i(T?{weekday:b}:{weekday:b,month:"long",day:"numeric"},"weekday"),g=b=>{const T=Rr.macroTokenToFormatOpts(b);return T?this.formatWithSystemDefault(t,T):b},m=b=>r?kk(t,b):i({era:b},"era"),w=b=>{switch(b){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return c();case"d":return o?i({day:"numeric"},"day"):this.num(t.day);case"dd":return o?i({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return h("short",!0);case"cccc":return h("long",!0);case"ccccc":return h("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return h("short",!1);case"EEEE":return h("long",!1);case"EEEEE":return h("narrow",!1);case"L":return o?i({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return o?i({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return d("short",!0);case"LLLL":return d("long",!0);case"LLLLL":return d("narrow",!0);case"M":return o?i({month:"numeric"},"month"):this.num(t.month);case"MM":return o?i({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return d("short",!1);case"MMMM":return d("long",!1);case"MMMMM":return d("narrow",!1);case"y":return o?i({year:"numeric"},"year"):this.num(t.year);case"yy":return o?i({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return o?i({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return o?i({year:"numeric"},"year"):this.num(t.year,6);case"G":return m("short");case"GG":return m("long");case"GGGGG":return m("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return g(b)}};return Vb(Rr.parseFormat(n),w)}formatDurationFromString(t,n){const r=d=>{switch(d[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},o=d=>h=>{const g=r(h);return g?this.num(d.get(g),h.length):h},i=Rr.parseFormat(n),s=i.reduce((d,{literal:h,val:g})=>h?d:d.concat(g),[]),c=t.shiftTo(...s.map(r).filter(d=>d));return Vb(i,o(c))}}class Na{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const zE=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Pf(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function jf(...e){return t=>e.reduce(([n,r,o],i)=>{const[s,c,d]=i(t,o);return[{...n,...s},c||r,d]},[{},null,1]).slice(0,2)}function Bf(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const o=n.exec(e);if(o)return r(o)}return[null,null]}function $E(...e){return(t,n)=>{const r={};let o;for(o=0;o<e.length;o++)r[e[o]]=ul(t[n+o]);return[r,null,n+o]}}const qE=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Ik=`(?:${qE.source}?(?:\\[(${zE.source})\\])?)?`,K1=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,WE=RegExp(`${K1.source}${Ik}`),Q1=RegExp(`(?:T${WE.source})?`),Ak=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ok=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Rk=/(\d{4})-?(\d{3})/,Lk=$E("weekYear","weekNumber","weekDay"),_k=$E("year","ordinal"),Pk=/(\d{4})-(\d\d)-(\d\d)/,GE=RegExp(`${K1.source} ?(?:${qE.source}|(${zE.source}))?`),jk=RegExp(`(?: ${GE.source})?`);function wf(e,t,n){const r=e[t];return _t(r)?n:ul(r)}function Bk(e,t){return[{year:wf(e,t),month:wf(e,t+1,1),day:wf(e,t+2,1)},null,t+3]}function Yf(e,t){return[{hours:wf(e,t,0),minutes:wf(e,t+1,0),seconds:wf(e,t+2,0),milliseconds:q1(e[t+3])},null,t+4]}function wh(e,t){const n=!e[t]&&!e[t+1],r=Cv(e[t+1],e[t+2]),o=n?null:Wr.instance(r);return[{},o,t+3]}function bh(e,t){const n=e[t]?ss.create(e[t]):null;return[{},n,t+1]}const Yk=RegExp(`^T?${K1.source}$`),Hk=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Uk(e){const[t,n,r,o,i,s,c,d,h]=e,g=t[0]==="-",m=d&&d[0]==="-",w=(b,T=!1)=>b!==void 0&&(T||b&&g)?-b:b;return[{years:w(mu(n)),months:w(mu(r)),weeks:w(mu(o)),days:w(mu(i)),hours:w(mu(s)),minutes:w(mu(c)),seconds:w(mu(d),d==="-0"),milliseconds:w(q1(h),m)}]}const Vk={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Z1(e,t,n,r,o,i,s){const c={year:t.length===2?f1(ul(t)):ul(t),month:PE.indexOf(n)+1,day:ul(r),hour:ul(o),minute:ul(i)};return s&&(c.second=ul(s)),e&&(c.weekday=e.length>3?BE.indexOf(e)+1:YE.indexOf(e)+1),c}const zk=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function $k(e){const[,t,n,r,o,i,s,c,d,h,g,m]=e,w=Z1(t,o,r,n,i,s,c);let b;return d?b=Vk[d]:h?b=0:b=Cv(g,m),[w,new Wr(b)]}function qk(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Wk=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Gk=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Kk=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function zb(e){const[,t,n,r,o,i,s,c]=e;return[Z1(t,o,r,n,i,s,c),Wr.utcInstance]}function Qk(e){const[,t,n,r,o,i,s,c]=e;return[Z1(t,c,n,r,o,i,s),Wr.utcInstance]}const Zk=Pf(Ak,Q1),Jk=Pf(Ok,Q1),Xk=Pf(Rk,Q1),e5=Pf(WE),KE=jf(Bk,Yf,wh,bh),t5=jf(Lk,Yf,wh,bh),n5=jf(_k,Yf,wh,bh),r5=jf(Yf,wh,bh);function o5(e){return Bf(e,[Zk,KE],[Jk,t5],[Xk,n5],[e5,r5])}function a5(e){return Bf(qk(e),[zk,$k])}function i5(e){return Bf(e,[Wk,zb],[Gk,zb],[Kk,Qk])}function s5(e){return Bf(e,[Hk,Uk])}const l5=jf(Yf);function u5(e){return Bf(e,[Yk,l5])}const c5=Pf(Pk,jk),f5=Pf(GE),d5=jf(Yf,wh,bh);function p5(e){return Bf(e,[c5,KE],[f5,d5])}const h5="Invalid Duration",QE={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},m5={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...QE},ta=146097/400,ff=146097/4800,g5={years:{quarters:4,months:12,weeks:ta/7,days:ta,hours:ta*24,minutes:ta*24*60,seconds:ta*24*60*60,milliseconds:ta*24*60*60*1e3},quarters:{months:3,weeks:ta/28,days:ta/4,hours:ta*24/4,minutes:ta*24*60/4,seconds:ta*24*60*60/4,milliseconds:ta*24*60*60*1e3/4},months:{weeks:ff/7,days:ff,hours:ff*24,minutes:ff*24*60,seconds:ff*24*60*60,milliseconds:ff*24*60*60*1e3},...QE},gu=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],v5=gu.slice(0).reverse();function rl(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Ze(r)}function y5(e){return e<0?Math.floor(e):Math.ceil(e)}function ZE(e,t,n,r,o){const i=e[o][n],s=t[n]/i,c=Math.sign(s)===Math.sign(r[o]),d=!c&&r[o]!==0&&Math.abs(s)<=1?y5(s):Math.trunc(s);r[o]+=d,t[n]-=d*i}function w5(e,t){v5.reduce((n,r)=>_t(t[r])?n:(n&&ZE(e,t,n,t,r),r),null)}function b5(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Ze{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?g5:m5;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||un.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Ze.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new na(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ze({values:ev(t,Ze.normalizeUnit),loc:un.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Su(t))return Ze.fromMillis(t);if(Ze.isDuration(t))return t;if(typeof t=="object")return Ze.fromObject(t);throw new na(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=s5(t);return r?Ze.fromObject(r,n):Ze.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=u5(t);return r?Ze.fromObject(r,n):Ze.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new na("need to specify a reason the Duration is invalid");const r=t instanceof Na?t:new Na(t,n);if(jn.throwOnInvalid)throw new GM(r);return new Ze({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new hE(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Rr.create(this.loc,r).formatDurationFromString(this,t):h5}toHuman(t={}){const n=gu.map(r=>{const o=this.values[r];return _t(o)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(o)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=W1(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let o=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(o+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(o+=".SSS"));let i=r.toFormat(o);return t.includePrefix&&(i="T"+i),i}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Ze.fromDurationLike(t),r={};for(const o of gu)(Sf(n.values,o)||Sf(this.values,o))&&(r[o]=n.get(o)+this.get(o));return rl(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ze.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=_E(t(this.values[r],r));return rl(this,{values:n},!0)}get(t){return this[Ze.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...ev(t,Ze.normalizeUnit)};return rl(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:o}={}){const s={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:o,conversionAccuracy:r};return rl(this,s)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return w5(this.matrix,t),rl(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=b5(this.normalize().shiftToAll().toObject());return rl(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>Ze.normalizeUnit(s));const n={},r={},o=this.toObject();let i;for(const s of gu)if(t.indexOf(s)>=0){i=s;let c=0;for(const h in r)c+=this.matrix[h][s]*r[h],r[h]=0;Su(o[s])&&(c+=o[s]);const d=Math.trunc(c);n[s]=d,r[s]=(c*1e3-d*1e3)/1e3;for(const h in o)gu.indexOf(h)>gu.indexOf(s)&&ZE(this.matrix,o,h,n,s)}else Su(o[s])&&(r[s]=o[s]);for(const s in r)r[s]!==0&&(n[i]+=s===i?r[s]:r[s]/this.matrix[i][s]);return rl(this,{values:n},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return rl(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,o){return r===void 0||r===0?o===void 0||o===0:r===o}for(const r of gu)if(!n(this.values[r],t.values[r]))return!1;return!0}}const df="Invalid Interval";function D5(e,t){return!e||!e.isValid?Tn.invalid("missing or invalid start"):!t||!t.isValid?Tn.invalid("missing or invalid end"):t<e?Tn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Tn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new na("need to specify a reason the Interval is invalid");const r=t instanceof Na?t:new Na(t,n);if(jn.throwOnInvalid)throw new WM(r);return new Tn({invalid:r})}static fromDateTimes(t,n){const r=xp(t),o=xp(n),i=D5(r,o);return i??new Tn({start:r,end:o})}static after(t,n){const r=Ze.fromDurationLike(n),o=xp(t);return Tn.fromDateTimes(o,o.plus(r))}static before(t,n){const r=Ze.fromDurationLike(n),o=xp(t);return Tn.fromDateTimes(o.minus(r),o)}static fromISO(t,n){const[r,o]=(t||"").split("/",2);if(r&&o){let i,s;try{i=at.fromISO(r,n),s=i.isValid}catch{s=!1}let c,d;try{c=at.fromISO(o,n),d=c.isValid}catch{d=!1}if(s&&d)return Tn.fromDateTimes(i,c);if(s){const h=Ze.fromISO(o,n);if(h.isValid)return Tn.after(i,h)}else if(d){const h=Ze.fromISO(r,n);if(h.isValid)return Tn.before(c,h)}}return Tn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const n=this.start.startOf(t),r=this.end.startOf(t);return Math.floor(r.diff(n,t).get(t))+1}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Tn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(xp).filter(s=>this.contains(s)).sort(),r=[];let{s:o}=this,i=0;for(;o<this.e;){const s=n[i]||this.e,c=+s>+this.e?this.e:s;r.push(Tn.fromDateTimes(o,c)),o=c,i+=1}return r}splitBy(t){const n=Ze.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,o=1,i;const s=[];for(;r<this.e;){const c=this.start.plus(n.mapUnits(d=>d*o));i=+c>+this.e?this.e:c,s.push(Tn.fromDateTimes(r,i)),r=i,o+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:Tn.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return Tn.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((o,i)=>o.s-i.s).reduce(([o,i],s)=>i?i.overlaps(s)||i.abutsStart(s)?[o,i.union(s)]:[o.concat([i]),s]:[o,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const o=[],i=t.map(d=>[{time:d.s,type:"s"},{time:d.e,type:"e"}]),s=Array.prototype.concat(...i),c=s.sort((d,h)=>d.time-h.time);for(const d of c)r+=d.type==="s"?1:-1,r===1?n=d.time:(n&&+n!=+d.time&&o.push(Tn.fromDateTimes(n,d.time)),n=null);return Tn.merge(o)}difference(...t){return Tn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} ${this.e.toISO()})`:df}toLocaleString(t=Zg,n={}){return this.isValid?Rr.create(this.s.loc.clone(n),t).formatInterval(this):df}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:df}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:df}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:df}toFormat(t,{separator:n=" "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:df}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ze.invalid(this.invalidReason)}mapEndpoints(t){return Tn.fromDateTimes(t(this.s),t(this.e))}}class yg{static hasDST(t=jn.defaultZone){const n=at.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return ss.isValidZone(t)}static normalizeZone(t){return pl(t,jn.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||un.create(n,r,i)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null,outputCalendar:i="gregory"}={}){return(o||un.create(n,r,i)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null}={}){return(o||un.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:o=null}={}){return(o||un.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return un.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return un.create(n,null,"gregory").eras(t)}static features(){return{relative:RE()}}}function $b(e,t){const n=o=>o.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Ze.fromMillis(r).as("days"))}function S5(e,t,n){const r=[["years",(d,h)=>h.year-d.year],["quarters",(d,h)=>h.quarter-d.quarter+(h.year-d.year)*4],["months",(d,h)=>h.month-d.month+(h.year-d.year)*12],["weeks",(d,h)=>{const g=$b(d,h);return(g-g%7)/7}],["days",$b]],o={},i=e;let s,c;for(const[d,h]of r)n.indexOf(d)>=0&&(s=d,o[d]=h(e,t),c=i.plus(o),c>t?(o[d]--,e=i.plus(o)):e=c);return[e,o,c,s]}function E5(e,t,n,r){let[o,i,s,c]=S5(e,t,n);const d=t-o,h=n.filter(m=>["hours","minutes","seconds","milliseconds"].indexOf(m)>=0);h.length===0&&(s<t&&(s=o.plus({[c]:1})),s!==o&&(i[c]=(i[c]||0)+d/(s-o)));const g=Ze.fromObject(i,r);return h.length>0?Ze.fromMillis(d,r).shiftTo(...h).plus(g):g}const J1={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",gujr:"[-૯]",hanidec:"[|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[-೯]",laoo:"[-໙]",limb:"[᥆-᥏]",mlym:"[-൯]",mong:"[᠐-᠙]",mymr:"[-၉]",orya:"[-୯]",tamldec:"[-௯]",telu:"[-౯]",thai:"[-๙]",tibt:"[༠-༩]",latn:"\\d"},qb={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},T5=J1.hanidec.replace(/[\[|\]]/g,"").split("");function C5(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(J1.hanidec)!==-1)t+=T5.indexOf(e[n]);else for(const o in qb){const[i,s]=qb[o];r>=i&&r<=s&&(t+=r-i)}}return parseInt(t,10)}else return t}function Ca({numberingSystem:e},t=""){return new RegExp(`${J1[e||"latn"]}${t}`)}const x5="missing Intl.DateTimeFormat.formatToParts support";function Ut(e,t=n=>n){return{regex:e,deser:([n])=>t(C5(n))}}const M5=" ",JE=`[ ${M5}]`,XE=new RegExp(JE,"g");function k5(e){return e.replace(/\./g,"\\.?").replace(XE,JE)}function Wb(e){return e.replace(/\./g,"").replace(XE," ").toLowerCase()}function xa(e,t){return e===null?null:{regex:RegExp(e.map(k5).join("|")),deser:([n])=>e.findIndex(r=>Wb(n)===Wb(r))+t}}function Gb(e,t){return{regex:e,deser:([,n,r])=>Cv(n,r),groups:t}}function p0(e){return{regex:e,deser:([t])=>t}}function N5(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function F5(e,t){const n=Ca(t),r=Ca(t,"{2}"),o=Ca(t,"{3}"),i=Ca(t,"{4}"),s=Ca(t,"{6}"),c=Ca(t,"{1,2}"),d=Ca(t,"{1,3}"),h=Ca(t,"{1,6}"),g=Ca(t,"{1,9}"),m=Ca(t,"{2,4}"),w=Ca(t,"{4,6}"),b=k=>({regex:RegExp(N5(k.val)),deser:([C])=>C,literal:!0}),E=(k=>{if(e.literal)return b(k);switch(k.val){case"G":return xa(t.eras("short",!1),0);case"GG":return xa(t.eras("long",!1),0);case"y":return Ut(h);case"yy":return Ut(m,f1);case"yyyy":return Ut(i);case"yyyyy":return Ut(w);case"yyyyyy":return Ut(s);case"M":return Ut(c);case"MM":return Ut(r);case"MMM":return xa(t.months("short",!0,!1),1);case"MMMM":return xa(t.months("long",!0,!1),1);case"L":return Ut(c);case"LL":return Ut(r);case"LLL":return xa(t.months("short",!1,!1),1);case"LLLL":return xa(t.months("long",!1,!1),1);case"d":return Ut(c);case"dd":return Ut(r);case"o":return Ut(d);case"ooo":return Ut(o);case"HH":return Ut(r);case"H":return Ut(c);case"hh":return Ut(r);case"h":return Ut(c);case"mm":return Ut(r);case"m":return Ut(c);case"q":return Ut(c);case"qq":return Ut(r);case"s":return Ut(c);case"ss":return Ut(r);case"S":return Ut(d);case"SSS":return Ut(o);case"u":return p0(g);case"uu":return p0(c);case"uuu":return Ut(n);case"a":return xa(t.meridiems(),0);case"kkkk":return Ut(i);case"kk":return Ut(m,f1);case"W":return Ut(c);case"WW":return Ut(r);case"E":case"c":return Ut(n);case"EEE":return xa(t.weekdays("short",!1,!1),1);case"EEEE":return xa(t.weekdays("long",!1,!1),1);case"ccc":return xa(t.weekdays("short",!0,!1),1);case"cccc":return xa(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Gb(new RegExp(`([+-]${c.source})(?::(${r.source}))?`),2);case"ZZZ":return Gb(new RegExp(`([+-]${c.source})(${r.source})?`),2);case"z":return p0(/[a-z_+-/]{1,256}?/i);default:return b(k)}})(e)||{invalidReason:x5};return E.token=e,E}const I5={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function A5(e,t){const{type:n,value:r}=e;if(n==="literal")return{literal:!0,val:r};const o=t[n];let i=I5[n];if(typeof i=="object"&&(i=i[o]),i)return{literal:!1,val:i}}function O5(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function R5(e,t,n){const r=e.match(t);if(r){const o={};let i=1;for(const s in n)if(Sf(n,s)){const c=n[s],d=c.groups?c.groups+1:1;!c.literal&&c.token&&(o[c.token.val[0]]=c.deser(r.slice(i,i+d))),i+=d}return[r,o]}else return[r,{}]}function L5(e){const t=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return _t(e.z)||(n=ss.create(e.z)),_t(e.Z)||(n||(n=new Wr(e.Z)),r=e.Z),_t(e.q)||(e.M=(e.q-1)*3+1),_t(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),_t(e.u)||(e.S=q1(e.u)),[Object.keys(e).reduce((i,s)=>{const c=t(s);return c&&(i[c]=e[s]),i},{}),n,r]}let h0=null;function _5(){return h0||(h0=at.fromMillis(1555555555555)),h0}function P5(e,t){if(e.literal)return e;const n=Rr.macroTokenToFormatOpts(e.val),r=n3(n,t);return r==null||r.includes(void 0)?e:r}function e3(e,t){return Array.prototype.concat(...e.map(n=>P5(n,t)))}function t3(e,t,n){const r=e3(Rr.parseFormat(n),e),o=r.map(s=>F5(s,e)),i=o.find(s=>s.invalidReason);if(i)return{input:t,tokens:r,invalidReason:i.invalidReason};{const[s,c]=O5(o),d=RegExp(s,"i"),[h,g]=R5(t,d,c),[m,w,b]=g?L5(g):[null,null,void 0];if(Sf(g,"a")&&Sf(g,"H"))throw new Lp("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:d,rawMatches:h,matches:g,result:m,zone:w,specificOffset:b}}}function j5(e,t,n){const{result:r,zone:o,specificOffset:i,invalidReason:s}=t3(e,t,n);return[r,o,i,s]}function n3(e,t){return e?Rr.create(t,e).formatDateTimeParts(_5()).map(o=>A5(o,e)):null}const r3=[0,31,59,90,120,151,181,212,243,273,304,334],o3=[0,31,60,91,121,152,182,213,244,274,305,335];function ra(e,t){return new Na("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function a3(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const o=r.getUTCDay();return o===0?7:o}function i3(e,t,n){return n+(yh(e)?o3:r3)[t-1]}function s3(e,t){const n=yh(e)?o3:r3,r=n.findIndex(i=>i<t),o=t-n[r];return{month:r+1,day:o}}function d1(e){const{year:t,month:n,day:r}=e,o=i3(t,n,r),i=a3(t,n,r);let s=Math.floor((o-i+10)/7),c;return s<1?(c=t-1,s=Xg(c)):s>Xg(t)?(c=t+1,s=1):c=t,{weekYear:c,weekNumber:s,weekday:i,...xv(e)}}function Kb(e){const{weekYear:t,weekNumber:n,weekday:r}=e,o=a3(t,1,4),i=Yp(t);let s=n*7+r-o-3,c;s<1?(c=t-1,s+=Yp(c)):s>i?(c=t+1,s-=Yp(t)):c=t;const{month:d,day:h}=s3(c,s);return{year:c,month:d,day:h,...xv(e)}}function m0(e){const{year:t,month:n,day:r}=e,o=i3(t,n,r);return{year:t,ordinal:o,...xv(e)}}function Qb(e){const{year:t,ordinal:n}=e,{month:r,day:o}=s3(t,n);return{year:t,month:r,day:o,...xv(e)}}function B5(e){const t=Tv(e.weekYear),n=is(e.weekNumber,1,Xg(e.weekYear)),r=is(e.weekday,1,7);return t?n?r?!1:ra("weekday",e.weekday):ra("week",e.week):ra("weekYear",e.weekYear)}function Y5(e){const t=Tv(e.year),n=is(e.ordinal,1,Yp(e.year));return t?n?!1:ra("ordinal",e.ordinal):ra("year",e.year)}function l3(e){const t=Tv(e.year),n=is(e.month,1,12),r=is(e.day,1,Jg(e.year,e.month));return t?n?r?!1:ra("day",e.day):ra("month",e.month):ra("year",e.year)}function u3(e){const{hour:t,minute:n,second:r,millisecond:o}=e,i=is(t,0,23)||t===24&&n===0&&r===0&&o===0,s=is(n,0,59),c=is(r,0,59),d=is(o,0,999);return i?s?c?d?!1:ra("millisecond",o):ra("second",r):ra("minute",n):ra("hour",t)}const g0="Invalid DateTime",Zb=864e13;function wg(e){return new Na("unsupported zone",`the zone "${e.name}" is not supported`)}function v0(e){return e.weekData===null&&(e.weekData=d1(e.c)),e.weekData}function Tp(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new at({...n,...t,old:n})}function c3(e,t,n){let r=e-t*60*1e3;const o=n.offset(r);if(t===o)return[r,t];r-=(o-t)*60*1e3;const i=n.offset(r);return o===i?[r,o]:[e-Math.min(o,i)*60*1e3,Math.max(o,i)]}function Jb(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Bg(e,t,n){return c3(G1(e),t,n)}function Xb(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),o=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,i={...e.c,year:r,month:o,day:Math.min(e.c.day,Jg(r,o))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=Ze.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),c=G1(i);let[d,h]=c3(c,n,e.zone);return s!==0&&(d+=s,h=e.zone.offset(d)),{ts:d,o:h}}function Cp(e,t,n,r,o,i){const{setZone:s,zone:c}=n;if(e&&Object.keys(e).length!==0){const d=t||c,h=at.fromObject(e,{...n,zone:d,specificOffset:i});return s?h:h.setZone(c)}else return at.invalid(new Na("unparsable",`the input "${o}" can't be parsed as ${r}`))}function bg(e,t,n=!0){return e.isValid?Rr.create(un.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function y0(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Bn(e.c.year,n?6:4),t?(r+="-",r+=Bn(e.c.month),r+="-",r+=Bn(e.c.day)):(r+=Bn(e.c.month),r+=Bn(e.c.day)),r}function eD(e,t,n,r,o,i){let s=Bn(e.c.hour);return t?(s+=":",s+=Bn(e.c.minute),(e.c.second!==0||!n)&&(s+=":")):s+=Bn(e.c.minute),(e.c.second!==0||!n)&&(s+=Bn(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=Bn(e.c.millisecond,3))),o&&(e.isOffsetFixed&&e.offset===0&&!i?s+="Z":e.o<0?(s+="-",s+=Bn(Math.trunc(-e.o/60)),s+=":",s+=Bn(Math.trunc(-e.o%60))):(s+="+",s+=Bn(Math.trunc(e.o/60)),s+=":",s+=Bn(Math.trunc(e.o%60)))),i&&(s+="["+e.zone.ianaName+"]"),s}const f3={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},H5={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},U5={ordinal:1,hour:0,minute:0,second:0,millisecond:0},d3=["year","month","day","hour","minute","second","millisecond"],V5=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],z5=["year","ordinal","hour","minute","second","millisecond"];function tD(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new hE(e);return t}function nD(e,t){const n=pl(t.zone,jn.defaultZone),r=un.fromObject(t),o=jn.now();let i,s;if(_t(e.year))i=o;else{for(const h of d3)_t(e[h])&&(e[h]=f3[h]);const c=l3(e)||u3(e);if(c)return at.invalid(c);const d=n.offset(o);[i,s]=Bg(e,d,n)}return new at({ts:i,zone:n,loc:r,o:s})}function rD(e,t,n){const r=_t(n.round)?!0:n.round,o=(s,c)=>(s=W1(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,c)),i=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return o(i(n.unit),n.unit);for(const s of n.units){const c=i(s);if(Math.abs(c)>=1)return o(c,s)}return o(e>t?-0:0,n.units[n.units.length-1])}function oD(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class at{constructor(t){const n=t.zone||jn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new Na("invalid input"):null)||(n.isValid?null:wg(n));this.ts=_t(t.ts)?jn.now():t.ts;let o=null,i=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[o,i]=[t.old.c,t.old.o];else{const c=n.offset(this.ts);o=Jb(this.ts,c),r=Number.isNaN(o.year)?new Na("invalid input"):null,o=r?null:o,i=r?null:c}this._zone=n,this.loc=t.loc||un.create(),this.invalid=r,this.weekData=null,this.c=o,this.o=i,this.isLuxonDateTime=!0}static now(){return new at({})}static local(){const[t,n]=oD(arguments),[r,o,i,s,c,d,h]=n;return nD({year:r,month:o,day:i,hour:s,minute:c,second:d,millisecond:h},t)}static utc(){const[t,n]=oD(arguments),[r,o,i,s,c,d,h]=n;return t.zone=Wr.utcInstance,nD({year:r,month:o,day:i,hour:s,minute:c,second:d,millisecond:h},t)}static fromJSDate(t,n={}){const r=mk(t)?t.valueOf():NaN;if(Number.isNaN(r))return at.invalid("invalid input");const o=pl(n.zone,jn.defaultZone);return o.isValid?new at({ts:r,zone:o,loc:un.fromObject(n)}):at.invalid(wg(o))}static fromMillis(t,n={}){if(Su(t))return t<-Zb||t>Zb?at.invalid("Timestamp out of range"):new at({ts:t,zone:pl(n.zone,jn.defaultZone),loc:un.fromObject(n)});throw new na(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Su(t))return new at({ts:t*1e3,zone:pl(n.zone,jn.defaultZone),loc:un.fromObject(n)});throw new na("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=pl(n.zone,jn.defaultZone);if(!r.isValid)return at.invalid(wg(r));const o=jn.now(),i=_t(n.specificOffset)?r.offset(o):n.specificOffset,s=ev(t,tD),c=!_t(s.ordinal),d=!_t(s.year),h=!_t(s.month)||!_t(s.day),g=d||h,m=s.weekYear||s.weekNumber,w=un.fromObject(n);if((g||c)&&m)throw new Lp("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new Lp("Can't mix ordinal dates with month/day");const b=m||s.weekday&&!g;let T,E,k=Jb(o,i);b?(T=V5,E=H5,k=d1(k)):c?(T=z5,E=U5,k=m0(k)):(T=d3,E=f3);let C=!1;for(const z of T){const q=s[z];_t(q)?C?s[z]=E[z]:s[z]=k[z]:C=!0}const I=b?B5(s):c?Y5(s):l3(s),B=I||u3(s);if(B)return at.invalid(B);const F=b?Kb(s):c?Qb(s):s,[_,R]=Bg(F,i,r),j=new at({ts:_,zone:r,o:R,loc:w});return s.weekday&&g&&t.weekday!==j.weekday?at.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${j.toISO()}`):j}static fromISO(t,n={}){const[r,o]=o5(t);return Cp(r,o,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,o]=a5(t);return Cp(r,o,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,o]=i5(t);return Cp(r,o,n,"HTTP",n)}static fromFormat(t,n,r={}){if(_t(t)||_t(n))throw new na("fromFormat requires an input string and a format");const{locale:o=null,numberingSystem:i=null}=r,s=un.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0}),[c,d,h,g]=j5(s,t,n);return g?at.invalid(g):Cp(c,d,r,`format ${n}`,t,h)}static fromString(t,n,r={}){return at.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,o]=p5(t);return Cp(r,o,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new na("need to specify a reason the DateTime is invalid");const r=t instanceof Na?t:new Na(t,n);if(jn.throwOnInvalid)throw new qM(r);return new at({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=n3(t,un.fromObject(n));return r?r.map(o=>o?o.val:null).join(""):null}static expandFormat(t,n={}){return e3(Rr.parseFormat(t),un.fromObject(n)).map(o=>o.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?v0(this).weekYear:NaN}get weekNumber(){return this.isValid?v0(this).weekNumber:NaN}get weekday(){return this.isValid?v0(this).weekday:NaN}get ordinal(){return this.isValid?m0(this.c).ordinal:NaN}get monthShort(){return this.isValid?yg.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?yg.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?yg.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?yg.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return yh(this.year)}get daysInMonth(){return Jg(this.year,this.month)}get daysInYear(){return this.isValid?Yp(this.year):NaN}get weeksInWeekYear(){return this.isValid?Xg(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:o}=Rr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:o}}toUTC(t=0,n={}){return this.setZone(Wr.instance(t),n)}toLocal(){return this.setZone(jn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=pl(t,jn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let o=this.ts;if(n||r){const i=t.offset(this.ts),s=this.toObject();[o]=Bg(s,i,t)}return Tp(this,{ts:o,zone:t})}else return at.invalid(wg(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const o=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Tp(this,{loc:o})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=ev(t,tD),r=!_t(n.weekYear)||!_t(n.weekNumber)||!_t(n.weekday),o=!_t(n.ordinal),i=!_t(n.year),s=!_t(n.month)||!_t(n.day),c=i||s,d=n.weekYear||n.weekNumber;if((c||o)&&d)throw new Lp("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&o)throw new Lp("Can't mix ordinal dates with month/day");let h;r?h=Kb({...d1(this.c),...n}):_t(n.ordinal)?(h={...this.toObject(),...n},_t(n.day)&&(h.day=Math.min(Jg(h.year,h.month),h.day))):h=Qb({...m0(this.c),...n});const[g,m]=Bg(h,this.o,this.zone);return Tp(this,{ts:g,o:m})}plus(t){if(!this.isValid)return this;const n=Ze.fromDurationLike(t);return Tp(this,Xb(this,n))}minus(t){if(!this.isValid)return this;const n=Ze.fromDurationLike(t).negate();return Tp(this,Xb(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=Ze.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const o=Math.ceil(this.month/3);n.month=(o-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?Rr.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):g0}toLocaleString(t=Zg,n={}){return this.isValid?Rr.create(this.loc.clone(n),t).formatDateTime(this):g0}toLocaleParts(t={}){return this.isValid?Rr.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:o=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const s=t==="extended";let c=y0(this,s);return c+="T",c+=eD(this,s,n,r,o,i),c}toISODate({format:t="extended"}={}){return this.isValid?y0(this,t==="extended"):null}toISOWeekDate(){return bg(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:o=!1,extendedZone:i=!1,format:s="extended"}={}){return this.isValid?(o?"T":"")+eD(this,s==="extended",n,t,r,i):null}toRFC2822(){return bg(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return bg(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?y0(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let o="HH:mm:ss.SSS";return(n||t)&&(r&&(o+=" "),n?o+="z":t&&(o+="ZZ")),bg(this,o,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():g0}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Ze.invalid("created by diffing an invalid DateTime");const o={locale:this.locale,numberingSystem:this.numberingSystem,...r},i=gk(n).map(Ze.normalizeUnit),s=t.valueOf()>this.valueOf(),c=s?this:t,d=s?t:this,h=E5(c,d,i,o);return s?h.negate():h}diffNow(t="milliseconds",n={}){return this.diff(at.now(),t,n)}until(t){return this.isValid?Tn.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),o=this.setZone(t.zone,{keepLocalTime:!0});return o.startOf(n)<=r&&r<=o.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||at.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let o=["years","months","days","hours","minutes","seconds"],i=t.unit;return Array.isArray(t.unit)&&(o=t.unit,i=void 0),rD(n,this.plus(r),{...t,numeric:"always",units:o,unit:i})}toRelativeCalendar(t={}){return this.isValid?rD(t.base||at.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(at.isDateTime))throw new na("min requires all arguments be DateTimes");return Ub(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(at.isDateTime))throw new na("max requires all arguments be DateTimes");return Ub(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:o=null,numberingSystem:i=null}=r,s=un.fromOpts({locale:o,numberingSystem:i,defaultToEN:!0});return t3(s,t,n)}static fromStringExplain(t,n,r={}){return at.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return Zg}static get DATE_MED(){return mE}static get DATE_MED_WITH_WEEKDAY(){return KM}static get DATE_FULL(){return gE}static get DATE_HUGE(){return vE}static get TIME_SIMPLE(){return yE}static get TIME_WITH_SECONDS(){return wE}static get TIME_WITH_SHORT_OFFSET(){return bE}static get TIME_WITH_LONG_OFFSET(){return DE}static get TIME_24_SIMPLE(){return SE}static get TIME_24_WITH_SECONDS(){return EE}static get TIME_24_WITH_SHORT_OFFSET(){return TE}static get TIME_24_WITH_LONG_OFFSET(){return CE}static get DATETIME_SHORT(){return xE}static get DATETIME_SHORT_WITH_SECONDS(){return ME}static get DATETIME_MED(){return kE}static get DATETIME_MED_WITH_SECONDS(){return NE}static get DATETIME_MED_WITH_WEEKDAY(){return QM}static get DATETIME_FULL(){return FE}static get DATETIME_FULL_WITH_SECONDS(){return IE}static get DATETIME_HUGE(){return AE}static get DATETIME_HUGE_WITH_SECONDS(){return OE}}function xp(e){if(at.isDateTime(e))return e;if(e&&e.valueOf&&Su(e.valueOf()))return at.fromJSDate(e);if(e&&typeof e=="object")return at.fromObject(e);throw new na(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const X1={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},$5={allowHtml:!0};({...X1,...$5});class ew{constructor(t){this.value=t,this.successful=!0}map(t){return new ew(t(this.value))}flatMap(t){return t(this.value)}mapErr(t){return this}bimap(t,n){return this.map(t)}orElse(t){return this.value}cast(){return this}orElseThrow(t){return this.value}}class tw{constructor(t){this.error=t,this.successful=!1}map(t){return this}flatMap(t){return this}mapErr(t){return new tw(t(this.error))}bimap(t,n){return this.mapErr(n)}orElse(t){return t}cast(){return this}orElseThrow(t){throw t?new Error(t(this.error)):new Error(""+this.error)}}var tv;(function(e){function t(i){return new ew(i)}e.success=t;function n(i){return new tw(i)}e.failure=n;function r(i,s,c){return i.successful?s.successful?c(i.value,s.value):n(s.error):n(i.error)}e.flatMap2=r;function o(i,s,c){return r(i,s,(d,h)=>t(c(d,h)))}e.map2=o})(tv||(tv={}));var q5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Vn<"u"?Vn:typeof self<"u"?self:{},Z={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:q5,function(){return function(n){var r={};function o(i){if(r[i])return r[i].exports;var s=r[i]={i,l:!1,exports:{}};return n[i].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=n,o.c=r,o.d=function(i,s,c){o.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:c})},o.r=function(i){Object.defineProperty(i,"__esModule",{value:!0})},o.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(s,"a",s),s},o.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},o.p="",o(o.s=0)}([function(n,r,o){function i(U){if(!(this instanceof i))return new i(U);this._=U}var s=i.prototype;function c(U,te){for(var he=0;he<U;he++)te(he)}function d(U,te,he){return function(Ce,Le){c(Le.length,function(je){Ce(Le[je],je,Le)})}(function(Ce,Le,je){te=U(te,Ce,Le,je)},he),te}function h(U,te){return d(function(he,Ce,Le,je){return he.concat([U(Ce,Le,je)])},[],te)}function g(U,te){var he={v:0,buf:te};return c(U,function(){var Ce;he={v:he.v<<1|(Ce=he.buf,Ce[0]>>7),buf:function(Le){var je=d(function(He,mt,Yt,xn){return He.concat(Yt===xn.length-1?Buffer.from([mt,0]).readUInt16BE(0):xn.readUInt16BE(Yt))},[],Le);return Buffer.from(h(function(He){return(He<<1&65535)>>8},je))}(he.buf)}}),he}function m(){return typeof Buffer<"u"}function w(){if(!m())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function b(U){w();var te=d(function(je,He){return je+He},0,U);if(te%8!=0)throw new Error("The bits ["+U.join(", ")+"] add up to "+te+" which is not an even number of bytes; the total should be divisible by 8");var he,Ce=te/8,Le=(he=function(je){return je>48},d(function(je,He){return je||(he(He)?He:je)},null,U));if(Le)throw new Error(Le+" bit range requested exceeds 48 bit (6 byte) Number max.");return new i(function(je,He){var mt=Ce+He;return mt>je.length?z(He,Ce.toString()+" bytes"):j(mt,d(function(Yt,xn){var mn=g(xn,Yt.buf);return{coll:Yt.coll.concat(mn.v),buf:mn.buf}},{coll:[],buf:je.slice(He,mt)},U).coll)})}function T(U,te){return new i(function(he,Ce){return w(),Ce+te>he.length?z(Ce,te+" bytes for "+U):j(Ce+te,he.slice(Ce,Ce+te))})}function E(U,te){if(typeof(he=te)!="number"||Math.floor(he)!==he||te<0||te>6)throw new Error(U+" requires integer length in range [0, 6].");var he}function k(U){return E("uintBE",U),T("uintBE("+U+")",U).map(function(te){return te.readUIntBE(0,U)})}function C(U){return E("uintLE",U),T("uintLE("+U+")",U).map(function(te){return te.readUIntLE(0,U)})}function I(U){return E("intBE",U),T("intBE("+U+")",U).map(function(te){return te.readIntBE(0,U)})}function B(U){return E("intLE",U),T("intLE("+U+")",U).map(function(te){return te.readIntLE(0,U)})}function F(U){return U instanceof i}function _(U){return{}.toString.call(U)==="[object Array]"}function R(U){return m()&&Buffer.isBuffer(U)}function j(U,te){return{status:!0,index:U,value:te,furthest:-1,expected:[]}}function z(U,te){return _(te)||(te=[te]),{status:!1,index:-1,value:null,furthest:U,expected:te}}function q(U,te){if(!te||U.furthest>te.furthest)return U;var he=U.furthest===te.furthest?function(Ce,Le){if(function(){if(i._supportsSet!==void 0)return i._supportsSet;var ur=typeof Set<"u";return i._supportsSet=ur,ur}()&&Array.from){for(var je=new Set(Ce),He=0;He<Le.length;He++)je.add(Le[He]);var mt=Array.from(je);return mt.sort(),mt}for(var Yt={},xn=0;xn<Ce.length;xn++)Yt[Ce[xn]]=!0;for(var mn=0;mn<Le.length;mn++)Yt[Le[mn]]=!0;var Zr=[];for(var Mn in Yt)({}).hasOwnProperty.call(Yt,Mn)&&Zr.push(Mn);return Zr.sort(),Zr}(U.expected,te.expected):te.expected;return{status:U.status,index:U.index,value:U.value,furthest:te.furthest,expected:he}}var $={};function J(U,te){if(R(U))return{offset:te,line:-1,column:-1};U in $||($[U]={});for(var he=$[U],Ce=0,Le=0,je=0,He=te;He>=0;){if(He in he){Ce=he[He].line,je===0&&(je=he[He].lineStart);break}(U.charAt(He)===`
`||U.charAt(He)==="\r"&&U.charAt(He+1)!==`
`)&&(Le++,je===0&&(je=He+1)),He--}var mt=Ce+Le,Yt=te-je;return he[te]={line:mt,lineStart:je},{offset:te,line:mt+1,column:Yt+1}}function ae(U){if(!F(U))throw new Error("not a parser: "+U)}function ie(U,te){return typeof U=="string"?U.charAt(te):U[te]}function ge(U){if(typeof U!="number")throw new Error("not a number: "+U)}function pe(U){if(typeof U!="function")throw new Error("not a function: "+U)}function fe(U){if(typeof U!="string")throw new Error("not a string: "+U)}var De=2,re=3,be=8,V=5*be,G=4*be,le=" ";function we(U,te){return new Array(te+1).join(U)}function ue(U,te,he){var Ce=te-U.length;return Ce<=0?U:we(he,Ce)+U}function Se(U,te,he,Ce){return{from:U-te>0?U-te:0,to:U+he>Ce?Ce:U+he}}function Re(U,te){var he,Ce,Le,je,He,mt=te.index,Yt=mt.offset,xn=1;if(Yt===U.length)return"Got the end of the input";if(R(U)){var mn=Yt-Yt%be,Zr=Yt-mn,Mn=Se(mn,V,G+be,U.length),ur=h(function(Gt){return h(function(wo){return ue(wo.toString(16),2,"0")},Gt)},function(Gt,wo){var bo=Gt.length,Do=[],ja=0;if(bo<=wo)return[Gt.slice()];for(var Ba=0;Ba<bo;Ba++)Do[ja]||Do.push([]),Do[ja].push(Gt[Ba]),(Ba+1)%wo==0&&ja++;return Do}(U.slice(Mn.from,Mn.to).toJSON().data,be));je=function(Gt){return Gt.from===0&&Gt.to===1?{from:Gt.from,to:Gt.to}:{from:Gt.from/be,to:Math.floor(Gt.to/be)}}(Mn),Ce=mn/be,he=3*Zr,Zr>=4&&(he+=1),xn=2,Le=h(function(Gt){return Gt.length<=4?Gt.join(" "):Gt.slice(0,4).join(" ")+" "+Gt.slice(4).join(" ")},ur),(He=(8*(je.to>0?je.to-1:je.to)).toString(16).length)<2&&(He=2)}else{var Jr=U.split(/\r\n|[\n\r\u2028\u2029]/);he=mt.column-1,Ce=mt.line-1,je=Se(Ce,De,re,Jr.length),Le=Jr.slice(je.from,je.to),He=je.to.toString().length}var Cl=Ce-je.from;return R(U)&&(He=(8*(je.to>0?je.to-1:je.to)).toString(16).length)<2&&(He=2),d(function(Gt,wo,bo){var Do,ja=bo===Cl,Ba=ja?"> ":le;return Do=R(U)?ue((8*(je.from+bo)).toString(16),He,"0"):ue((je.from+bo+1).toString(),He," "),[].concat(Gt,[Ba+Do+" | "+wo],ja?[le+we(" ",He)+" | "+ue("",he," ")+we("^",xn)]:[])},[],Le).join(`
`)}function Ye(U,te){return[`
`,"-- PARSING FAILED "+we("-",50),`
`,Re(U,te),`
`,(he=te.expected,he.length===1?`Expected:
`+he[0]:`Expected one of the following:
`+he.join(", ")),`
`].join("");var he}function Be(U){return U.flags!==void 0?U.flags:[U.global?"g":"",U.ignoreCase?"i":"",U.multiline?"m":"",U.unicode?"u":"",U.sticky?"y":""].join("")}function yt(){for(var U=[].slice.call(arguments),te=U.length,he=0;he<te;he+=1)ae(U[he]);return i(function(Ce,Le){for(var je,He=new Array(te),mt=0;mt<te;mt+=1){if(!(je=q(U[mt]._(Ce,Le),je)).status)return je;He[mt]=je.value,Le=je.index}return q(j(Le,He),je)})}function Ee(){var U=[].slice.call(arguments);if(U.length===0)throw new Error("seqMap needs at least one argument");var te=U.pop();return pe(te),yt.apply(null,U).map(function(he){return te.apply(null,he)})}function Ve(){var U=[].slice.call(arguments),te=U.length;if(te===0)return dt("zero alternates");for(var he=0;he<te;he+=1)ae(U[he]);return i(function(Ce,Le){for(var je,He=0;He<U.length;He+=1)if((je=q(U[He]._(Ce,Le),je)).status)return je;return je})}function Ke(U,te){return Xe(U,te).or(Dt([]))}function Xe(U,te){return ae(U),ae(te),Ee(U,te.then(U).many(),function(he,Ce){return[he].concat(Ce)})}function Ge(U){fe(U);var te="'"+U+"'";return i(function(he,Ce){var Le=Ce+U.length,je=he.slice(Ce,Le);return je===U?j(Le,je):z(Ce,te)})}function tt(U,te){(function(Le){if(!(Le instanceof RegExp))throw new Error("not a regexp: "+Le);for(var je=Be(Le),He=0;He<je.length;He++){var mt=je.charAt(He);if(mt!=="i"&&mt!=="m"&&mt!=="u"&&mt!=="s")throw new Error('unsupported regexp flag "'+mt+'": '+Le)}})(U),arguments.length>=2?ge(te):te=0;var he=function(Le){return RegExp("^(?:"+Le.source+")",Be(Le))}(U),Ce=""+U;return i(function(Le,je){var He=he.exec(Le.slice(je));if(He){if(0<=te&&te<=He.length){var mt=He[0],Yt=He[te];return j(je+mt.length,Yt)}return z(je,"valid match group (0 to "+He.length+") in "+Ce)}return z(je,Ce)})}function Dt(U){return i(function(te,he){return j(he,U)})}function dt(U){return i(function(te,he){return z(he,U)})}function Vt(U){if(F(U))return i(function(te,he){var Ce=U._(te,he);return Ce.index=he,Ce.value="",Ce});if(typeof U=="string")return Vt(Ge(U));if(U instanceof RegExp)return Vt(tt(U));throw new Error("not a string, regexp, or parser: "+U)}function Yo(U){return ae(U),i(function(te,he){var Ce=U._(te,he),Le=te.slice(he,Ce.index);return Ce.status?z(he,'not "'+Le+'"'):j(he,null)})}function cn(U){return pe(U),i(function(te,he){var Ce=ie(te,he);return he<te.length&&U(Ce)?j(he+1,Ce):z(he,"a character/byte matching "+U)})}function en(U,te){arguments.length<2&&(te=U,U=void 0);var he=i(function(Ce,Le){return he._=te()._,he._(Ce,Le)});return U?he.desc(U):he}function br(){return dt("fantasy-land/empty")}s.parse=function(U){if(typeof U!="string"&&!R(U))throw new Error(".parse must be called with a string or Buffer as its argument");var te,he=this.skip(la)._(U,0);return te=he.status?{status:!0,value:he.value}:{status:!1,index:J(U,he.furthest),expected:he.expected},delete $[U],te},s.tryParse=function(U){var te=this.parse(U);if(te.status)return te.value;var he=Ye(U,te),Ce=new Error(he);throw Ce.type="ParsimmonError",Ce.result=te,Ce},s.assert=function(U,te){return this.chain(function(he){return U(he)?Dt(he):dt(te)})},s.or=function(U){return Ve(this,U)},s.trim=function(U){return this.wrap(U,U)},s.wrap=function(U,te){return Ee(U,this,te,function(he,Ce){return Ce})},s.thru=function(U){return U(this)},s.then=function(U){return ae(U),yt(this,U).map(function(te){return te[1]})},s.many=function(){var U=this;return i(function(te,he){for(var Ce=[],Le=void 0;;){if(!(Le=q(U._(te,he),Le)).status)return q(j(he,Ce),Le);if(he===Le.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");he=Le.index,Ce.push(Le.value)}})},s.tieWith=function(U){return fe(U),this.map(function(te){if(function(Le){if(!_(Le))throw new Error("not an array: "+Le)}(te),te.length){fe(te[0]);for(var he=te[0],Ce=1;Ce<te.length;Ce++)fe(te[Ce]),he+=U+te[Ce];return he}return""})},s.tie=function(){return this.tieWith("")},s.times=function(U,te){var he=this;return arguments.length<2&&(te=U),ge(U),ge(te),i(function(Ce,Le){for(var je=[],He=void 0,mt=void 0,Yt=0;Yt<U;Yt+=1){if(mt=q(He=he._(Ce,Le),mt),!He.status)return mt;Le=He.index,je.push(He.value)}for(;Yt<te&&(mt=q(He=he._(Ce,Le),mt),He.status);Yt+=1)Le=He.index,je.push(He.value);return q(j(Le,je),mt)})},s.result=function(U){return this.map(function(){return U})},s.atMost=function(U){return this.times(0,U)},s.atLeast=function(U){return Ee(this.times(U),this.many(),function(te,he){return te.concat(he)})},s.map=function(U){pe(U);var te=this;return i(function(he,Ce){var Le=te._(he,Ce);return Le.status?q(j(Le.index,U(Le.value)),Le):Le})},s.contramap=function(U){pe(U);var te=this;return i(function(he,Ce){var Le=te.parse(U(he.slice(Ce)));return Le.status?j(Ce+he.length,Le.value):Le})},s.promap=function(U,te){return pe(U),pe(te),this.contramap(U).map(te)},s.skip=function(U){return yt(this,U).map(function(te){return te[0]})},s.mark=function(){return Ee(Dr,this,Dr,function(U,te,he){return{start:U,value:te,end:he}})},s.node=function(U){return Ee(Dr,this,Dr,function(te,he,Ce){return{name:U,value:he,start:te,end:Ce}})},s.sepBy=function(U){return Ke(this,U)},s.sepBy1=function(U){return Xe(this,U)},s.lookahead=function(U){return this.skip(Vt(U))},s.notFollowedBy=function(U){return this.skip(Yo(U))},s.desc=function(U){_(U)||(U=[U]);var te=this;return i(function(he,Ce){var Le=te._(he,Ce);return Le.status||(Le.expected=U),Le})},s.fallback=function(U){return this.or(Dt(U))},s.ap=function(U){return Ee(U,this,function(te,he){return te(he)})},s.chain=function(U){var te=this;return i(function(he,Ce){var Le=te._(he,Ce);return Le.status?q(U(Le.value)._(he,Le.index),Le):Le})},s.concat=s.or,s.empty=br,s.of=Dt,s["fantasy-land/ap"]=s.ap,s["fantasy-land/chain"]=s.chain,s["fantasy-land/concat"]=s.concat,s["fantasy-land/empty"]=s.empty,s["fantasy-land/of"]=s.of,s["fantasy-land/map"]=s.map;var Dr=i(function(U,te){return j(te,J(U,te))}),_a=i(function(U,te){return te>=U.length?z(te,"any character/byte"):j(te+1,ie(U,te))}),yo=i(function(U,te){return j(U.length,U.slice(te))}),la=i(function(U,te){return te<U.length?z(te,"EOF"):j(te,null)}),Qr=tt(/[0-9]/).desc("a digit"),Sr=tt(/[0-9]*/).desc("optional digits"),gs=tt(/[a-z]/i).desc("a letter"),ua=tt(/[a-z]*/i).desc("optional letters"),ca=tt(/\s*/).desc("optional whitespace"),Tl=tt(/\s+/).desc("whitespace"),Mi=Ge("\r"),ki=Ge(`
`),vs=Ge(`\r
`),Pa=Ve(vs,ki,Mi).desc("newline"),Ni=Ve(Pa,la);i.all=yo,i.alt=Ve,i.any=_a,i.cr=Mi,i.createLanguage=function(U){var te={};for(var he in U)({}).hasOwnProperty.call(U,he)&&function(Ce){te[Ce]=en(function(){return U[Ce](te)})}(he);return te},i.crlf=vs,i.custom=function(U){return i(U(j,z))},i.digit=Qr,i.digits=Sr,i.empty=br,i.end=Ni,i.eof=la,i.fail=dt,i.formatError=Ye,i.index=Dr,i.isParser=F,i.lazy=en,i.letter=gs,i.letters=ua,i.lf=ki,i.lookahead=Vt,i.makeFailure=z,i.makeSuccess=j,i.newline=Pa,i.noneOf=function(U){return cn(function(te){return U.indexOf(te)<0}).desc("none of '"+U+"'")},i.notFollowedBy=Yo,i.of=Dt,i.oneOf=function(U){for(var te=U.split(""),he=0;he<te.length;he++)te[he]="'"+te[he]+"'";return cn(function(Ce){return U.indexOf(Ce)>=0}).desc(te)},i.optWhitespace=ca,i.Parser=i,i.range=function(U,te){return cn(function(he){return U<=he&&he<=te}).desc(U+"-"+te)},i.regex=tt,i.regexp=tt,i.sepBy=Ke,i.sepBy1=Xe,i.seq=yt,i.seqMap=Ee,i.seqObj=function(){for(var U,te={},he=0,Ce=(U=arguments,Array.prototype.slice.call(U)),Le=Ce.length,je=0;je<Le;je+=1){var He=Ce[je];if(!F(He)){if(_(He)&&He.length===2&&typeof He[0]=="string"&&F(He[1])){var mt=He[0];if(Object.prototype.hasOwnProperty.call(te,mt))throw new Error("seqObj: duplicate key "+mt);te[mt]=!0,he++;continue}throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.")}}if(he===0)throw new Error("seqObj expects at least one named parser, found zero");return i(function(Yt,xn){for(var mn,Zr={},Mn=0;Mn<Le;Mn+=1){var ur,Jr;if(_(Ce[Mn])?(ur=Ce[Mn][0],Jr=Ce[Mn][1]):(ur=null,Jr=Ce[Mn]),!(mn=q(Jr._(Yt,xn),mn)).status)return mn;ur&&(Zr[ur]=mn.value),xn=mn.index}return q(j(xn,Zr),mn)})},i.string=Ge,i.succeed=Dt,i.takeWhile=function(U){return pe(U),i(function(te,he){for(var Ce=he;Ce<te.length&&U(ie(te,Ce));)Ce++;return j(Ce,te.slice(he,Ce))})},i.test=cn,i.whitespace=Tl,i["fantasy-land/empty"]=br,i["fantasy-land/of"]=Dt,i.Binary={bitSeq:b,bitSeqObj:function(U){w();var te={},he=0,Ce=h(function(je){if(_(je)){var He=je;if(He.length!==2)throw new Error("["+He.join(", ")+"] should be length 2, got length "+He.length);if(fe(He[0]),ge(He[1]),Object.prototype.hasOwnProperty.call(te,He[0]))throw new Error("duplicate key in bitSeqObj: "+He[0]);return te[He[0]]=!0,he++,He}return ge(je),[null,je]},U);if(he<1)throw new Error("bitSeqObj expects at least one named pair, got ["+U.join(", ")+"]");var Le=h(function(je){return je[0]},Ce);return b(h(function(je){return je[1]},Ce)).map(function(je){return d(function(He,mt){return mt[0]!==null&&(He[mt[0]]=mt[1]),He},{},h(function(He,mt){return[He,je[mt]]},Le))})},byte:function(U){if(w(),ge(U),U>255)throw new Error("Value specified to byte constructor ("+U+"=0x"+U.toString(16)+") is larger in value than a single byte.");var te=(U>15?"0x":"0x0")+U.toString(16);return i(function(he,Ce){var Le=ie(he,Ce);return Le===U?j(Ce+1,Le):z(Ce,te)})},buffer:function(U){return T("buffer",U).map(function(te){return Buffer.from(te)})},encodedString:function(U,te){return T("string",te).map(function(he){return he.toString(U)})},uintBE:k,uint8BE:k(1),uint16BE:k(2),uint32BE:k(4),uintLE:C,uint8LE:C(1),uint16LE:C(2),uint32LE:C(4),intBE:I,int8BE:I(1),int16BE:I(2),int32BE:I(4),intLE:B,int8LE:B(1),int16LE:B(2),int32LE:B(4),floatBE:T("floatBE",4).map(function(U){return U.readFloatBE(0)}),floatLE:T("floatLE",4).map(function(U){return U.readFloatLE(0)}),doubleBE:T("doubleBE",8).map(function(U){return U.readDoubleBE(0)}),doubleLE:T("doubleLE",8).map(function(U){return U.readDoubleLE(0)})},n.exports=i}])})})(Z);var nw=()=>/(?:[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDD-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF6](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC2\uDED0-\uDED9\uDEE0-\uDEE7]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?))/g;function p3(e){return e==null?e:e.shiftToAll().normalize()}function aD(e){return e.includes("/")&&(e=e.substring(e.lastIndexOf("/")+1)),e.endsWith(".md")&&(e=e.substring(0,e.length-3)),e}Z.exports.alt(Z.exports.regex(new RegExp(nw(),"")),Z.exports.regex(/[0-9\p{Letter}_-]+/u).map(e=>e.toLocaleLowerCase()),Z.exports.whitespace.map(e=>"-"),Z.exports.any.map(e=>"")).many().map(e=>e.join(""));const W5=Z.exports.alt(Z.exports.regex(new RegExp(nw(),"")),Z.exports.regex(/[0-9\p{Letter}_-]+/u),Z.exports.whitespace.map(e=>" "),Z.exports.any.map(e=>" ")).many().map(e=>e.join("").split(/\s+/).join(" ").trim());function G5(e){return W5.tryParse(e)}function K5(e){return e=p3(e),e=Ze.fromObject(Object.fromEntries(Object.entries(e.toObject()).filter(([,t])=>t>0))),e.toHuman()}var Gp;(function(e){function t(F,_=X1,R=!1){let j=n(F);if(!j)return _.renderNullAs;switch(j.type){case"null":return _.renderNullAs;case"string":return j.value;case"number":case"boolean":return""+j.value;case"html":return j.value.outerHTML;case"widget":return j.value.markdown();case"link":return j.value.markdown();case"function":return"<function>";case"array":let z="";return R&&(z+="["),z+=j.value.map(q=>t(q,_,!0)).join(", "),R&&(z+="]"),z;case"object":return"{ "+Object.entries(j.value).map(q=>q[0]+": "+t(q[1],_,!0)).join(", ")+" }";case"date":return j.value.second==0&&j.value.hour==0&&j.value.minute==0?j.value.toFormat(_.defaultDateFormat):j.value.toFormat(_.defaultDateTimeFormat);case"duration":return K5(j.value)}}e.toString=t;function n(F){return w(F)?{type:"null",value:F}:h(F)?{type:"number",value:F}:d(F)?{type:"string",value:F}:T(F)?{type:"boolean",value:F}:m(F)?{type:"duration",value:F}:g(F)?{type:"date",value:F}:k(F)?{type:"widget",value:F}:b(F)?{type:"array",value:F}:E(F)?{type:"link",value:F}:B(F)?{type:"function",value:F}:C(F)?{type:"html",value:F}:I(F)?{type:"object",value:F}:void 0}e.wrapValue=n;function r(F,_){if(I(F)){let R={};for(let[j,z]of Object.entries(F))R[j]=r(z,_);return R}else if(b(F)){let R=[];for(let j of F)R.push(r(j,_));return R}else return _(F)}e.mapLeaves=r;function o(F,_,R){var j,z;if(F===void 0&&(F=null),_===void 0&&(_=null),F===null&&_===null)return 0;if(F===null)return-1;if(_===null)return 1;let q=n(F),$=n(_);if(q===void 0&&$===void 0)return 0;if(q===void 0)return-1;if($===void 0)return 1;if(q.type!=$.type)return q.type.localeCompare($.type);if(q.value===$.value)return 0;switch(q.type){case"string":return q.value.localeCompare($.value);case"number":return q.value<$.value?-1:q.value==$.value?0:1;case"null":return 0;case"boolean":return q.value==$.value?0:q.value?1:-1;case"link":let J=q.value,ae=$.value,ie=R??(we=>we),ge=ie(J.path).localeCompare(ie(ae.path));if(ge!=0)return ge;let pe=J.type.localeCompare(ae.type);return pe!=0?pe:J.subpath&&!ae.subpath?1:!J.subpath&&ae.subpath?-1:!J.subpath&&!ae.subpath?0:((j=J.subpath)!==null&&j!==void 0?j:"").localeCompare((z=ae.subpath)!==null&&z!==void 0?z:"");case"date":return q.value<$.value?-1:q.value.equals($.value)?0:1;case"duration":return q.value<$.value?-1:q.value.equals($.value)?0:1;case"array":let fe=q.value,De=$.value;for(let we=0;we<Math.min(fe.length,De.length);we++){let ue=o(fe[we],De[we]);if(ue!=0)return ue}return fe.length-De.length;case"object":let re=q.value,be=$.value,V=Array.from(Object.keys(re)),G=Array.from(Object.keys(be));V.sort(),G.sort();let le=o(V,G);if(le!=0)return le;for(let we of V){let ue=o(re[we],be[we]);if(ue!=0)return ue}return 0;case"widget":case"html":case"function":return 0}}e.compareValue=o;function i(F){var _;return(_=n(F))===null||_===void 0?void 0:_.type}e.typeOf=i;function s(F){let _=n(F);if(!_)return!1;switch(_.type){case"number":return _.value!=0;case"string":return _.value.length>0;case"boolean":return _.value;case"link":return!!_.value.path;case"date":return _.value.toMillis()!=0;case"duration":return _.value.as("seconds")!=0;case"object":return Object.keys(_.value).length>0;case"array":return _.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}e.isTruthy=s;function c(F){if(F==null)return F;if(e.isArray(F))return[].concat(F.map(_=>c(_)));if(e.isObject(F)){let _={};for(let[R,j]of Object.entries(F))_[R]=c(j);return _}else return F}e.deepCopy=c;function d(F){return typeof F=="string"}e.isString=d;function h(F){return typeof F=="number"}e.isNumber=h;function g(F){return F instanceof at}e.isDate=g;function m(F){return F instanceof Ze}e.isDuration=m;function w(F){return F==null}e.isNull=w;function b(F){return Array.isArray(F)}e.isArray=b;function T(F){return typeof F=="boolean"}e.isBoolean=T;function E(F){return F instanceof Ir}e.isLink=E;function k(F){return F instanceof rw}e.isWidget=k;function C(F){return typeof HTMLElement<"u"?F instanceof HTMLElement:!1}e.isHtml=C;function I(F){return typeof F=="object"&&!C(F)&&!k(F)&&!b(F)&&!m(F)&&!g(F)&&!E(F)&&F!==void 0&&!w(F)}e.isObject=I;function B(F){return typeof F=="function"}e.isFunction=B})(Gp||(Gp={}));var iD;(function(e){function t(o){return Gp.isObject(o)&&Object.keys(o).length==2&&"key"in o&&"rows"in o}e.isElementGroup=t;function n(o){for(let i of o)if(!t(i))return!1;return!0}e.isGrouping=n;function r(o){if(n(o)){let i=0;for(let s of o)i+=r(s.rows);return i}else return o.length}e.count=r})(iD||(iD={}));class Ir{constructor(t){Object.assign(this,t)}static file(t,n=!1,r){return new Ir({path:t,embed:n,display:r,subpath:void 0,type:"file"})}static infer(t,n=!1,r){if(t.includes("#^")){let o=t.split("#^");return Ir.block(o[0],o[1],n,r)}else if(t.includes("#")){let o=t.split("#");return Ir.header(o[0],o[1],n,r)}else return Ir.file(t,n,r)}static header(t,n,r,o){return new Ir({path:t,embed:r,display:o,subpath:G5(n),type:"header"})}static block(t,n,r,o){return new Ir({path:t,embed:r,display:o,subpath:n,type:"block"})}static fromObject(t){return new Ir(t)}equals(t){return t==null||t==null?!1:this.path==t.path&&this.type==t.type&&this.subpath==t.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(t){return new Ir(Object.assign({},this,{path:t}))}withDisplay(t){return new Ir(Object.assign({},this,{display:t}))}withHeader(t){return Ir.header(this.path,t,this.embed,this.display)}toFile(){return Ir.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let t=new Ir(this);return t.embed=!0,t}}fromEmbed(){if(this.embed){let t=new Ir(this);return t.embed=!1,t}else return this}markdown(){let t=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?t+="|"+this.display:(t+="|"+aD(this.path),(this.type=="header"||this.type=="block")&&(t+=" > "+this.subpath)),t+="]]",t}obsidianLink(){var t,n;const r=this.path.replace("|","\\|");return this.type=="header"?r+"#"+((t=this.subpath)===null||t===void 0?void 0:t.replace("|","\\|")):this.type=="block"?r+"#^"+((n=this.subpath)===null||n===void 0?void 0:n.replace("|","\\|")):r}fileName(){return aD(this.path).replace(".md","")}}class rw{constructor(t){this.$widget=t}}class Q5 extends rw{constructor(t,n){super("dataview:list-pair"),this.key=t,this.value=n}markdown(){return`${Gp.toString(this.key)}: ${Gp.toString(this.value)}`}}class Z5 extends rw{constructor(t,n){super("dataview:external-link"),this.url=t,this.display=n}markdown(){var t;return`[${(t=this.display)!==null&&t!==void 0?t:this.url}](${this.url})`}}var sD;(function(e){function t(s,c){return new Q5(s,c)}e.listPair=t;function n(s,c){return new Z5(s,c)}e.externalLink=n;function r(s){return s.$widget==="dataview:list-pair"}e.isListPair=r;function o(s){return s.$widget==="dataview:external-link"}e.isExternalLink=o;function i(s){return r(s)||o(s)}e.isBuiltin=i})(sD||(sD={}));var En;(function(e){function t(w){return{type:"variable",name:w}}e.variable=t;function n(w){return{type:"literal",value:w}}e.literal=n;function r(w,b,T){return{type:"binaryop",left:w,op:b,right:T}}e.binaryOp=r;function o(w,b){return{type:"index",object:w,index:b}}e.index=o;function i(w){let b=w.split("."),T=e.variable(b[0]);for(let E=1;E<b.length;E++)T=e.index(T,e.literal(b[E]));return T}e.indexVariable=i;function s(w,b){return{type:"lambda",arguments:w,value:b}}e.lambda=s;function c(w,b){return{type:"function",func:w,arguments:b}}e.func=c;function d(w){return{type:"list",values:w}}e.list=d;function h(w){return{type:"object",values:w}}e.object=h;function g(w){return{type:"negated",child:w}}e.negate=g;function m(w){return w=="<="||w=="<"||w==">"||w==">="||w=="!="||w=="="}e.isCompareOp=m,e.NULL=e.literal(null)})(En||(En={}));var yi;(function(e){function t(g){return{type:"tag",tag:g}}e.tag=t;function n(g){return{type:"csv",path:g}}e.csv=n;function r(g){return{type:"folder",folder:g}}e.folder=r;function o(g,m){return{type:"link",file:g,direction:m?"incoming":"outgoing"}}e.link=o;function i(g,m,w){return{type:"binaryop",left:g,op:m,right:w}}e.binaryOp=i;function s(g,m){return{type:"binaryop",left:g,op:"&",right:m}}e.and=s;function c(g,m){return{type:"binaryop",left:g,op:"|",right:m}}e.or=c;function d(g){return{type:"negate",child:g}}e.negate=d;function h(){return{type:"empty"}}e.empty=h})(yi||(yi={}));const lD=new RegExp(nw(),""),p1={year:Ze.fromObject({years:1}),years:Ze.fromObject({years:1}),yr:Ze.fromObject({years:1}),yrs:Ze.fromObject({years:1}),month:Ze.fromObject({months:1}),months:Ze.fromObject({months:1}),mo:Ze.fromObject({months:1}),mos:Ze.fromObject({months:1}),week:Ze.fromObject({weeks:1}),weeks:Ze.fromObject({weeks:1}),wk:Ze.fromObject({weeks:1}),wks:Ze.fromObject({weeks:1}),w:Ze.fromObject({weeks:1}),day:Ze.fromObject({days:1}),days:Ze.fromObject({days:1}),d:Ze.fromObject({days:1}),hour:Ze.fromObject({hours:1}),hours:Ze.fromObject({hours:1}),hr:Ze.fromObject({hours:1}),hrs:Ze.fromObject({hours:1}),h:Ze.fromObject({hours:1}),minute:Ze.fromObject({minutes:1}),minutes:Ze.fromObject({minutes:1}),min:Ze.fromObject({minutes:1}),mins:Ze.fromObject({minutes:1}),m:Ze.fromObject({minutes:1}),second:Ze.fromObject({seconds:1}),seconds:Ze.fromObject({seconds:1}),sec:Ze.fromObject({seconds:1}),secs:Ze.fromObject({seconds:1}),s:Ze.fromObject({seconds:1})},h1={now:()=>at.local(),today:()=>at.local().startOf("day"),yesterday:()=>at.local().startOf("day").minus(Ze.fromObject({days:1})),tomorrow:()=>at.local().startOf("day").plus(Ze.fromObject({days:1})),sow:()=>at.local().startOf("week"),"start-of-week":()=>at.local().startOf("week"),eow:()=>at.local().endOf("week"),"end-of-week":()=>at.local().endOf("week"),soy:()=>at.local().startOf("year"),"start-of-year":()=>at.local().startOf("year"),eoy:()=>at.local().endOf("year"),"end-of-year":()=>at.local().endOf("year"),som:()=>at.local().startOf("month"),"start-of-month":()=>at.local().startOf("month"),eom:()=>at.local().endOf("month"),"end-of-month":()=>at.local().endOf("month")},m1=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function J5(e){let t=-1;for(;(t=e.indexOf("|",t+1))>=0;)if(!(t>0&&e[t-1]=="\\"))return[e.substring(0,t).replace(/\\\|/g,"|"),e.substring(t+1)];return[e.replace(/\\\|/g,"|"),void 0]}function X5(e){let[t,n]=J5(e);return Ir.infer(t,!1,n)}function Mp(e,t,n){return Z.exports.seqMap(e,Z.exports.seq(Z.exports.optWhitespace,t,Z.exports.optWhitespace,e).many(),(r,o)=>{if(o.length==0)return r;let i=n(r,o[0][1],o[0][3]);for(let s=1;s<o.length;s++)i=n(i,o[s][1],o[s][3]);return i})}function e7(e,...t){return Z.exports.custom((n,r)=>(o,i)=>{let s=e._(o,i);if(!s.status)return s;for(let c of t){let d=c(s.value)._(o,s.index);if(!d.status)return s;s=d}return s})}const ka=Z.exports.createLanguage({number:e=>Z.exports.regexp(/-?[0-9]+(\.[0-9]+)?/).map(t=>Number.parseFloat(t)).desc("number"),string:e=>Z.exports.string('"').then(Z.exports.alt(e.escapeCharacter,Z.exports.noneOf('"\\')).atLeast(0).map(t=>t.join(""))).skip(Z.exports.string('"')).desc("string"),escapeCharacter:e=>Z.exports.string("\\").then(Z.exports.any).map(t=>t==='"'?'"':t==="\\"?"\\":"\\"+t),bool:e=>Z.exports.regexp(/true|false|True|False/).map(t=>t.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:e=>Z.exports.seqMap(Z.exports.string("#"),Z.exports.alt(Z.exports.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(t,n)=>t+n.join("")).desc("tag ('#hello/stuff')"),identifier:e=>Z.exports.seqMap(Z.exports.alt(Z.exports.regexp(new RegExp("\\p{Letter}","u")),Z.exports.regexp(lD).desc("text")),Z.exports.alt(Z.exports.regexp(/[0-9\p{Letter}_-]/u),Z.exports.regexp(lD).desc("text")).many(),(t,n)=>t+n.join("")).desc("variable identifier"),link:e=>Z.exports.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(t=>X5(t)).desc("file link"),embedLink:e=>Z.exports.seqMap(Z.exports.string("!").atMost(1),e.link,(t,n)=>(t.length>0&&(n.embed=!0),n)).desc("file link"),binaryPlusMinus:e=>Z.exports.regexp(/\+|-/).map(t=>t).desc("'+' or '-'"),binaryMulDiv:e=>Z.exports.regexp(/\*|\/|%/).map(t=>t).desc("'*' or '/' or '%'"),binaryCompareOp:e=>Z.exports.regexp(/>=|<=|!=|>|<|=/).map(t=>t).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:e=>Z.exports.regexp(/and|or|&|\|/i).map(t=>t.toLowerCase()=="and"?"&":t.toLowerCase()=="or"?"|":t).desc("'and' or 'or'"),rootDate:e=>Z.exports.seqMap(Z.exports.regexp(/\d{4}/),Z.exports.string("-"),Z.exports.regexp(/\d{2}/),(t,n,r)=>at.fromObject({year:Number.parseInt(t),month:Number.parseInt(r)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:e=>Z.exports.alt(...Object.keys(h1).sort((t,n)=>n.length-t.length).map(Z.exports.string)),date:e=>e7(e.rootDate,t=>Z.exports.seqMap(Z.exports.string("-"),Z.exports.regexp(/\d{2}/),(n,r)=>t.set({day:Number.parseInt(r)})),t=>Z.exports.seqMap(Z.exports.string("T"),Z.exports.regexp(/\d{2}/),(n,r)=>t.set({hour:Number.parseInt(r)})),t=>Z.exports.seqMap(Z.exports.string(":"),Z.exports.regexp(/\d{2}/),(n,r)=>t.set({minute:Number.parseInt(r)})),t=>Z.exports.seqMap(Z.exports.string(":"),Z.exports.regexp(/\d{2}/),(n,r)=>t.set({second:Number.parseInt(r)})),t=>Z.exports.alt(Z.exports.seqMap(Z.exports.string("."),Z.exports.regexp(/\d{3}/),(n,r)=>t.set({millisecond:Number.parseInt(r)})),Z.exports.succeed(t)),t=>Z.exports.alt(Z.exports.seqMap(Z.exports.string("+").or(Z.exports.string("-")),Z.exports.regexp(/\d{1,2}(:\d{2})?/),(n,r)=>t.setZone("UTC"+n+r,{keepLocalTime:!0})),Z.exports.seqMap(Z.exports.string("Z"),()=>t.setZone("utc",{keepLocalTime:!0})),Z.exports.seqMap(Z.exports.string("["),Z.exports.regexp(/[0-9A-Za-z+-\/]+/u),Z.exports.string("]"),(n,r,o)=>t.setZone(r,{keepLocalTime:!0})))).assert(t=>t.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:e=>Z.exports.alt(e.dateShorthand.map(t=>h1[t]()),e.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:e=>Z.exports.alt(...Object.keys(p1).sort((t,n)=>n.length-t.length).map(Z.exports.string)),duration:e=>Z.exports.seqMap(e.number,Z.exports.optWhitespace,e.durationType,(t,n,r)=>p1[r].mapUnits(o=>o*t)).sepBy1(Z.exports.string(",").trim(Z.exports.optWhitespace).or(Z.exports.optWhitespace)).map(t=>t.reduce((n,r)=>n.plus(r))).desc("duration like 4hr2min"),rawNull:e=>Z.exports.string("null"),tagSource:e=>e.tag.map(t=>yi.tag(t)),csvSource:e=>Z.exports.seqMap(Z.exports.string("csv(").skip(Z.exports.optWhitespace),e.string,Z.exports.string(")"),(t,n,r)=>yi.csv(n)),linkIncomingSource:e=>e.link.map(t=>yi.link(t.path,!0)),linkOutgoingSource:e=>Z.exports.seqMap(Z.exports.string("outgoing(").skip(Z.exports.optWhitespace),e.link,Z.exports.string(")"),(t,n,r)=>yi.link(n.path,!1)),folderSource:e=>e.string.map(t=>yi.folder(t)),parensSource:e=>Z.exports.seqMap(Z.exports.string("("),Z.exports.optWhitespace,e.source,Z.exports.optWhitespace,Z.exports.string(")"),(t,n,r,o,i)=>r),negateSource:e=>Z.exports.seqMap(Z.exports.alt(Z.exports.string("-"),Z.exports.string("!")),e.atomSource,(t,n)=>yi.negate(n)),atomSource:e=>Z.exports.alt(e.parensSource,e.negateSource,e.linkOutgoingSource,e.linkIncomingSource,e.folderSource,e.tagSource,e.csvSource),binaryOpSource:e=>Mp(e.atomSource,e.binaryBooleanOp.map(t=>t),yi.binaryOp),source:e=>e.binaryOpSource,variableField:e=>e.identifier.chain(t=>m1.includes(t.toUpperCase())?Z.exports.fail("Variable fields cannot be a keyword ("+m1.join(" or ")+")"):Z.exports.succeed(En.variable(t))).desc("variable"),numberField:e=>e.number.map(t=>En.literal(t)).desc("number"),stringField:e=>e.string.map(t=>En.literal(t)).desc("string"),boolField:e=>e.bool.map(t=>En.literal(t)).desc("boolean"),dateField:e=>Z.exports.seqMap(Z.exports.string("date("),Z.exports.optWhitespace,e.datePlus,Z.exports.optWhitespace,Z.exports.string(")"),(t,n,r,o,i)=>En.literal(r)).desc("date"),durationField:e=>Z.exports.seqMap(Z.exports.string("dur("),Z.exports.optWhitespace,e.duration,Z.exports.optWhitespace,Z.exports.string(")"),(t,n,r,o,i)=>En.literal(r)).desc("duration"),nullField:e=>e.rawNull.map(t=>En.NULL),linkField:e=>e.link.map(t=>En.literal(t)),listField:e=>e.field.sepBy(Z.exports.string(",").trim(Z.exports.optWhitespace)).wrap(Z.exports.string("[").skip(Z.exports.optWhitespace),Z.exports.optWhitespace.then(Z.exports.string("]"))).map(t=>En.list(t)).desc("list ('[1, 2, 3]')"),objectField:e=>Z.exports.seqMap(e.identifier.or(e.string),Z.exports.string(":").trim(Z.exports.optWhitespace),e.field,(t,n,r)=>({name:t,value:r})).sepBy(Z.exports.string(",").trim(Z.exports.optWhitespace)).wrap(Z.exports.string("{").skip(Z.exports.optWhitespace),Z.exports.optWhitespace.then(Z.exports.string("}"))).map(t=>{let n={};for(let r of t)n[r.name]=r.value;return En.object(n)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:e=>Z.exports.alt(e.date,e.duration.map(t=>p3(t)),e.string,e.tag,e.embedLink,e.bool,e.number,e.rawNull),inlineFieldList:e=>e.atomInlineField.sepBy(Z.exports.string(",").trim(Z.exports.optWhitespace).lookahead(e.atomInlineField)),inlineField:e=>Z.exports.alt(Z.exports.seqMap(e.atomInlineField,Z.exports.string(",").trim(Z.exports.optWhitespace),e.inlineFieldList,(t,n,r)=>[t].concat(r)),e.atomInlineField),atomField:e=>Z.exports.alt(e.embedLink.map(t=>En.literal(t)),e.negatedField,e.linkField,e.listField,e.objectField,e.lambdaField,e.parensField,e.boolField,e.numberField,e.stringField,e.dateField,e.durationField,e.nullField,e.variableField),indexField:e=>Z.exports.seqMap(e.atomField,Z.exports.alt(e.dotPostfix,e.indexPostfix,e.functionPostfix).many(),(t,n)=>{let r=t;for(let o of n)switch(o.type){case"dot":r=En.index(r,En.literal(o.field));break;case"index":r=En.index(r,o.field);break;case"function":r=En.func(r,o.fields);break}return r}),negatedField:e=>Z.exports.seqMap(Z.exports.string("!"),e.indexField,(t,n)=>En.negate(n)).desc("negated field"),parensField:e=>Z.exports.seqMap(Z.exports.string("("),Z.exports.optWhitespace,e.field,Z.exports.optWhitespace,Z.exports.string(")"),(t,n,r,o,i)=>r),lambdaField:e=>Z.exports.seqMap(e.identifier.sepBy(Z.exports.string(",").trim(Z.exports.optWhitespace)).wrap(Z.exports.string("(").trim(Z.exports.optWhitespace),Z.exports.string(")").trim(Z.exports.optWhitespace)),Z.exports.string("=>").trim(Z.exports.optWhitespace),e.field,(t,n,r)=>({type:"lambda",arguments:t,value:r})),dotPostfix:e=>Z.exports.seqMap(Z.exports.string("."),e.identifier,(t,n)=>({type:"dot",field:n})),indexPostfix:e=>Z.exports.seqMap(Z.exports.string("["),Z.exports.optWhitespace,e.field,Z.exports.optWhitespace,Z.exports.string("]"),(t,n,r,o,i)=>({type:"index",field:r})),functionPostfix:e=>Z.exports.seqMap(Z.exports.string("("),Z.exports.optWhitespace,e.field.sepBy(Z.exports.string(",").trim(Z.exports.optWhitespace)),Z.exports.optWhitespace,Z.exports.string(")"),(t,n,r,o,i)=>({type:"function",fields:r})),binaryMulDivField:e=>Mp(e.indexField,e.binaryMulDiv,En.binaryOp),binaryPlusMinusField:e=>Mp(e.binaryMulDivField,e.binaryPlusMinus,En.binaryOp),binaryCompareField:e=>Mp(e.binaryPlusMinusField,e.binaryCompareOp,En.binaryOp),binaryBooleanField:e=>Mp(e.binaryCompareField,e.binaryBooleanOp,En.binaryOp),binaryOpField:e=>e.binaryBooleanField,field:e=>e.binaryOpField});function t7(e){try{return tv.success(ka.field.tryParse(e))}catch(t){return tv.failure(""+t)}}var nv;(function(e){function t(r,o){return{name:r,field:o}}e.named=t;function n(r,o){return{field:r,direction:o}}e.sortBy=n})(nv||(nv={}));function n7(e){return Z.exports.custom((t,n)=>(r,o)=>{let i=e._(r,o);return i.status?Object.assign({},i,{value:[i.value,r.substring(o,i.index)]}):i})}function r7(e){return e.split(/[\r\n]+/).map(t=>t.trim()).join("")}const o7=Z.exports.createLanguage({queryType:e=>Z.exports.alt(Z.exports.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(t=>t.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:e=>Z.exports.seqMap(ka.field.skip(Z.exports.whitespace),Z.exports.regexp(/AS/i).skip(Z.exports.whitespace),ka.identifier.or(ka.string),(t,n,r)=>nv.named(r,t)),namedField:e=>Z.exports.alt(e.explicitNamedField,n7(ka.field).map(([t,n])=>nv.named(r7(n),t))),sortField:e=>Z.exports.seqMap(ka.field.skip(Z.exports.optWhitespace),Z.exports.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(t,n)=>{let r=n.length==0?"ascending":n[0].toLowerCase();return r=="desc"&&(r="descending"),r=="asc"&&(r="ascending"),{field:t,direction:r}}),headerClause:e=>e.queryType.skip(Z.exports.whitespace).chain(t=>{switch(t){case"table":return Z.exports.seqMap(Z.exports.regexp(/WITHOUT\s+ID/i).skip(Z.exports.optWhitespace).atMost(1),Z.exports.sepBy(e.namedField,Z.exports.string(",").trim(Z.exports.optWhitespace)),(n,r)=>({type:"table",fields:r,showId:n.length==0}));case"list":return Z.exports.seqMap(Z.exports.regexp(/WITHOUT\s+ID/i).skip(Z.exports.optWhitespace).atMost(1),ka.field.atMost(1),(n,r)=>({type:"list",format:r.length==1?r[0]:void 0,showId:n.length==0}));case"task":return Z.exports.succeed({type:"task"});case"calendar":return Z.exports.seqMap(e.namedField,n=>({type:"calendar",showId:!0,field:n}));default:return Z.exports.fail(`Unrecognized query type '${t}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:e=>Z.exports.seqMap(Z.exports.regexp(/FROM/i),Z.exports.whitespace,ka.source,(t,n,r)=>r),whereClause:e=>Z.exports.seqMap(Z.exports.regexp(/WHERE/i),Z.exports.whitespace,ka.field,(t,n,r)=>({type:"where",clause:r})).desc("WHERE <expression>"),sortByClause:e=>Z.exports.seqMap(Z.exports.regexp(/SORT/i),Z.exports.whitespace,e.sortField.sepBy1(Z.exports.string(",").trim(Z.exports.optWhitespace)),(t,n,r)=>({type:"sort",fields:r})).desc("SORT field [ASC/DESC]"),limitClause:e=>Z.exports.seqMap(Z.exports.regexp(/LIMIT/i),Z.exports.whitespace,ka.field,(t,n,r)=>({type:"limit",amount:r})).desc("LIMIT <value>"),flattenClause:e=>Z.exports.seqMap(Z.exports.regexp(/FLATTEN/i).skip(Z.exports.whitespace),e.namedField,(t,n)=>({type:"flatten",field:n})).desc("FLATTEN <value> [AS <name>]"),groupByClause:e=>Z.exports.seqMap(Z.exports.regexp(/GROUP BY/i).skip(Z.exports.whitespace),e.namedField,(t,n)=>({type:"group",field:n})).desc("GROUP BY <value> [AS <name>]"),clause:e=>Z.exports.alt(e.fromClause,e.whereClause,e.sortByClause,e.limitClause,e.groupByClause,e.flattenClause),query:e=>Z.exports.seqMap(e.headerClause.trim(Z.exports.optWhitespace),e.fromClause.trim(Z.exports.optWhitespace).atMost(1),e.clause.trim(Z.exports.optWhitespace).many(),(t,n,r)=>({header:t,source:n.length==0?yi.folder(""):n[0],operations:r,settings:X1}))}),a7=e=>{var t;return e?(t=e.plugins.plugins.dataview)===null||t===void 0?void 0:t.api:window.DataviewAPI},i7=e=>e.plugins.enabledPlugins.has("dataview");hs.DATE_SHORTHANDS=h1;hs.DURATION_TYPES=p1;hs.EXPRESSION=ka;hs.KEYWORDS=m1;hs.QUERY_LANGUAGE=o7;var s7=hs.getAPI=a7;hs.isPluginEnabled=i7;hs.parseField=t7;async function l7(e,t,n,r,o){var k,C;const{vault:i,metadataCache:s}=xe.getState().dailyNotesState.app===void 0?app:xe.getState().dailyNotesState.app,c=xe.getState().dailyNotesState.settings,d=e.replace(/\n/g,"<br>");if(n===void 0)return;const h=s.getFirstLinkpathDest("",n),g=N.moment(),m=g.format("YYYYMMDDHHmmss"),w=r.slice(14),b=" ",T=m+" "+d.trim(),E=b+"- "+m+" "+d.trim();if(h){let I;if(c!=null&&c.CommentOnMemos&&(c!=null&&c.CommentsInOriginalNotes)){const R=s7();if(R!==void 0)try{I=(C=(k=R.page(h.path))==null?void 0:k.file.lists.values)==null?void 0:C.filter(j=>j.line===parseInt(w))}catch(j){console.error(j)}}const B=await i.read(h);let F=0;I[0].children.values.length>0?F=I[0].children.values[I[0].children.values.length-1].line:F=I[0].line;const _=await u7(E,B,F);if(await i.modify(h,_.content),t)return{id:m+(F+1),content:T,deletedAt:"",createdAt:g.format("YYYY/MM/DD HH:mm:ss"),updatedAt:g.format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",path:h.path,hasId:"",linkId:o}}}async function u7(e,t,n){if(n===-1)return{content:`${t}
${e}`,posNum:-1};const r=t.split(`
`),o=r.slice(0,n+1).join(`
`),i=r.slice(n+1).join(`
`);return/^\s*$/g.test(r[n+1])?{content:`${o}
${e}
${i}`,posNum:n}:{content:`${o}
${e}
${i}`,posNum:n}}const ow=async e=>{const t=ut.getState().app,n=t.metadataCache.getFirstLinkpathDest("",e);if(!n){new N.Notice(O("File not found for the given thino path"));return}await t.workspace.getLeaf("split").openFile(n)},aw=async(e,t)=>{const{app:n}=ut.getState(),r=parseInt(e.slice(14)),o=n.metadataCache.getFirstLinkpathDest("",t);if(!N.Platform.isMobile)await n.workspace.getLeaf("split").openFile(o,{eState:{line:r}});else{let i=n.workspace.activeLeaf;i===null&&(i=n.workspace.getLeaf(!1)),await i.openFile(o,{eState:{line:r}})}},iw=async(e,t)=>{var d;const n=ut.getState().app,r=n.metadataCache.getFirstLinkpathDest("",t);if(!r){new N.Notice(O("File not found for the given thino path"));return}let o="";try{o=await n.vault.read(r)}catch(h){console.error(h),o=await n.vault.cachedRead(r)}const s=o.split(/\r?\n/).findIndex(h=>h.contains(e)),c=n.workspace.getLeaf("split");await c.openFile(r,{eState:{line:s}});try{(d=c.view.editor)==null||d.setCursor({line:s,ch:1})}catch(h){console.error(h)}},sw=async(e,t)=>{var c;const n=ut.getState().app,r=(d,h)=>{var m;const g=(m=Array.from(d.nodes.values()))==null?void 0:m.find(w=>w.id===h);return g?(d.selectOnly(g),d.zoomToSelection(),!0):!1},o=n.workspace.getLeavesOfType("canvas");for(const d of o){const h=d.view;if(((c=h==null?void 0:h.file)==null?void 0:c.path)===t&&r(h.canvas,e))return}const i=n.metadataCache.getFirstLinkpathDest("",t);if(!i){new N.Notice(O("File not found for the given thino path"));return}const s=n.workspace.getLeaf("split");await s.openFile(i),setTimeout(()=>{var d;r((d=s.view)==null?void 0:d.canvas,e)},10)},c7="https://api.thino.pkmer.cn/test",Hf=c7,f7="unknown",d7=/!\[(?<content>[^\]]+)\]\((?<link>[^)]+)\)/g;function p7(e){return e.substring(e.lastIndexOf(".")+1)}function h7(e){return{id:e.id,createdAt:Date.now().toString(),filename:e.id,type:`${p7(e.id)}`,size:e.size.toString()}}function m7(e){const t=e==null?void 0:e.matchAll(d7);return t?Array.from(t).map(n=>{var r;return h7({url:(r=n.groups)==null?void 0:r.link,id:f7,size:0,mtime:""})}).filter(n=>n.type!="html"):[]}function Dh(e){var t;return{id:e.id,createdAt:N.moment(e.ctime.toString(),"x").format("YYYY-MM-DD HH:mm:ss"),updatedAt:N.moment(e.mtime.toString(),"x").format("YYYY-MM-DD HH:mm:ss"),deletedAt:(t=e.ttime)!=null&&t.toString()?N.moment(e.ttime.toString(),"x").format("YYYY-MM-DD HH:mm:ss"):"",rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,resourceList:m7(e.content),creatorName:"thino",sourceType:(e==null?void 0:e.thinoType)||"FILE",visibility:"PUBLIC",localId:e.originalId,deleted:!!e.dtime}}async function g7(e){const n={url:`${Hf}/thino/getThinos${e?`?since=${e}&includeDeleted=true`:""}`,method:"GET",headers:{Authorization:`Bearer ${Uf()}`}};return N.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to fetch memos: ${r.status}`);try{return r.json.payload.map(i=>Dh(i))}catch(o){console.error(`Error processing memo response: ${o}`)}}).catch(r=>(console.error(r),[]))}function Uf(){const e=xe.getState().dailyNotesState.app||app;return(e==null?void 0:e.loadLocalStorage("tokenForSync"))||""}async function h3(e){const t=`${Hf}/thino/createThino`,n={content:e.content,thinoType:(e==null?void 0:e.thinoType)||"FILE",pinned:!1,rowStatus:"NORMAL",encrypted:!1},r={url:t,method:"POST",contentType:"application/json",body:JSON.stringify(n),headers:{Authorization:`Bearer ${Uf()}`}};return N.requestUrl(r).then(o=>{o.status>=400&&console.error(`Failed to create memo: ${o.status}`);try{const i=o.json;return Dh(i.payload)}catch(i){console.error(`Error processing memo creation response: ${i}`)}}).catch(o=>(console.error(o),null))}function v7(e){return{id:e.id,ctime:N.moment(e.createdAt,"YYYY-MM-DD HH:mm:ss").valueOf(),mtime:N.moment(e.updatedAt,"YYYY-MM-DD HH:mm:ss").valueOf(),ttime:e.deletedAt?N.moment(e.deletedAt,"YYYY-MM-DD HH:mm:ss").valueOf():void 0,rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,encrypted:!1,thinoType:e.sourceType==="DAILY"?"DAILY":"FILE",tags:[]}}async function y7(e){const t=`${Hf}/thino/createThinosByData`,n=e.map(o=>v7(o)),r={url:t,method:"POST",contentType:"application/json",body:JSON.stringify(n),headers:{Authorization:`Bearer ${Uf()}`}};return N.requestUrl(r).then(o=>{o.status>=400&&console.error(`Failed to create thinos: ${o.status}`);try{return o.json.payload.map(c=>Dh(c))}catch(i){console.error(`Error processing thinos creation response: ${i}`)}}).catch(o=>(console.error(o),[]))}async function w0(e){const n={url:`${Hf}/thino/updateThinoById/${e.id}`,method:"POST",contentType:"application/json",body:JSON.stringify(e),headers:{Authorization:`Bearer ${Uf()}`}};return N.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to update memo: ${r.status}`);try{const o=r.json;return Dh(o.payload)}catch(o){console.error(`Error processing memo update response: ${o}`)}}).catch(r=>(console.error(r),null))}async function w7(e){const n={url:`${Hf}/thino/recoverThinoFromTrash/${e}`,method:"POST",headers:{Authorization:`Bearer ${Uf()}`}};return N.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to recover memo: ${r.status}`);try{const o=r.json;return Dh(o.payload)}catch(o){console.error(`Error processing memo recovery response: ${o}`)}}).catch(r=>(console.error(r),null))}async function b7(e){const n={url:`${Hf}/thino/deleteThinoById/${e}`,method:"DELETE",headers:{Authorization:`Bearer ${Uf()}`}};return N.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to delete memo: ${r.status}`)}).catch(r=>(console.error(r),null))}class D7{constructor(){ye(this,"initialized",!1)}getState(){return xe.getState().memoState}async fetchAllMemos(){const t=ut.getState().settings,n=await po.getMyMemos(t.EnabledLocationList.map(i=>i.value)),r=[...n.memos],o=[...n.commentMemos];return xe.dispatch({type:"SET_MEMOS",payload:{memos:r}}),xe.dispatch({type:"SET_COMMENT_MEMOS",payload:{commentMemos:o}}),this.initialized||(this.initialized=!0,rt.setLoaded(!0)),r}async updateTypeMemos(t){const n=await po.updateSpecificTypeMemo(t),r=this.getState().memos.filter(o=>o.sourceType!==t);xe.dispatch({type:"SET_MEMOS",payload:{memos:[...r,...n.memos]}})}async removeTypeMemos(t){const n=this.getState().memos.filter(r=>r.sourceType!==t);xe.dispatch({type:"SET_MEMOS",payload:{memos:[...n]}})}async fetchDeletedMemos(){const t=await po.getMyDeletedMemos();return t.sort((n,r)=>Ue.getTimeStampByDate(r.deletedAt)-Ue.getTimeStampByDate(n.deletedAt)),t}pushMemo(t){xe.dispatch({type:"INSERT_MEMO",payload:{memo:{...t}}})}pushCommentMemo(t){xe.dispatch({type:"INSERT_COMMENT_MEMO",payload:{memo:{...t}}})}getMemoById(t){for(const n of this.getState().memos)if(n.id===t)return n;return null}getCommentMemoById(t){for(const n of this.getState().commentMemos)if(n.id===t)return n;return null}getMemoByWebId(t){for(const n of this.getState().memos)if(n.webId===t||n.id===t)return n;return null}async updateMemoById(t,n,r){const o=this.getMemoByWebId(t);if(!o)return;let i=null;const s=r?{}:{content:n.content,rowStatus:n.rowStatus,pinned:n.pinned,deleted:!!n.deletedAt,thinoType:n.thinoType??""};switch(o.sourceType){case"DAILY":i=await dl(o,{id:o.id,webId:n.id,...s});break;case"CANVAS":i=await fl(o,{id:o.id,webId:n.id,...s});break;case"MULTI":i=await os(o,{id:o.id,webId:n.id,...s});break;case"FILE":i=await cl(o,{id:o.id,webId:n.id,...s});break}if(!i)return o;xe.dispatch({type:"EDIT_MEMO",payload:i})}async archiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await dl(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"CANVAS":n=await fl(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"MULTI":n=await os(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"FILE":n=await cl(t,{id:t.id,rowStatus:"ARCHIVED"});break}return n?(xe.dispatch({type:"ARCHIVE_MEMO_BY_ID",payload:n}),n):t}async unarchiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await dl(t,{id:t.id,rowStatus:"NORMAL"});break;case"CANVAS":n=await fl(t,{id:t.id,rowStatus:"NORMAL"});break;case"MULTI":n=await os(t,{id:t.id,rowStatus:"NORMAL"});break;case"FILE":n=await cl(t,{id:t.id,rowStatus:"NORMAL"});break}return xe.dispatch({type:"UNARCHIVE_MEMO_BY_ID",payload:n}),n}async hideMemoById(t){const n=this.getMemoById(t);if(!n)return n;let r=null;switch(n.sourceType){case"DAILY":r=await dl(n,{id:n.id,deleted:!0});break;case"CANVAS":r=await fl(n,{id:n.id,deleted:!0});break;case"MULTI":r=await os(n,{id:n.id,deleted:!0});break;case"FILE":r=await cl(n,{id:n.id,deleted:!0});break}if(!r)return n;if(r)return r}async restoreMemoById(t){return await po.restoreMemo(t)}async deleteMemoById(t,n){const r=this.getMemoById(t);try{switch(r.sourceType){case"DAILY":await po.deleteMemoInDailyNote(r);break;case"CANVAS":await po.deleteMemoInCanvas(r);break;case"MULTI":await po.deleteMemoInMultiFiles(r);break;case"FILE":await po.deleteMemoInSingleFile(r);break}xe.dispatch({type:"DELETE_MEMO_BY_ID",payload:{id:t}})}catch(c){console.error(c),new N.Notice(O("Failed to delete memo"))}if(n&&n==="local")return;const o=ut.getState().settings,i=ut.getState().app;!(i!=null&&i.loadLocalStorage("tokenForSync"))||!o.startSync||r.webId&&await b7(r.webId)}async removeMemosInFile(t,n){var o,i;const r=[];try{if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n)await o1(t,r);else if(t.path.contains("thino.canvas"))await a1(t,r);else if((o=t==null?void 0:t.parent)!=null&&o.path.contains(n)||!(t!=null&&t.parent)&&!((i=t==null?void 0:t.parent)!=null&&i.path)){const c=this.getState().memos.filter(d=>d.path.trim()===t.path.trim());c.length>0&&r.push(...c)}else t.path.endsWith(".md")&&t.path.contains(".thino")&&await r1(t,r);const s=r.map(c=>c.id);xe.dispatch({type:"DELETE_MEMO_BY_ID_BATCH",payload:{ids:s}})}catch(s){console.error(s)}}async updateMemosInFile(t,n){const r=[],o=async()=>{if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n){await o1(t,r);return}else if(t.path.contains("thino.canvas")){await a1(t,r);return}else if(t!=null&&t.parent.path.contains(n)){await fE(t,r);return}else if(t.path.endsWith(".md")&&t.path.contains(".thino")){await r1(t,r);return}};try{await o(),xe.dispatch({type:"UPDATE_MEMO_BATCH",payload:{memos:r,path:t.path}})}catch(i){console.error(i)}}async updateMemoProperty(t){const n=Ue.randomId(16),r=await os(t,{id:n});xe.dispatch({type:"EDIT_MEMO_PATH",payload:r})}editMemo(t){const n=t.webId;xe.dispatch({type:"EDIT_MEMO",payload:t});const r=ut.getState().settings,o=ut.getState().app;if(!(!(o!=null&&o.loadLocalStorage("tokenForSync"))||!r.startSync))try{t&&n&&w0({id:n,content:t.content,rowStatus:t.rowStatus,pinned:t.pinned,ttime:t.deletedAt?N.moment(t.deletedAt,"YYYY-MM-DD HH:mm:ss").valueOf():0,thinoType:t.sourceType==="DAILY"?"DAILY":"FILE"})}catch(s){console.error(s)}}editCommentMemo(t){xe.dispatch({type:"EDIT_COMMENT_MEMO",payload:t})}getThinoViaKeyword(t){const{memos:n}=this.getState();return n.filter(o=>o.content.toLowerCase().includes(t==null?void 0:t.toLowerCase()))}updateTagsState(){const{memos:t}=this.getState(),n=new Set,r={};for(const o of t){const i=o.content.replace(/<br>/g," ").replace(/<[^>]*>/g,"").replace(/\`\`\`[a-z]*\n[\s\S]*?\n\`\`\`/g,"").replace(/\`([^\`].*?)\`/g,"");if(o.deletedAt!==""&&o.deletedAt)continue;[...Array.from(i.match(ir)??[]),...Array.from(i.match(Lr)??[]),...Array.from(i.match(_o)??[])].forEach(c=>{const d=c.replace(ir,"$1").replace(Lr,"$1").replace(_o,"$2").trim();/^\d+$/.test(d)||(n.add(d),r[d]=(r[d]||0)+1)})}xe.dispatch({type:"SET_TAGS",payload:{tags:Array.from(n),tagsNum:r}})}clearMemos(){xe.dispatch({type:"SET_MEMOS",payload:{memos:[]}})}async getLinkedMemos(t){const{memos:n}=this.getState();return n.filter(r=>r.content.includes(t))}async getCommentMemos(t){const{memos:n}=this.getState();return n.filter(r=>r.content.includes("comment: "+t))}async createMemoMultiFile({content:t,isList:n}){return await MM({content:t,isList:n})}async createMemoSingleFile({content:t,isList:n}){return await kM({content:t,isList:n})}async createOrPatchThinoFromWeb(t){const n=this.getState().memos;if(t.localId&&(n!=null&&n.some(i=>i.id===t.localId)))return await this.updateMemoById(t.localId,t,!0),null;if(n!=null&&n.some(i=>i.id===t.id)||n!=null&&n.some(i=>i.webId===t.id))return await this.updateMemoById(t.id,t,!1),null;let r=t.sourceType;const o=ut.getState().settings;switch(o&&(o!=null&&o.saveThinoType)&&(r=o.saveThinoType!=="FILE"?o.saveThinoType:t.sourceType),r){case"FILE":case"MULTI":case"CANVAS":return await Ib(t);case"DAILY":return await FM(t);default:return await Ib(t)}}async initSync(){const n=this.getState().memos.filter(o=>!o.webId),r=await y7(n);for(const o of r)await this.createOrPatchThinoFromWeb(o)}async createMemoCanvas({text:t,isList:n}){return await NM({content:t,isList:n})}async createMemoDaily(t,n){return await Ab(t,n)}async pinMemoById(t){const n=this.getMemoById(t),r=await zM(n);xe.dispatch({type:"PIN_MEMO",payload:r});try{const o=ut.getState().settings,i=ut.getState().app;if((i==null?void 0:i.loadLocalStorage("tokenForSync"))&&o.startSync){const c=await w0({id:r.webId,pinned:!0});this.editMemo(c)}}catch(o){console.error(o)}}async unpinMemoById(t){const n=this.getMemoById(t),r=await $M(n);xe.dispatch({type:"PIN_MEMO",payload:r});try{const o=ut.getState().settings,i=ut.getState().app;if((i==null?void 0:i.loadLocalStorage("tokenForSync"))&&o.startSync){const c=await w0({id:r.webId,pinned:!1});this.editMemo(c)}}catch(o){console.error(o)}}async createCommentMemo(t,n,r,o,i){return await l7(t,n,r,o,i)}async importMemos(t,n,r){return await Ab(t,n,r)}async createThino({content:t,isList:n,type:r}){let o=null;switch(r.toLowerCase()){case"canvas":o=await Me.createMemoCanvas({text:t,isList:n});break;case"multi":o=await Me.createMemoMultiFile({content:t,isList:n});break;case"daily":o=await Me.createMemoDaily(t,n);break;case"file":o=await Me.createMemoSingleFile({content:t,isList:n});break;default:o=await Me.createMemoDaily(t,n);break}const i=ut.getState().settings,s=ut.getState().app,c=s==null?void 0:s.loadLocalStorage("tokenForSync");if(o&&c&&i.startSync){const d=await h3({content:t,thinoType:r==="DAILY"?"DAILY":"FILE"});await this.updateMemoById(o.id,d,!0)}return o}async openThinoByID(t){const n=this.getMemoById(t);if(n)switch(n.sourceType){case"DAILY":await aw(n.id,n.path);break;case"CANVAS":await sw(n.id,n.path);break;case"MULTI":await ow(n.path);break;case"FILE":await iw(n.id,n.path);break}}async updateMemo(t,n,r){const o=this.getMemoById(t);if(o){let i=null;switch(o.sourceType){case"DAILY":i=await dl(o,{id:o.id,content:n,thinoType:r||""});break;case"CANVAS":i=await fl(o,{id:o.id,content:n,thinoType:r||""});break;case"MULTI":i=await os(o,{id:o.id,content:n,thinoType:r||""});break;case"FILE":i=await cl(o,{id:o.id,content:n,thinoType:r||""})}if(i)return i}return o}}const Me=new D7;class S7{getState(){return xe.getState().queryState}async getMyAllQueries(){const t=it.getState().query.filter,n=this.getQueryById(t),r=await po.getMyQueries();return xe.dispatch({type:"SET_QUERIES",payload:{queries:[...r,...n?[n]:[]]}}),r}getQueryById(t){return this.getState().queries.find(n=>n.id===t)}pushQuery(t){xe.dispatch({type:"INSERT_QUERY",payload:{query:{...t}}})}editQuery(t){xe.dispatch({type:"UPDATE_QUERY",payload:t})}async deleteQuery(t){await po.deleteQueryById(t),xe.dispatch({type:"DELETE_QUERY_BY_ID",payload:{id:t}})}async createQuery(t,n){return await po.createQuery(t,n)}createTempQuery(t,n){return oM(t,n)}async updateQuery(t,n,r){return await po.updateQuery(t,n,r)}async pinQuery(t){await po.pinQuery(t)}async unpinQuery(t){await po.unpinQuery(t)}}const ln=new S7;class E7{async upload(t){const{vault:n,fileManager:r}=xe.getState().dailyNotesState.app,o=await t.arrayBuffer(),i=T7(t.type),s=Au(),c=N.moment(),d=Sv(c,s);let h;if(d)d instanceof N.TFile&&(h=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${N.moment().format("YYYYMMDDHHmmss")}`,i,d),o));else{const g=await nE(c);h=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${N.moment().format("YYYYMMDDHHmmss")}`,i,g),o)}return r.generateMarkdownLink(h,h.path,"","")}async parseHtml(t){const n=await t.text(),r=document.createElement("html");r.innerHTML=n;const o=Array.from(r.getElementsByClassName("memo"));for(const i of o){const s=i.getElementsByClassName("content")[0],c=N.htmlToMarkdown(s.innerHTML),d=await Me.importMemos(c,!0,N.moment(i.getElementsByClassName("time")[0].innerHTML));Me.pushMemo(d)}}}const T7=e=>{var t;return(t=/^image\/(.+)$/.exec(e))==null?void 0:t[1]},lw=new E7;var Lu={},m3={exports:{}},fo={},b0={exports:{}},D0={},uD;function C7(){return uD||(uD=1,function(e){function t(re,be){var V=re.length;re.push(be);e:for(;0<V;){var G=V-1>>>1,le=re[G];if(0<o(le,be))re[G]=be,re[V]=le,V=G;else break e}}function n(re){return re.length===0?null:re[0]}function r(re){if(re.length===0)return null;var be=re[0],V=re.pop();if(V!==be){re[0]=V;e:for(var G=0,le=re.length,we=le>>>1;G<we;){var ue=2*(G+1)-1,Se=re[ue],Re=ue+1,Ye=re[Re];if(0>o(Se,V))Re<le&&0>o(Ye,Se)?(re[G]=Ye,re[Re]=V,G=Re):(re[G]=Se,re[ue]=V,G=ue);else if(Re<le&&0>o(Ye,V))re[G]=Ye,re[Re]=V,G=Re;else break e}}return be}function o(re,be){var V=re.sortIndex-be.sortIndex;return V!==0?V:re.id-be.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var d=[],h=[],g=1,m=null,w=3,b=!1,T=!1,E=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function B(re){for(var be=n(h);be!==null;){if(be.callback===null)r(h);else if(be.startTime<=re)r(h),be.sortIndex=be.expirationTime,t(d,be);else break;be=n(h)}}function F(re){if(E=!1,B(re),!T)if(n(d)!==null)T=!0,fe(_);else{var be=n(h);be!==null&&De(F,be.startTime-re)}}function _(re,be){T=!1,E&&(E=!1,C(z),z=-1),b=!0;var V=w;try{for(B(be),m=n(d);m!==null&&(!(m.expirationTime>be)||re&&!J());){var G=m.callback;if(typeof G=="function"){m.callback=null,w=m.priorityLevel;var le=G(m.expirationTime<=be);be=e.unstable_now(),typeof le=="function"?m.callback=le:m===n(d)&&r(d),B(be)}else r(d);m=n(d)}if(m!==null)var we=!0;else{var ue=n(h);ue!==null&&De(F,ue.startTime-be),we=!1}return we}finally{m=null,w=V,b=!1}}var R=!1,j=null,z=-1,q=5,$=-1;function J(){return!(e.unstable_now()-$<q)}function ae(){if(j!==null){var re=e.unstable_now();$=re;var be=!0;try{be=j(!0,re)}finally{be?ie():(R=!1,j=null)}}else R=!1}var ie;if(typeof I=="function")ie=function(){I(ae)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,pe=ge.port2;ge.port1.onmessage=ae,ie=function(){pe.postMessage(null)}}else ie=function(){k(ae,0)};function fe(re){j=re,R||(R=!0,ie())}function De(re,be){z=k(function(){re(e.unstable_now())},be)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(re){re.callback=null},e.unstable_continueExecution=function(){T||b||(T=!0,fe(_))},e.unstable_forceFrameRate=function(re){0>re||125<re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<re?Math.floor(1e3/re):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(re){switch(w){case 1:case 2:case 3:var be=3;break;default:be=w}var V=w;w=be;try{return re()}finally{w=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(re,be){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var V=w;w=re;try{return be()}finally{w=V}},e.unstable_scheduleCallback=function(re,be,V){var G=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?G+V:G):V=G,re){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=V+le,re={id:g++,callback:be,priorityLevel:re,startTime:V,expirationTime:le,sortIndex:-1},V>G?(re.sortIndex=V,t(h,re),n(d)===null&&re===n(h)&&(E?(C(z),z=-1):E=!0,De(F,V-G))):(re.sortIndex=le,t(d,re),T||b||(T=!0,fe(_))),re},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(re){var be=w;return function(){var V=w;w=be;try{return re.apply(this,arguments)}finally{w=V}}}}(D0)),D0}var cD;function x7(){return cD||(cD=1,b0.exports=C7()),b0.exports}var fD;function M7(){if(fD)return fo;fD=1;var e=A,t=x7();function n(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,p=1;p<arguments.length;p++)l+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function i(a,l){s(a,l),s(a+"Capture",l)}function s(a,l){for(o[a]=l,a=0;a<l.length;a++)r.add(l[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},m={};function w(a){return d.call(m,a)?!0:d.call(g,a)?!1:h.test(a)?m[a]=!0:(g[a]=!0,!1)}function b(a,l,p,v){if(p!==null&&p.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return v?!1:p!==null?!p.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function T(a,l,p,v){if(l===null||typeof l>"u"||b(a,l,p,v))return!0;if(v)return!1;if(p!==null)switch(p.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function E(a,l,p,v,S,x,P){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=v,this.attributeNamespace=S,this.mustUseProperty=p,this.propertyName=a,this.type=l,this.sanitizeURL=x,this.removeEmptyString=P}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){k[a]=new E(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var l=a[0];k[l]=new E(l,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){k[a]=new E(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){k[a]=new E(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){k[a]=new E(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){k[a]=new E(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){k[a]=new E(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){k[a]=new E(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){k[a]=new E(a,5,!1,a.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function I(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var l=a.replace(C,I);k[l]=new E(l,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var l=a.replace(C,I);k[l]=new E(l,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var l=a.replace(C,I);k[l]=new E(l,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){k[a]=new E(a,1,!1,a.toLowerCase(),null,!1,!1)}),k.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){k[a]=new E(a,1,!1,a.toLowerCase(),null,!0,!0)});function B(a,l,p,v){var S=k.hasOwnProperty(l)?k[l]:null;(S!==null?S.type!==0:v||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(T(l,p,S,v)&&(p=null),v||S===null?w(l)&&(p===null?a.removeAttribute(l):a.setAttribute(l,""+p)):S.mustUseProperty?a[S.propertyName]=p===null?S.type===3?!1:"":p:(l=S.attributeName,v=S.attributeNamespace,p===null?a.removeAttribute(l):(S=S.type,p=S===3||S===4&&p===!0?"":""+p,v?a.setAttributeNS(v,l,p):a.setAttribute(l,p))))}var F=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),R=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),$=Symbol.for("react.provider"),J=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),pe=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),De=Symbol.for("react.offscreen"),re=Symbol.iterator;function be(a){return a===null||typeof a!="object"?null:(a=re&&a[re]||a["@@iterator"],typeof a=="function"?a:null)}var V=Object.assign,G;function le(a){if(G===void 0)try{throw Error()}catch(p){var l=p.stack.trim().match(/\n( *(at )?)/);G=l&&l[1]||""}return`
`+G+a}var we=!1;function ue(a,l){if(!a||we)return"";we=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(ve){var v=ve}Reflect.construct(a,[],l)}else{try{l.call()}catch(ve){v=ve}a.call(l.prototype)}else{try{throw Error()}catch(ve){v=ve}a()}}catch(ve){if(ve&&v&&typeof ve.stack=="string"){for(var S=ve.stack.split(`
`),x=v.stack.split(`
`),P=S.length-1,W=x.length-1;1<=P&&0<=W&&S[P]!==x[W];)W--;for(;1<=P&&0<=W;P--,W--)if(S[P]!==x[W]){if(P!==1||W!==1)do if(P--,W--,0>W||S[P]!==x[W]){var X=`
`+S[P].replace(" at new "," at ");return a.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",a.displayName)),X}while(1<=P&&0<=W);break}}}finally{we=!1,Error.prepareStackTrace=p}return(a=a?a.displayName||a.name:"")?le(a):""}function Se(a){switch(a.tag){case 5:return le(a.type);case 16:return le("Lazy");case 13:return le("Suspense");case 19:return le("SuspenseList");case 0:case 2:case 15:return a=ue(a.type,!1),a;case 11:return a=ue(a.type.render,!1),a;case 1:return a=ue(a.type,!0),a;default:return""}}function Re(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case j:return"Fragment";case R:return"Portal";case q:return"Profiler";case z:return"StrictMode";case ie:return"Suspense";case ge:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case J:return(a.displayName||"Context")+".Consumer";case $:return(a._context.displayName||"Context")+".Provider";case ae:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case pe:return l=a.displayName||null,l!==null?l:Re(a.type)||"Memo";case fe:l=a._payload,a=a._init;try{return Re(a(l))}catch{}}return null}function Ye(a){var l=a.type;switch(a.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=l.render,a=a.displayName||a.name||"",l.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Re(l);case 8:return l===z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function Be(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function yt(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Ee(a){var l=yt(a)?"checked":"value",p=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),v=""+a[l];if(!a.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var S=p.get,x=p.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return S.call(this)},set:function(P){v=""+P,x.call(this,P)}}),Object.defineProperty(a,l,{enumerable:p.enumerable}),{getValue:function(){return v},setValue:function(P){v=""+P},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function Ve(a){a._valueTracker||(a._valueTracker=Ee(a))}function Ke(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var p=l.getValue(),v="";return a&&(v=yt(a)?a.checked?"true":"false":a.value),a=v,a!==p?(l.setValue(a),!0):!1}function Xe(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ge(a,l){var p=l.checked;return V({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??a._wrapperState.initialChecked})}function tt(a,l){var p=l.defaultValue==null?"":l.defaultValue,v=l.checked!=null?l.checked:l.defaultChecked;p=Be(l.value!=null?l.value:p),a._wrapperState={initialChecked:v,initialValue:p,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function Dt(a,l){l=l.checked,l!=null&&B(a,"checked",l,!1)}function dt(a,l){Dt(a,l);var p=Be(l.value),v=l.type;if(p!=null)v==="number"?(p===0&&a.value===""||a.value!=p)&&(a.value=""+p):a.value!==""+p&&(a.value=""+p);else if(v==="submit"||v==="reset"){a.removeAttribute("value");return}l.hasOwnProperty("value")?Yo(a,l.type,p):l.hasOwnProperty("defaultValue")&&Yo(a,l.type,Be(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(a.defaultChecked=!!l.defaultChecked)}function Vt(a,l,p){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var v=l.type;if(!(v!=="submit"&&v!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+a._wrapperState.initialValue,p||l===a.value||(a.value=l),a.defaultValue=l}p=a.name,p!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,p!==""&&(a.name=p)}function Yo(a,l,p){(l!=="number"||Xe(a.ownerDocument)!==a)&&(p==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+p&&(a.defaultValue=""+p))}var cn=Array.isArray;function en(a,l,p,v){if(a=a.options,l){l={};for(var S=0;S<p.length;S++)l["$"+p[S]]=!0;for(p=0;p<a.length;p++)S=l.hasOwnProperty("$"+a[p].value),a[p].selected!==S&&(a[p].selected=S),S&&v&&(a[p].defaultSelected=!0)}else{for(p=""+Be(p),l=null,S=0;S<a.length;S++){if(a[S].value===p){a[S].selected=!0,v&&(a[S].defaultSelected=!0);return}l!==null||a[S].disabled||(l=a[S])}l!==null&&(l.selected=!0)}}function br(a,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return V({},l,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Dr(a,l){var p=l.value;if(p==null){if(p=l.children,l=l.defaultValue,p!=null){if(l!=null)throw Error(n(92));if(cn(p)){if(1<p.length)throw Error(n(93));p=p[0]}l=p}l==null&&(l=""),p=l}a._wrapperState={initialValue:Be(p)}}function _a(a,l){var p=Be(l.value),v=Be(l.defaultValue);p!=null&&(p=""+p,p!==a.value&&(a.value=p),l.defaultValue==null&&a.defaultValue!==p&&(a.defaultValue=p)),v!=null&&(a.defaultValue=""+v)}function yo(a){var l=a.textContent;l===a._wrapperState.initialValue&&l!==""&&l!==null&&(a.value=l)}function la(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Qr(a,l){return a==null||a==="http://www.w3.org/1999/xhtml"?la(l):a==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Sr,gs=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,p,v,S){MSApp.execUnsafeLocalFunction(function(){return a(l,p,v,S)})}:a}(function(a,l){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=l;else{for(Sr=Sr||document.createElement("div"),Sr.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Sr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}});function ua(a,l){if(l){var p=a.firstChild;if(p&&p===a.lastChild&&p.nodeType===3){p.nodeValue=l;return}}a.textContent=l}var ca={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Tl=["Webkit","ms","Moz","O"];Object.keys(ca).forEach(function(a){Tl.forEach(function(l){l=l+a.charAt(0).toUpperCase()+a.substring(1),ca[l]=ca[a]})});function Mi(a,l,p){return l==null||typeof l=="boolean"||l===""?"":p||typeof l!="number"||l===0||ca.hasOwnProperty(a)&&ca[a]?(""+l).trim():l+"px"}function ki(a,l){a=a.style;for(var p in l)if(l.hasOwnProperty(p)){var v=p.indexOf("--")===0,S=Mi(p,l[p],v);p==="float"&&(p="cssFloat"),v?a.setProperty(p,S):a[p]=S}}var vs=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Pa(a,l){if(l){if(vs[a]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Ni(a,l){if(a.indexOf("-")===-1)return typeof l.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var U=null;function te(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var he=null,Ce=null,Le=null;function je(a){if(a=Kn(a)){if(typeof he!="function")throw Error(n(280));var l=a.stateNode;l&&(l=fc(l),he(a.stateNode,a.type,l))}}function He(a){Ce?Le?Le.push(a):Le=[a]:Ce=a}function mt(){if(Ce){var a=Ce,l=Le;if(Le=Ce=null,je(a),l)for(a=0;a<l.length;a++)je(l[a])}}function Yt(a,l){return a(l)}function xn(){}var mn=!1;function Zr(a,l,p){if(mn)return a(l,p);mn=!0;try{return Yt(a,l,p)}finally{mn=!1,(Ce!==null||Le!==null)&&(xn(),mt())}}function Mn(a,l){var p=a.stateNode;if(p===null)return null;var v=fc(p);if(v===null)return null;p=v[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(a=a.type,v=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!v;break e;default:a=!1}if(a)return null;if(p&&typeof p!="function")throw Error(n(231,l,typeof p));return p}var ur=!1;if(c)try{var Jr={};Object.defineProperty(Jr,"passive",{get:function(){ur=!0}}),window.addEventListener("test",Jr,Jr),window.removeEventListener("test",Jr,Jr)}catch{ur=!1}function Cl(a,l,p,v,S,x,P,W,X){var ve=Array.prototype.slice.call(arguments,3);try{l.apply(p,ve)}catch(Ae){this.onError(Ae)}}var Gt=!1,wo=null,bo=!1,Do=null,ja={onError:function(a){Gt=!0,wo=a}};function Ba(a,l,p,v,S,x,P,W,X){Gt=!1,wo=null,Cl.apply(ja,arguments)}function ly(a,l,p,v,S,x,P,W,X){if(Ba.apply(this,arguments),Gt){if(Gt){var ve=wo;Gt=!1,wo=null}else throw Error(n(198));bo||(bo=!0,Do=ve)}}function Fi(a){var l=a,p=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,l.flags&4098&&(p=l.return),a=l.return;while(a)}return l.tag===3?p:null}function ed(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function jh(a){if(Fi(a)!==a)throw Error(n(188))}function uy(a){var l=a.alternate;if(!l){if(l=Fi(a),l===null)throw Error(n(188));return l!==a?null:a}for(var p=a,v=l;;){var S=p.return;if(S===null)break;var x=S.alternate;if(x===null){if(v=S.return,v!==null){p=v;continue}break}if(S.child===x.child){for(x=S.child;x;){if(x===p)return jh(S),a;if(x===v)return jh(S),l;x=x.sibling}throw Error(n(188))}if(p.return!==v.return)p=S,v=x;else{for(var P=!1,W=S.child;W;){if(W===p){P=!0,p=S,v=x;break}if(W===v){P=!0,v=S,p=x;break}W=W.sibling}if(!P){for(W=x.child;W;){if(W===p){P=!0,p=x,v=S;break}if(W===v){P=!0,v=x,p=S;break}W=W.sibling}if(!P)throw Error(n(189))}}if(p.alternate!==v)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?a:l}function Bh(a){return a=uy(a),a!==null?Yh(a):null}function Yh(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var l=Yh(a);if(l!==null)return l;a=a.sibling}return null}var Hh=t.unstable_scheduleCallback,Uh=t.unstable_cancelCallback,Pu=t.unstable_shouldYield,cy=t.unstable_requestPaint,tn=t.unstable_now,fy=t.unstable_getCurrentPriorityLevel,td=t.unstable_ImmediatePriority,Vh=t.unstable_UserBlockingPriority,xl=t.unstable_NormalPriority,zh=t.unstable_LowPriority,nd=t.unstable_IdlePriority,ju=null,Ho=null;function dy(a){if(Ho&&typeof Ho.onCommitFiberRoot=="function")try{Ho.onCommitFiberRoot(ju,a,void 0,(a.current.flags&128)===128)}catch{}}var So=Math.clz32?Math.clz32:Wh,$h=Math.log,qh=Math.LN2;function Wh(a){return a>>>=0,a===0?32:31-($h(a)/qh|0)|0}var ys=64,Bu=4194304;function ws(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ii(a,l){var p=a.pendingLanes;if(p===0)return 0;var v=0,S=a.suspendedLanes,x=a.pingedLanes,P=p&268435455;if(P!==0){var W=P&~S;W!==0?v=ws(W):(x&=P,x!==0&&(v=ws(x)))}else P=p&~S,P!==0?v=ws(P):x!==0&&(v=ws(x));if(v===0)return 0;if(l!==0&&l!==v&&!(l&S)&&(S=v&-v,x=l&-l,S>=x||S===16&&(x&4194240)!==0))return l;if(v&4&&(v|=p&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=v;0<l;)p=31-So(l),S=1<<p,v|=a[p],l&=~S;return v}function Gh(a,l){switch(a){case 1:case 2:case 4:return l+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function py(a,l){for(var p=a.suspendedLanes,v=a.pingedLanes,S=a.expirationTimes,x=a.pendingLanes;0<x;){var P=31-So(x),W=1<<P,X=S[P];X===-1?(!(W&p)||W&v)&&(S[P]=Gh(W,l)):X<=l&&(a.expiredLanes|=W),x&=~W}}function Yu(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function rd(){var a=ys;return ys<<=1,!(ys&4194240)&&(ys=64),a}function Ml(a){for(var l=[],p=0;31>p;p++)l.push(a);return l}function kl(a,l,p){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-So(l),a[l]=p}function Kh(a,l){var p=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var v=a.eventTimes;for(a=a.expirationTimes;0<p;){var S=31-So(p),x=1<<S;l[S]=0,v[S]=-1,a[S]=-1,p&=~x}}function Nl(a,l){var p=a.entangledLanes|=l;for(a=a.entanglements;p;){var v=31-So(p),S=1<<v;S&l|a[v]&l&&(a[v]|=l),p&=~S}}var Pt=0;function Ai(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var od,Hu,Qh,ad,id,Uu=!1,Fl=[],Ya=null,Ha=null,Ua=null,bs=new Map,Il=new Map,Va=[],hy="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Zh(a,l){switch(a){case"focusin":case"focusout":Ya=null;break;case"dragenter":case"dragleave":Ha=null;break;case"mouseover":case"mouseout":Ua=null;break;case"pointerover":case"pointerout":bs.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Il.delete(l.pointerId)}}function Oi(a,l,p,v,S,x){return a===null||a.nativeEvent!==x?(a={blockedOn:l,domEventName:p,eventSystemFlags:v,nativeEvent:x,targetContainers:[S]},l!==null&&(l=Kn(l),l!==null&&Hu(l)),a):(a.eventSystemFlags|=v,l=a.targetContainers,S!==null&&l.indexOf(S)===-1&&l.push(S),a)}function my(a,l,p,v,S){switch(l){case"focusin":return Ya=Oi(Ya,a,l,p,v,S),!0;case"dragenter":return Ha=Oi(Ha,a,l,p,v,S),!0;case"mouseover":return Ua=Oi(Ua,a,l,p,v,S),!0;case"pointerover":var x=S.pointerId;return bs.set(x,Oi(bs.get(x)||null,a,l,p,v,S)),!0;case"gotpointercapture":return x=S.pointerId,Il.set(x,Oi(Il.get(x)||null,a,l,p,v,S)),!0}return!1}function Jh(a){var l=$o(a.target);if(l!==null){var p=Fi(l);if(p!==null){if(l=p.tag,l===13){if(l=ed(p),l!==null){a.blockedOn=l,id(a.priority,function(){Qh(p)});return}}else if(l===3&&p.stateNode.current.memoizedState.isDehydrated){a.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Vu(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var p=qu(a.domEventName,a.eventSystemFlags,l[0],a.nativeEvent);if(p===null){p=a.nativeEvent;var v=new p.constructor(p.type,p);U=v,p.target.dispatchEvent(v),U=null}else return l=Kn(p),l!==null&&Hu(l),a.blockedOn=p,!1;l.shift()}return!0}function Xh(a,l,p){Vu(a)&&p.delete(l)}function gy(){Uu=!1,Ya!==null&&Vu(Ya)&&(Ya=null),Ha!==null&&Vu(Ha)&&(Ha=null),Ua!==null&&Vu(Ua)&&(Ua=null),bs.forEach(Xh),Il.forEach(Xh)}function Ht(a,l){a.blockedOn===l&&(a.blockedOn=null,Uu||(Uu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,gy)))}function jt(a){function l(S){return Ht(S,a)}if(0<Fl.length){Ht(Fl[0],a);for(var p=1;p<Fl.length;p++){var v=Fl[p];v.blockedOn===a&&(v.blockedOn=null)}}for(Ya!==null&&Ht(Ya,a),Ha!==null&&Ht(Ha,a),Ua!==null&&Ht(Ua,a),bs.forEach(l),Il.forEach(l),p=0;p<Va.length;p++)v=Va[p],v.blockedOn===a&&(v.blockedOn=null);for(;0<Va.length&&(p=Va[0],p.blockedOn===null);)Jh(p),p.blockedOn===null&&Va.shift()}var Ds=F.ReactCurrentBatchConfig,zu=!0;function vy(a,l,p,v){var S=Pt,x=Ds.transition;Ds.transition=null;try{Pt=1,sd(a,l,p,v)}finally{Pt=S,Ds.transition=x}}function yy(a,l,p,v){var S=Pt,x=Ds.transition;Ds.transition=null;try{Pt=4,sd(a,l,p,v)}finally{Pt=S,Ds.transition=x}}function sd(a,l,p,v){if(zu){var S=qu(a,l,p,v);if(S===null)Td(a,l,v,$u,p),Zh(a,v);else if(my(S,a,l,p,v))v.stopPropagation();else if(Zh(a,v),l&4&&-1<hy.indexOf(a)){for(;S!==null;){var x=Kn(S);if(x!==null&&od(x),x=qu(a,l,p,v),x===null&&Td(a,l,v,$u,p),x===S)break;S=x}S!==null&&v.stopPropagation()}else Td(a,l,v,null,p)}}var $u=null;function qu(a,l,p,v){if($u=null,a=te(v),a=$o(a),a!==null)if(l=Fi(a),l===null)a=null;else if(p=l.tag,p===13){if(a=ed(l),a!==null)return a;a=null}else if(p===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null);return $u=a,null}function em(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(fy()){case td:return 1;case Vh:return 4;case xl:case zh:return 16;case nd:return 536870912;default:return 16}default:return 16}}var nn=null,Al=null,Uo=null;function ld(){if(Uo)return Uo;var a,l=Al,p=l.length,v,S="value"in nn?nn.value:nn.textContent,x=S.length;for(a=0;a<p&&l[a]===S[a];a++);var P=p-a;for(v=1;v<=P&&l[p-v]===S[x-v];v++);return Uo=S.slice(a,1<v?1-v:void 0)}function Ss(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function cr(){return!0}function ud(){return!1}function Er(a){function l(p,v,S,x,P){this._reactName=p,this._targetInst=S,this.type=v,this.nativeEvent=x,this.target=P,this.currentTarget=null;for(var W in a)a.hasOwnProperty(W)&&(p=a[W],this[W]=p?p(x):x[W]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?cr:ud,this.isPropagationStopped=ud,this}return V(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=cr)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=cr)},persist:function(){},isPersistent:cr}),l}var Ri={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wu=Er(Ri),Es=V({},Ri,{view:0,detail:0}),tm=Er(Es),fr,cd,Wn,Gu=V({},Es,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:md,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Wn&&(Wn&&a.type==="mousemove"?(fr=a.screenX-Wn.screenX,cd=a.screenY-Wn.screenY):cd=fr=0,Wn=a),fr)},movementY:function(a){return"movementY"in a?a.movementY:cd}}),fd=Er(Gu),za=V({},Gu,{dataTransfer:0}),Ku=Er(za),dd=V({},Es,{relatedTarget:0}),qt=Er(dd),$a=V({},Ri,{animationName:0,elapsedTime:0,pseudoElement:0}),pd=Er($a),wy=V({},Ri,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),hd=Er(wy),by=V({},Ri,{data:0}),nm=Er(by),Dy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rm={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Qu={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ts(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=Qu[a])?!!l[a]:!1}function md(){return Ts}var om=V({},Es,{key:function(a){if(a.key){var l=Dy[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=Ss(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?rm[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:md,charCode:function(a){return a.type==="keypress"?Ss(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Ss(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),am=Er(om),gd=V({},Gu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zu=Er(gd),im=V({},Es,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:md}),Sy=Er(im),vd=V({},Ri,{propertyName:0,elapsedTime:0,pseudoElement:0}),yd=Er(vd),Ey=V({},Gu,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),sm=Er(Ey),_r=[9,13,27,32],Ol=c&&"CompositionEvent"in window,fa=null;c&&"documentMode"in document&&(fa=document.documentMode);var lm=c&&"TextEvent"in window&&!fa,wd=c&&(!Ol||fa&&8<fa&&11>=fa),um=" ",cm=!1;function fm(a,l){switch(a){case"keyup":return _r.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dm(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Cs=!1;function xs(a,l){switch(a){case"compositionend":return dm(l);case"keypress":return l.which!==32?null:(cm=!0,um);case"textInput":return a=l.data,a===um&&cm?null:a;default:return null}}function Ty(a,l){if(Cs)return a==="compositionend"||!Ol&&fm(a,l)?(a=ld(),Uo=Al=nn=null,Cs=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return wd&&l.locale!=="ko"?null:l.data;default:return null}}var Cy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ju(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!Cy[a.type]:l==="textarea"}function bd(a,l,p,v){He(v),l=sc(l,"onChange"),0<l.length&&(p=new Wu("onChange","change",null,p,v),a.push({event:p,listeners:l}))}var Xr=null,qa=null;function xy(a){wm(a,0)}function Xu(a){var l=St(a);if(Ke(l))return a}function My(a,l){if(a==="change")return l}var Li=!1;if(c){var Pr;if(c){var ec="oninput"in document;if(!ec){var pm=document.createElement("div");pm.setAttribute("oninput","return;"),ec=typeof pm.oninput=="function"}Pr=ec}else Pr=!1;Li=Pr&&(!document.documentMode||9<document.documentMode)}function hm(){Xr&&(Xr.detachEvent("onpropertychange",mm),qa=Xr=null)}function mm(a){if(a.propertyName==="value"&&Xu(qa)){var l=[];bd(l,qa,a,te(a)),Zr(xy,l)}}function ky(a,l,p){a==="focusin"?(hm(),Xr=l,qa=p,Xr.attachEvent("onpropertychange",mm)):a==="focusout"&&hm()}function Ny(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Xu(qa)}function Ms(a,l){if(a==="click")return Xu(l)}function oe(a,l){if(a==="input"||a==="change")return Xu(l)}function Te(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var me=typeof Object.is=="function"?Object.is:Te;function qe(a,l){if(me(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var p=Object.keys(a),v=Object.keys(l);if(p.length!==v.length)return!1;for(v=0;v<p.length;v++){var S=p[v];if(!d.call(l,S)||!me(a[S],l[S]))return!1}return!0}function bt(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Ot(a,l){var p=bt(a);a=0;for(var v;p;){if(p.nodeType===3){if(v=a+p.textContent.length,a<=l&&v>=l)return{node:p,offset:l-a};a=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=bt(p)}}function wn(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?wn(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function zt(){for(var a=window,l=Xe();l instanceof a.HTMLIFrameElement;){try{var p=typeof l.contentWindow.location.href=="string"}catch{p=!1}if(p)a=l.contentWindow;else break;l=Xe(a.document)}return l}function Rl(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function Fy(a){var l=zt(),p=a.focusedElem,v=a.selectionRange;if(l!==p&&p&&p.ownerDocument&&wn(p.ownerDocument.documentElement,p)){if(v!==null&&Rl(p)){if(l=v.start,a=v.end,a===void 0&&(a=l),"selectionStart"in p)p.selectionStart=l,p.selectionEnd=Math.min(a,p.value.length);else if(a=(l=p.ownerDocument||document)&&l.defaultView||window,a.getSelection){a=a.getSelection();var S=p.textContent.length,x=Math.min(v.start,S);v=v.end===void 0?x:Math.min(v.end,S),!a.extend&&x>v&&(S=v,v=x,x=S),S=Ot(p,x);var P=Ot(p,v);S&&P&&(a.rangeCount!==1||a.anchorNode!==S.node||a.anchorOffset!==S.offset||a.focusNode!==P.node||a.focusOffset!==P.offset)&&(l=l.createRange(),l.setStart(S.node,S.offset),a.removeAllRanges(),x>v?(a.addRange(l),a.extend(P.node,P.offset)):(l.setEnd(P.node,P.offset),a.addRange(l)))}}for(l=[],a=p;a=a.parentNode;)a.nodeType===1&&l.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<l.length;p++)a=l[p],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var eo=c&&"documentMode"in document&&11>=document.documentMode,da=null,Dd=null,Vo=null,ks=!1;function Ll(a,l,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;ks||da==null||da!==Xe(v)||(v=da,"selectionStart"in v&&Rl(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Vo&&qe(Vo,v)||(Vo=v,v=sc(Dd,"onSelect"),0<v.length&&(l=new Wu("onSelect","select",null,l,p),a.push({event:l,listeners:v}),l.target=da)))}function Rt(a,l){var p={};return p[a.toLowerCase()]=l.toLowerCase(),p["Webkit"+a]="webkit"+l,p["Moz"+a]="moz"+l,p}var Ns={animationend:Rt("Animation","AnimationEnd"),animationiteration:Rt("Animation","AnimationIteration"),animationstart:Rt("Animation","AnimationStart"),transitionend:Rt("Transition","TransitionEnd")},tc={},_l={};c&&(_l=document.createElement("div").style,"AnimationEvent"in window||(delete Ns.animationend.animation,delete Ns.animationiteration.animation,delete Ns.animationstart.animation),"TransitionEvent"in window||delete Ns.transitionend.transition);function nc(a){if(tc[a])return tc[a];if(!Ns[a])return a;var l=Ns[a],p;for(p in l)if(l.hasOwnProperty(p)&&p in _l)return tc[a]=l[p];return a}var gm=nc("animationend"),vm=nc("animationiteration"),Pl=nc("animationstart"),pa=nc("transitionend"),jl=new Map,Sd="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Eo(a,l){jl.set(a,l),i(l,[a])}for(var rc=0;rc<Sd.length;rc++){var oc=Sd[rc],ac=oc.toLowerCase(),ym=oc[0].toUpperCase()+oc.slice(1);Eo(ac,"on"+ym)}Eo(gm,"onAnimationEnd"),Eo(vm,"onAnimationIteration"),Eo(Pl,"onAnimationStart"),Eo("dblclick","onDoubleClick"),Eo("focusin","onFocus"),Eo("focusout","onBlur"),Eo(pa,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ha="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),_i=new Set("cancel close invalid load scroll toggle".split(" ").concat(ha));function Bl(a,l,p){var v=a.type||"unknown-event";a.currentTarget=p,ly(v,l,void 0,a),a.currentTarget=null}function wm(a,l){l=(l&4)!==0;for(var p=0;p<a.length;p++){var v=a[p],S=v.event;v=v.listeners;e:{var x=void 0;if(l)for(var P=v.length-1;0<=P;P--){var W=v[P],X=W.instance,ve=W.currentTarget;if(W=W.listener,X!==x&&S.isPropagationStopped())break e;Bl(S,W,ve),x=X}else for(P=0;P<v.length;P++){if(W=v[P],X=W.instance,ve=W.currentTarget,W=W.listener,X!==x&&S.isPropagationStopped())break e;Bl(S,W,ve),x=X}}}if(bo)throw a=Do,bo=!1,Do=null,a}function Kt(a,l){var p=l[cc];p===void 0&&(p=l[cc]=new Set);var v=a+"__bubble";p.has(v)||(ic(l,a,2,!1),p.add(v))}function Ed(a,l,p){var v=0;l&&(v|=4),ic(p,a,v,l)}var Pi="_reactListening"+Math.random().toString(36).slice(2);function Wa(a){if(!a[Pi]){a[Pi]=!0,r.forEach(function(p){p!=="selectionchange"&&(_i.has(p)||Ed(p,!1,a),Ed(p,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[Pi]||(l[Pi]=!0,Ed("selectionchange",!1,l))}}function ic(a,l,p,v){switch(em(l)){case 1:var S=vy;break;case 4:S=yy;break;default:S=sd}p=S.bind(null,l,p,a),S=void 0,!ur||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(S=!0),v?S!==void 0?a.addEventListener(l,p,{capture:!0,passive:S}):a.addEventListener(l,p,!0):S!==void 0?a.addEventListener(l,p,{passive:S}):a.addEventListener(l,p,!1)}function Td(a,l,p,v,S){var x=v;if(!(l&1)&&!(l&2)&&v!==null)e:for(;;){if(v===null)return;var P=v.tag;if(P===3||P===4){var W=v.stateNode.containerInfo;if(W===S||W.nodeType===8&&W.parentNode===S)break;if(P===4)for(P=v.return;P!==null;){var X=P.tag;if((X===3||X===4)&&(X=P.stateNode.containerInfo,X===S||X.nodeType===8&&X.parentNode===S))return;P=P.return}for(;W!==null;){if(P=$o(W),P===null)return;if(X=P.tag,X===5||X===6){v=x=P;continue e}W=W.parentNode}}v=v.return}Zr(function(){var ve=x,Ae=te(p),_e=[];e:{var Ie=jl.get(a);if(Ie!==void 0){var We=Wu,Je=a;switch(a){case"keypress":if(Ss(p)===0)break e;case"keydown":case"keyup":We=am;break;case"focusin":Je="focus",We=qt;break;case"focusout":Je="blur",We=qt;break;case"beforeblur":case"afterblur":We=qt;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":We=fd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":We=Ku;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":We=Sy;break;case gm:case vm:case Pl:We=pd;break;case pa:We=yd;break;case"scroll":We=tm;break;case"wheel":We=sm;break;case"copy":case"cut":case"paste":We=hd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":We=Zu}var et=(l&4)!==0,gn=!et&&a==="scroll",ce=et?Ie!==null?Ie+"Capture":null:Ie;et=[];for(var ne=ve,de;ne!==null;){de=ne;var Pe=de.stateNode;if(de.tag===5&&Pe!==null&&(de=Pe,ce!==null&&(Pe=Mn(ne,ce),Pe!=null&&et.push(Fs(ne,Pe,de)))),gn)break;ne=ne.return}0<et.length&&(Ie=new We(Ie,Je,null,p,Ae),_e.push({event:Ie,listeners:et}))}}if(!(l&7)){e:{if(Ie=a==="mouseover"||a==="pointerover",We=a==="mouseout"||a==="pointerout",Ie&&p!==U&&(Je=p.relatedTarget||p.fromElement)&&($o(Je)||Je[jr]))break e;if((We||Ie)&&(Ie=Ae.window===Ae?Ae:(Ie=Ae.ownerDocument)?Ie.defaultView||Ie.parentWindow:window,We?(Je=p.relatedTarget||p.toElement,We=ve,Je=Je?$o(Je):null,Je!==null&&(gn=Fi(Je),Je!==gn||Je.tag!==5&&Je.tag!==6)&&(Je=null)):(We=null,Je=ve),We!==Je)){if(et=fd,Pe="onMouseLeave",ce="onMouseEnter",ne="mouse",(a==="pointerout"||a==="pointerover")&&(et=Zu,Pe="onPointerLeave",ce="onPointerEnter",ne="pointer"),gn=We==null?Ie:St(We),de=Je==null?Ie:St(Je),Ie=new et(Pe,ne+"leave",We,p,Ae),Ie.target=gn,Ie.relatedTarget=de,Pe=null,$o(Ae)===ve&&(et=new et(ce,ne+"enter",Je,p,Ae),et.target=de,et.relatedTarget=gn,Pe=et),gn=Pe,We&&Je)t:{for(et=We,ce=Je,ne=0,de=et;de;de=Is(de))ne++;for(de=0,Pe=ce;Pe;Pe=Is(Pe))de++;for(;0<ne-de;)et=Is(et),ne--;for(;0<de-ne;)ce=Is(ce),de--;for(;ne--;){if(et===ce||ce!==null&&et===ce.alternate)break t;et=Is(et),ce=Is(ce)}et=null}else et=null;We!==null&&bn(_e,Ie,We,et,!1),Je!==null&&gn!==null&&bn(_e,gn,Je,et,!0)}}e:{if(Ie=ve?St(ve):window,We=Ie.nodeName&&Ie.nodeName.toLowerCase(),We==="select"||We==="input"&&Ie.type==="file")var nt=My;else if(Ju(Ie))if(Li)nt=oe;else{nt=Ny;var lt=ky}else(We=Ie.nodeName)&&We.toLowerCase()==="input"&&(Ie.type==="checkbox"||Ie.type==="radio")&&(nt=Ms);if(nt&&(nt=nt(a,ve))){bd(_e,nt,p,Ae);break e}lt&&lt(a,Ie,ve),a==="focusout"&&(lt=Ie._wrapperState)&&lt.controlled&&Ie.type==="number"&&Yo(Ie,"number",Ie.value)}switch(lt=ve?St(ve):window,a){case"focusin":(Ju(lt)||lt.contentEditable==="true")&&(da=lt,Dd=ve,Vo=null);break;case"focusout":Vo=Dd=da=null;break;case"mousedown":ks=!0;break;case"contextmenu":case"mouseup":case"dragend":ks=!1,Ll(_e,p,Ae);break;case"selectionchange":if(eo)break;case"keydown":case"keyup":Ll(_e,p,Ae)}var ct;if(Ol)e:{switch(a){case"compositionstart":var wt="onCompositionStart";break e;case"compositionend":wt="onCompositionEnd";break e;case"compositionupdate":wt="onCompositionUpdate";break e}wt=void 0}else Cs?fm(a,p)&&(wt="onCompositionEnd"):a==="keydown"&&p.keyCode===229&&(wt="onCompositionStart");wt&&(wd&&p.locale!=="ko"&&(Cs||wt!=="onCompositionStart"?wt==="onCompositionEnd"&&Cs&&(ct=ld()):(nn=Ae,Al="value"in nn?nn.value:nn.textContent,Cs=!0)),lt=sc(ve,wt),0<lt.length&&(wt=new nm(wt,a,null,p,Ae),_e.push({event:wt,listeners:lt}),ct?wt.data=ct:(ct=dm(p),ct!==null&&(wt.data=ct)))),(ct=lm?xs(a,p):Ty(a,p))&&(ve=sc(ve,"onBeforeInput"),0<ve.length&&(Ae=new nm("onBeforeInput","beforeinput",null,p,Ae),_e.push({event:Ae,listeners:ve}),Ae.data=ct))}wm(_e,l)})}function Fs(a,l,p){return{instance:a,listener:l,currentTarget:p}}function sc(a,l){for(var p=l+"Capture",v=[];a!==null;){var S=a,x=S.stateNode;S.tag===5&&x!==null&&(S=x,x=Mn(a,p),x!=null&&v.unshift(Fs(a,x,S)),x=Mn(a,l),x!=null&&v.push(Fs(a,x,S))),a=a.return}return v}function Is(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function bn(a,l,p,v,S){for(var x=l._reactName,P=[];p!==null&&p!==v;){var W=p,X=W.alternate,ve=W.stateNode;if(X!==null&&X===v)break;W.tag===5&&ve!==null&&(W=ve,S?(X=Mn(p,x),X!=null&&P.unshift(Fs(p,X,W))):S||(X=Mn(p,x),X!=null&&P.push(Fs(p,X,W)))),p=p.return}P.length!==0&&a.push({event:l,listeners:P})}var Gn=/\r\n?/g,Iy=/\u0000|\uFFFD/g;function bm(a){return(typeof a=="string"?a:""+a).replace(Gn,`
`).replace(Iy,"")}function Yl(a,l,p){if(l=bm(l),bm(a)!==l&&p)throw Error(n(425))}function lc(){}var Hl=null,ji=null;function Ul(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Ga=typeof setTimeout=="function"?setTimeout:void 0,Vl=typeof clearTimeout=="function"?clearTimeout:void 0,As=typeof Promise=="function"?Promise:void 0,uc=typeof queueMicrotask=="function"?queueMicrotask:typeof As<"u"?function(a){return As.resolve(null).then(a).catch(Os)}:Ga;function Os(a){setTimeout(function(){throw a})}function Cd(a,l){var p=l,v=0;do{var S=p.nextSibling;if(a.removeChild(p),S&&S.nodeType===8)if(p=S.data,p==="/$"){if(v===0){a.removeChild(S),jt(l);return}v--}else p!=="$"&&p!=="$?"&&p!=="$!"||v++;p=S}while(p);jt(l)}function Ka(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return a}function Dm(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var p=a.data;if(p==="$"||p==="$!"||p==="$?"){if(l===0)return a;l--}else p==="/$"&&l++}a=a.previousSibling}return null}var Rs=Math.random().toString(36).slice(2),zo="__reactFiber$"+Rs,Qa="__reactProps$"+Rs,jr="__reactContainer$"+Rs,cc="__reactEvents$"+Rs,Y="__reactListeners$"+Rs,Ls="__reactHandles$"+Rs;function $o(a){var l=a[zo];if(l)return l;for(var p=a.parentNode;p;){if(l=p[jr]||p[zo]){if(p=l.alternate,l.child!==null||p!==null&&p.child!==null)for(a=Dm(a);a!==null;){if(p=a[zo])return p;a=Dm(a)}return l}a=p,p=a.parentNode}return null}function Kn(a){return a=a[zo]||a[jr],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function St(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function fc(a){return a[Qa]||null}var xd=[],_s=-1;function Tr(a){return{current:a}}function Qt(a){0>_s||(a.current=xd[_s],xd[_s]=null,_s--)}function Wt(a,l){_s++,xd[_s]=a.current,a.current=l}var Za={},Qn=Tr(Za),Cr=Tr(!1),dr=Za;function Ps(a,l){var p=a.type.contextTypes;if(!p)return Za;var v=a.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===l)return v.__reactInternalMemoizedMaskedChildContext;var S={},x;for(x in p)S[x]=l[x];return v&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=l,a.__reactInternalMemoizedMaskedChildContext=S),S}function xr(a){return a=a.childContextTypes,a!=null}function dc(){Qt(Cr),Qt(Qn)}function Sm(a,l,p){if(Qn.current!==Za)throw Error(n(168));Wt(Qn,l),Wt(Cr,p)}function Em(a,l,p){var v=a.stateNode;if(l=l.childContextTypes,typeof v.getChildContext!="function")return p;v=v.getChildContext();for(var S in v)if(!(S in l))throw Error(n(108,Ye(a)||"Unknown",S));return V({},p,v)}function to(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Za,dr=Qn.current,Wt(Qn,a),Wt(Cr,Cr.current),!0}function Tm(a,l,p){var v=a.stateNode;if(!v)throw Error(n(169));p?(a=Em(a,l,dr),v.__reactInternalMemoizedMergedChildContext=a,Qt(Cr),Qt(Qn),Wt(Qn,a)):Qt(Cr),Wt(Cr,p)}var ma=null,pc=!1,Md=!1;function Cm(a){ma===null?ma=[a]:ma.push(a)}function Bi(a){pc=!0,Cm(a)}function Ja(){if(!Md&&ma!==null){Md=!0;var a=0,l=Pt;try{var p=ma;for(Pt=1;a<p.length;a++){var v=p[a];do v=v(!0);while(v!==null)}ma=null,pc=!1}catch(S){throw ma!==null&&(ma=ma.slice(a+1)),Hh(td,Ja),S}finally{Pt=l,Md=!1}}return null}var js=[],Zn=0,hc=null,mc=0,no=[],ro=0,Yi=null,qo=1,Wo="";function Hi(a,l){js[Zn++]=mc,js[Zn++]=hc,hc=a,mc=l}function xm(a,l,p){no[ro++]=qo,no[ro++]=Wo,no[ro++]=Yi,Yi=a;var v=qo;a=Wo;var S=32-So(v)-1;v&=~(1<<S),p+=1;var x=32-So(l)+S;if(30<x){var P=S-S%5;x=(v&(1<<P)-1).toString(32),v>>=P,S-=P,qo=1<<32-So(l)+S|p<<S|v,Wo=x+a}else qo=1<<x|p<<S|v,Wo=a}function zl(a){a.return!==null&&(Hi(a,1),xm(a,1,0))}function Ui(a){for(;a===hc;)hc=js[--Zn],js[Zn]=null,mc=js[--Zn],js[Zn]=null;for(;a===Yi;)Yi=no[--ro],no[ro]=null,Wo=no[--ro],no[ro]=null,qo=no[--ro],no[ro]=null}var Jn=null,Br=null,Zt=!1,To=null;function Go(a,l){var p=zr(5,null,null,0);p.elementType="DELETED",p.stateNode=l,p.return=a,l=a.deletions,l===null?(a.deletions=[p],a.flags|=16):l.push(p)}function gc(a,l){switch(a.tag){case 5:var p=a.type;return l=l.nodeType!==1||p.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(a.stateNode=l,Jn=a,Br=Ka(l.firstChild),!0):!1;case 6:return l=a.pendingProps===""||l.nodeType!==3?null:l,l!==null?(a.stateNode=l,Jn=a,Br=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(p=Yi!==null?{id:qo,overflow:Wo}:null,a.memoizedState={dehydrated:l,treeContext:p,retryLane:1073741824},p=zr(18,null,null,0),p.stateNode=l,p.return=a,a.child=p,Jn=a,Br=null,!0):!1;default:return!1}}function ga(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Mr(a){if(Zt){var l=Br;if(l){var p=l;if(!gc(a,l)){if(ga(a))throw Error(n(418));l=Ka(p.nextSibling);var v=Jn;l&&gc(a,l)?Go(v,p):(a.flags=a.flags&-4097|2,Zt=!1,Jn=a)}}else{if(ga(a))throw Error(n(418));a.flags=a.flags&-4097|2,Zt=!1,Jn=a}}}function Mm(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;Jn=a}function $l(a){if(a!==Jn)return!1;if(!Zt)return Mm(a),Zt=!0,!1;var l;if((l=a.tag!==3)&&!(l=a.tag!==5)&&(l=a.type,l=l!=="head"&&l!=="body"&&!Ul(a.type,a.memoizedProps)),l&&(l=Br)){if(ga(a))throw kd(),Error(n(418));for(;l;)Go(a,l),l=Ka(l.nextSibling)}if(Mm(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8){var p=a.data;if(p==="/$"){if(l===0){Br=Ka(a.nextSibling);break e}l--}else p!=="$"&&p!=="$!"&&p!=="$?"||l++}a=a.nextSibling}Br=null}}else Br=Jn?Ka(a.stateNode.nextSibling):null;return!0}function kd(){for(var a=Br;a;)a=Ka(a.nextSibling)}function Ko(){Br=Jn=null,Zt=!1}function Qo(a){To===null?To=[a]:To.push(a)}var km=F.ReactCurrentBatchConfig;function Co(a,l){if(a&&a.defaultProps){l=V({},l),a=a.defaultProps;for(var p in a)l[p]===void 0&&(l[p]=a[p]);return l}return l}var Vi=Tr(null),vc=null,zi=null,kn=null;function ql(){kn=zi=vc=null}function yc(a){var l=Vi.current;Qt(Vi),a._currentValue=l}function oo(a,l,p){for(;a!==null;){var v=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,v!==null&&(v.childLanes|=l)):v!==null&&(v.childLanes&l)!==l&&(v.childLanes|=l),a===p)break;a=a.return}}function Xa(a,l){vc=a,kn=zi=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&l&&(tr=!0),a.firstContext=null)}function pr(a){var l=a._currentValue;if(kn!==a)if(a={context:a,memoizedValue:l,next:null},zi===null){if(vc===null)throw Error(n(308));zi=a,vc.dependencies={lanes:0,firstContext:a}}else zi=zi.next=a;return l}var Yr=null;function wc(a){Yr===null?Yr=[a]:Yr.push(a)}function Xn(a,l,p,v){var S=l.interleaved;return S===null?(p.next=p,wc(l)):(p.next=S.next,S.next=p),l.interleaved=p,xo(a,v)}function xo(a,l){a.lanes|=l;var p=a.alternate;for(p!==null&&(p.lanes|=l),p=a,a=a.return;a!==null;)a.childLanes|=l,p=a.alternate,p!==null&&(p.childLanes|=l),p=a,a=a.return;return p.tag===3?p.stateNode:null}var ei=!1;function Nd(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nm(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Mo(a,l){return{eventTime:a,lane:l,tag:0,payload:null,callback:null,next:null}}function ti(a,l,p){var v=a.updateQueue;if(v===null)return null;if(v=v.shared,It&2){var S=v.pending;return S===null?l.next=l:(l.next=S.next,S.next=l),v.pending=l,xo(a,p)}return S=v.interleaved,S===null?(l.next=l,wc(v)):(l.next=S.next,S.next=l),v.interleaved=l,xo(a,p)}function ni(a,l,p){if(l=l.updateQueue,l!==null&&(l=l.shared,(p&4194240)!==0)){var v=l.lanes;v&=a.pendingLanes,p|=v,l.lanes=p,Nl(a,p)}}function Fd(a,l){var p=a.updateQueue,v=a.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var S=null,x=null;if(p=p.firstBaseUpdate,p!==null){do{var P={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};x===null?S=x=P:x=x.next=P,p=p.next}while(p!==null);x===null?S=x=l:x=x.next=l}else S=x=l;p={baseState:v.baseState,firstBaseUpdate:S,lastBaseUpdate:x,shared:v.shared,effects:v.effects},a.updateQueue=p;return}a=p.lastBaseUpdate,a===null?p.firstBaseUpdate=l:a.next=l,p.lastBaseUpdate=l}function bc(a,l,p,v){var S=a.updateQueue;ei=!1;var x=S.firstBaseUpdate,P=S.lastBaseUpdate,W=S.shared.pending;if(W!==null){S.shared.pending=null;var X=W,ve=X.next;X.next=null,P===null?x=ve:P.next=ve,P=X;var Ae=a.alternate;Ae!==null&&(Ae=Ae.updateQueue,W=Ae.lastBaseUpdate,W!==P&&(W===null?Ae.firstBaseUpdate=ve:W.next=ve,Ae.lastBaseUpdate=X))}if(x!==null){var _e=S.baseState;P=0,Ae=ve=X=null,W=x;do{var Ie=W.lane,We=W.eventTime;if((v&Ie)===Ie){Ae!==null&&(Ae=Ae.next={eventTime:We,lane:0,tag:W.tag,payload:W.payload,callback:W.callback,next:null});e:{var Je=a,et=W;switch(Ie=l,We=p,et.tag){case 1:if(Je=et.payload,typeof Je=="function"){_e=Je.call(We,_e,Ie);break e}_e=Je;break e;case 3:Je.flags=Je.flags&-65537|128;case 0:if(Je=et.payload,Ie=typeof Je=="function"?Je.call(We,_e,Ie):Je,Ie==null)break e;_e=V({},_e,Ie);break e;case 2:ei=!0}}W.callback!==null&&W.lane!==0&&(a.flags|=64,Ie=S.effects,Ie===null?S.effects=[W]:Ie.push(W))}else We={eventTime:We,lane:Ie,tag:W.tag,payload:W.payload,callback:W.callback,next:null},Ae===null?(ve=Ae=We,X=_e):Ae=Ae.next=We,P|=Ie;if(W=W.next,W===null){if(W=S.shared.pending,W===null)break;Ie=W,W=Ie.next,Ie.next=null,S.lastBaseUpdate=Ie,S.shared.pending=null}}while(!0);if(Ae===null&&(X=_e),S.baseState=X,S.firstBaseUpdate=ve,S.lastBaseUpdate=Ae,l=S.shared.interleaved,l!==null){S=l;do P|=S.lane,S=S.next;while(S!==l)}else x===null&&(S.shared.lanes=0);ui|=P,a.lanes=P,a.memoizedState=_e}}function Fm(a,l,p){if(a=l.effects,l.effects=null,a!==null)for(l=0;l<a.length;l++){var v=a[l],S=v.callback;if(S!==null){if(v.callback=null,v=p,typeof S!="function")throw Error(n(191,S));S.call(v)}}}var Bs=new e.Component().refs;function Id(a,l,p,v){l=a.memoizedState,p=p(v,l),p=p==null?l:V({},l,p),a.memoizedState=p,a.lanes===0&&(a.updateQueue.baseState=p)}var Dc={isMounted:function(a){return(a=a._reactInternals)?Fi(a)===a:!1},enqueueSetState:function(a,l,p){a=a._reactInternals;var v=gr(),S=fi(a),x=Mo(v,S);x.payload=l,p!=null&&(x.callback=p),l=ti(a,x,S),l!==null&&(Io(l,a,S,v),ni(l,a,S))},enqueueReplaceState:function(a,l,p){a=a._reactInternals;var v=gr(),S=fi(a),x=Mo(v,S);x.tag=1,x.payload=l,p!=null&&(x.callback=p),l=ti(a,x,S),l!==null&&(Io(l,a,S,v),ni(l,a,S))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var p=gr(),v=fi(a),S=Mo(p,v);S.tag=2,l!=null&&(S.callback=l),l=ti(a,S,v),l!==null&&(Io(l,a,v,p),ni(l,a,v))}};function Sc(a,l,p,v,S,x,P){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(v,x,P):l.prototype&&l.prototype.isPureReactComponent?!qe(p,v)||!qe(S,x):!0}function Ad(a,l,p){var v=!1,S=Za,x=l.contextType;return typeof x=="object"&&x!==null?x=pr(x):(S=xr(l)?dr:Qn.current,v=l.contextTypes,x=(v=v!=null)?Ps(a,S):Za),l=new l(p,x),a.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Dc,a.stateNode=l,l._reactInternals=a,v&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=S,a.__reactInternalMemoizedMaskedChildContext=x),l}function Im(a,l,p,v){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(p,v),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(p,v),l.state!==a&&Dc.enqueueReplaceState(l,l.state,null)}function Od(a,l,p,v){var S=a.stateNode;S.props=p,S.state=a.memoizedState,S.refs=Bs,Nd(a);var x=l.contextType;typeof x=="object"&&x!==null?S.context=pr(x):(x=xr(l)?dr:Qn.current,S.context=Ps(a,x)),S.state=a.memoizedState,x=l.getDerivedStateFromProps,typeof x=="function"&&(Id(a,l,x,p),S.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(l=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),l!==S.state&&Dc.enqueueReplaceState(S,S.state,null),bc(a,p,S,v),S.state=a.memoizedState),typeof S.componentDidMount=="function"&&(a.flags|=4194308)}function Wl(a,l,p){if(a=p.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(n(309));var v=p.stateNode}if(!v)throw Error(n(147,a));var S=v,x=""+a;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===x?l.ref:(l=function(P){var W=S.refs;W===Bs&&(W=S.refs={}),P===null?delete W[x]:W[x]=P},l._stringRef=x,l)}if(typeof a!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,a))}return a}function Gl(a,l){throw a=Object.prototype.toString.call(l),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a))}function Ec(a){var l=a._init;return l(a._payload)}function Am(a){function l(ce,ne){if(a){var de=ce.deletions;de===null?(ce.deletions=[ne],ce.flags|=16):de.push(ne)}}function p(ce,ne){if(!a)return null;for(;ne!==null;)l(ce,ne),ne=ne.sibling;return null}function v(ce,ne){for(ce=new Map;ne!==null;)ne.key!==null?ce.set(ne.key,ne):ce.set(ne.index,ne),ne=ne.sibling;return ce}function S(ce,ne){return ce=hi(ce,ne),ce.index=0,ce.sibling=null,ce}function x(ce,ne,de){return ce.index=de,a?(de=ce.alternate,de!==null?(de=de.index,de<ne?(ce.flags|=2,ne):de):(ce.flags|=2,ne)):(ce.flags|=1048576,ne)}function P(ce){return a&&ce.alternate===null&&(ce.flags|=2),ce}function W(ce,ne,de,Pe){return ne===null||ne.tag!==6?(ne=gp(de,ce.mode,Pe),ne.return=ce,ne):(ne=S(ne,de),ne.return=ce,ne)}function X(ce,ne,de,Pe){var nt=de.type;return nt===j?Ae(ce,ne,de.props.children,Pe,de.key):ne!==null&&(ne.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===fe&&Ec(nt)===ne.type)?(Pe=S(ne,de.props),Pe.ref=Wl(ce,ne,de),Pe.return=ce,Pe):(Pe=Jc(de.type,de.key,de.props,null,ce.mode,Pe),Pe.ref=Wl(ce,ne,de),Pe.return=ce,Pe)}function ve(ce,ne,de,Pe){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==de.containerInfo||ne.stateNode.implementation!==de.implementation?(ne=vp(de,ce.mode,Pe),ne.return=ce,ne):(ne=S(ne,de.children||[]),ne.return=ce,ne)}function Ae(ce,ne,de,Pe,nt){return ne===null||ne.tag!==7?(ne=Zi(de,ce.mode,Pe,nt),ne.return=ce,ne):(ne=S(ne,de),ne.return=ce,ne)}function _e(ce,ne,de){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=gp(""+ne,ce.mode,de),ne.return=ce,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case _:return de=Jc(ne.type,ne.key,ne.props,null,ce.mode,de),de.ref=Wl(ce,null,ne),de.return=ce,de;case R:return ne=vp(ne,ce.mode,de),ne.return=ce,ne;case fe:var Pe=ne._init;return _e(ce,Pe(ne._payload),de)}if(cn(ne)||be(ne))return ne=Zi(ne,ce.mode,de,null),ne.return=ce,ne;Gl(ce,ne)}return null}function Ie(ce,ne,de,Pe){var nt=ne!==null?ne.key:null;if(typeof de=="string"&&de!==""||typeof de=="number")return nt!==null?null:W(ce,ne,""+de,Pe);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case _:return de.key===nt?X(ce,ne,de,Pe):null;case R:return de.key===nt?ve(ce,ne,de,Pe):null;case fe:return nt=de._init,Ie(ce,ne,nt(de._payload),Pe)}if(cn(de)||be(de))return nt!==null?null:Ae(ce,ne,de,Pe,null);Gl(ce,de)}return null}function We(ce,ne,de,Pe,nt){if(typeof Pe=="string"&&Pe!==""||typeof Pe=="number")return ce=ce.get(de)||null,W(ne,ce,""+Pe,nt);if(typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case _:return ce=ce.get(Pe.key===null?de:Pe.key)||null,X(ne,ce,Pe,nt);case R:return ce=ce.get(Pe.key===null?de:Pe.key)||null,ve(ne,ce,Pe,nt);case fe:var lt=Pe._init;return We(ce,ne,de,lt(Pe._payload),nt)}if(cn(Pe)||be(Pe))return ce=ce.get(de)||null,Ae(ne,ce,Pe,nt,null);Gl(ne,Pe)}return null}function Je(ce,ne,de,Pe){for(var nt=null,lt=null,ct=ne,wt=ne=0,Pn=null;ct!==null&&wt<de.length;wt++){ct.index>wt?(Pn=ct,ct=null):Pn=ct.sibling;var Lt=Ie(ce,ct,de[wt],Pe);if(Lt===null){ct===null&&(ct=Pn);break}a&&ct&&Lt.alternate===null&&l(ce,ct),ne=x(Lt,ne,wt),lt===null?nt=Lt:lt.sibling=Lt,lt=Lt,ct=Pn}if(wt===de.length)return p(ce,ct),Zt&&Hi(ce,wt),nt;if(ct===null){for(;wt<de.length;wt++)ct=_e(ce,de[wt],Pe),ct!==null&&(ne=x(ct,ne,wt),lt===null?nt=ct:lt.sibling=ct,lt=ct);return Zt&&Hi(ce,wt),nt}for(ct=v(ce,ct);wt<de.length;wt++)Pn=We(ct,ce,wt,de[wt],Pe),Pn!==null&&(a&&Pn.alternate!==null&&ct.delete(Pn.key===null?wt:Pn.key),ne=x(Pn,ne,wt),lt===null?nt=Pn:lt.sibling=Pn,lt=Pn);return a&&ct.forEach(function(mi){return l(ce,mi)}),Zt&&Hi(ce,wt),nt}function et(ce,ne,de,Pe){var nt=be(de);if(typeof nt!="function")throw Error(n(150));if(de=nt.call(de),de==null)throw Error(n(151));for(var lt=nt=null,ct=ne,wt=ne=0,Pn=null,Lt=de.next();ct!==null&&!Lt.done;wt++,Lt=de.next()){ct.index>wt?(Pn=ct,ct=null):Pn=ct.sibling;var mi=Ie(ce,ct,Lt.value,Pe);if(mi===null){ct===null&&(ct=Pn);break}a&&ct&&mi.alternate===null&&l(ce,ct),ne=x(mi,ne,wt),lt===null?nt=mi:lt.sibling=mi,lt=mi,ct=Pn}if(Lt.done)return p(ce,ct),Zt&&Hi(ce,wt),nt;if(ct===null){for(;!Lt.done;wt++,Lt=de.next())Lt=_e(ce,Lt.value,Pe),Lt!==null&&(ne=x(Lt,ne,wt),lt===null?nt=Lt:lt.sibling=Lt,lt=Lt);return Zt&&Hi(ce,wt),nt}for(ct=v(ce,ct);!Lt.done;wt++,Lt=de.next())Lt=We(ct,ce,wt,Lt.value,Pe),Lt!==null&&(a&&Lt.alternate!==null&&ct.delete(Lt.key===null?wt:Lt.key),ne=x(Lt,ne,wt),lt===null?nt=Lt:lt.sibling=Lt,lt=Lt);return a&&ct.forEach(function(Zy){return l(ce,Zy)}),Zt&&Hi(ce,wt),nt}function gn(ce,ne,de,Pe){if(typeof de=="object"&&de!==null&&de.type===j&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case _:e:{for(var nt=de.key,lt=ne;lt!==null;){if(lt.key===nt){if(nt=de.type,nt===j){if(lt.tag===7){p(ce,lt.sibling),ne=S(lt,de.props.children),ne.return=ce,ce=ne;break e}}else if(lt.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===fe&&Ec(nt)===lt.type){p(ce,lt.sibling),ne=S(lt,de.props),ne.ref=Wl(ce,lt,de),ne.return=ce,ce=ne;break e}p(ce,lt);break}else l(ce,lt);lt=lt.sibling}de.type===j?(ne=Zi(de.props.children,ce.mode,Pe,de.key),ne.return=ce,ce=ne):(Pe=Jc(de.type,de.key,de.props,null,ce.mode,Pe),Pe.ref=Wl(ce,ne,de),Pe.return=ce,ce=Pe)}return P(ce);case R:e:{for(lt=de.key;ne!==null;){if(ne.key===lt)if(ne.tag===4&&ne.stateNode.containerInfo===de.containerInfo&&ne.stateNode.implementation===de.implementation){p(ce,ne.sibling),ne=S(ne,de.children||[]),ne.return=ce,ce=ne;break e}else{p(ce,ne);break}else l(ce,ne);ne=ne.sibling}ne=vp(de,ce.mode,Pe),ne.return=ce,ce=ne}return P(ce);case fe:return lt=de._init,gn(ce,ne,lt(de._payload),Pe)}if(cn(de))return Je(ce,ne,de,Pe);if(be(de))return et(ce,ne,de,Pe);Gl(ce,de)}return typeof de=="string"&&de!==""||typeof de=="number"?(de=""+de,ne!==null&&ne.tag===6?(p(ce,ne.sibling),ne=S(ne,de),ne.return=ce,ce=ne):(p(ce,ne),ne=gp(de,ce.mode,Pe),ne.return=ce,ce=ne),P(ce)):p(ce,ne)}return gn}var ri=Am(!0),Rd=Am(!1),Ys={},ko=Tr(Ys),oi=Tr(Ys),Kl=Tr(Ys);function ai(a){if(a===Ys)throw Error(n(174));return a}function Tc(a,l){switch(Wt(Kl,l),Wt(oi,a),Wt(ko,Ys),a=l.nodeType,a){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Qr(null,"");break;default:a=a===8?l.parentNode:l,l=a.namespaceURI||null,a=a.tagName,l=Qr(l,a)}Qt(ko),Wt(ko,l)}function Hs(){Qt(ko),Qt(oi),Qt(Kl)}function Ld(a){ai(Kl.current);var l=ai(ko.current),p=Qr(l,a.type);l!==p&&(Wt(oi,a),Wt(ko,p))}function _d(a){oi.current===a&&(Qt(ko),Qt(oi))}var Jt=Tr(0);function Ql(a){for(var l=a;l!==null;){if(l.tag===13){var p=l.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Zl=[];function Pd(){for(var a=0;a<Zl.length;a++)Zl[a]._workInProgressVersionPrimary=null;Zl.length=0}var Us=F.ReactCurrentDispatcher,Et=F.ReactCurrentBatchConfig,$i=0,on=null,an=null,Nn=null,Cc=!1,Jl=!1,er=0,Ay=0;function Fn(){throw Error(n(321))}function Xl(a,l){if(l===null)return!1;for(var p=0;p<l.length&&p<a.length;p++)if(!me(a[p],l[p]))return!1;return!0}function xc(a,l,p,v,S,x){if($i=x,on=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Us.current=a===null||a.memoizedState===null?tu:Ry,a=p(v,S),Jl){x=0;do{if(Jl=!1,er=0,25<=x)throw Error(n(301));x+=1,Nn=an=null,l.updateQueue=null,Us.current=Bm,a=p(v,S)}while(Jl)}if(Us.current=wa,l=an!==null&&an.next!==null,$i=0,Nn=an=on=null,Cc=!1,l)throw Error(n(300));return a}function Mc(){var a=er!==0;return er=0,a}function fn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?on.memoizedState=Nn=a:Nn=Nn.next=a,Nn}function In(){if(an===null){var a=on.alternate;a=a!==null?a.memoizedState:null}else a=an.next;var l=Nn===null?on.memoizedState:Nn.next;if(l!==null)Nn=l,an=a;else{if(a===null)throw Error(n(310));an=a,a={memoizedState:an.memoizedState,baseState:an.baseState,baseQueue:an.baseQueue,queue:an.queue,next:null},Nn===null?on.memoizedState=Nn=a:Nn=Nn.next=a}return Nn}function qi(a,l){return typeof l=="function"?l(a):l}function kc(a){var l=In(),p=l.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var v=an,S=v.baseQueue,x=p.pending;if(x!==null){if(S!==null){var P=S.next;S.next=x.next,x.next=P}v.baseQueue=S=x,p.pending=null}if(S!==null){x=S.next,v=v.baseState;var W=P=null,X=null,ve=x;do{var Ae=ve.lane;if(($i&Ae)===Ae)X!==null&&(X=X.next={lane:0,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null}),v=ve.hasEagerState?ve.eagerState:a(v,ve.action);else{var _e={lane:Ae,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null};X===null?(W=X=_e,P=v):X=X.next=_e,on.lanes|=Ae,ui|=Ae}ve=ve.next}while(ve!==null&&ve!==x);X===null?P=v:X.next=W,me(v,l.memoizedState)||(tr=!0),l.memoizedState=v,l.baseState=P,l.baseQueue=X,p.lastRenderedState=v}if(a=p.interleaved,a!==null){S=a;do x=S.lane,on.lanes|=x,ui|=x,S=S.next;while(S!==a)}else S===null&&(p.lanes=0);return[l.memoizedState,p.dispatch]}function Vs(a){var l=In(),p=l.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=a;var v=p.dispatch,S=p.pending,x=l.memoizedState;if(S!==null){p.pending=null;var P=S=S.next;do x=a(x,P.action),P=P.next;while(P!==S);me(x,l.memoizedState)||(tr=!0),l.memoizedState=x,l.baseQueue===null&&(l.baseState=x),p.lastRenderedState=x}return[x,v]}function jd(){}function Nc(a,l){var p=on,v=In(),S=l(),x=!me(v.memoizedState,S);if(x&&(v.memoizedState=S,tr=!0),v=v.queue,Hd(Ic.bind(null,p,v,a),[a]),v.getSnapshot!==l||x||Nn!==null&&Nn.memoizedState.tag&1){if(p.flags|=2048,zs(9,Fc.bind(null,p,v,S,l),void 0,null),_n===null)throw Error(n(349));$i&30||Bd(p,l,S)}return S}function Bd(a,l,p){a.flags|=16384,a={getSnapshot:l,value:p},l=on.updateQueue,l===null?(l={lastEffect:null,stores:null},on.updateQueue=l,l.stores=[a]):(p=l.stores,p===null?l.stores=[a]:p.push(a))}function Fc(a,l,p,v){l.value=p,l.getSnapshot=v,va(l)&&Om(a)}function Ic(a,l,p){return p(function(){va(l)&&Om(a)})}function va(a){var l=a.getSnapshot;a=a.value;try{var p=l();return!me(a,p)}catch{return!0}}function Om(a){var l=xo(a,1);l!==null&&Io(l,a,1,-1)}function ya(a){var l=fn();return typeof a=="function"&&(a=a()),l.memoizedState=l.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qi,lastRenderedState:a},l.queue=a,a=a.dispatch=Pm.bind(null,on,a),[l.memoizedState,a]}function zs(a,l,p,v){return a={tag:a,create:l,destroy:p,deps:v,next:null},l=on.updateQueue,l===null?(l={lastEffect:null,stores:null},on.updateQueue=l,l.lastEffect=a.next=a):(p=l.lastEffect,p===null?l.lastEffect=a.next=a:(v=p.next,p.next=a,a.next=v,l.lastEffect=a)),a}function Yd(){return In().memoizedState}function $s(a,l,p,v){var S=fn();on.flags|=a,S.memoizedState=zs(1|l,p,void 0,v===void 0?null:v)}function Ac(a,l,p,v){var S=In();v=v===void 0?null:v;var x=void 0;if(an!==null){var P=an.memoizedState;if(x=P.destroy,v!==null&&Xl(v,P.deps)){S.memoizedState=zs(l,p,x,v);return}}on.flags|=a,S.memoizedState=zs(1|l,p,x,v)}function Rm(a,l){return $s(8390656,8,a,l)}function Hd(a,l){return Ac(2048,8,a,l)}function Ud(a,l){return Ac(4,2,a,l)}function Vd(a,l){return Ac(4,4,a,l)}function Lm(a,l){if(typeof l=="function")return a=a(),l(a),function(){l(null)};if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function zd(a,l,p){return p=p!=null?p.concat([a]):null,Ac(4,4,Lm.bind(null,l,a),p)}function Oc(){}function hr(a,l){var p=In();l=l===void 0?null:l;var v=p.memoizedState;return v!==null&&l!==null&&Xl(l,v[1])?v[0]:(p.memoizedState=[a,l],a)}function No(a,l){var p=In();l=l===void 0?null:l;var v=p.memoizedState;return v!==null&&l!==null&&Xl(l,v[1])?v[0]:(a=a(),p.memoizedState=[a,l],a)}function _m(a,l,p){return $i&21?(me(p,l)||(p=rd(),on.lanes|=p,ui|=p,a.baseState=!0),l):(a.baseState&&(a.baseState=!1,tr=!0),a.memoizedState=p)}function Oy(a,l){var p=Pt;Pt=p!==0&&4>p?p:4,a(!0);var v=Et.transition;Et.transition={};try{a(!1),l()}finally{Pt=p,Et.transition=v}}function eu(){return In().memoizedState}function qs(a,l,p){var v=fi(a);if(p={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null},$d(a))jm(l,p);else if(p=Xn(a,l,p,v),p!==null){var S=gr();Io(p,a,v,S),qd(p,l,v)}}function Pm(a,l,p){var v=fi(a),S={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null};if($d(a))jm(l,S);else{var x=a.alternate;if(a.lanes===0&&(x===null||x.lanes===0)&&(x=l.lastRenderedReducer,x!==null))try{var P=l.lastRenderedState,W=x(P,p);if(S.hasEagerState=!0,S.eagerState=W,me(W,P)){var X=l.interleaved;X===null?(S.next=S,wc(l)):(S.next=X.next,X.next=S),l.interleaved=S;return}}catch{}p=Xn(a,l,S,v),p!==null&&(S=gr(),Io(p,a,v,S),qd(p,l,v))}}function $d(a){var l=a.alternate;return a===on||l!==null&&l===on}function jm(a,l){Jl=Cc=!0;var p=a.pending;p===null?l.next=l:(l.next=p.next,p.next=l),a.pending=l}function qd(a,l,p){if(p&4194240){var v=l.lanes;v&=a.pendingLanes,p|=v,l.lanes=p,Nl(a,p)}}var wa={readContext:pr,useCallback:Fn,useContext:Fn,useEffect:Fn,useImperativeHandle:Fn,useInsertionEffect:Fn,useLayoutEffect:Fn,useMemo:Fn,useReducer:Fn,useRef:Fn,useState:Fn,useDebugValue:Fn,useDeferredValue:Fn,useTransition:Fn,useMutableSource:Fn,useSyncExternalStore:Fn,useId:Fn,unstable_isNewReconciler:!1},tu={readContext:pr,useCallback:function(a,l){return fn().memoizedState=[a,l===void 0?null:l],a},useContext:pr,useEffect:Rm,useImperativeHandle:function(a,l,p){return p=p!=null?p.concat([a]):null,$s(4194308,4,Lm.bind(null,l,a),p)},useLayoutEffect:function(a,l){return $s(4194308,4,a,l)},useInsertionEffect:function(a,l){return $s(4,2,a,l)},useMemo:function(a,l){var p=fn();return l=l===void 0?null:l,a=a(),p.memoizedState=[a,l],a},useReducer:function(a,l,p){var v=fn();return l=p!==void 0?p(l):l,v.memoizedState=v.baseState=l,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:l},v.queue=a,a=a.dispatch=qs.bind(null,on,a),[v.memoizedState,a]},useRef:function(a){var l=fn();return a={current:a},l.memoizedState=a},useState:ya,useDebugValue:Oc,useDeferredValue:function(a){return fn().memoizedState=a},useTransition:function(){var a=ya(!1),l=a[0];return a=Oy.bind(null,a[1]),fn().memoizedState=a,[l,a]},useMutableSource:function(){},useSyncExternalStore:function(a,l,p){var v=on,S=fn();if(Zt){if(p===void 0)throw Error(n(407));p=p()}else{if(p=l(),_n===null)throw Error(n(349));$i&30||Bd(v,l,p)}S.memoizedState=p;var x={value:p,getSnapshot:l};return S.queue=x,Rm(Ic.bind(null,v,x,a),[a]),v.flags|=2048,zs(9,Fc.bind(null,v,x,p,l),void 0,null),p},useId:function(){var a=fn(),l=_n.identifierPrefix;if(Zt){var p=Wo,v=qo;p=(v&~(1<<32-So(v)-1)).toString(32)+p,l=":"+l+"R"+p,p=er++,0<p&&(l+="H"+p.toString(32)),l+=":"}else p=Ay++,l=":"+l+"r"+p.toString(32)+":";return a.memoizedState=l},unstable_isNewReconciler:!1},Ry={readContext:pr,useCallback:hr,useContext:pr,useEffect:Hd,useImperativeHandle:zd,useInsertionEffect:Ud,useLayoutEffect:Vd,useMemo:No,useReducer:kc,useRef:Yd,useState:function(){return kc(qi)},useDebugValue:Oc,useDeferredValue:function(a){var l=In();return _m(l,an.memoizedState,a)},useTransition:function(){var a=kc(qi)[0],l=In().memoizedState;return[a,l]},useMutableSource:jd,useSyncExternalStore:Nc,useId:eu,unstable_isNewReconciler:!1},Bm={readContext:pr,useCallback:hr,useContext:pr,useEffect:Hd,useImperativeHandle:zd,useInsertionEffect:Ud,useLayoutEffect:Vd,useMemo:No,useReducer:Vs,useRef:Yd,useState:function(){return Vs(qi)},useDebugValue:Oc,useDeferredValue:function(a){var l=In();return an===null?l.memoizedState=a:_m(l,an.memoizedState,a)},useTransition:function(){var a=Vs(qi)[0],l=In().memoizedState;return[a,l]},useMutableSource:jd,useSyncExternalStore:Nc,useId:eu,unstable_isNewReconciler:!1};function Wi(a,l){try{var p="",v=l;do p+=Se(v),v=v.return;while(v);var S=p}catch(x){S=`
Error generating stack: `+x.message+`
`+x.stack}return{value:a,source:l,stack:S,digest:null}}function Ws(a,l,p){return{value:a,source:null,stack:p??null,digest:l??null}}function Rc(a,l){try{console.error(l.value)}catch(p){setTimeout(function(){throw p})}}var Lc=typeof WeakMap=="function"?WeakMap:Map;function _c(a,l,p){p=Mo(-1,p),p.tag=3,p.payload={element:null};var v=l.value;return p.callback=function(){qc||(qc=!0,sp=v),Rc(a,l)},p}function nu(a,l,p){p=Mo(-1,p),p.tag=3;var v=a.type.getDerivedStateFromError;if(typeof v=="function"){var S=l.value;p.payload=function(){return v(S)},p.callback=function(){Rc(a,l)}}var x=a.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(p.callback=function(){Rc(a,l),typeof v!="function"&&(ci===null?ci=new Set([this]):ci.add(this));var P=l.stack;this.componentDidCatch(l.value,{componentStack:P!==null?P:""})}),p}function Ym(a,l,p){var v=a.pingCache;if(v===null){v=a.pingCache=new Lc;var S=new Set;v.set(l,S)}else S=v.get(l),S===void 0&&(S=new Set,v.set(l,S));S.has(p)||(S.add(p),a=Uy.bind(null,a,l,p),l.then(a,a))}function Wd(a){do{var l;if((l=a.tag===13)&&(l=a.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return a;a=a.return}while(a!==null);return null}function ru(a,l,p,v,S){return a.mode&1?(a.flags|=65536,a.lanes=S,a):(a===l?a.flags|=65536:(a.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(l=Mo(-1,1),l.tag=2,ti(p,l,1))),p.lanes|=1),a)}var Hm=F.ReactCurrentOwner,tr=!1;function mr(a,l,p,v){l.child=a===null?Rd(l,null,p,v):ri(l,a.child,p,v)}function Gd(a,l,p,v,S){p=p.render;var x=l.ref;return Xa(l,S),v=xc(a,l,p,v,x,S),p=Mc(),a!==null&&!tr?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~S,Xo(a,l,S)):(Zt&&p&&zl(l),l.flags|=1,mr(a,l,v,S),l.child)}function Zo(a,l,p,v,S){if(a===null){var x=p.type;return typeof x=="function"&&!mp(x)&&x.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(l.tag=15,l.type=x,Kd(a,l,x,v,S)):(a=Jc(p.type,null,v,l,l.mode,S),a.ref=l.ref,a.return=l,l.child=a)}if(x=a.child,!(a.lanes&S)){var P=x.memoizedProps;if(p=p.compare,p=p!==null?p:qe,p(P,v)&&a.ref===l.ref)return Xo(a,l,S)}return l.flags|=1,a=hi(x,v),a.ref=l.ref,a.return=l,l.child=a}function Kd(a,l,p,v,S){if(a!==null){var x=a.memoizedProps;if(qe(x,v)&&a.ref===l.ref)if(tr=!1,l.pendingProps=v=x,(a.lanes&S)!==0)a.flags&131072&&(tr=!0);else return l.lanes=a.lanes,Xo(a,l,S)}return Pc(a,l,p,v,S)}function Qd(a,l,p){var v=l.pendingProps,S=v.children,x=a!==null?a.memoizedState:null;if(v.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Wt(Js,Vr),Vr|=p;else{if(!(p&1073741824))return a=x!==null?x.baseLanes|p:p,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null,transitions:null},l.updateQueue=null,Wt(Js,Vr),Vr|=a,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},v=x!==null?x.baseLanes:p,Wt(Js,Vr),Vr|=v}else x!==null?(v=x.baseLanes|p,l.memoizedState=null):v=p,Wt(Js,Vr),Vr|=v;return mr(a,l,S,p),l.child}function Um(a,l){var p=l.ref;(a===null&&p!==null||a!==null&&a.ref!==p)&&(l.flags|=512,l.flags|=2097152)}function Pc(a,l,p,v,S){var x=xr(p)?dr:Qn.current;return x=Ps(l,x),Xa(l,S),p=xc(a,l,p,v,x,S),v=Mc(),a!==null&&!tr?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~S,Xo(a,l,S)):(Zt&&v&&zl(l),l.flags|=1,mr(a,l,p,S),l.child)}function Vm(a,l,p,v,S){if(xr(p)){var x=!0;to(l)}else x=!1;if(Xa(l,S),l.stateNode===null)Gs(a,l),Ad(l,p,v),Od(l,p,v,S),v=!0;else if(a===null){var P=l.stateNode,W=l.memoizedProps;P.props=W;var X=P.context,ve=p.contextType;typeof ve=="object"&&ve!==null?ve=pr(ve):(ve=xr(p)?dr:Qn.current,ve=Ps(l,ve));var Ae=p.getDerivedStateFromProps,_e=typeof Ae=="function"||typeof P.getSnapshotBeforeUpdate=="function";_e||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(W!==v||X!==ve)&&Im(l,P,v,ve),ei=!1;var Ie=l.memoizedState;P.state=Ie,bc(l,v,P,S),X=l.memoizedState,W!==v||Ie!==X||Cr.current||ei?(typeof Ae=="function"&&(Id(l,p,Ae,v),X=l.memoizedState),(W=ei||Sc(l,p,W,v,Ie,X,ve))?(_e||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount()),typeof P.componentDidMount=="function"&&(l.flags|=4194308)):(typeof P.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=v,l.memoizedState=X),P.props=v,P.state=X,P.context=ve,v=W):(typeof P.componentDidMount=="function"&&(l.flags|=4194308),v=!1)}else{P=l.stateNode,Nm(a,l),W=l.memoizedProps,ve=l.type===l.elementType?W:Co(l.type,W),P.props=ve,_e=l.pendingProps,Ie=P.context,X=p.contextType,typeof X=="object"&&X!==null?X=pr(X):(X=xr(p)?dr:Qn.current,X=Ps(l,X));var We=p.getDerivedStateFromProps;(Ae=typeof We=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(W!==_e||Ie!==X)&&Im(l,P,v,X),ei=!1,Ie=l.memoizedState,P.state=Ie,bc(l,v,P,S);var Je=l.memoizedState;W!==_e||Ie!==Je||Cr.current||ei?(typeof We=="function"&&(Id(l,p,We,v),Je=l.memoizedState),(ve=ei||Sc(l,p,ve,v,Ie,Je,X)||!1)?(Ae||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(v,Je,X),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(v,Je,X)),typeof P.componentDidUpdate=="function"&&(l.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof P.componentDidUpdate!="function"||W===a.memoizedProps&&Ie===a.memoizedState||(l.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||W===a.memoizedProps&&Ie===a.memoizedState||(l.flags|=1024),l.memoizedProps=v,l.memoizedState=Je),P.props=v,P.state=Je,P.context=X,v=ve):(typeof P.componentDidUpdate!="function"||W===a.memoizedProps&&Ie===a.memoizedState||(l.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||W===a.memoizedProps&&Ie===a.memoizedState||(l.flags|=1024),v=!1)}return Zd(a,l,p,v,x,S)}function Zd(a,l,p,v,S,x){Um(a,l);var P=(l.flags&128)!==0;if(!v&&!P)return S&&Tm(l,p,!1),Xo(a,l,x);v=l.stateNode,Hm.current=l;var W=P&&typeof p.getDerivedStateFromError!="function"?null:v.render();return l.flags|=1,a!==null&&P?(l.child=ri(l,a.child,null,x),l.child=ri(l,null,W,x)):mr(a,l,W,x),l.memoizedState=v.state,S&&Tm(l,p,!0),l.child}function Jo(a){var l=a.stateNode;l.pendingContext?Sm(a,l.pendingContext,l.pendingContext!==l.context):l.context&&Sm(a,l.context,!1),Tc(a,l.containerInfo)}function jc(a,l,p,v,S){return Ko(),Qo(S),l.flags|=256,mr(a,l,p,v),l.child}var ou={dehydrated:null,treeContext:null,retryLane:0};function au(a){return{baseLanes:a,cachePool:null,transitions:null}}function iu(a,l,p){var v=l.pendingProps,S=Jt.current,x=!1,P=(l.flags&128)!==0,W;if((W=P)||(W=a!==null&&a.memoizedState===null?!1:(S&2)!==0),W?(x=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(S|=1),Wt(Jt,S&1),a===null)return Mr(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(l.mode&1?a.data==="$!"?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(P=v.children,a=v.fallback,x?(v=l.mode,x=l.child,P={mode:"hidden",children:P},!(v&1)&&x!==null?(x.childLanes=0,x.pendingProps=P):x=Xc(P,v,0,null),a=Zi(a,v,p,null),x.return=l,a.return=l,x.sibling=a,l.child=x,l.child.memoizedState=au(p),l.memoizedState=ou,a):ii(l,P));if(S=a.memoizedState,S!==null&&(W=S.dehydrated,W!==null))return Bc(a,l,P,v,W,S,p);if(x){x=v.fallback,P=l.mode,S=a.child,W=S.sibling;var X={mode:"hidden",children:v.children};return!(P&1)&&l.child!==S?(v=l.child,v.childLanes=0,v.pendingProps=X,l.deletions=null):(v=hi(S,X),v.subtreeFlags=S.subtreeFlags&14680064),W!==null?x=hi(W,x):(x=Zi(x,P,p,null),x.flags|=2),x.return=l,v.return=l,v.sibling=x,l.child=v,v=x,x=l.child,P=a.child.memoizedState,P=P===null?au(p):{baseLanes:P.baseLanes|p,cachePool:null,transitions:P.transitions},x.memoizedState=P,x.childLanes=a.childLanes&~p,l.memoizedState=ou,v}return x=a.child,a=x.sibling,v=hi(x,{mode:"visible",children:v.children}),!(l.mode&1)&&(v.lanes=p),v.return=l,v.sibling=null,a!==null&&(p=l.deletions,p===null?(l.deletions=[a],l.flags|=16):p.push(a)),l.child=v,l.memoizedState=null,v}function ii(a,l){return l=Xc({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function st(a,l,p,v){return v!==null&&Qo(v),ri(l,a.child,null,p),a=ii(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function Bc(a,l,p,v,S,x,P){if(p)return l.flags&256?(l.flags&=-257,v=Ws(Error(n(422))),st(a,l,P,v)):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(x=v.fallback,S=l.mode,v=Xc({mode:"visible",children:v.children},S,0,null),x=Zi(x,S,P,null),x.flags|=2,v.return=l,x.return=l,v.sibling=x,l.child=v,l.mode&1&&ri(l,a.child,null,P),l.child.memoizedState=au(P),l.memoizedState=ou,x);if(!(l.mode&1))return st(a,l,P,null);if(S.data==="$!"){if(v=S.nextSibling&&S.nextSibling.dataset,v)var W=v.dgst;return v=W,x=Error(n(419)),v=Ws(x,v,void 0),st(a,l,P,v)}if(W=(P&a.childLanes)!==0,tr||W){if(v=_n,v!==null){switch(P&-P){case 4:S=2;break;case 16:S=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:S=32;break;case 536870912:S=268435456;break;default:S=0}S=S&(v.suspendedLanes|P)?0:S,S!==0&&S!==x.retryLane&&(x.retryLane=S,xo(a,S),Io(v,a,S,-1))}return pp(),v=Ws(Error(n(421))),st(a,l,P,v)}return S.data==="$?"?(l.flags|=128,l.child=a.child,l=Vy.bind(null,a),S._reactRetry=l,null):(a=x.treeContext,Br=Ka(S.nextSibling),Jn=l,Zt=!0,To=null,a!==null&&(no[ro++]=qo,no[ro++]=Wo,no[ro++]=Yi,qo=a.id,Wo=a.overflow,Yi=l),l=ii(l,v.children),l.flags|=4096,l)}function Yc(a,l,p){a.lanes|=l;var v=a.alternate;v!==null&&(v.lanes|=l),oo(a.return,l,p)}function ba(a,l,p,v,S){var x=a.memoizedState;x===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:v,tail:p,tailMode:S}:(x.isBackwards=l,x.rendering=null,x.renderingStartTime=0,x.last=v,x.tail=p,x.tailMode=S)}function zm(a,l,p){var v=l.pendingProps,S=v.revealOrder,x=v.tail;if(mr(a,l,v.children,p),v=Jt.current,v&2)v=v&1|2,l.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Yc(a,p,l);else if(a.tag===19)Yc(a,p,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}v&=1}if(Wt(Jt,v),!(l.mode&1))l.memoizedState=null;else switch(S){case"forwards":for(p=l.child,S=null;p!==null;)a=p.alternate,a!==null&&Ql(a)===null&&(S=p),p=p.sibling;p=S,p===null?(S=l.child,l.child=null):(S=p.sibling,p.sibling=null),ba(l,!1,S,p,x);break;case"backwards":for(p=null,S=l.child,l.child=null;S!==null;){if(a=S.alternate,a!==null&&Ql(a)===null){l.child=S;break}a=S.sibling,S.sibling=p,p=S,S=a}ba(l,!0,p,null,x);break;case"together":ba(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Gs(a,l){!(l.mode&1)&&a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2)}function Xo(a,l,p){if(a!==null&&(l.dependencies=a.dependencies),ui|=l.lanes,!(p&l.childLanes))return null;if(a!==null&&l.child!==a.child)throw Error(n(153));if(l.child!==null){for(a=l.child,p=hi(a,a.pendingProps),l.child=p,p.return=l;a.sibling!==null;)a=a.sibling,p=p.sibling=hi(a,a.pendingProps),p.return=l;p.sibling=null}return l.child}function nr(a,l,p){switch(l.tag){case 3:Jo(l),Ko();break;case 5:Ld(l);break;case 1:xr(l.type)&&to(l);break;case 4:Tc(l,l.stateNode.containerInfo);break;case 10:var v=l.type._context,S=l.memoizedProps.value;Wt(Vi,v._currentValue),v._currentValue=S;break;case 13:if(v=l.memoizedState,v!==null)return v.dehydrated!==null?(Wt(Jt,Jt.current&1),l.flags|=128,null):p&l.child.childLanes?iu(a,l,p):(Wt(Jt,Jt.current&1),a=Xo(a,l,p),a!==null?a.sibling:null);Wt(Jt,Jt.current&1);break;case 19:if(v=(p&l.childLanes)!==0,a.flags&128){if(v)return zm(a,l,p);l.flags|=128}if(S=l.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),Wt(Jt,Jt.current),v)break;return null;case 22:case 23:return l.lanes=0,Qd(a,l,p)}return Xo(a,l,p)}var $m,Jd,Xd,qm;$m=function(a,l){for(var p=l.child;p!==null;){if(p.tag===5||p.tag===6)a.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===l)break;for(;p.sibling===null;){if(p.return===null||p.return===l)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},Jd=function(){},Xd=function(a,l,p,v){var S=a.memoizedProps;if(S!==v){a=l.stateNode,ai(ko.current);var x=null;switch(p){case"input":S=Ge(a,S),v=Ge(a,v),x=[];break;case"select":S=V({},S,{value:void 0}),v=V({},v,{value:void 0}),x=[];break;case"textarea":S=br(a,S),v=br(a,v),x=[];break;default:typeof S.onClick!="function"&&typeof v.onClick=="function"&&(a.onclick=lc)}Pa(p,v);var P;p=null;for(ve in S)if(!v.hasOwnProperty(ve)&&S.hasOwnProperty(ve)&&S[ve]!=null)if(ve==="style"){var W=S[ve];for(P in W)W.hasOwnProperty(P)&&(p||(p={}),p[P]="")}else ve!=="dangerouslySetInnerHTML"&&ve!=="children"&&ve!=="suppressContentEditableWarning"&&ve!=="suppressHydrationWarning"&&ve!=="autoFocus"&&(o.hasOwnProperty(ve)?x||(x=[]):(x=x||[]).push(ve,null));for(ve in v){var X=v[ve];if(W=S!=null?S[ve]:void 0,v.hasOwnProperty(ve)&&X!==W&&(X!=null||W!=null))if(ve==="style")if(W){for(P in W)!W.hasOwnProperty(P)||X&&X.hasOwnProperty(P)||(p||(p={}),p[P]="");for(P in X)X.hasOwnProperty(P)&&W[P]!==X[P]&&(p||(p={}),p[P]=X[P])}else p||(x||(x=[]),x.push(ve,p)),p=X;else ve==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,W=W?W.__html:void 0,X!=null&&W!==X&&(x=x||[]).push(ve,X)):ve==="children"?typeof X!="string"&&typeof X!="number"||(x=x||[]).push(ve,""+X):ve!=="suppressContentEditableWarning"&&ve!=="suppressHydrationWarning"&&(o.hasOwnProperty(ve)?(X!=null&&ve==="onScroll"&&Kt("scroll",a),x||W===X||(x=[])):(x=x||[]).push(ve,X))}p&&(x=x||[]).push("style",p);var ve=x;(l.updateQueue=ve)&&(l.flags|=4)}},qm=function(a,l,p,v){p!==v&&(l.flags|=4)};function Ks(a,l){if(!Zt)switch(a.tailMode){case"hidden":l=a.tail;for(var p=null;l!==null;)l.alternate!==null&&(p=l),l=l.sibling;p===null?a.tail=null:p.sibling=null;break;case"collapsed":p=a.tail;for(var v=null;p!==null;)p.alternate!==null&&(v=p),p=p.sibling;v===null?l||a.tail===null?a.tail=null:a.tail.sibling=null:v.sibling=null}}function rr(a){var l=a.alternate!==null&&a.alternate.child===a.child,p=0,v=0;if(l)for(var S=a.child;S!==null;)p|=S.lanes|S.childLanes,v|=S.subtreeFlags&14680064,v|=S.flags&14680064,S.return=a,S=S.sibling;else for(S=a.child;S!==null;)p|=S.lanes|S.childLanes,v|=S.subtreeFlags,v|=S.flags,S.return=a,S=S.sibling;return a.subtreeFlags|=v,a.childLanes=p,l}function Ly(a,l,p){var v=l.pendingProps;switch(Ui(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rr(l),null;case 1:return xr(l.type)&&dc(),rr(l),null;case 3:return v=l.stateNode,Hs(),Qt(Cr),Qt(Qn),Pd(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(a===null||a.child===null)&&($l(l)?l.flags|=4:a===null||a.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,To!==null&&(cp(To),To=null))),Jd(a,l),rr(l),null;case 5:_d(l);var S=ai(Kl.current);if(p=l.type,a!==null&&l.stateNode!=null)Xd(a,l,p,v,S),a.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!v){if(l.stateNode===null)throw Error(n(166));return rr(l),null}if(a=ai(ko.current),$l(l)){v=l.stateNode,p=l.type;var x=l.memoizedProps;switch(v[zo]=l,v[Qa]=x,a=(l.mode&1)!==0,p){case"dialog":Kt("cancel",v),Kt("close",v);break;case"iframe":case"object":case"embed":Kt("load",v);break;case"video":case"audio":for(S=0;S<ha.length;S++)Kt(ha[S],v);break;case"source":Kt("error",v);break;case"img":case"image":case"link":Kt("error",v),Kt("load",v);break;case"details":Kt("toggle",v);break;case"input":tt(v,x),Kt("invalid",v);break;case"select":v._wrapperState={wasMultiple:!!x.multiple},Kt("invalid",v);break;case"textarea":Dr(v,x),Kt("invalid",v)}Pa(p,x),S=null;for(var P in x)if(x.hasOwnProperty(P)){var W=x[P];P==="children"?typeof W=="string"?v.textContent!==W&&(x.suppressHydrationWarning!==!0&&Yl(v.textContent,W,a),S=["children",W]):typeof W=="number"&&v.textContent!==""+W&&(x.suppressHydrationWarning!==!0&&Yl(v.textContent,W,a),S=["children",""+W]):o.hasOwnProperty(P)&&W!=null&&P==="onScroll"&&Kt("scroll",v)}switch(p){case"input":Ve(v),Vt(v,x,!0);break;case"textarea":Ve(v),yo(v);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(v.onclick=lc)}v=S,l.updateQueue=v,v!==null&&(l.flags|=4)}else{P=S.nodeType===9?S:S.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=la(p)),a==="http://www.w3.org/1999/xhtml"?p==="script"?(a=P.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof v.is=="string"?a=P.createElement(p,{is:v.is}):(a=P.createElement(p),p==="select"&&(P=a,v.multiple?P.multiple=!0:v.size&&(P.size=v.size))):a=P.createElementNS(a,p),a[zo]=l,a[Qa]=v,$m(a,l,!1,!1),l.stateNode=a;e:{switch(P=Ni(p,v),p){case"dialog":Kt("cancel",a),Kt("close",a),S=v;break;case"iframe":case"object":case"embed":Kt("load",a),S=v;break;case"video":case"audio":for(S=0;S<ha.length;S++)Kt(ha[S],a);S=v;break;case"source":Kt("error",a),S=v;break;case"img":case"image":case"link":Kt("error",a),Kt("load",a),S=v;break;case"details":Kt("toggle",a),S=v;break;case"input":tt(a,v),S=Ge(a,v),Kt("invalid",a);break;case"option":S=v;break;case"select":a._wrapperState={wasMultiple:!!v.multiple},S=V({},v,{value:void 0}),Kt("invalid",a);break;case"textarea":Dr(a,v),S=br(a,v),Kt("invalid",a);break;default:S=v}Pa(p,S),W=S;for(x in W)if(W.hasOwnProperty(x)){var X=W[x];x==="style"?ki(a,X):x==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&gs(a,X)):x==="children"?typeof X=="string"?(p!=="textarea"||X!=="")&&ua(a,X):typeof X=="number"&&ua(a,""+X):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(o.hasOwnProperty(x)?X!=null&&x==="onScroll"&&Kt("scroll",a):X!=null&&B(a,x,X,P))}switch(p){case"input":Ve(a),Vt(a,v,!1);break;case"textarea":Ve(a),yo(a);break;case"option":v.value!=null&&a.setAttribute("value",""+Be(v.value));break;case"select":a.multiple=!!v.multiple,x=v.value,x!=null?en(a,!!v.multiple,x,!1):v.defaultValue!=null&&en(a,!!v.multiple,v.defaultValue,!0);break;default:typeof S.onClick=="function"&&(a.onclick=lc)}switch(p){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}}v&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return rr(l),null;case 6:if(a&&l.stateNode!=null)qm(a,l,a.memoizedProps,v);else{if(typeof v!="string"&&l.stateNode===null)throw Error(n(166));if(p=ai(Kl.current),ai(ko.current),$l(l)){if(v=l.stateNode,p=l.memoizedProps,v[zo]=l,(x=v.nodeValue!==p)&&(a=Jn,a!==null))switch(a.tag){case 3:Yl(v.nodeValue,p,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Yl(v.nodeValue,p,(a.mode&1)!==0)}x&&(l.flags|=4)}else v=(p.nodeType===9?p:p.ownerDocument).createTextNode(v),v[zo]=l,l.stateNode=v}return rr(l),null;case 13:if(Qt(Jt),v=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(Zt&&Br!==null&&l.mode&1&&!(l.flags&128))kd(),Ko(),l.flags|=98560,x=!1;else if(x=$l(l),v!==null&&v.dehydrated!==null){if(a===null){if(!x)throw Error(n(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[zo]=l}else Ko(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;rr(l),x=!1}else To!==null&&(cp(To),To=null),x=!0;if(!x)return l.flags&65536?l:null}return l.flags&128?(l.lanes=p,l):(v=v!==null,v!==(a!==null&&a.memoizedState!==null)&&v&&(l.child.flags|=8192,l.mode&1&&(a===null||Jt.current&1?An===0&&(An=3):pp())),l.updateQueue!==null&&(l.flags|=4),rr(l),null);case 4:return Hs(),Jd(a,l),a===null&&Wa(l.stateNode.containerInfo),rr(l),null;case 10:return yc(l.type._context),rr(l),null;case 17:return xr(l.type)&&dc(),rr(l),null;case 19:if(Qt(Jt),x=l.memoizedState,x===null)return rr(l),null;if(v=(l.flags&128)!==0,P=x.rendering,P===null)if(v)Ks(x,!1);else{if(An!==0||a!==null&&a.flags&128)for(a=l.child;a!==null;){if(P=Ql(a),P!==null){for(l.flags|=128,Ks(x,!1),v=P.updateQueue,v!==null&&(l.updateQueue=v,l.flags|=4),l.subtreeFlags=0,v=p,p=l.child;p!==null;)x=p,a=v,x.flags&=14680066,P=x.alternate,P===null?(x.childLanes=0,x.lanes=a,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=P.childLanes,x.lanes=P.lanes,x.child=P.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=P.memoizedProps,x.memoizedState=P.memoizedState,x.updateQueue=P.updateQueue,x.type=P.type,a=P.dependencies,x.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),p=p.sibling;return Wt(Jt,Jt.current&1|2),l.child}a=a.sibling}x.tail!==null&&tn()>el&&(l.flags|=128,v=!0,Ks(x,!1),l.lanes=4194304)}else{if(!v)if(a=Ql(P),a!==null){if(l.flags|=128,v=!0,p=a.updateQueue,p!==null&&(l.updateQueue=p,l.flags|=4),Ks(x,!0),x.tail===null&&x.tailMode==="hidden"&&!P.alternate&&!Zt)return rr(l),null}else 2*tn()-x.renderingStartTime>el&&p!==1073741824&&(l.flags|=128,v=!0,Ks(x,!1),l.lanes=4194304);x.isBackwards?(P.sibling=l.child,l.child=P):(p=x.last,p!==null?p.sibling=P:l.child=P,x.last=P)}return x.tail!==null?(l=x.tail,x.rendering=l,x.tail=l.sibling,x.renderingStartTime=tn(),l.sibling=null,p=Jt.current,Wt(Jt,v?p&1|2:p&1),l):(rr(l),null);case 22:case 23:return dp(),v=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==v&&(l.flags|=8192),v&&l.mode&1?Vr&1073741824&&(rr(l),l.subtreeFlags&6&&(l.flags|=8192)):rr(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function _y(a,l){switch(Ui(l),l.tag){case 1:return xr(l.type)&&dc(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return Hs(),Qt(Cr),Qt(Qn),Pd(),a=l.flags,a&65536&&!(a&128)?(l.flags=a&-65537|128,l):null;case 5:return _d(l),null;case 13:if(Qt(Jt),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Ko()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return Qt(Jt),null;case 4:return Hs(),null;case 10:return yc(l.type._context),null;case 22:case 23:return dp(),null;case 24:return null;default:return null}}var ao=!1,Bt=!1,ep=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function si(a,l){var p=a.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(v){dn(a,l,v)}else p.current=null}function tp(a,l,p){try{p()}catch(v){dn(a,l,v)}}var Wm=!1;function su(a,l){if(Hl=zu,a=zt(),Rl(a)){if("selectionStart"in a)var p={start:a.selectionStart,end:a.selectionEnd};else e:{p=(p=a.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var S=v.anchorOffset,x=v.focusNode;v=v.focusOffset;try{p.nodeType,x.nodeType}catch{p=null;break e}var P=0,W=-1,X=-1,ve=0,Ae=0,_e=a,Ie=null;t:for(;;){for(var We;_e!==p||S!==0&&_e.nodeType!==3||(W=P+S),_e!==x||v!==0&&_e.nodeType!==3||(X=P+v),_e.nodeType===3&&(P+=_e.nodeValue.length),(We=_e.firstChild)!==null;)Ie=_e,_e=We;for(;;){if(_e===a)break t;if(Ie===p&&++ve===S&&(W=P),Ie===x&&++Ae===v&&(X=P),(We=_e.nextSibling)!==null)break;_e=Ie,Ie=_e.parentNode}_e=We}p=W===-1||X===-1?null:{start:W,end:X}}else p=null}p=p||{start:0,end:0}}else p=null;for(ji={focusedElem:a,selectionRange:p},zu=!1,Qe=l;Qe!==null;)if(l=Qe,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,Qe=a;else for(;Qe!==null;){l=Qe;try{var Je=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Je!==null){var et=Je.memoizedProps,gn=Je.memoizedState,ce=l.stateNode,ne=ce.getSnapshotBeforeUpdate(l.elementType===l.type?et:Co(l.type,et),gn);ce.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var de=l.stateNode.containerInfo;de.nodeType===1?de.textContent="":de.nodeType===9&&de.documentElement&&de.removeChild(de.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Pe){dn(l,l.return,Pe)}if(a=l.sibling,a!==null){a.return=l.return,Qe=a;break}Qe=l.return}return Je=Wm,Wm=!1,Je}function Qs(a,l,p){var v=l.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var S=v=v.next;do{if((S.tag&a)===a){var x=S.destroy;S.destroy=void 0,x!==void 0&&tp(l,p,x)}S=S.next}while(S!==v)}}function lu(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&a)===a){var v=p.create;p.destroy=v()}p=p.next}while(p!==l)}}function np(a){var l=a.ref;if(l!==null){var p=a.stateNode;switch(a.tag){case 5:a=p;break;default:a=p}typeof l=="function"?l(a):l.current=a}}function Gm(a){var l=a.alternate;l!==null&&(a.alternate=null,Gm(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&(delete l[zo],delete l[Qa],delete l[cc],delete l[Y],delete l[Ls])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function Km(a){return a.tag===5||a.tag===3||a.tag===4}function Qm(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Km(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Hc(a,l,p){var v=a.tag;if(v===5||v===6)a=a.stateNode,l?p.nodeType===8?p.parentNode.insertBefore(a,l):p.insertBefore(a,l):(p.nodeType===8?(l=p.parentNode,l.insertBefore(a,p)):(l=p,l.appendChild(a)),p=p._reactRootContainer,p!=null||l.onclick!==null||(l.onclick=lc));else if(v!==4&&(a=a.child,a!==null))for(Hc(a,l,p),a=a.sibling;a!==null;)Hc(a,l,p),a=a.sibling}function Uc(a,l,p){var v=a.tag;if(v===5||v===6)a=a.stateNode,l?p.insertBefore(a,l):p.appendChild(a);else if(v!==4&&(a=a.child,a!==null))for(Uc(a,l,p),a=a.sibling;a!==null;)Uc(a,l,p),a=a.sibling}var Yn=null,Hr=!1;function Da(a,l,p){for(p=p.child;p!==null;)Zs(a,l,p),p=p.sibling}function Zs(a,l,p){if(Ho&&typeof Ho.onCommitFiberUnmount=="function")try{Ho.onCommitFiberUnmount(ju,p)}catch{}switch(p.tag){case 5:Bt||si(p,l);case 6:var v=Yn,S=Hr;Yn=null,Da(a,l,p),Yn=v,Hr=S,Yn!==null&&(Hr?(a=Yn,p=p.stateNode,a.nodeType===8?a.parentNode.removeChild(p):a.removeChild(p)):Yn.removeChild(p.stateNode));break;case 18:Yn!==null&&(Hr?(a=Yn,p=p.stateNode,a.nodeType===8?Cd(a.parentNode,p):a.nodeType===1&&Cd(a,p),jt(a)):Cd(Yn,p.stateNode));break;case 4:v=Yn,S=Hr,Yn=p.stateNode.containerInfo,Hr=!0,Da(a,l,p),Yn=v,Hr=S;break;case 0:case 11:case 14:case 15:if(!Bt&&(v=p.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){S=v=v.next;do{var x=S,P=x.destroy;x=x.tag,P!==void 0&&(x&2||x&4)&&tp(p,l,P),S=S.next}while(S!==v)}Da(a,l,p);break;case 1:if(!Bt&&(si(p,l),v=p.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=p.memoizedProps,v.state=p.memoizedState,v.componentWillUnmount()}catch(W){dn(p,l,W)}Da(a,l,p);break;case 21:Da(a,l,p);break;case 22:p.mode&1?(Bt=(v=Bt)||p.memoizedState!==null,Da(a,l,p),Bt=v):Da(a,l,p);break;default:Da(a,l,p)}}function Vc(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var p=a.stateNode;p===null&&(p=a.stateNode=new ep),l.forEach(function(v){var S=zy.bind(null,a,v);p.has(v)||(p.add(v),v.then(S,S))})}}function io(a,l){var p=l.deletions;if(p!==null)for(var v=0;v<p.length;v++){var S=p[v];try{var x=a,P=l,W=P;e:for(;W!==null;){switch(W.tag){case 5:Yn=W.stateNode,Hr=!1;break e;case 3:Yn=W.stateNode.containerInfo,Hr=!0;break e;case 4:Yn=W.stateNode.containerInfo,Hr=!0;break e}W=W.return}if(Yn===null)throw Error(n(160));Zs(x,P,S),Yn=null,Hr=!1;var X=S.alternate;X!==null&&(X.return=null),S.return=null}catch(ve){dn(S,l,ve)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)rp(l,a),l=l.sibling}function rp(a,l){var p=a.alternate,v=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(io(l,a),Ur(a),v&4){try{Qs(3,a,a.return),lu(3,a)}catch(et){dn(a,a.return,et)}try{Qs(5,a,a.return)}catch(et){dn(a,a.return,et)}}break;case 1:io(l,a),Ur(a),v&512&&p!==null&&si(p,p.return);break;case 5:if(io(l,a),Ur(a),v&512&&p!==null&&si(p,p.return),a.flags&32){var S=a.stateNode;try{ua(S,"")}catch(et){dn(a,a.return,et)}}if(v&4&&(S=a.stateNode,S!=null)){var x=a.memoizedProps,P=p!==null?p.memoizedProps:x,W=a.type,X=a.updateQueue;if(a.updateQueue=null,X!==null)try{W==="input"&&x.type==="radio"&&x.name!=null&&Dt(S,x),Ni(W,P);var ve=Ni(W,x);for(P=0;P<X.length;P+=2){var Ae=X[P],_e=X[P+1];Ae==="style"?ki(S,_e):Ae==="dangerouslySetInnerHTML"?gs(S,_e):Ae==="children"?ua(S,_e):B(S,Ae,_e,ve)}switch(W){case"input":dt(S,x);break;case"textarea":_a(S,x);break;case"select":var Ie=S._wrapperState.wasMultiple;S._wrapperState.wasMultiple=!!x.multiple;var We=x.value;We!=null?en(S,!!x.multiple,We,!1):Ie!==!!x.multiple&&(x.defaultValue!=null?en(S,!!x.multiple,x.defaultValue,!0):en(S,!!x.multiple,x.multiple?[]:"",!1))}S[Qa]=x}catch(et){dn(a,a.return,et)}}break;case 6:if(io(l,a),Ur(a),v&4){if(a.stateNode===null)throw Error(n(162));S=a.stateNode,x=a.memoizedProps;try{S.nodeValue=x}catch(et){dn(a,a.return,et)}}break;case 3:if(io(l,a),Ur(a),v&4&&p!==null&&p.memoizedState.isDehydrated)try{jt(l.containerInfo)}catch(et){dn(a,a.return,et)}break;case 4:io(l,a),Ur(a);break;case 13:io(l,a),Ur(a),S=a.child,S.flags&8192&&(x=S.memoizedState!==null,S.stateNode.isHidden=x,!x||S.alternate!==null&&S.alternate.memoizedState!==null||($c=tn())),v&4&&Vc(a);break;case 22:if(Ae=p!==null&&p.memoizedState!==null,a.mode&1?(Bt=(ve=Bt)||Ae,io(l,a),Bt=ve):io(l,a),Ur(a),v&8192){if(ve=a.memoizedState!==null,(a.stateNode.isHidden=ve)&&!Ae&&a.mode&1)for(Qe=a,Ae=a.child;Ae!==null;){for(_e=Qe=Ae;Qe!==null;){switch(Ie=Qe,We=Ie.child,Ie.tag){case 0:case 11:case 14:case 15:Qs(4,Ie,Ie.return);break;case 1:si(Ie,Ie.return);var Je=Ie.stateNode;if(typeof Je.componentWillUnmount=="function"){v=Ie,p=Ie.return;try{l=v,Je.props=l.memoizedProps,Je.state=l.memoizedState,Je.componentWillUnmount()}catch(et){dn(v,p,et)}}break;case 5:si(Ie,Ie.return);break;case 22:if(Ie.memoizedState!==null){Jm(_e);continue}}We!==null?(We.return=Ie,Qe=We):Jm(_e)}Ae=Ae.sibling}e:for(Ae=null,_e=a;;){if(_e.tag===5){if(Ae===null){Ae=_e;try{S=_e.stateNode,ve?(x=S.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(W=_e.stateNode,X=_e.memoizedProps.style,P=X!=null&&X.hasOwnProperty("display")?X.display:null,W.style.display=Mi("display",P))}catch(et){dn(a,a.return,et)}}}else if(_e.tag===6){if(Ae===null)try{_e.stateNode.nodeValue=ve?"":_e.memoizedProps}catch(et){dn(a,a.return,et)}}else if((_e.tag!==22&&_e.tag!==23||_e.memoizedState===null||_e===a)&&_e.child!==null){_e.child.return=_e,_e=_e.child;continue}if(_e===a)break e;for(;_e.sibling===null;){if(_e.return===null||_e.return===a)break e;Ae===_e&&(Ae=null),_e=_e.return}Ae===_e&&(Ae=null),_e.sibling.return=_e.return,_e=_e.sibling}}break;case 19:io(l,a),Ur(a),v&4&&Vc(a);break;case 21:break;default:io(l,a),Ur(a)}}function Ur(a){var l=a.flags;if(l&2){try{e:{for(var p=a.return;p!==null;){if(Km(p)){var v=p;break e}p=p.return}throw Error(n(160))}switch(v.tag){case 5:var S=v.stateNode;v.flags&32&&(ua(S,""),v.flags&=-33);var x=Qm(a);Uc(a,x,S);break;case 3:case 4:var P=v.stateNode.containerInfo,W=Qm(a);Hc(a,W,P);break;default:throw Error(n(161))}}catch(X){dn(a,a.return,X)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function Zm(a,l,p){Qe=a,Fo(a)}function Fo(a,l,p){for(var v=(a.mode&1)!==0;Qe!==null;){var S=Qe,x=S.child;if(S.tag===22&&v){var P=S.memoizedState!==null||ao;if(!P){var W=S.alternate,X=W!==null&&W.memoizedState!==null||Bt;W=ao;var ve=Bt;if(ao=P,(Bt=X)&&!ve)for(Qe=S;Qe!==null;)P=Qe,X=P.child,P.tag===22&&P.memoizedState!==null?op(S):X!==null?(X.return=P,Qe=X):op(S);for(;x!==null;)Qe=x,Fo(x),x=x.sibling;Qe=S,ao=W,Bt=ve}li(a)}else S.subtreeFlags&8772&&x!==null?(x.return=S,Qe=x):li(a)}}function li(a){for(;Qe!==null;){var l=Qe;if(l.flags&8772){var p=l.alternate;try{if(l.flags&8772)switch(l.tag){case 0:case 11:case 15:Bt||lu(5,l);break;case 1:var v=l.stateNode;if(l.flags&4&&!Bt)if(p===null)v.componentDidMount();else{var S=l.elementType===l.type?p.memoizedProps:Co(l.type,p.memoizedProps);v.componentDidUpdate(S,p.memoizedState,v.__reactInternalSnapshotBeforeUpdate)}var x=l.updateQueue;x!==null&&Fm(l,x,v);break;case 3:var P=l.updateQueue;if(P!==null){if(p=null,l.child!==null)switch(l.child.tag){case 5:p=l.child.stateNode;break;case 1:p=l.child.stateNode}Fm(l,P,p)}break;case 5:var W=l.stateNode;if(p===null&&l.flags&4){p=W;var X=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&p.focus();break;case"img":X.src&&(p.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ve=l.alternate;if(ve!==null){var Ae=ve.memoizedState;if(Ae!==null){var _e=Ae.dehydrated;_e!==null&&jt(_e)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Bt||l.flags&512&&np(l)}catch(Ie){dn(l,l.return,Ie)}}if(l===a){Qe=null;break}if(p=l.sibling,p!==null){p.return=l.return,Qe=p;break}Qe=l.return}}function Jm(a){for(;Qe!==null;){var l=Qe;if(l===a){Qe=null;break}var p=l.sibling;if(p!==null){p.return=l.return,Qe=p;break}Qe=l.return}}function op(a){for(;Qe!==null;){var l=Qe;try{switch(l.tag){case 0:case 11:case 15:var p=l.return;try{lu(4,l)}catch(X){dn(l,p,X)}break;case 1:var v=l.stateNode;if(typeof v.componentDidMount=="function"){var S=l.return;try{v.componentDidMount()}catch(X){dn(l,S,X)}}var x=l.return;try{np(l)}catch(X){dn(l,x,X)}break;case 5:var P=l.return;try{np(l)}catch(X){dn(l,P,X)}}}catch(X){dn(l,l.return,X)}if(l===a){Qe=null;break}var W=l.sibling;if(W!==null){W.return=l.return,Qe=W;break}Qe=l.return}}var Py=Math.ceil,zc=F.ReactCurrentDispatcher,ap=F.ReactCurrentOwner,so=F.ReactCurrentBatchConfig,It=0,_n=null,Dn=null,Hn=0,Vr=0,Js=Tr(0),An=0,Xs=null,ui=0,uu=0,ip=0,cu=null,kr=null,$c=0,el=1/0,Sa=null,qc=!1,sp=null,ci=null,Wc=!1,On=null,Gc=0,fu=0,lp=null,du=-1,Kc=0;function gr(){return It&6?tn():du!==-1?du:du=tn()}function fi(a){return a.mode&1?It&2&&Hn!==0?Hn&-Hn:km.transition!==null?(Kc===0&&(Kc=rd()),Kc):(a=Pt,a!==0||(a=window.event,a=a===void 0?16:em(a.type)),a):1}function Io(a,l,p,v){if(50<fu)throw fu=0,lp=null,Error(n(185));kl(a,p,v),(!(It&2)||a!==_n)&&(a===_n&&(!(It&2)&&(uu|=p),An===4&&di(a,Hn)),or(a,v),p===1&&It===0&&!(l.mode&1)&&(el=tn()+500,pc&&Ja()))}function or(a,l){var p=a.callbackNode;py(a,l);var v=Ii(a,a===_n?Hn:0);if(v===0)p!==null&&Uh(p),a.callbackNode=null,a.callbackPriority=0;else if(l=v&-v,a.callbackPriority!==l){if(p!=null&&Uh(p),l===1)a.tag===0?Bi(eg.bind(null,a)):Cm(eg.bind(null,a)),uc(function(){!(It&6)&&Ja()}),p=null;else{switch(Ai(v)){case 1:p=td;break;case 4:p=Vh;break;case 16:p=xl;break;case 536870912:p=nd;break;default:p=xl}p=sg(p,Xm.bind(null,a))}a.callbackPriority=l,a.callbackNode=p}}function Xm(a,l){if(du=-1,Kc=0,It&6)throw Error(n(327));var p=a.callbackNode;if(pi()&&a.callbackNode!==p)return null;var v=Ii(a,a===_n?Hn:0);if(v===0)return null;if(v&30||v&a.expiredLanes||l)l=Qc(a,v);else{l=v;var S=It;It|=2;var x=ng();(_n!==a||Hn!==l)&&(Sa=null,el=tn()+500,Ki(a,l));do try{Yy();break}catch(W){tg(a,W)}while(!0);ql(),zc.current=x,It=S,Dn!==null?l=0:(_n=null,Hn=0,l=An)}if(l!==0){if(l===2&&(S=Yu(a),S!==0&&(v=S,l=up(a,S))),l===1)throw p=Xs,Ki(a,0),di(a,v),or(a,tn()),p;if(l===6)di(a,v);else{if(S=a.current.alternate,!(v&30)&&!jy(S)&&(l=Qc(a,v),l===2&&(x=Yu(a),x!==0&&(v=x,l=up(a,x))),l===1))throw p=Xs,Ki(a,0),di(a,v),or(a,tn()),p;switch(a.finishedWork=S,a.finishedLanes=v,l){case 0:case 1:throw Error(n(345));case 2:Qi(a,kr,Sa);break;case 3:if(di(a,v),(v&130023424)===v&&(l=$c+500-tn(),10<l)){if(Ii(a,0)!==0)break;if(S=a.suspendedLanes,(S&v)!==v){gr(),a.pingedLanes|=a.suspendedLanes&S;break}a.timeoutHandle=Ga(Qi.bind(null,a,kr,Sa),l);break}Qi(a,kr,Sa);break;case 4:if(di(a,v),(v&4194240)===v)break;for(l=a.eventTimes,S=-1;0<v;){var P=31-So(v);x=1<<P,P=l[P],P>S&&(S=P),v&=~x}if(v=S,v=tn()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*Py(v/1960))-v,10<v){a.timeoutHandle=Ga(Qi.bind(null,a,kr,Sa),v);break}Qi(a,kr,Sa);break;case 5:Qi(a,kr,Sa);break;default:throw Error(n(329))}}}return or(a,tn()),a.callbackNode===p?Xm.bind(null,a):null}function up(a,l){var p=cu;return a.current.memoizedState.isDehydrated&&(Ki(a,l).flags|=256),a=Qc(a,l),a!==2&&(l=kr,kr=p,l!==null&&cp(l)),a}function cp(a){kr===null?kr=a:kr.push.apply(kr,a)}function jy(a){for(var l=a;;){if(l.flags&16384){var p=l.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var v=0;v<p.length;v++){var S=p[v],x=S.getSnapshot;S=S.value;try{if(!me(x(),S))return!1}catch{return!1}}}if(p=l.child,l.subtreeFlags&16384&&p!==null)p.return=l,l=p;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function di(a,l){for(l&=~ip,l&=~uu,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var p=31-So(l),v=1<<p;a[p]=-1,l&=~v}}function eg(a){if(It&6)throw Error(n(327));pi();var l=Ii(a,0);if(!(l&1))return or(a,tn()),null;var p=Qc(a,l);if(a.tag!==0&&p===2){var v=Yu(a);v!==0&&(l=v,p=up(a,v))}if(p===1)throw p=Xs,Ki(a,0),di(a,l),or(a,tn()),p;if(p===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=l,Qi(a,kr,Sa),or(a,tn()),null}function fp(a,l){var p=It;It|=1;try{return a(l)}finally{It=p,It===0&&(el=tn()+500,pc&&Ja())}}function Gi(a){On!==null&&On.tag===0&&!(It&6)&&pi();var l=It;It|=1;var p=so.transition,v=Pt;try{if(so.transition=null,Pt=1,a)return a()}finally{Pt=v,so.transition=p,It=l,!(It&6)&&Ja()}}function dp(){Vr=Js.current,Qt(Js)}function Ki(a,l){a.finishedWork=null,a.finishedLanes=0;var p=a.timeoutHandle;if(p!==-1&&(a.timeoutHandle=-1,Vl(p)),Dn!==null)for(p=Dn.return;p!==null;){var v=p;switch(Ui(v),v.tag){case 1:v=v.type.childContextTypes,v!=null&&dc();break;case 3:Hs(),Qt(Cr),Qt(Qn),Pd();break;case 5:_d(v);break;case 4:Hs();break;case 13:Qt(Jt);break;case 19:Qt(Jt);break;case 10:yc(v.type._context);break;case 22:case 23:dp()}p=p.return}if(_n=a,Dn=a=hi(a.current,null),Hn=Vr=l,An=0,Xs=null,ip=uu=ui=0,kr=cu=null,Yr!==null){for(l=0;l<Yr.length;l++)if(p=Yr[l],v=p.interleaved,v!==null){p.interleaved=null;var S=v.next,x=p.pending;if(x!==null){var P=x.next;x.next=S,v.next=P}p.pending=v}Yr=null}return a}function tg(a,l){do{var p=Dn;try{if(ql(),Us.current=wa,Cc){for(var v=on.memoizedState;v!==null;){var S=v.queue;S!==null&&(S.pending=null),v=v.next}Cc=!1}if($i=0,Nn=an=on=null,Jl=!1,er=0,ap.current=null,p===null||p.return===null){An=1,Xs=l,Dn=null;break}e:{var x=a,P=p.return,W=p,X=l;if(l=Hn,W.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var ve=X,Ae=W,_e=Ae.tag;if(!(Ae.mode&1)&&(_e===0||_e===11||_e===15)){var Ie=Ae.alternate;Ie?(Ae.updateQueue=Ie.updateQueue,Ae.memoizedState=Ie.memoizedState,Ae.lanes=Ie.lanes):(Ae.updateQueue=null,Ae.memoizedState=null)}var We=Wd(P);if(We!==null){We.flags&=-257,ru(We,P,W,x,l),We.mode&1&&Ym(x,ve,l),l=We,X=ve;var Je=l.updateQueue;if(Je===null){var et=new Set;et.add(X),l.updateQueue=et}else Je.add(X);break e}else{if(!(l&1)){Ym(x,ve,l),pp();break e}X=Error(n(426))}}else if(Zt&&W.mode&1){var gn=Wd(P);if(gn!==null){!(gn.flags&65536)&&(gn.flags|=256),ru(gn,P,W,x,l),Qo(Wi(X,W));break e}}x=X=Wi(X,W),An!==4&&(An=2),cu===null?cu=[x]:cu.push(x),x=P;do{switch(x.tag){case 3:x.flags|=65536,l&=-l,x.lanes|=l;var ce=_c(x,X,l);Fd(x,ce);break e;case 1:W=X;var ne=x.type,de=x.stateNode;if(!(x.flags&128)&&(typeof ne.getDerivedStateFromError=="function"||de!==null&&typeof de.componentDidCatch=="function"&&(ci===null||!ci.has(de)))){x.flags|=65536,l&=-l,x.lanes|=l;var Pe=nu(x,W,l);Fd(x,Pe);break e}}x=x.return}while(x!==null)}og(p)}catch(nt){l=nt,Dn===p&&p!==null&&(Dn=p=p.return);continue}break}while(!0)}function ng(){var a=zc.current;return zc.current=wa,a===null?wa:a}function pp(){(An===0||An===3||An===2)&&(An=4),_n===null||!(ui&268435455)&&!(uu&268435455)||di(_n,Hn)}function Qc(a,l){var p=It;It|=2;var v=ng();(_n!==a||Hn!==l)&&(Sa=null,Ki(a,l));do try{By();break}catch(S){tg(a,S)}while(!0);if(ql(),It=p,zc.current=v,Dn!==null)throw Error(n(261));return _n=null,Hn=0,An}function By(){for(;Dn!==null;)rg(Dn)}function Yy(){for(;Dn!==null&&!Pu();)rg(Dn)}function rg(a){var l=ig(a.alternate,a,Vr);a.memoizedProps=a.pendingProps,l===null?og(a):Dn=l,ap.current=null}function og(a){var l=a;do{var p=l.alternate;if(a=l.return,l.flags&32768){if(p=_y(p,l),p!==null){p.flags&=32767,Dn=p;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{An=6,Dn=null;return}}else if(p=Ly(p,l,Vr),p!==null){Dn=p;return}if(l=l.sibling,l!==null){Dn=l;return}Dn=l=a}while(l!==null);An===0&&(An=5)}function Qi(a,l,p){var v=Pt,S=so.transition;try{so.transition=null,Pt=1,Hy(a,l,p,v)}finally{so.transition=S,Pt=v}return null}function Hy(a,l,p,v){do pi();while(On!==null);if(It&6)throw Error(n(327));p=a.finishedWork;var S=a.finishedLanes;if(p===null)return null;if(a.finishedWork=null,a.finishedLanes=0,p===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var x=p.lanes|p.childLanes;if(Kh(a,x),a===_n&&(Dn=_n=null,Hn=0),!(p.subtreeFlags&2064)&&!(p.flags&2064)||Wc||(Wc=!0,sg(xl,function(){return pi(),null})),x=(p.flags&15990)!==0,p.subtreeFlags&15990||x){x=so.transition,so.transition=null;var P=Pt;Pt=1;var W=It;It|=4,ap.current=null,su(a,p),rp(p,a),Fy(ji),zu=!!Hl,ji=Hl=null,a.current=p,Zm(p),cy(),It=W,Pt=P,so.transition=x}else a.current=p;if(Wc&&(Wc=!1,On=a,Gc=S),x=a.pendingLanes,x===0&&(ci=null),dy(p.stateNode),or(a,tn()),l!==null)for(v=a.onRecoverableError,p=0;p<l.length;p++)S=l[p],v(S.value,{componentStack:S.stack,digest:S.digest});if(qc)throw qc=!1,a=sp,sp=null,a;return Gc&1&&a.tag!==0&&pi(),x=a.pendingLanes,x&1?a===lp?fu++:(fu=0,lp=a):fu=0,Ja(),null}function pi(){if(On!==null){var a=Ai(Gc),l=so.transition,p=Pt;try{if(so.transition=null,Pt=16>a?16:a,On===null)var v=!1;else{if(a=On,On=null,Gc=0,It&6)throw Error(n(331));var S=It;for(It|=4,Qe=a.current;Qe!==null;){var x=Qe,P=x.child;if(Qe.flags&16){var W=x.deletions;if(W!==null){for(var X=0;X<W.length;X++){var ve=W[X];for(Qe=ve;Qe!==null;){var Ae=Qe;switch(Ae.tag){case 0:case 11:case 15:Qs(8,Ae,x)}var _e=Ae.child;if(_e!==null)_e.return=Ae,Qe=_e;else for(;Qe!==null;){Ae=Qe;var Ie=Ae.sibling,We=Ae.return;if(Gm(Ae),Ae===ve){Qe=null;break}if(Ie!==null){Ie.return=We,Qe=Ie;break}Qe=We}}}var Je=x.alternate;if(Je!==null){var et=Je.child;if(et!==null){Je.child=null;do{var gn=et.sibling;et.sibling=null,et=gn}while(et!==null)}}Qe=x}}if(x.subtreeFlags&2064&&P!==null)P.return=x,Qe=P;else e:for(;Qe!==null;){if(x=Qe,x.flags&2048)switch(x.tag){case 0:case 11:case 15:Qs(9,x,x.return)}var ce=x.sibling;if(ce!==null){ce.return=x.return,Qe=ce;break e}Qe=x.return}}var ne=a.current;for(Qe=ne;Qe!==null;){P=Qe;var de=P.child;if(P.subtreeFlags&2064&&de!==null)de.return=P,Qe=de;else e:for(P=ne;Qe!==null;){if(W=Qe,W.flags&2048)try{switch(W.tag){case 0:case 11:case 15:lu(9,W)}}catch(nt){dn(W,W.return,nt)}if(W===P){Qe=null;break e}var Pe=W.sibling;if(Pe!==null){Pe.return=W.return,Qe=Pe;break e}Qe=W.return}}if(It=S,Ja(),Ho&&typeof Ho.onPostCommitFiberRoot=="function")try{Ho.onPostCommitFiberRoot(ju,a)}catch{}v=!0}return v}finally{Pt=p,so.transition=l}}return!1}function hp(a,l,p){l=Wi(p,l),l=_c(a,l,1),a=ti(a,l,1),l=gr(),a!==null&&(kl(a,1,l),or(a,l))}function dn(a,l,p){if(a.tag===3)hp(a,a,p);else for(;l!==null;){if(l.tag===3){hp(l,a,p);break}else if(l.tag===1){var v=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(ci===null||!ci.has(v))){a=Wi(p,a),a=nu(l,a,1),l=ti(l,a,1),a=gr(),l!==null&&(kl(l,1,a),or(l,a));break}}l=l.return}}function Uy(a,l,p){var v=a.pingCache;v!==null&&v.delete(l),l=gr(),a.pingedLanes|=a.suspendedLanes&p,_n===a&&(Hn&p)===p&&(An===4||An===3&&(Hn&130023424)===Hn&&500>tn()-$c?Ki(a,0):ip|=p),or(a,l)}function ag(a,l){l===0&&(a.mode&1?(l=Bu,Bu<<=1,!(Bu&130023424)&&(Bu=4194304)):l=1);var p=gr();a=xo(a,l),a!==null&&(kl(a,l,p),or(a,p))}function Vy(a){var l=a.memoizedState,p=0;l!==null&&(p=l.retryLane),ag(a,p)}function zy(a,l){var p=0;switch(a.tag){case 13:var v=a.stateNode,S=a.memoizedState;S!==null&&(p=S.retryLane);break;case 19:v=a.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(l),ag(a,p)}var ig;ig=function(a,l,p){if(a!==null)if(a.memoizedProps!==l.pendingProps||Cr.current)tr=!0;else{if(!(a.lanes&p)&&!(l.flags&128))return tr=!1,nr(a,l,p);tr=!!(a.flags&131072)}else tr=!1,Zt&&l.flags&1048576&&xm(l,mc,l.index);switch(l.lanes=0,l.tag){case 2:var v=l.type;Gs(a,l),a=l.pendingProps;var S=Ps(l,Qn.current);Xa(l,p),S=xc(null,l,v,a,S,p);var x=Mc();return l.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,xr(v)?(x=!0,to(l)):x=!1,l.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Nd(l),S.updater=Dc,l.stateNode=S,S._reactInternals=l,Od(l,v,a,p),l=Zd(null,l,v,!0,x,p)):(l.tag=0,Zt&&x&&zl(l),mr(null,l,S,p),l=l.child),l;case 16:v=l.elementType;e:{switch(Gs(a,l),a=l.pendingProps,S=v._init,v=S(v._payload),l.type=v,S=l.tag=Zc(v),a=Co(v,a),S){case 0:l=Pc(null,l,v,a,p);break e;case 1:l=Vm(null,l,v,a,p);break e;case 11:l=Gd(null,l,v,a,p);break e;case 14:l=Zo(null,l,v,Co(v.type,a),p);break e}throw Error(n(306,v,""))}return l;case 0:return v=l.type,S=l.pendingProps,S=l.elementType===v?S:Co(v,S),Pc(a,l,v,S,p);case 1:return v=l.type,S=l.pendingProps,S=l.elementType===v?S:Co(v,S),Vm(a,l,v,S,p);case 3:e:{if(Jo(l),a===null)throw Error(n(387));v=l.pendingProps,x=l.memoizedState,S=x.element,Nm(a,l),bc(l,v,null,p);var P=l.memoizedState;if(v=P.element,x.isDehydrated)if(x={element:v,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},l.updateQueue.baseState=x,l.memoizedState=x,l.flags&256){S=Wi(Error(n(423)),l),l=jc(a,l,v,p,S);break e}else if(v!==S){S=Wi(Error(n(424)),l),l=jc(a,l,v,p,S);break e}else for(Br=Ka(l.stateNode.containerInfo.firstChild),Jn=l,Zt=!0,To=null,p=Rd(l,null,v,p),l.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Ko(),v===S){l=Xo(a,l,p);break e}mr(a,l,v,p)}l=l.child}return l;case 5:return Ld(l),a===null&&Mr(l),v=l.type,S=l.pendingProps,x=a!==null?a.memoizedProps:null,P=S.children,Ul(v,S)?P=null:x!==null&&Ul(v,x)&&(l.flags|=32),Um(a,l),mr(a,l,P,p),l.child;case 6:return a===null&&Mr(l),null;case 13:return iu(a,l,p);case 4:return Tc(l,l.stateNode.containerInfo),v=l.pendingProps,a===null?l.child=ri(l,null,v,p):mr(a,l,v,p),l.child;case 11:return v=l.type,S=l.pendingProps,S=l.elementType===v?S:Co(v,S),Gd(a,l,v,S,p);case 7:return mr(a,l,l.pendingProps,p),l.child;case 8:return mr(a,l,l.pendingProps.children,p),l.child;case 12:return mr(a,l,l.pendingProps.children,p),l.child;case 10:e:{if(v=l.type._context,S=l.pendingProps,x=l.memoizedProps,P=S.value,Wt(Vi,v._currentValue),v._currentValue=P,x!==null)if(me(x.value,P)){if(x.children===S.children&&!Cr.current){l=Xo(a,l,p);break e}}else for(x=l.child,x!==null&&(x.return=l);x!==null;){var W=x.dependencies;if(W!==null){P=x.child;for(var X=W.firstContext;X!==null;){if(X.context===v){if(x.tag===1){X=Mo(-1,p&-p),X.tag=2;var ve=x.updateQueue;if(ve!==null){ve=ve.shared;var Ae=ve.pending;Ae===null?X.next=X:(X.next=Ae.next,Ae.next=X),ve.pending=X}}x.lanes|=p,X=x.alternate,X!==null&&(X.lanes|=p),oo(x.return,p,l),W.lanes|=p;break}X=X.next}}else if(x.tag===10)P=x.type===l.type?null:x.child;else if(x.tag===18){if(P=x.return,P===null)throw Error(n(341));P.lanes|=p,W=P.alternate,W!==null&&(W.lanes|=p),oo(P,p,l),P=x.sibling}else P=x.child;if(P!==null)P.return=x;else for(P=x;P!==null;){if(P===l){P=null;break}if(x=P.sibling,x!==null){x.return=P.return,P=x;break}P=P.return}x=P}mr(a,l,S.children,p),l=l.child}return l;case 9:return S=l.type,v=l.pendingProps.children,Xa(l,p),S=pr(S),v=v(S),l.flags|=1,mr(a,l,v,p),l.child;case 14:return v=l.type,S=Co(v,l.pendingProps),S=Co(v.type,S),Zo(a,l,v,S,p);case 15:return Kd(a,l,l.type,l.pendingProps,p);case 17:return v=l.type,S=l.pendingProps,S=l.elementType===v?S:Co(v,S),Gs(a,l),l.tag=1,xr(v)?(a=!0,to(l)):a=!1,Xa(l,p),Ad(l,v,S),Od(l,v,S,p),Zd(null,l,v,!0,a,p);case 19:return zm(a,l,p);case 22:return Qd(a,l,p)}throw Error(n(156,l.tag))};function sg(a,l){return Hh(a,l)}function $y(a,l,p,v){this.tag=a,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zr(a,l,p,v){return new $y(a,l,p,v)}function mp(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Zc(a){if(typeof a=="function")return mp(a)?1:0;if(a!=null){if(a=a.$$typeof,a===ae)return 11;if(a===pe)return 14}return 2}function hi(a,l){var p=a.alternate;return p===null?(p=zr(a.tag,l,a.key,a.mode),p.elementType=a.elementType,p.type=a.type,p.stateNode=a.stateNode,p.alternate=a,a.alternate=p):(p.pendingProps=l,p.type=a.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=a.flags&14680064,p.childLanes=a.childLanes,p.lanes=a.lanes,p.child=a.child,p.memoizedProps=a.memoizedProps,p.memoizedState=a.memoizedState,p.updateQueue=a.updateQueue,l=a.dependencies,p.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},p.sibling=a.sibling,p.index=a.index,p.ref=a.ref,p}function Jc(a,l,p,v,S,x){var P=2;if(v=a,typeof a=="function")mp(a)&&(P=1);else if(typeof a=="string")P=5;else e:switch(a){case j:return Zi(p.children,S,x,l);case z:P=8,S|=8;break;case q:return a=zr(12,p,l,S|2),a.elementType=q,a.lanes=x,a;case ie:return a=zr(13,p,l,S),a.elementType=ie,a.lanes=x,a;case ge:return a=zr(19,p,l,S),a.elementType=ge,a.lanes=x,a;case De:return Xc(p,S,x,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case $:P=10;break e;case J:P=9;break e;case ae:P=11;break e;case pe:P=14;break e;case fe:P=16,v=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return l=zr(P,p,l,S),l.elementType=a,l.type=v,l.lanes=x,l}function Zi(a,l,p,v){return a=zr(7,a,v,l),a.lanes=p,a}function Xc(a,l,p,v){return a=zr(22,a,v,l),a.elementType=De,a.lanes=p,a.stateNode={isHidden:!1},a}function gp(a,l,p){return a=zr(6,a,null,l),a.lanes=p,a}function vp(a,l,p){return l=zr(4,a.children!==null?a.children:[],a.key,l),l.lanes=p,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function qy(a,l,p,v,S){this.tag=l,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ml(0),this.expirationTimes=Ml(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ml(0),this.identifierPrefix=v,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function yp(a,l,p,v,S,x,P,W,X){return a=new qy(a,l,p,W,X),l===1?(l=1,x===!0&&(l|=8)):l=0,x=zr(3,null,null,l),a.current=x,x.stateNode=a,x.memoizedState={element:v,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},Nd(x),a}function Wy(a,l,p){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:v==null?null:""+v,children:a,containerInfo:l,implementation:p}}function lg(a){if(!a)return Za;a=a._reactInternals;e:{if(Fi(a)!==a||a.tag!==1)throw Error(n(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(xr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(a.tag===1){var p=a.type;if(xr(p))return Em(a,p,l)}return l}function ug(a,l,p,v,S,x,P,W,X){return a=yp(p,v,!0,a,S,x,P,W,X),a.context=lg(null),p=a.current,v=gr(),S=fi(p),x=Mo(v,S),x.callback=l??null,ti(p,x,S),a.current.lanes=S,kl(a,S,v),or(a,v),a}function ef(a,l,p,v){var S=l.current,x=gr(),P=fi(S);return p=lg(p),l.context===null?l.context=p:l.pendingContext=p,l=Mo(x,P),l.payload={element:a},v=v===void 0?null:v,v!==null&&(l.callback=v),a=ti(S,l,P),a!==null&&(Io(a,S,P,x),ni(a,S,P)),P}function tf(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function cg(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var p=a.retryLane;a.retryLane=p!==0&&p<l?p:l}}function wp(a,l){cg(a,l),(a=a.alternate)&&cg(a,l)}function Gy(){return null}var bp=typeof reportError=="function"?reportError:function(a){console.error(a)};function nf(a){this._internalRoot=a}rf.prototype.render=nf.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(n(409));ef(a,l,null,null)},rf.prototype.unmount=nf.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;Gi(function(){ef(null,a,null,null)}),l[jr]=null}};function rf(a){this._internalRoot=a}rf.prototype.unstable_scheduleHydration=function(a){if(a){var l=ad();a={blockedOn:null,target:a,priority:l};for(var p=0;p<Va.length&&l!==0&&l<Va[p].priority;p++);Va.splice(p,0,a),p===0&&Jh(a)}};function Dp(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function of(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function fg(){}function af(a,l,p,v,S){if(S){if(typeof v=="function"){var x=v;v=function(){var ve=tf(P);x.call(ve)}}var P=ug(l,v,a,0,null,!1,!1,"",fg);return a._reactRootContainer=P,a[jr]=P.current,Wa(a.nodeType===8?a.parentNode:a),Gi(),P}for(;S=a.lastChild;)a.removeChild(S);if(typeof v=="function"){var W=v;v=function(){var ve=tf(X);W.call(ve)}}var X=yp(a,0,!1,null,null,!1,!1,"",fg);return a._reactRootContainer=X,a[jr]=X.current,Wa(a.nodeType===8?a.parentNode:a),Gi(function(){ef(l,X,p,v)}),X}function sf(a,l,p,v,S){var x=p._reactRootContainer;if(x){var P=x;if(typeof S=="function"){var W=S;S=function(){var X=tf(P);W.call(X)}}ef(l,P,a,S)}else P=af(p,l,a,S,v);return tf(P)}od=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.current.memoizedState.isDehydrated){var p=ws(l.pendingLanes);p!==0&&(Nl(l,p|1),or(l,tn()),!(It&6)&&(el=tn()+500,Ja()))}break;case 13:Gi(function(){var v=xo(a,1);if(v!==null){var S=gr();Io(v,a,1,S)}}),wp(a,1)}},Hu=function(a){if(a.tag===13){var l=xo(a,134217728);if(l!==null){var p=gr();Io(l,a,134217728,p)}wp(a,134217728)}},Qh=function(a){if(a.tag===13){var l=fi(a),p=xo(a,l);if(p!==null){var v=gr();Io(p,a,l,v)}wp(a,l)}},ad=function(){return Pt},id=function(a,l){var p=Pt;try{return Pt=a,l()}finally{Pt=p}},he=function(a,l,p){switch(l){case"input":if(dt(a,p),l=p.name,p.type==="radio"&&l!=null){for(p=a;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<p.length;l++){var v=p[l];if(v!==a&&v.form===a.form){var S=fc(v);if(!S)throw Error(n(90));Ke(v),dt(v,S)}}}break;case"textarea":_a(a,p);break;case"select":l=p.value,l!=null&&en(a,!!p.multiple,l,!1)}},Yt=fp,xn=Gi;var Ky={usingClientEntryPoint:!1,Events:[Kn,St,fc,He,mt,fp]},pu={findFiberByHostInstance:$o,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},Qy={bundleType:pu.bundleType,version:pu.version,rendererPackageName:pu.rendererPackageName,rendererConfig:pu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:F.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Bh(a),a===null?null:a.stateNode},findFiberByHostInstance:pu.findFiberByHostInstance||Gy,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lf.isDisabled&&lf.supportsFiber)try{ju=lf.inject(Qy),Ho=lf}catch{}}return fo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ky,fo.createPortal=function(a,l){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dp(l))throw Error(n(200));return Wy(a,l,null,p)},fo.createRoot=function(a,l){if(!Dp(a))throw Error(n(299));var p=!1,v="",S=bp;return l!=null&&(l.unstable_strictMode===!0&&(p=!0),l.identifierPrefix!==void 0&&(v=l.identifierPrefix),l.onRecoverableError!==void 0&&(S=l.onRecoverableError)),l=yp(a,1,!1,null,null,p,!1,v,S),a[jr]=l.current,Wa(a.nodeType===8?a.parentNode:a),new nf(l)},fo.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=Bh(l),a=a===null?null:a.stateNode,a},fo.flushSync=function(a){return Gi(a)},fo.hydrate=function(a,l,p){if(!of(l))throw Error(n(200));return sf(null,a,l,!0,p)},fo.hydrateRoot=function(a,l,p){if(!Dp(a))throw Error(n(405));var v=p!=null&&p.hydratedSources||null,S=!1,x="",P=bp;if(p!=null&&(p.unstable_strictMode===!0&&(S=!0),p.identifierPrefix!==void 0&&(x=p.identifierPrefix),p.onRecoverableError!==void 0&&(P=p.onRecoverableError)),l=ug(l,null,a,1,p??null,S,!1,x,P),a[jr]=l.current,Wa(a),v)for(a=0;a<v.length;a++)p=v[a],S=p._getVersion,S=S(p._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[p,S]:l.mutableSourceEagerHydrationData.push(p,S);return new rf(l)},fo.render=function(a,l,p){if(!of(l))throw Error(n(200));return sf(null,a,l,!1,p)},fo.unmountComponentAtNode=function(a){if(!of(a))throw Error(n(40));return a._reactRootContainer?(Gi(function(){sf(null,null,a,!1,function(){a._reactRootContainer=null,a[jr]=null})}),!0):!1},fo.unstable_batchedUpdates=fp,fo.unstable_renderSubtreeIntoContainer=function(a,l,p,v){if(!of(p))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return sf(a,l,p,!1,v)},fo.version="18.2.0-next-9e3b772b8-20220608",fo}function g3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g3)}catch(e){console.error(e)}}g3();m3.exports=M7();var uw=m3.exports;const cw=qn(uw);var Mv,v3=uw;Mv=Lu.createRoot=v3.createRoot;Lu.hydrateRoot=v3.hydrateRoot;const k7=e=>{const{children:t,className:n,clickSpaceDestroy:r,destroy:o}=e,i=()=>{r&&o()},s=c=>{(c.key==="Escape"||(c.ctrlKey||c.metaKey)&&c.key.toLowerCase()==="w")&&o()};return D.jsx("div",{className:`dialog-wrapper ${n}`,onClick:i,onKeyDown:c=>s(c),children:D.jsx("div",{className:"dialog-container",onClick:c=>c.stopPropagation(),children:t})})};function Sh(e,t,n){const r=document.createElement("div");document.body.append(r),setTimeout(()=>{var d;(d=r.firstElementChild)==null||d.classList.add("showup")},0);const o={destroy:()=>{var d,h;(d=r.firstElementChild)==null||d.classList.remove("showup"),(h=r.firstElementChild)==null||h.classList.add("showoff"),setTimeout(()=>{r.detach(),c.unmount()},oE)}},i={...n,destroy:o.destroy};let s=D.jsx(k7,{destroy:o.destroy,clickSpaceDestroy:!0,...e,children:D.jsx(t,{...i})});s=D.jsx(If,{store:xe,context:Nt,children:s});const c=Lu.createRoot(r);return c.render(s),o}const N7=e=>{const{shownStatus:t,setShownStatus:n}=e,{dailyNotesState:{app:r},globalState:{manifest:o}}=A.useContext(Nt),i=A.useRef(null);A.useEffect(()=>{if(t){const h=g=>{var m;(m=i.current)!=null&&m.contains(g.target)||g.stopPropagation(),n(!1)};window.addEventListener("click",h,{capture:!0,once:!0})}},[t]);const s=A.useCallback(async h=>{const{type:g}=h;if(g.startsWith("text"))try{return`${await lw.parseHtml(h)}`}catch(m){new N.Notice(m)}},[]),c=A.useCallback(()=>{const h=document.createElement("input");document.body.appendChild(h),h.type="file",h.multiple=!1,h.accept="text/html",h.onchange=async()=>{if(!h.files||h.files.length===0)return;const g=h.files[0];await s(g),document.body.removeChild(h)},h.click()},[]),d=()=>{r.setting.open(),r.setting.openTabById(o.id??"obsidian-memos")};return D.jsxs("div",{className:`menu-btns-popup ${t?"":"hidden"}`,ref:i,children:[D.jsxs("div",{className:"btn action-btn",onClick:d,children:[D.jsx("span",{ref:h=>{h&&N.setIcon(h,"user")},className:"icon"}),O("Settings")]}),D.jsxs("div",{className:"btn action-btn",onClick:c,children:[D.jsx("span",{ref:h=>{h&&N.setIcon(h,"import")},className:"icon"}),O("Import")]})]})},g1=new Map,Yg=async(e,t=!0)=>{const{vault:n,metadataCache:r}=ut.getState().app;if(t&&g1.has(e))return Promise.resolve(g1.get(e));let o;const i=await n.adapter.exists(e);let s="";try{if(!i&&!/(http|https)/g.test(e)){const c=r.getFirstLinkpathDest(e,"");if(!c){new N.Notice(O("File not exist"));return}s=c.path}else s=e}catch(c){console.error(c)}if(s){if(/(http|https)/g.test(s))try{const c=await N.requestUrl(e),d=new Uint8Array(c.arrayBuffer);o=new Blob([d],{type:"image/png"})}catch{}else if(s){const c=await n.adapter.readBinary(s),d=new Uint8Array(c);o=new Blob([d],{type:"image/png"})}return o?F7(o,e):""}},F7=(e,t)=>new Promise(n=>{const r=new FileReader;r.onloadend=()=>{const o=r.result;g1.set(t,o),n(o)},r.readAsDataURL(e)}),I7=async e=>{const t=document.createElement(e.tagName);t.innerHTML=e.innerHTML;const n=async(r,o)=>{if(!r||!o)return;const i=window.getComputedStyle(r);if(r.tagName==="IMG")try{let s="";const c=r.getAttribute("src");c!=null&&c.startsWith("http")&&!c.startsWith("http://localhost")?s=await Yg(r==null?void 0:r.getAttribute("src")):s=await Yg(r.getAttribute("path")??N.normalizePath(r==null?void 0:r.parentElement.getAttribute("src"))),o.src=s}catch(s){console.error(s)}else if(r.className==="property-image")try{const s=r.style.backgroundImage,c=await Yg(s);o.style.backgroundImage=c}catch(s){console.error(s)}for(const s of i)o.style.setProperty(s,i.getPropertyValue(s),i.getPropertyPriority(s));for(let s=0;s<o.childElementCount;s++)await n(r.children[s],o.children[s])};return await n(e,t),t},A7=async e=>{const t=e.ownerDocument.styleSheets,n=[];for(const o of t)for(const i of o.cssRules)i.constructor.name==="CSSFontFaceRule"&&n.push(i.style);return document.createElement("style")},y3=e=>{const{width:t,height:n}=window.getComputedStyle(e);return{width:parseInt(t.replace("px","")),height:parseInt(n.replace("px",""))}},O7=e=>{const t=new XMLSerializer().serializeToString(e);return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`},R7=(e,t,n)=>{const r="http://www.w3.org/2000/svg",o=document.createElementNS(r,"svg");o.setAttribute("width",`${e}`),o.setAttribute("height",`${t}`),o.setAttribute("viewBox",`0 0 ${e} ${t}`);const i=document.createElementNS(r,"foreignObject");return i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),i.appendChild(n),o.appendChild(i),o},L7=async(e,t)=>{const{width:n,height:r}=y3(e),o=await I7(e);t!=null&&t.backgroundColor&&(o.style.backgroundColor=t.backgroundColor);const i=R7(n,r,o);return i.prepend(await A7(e)),O7(i)},_7=async(e,t)=>{const n=await L7(e,t),r=new Image;r.src=n;const o=(t==null?void 0:t.pixelRatio)||1,{width:i,height:s}=y3(e),c=document.createElement("canvas"),d=c.getContext("2d");return d?(c.width=i*o,c.height=s*o,c.style.width=`${i}`,c.style.height=`${s}`,(t!=null&&t.backgroundColor||document.body.className.contains("theme-dark"))&&(d.fillStyle=t.backgroundColor||"#1f1f1f",d.fillRect(0,0,c.width,c.height)),new Promise(h=>{r.onload=()=>{d.drawImage(r,0,0,c.width,c.height),h(c)}})):Promise.reject("Canvas error")},w3=async(e,t)=>(await _7(e,t)).toDataURL();function Oa(e){const[t,n]=A.useState(()=>!!e),r=A.useCallback(o=>{n(typeof o=="boolean"?o:i=>!i)},[]);return[t,r]}function Vf(e=!0){const[t,n]=A.useState({isLoading:e,isFailed:!1,isSucceed:!1,isPending:!1});return{...t,setLoading:()=>{n({...t,isLoading:!0,isFailed:!1,isPending:!1,isSucceed:!1})},setFinish:()=>{n({...t,isLoading:!1,isFailed:!1,isPending:!1,isSucceed:!0})},setError:()=>{n({...t,isLoading:!1,isFailed:!0,isPending:!1,isSucceed:!1})},setPending:()=>{n({...t,isLoading:!1,isFailed:!1,isPending:!0,isSucceed:!1})}}}const P7=(e,t)=>{const n=window.atob(e),r=new ArrayBuffer(n.length),o=new Uint8Array(r);for(let i=0;i<n.length;i++)o[i]=n.charCodeAt(i);return new Blob([r],{type:t})},dD=async e=>{e.startsWith("http")&&(e=await Yg(e));const t=e.split("base64,")[1],n=P7(t,"image/png");await b3(n),new N.Notice(O("Send to clipboard successfully"))},j7=async(e,t)=>{const n=await e.vault.adapter.exists(t);let r="";if(n)r=t;else{const c=e.metadataCache.getFirstLinkpathDest(t,"");if(!c){new N.Notice(O("File not exist"));return}r=c.path}const o=await e.vault.adapter.readBinary(r),i=new Uint8Array(o),s=new Blob([i],{type:"image/png"});await b3(s)},b3=async e=>{const t=new ClipboardItem({"image/png":e});await window.navigator.clipboard.write([t])},pD=1.1,hD=300,mD=20,B7=({destroy:e,imgUrl:t,filepath:n,otherIMGEls:r,currentIndex:o})=>{const i=A.useRef(null),[s,c]=A.useState(-1),d=xe.getState().dailyNotesState.app,[h,g]=A.useState(o),[m,w]=A.useState(t),b={close:A.useRef(null),previous:A.useRef(null),next:A.useRef(null),decrease:A.useRef(null),increase:A.useRef(null),zoom:A.useRef(null),copy:A.useRef(null)};A.useEffect(()=>{!n&&!t||(N.setIcon(b.close.current,"x"),b.previous.current&&N.setIcon(b.previous.current,"arrow-left"),b.next.current&&N.setIcon(b.next.current,"arrow-right"),N.setIcon(b.decrease.current,"zoom-out"),N.setIcon(b.increase.current,"zoom-in"),N.setIcon(b.zoom.current,"circle"),N.setIcon(b.copy.current,"clipboard"))},[b]),A.useEffect(()=>{Ue.getImageSize(m).then(({width:R})=>{c(R!==0?40:0)})},[m]);const T=()=>{let R=h-1;R<0&&(R=r.length-1),g(R),w(r[R].src)},E=()=>{let R=h+1;R>=r.length&&(R=0),g(R),w(r[R].src)},k=()=>{e()},C=()=>{s>30&&c(s-10)},I=()=>{c(s+10)},B=R=>{R.target!==i.current&&R.target===i.current.parentElement&&k()},F=R=>{if(R.ctrlKey){R.preventDefault();const j=i.current,z=R.nativeEvent.offsetX,q=R.nativeEvent.offsetY,$=z/j.clientWidth,J=q/j.clientHeight;let ae;R.deltaY>0?ae=s/pD:ae=s*pD,ae>hD?ae=hD:ae<mD&&(ae=mD);const ie=s;c(ae);const ge=R.currentTarget;ge.scrollLeft+=(ae-ie)*$,ge.scrollTop+=(ae-ie)*J}else R.deltaX!==0&&(R.currentTarget.scrollLeft+=R.deltaX)},_=async()=>{if(m&&!n)await dD(t);else if(n){const j=r[h].parentElement.getAttribute("src");if(!j){await dD(m);return}await j7(d,j)}};return D.jsxs(D.Fragment,{children:[D.jsx("button",{ref:b.close,className:"btn close-btn",onClick:k}),D.jsxs("div",{className:"img-container internal-embed image-embed is-loaded",onClick:B,onWheel:F,children:[D.jsx("img",{className:s<=0?"hidden":"",ref:i,height:s+"%",src:m}),D.jsx("span",{className:"loading-text "+(s===-1?"":"hidden"),children:O("Image is loading...")}),D.jsx("span",{className:"loading-text "+(s===0?"":"hidden"),children:O("😟 Cannot load image, image link maybe broken")})]}),D.jsxs("div",{className:"action-btns-container",children:[r&&(r==null?void 0:r.length)>1&&D.jsxs(D.Fragment,{children:[D.jsx("button",{ref:b.previous,className:"btn",onClick:T}),D.jsx("button",{ref:b.next,className:"btn",onClick:E})]}),D.jsx("button",{ref:b.decrease,className:"btn",onClick:C}),D.jsx("button",{ref:b.increase,className:"btn",onClick:I}),D.jsx("button",{ref:b.zoom,className:"btn",onClick:()=>c(80)}),D.jsx("button",{ref:b.copy,className:"btn",onClick:_})]})]})};function D3({imgUrl:e,filepath:t,otherIMGEls:n,currentIndex:r}){Sh({className:"preview-image-dialog"},B7,{...{imgUrl:e,otherIMGEls:n,currentIndex:r},filepath:t})}const Y7=e=>{const{app:t,view:n}=xe.getState().dailyNotesState,{memo:r}=e,o={...r,createdAtStr:Ue.getDateTimeString(r.createdAt),timeStr:Ue.getTimeString(r.createdAt)},i=Q.useRef(null),s=Q.useRef(null);A.useEffect(()=>{if(!s.current||!i.current||(s.current.hasChildNodes()&&s.current.children[0].detach(),!n))return;async function m(){var b;await N.MarkdownRenderer.render(t,r.content.replaceAll(/<br>/g,`
`)+`
`,s.current,r.path,n);const w=(b=s.current)==null?void 0:b.querySelectorAll(".internal-link");w==null||w.forEach(T=>{const E=T,k=E.getAttribute("data-href");if(!k)return;t.metadataCache.getFirstLinkpathDest(k,r.path)||T.classList.add("is-unresolved"),E.addEventListener("mouseover",I=>{I.stopPropagation(),t.workspace.trigger("hover-link",{event:I,source:"thino",hoverParent:n.containerEl,targetEl:E,linktext:k,sourcePath:E.href})})})}m()},[e.memo.content]);const c=()=>{e.onClickThino&&e.onClickThino(o)},d=async(m,w,b)=>{var k;const T=((k=b.parentElement.dataset)==null?void 0:k.task)==="x"?"DONE":"TODO",E=[...(w==null?void 0:w.querySelectorAll("li.task-list-item"))??[]];for(const C of E)if(C===b||C===b.closest("li.task-list-item")){const I=E.indexOf(C),B=m.content.replace(/<br>/g,`
`).split(/\n/),F=[];for(let q=0;q<B.length;q++)(B[q].trim().startsWith("- [ ]")||B[q].trim().startsWith("- [x]"))&&F.push(q);const _=F[I],j=B[_].replace(/- \[ \] |- \[x\] /g,T==="TODO"?"- [x] ":"- [ ] ");B[_]=j;const z=B.join(`
`).trim();if(m&&m.content!==z){const q=await Me.updateMemo(m.id,z);Me.editMemo(q)}}},h=async m=>{m.preventDefault();const w=m.target;if(w.tagName==="INPUT"&&w.hasClass("task-list-item-checkbox")){await d(o,i.current,w);return}};return A.useMemo(()=>D.jsxs("div",{ref:i,className:"daily-memo-wrapper",children:[D.jsx("div",{className:"time-wrapper",onClick:c,children:D.jsx("span",{className:"normal-text",children:o.timeStr})}),D.jsx("div",{className:"memo-content-container",children:D.jsx("div",{ref:s,onClick:h,className:"memo-content-text"})})]}),[r.content])},H7=typeof window<"u"?A.useLayoutEffect:A.useEffect;function U7(e,t,n,r){const o=A.useRef(t);H7(()=>{o.current=t},[t]),A.useEffect(()=>{const i=(n==null?void 0:n.current)??window;if(!(i&&i.addEventListener))return;const s=c=>{o.current(c)};return i.addEventListener(e,s,r),()=>{i.removeEventListener(e,s,r)}},[e,n,r])}function Eh(e,t,n="mousedown"){U7(n,r=>{const o=r.target;if(!o||!o.isConnected||o.closest(".suggestion-container")||o.closest(".menu"))return;(Array.isArray(e)?e.every(s=>s.current&&!s.current.contains(o)):e.current&&!e.current.contains(o))&&t(r)})}const S3=e=>{const{year:t,handleYearChange:n}=e,[r,o]=A.useState([]),[i,s]=A.useState(t),c=A.useRef(null),d=A.useRef(null),[h,g]=Q.useState(!1),m=Q.useRef(null);Eh(m,()=>{g(!1)}),A.useEffect(()=>{c.current&&N.setIcon(c.current,"chevron-left"),d.current&&N.setIcon(d.current,"chevron-right")},[c,d,h]),A.useEffect(()=>{b(i)},[t]);const b=T=>{const E=parseInt(T),k=E-E%10,C=[];for(let I=0;I<10;I++)C.push(`${k+I}`);o(C)};return D.jsxs(D.Fragment,{children:[D.jsxs("span",{className:"btn year-btn",onClick:()=>{g(!h)},children:[D.jsx("span",{children:t}),D.jsx("span",{children:O("year")})]}),h&&D.jsxs("div",{ref:m,className:"year-picker-wrapper",children:[D.jsxs("div",{className:"year-picker-header",children:[D.jsxs("div",{className:"year-picker-header-title",children:[i," "+(O("year")||"")]}),D.jsxs("div",{className:"year-picker-header-btns",children:[D.jsx("span",{className:"btn",ref:c,onClick:()=>{const T=parseInt(i)-10;s(T.toString()),b(T.toString())}}),D.jsx("span",{className:"btn",ref:d,onClick:()=>{const T=parseInt(i)+10;s(T.toString()),b(T.toString())}})]})]}),D.jsx("div",{className:"year-picker-body",children:D.jsx("div",{className:"year-picker-body-list",children:r.map(T=>D.jsx("div",{className:`year-picker-body-item ${T===i?"selected":""}`,onClick:()=>{s(T),n(T),g(!1)},children:T},T))})})]})]})},E3=e=>{const{month:t,handleMonthChange:n}=e,[r,o]=A.useState([]),[i,s]=A.useState((parseInt(t)+1).toString()),[c,d]=Q.useState(!1),h=Q.useRef(null);Eh(h,()=>{d(!1)}),A.useEffect(()=>{m()},[t]);const m=()=>{const w=[];for(let b=1;b<=12;b++)w.push(`${b}`);o(w)};return D.jsxs(D.Fragment,{children:[D.jsxs("span",{className:"btn month-btn",onClick:()=>{d(!c)},children:[D.jsxs("span",{children:[O("monthsShort")[parseInt(t)]||parseInt(t)+1," "]}),D.jsx("span",{children:O("month")||""})]}),c&&D.jsxs("div",{ref:h,className:"month-picker-wrapper",children:[D.jsxs("div",{className:"month-picker-header",children:[D.jsxs("div",{className:"month-picker-header-title",children:[i," "+(O("month")||"")]}),D.jsx("div",{className:"month-picker-header-btns"})]}),D.jsx("div",{className:"month-picker-body",children:D.jsx("div",{className:"month-picker-body-list",children:r.map(w=>D.jsx("div",{className:`month-picker-body-item ${w===i?"selected":""}`,onClick:()=>{s(w),n(w),d(!1)},children:w},w))})})]})]})},kv=e=>{const{className:t,datestamp:n,handleDateStampChange:r}=e,[o,i]=A.useState(kp(n)),[s,c]=A.useState(n);A.useEffect(()=>{i(kp(n))},[n]);const d=new Date(o),h=d.getDay(),g=[];for(let T=0;T<h;T++)g.push({date:0,datestamp:d.getTime()-Si*(7-T)});const m=V7(o);for(let T=1;T<=m;T++)g.push({date:T,datestamp:d.getTime()+Si*(T-1)});const w=(T,E)=>{r(E,T.nativeEvent),c(E)},b=T=>{const E=d.getFullYear(),k=d.getMonth()+1;let C=0;k===1&&T===-1?C=new Date(`${E-1}/12/1`).getTime():k===12&&T===1?C=new Date(`${E+1}/1/1`).getTime():C=new Date(`${E}/${k+T}/1`).getTime(),i(kp(C))};return D.jsxs("div",{className:`date-picker-wrapper ${t}`,children:[D.jsxs("div",{className:"date-picker-header",children:[D.jsx("span",{ref:T=>{T&&N.setIcon(T,"chevron-left")},className:"btn btn-text",onClick:()=>b(-1)}),D.jsxs("span",{className:"normal-text",children:[D.jsx(S3,{year:d.getFullYear().toString(),handleYearChange:T=>{i(kp(new Date(`${T}/${d.getMonth()+1}/1`).getTime()))}}),D.jsx(E3,{month:d.getMonth().toString(),handleMonthChange:T=>{i(kp(new Date(`${d.getFullYear()}/${parseInt(T)}/1`).getTime()))}})]}),D.jsx("span",{ref:T=>{T&&N.setIcon(T,"chevron-right")},className:"btn btn-text",onClick:()=>b(1)})]}),D.jsxs("div",{className:"date-picker-day-container",children:[D.jsx("div",{className:"date-picker-day-header",children:O("weekDaysShort").map(T=>D.jsx("span",{className:"day-item",children:T},T))}),D.jsx("div",{className:"date-picker-day-content",children:g.map(T=>T.date===0?D.jsx("span",{className:"day-item null",children:""},T.datestamp):D.jsx("span",{className:`day-item ${T.datestamp===n?"current":""} ${T.datestamp===s?"selected":""}`,onClick:E=>w(E,T.datestamp),children:D.jsx("span",{className:"day-item-text",children:T.date})},T.datestamp))})]})]})};function V7(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return((n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-n.getTime())/Si}function kp(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}const z7=e=>{const{dailyNotesState:{app:t,view:n}}=A.useContext(Nt),{memo:r,handleMemoContentClick:o,handleMemoDoubleClick:i}=e,s=Q.useRef(null),[c,d]=Q.useState("");return A.useEffect(()=>{if(!s.current||s.current.hasChildNodes()&&r.content===c||!n||!t)return;d(r.content),s.current.hasChildNodes()&&s.current.empty(),(async()=>{var m,w;await N.MarkdownRenderer.render(t,r.content.replaceAll(/<br>/g,`
`)+`
`,s.current,r.path,n),(m=s.current)==null||m.toggleClass(["markdown-rendered"],!0);const g=(w=s.current)==null?void 0:w.querySelectorAll(".internal-link");g==null||g.forEach(b=>{const T=b,E=T.getAttribute("data-href");if(!E)return;t.metadataCache.getFirstLinkpathDest(E,r.path)||b.classList.add("is-unresolved"),T.addEventListener("mouseover",C=>{C.stopPropagation(),t.workspace.trigger("hover-link",{event:C,source:"thino",hoverParent:n.containerEl,targetEl:T,linktext:E,sourcePath:T.href})})})})()},[r.content,n,t]),D.jsx("div",{ref:s,className:"memo-content-text",onClick:h=>o(h,r),onDoubleClick:i,onContextMenu:h=>{h.preventDefault()}})},T3=A.memo(z7),$7=e=>{const[t,n]=A.useState({...e.memo,createdAtStr:Ue.getDateTimeString(e.memo.createdAt)}),[r,o]=A.useState([]),[i,s]=A.useState([]);A.useEffect(()=>{(async()=>{try{const m=[],w=[...t.content.matchAll(Ou)];for(const T of w)if(T&&T.length===3){const E=T[2],k=Me.getMemoById(E);k&&m.push({...k,createdAtStr:Ue.getDateTimeString(k.createdAt),dateStr:Ue.getDateString(k.createdAt)})}o([...m]);const b=await Me.getLinkedMemos(t.id);s(b.sort((T,E)=>Ue.getTimeStampByDate(E.createdAt)-Ue.getTimeStampByDate(T.createdAt)).map(T=>({...T,createdAtStr:Ue.getDateTimeString(T.createdAt),dateStr:Ue.getDateString(T.createdAt)})))}catch(m){console.error(m)}})()},[t.id]);const c=A.useCallback(async g=>{var w;const m=g.target;if(m.className==="memo-link-text"){const b=(w=m.dataset)==null?void 0:w.value,T=Me.getMemoById(b??"");if(T){const E={...T,createdAtStr:Ue.getDateTimeString(T.createdAt)};o([]),s([]),n(E)}else new N.Notice(O("Thino not found")),m.classList.remove("memo-link-text")}},[]),d=A.useCallback(g=>{o([]),s([]),n(g)},[]),h=A.useCallback(()=>{e.destroy(),rt.setEditMemoId(t.id)},[t.id]);return D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"memo-card-container",children:[D.jsxs("div",{className:"header-container",children:[D.jsx("span",{className:"time-text",children:t.createdAtStr}),D.jsxs("div",{className:"btns-container",children:[D.jsx("button",{ref:g=>{g&&N.setIcon(g,"edit")},className:"btn edit-btn",onClick:h}),D.jsx("button",{ref:g=>{g&&N.setIcon(g,"x")},className:"btn close-btn",onClick:e.destroy})]})]}),D.jsx("div",{className:"memo-container",children:D.jsx("div",{className:"memo-content-text",children:D.jsx(T3,{memo:e.memo,handleMemoContentClick:c,handleMemoDoubleClick:()=>{}})})}),D.jsx("div",{className:"layer-container"}),r.map((g,m)=>m<4?D.jsx("div",{className:"background-layer-container",style:{bottom:(m+1)*-3+"px",left:(m+1)*5+"px",width:`calc(100% - ${(m+1)*10}px)`,zIndex:-m-1}},m):null)]}),r.length>0?D.jsxs("div",{className:"linked-memos-wrapper",children:[D.jsxs("span",{className:"normal-text",children:[O("LINKED")," ",r.length," THINO"," "]}),r.map(g=>{const m=kb(n1(g.content)).replaceAll(`
`," ");return D.jsxs("div",{className:"linked-memo-container",onClick:()=>d(g),children:[D.jsxs("span",{className:"time-text",children:[g.dateStr," "]}),m]},g.id)})]}):null,i.length>0?D.jsxs("div",{className:"linked-memos-wrapper",children:[D.jsxs("span",{className:"normal-text",children:[i.length," THINO ",O("LINK TO THE")," THINO"]}),i.map(g=>{const m=kb(n1(g.content)).replaceAll(`
`," ");return D.jsxs("div",{className:"linked-memo-container",onClick:()=>d(g),children:[D.jsxs("span",{className:"time-text",children:[g.dateStr," "]}),m]},g.id)})]}):null]})};function Nv(e){Sh({className:"memo-card-dialog"},$7,{memo:e})}const q7=e=>{const{memoState:{memos:t}}=A.useContext(Nt),n=Vf(),[r,o]=A.useState([]),[i,s]=A.useState(Ue.getDateStampByDate(Ue.getDateString(e.currentDateStamp))),[c,d]=Oa(!1),h=A.useRef(null),g=new Date(i),{vault:m}=xe.getState().dailyNotesState.app,w=xe.getState().dailyNotesState.settings;A.useEffect(()=>{(()=>{const I=t.filter(B=>Ue.getTimeStampByDate(B.createdAt)>=i&&Ue.getTimeStampByDate(B.createdAt)<i+Si).filter(B=>B.deletedAt==="").sort((B,F)=>Ue.getTimeStampByDate(B.createdAt)-Ue.getTimeStampByDate(F.createdAt));o(I),n.setFinish()})()},[i,t]);const b=(C,I)=>{const B=window.atob(C),F=new ArrayBuffer(B.length),_=new Uint8Array(F);for(let R=0;R<B.length;R++)_[R]=B.charCodeAt(R);return new Blob([F],{type:I})},T=async()=>{d(!1),setTimeout(()=>{h.current&&w3(h.current,{backgroundColor:"#ffffff",pixelRatio:window.devicePixelRatio*2}).then(C=>{if(w!=null&&w.AutoSaveWhenOnMobile&&N.Platform.isMobile){const I=C.split("base64,")[1];b(I,"image/png").arrayBuffer().then(async F=>{let _;const R="png",j=Au();for(const z in j)if(j[z]instanceof N.TFile){_=j[z];break}_!==void 0&&await m.createBinary(await m.getAvailablePathForAttachments(`Pasted Image ${N.moment().format("YYYYMMDDHHmmss")}`,R,_),F)})}D3({imgUrl:C})}).catch(()=>{})},0)},E=C=>{s(C),d(!1)},k=A.useMemo(()=>D.jsxs("div",{className:"header-wrapper",children:[D.jsx("span",{className:"title-text",children:O("Daily Memos")}),D.jsxs("div",{className:"btns-container",children:[D.jsx("span",{ref:C=>{N.setIcon&&C&&N.setIcon(C,"chevron-left")},className:"btn btn-text",onClick:()=>s(C=>C-Si)}),D.jsx("span",{ref:C=>{N.setIcon&&C&&N.setIcon(C,"chevron-right")},className:"btn btn-text",onClick:()=>s(C=>C+Si)}),D.jsx("span",{ref:C=>{N.setIcon&&C&&N.setIcon(C,"share")},className:"btn btn-text share-btn",onClick:T}),D.jsx("span",{ref:C=>{N.setIcon&&C&&N.setIcon(C,"x")},className:"btn btn-text",onClick:()=>e.destroy()})]})]}),[]);return D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"dialog-header-container",children:k}),D.jsxs("div",{className:"dialog-content-container",ref:h,children:[D.jsxs("div",{className:"date-card-container",onClick:()=>d(),children:[D.jsx("div",{className:"year-text",children:g.getFullYear()}),D.jsxs("div",{className:"date-container",children:[D.jsx("div",{className:"month-text",children:O("months")[g.getMonth()]}),D.jsx("div",{className:"date-text",children:g.getDate()}),D.jsx("div",{className:"day-text",children:O("weekDays")[g.getDay()]})]})]}),D.jsx(kv,{className:`date-picker ${c?"":"hidden"}`,datestamp:i,handleDateStampChange:E}),n.isLoading?D.jsx("div",{className:"tip-container",children:D.jsx("span",{className:"tip-text",children:O("Loading...")})}):r.length===0?D.jsx("div",{className:"tip-container",children:D.jsx("span",{className:"tip-text",children:O("Noooop!")})}):D.jsx("div",{className:"dailymemos-wrapper",children:r.map(C=>D.jsx(Y7,{memo:C,onClickThino:I=>{e.destroy(),Nv(I)}},`${C.id}-${C.updatedAt}`))})]})]})};function Up(e=Date.now()){Sh({className:"daily-memo-diary-dialog"},q7,{currentDateStamp:e})}const W7=()=>{const{memoState:{memos:e,tags:t},locationState:{pathname:n},dailyNotesState:{settings:r,app:o,verifyState:i},globalState:{manifest:s,showSiderbarInMobileView:c}}=A.useContext(Nt),[d,h]=A.useState("Memos"),[g,m]=A.useState(0),[w,b]=A.useState(0),[T,E]=A.useState(0),[k,C]=A.useState(null),[I,B]=A.useState(!1),F=Q.useRef(null),[_,R]=A.useState(0),[j,z]=A.useState(0),[q,$]=A.useState(!1);A.useEffect(()=>{r&&h(r.UserName)},[r]),A.useLayoutEffect(()=>{if(!o)return;const{tags:ie,memos:ge,days:pe}=G7(o);E(ie),m(ge),b(pe)},[o]),A.useEffect(()=>{let ie=0;const ge=g-_,pe=1e3,fe=De=>{ie||(ie=De);const re=De-ie;if(re<pe){const be=re/pe;R(_+ge*be),requestAnimationFrame(fe)}else R(g)};requestAnimationFrame(fe)},[g]),A.useEffect(()=>{let ie=0;const ge=w-j,pe=1e3,fe=De=>{ie||(ie=De);const re=De-ie;if(re<pe){const be=re/pe;z(j+ge*be),requestAnimationFrame(fe)}else z(w)};requestAnimationFrame(fe)},[w]),A.useEffect(()=>{!r||!o||(B(g>9999||T>999||w>999),K7({tags:T,memos:g,days:w},o))},[g,T,w]),A.useEffect(()=>{Me.initialized&&e&&n==="/"&&(E(t.length),m(e.filter(ie=>!(ie.deletedAt!==""&&ie.deletedAt)).length),C(e.length>0?e[e.length-1]:null))},[t,e,n]),A.useEffect(()=>{if(!Me.initialized)return;if(!k){b(0);return}if(!F.current||!(k!=null&&k.createdAt))return;N.requireApiVersion("1.4.4")&&N.setTooltip(F.current,O("Started from")+" "+Ue.getDateTimeString((k==null?void 0:k.createdAt)??""));const ie=Math.ceil((Date.now()-Ue.getTimeStampByDate(k==null?void 0:k.createdAt))/1e3/3600/24);b(e?ie:0)},[k]);const J=A.useCallback(()=>{it.pushHistory("/"),it.clearQuery()},[]),ae=()=>{const ie=document.querySelector(".memos-sidebar-wrapper"),ge=document.querySelector(".menu-btns-popup");ge.style.top=70-ie.scrollTop+"px",$(!0)};return D.jsxs("div",{className:"user-banner-container",children:[D.jsxs("div",{className:"userinfo-header-container",children:[D.jsxs("span",{className:"username-container",children:[D.jsx("span",{className:"username-text",onClick:J,children:d==="MEMO 😉"?"THINO 😉":d??"THINO"}),D.jsx("span",{className:`user-pro-badge ${i?"activated":""}`,onClick:()=>{o.setting.open(),o.setting.openTabById(s.id??"obsidian-memos")},children:"PRO"})]}),D.jsxs("span",{className:"btn-group",children:[D.jsx("span",{ref:ie=>{ie&&ie.hasChildNodes()||ie&&N.setIcon(ie,"more-horizontal")},className:"btn action-btn menu-popup-btn",onClick:ae}),c&&D.jsx("span",{ref:ie=>{ie&&ie.hasChildNodes()||ie&&N.setIcon(ie,"x")},className:"btn action-btn",onClick:()=>{rt.setShowSiderbarInMobileView(!1)}})]}),D.jsx(N7,{shownStatus:q,setShownStatus:$})]}),D.jsxs("div",{className:`status-text-container ${I?"text-overflow":""}`,children:[D.jsxs("div",{className:"status-text memos-text",children:[D.jsx("span",{className:"amount-text",children:Math.round(_)}),D.jsx("span",{className:"type-text",children:"THINO"})]}),D.jsxs("div",{className:"status-text tags-text",children:[D.jsx("span",{className:"amount-text",children:T}),D.jsx("span",{className:"type-text",children:O("TAG")})]}),D.jsxs("div",{ref:F,className:"status-text duration-text",onClick:()=>Up(),children:[D.jsx("span",{className:"amount-text",children:Math.round(j)??0}),D.jsx("span",{className:"type-text",children:O("DAY")})]})]})]})};function C3(e){return`userBannerCache:${e}`}function G7(e){try{const t=C3(e.appId),n=zn.get([t])[t];return n?JSON.parse(n):{tags:0,memos:0,days:0}}catch(t){return console.error(t),{tags:0,memos:0,days:0}}}function K7({tags:e,memos:t,days:n},r){try{const o={tags:e,memos:t,days:n},i=C3(r.appId);zn.set({[i]:JSON.stringify(o)})}catch(o){console.error(o)}}const Q7=e=>{const{children:t,when:n}=e;return n?D.jsx(D.Fragment,{children:t}):null},Fa=Q7,Z7=[{text:O("AND"),value:"AND"},{text:O("OR"),value:"OR"}],sl={TAG:{value:"TAG",text:O("TAG"),operators:[{text:O("INCLUDE"),value:"CONTAIN"},{text:O("EXCLUDE"),value:"NOT_CONTAIN"}]},TYPE:{value:"TYPE",text:O("TYPE"),operators:[{value:"IS",text:O("IS")},{value:"IS_NOT",text:O("ISNOT")}],values:[{value:"CONNECTED",text:O("LINKED")},{value:"NOT_TAGGED",text:O("NO TAGS")},{value:"LINKED",text:O("HAS LINKS")},{value:"IMAGED",text:O("HAS IMAGES")}]},TEXT:{value:"TEXT",text:O("TEXT"),operators:[{value:"CONTAIN",text:O("INCLUDE")},{value:"NOT_CONTAIN",text:O("EXCLUDE")}]},DATE:{value:"DATE",text:O("DATE"),operators:[{value:"NOT_CONTAIN",text:O("BEFORE")},{value:"CONTAIN",text:O("AFTER")}]},LIST:{value:"LIST",text:O("LIST"),operators:[{value:"IS",text:O("IS")},{value:"IS_NOT",text:O("ISNOT")}],values:[{value:"TODO",text:O("TODO")},{value:"DONE",text:O("DONE")},{value:"LIST",text:O("JOURNAL")},{value:"OTHER",text:O("OTHER")}]},SOURCE:{value:"SOURCE",text:O("SOURCE"),operators:[{value:"IS",text:O("IS")},{value:"IS_NOT",text:O("ISNOT")}],values:[{value:"DAILY",text:O("DAILY")},{value:"MULTI",text:O("MULTI")},{value:"FILE",text:O("FILE")},{value:"CANVAS",text:O("CANVAS")}]}},v1=sl.TYPE.values,J7=e=>{for(const t of v1)if(t.value===e)return t.text;return""},gD=()=>({type:"TAG",value:{operator:"CONTAIN",value:""},relation:"AND"}),Th=(e,t)=>{let n=!0;for(const r of t){const{relation:o}=r,i=X7(e,r);o==="OR"?n=n||i:n=n&&i}return n},X7=(e,t)=>{const{type:n,value:{operator:r,value:o}}=t;if(o==="")return!0;let i=!0;if(n==="TAG"){let s=!0;const c=new Set;for(const d of Array.from(e.content.match(ir)??[])){const g=d.replace(ir,"$1").trim().split("/");let m="";for(const w of g)m+=w,c.add(m),m+="/"}for(const d of Array.from(e.content.match(Lr)??[])){const g=d.replace(Lr,"$1").trim().split("/");let m="";for(const w of g)m+=w,c.add(m),m+="/"}c.has(o)||(s=!1),r==="NOT_CONTAIN"&&(s=!s),i=s}else if(n==="TYPE"){let s=!1;(o==="NOT_TAGGED"&&e.content.match(ir)===null&&e.content.match(_o)===null||o==="LINKED"&&e.content.match(Rf)!==null||o==="IMAGED"&&e.content.match(Lf)!==null||o==="CONNECTED"&&e.content.match(Ou)!==null)&&(s=!0),r==="IS_NOT"&&(s=!s),i=s}else if(n==="TEXT"){let s=e.content.toLowerCase().includes(o.toLowerCase());r==="NOT_CONTAIN"&&(s=!s),i=s}else if(n==="LIST"){let c=(e.thinoType==="JOURNAL"?"LIST":e.thinoType==="TASK-TODO"?"TODO":e.thinoType==="TASK-DONE"?"DONE":"OTHER").contains(o);r==="IS_NOT"&&(c=!c),i=c}else if(n==="SOURCE"){let s=e.sourceType===o;r==="IS_NOT"&&(s=!s),i=s}else if(n==="DATE"){const s=N.moment(o,"YYYY-MM-DD").isValid();let c,d;if(s)c=N.moment(o,"YYYY-MM-DD"),d=c.isBefore(N.moment(e.createdAt,"YYYY-MM-DD HH:mm:ss"),"day");else{const g=(app.plugins.enabledPlugins.has("nldates-obsidian")&&app.plugins.getPlugin("nldates-obsidian")).parseDate(o);g.date!==null&&(d=g.moment.isBefore(N.moment(e.createdAt),"day"))}r==="NOT_CONTAIN"&&(d=!d),i=d}return i=e.linkId===""?i:!1,i},e9={text:O("SELECT"),value:""},t9=e=>{const{className:t,dataSource:n,handleValueChanged:r,value:o}=e,[i,s]=Oa(!1),c=A.useRef(null);let d=e9;for(const m of n)if(m.value===o){d=m;break}A.useEffect(()=>{if(i){const m=w=>{var b;(b=c.current)!=null&&b.contains(w.target)||s(!1)};window.addEventListener("click",m,{capture:!0,once:!0})}},[i]);const h=m=>{r&&r(m.value),s(!1)},g=m=>{m.stopPropagation(),s()};return D.jsxs("div",{className:`selector-wrapper ${t??""}`,ref:c,children:[D.jsxs("div",{className:`current-value-container ${i?"active":""}`,onClick:g,children:[D.jsx("span",{className:"value-text",children:d.text}),D.jsx("span",{ref:m=>{m&&N.setIcon(m,"chevron-right")},className:"btn arrow-text"})]}),D.jsx("div",{className:`items-wrapper ${i?"":"hidden"}`,children:n.map(m=>D.jsx("div",{className:`item-container ${m.value===o?"selected":""}`,onClick:()=>{h(m)},children:m.text},m.value))})]})},pf=A.memo(t9);var vD=function(t){return t.reduce(function(n,r){var o=r[0],i=r[1];return n[o]=i,n},{})},yD=typeof window<"u"&&window.document&&window.document.createElement?A.useLayoutEffect:A.useEffect,mo="top",aa="bottom",ia="right",go="left",fw="auto",Ch=[mo,aa,ia,go],Ef="start",Kp="end",n9="clippingParents",x3="viewport",Np="popper",r9="reference",wD=Ch.reduce(function(e,t){return e.concat([t+"-"+Ef,t+"-"+Kp])},[]),dw=[].concat(Ch,[fw]).reduce(function(e,t){return e.concat([t,t+"-"+Ef,t+"-"+Kp])},[]),o9="beforeRead",a9="read",i9="afterRead",s9="beforeMain",l9="main",u9="afterMain",c9="beforeWrite",f9="write",d9="afterWrite",p9=[o9,a9,i9,s9,l9,u9,c9,f9,d9];function Ti(e){return e?(e.nodeName||"").toLowerCase():null}function jo(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Cu(e){var t=jo(e).Element;return e instanceof t||e instanceof Element}function oa(e){var t=jo(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function pw(e){if(typeof ShadowRoot>"u")return!1;var t=jo(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function h9(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!oa(i)||!Ti(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var c=o[s];c===!1?i.removeAttribute(s):i.setAttribute(s,c===!0?"":c)}))})}function m9(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),c=s.reduce(function(d,h){return d[h]="",d},{});!oa(o)||!Ti(o)||(Object.assign(o.style,c),Object.keys(i).forEach(function(d){o.removeAttribute(d)}))})}}const g9={name:"applyStyles",enabled:!0,phase:"write",fn:h9,effect:m9,requires:["computeStyles"]};function Ei(e){return e.split("-")[0]}var Eu=Math.max,rv=Math.min,Tf=Math.round;function y1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function M3(){return!/^((?!chrome|android).)*safari/i.test(y1())}function Cf(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&oa(e)&&(o=e.offsetWidth>0&&Tf(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Tf(r.height)/e.offsetHeight||1);var s=Cu(e)?jo(e):window,c=s.visualViewport,d=!M3()&&n,h=(r.left+(d&&c?c.offsetLeft:0))/o,g=(r.top+(d&&c?c.offsetTop:0))/i,m=r.width/o,w=r.height/i;return{width:m,height:w,top:g,right:h+m,bottom:g+w,left:h,x:h,y:g}}function hw(e){var t=Cf(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function k3(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&pw(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ls(e){return jo(e).getComputedStyle(e)}function v9(e){return["table","td","th"].indexOf(Ti(e))>=0}function wl(e){return((Cu(e)?e.ownerDocument:e.document)||window.document).documentElement}function Fv(e){return Ti(e)==="html"?e:e.assignedSlot||e.parentNode||(pw(e)?e.host:null)||wl(e)}function bD(e){return!oa(e)||ls(e).position==="fixed"?null:e.offsetParent}function y9(e){var t=/firefox/i.test(y1()),n=/Trident/i.test(y1());if(n&&oa(e)){var r=ls(e);if(r.position==="fixed")return null}var o=Fv(e);for(pw(o)&&(o=o.host);oa(o)&&["html","body"].indexOf(Ti(o))<0;){var i=ls(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function xh(e){for(var t=jo(e),n=bD(e);n&&v9(n)&&ls(n).position==="static";)n=bD(n);return n&&(Ti(n)==="html"||Ti(n)==="body"&&ls(n).position==="static")?t:n||y9(e)||t}function mw(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Vp(e,t,n){return Eu(e,rv(t,n))}function w9(e,t,n){var r=Vp(e,t,n);return r>n?n:r}function N3(){return{top:0,right:0,bottom:0,left:0}}function F3(e){return Object.assign({},N3(),e)}function I3(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var b9=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,F3(typeof t!="number"?t:I3(t,Ch))};function D9(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,c=Ei(n.placement),d=mw(c),h=[go,ia].indexOf(c)>=0,g=h?"height":"width";if(!(!i||!s)){var m=b9(o.padding,n),w=hw(i),b=d==="y"?mo:go,T=d==="y"?aa:ia,E=n.rects.reference[g]+n.rects.reference[d]-s[d]-n.rects.popper[g],k=s[d]-n.rects.reference[d],C=xh(i),I=C?d==="y"?C.clientHeight||0:C.clientWidth||0:0,B=E/2-k/2,F=m[b],_=I-w[g]-m[T],R=I/2-w[g]/2+B,j=Vp(F,R,_),z=d;n.modifiersData[r]=(t={},t[z]=j,t.centerOffset=j-R,t)}}function S9(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||k3(t.elements.popper,o)&&(t.elements.arrow=o))}const A3={name:"arrow",enabled:!0,phase:"main",fn:D9,effect:S9,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xf(e){return e.split("-")[1]}var E9={top:"auto",right:"auto",bottom:"auto",left:"auto"};function T9(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Tf(n*o)/o||0,y:Tf(r*o)/o||0}}function DD(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,c=e.position,d=e.gpuAcceleration,h=e.adaptive,g=e.roundOffsets,m=e.isFixed,w=s.x,b=w===void 0?0:w,T=s.y,E=T===void 0?0:T,k=typeof g=="function"?g({x:b,y:E}):{x:b,y:E};b=k.x,E=k.y;var C=s.hasOwnProperty("x"),I=s.hasOwnProperty("y"),B=go,F=mo,_=window;if(h){var R=xh(n),j="clientHeight",z="clientWidth";if(R===jo(n)&&(R=wl(n),ls(R).position!=="static"&&c==="absolute"&&(j="scrollHeight",z="scrollWidth")),o===mo||(o===go||o===ia)&&i===Kp){F=aa;var q=m&&R===_&&_.visualViewport?_.visualViewport.height:R[j];E-=q-r.height,E*=d?1:-1}if(o===go||(o===mo||o===aa)&&i===Kp){B=ia;var $=m&&R===_&&_.visualViewport?_.visualViewport.width:R[z];b-=$-r.width,b*=d?1:-1}}var J=Object.assign({position:c},h&&E9),ae=g===!0?T9({x:b,y:E},jo(n)):{x:b,y:E};if(b=ae.x,E=ae.y,d){var ie;return Object.assign({},J,(ie={},ie[F]=I?"0":"",ie[B]=C?"0":"",ie.transform=(_.devicePixelRatio||1)<=1?"translate("+b+"px, "+E+"px)":"translate3d("+b+"px, "+E+"px, 0)",ie))}return Object.assign({},J,(t={},t[F]=I?E+"px":"",t[B]=C?b+"px":"",t.transform="",t))}function C9(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,c=n.roundOffsets,d=c===void 0?!0:c,h={placement:Ei(t.placement),variation:xf(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,DD(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:d})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,DD(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const O3={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:C9,data:{}};var Dg={passive:!0};function x9(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,c=s===void 0?!0:s,d=jo(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&h.forEach(function(g){g.addEventListener("scroll",n.update,Dg)}),c&&d.addEventListener("resize",n.update,Dg),function(){i&&h.forEach(function(g){g.removeEventListener("scroll",n.update,Dg)}),c&&d.removeEventListener("resize",n.update,Dg)}}const R3={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:x9,data:{}};var M9={left:"right",right:"left",bottom:"top",top:"bottom"};function Hg(e){return e.replace(/left|right|bottom|top/g,function(t){return M9[t]})}var k9={start:"end",end:"start"};function SD(e){return e.replace(/start|end/g,function(t){return k9[t]})}function gw(e){var t=jo(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function vw(e){return Cf(wl(e)).left+gw(e).scrollLeft}function N9(e,t){var n=jo(e),r=wl(e),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,c=0,d=0;if(o){i=o.width,s=o.height;var h=M3();(h||!h&&t==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}return{width:i,height:s,x:c+vw(e),y:d}}function F9(e){var t,n=wl(e),r=gw(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Eu(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Eu(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),c=-r.scrollLeft+vw(e),d=-r.scrollTop;return ls(o||n).direction==="rtl"&&(c+=Eu(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:c,y:d}}function yw(e){var t=ls(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function L3(e){return["html","body","#document"].indexOf(Ti(e))>=0?e.ownerDocument.body:oa(e)&&yw(e)?e:L3(Fv(e))}function zp(e,t){var n;t===void 0&&(t=[]);var r=L3(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=jo(r),s=o?[i].concat(i.visualViewport||[],yw(r)?r:[]):r,c=t.concat(s);return o?c:c.concat(zp(Fv(s)))}function w1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function I9(e,t){var n=Cf(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function ED(e,t,n){return t===x3?w1(N9(e,n)):Cu(t)?I9(t,n):w1(F9(wl(e)))}function A9(e){var t=zp(Fv(e)),n=["absolute","fixed"].indexOf(ls(e).position)>=0,r=n&&oa(e)?xh(e):e;return Cu(r)?t.filter(function(o){return Cu(o)&&k3(o,r)&&Ti(o)!=="body"}):[]}function O9(e,t,n,r){var o=t==="clippingParents"?A9(e):[].concat(t),i=[].concat(o,[n]),s=i[0],c=i.reduce(function(d,h){var g=ED(e,h,r);return d.top=Eu(g.top,d.top),d.right=rv(g.right,d.right),d.bottom=rv(g.bottom,d.bottom),d.left=Eu(g.left,d.left),d},ED(e,s,r));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function _3(e){var t=e.reference,n=e.element,r=e.placement,o=r?Ei(r):null,i=r?xf(r):null,s=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2,d;switch(o){case mo:d={x:s,y:t.y-n.height};break;case aa:d={x:s,y:t.y+t.height};break;case ia:d={x:t.x+t.width,y:c};break;case go:d={x:t.x-n.width,y:c};break;default:d={x:t.x,y:t.y}}var h=o?mw(o):null;if(h!=null){var g=h==="y"?"height":"width";switch(i){case Ef:d[h]=d[h]-(t[g]/2-n[g]/2);break;case Kp:d[h]=d[h]+(t[g]/2-n[g]/2);break}}return d}function Qp(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,s=i===void 0?e.strategy:i,c=n.boundary,d=c===void 0?n9:c,h=n.rootBoundary,g=h===void 0?x3:h,m=n.elementContext,w=m===void 0?Np:m,b=n.altBoundary,T=b===void 0?!1:b,E=n.padding,k=E===void 0?0:E,C=F3(typeof k!="number"?k:I3(k,Ch)),I=w===Np?r9:Np,B=e.rects.popper,F=e.elements[T?I:w],_=O9(Cu(F)?F:F.contextElement||wl(e.elements.popper),d,g,s),R=Cf(e.elements.reference),j=_3({reference:R,element:B,strategy:"absolute",placement:o}),z=w1(Object.assign({},B,j)),q=w===Np?z:R,$={top:_.top-q.top+C.top,bottom:q.bottom-_.bottom+C.bottom,left:_.left-q.left+C.left,right:q.right-_.right+C.right},J=e.modifiersData.offset;if(w===Np&&J){var ae=J[o];Object.keys($).forEach(function(ie){var ge=[ia,aa].indexOf(ie)>=0?1:-1,pe=[mo,aa].indexOf(ie)>=0?"y":"x";$[ie]+=ae[pe]*ge})}return $}function R9(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,c=n.flipVariations,d=n.allowedAutoPlacements,h=d===void 0?dw:d,g=xf(r),m=g?c?wD:wD.filter(function(T){return xf(T)===g}):Ch,w=m.filter(function(T){return h.indexOf(T)>=0});w.length===0&&(w=m);var b=w.reduce(function(T,E){return T[E]=Qp(e,{placement:E,boundary:o,rootBoundary:i,padding:s})[Ei(E)],T},{});return Object.keys(b).sort(function(T,E){return b[T]-b[E]})}function L9(e){if(Ei(e)===fw)return[];var t=Hg(e);return[SD(e),t,SD(t)]}function _9(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,c=s===void 0?!0:s,d=n.fallbackPlacements,h=n.padding,g=n.boundary,m=n.rootBoundary,w=n.altBoundary,b=n.flipVariations,T=b===void 0?!0:b,E=n.allowedAutoPlacements,k=t.options.placement,C=Ei(k),I=C===k,B=d||(I||!T?[Hg(k)]:L9(k)),F=[k].concat(B).reduce(function(ue,Se){return ue.concat(Ei(Se)===fw?R9(t,{placement:Se,boundary:g,rootBoundary:m,padding:h,flipVariations:T,allowedAutoPlacements:E}):Se)},[]),_=t.rects.reference,R=t.rects.popper,j=new Map,z=!0,q=F[0],$=0;$<F.length;$++){var J=F[$],ae=Ei(J),ie=xf(J)===Ef,ge=[mo,aa].indexOf(ae)>=0,pe=ge?"width":"height",fe=Qp(t,{placement:J,boundary:g,rootBoundary:m,altBoundary:w,padding:h}),De=ge?ie?ia:go:ie?aa:mo;_[pe]>R[pe]&&(De=Hg(De));var re=Hg(De),be=[];if(i&&be.push(fe[ae]<=0),c&&be.push(fe[De]<=0,fe[re]<=0),be.every(function(ue){return ue})){q=J,z=!1;break}j.set(J,be)}if(z)for(var V=T?3:1,G=function(Se){var Re=F.find(function(Ye){var Be=j.get(Ye);if(Be)return Be.slice(0,Se).every(function(yt){return yt})});if(Re)return q=Re,"break"},le=V;le>0;le--){var we=G(le);if(we==="break")break}t.placement!==q&&(t.modifiersData[r]._skip=!0,t.placement=q,t.reset=!0)}}const P3={name:"flip",enabled:!0,phase:"main",fn:_9,requiresIfExists:["offset"],data:{_skip:!1}};function TD(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function CD(e){return[mo,ia,aa,go].some(function(t){return e[t]>=0})}function P9(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=Qp(t,{elementContext:"reference"}),c=Qp(t,{altBoundary:!0}),d=TD(s,r),h=TD(c,o,i),g=CD(d),m=CD(h);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:h,isReferenceHidden:g,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":g,"data-popper-escaped":m})}const j3={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:P9};function j9(e,t,n){var r=Ei(e),o=[go,mo].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],c=i[1];return s=s||0,c=(c||0)*o,[go,ia].indexOf(r)>=0?{x:c,y:s}:{x:s,y:c}}function B9(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,s=dw.reduce(function(g,m){return g[m]=j9(m,t.rects,i),g},{}),c=s[t.placement],d=c.x,h=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=h),t.modifiersData[r]=s}const B3={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:B9};function Y9(e){var t=e.state,n=e.name;t.modifiersData[n]=_3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Y3={name:"popperOffsets",enabled:!0,phase:"read",fn:Y9,data:{}};function H9(e){return e==="x"?"y":"x"}function U9(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,c=s===void 0?!1:s,d=n.boundary,h=n.rootBoundary,g=n.altBoundary,m=n.padding,w=n.tether,b=w===void 0?!0:w,T=n.tetherOffset,E=T===void 0?0:T,k=Qp(t,{boundary:d,rootBoundary:h,padding:m,altBoundary:g}),C=Ei(t.placement),I=xf(t.placement),B=!I,F=mw(C),_=H9(F),R=t.modifiersData.popperOffsets,j=t.rects.reference,z=t.rects.popper,q=typeof E=="function"?E(Object.assign({},t.rects,{placement:t.placement})):E,$=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),J=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,ae={x:0,y:0};if(R){if(i){var ie,ge=F==="y"?mo:go,pe=F==="y"?aa:ia,fe=F==="y"?"height":"width",De=R[F],re=De+k[ge],be=De-k[pe],V=b?-z[fe]/2:0,G=I===Ef?j[fe]:z[fe],le=I===Ef?-z[fe]:-j[fe],we=t.elements.arrow,ue=b&&we?hw(we):{width:0,height:0},Se=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:N3(),Re=Se[ge],Ye=Se[pe],Be=Vp(0,j[fe],ue[fe]),yt=B?j[fe]/2-V-Be-Re-$.mainAxis:G-Be-Re-$.mainAxis,Ee=B?-j[fe]/2+V+Be+Ye+$.mainAxis:le+Be+Ye+$.mainAxis,Ve=t.elements.arrow&&xh(t.elements.arrow),Ke=Ve?F==="y"?Ve.clientTop||0:Ve.clientLeft||0:0,Xe=(ie=J==null?void 0:J[F])!=null?ie:0,Ge=De+yt-Xe-Ke,tt=De+Ee-Xe,Dt=Vp(b?rv(re,Ge):re,De,b?Eu(be,tt):be);R[F]=Dt,ae[F]=Dt-De}if(c){var dt,Vt=F==="x"?mo:go,Yo=F==="x"?aa:ia,cn=R[_],en=_==="y"?"height":"width",br=cn+k[Vt],Dr=cn-k[Yo],_a=[mo,go].indexOf(C)!==-1,yo=(dt=J==null?void 0:J[_])!=null?dt:0,la=_a?br:cn-j[en]-z[en]-yo+$.altAxis,Qr=_a?cn+j[en]+z[en]-yo-$.altAxis:Dr,Sr=b&&_a?w9(la,cn,Qr):Vp(b?la:br,cn,b?Qr:Dr);R[_]=Sr,ae[_]=Sr-cn}t.modifiersData[r]=ae}}const H3={name:"preventOverflow",enabled:!0,phase:"main",fn:U9,requiresIfExists:["offset"]};function V9(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function z9(e){return e===jo(e)||!oa(e)?gw(e):V9(e)}function $9(e){var t=e.getBoundingClientRect(),n=Tf(t.width)/e.offsetWidth||1,r=Tf(t.height)/e.offsetHeight||1;return n!==1||r!==1}function q9(e,t,n){n===void 0&&(n=!1);var r=oa(t),o=oa(t)&&$9(t),i=wl(t),s=Cf(e,o,n),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!n)&&((Ti(t)!=="body"||yw(i))&&(c=z9(t)),oa(t)?(d=Cf(t,!0),d.x+=t.clientLeft,d.y+=t.clientTop):i&&(d.x=vw(i))),{x:s.left+c.scrollLeft-d.x,y:s.top+c.scrollTop-d.y,width:s.width,height:s.height}}function W9(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(c){if(!n.has(c)){var d=t.get(c);d&&o(d)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function G9(e){var t=W9(e);return p9.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function K9(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Q9(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var xD={placement:"bottom",modifiers:[],strategy:"absolute"};function MD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function U3(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,i=o===void 0?xD:o;return function(c,d,h){h===void 0&&(h=i);var g={placement:"bottom",orderedModifiers:[],options:Object.assign({},xD,i),modifiersData:{},elements:{reference:c,popper:d},attributes:{},styles:{}},m=[],w=!1,b={state:g,setOptions:function(C){var I=typeof C=="function"?C(g.options):C;E(),g.options=Object.assign({},i,g.options,I),g.scrollParents={reference:Cu(c)?zp(c):c.contextElement?zp(c.contextElement):[],popper:zp(d)};var B=G9(Q9([].concat(r,g.options.modifiers)));return g.orderedModifiers=B.filter(function(F){return F.enabled}),T(),b.update()},forceUpdate:function(){if(!w){var C=g.elements,I=C.reference,B=C.popper;if(MD(I,B)){g.rects={reference:q9(I,xh(B),g.options.strategy==="fixed"),popper:hw(B)},g.reset=!1,g.placement=g.options.placement,g.orderedModifiers.forEach(function($){return g.modifiersData[$.name]=Object.assign({},$.data)});for(var F=0;F<g.orderedModifiers.length;F++){if(g.reset===!0){g.reset=!1,F=-1;continue}var _=g.orderedModifiers[F],R=_.fn,j=_.options,z=j===void 0?{}:j,q=_.name;typeof R=="function"&&(g=R({state:g,options:z,name:q,instance:b})||g)}}}},update:K9(function(){return new Promise(function(k){b.forceUpdate(),k(g)})}),destroy:function(){E(),w=!0}};if(!MD(c,d))return b;b.setOptions(h).then(function(k){!w&&h.onFirstUpdate&&h.onFirstUpdate(k)});function T(){g.orderedModifiers.forEach(function(k){var C=k.name,I=k.options,B=I===void 0?{}:I,F=k.effect;if(typeof F=="function"){var _=F({state:g,name:C,instance:b,options:B}),R=function(){};m.push(_||R)}})}function E(){m.forEach(function(k){return k()}),m=[]}return b}}var Z9=[R3,Y3,O3,g9,B3,P3,H3,A3,j3],V3=U3({defaultModifiers:Z9}),J9=typeof Element<"u",X9=typeof Map=="function",eN=typeof Set=="function",tN=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Ug(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Ug(e[r],t[r]))return!1;return!0}var i;if(X9&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!Ug(r.value[1],t.get(r.value[0])))return!1;return!0}if(eN&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(tN&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(J9&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&e.$$typeof)&&!Ug(e[o[r]],t[o[r]]))return!1;return!0}return e!==e&&t!==t}var nN=function(t,n){try{return Ug(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const rN=qn(nN);var oN=[],Iv=function(t,n,r){r===void 0&&(r={});var o=A.useRef(null),i={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||oN},s=A.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),c=s[0],d=s[1],h=A.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(b){var T=b.state,E=Object.keys(T.elements);uw.flushSync(function(){d({styles:vD(E.map(function(k){return[k,T.styles[k]||{}]})),attributes:vD(E.map(function(k){return[k,T.attributes[k]]}))})})},requires:["computeStyles"]}},[]),g=A.useMemo(function(){var w={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[h,{name:"applyStyles",enabled:!1}])};return rN(o.current,w)?o.current||w:(o.current=w,w)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,h]),m=A.useRef();return yD(function(){m.current&&m.current.setOptions(g)},[g]),yD(function(){if(!(t==null||n==null)){var w=r.createPopper||V3,b=w(t,n,g);return m.current=b,function(){b.destroy(),m.current=null}}},[t,n,r.createPopper]),{state:m.current?m.current.state:null,styles:c.styles,attributes:c.attributes,update:m.current?m.current.update:null,forceUpdate:m.current?m.current.forceUpdate:null}},aN=function(){},iN=aN;const sN=qn(iN),lN=[{label:O("Today"),value:N.moment().format("YYYY-MM-DD")},{label:O("Yesterday"),value:N.moment().subtract(1,"days").format("YYYY-MM-DD")},{label:O("Last 7 days"),value:N.moment().subtract(7,"days").format("YYYY-MM-DD")},{label:O("Last 30 days"),value:N.moment().subtract(30,"days").format("YYYY-MM-DD")},{label:O("Last 90 days"),value:N.moment().subtract(90,"days").format("YYYY-MM-DD")},{label:O("Last 180 days"),value:N.moment().subtract(180,"days").format("YYYY-MM-DD")},{label:O("Last 365 days"),value:N.moment().subtract(365,"days").format("YYYY-MM-DD")}],z3=e=>{const{handleValueChange:t,setShownStatus:n}=e;return D.jsxs(D.Fragment,{children:[e.type==="icon"&&D.jsx("div",{className:"quick-date-btn-group",children:lN.map((r,o)=>D.jsx("div",{className:"btn action-btn quick-date-btn",onClick:()=>{t(r.value),n&&n(!1)},children:r.label},o))}),D.jsx(kv,{className:"calendar-date-picker",datestamp:(e==null?void 0:e.defaultValue)||N.moment().startOf("day").valueOf(),handleDateStampChange:(r,o)=>{t(e.type==="icon"?N.moment(r).format("YYYY-MM-DD"):r.toString()),n&&n(!1)}})]})},ov=e=>{const{handleValueChange:t}=e,[n,r]=Q.useState(!1),o=Q.useRef(null),i=Q.useRef(null),s=Iv(i.current,o.current,{placement:"bottom-start"});return Eh(o,()=>{r(!1)}),D.jsxs(D.Fragment,{children:[D.jsx("span",{ref:d=>{i.current=d,d&&e.type==="icon"&&N.setIcon(d,"calendar")},className:`btn calendar-btn ${e.type==="icon"?"icon-btn":"text-btn"}`,onClick:()=>{!N.Platform.isMobile&&r(!n),!N.Platform.isMobile&&(s!=null&&s.update)&&(s==null||s.update()),N.Platform.isMobile&&new $3(ut.getState().app,e.type,t).open()},children:e.type==="text"&&e.defaultValue?e.defaultText?e.defaultText:N.moment(e.defaultValue,"x").subtract(e.startOrEnd==="end"?1:0,"days").format("YYYY/MM/DD"):""}),D.jsx("div",{className:`menu-btns-popup ${n?"":"hidden"}`,ref:o,style:s.styles.popper,children:D.jsx(z3,{type:e.defaultText?"icon":e.type,handleValueChange:t,setShownStatus:r})})]})};class $3 extends N.Modal{constructor(n,r,o){super(n);ye(this,"root");ye(this,"type");ye(this,"handleValueChange");this.type=r,this.handleValueChange=o}onOpen(){const{contentEl:n}=this;this.root=Mv(n),this.root.render(D.jsx(z3,{type:this.type,handleValueChange:this.handleValueChange,setShownStatus:r=>{!r&&this.close()}}))}onClose(){var n;(n=this.root)==null||n.unmount()}}const uN=(e,t)=>(e%t+t)%t;class cN{constructor(t,n,r){ye(this,"owner");ye(this,"values");ye(this,"suggestions");ye(this,"selectedItem");ye(this,"containerEl");this.owner=t,this.containerEl=n,n.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),n.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),r.register([],"ArrowUp",o=>{if(!o.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",o=>{if(!o.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",o=>{if(!o.isComposing)return this.useSelectedItem(o),!1})}onSuggestionClick(t,n){t.preventDefault();const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1),this.useSelectedItem(t)}onSuggestionMouseover(t,n){const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1)}setSuggestions(t){this.containerEl.empty();const n=[];t.forEach(r=>{const o=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,o),n.push(o)}),this.values=t,this.suggestions=n,this.setSelectedItem(0,!1)}useSelectedItem(t){const n=this.values[this.selectedItem];n&&this.owner.selectSuggestion(n,t)}setSelectedItem(t,n){const r=uN(t,this.suggestions.length),o=this.suggestions[this.selectedItem],i=this.suggestions[r];o==null||o.removeClass("is-selected"),i==null||i.addClass("is-selected"),this.selectedItem=r,n&&i.scrollIntoView(!1)}}class q3{constructor(t,n){ye(this,"inputEl");ye(this,"popper");ye(this,"scope");ye(this,"suggestEl");ye(this,"suggest");this.cb=n,this.inputEl=t,this.scope=new N.Scope,this.suggestEl=createDiv("suggestion-container");const r=this.suggestEl.createDiv("suggestion");this.suggest=new cN(this,r,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",o=>{o.preventDefault()})}onInputChanged(){const t=this.inputEl.value,n=this.getSuggestions(t);if(!n){this.close();return}n.length>0?(this.suggest.setSuggestions(n),this.open(app.dom.appContainerEl,this.inputEl)):this.close()}open(t,n){app.keymap.pushScope(this.scope),t.appendChild(this.suggestEl),this.popper=V3(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:o})=>{const i=`${r.rects.reference.width}px`;r.styles.popper.width!==i&&(r.styles.popper.width=i,o.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}destroy(){this.inputEl.removeEventListener("input",this.onInputChanged.bind(this)),this.inputEl.removeEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.removeEventListener("blur",this.close.bind(this)),this.close()}}const fN=e=>{const t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())};let dN=class extends q3{fuzzySearchItemsOptimized(t,n){const r=N.prepareFuzzySearch(t);return n.map(o=>{const i=r(o);return i?{item:o,match:i,score:i.score}:null}).sort((o,i)=>(i==null?void 0:i.score)-(o==null?void 0:o.score)).filter(Boolean)}getSuggestions(t){const{settings:n,app:r}=ut.getState(),o=t.toLocaleLowerCase(),i=n.UseVaultTags?fN(r):Me.getState().tags;return this.fuzzySearchItemsOptimized(o,i).map(s=>s.item)}renderSuggestion(t,n){n.toggleClass("thino-image-suggest-item",!0),n.createSpan({cls:"suggestion-name",text:t})}selectSuggestion(t){this.inputEl.value=t,this.inputEl.dispatchEvent(new Event("change")),this.cb&&this.cb(t),this.close()}};function yr(){const e=document.createDocumentFragment();e.createEl("div",{cls:"thino-info"}).createEl("div",{text:O("This is a pro feature, please upgrade to pro version to use it.")});const r=e.createEl("div",{cls:"thino-link"}).createEl("div",{text:O("You can get pro version from: ")}),o=localStorage.getItem("language");let i="https://pkmer.cn/products/UserProfile/";o&&o==="zh"?i="https://pkmer.cn/products/thino/":i="https://thino.pkmer.net/en/",r.createEl("a",{text:"PKMer",attr:{href:i}}),new N.Notice(e,5e3)}const{exec:pN,execSync:EJ}=N.Platform.isDesktop&&require("child_process"),{createHash:hN}=N.Platform.isDesktop&&require("crypto"),mN={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},gN=N.Platform.isDesktop&&{darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:`${mN[vN()]}\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`,linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"};function vN(){return process.platform!=="win32"?"":process.arch==="ia32"&&Object.hasOwnProperty.call(process.env,"PROCESSOR_ARCHITEW6432")?"mixed":"native"}function yN(e){return hN("sha256").update(e).digest("hex")}function wN(e){switch(process.platform){case"darwin":return e.split("IOPlatformUUID")[1].split(`
`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return e.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return e.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return e.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error(`Unsupported platform: ${process.platform}`)}}function Un(e=!1){return new Promise((t,n)=>{pN(gN[process.platform],{},(r,o)=>{if(r)return n(new Error(`Error while obtaining machine id: ${r.stack}`));const i=wN(o.toString());return t(e?i:yN(i))})})}const ww=e=>{const{destroy:t,queryId:n,type:r="dialog"}=e,[o,i]=A.useState(""),[s,c]=A.useState(r!=="dialog"?[gD()]:[]),d=Vf(!1),[h,g]=A.useState(!1),[m,w]=Oa(!1),b=Me.getState().memos.filter(R=>!(R.deletedAt!==""&&R.deletedAt)).filter(R=>Th(R,s)).length;A.useEffect(()=>{T()},[n]);const T=()=>{const R=ln.getQueryById(n??"");if(R){i(R.title);const j=JSON.parse(R.querystring);return Array.isArray(j)&&c(j),R}},E=R=>{const j=R.target.value;i(j)},k=async()=>{if(!o)return new N.Notice(O("TITLE CANNOT BE NULL!")),null;if(s.length===0)return new N.Notice(O("FILTER CANNOT BE NULL!")),null;if(s.length===1&&s[s.length-1].value.value==="")return new N.Notice(O("Please finish the last filter setting first")),null;let R;try{n&&!n.startsWith("Filter [Temp] ")?(R=await ln.updateQuery(n,o,JSON.stringify(s)),ln.editQuery(R),await ln.getMyAllQueries()):(R=await ln.createQuery(o,JSON.stringify(s)),ln.pushQuery(R),await ln.getMyAllQueries())}catch(j){new N.Notice(j.message)}return R},C=async()=>{switch(r){case"modal":case"inline":if(s.length===0){new N.Notice(O("FILTER CANNOT BE NULL!"));return}if(s.length===1&&s[s.length-1].value.value===""){new N.Notice(O("Please finish the last filter setting first"));return}try{const R=ln.getQueryById(n??"");if(R&&JSON.stringify(s)===R.querystring){it.setMemoFilter(R.id),t();return}const j=ln.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(s));ln.pushQuery(j),it.setMemoFilter(j.id)}catch(R){new N.Notice(R.message)}t();break;case"dialog":try{if(!await k())return}catch(R){console.error(R),new N.Notice(R.message)}t();break}},I=()=>{if(s.length===0){new N.Notice(O("FILTER CANNOT BE NULL!"));return}if(h){it.setMemoFilter(""),g(!1);return}const R=ln.getQueryById(n??"");if(R&&JSON.stringify(s)===R.querystring){it.setMemoFilter(R.id);return}const j=ln.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(s));ln.pushQuery(j),it.setMemoFilter(j.id),e.setPreview&&e.setPreview(j.id),g(!0)},B=()=>{if(s.length>0&&s[s.length-1].value.value===""){new N.Notice(O("Please finish the last filter setting first"));return}c([...s,gD()])},F=A.useCallback((R,j)=>{c(z=>{const q=[...z];return q[R]=j,q})},[]),_=A.useCallback(R=>{c(j=>j.filter((q,$)=>$!==R))},[]);return D.jsxs(D.Fragment,{children:[r==="dialog"&&D.jsxs("div",{className:"dialog-header-container",children:[D.jsxs("span",{className:"title-text",children:[D.jsx("span",{className:"icon-text",children:"🔖"}),O(n?"EDIT QUERY":"CREATE QUERY")]}),D.jsx("button",{ref:R=>{R&&N.setIcon(R,"x")},className:"btn close-btn",onClick:t})]}),D.jsxs("div",{className:"dialog-content-container",children:[(r==="dialog"||m)&&D.jsxs("div",{className:"form-item-container input-form-container",children:[D.jsx("span",{className:"normal-text",children:O("TITLE")}),D.jsx("input",{className:"title-input",type:"text",value:o,onChange:E})]}),D.jsxs("div",{className:"form-item-container filter-form-container",children:[D.jsx("span",{className:"normal-text",children:O("FILTER")}),D.jsxs("div",{className:"filters-wrapper",children:[s.map((R,j)=>D.jsx(DN,{index:j,filter:R,handleFilterChange:F,handleFilterRemove:_},j)),D.jsx("div",{className:"create-filter-btn",onClick:B,children:O("ADD FILTER TERMS")})]})]})]}),D.jsx("div",{className:"dialog-footer-container",children:D.jsxs("div",{className:"btns-container",children:[(r==="inline"||r==="modal")&&D.jsx("button",{className:`btn ${m?"mod-cta":"save-btn"}`,onClick:async()=>{if(!m)w();else{const R=await k();w(!1),t(),R&&it.setMemoFilter(R.id)}},children:O(m?"Set and save":"Save")}),D.jsxs("div",{className:"btns-group-container",children:[D.jsxs("span",{className:`tip-text ${s.length===0&&"hidden"}`,children:[O("MATCH")," Thino ",D.jsx("strong",{children:b})," ",O("TIMES")]}),D.jsx(D.Fragment,{children:r==="inline"&&D.jsx("button",{className:"btn mod-cta",onClick:I,children:O("Preview")})}),D.jsx("button",{className:`btn save-btn ${d.isLoading?"requesting":""}`,onClick:C,children:O(r==="inline"||r==="modal"?"Filter":n?"EDIT":"Save")})]})]})})]})},bN=e=>{const{index:t,filter:n,handleFilterChange:r,handleFilterRemove:o}=e,{type:i}=n,s=A.useRef(null),c=A.useRef(null),d=A.useRef(n),h=A.useRef(i);A.useEffect(()=>{d.current=e.filter},[n]),A.useEffect(()=>{if(s.current)return i==="TAG"&&!c.current&&(h.current=i,c.current=new dN(s.current,b)),()=>{c.current&&(c.current.destroy(),c.current=null)}},[s,i]);const g=A.useCallback(k=>{["AND","OR"].includes(k)&&r(t,{...n,relation:k})},[n]),m=A.useCallback(async k=>{var C;if(n.type!==k){const{verifyState:I}=ut.getState(),B=!N.Platform.isDesktop&&await((C=window.Capacitor)==null?void 0:C.Plugins.Device.getId()),F=N.Platform.isDesktop?await Un():B.identifier||B.uuid,_=I&&(I==null?void 0:I.appId)===F;if(k==="SOURCE"&&!_){yr();return}const R=Object.values(sl[k].operators);r(t,{...n,type:k,value:{operator:R[0].value,value:""}})}},[n]),w=A.useCallback(k=>{r(t,{...n,value:{...n.value,operator:k}})},[n]),b=A.useCallback(k=>{r(t,{...d.current,value:{...d.current.value,value:k}})},[n]),T=()=>{o(t)},E={TYPE:D.jsx(pf,{className:"value-selector",dataSource:sl.TYPE.values,value:n.value.value,handleValueChanged:b}),LIST:D.jsx(pf,{className:"value-selector",dataSource:sl.LIST.values,value:n.value.value,handleValueChanged:b}),SOURCE:D.jsx(pf,{className:"value-selector",dataSource:sl.SOURCE.values,value:n.value.value,handleValueChanged:b}),TAG:D.jsx("input",{type:"text",id:Math.random().toString(36).substring(7),className:"value-inputer",ref:s,value:n.value.value,onChange:k=>{b(k.target.value)}}),TEXT:D.jsx("input",{type:"text",className:"value-inputer",value:n.value.value,onChange:k=>{b(k.target.value)}}),DATE:D.jsxs("div",{className:"date-inputer",children:[D.jsx(ov,{type:"icon",handleValueChange:b}),D.jsx("input",{type:"text",className:"value-inputer",value:n.value.value,onChange:k=>{b(k.target.value)}})]})};return D.jsxs("div",{className:"memo-filter-input-wrapper",children:[t>0&&D.jsx(pf,{className:"relation-selector",dataSource:Z7,value:n.relation,handleValueChanged:g}),D.jsx(pf,{className:"type-selector",dataSource:Object.values(sl),value:n.type,handleValueChanged:m}),D.jsxs(D.Fragment,{children:[Object.keys(sl).includes(i)&&D.jsx(pf,{className:"operator-selector",dataSource:Object.values(sl[i].operators),value:n.value.operator,handleValueChanged:w}),E[i]]}),D.jsx("div",{ref:k=>{k&&N.setIcon(k,"x")},className:"btn remove-btn",onClick:T})]})},DN=A.memo(bN);function b1(e){Sh({className:"create-query-dialog"},ww,{queryId:e})}const SN=()=>{const{queryState:{queries:e},dailyNotesState:{app:t},locationState:{query:{filter:n}}}=A.useContext(Nt),r=Vf(),[o,i]=A.useState([]);return A.useEffect(()=>{const s=e.filter(c=>{var d,h;return!((d=c.id)!=null&&d.toString().startsWith("Filter [Temp]"))&&!((h=c.id)!=null&&h.toString().includes("Filter [Temp]"))}).sort((c,d)=>{if(d.pinnedAt&&!c.pinnedAt)return 1;if(c.pinnedAt&&!d.pinnedAt)return-1;const h=Ue.getTimeStampByDate(c.pinnedAt||c.createdAt);return Ue.getTimeStampByDate(d.pinnedAt||d.createdAt)-h});i(s)},[e]),A.useEffect(()=>{ln.getMyAllQueries().catch(()=>{}).finally(()=>{r.setFinish()})},[t]),D.jsxs("div",{className:"queries-wrapper",children:[D.jsxs("span",{className:"title-text",children:[D.jsx("span",{className:"normal-text",children:O("QUERY")}),D.jsx("span",{ref:s=>{s&&N.setIcon(s,"plus")},className:"btn create-query-btn",onClick:()=>b1()})]}),D.jsx(Fa,{when:r.isSucceed&&o.length===0,children:D.jsx("div",{className:"create-query-btn-container",children:D.jsx("span",{className:"btn",onClick:()=>b1(),children:O("CREATE FILTER")})})}),D.jsx("div",{className:"queries-container",children:o.map(s=>D.jsx(EN,{query:s,isActive:s.id===n},`${s.id}-${N.moment(s.createdAt,"YYYY-MM-DD HH:mm:ss").format("x")}`))})]})},EN=e=>{const{query:t,isActive:n}=e,[r,o]=Oa(!1),[i,s]=Oa(!1),c=()=>{it.setMemoFilter(n?"":t.id)},d=E=>{E.stopPropagation(),o()},h=()=>{o(!1)},g=async E=>{if(E.stopPropagation(),i)try{await ln.deleteQuery(t.id)}catch(k){new N.Notice(k.message)}else s()},m=E=>{E.stopPropagation(),b1(t.id)},w=async E=>{E.stopPropagation();try{t.pinnedAt?await ln.unpinQuery(t.id):await ln.pinQuery(t.id),ln.editQuery({...t,pinnedAt:t.pinnedAt?"":Ue.getDateTimeString(Date.now())})}catch(k){console.error(k)}},b=()=>{s(!1)},T=A.useMemo(()=>D.jsxs("div",{className:"action-btns-container",children:[D.jsxs("span",{className:"btn",onClick:w,children:[D.jsx("span",{ref:E=>{E&&N.setIcon(E,t.pinnedAt?"pin-off":"pin")},className:"icon-text"}),D.jsx("span",{className:"normal-text",children:t.pinnedAt?O("UNPIN"):O("PIN")})]}),D.jsxs("span",{className:"btn",onClick:m,children:[D.jsx("span",{ref:E=>{E&&!E.hasChildNodes()&&N.setIcon(E,"edit")},className:"icon-text"}),D.jsx("span",{className:"normal-text",children:O("EDIT")})]}),D.jsxs("span",{className:`btn delete-btn ${i?"final-confirm":""}`,onClick:g,onMouseLeave:b,children:[D.jsx("span",{ref:E=>{E&&!E.hasChildNodes()&&N.setIcon(E,"trash-2")},className:"icon-text"}),D.jsx("span",{className:"normal-text",children:O(i?"CONFIRM":"DELETE")})]})]}),[t.pinnedAt,i]);return D.jsx(D.Fragment,{children:D.jsxs("div",{className:`query-item-container ${n?"active":""}`,onClick:c,children:[D.jsxs("div",{className:"query-text-container",children:[D.jsx("span",{ref:E=>{E&&!E.hasChildNodes()&&N.setIcon(E,"filter")},className:"icon-text"}),D.jsxs("span",{className:"query-text",children:[t.title,t.pinnedAt&&" 📌"]})]}),D.jsxs("div",{className:"btns-container",children:[D.jsx("span",{ref:E=>{E&&!E.hasChildNodes()&&N.setIcon(E,"more-horizontal")},className:"btn action-btn toggle-btn",onClick:d}),D.jsx("div",{className:`action-btns-wrapper ${r?"":"hidden"}`,onMouseLeave:h,children:T})]})]})})},TN=()=>{var g;const{locationState:{query:{tag:e}},dailyNotesState:{app:t},memoState:{tags:n,tagsNum:r,memos:o}}=A.useContext(Nt),[i,s]=A.useState([]),[c,d]=A.useState(((g=t||app)==null?void 0:g.loadLocalStorage("thino-tag-sort-order"))||"alphabetical");A.useEffect(()=>{var w;const m=(w=t||app)==null?void 0:w.loadLocalStorage("thino-temp-tags");s(m||[])},[]),A.useEffect(()=>{Me.updateTagsState()},[o]),A.useEffect(()=>{const m=Array.from(n).sort(),w={subTags:[]};for(const b of m){const T=b.split("/");let E=w,k="";for(let C=0;C<T.length;C++){const I=T[C];C===0?k+=I:k+="/"+I;let B=null;for(const F of E.subTags)if(F.text===k){B=F;break}B||(B={key:I,text:k,count:r[k],subTags:[]},E.subTags.push(B)),E=B}}s(w.subTags)},[n]),A.useEffect(()=>{var m;Me.initialized&&((m=t||app)==null||m.saveLocalStorage("thino-temp-tags",i))},[i]);const h=m=>{m.stopPropagation();const w=new N.Menu;for(const b of["alphabetical","alphabeticalReverse","byCount","byCountReverse"])w.addItem(T=>{T.setTitle(O(b)).onClick(()=>{d(b),t==null||t.saveLocalStorage("thino-tag-sort-order",b)}).setChecked(c===b)}),b==="alphabeticalReverse"&&w.addSeparator();w.showAtMouseEvent(m.nativeEvent)};return D.jsxs("div",{className:"tags-wrapper",children:[D.jsxs("div",{className:"tags-header title-text",children:[D.jsx("span",{className:"normal-text",children:O("Frequently Used Tags")}),D.jsx("span",{ref:m=>{m&&N.setIcon(m,"arrow-down-narrow-wide")},className:"tags-sort-btn",onClick:h})]}),D.jsxs("div",{className:"tags-container",children:[i.sort(CN(c)).map((m,w)=>D.jsx(W3,{tag:m,tagQuery:e},m.text+"-"+w)),D.jsx(Fa,{when:i.length<5&&Me.initialized,children:D.jsxs("span",{className:"tag-tip-container",children:[O("Input")," ",D.jsxs("span",{className:"code-text",children:[O("#Tag")," "]}),O("to create tag"),"..."]})})]})]})},W3=e=>{const{tag:t,tagQuery:n}=e,r=n===t.text,o=t.subTags.length>0,[i,s]=Oa(!1),c=()=>{r?it.setTagQuery(""):(Ue.copyTextToClipboard(`#${t.text} `),["/","/recycle"].includes(it.getState().pathname)||it.setPathname("/"),it.setTagQuery(t.text))},d=h=>{h.stopPropagation(),s()};return D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:`tag-item-container ${r?"active":""}`,onClick:c,children:[D.jsxs("div",{className:"tag-text-container",children:[D.jsx("span",{ref:h=>{h&&N.setIcon(h,"hash")},className:"btn tag-btn"}),D.jsx("span",{className:"tag-text",children:t.key})]}),D.jsxs("div",{className:"btns-container",children:[D.jsx("span",{className:"tag-count",children:t.count}),o?D.jsx("span",{ref:h=>{h&&N.setIcon(h,"chevron-right")},className:`btn action-btn toggle-btn ${i?"shown":""}`,onClick:d}):null]})]}),o?D.jsx("div",{className:`subtags-container ${i?"":"hidden"}`,children:t.subTags.map((h,g)=>D.jsx(W3,{tag:h,tagQuery:n},h.text+"-"+g))}):null]})},kD=new Intl.Collator(void 0,{usage:"sort",sensitivity:"base",numeric:!0}).compare,S0={alphabetical:(e,t)=>kD(e.text,t.text),alphabeticalReverse:(e,t)=>-kD(e.text,t.text),byCount:(e,t)=>t.count-e.count,byCountReverse:(e,t)=>e.count-t.count},CN=(e="byCount")=>S0.hasOwnProperty(e)?S0[e]:S0.alphabetical;var E0=A,xN=function(e){return typeof e=="function"},MN=function(e){var t=E0.useState(e),n=t[0],r=t[1],o=E0.useRef(n),i=E0.useCallback(function(s){o.current=xN(s)?s(o.current):s,r(o.current)},[]);return[n,i,o]},kN=MN;const Or=qn(kN);class ft extends N.Setting{constructor(n,r){super(n);ye(this,"settingTab");ye(this,"name","");ye(this,"desc","");this.settingTab=r}setName(n){return super.setName(n),this.name=n,this}setDesc(n){return super.setDesc(n),this.desc=n,this}setTab(n){const r=typeof this.name=="string"?this.name:this.name.textContent??"",o=typeof this.desc=="string"?this.desc:this.desc.textContent??"";return this.settingTab.addSettingToMasterSettingsList(n,this.settingEl,r,o),this}}class NN extends N.Modal{constructor(n,r,o,i,s){super(n);ye(this,"plugin");ye(this,"settingTab");ye(this,"target",5);ye(this,"cb");this.app=n,this.settingTab=r,this.plugin=o,this.target=i,this.cb=s}onOpen(){var c;const{contentEl:n}=this;(c=n.parentElement)==null||c.classList.add("memo-save-location-modal"),n.createEl("h3",{text:O("Thino Daily Target")});const r=n.createDiv("modal-setting");new ft(r,this.settingTab).setName(O("Target Thino Count")).addSlider(d=>{d.setDynamicTooltip().setValue(this.target).setLimits(1,30,1).onChange(async h=>{this.target=h})});const o=n.createDiv("button-group"),i=o.createEl("button",{text:O("Cancel")}),s=o.createEl("button",{text:O("Save")});s.onclick=async()=>{this.plugin.settings.MemoDailyTarget=this.target,this.settingTab.applySettingsUpdate(),this.cb(this.target),this.close()},i.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}const FN=({allStat:e,todayTimeStamp:t,calendarType:n,handleCalendarTypeChange:r})=>{const{dailyNotesState:{app:o,settings:i},globalState:{manifest:s}}=A.useContext(Nt),[c,d]=A.useState(),[h,g]=A.useState(5),[m,w]=A.useState(0),[b,T]=A.useState(0),[E,k]=A.useState(i.HeatmapColorScheme||"default"),C=A.useRef(null),I=A.useRef(null);A.useEffect(()=>{i.HeatmapColorScheme&&k(i.HeatmapColorScheme)},[i.HeatmapColorScheme]),A.useEffect(()=>{let F,_=5;s&&o&&(F=o==null?void 0:o.plugins.getPlugin(s.id),_=F==null?void 0:F.settings.MemoDailyTarget,d(F)),g(_)},[s,o]),A.useEffect(()=>{const F=e.find(j=>j.timestamp===t),_=F?F.count:0;T(_);const R=Math.min(100,_/h*100);w(R)},[e,h]),A.useEffect(()=>{N.requireApiVersion("1.4.4")&&(N.setTooltip(I.current,m.toFixed(2)+"%"),N.setTooltip(C.current,O("Set daily target")+` (${b}/${h})`))},[m,b]),A.useEffect(()=>{C.current&&(C.current.hasChildNodes()||N.setIcon(C.current,"crosshair"),N.requireApiVersion("1.4.4")&&N.setTooltip(I.current,m+"%"))},[C,h]);const B=A.useCallback(()=>{if(!c)return;new NN(o,c==null?void 0:c.settingTab,c,h,_=>{g(_)}).open()},[c,h]);return D.jsx(D.Fragment,{children:D.jsxs("div",{className:`usage-daily-progress-wrapper heatmap-${E}`,children:[D.jsx("div",{ref:I,className:"daily-progress-bar",children:D.jsx("div",{className:"daily-progress-bar-inner",style:{width:`${m}%`}})}),D.jsx("div",{ref:C,className:"daily-progress-target",onClick:B}),D.jsx("div",{ref:F=>{F&&N.setIcon(F,n==="basic"?"layout-grid":"calendar"),F&&N.setTooltip&&N.setTooltip(F,O("Switch calendar type"))},className:"switch-calendar-type-btn",onClick:()=>r&&r(n==="basic"?"heatmap":"basic")})]})})},IN=e=>{const{className:t,view:n,datestamp:r,handleDateStampChange:o,handleDateItemClick:i,handleMonthChange:s,dailyStat:c}=e,d=N.moment().startOf("day").valueOf(),[h,g]=A.useState(Fp(r)),[m,w]=A.useState(null);A.useEffect(()=>{g(Fp(r))},[r]);const b=new Date(h),T=b.getDay(),E=[];for(let I=0;I<T;I++)E.push({date:0,datestamp:b.getTime()-Si*(7-I)});const k=ON(h);for(let I=1;I<=k;I++)E.push({date:I,datestamp:b.getTime()+Si*(I-1)});const C=I=>{const B=b.getFullYear(),F=b.getMonth()+1;let _=0;F===1&&I===-1?_=new Date(`${B-1}/12/1`).getTime():F===12&&I===1?_=new Date(`${B+1}/1/1`).getTime():_=new Date(`${B}/${F+I}/1`).getTime(),g(Fp(_)),s&&s(_)};return D.jsxs("div",{className:`heatmap-date-picker-wrapper ${t}`,children:[D.jsxs("div",{className:"date-picker-header",children:[D.jsx("span",{ref:I=>{I&&N.setIcon(I,"chevron-left")},className:"btn btn-text",onClick:()=>C(-1)}),D.jsxs("span",{className:"normal-text",children:[D.jsx(S3,{year:b.getFullYear().toString(),handleYearChange:I=>{g(Fp(new Date(`${I}/${b.getMonth()+1}/1`).getTime()))}}),D.jsx(E3,{month:b.getMonth().toString(),handleMonthChange:I=>{g(Fp(new Date(`${b.getFullYear()}/${parseInt(I)}/1`).getTime()))}})]}),D.jsx("span",{ref:I=>{I&&N.setIcon(I,"chevron-right")},className:"btn btn-text",onClick:()=>C(1)})]}),D.jsxs("div",{className:"date-picker-day-container",children:[D.jsx("div",{className:"date-picker-day-header",children:O("weekDaysShort").map(I=>D.jsx("span",{className:"day-item",children:I},I))}),D.jsx("div",{className:"date-picker-day-content",children:E.map(I=>{if(I.date===0)return D.jsx("span",{className:"day-item null",children:""},I.datestamp);const B=c.find(R=>R.timestamp===I.datestamp)||{count:0,timestamp:I.datestamp,list:0},F=B.count-B.list,_=B.list;return D.jsxs("span",{className:`day-item ${I.datestamp===d?"current":""} ${I.datestamp===m?"selected":""} ${T0(B.count)}`,onClick:R=>{o(r,R.nativeEvent),w(I.datestamp===m?null:I.datestamp),i&&i(R,B)},onMouseOver:R=>{if(!B||!B.count)return;const j=new N.HoverPopover(n,R.currentTarget,100);AN(j,{d:I,list:_,task:F})},children:[D.jsx("span",{className:"day-item-text",children:I.date}),D.jsx(D.Fragment,{children:B&&B.count!==0&&D.jsxs("span",{className:"day-item-dots",children:[F>0&&D.jsx("div",{className:`day-item-dot thino-task-dot ${T0(F)}`}),_>0&&D.jsx("div",{className:`day-item-dot thino-list-dot ${T0(_)}`})]})})]},I.datestamp)})})]})]})};function AN(e,{d:t,list:n,task:r}){e.hoverEl.toggleClass("thino-hover-popover",!0);const o=e.hoverEl.createDiv({cls:"thino-hover-popover-content"});o.createDiv({cls:"thino-date-item",text:`${N.moment(t.datestamp).format("YYYY-MM-DD")}`});const i=o.createDiv({cls:"thino-list-item"});i.createSpan({cls:"thino-list-item-title-text",text:`${O("List")}: `}),i.createSpan({cls:"thino-list-item-title-count",text:`${n}`});const s=o.createDiv({cls:"thino-task-item"});s.createSpan({cls:"thino-task-item-title-text",text:`${O("Task")}: `}),s.createSpan({cls:"thino-task-item-title-count",text:`${r}`})}function ON(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return((n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-n.getTime())/Si}function Fp(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}function T0(e){return e<=0?"":e<=1?"stat-day-L1-bg":e<=2?"stat-day-L2-bg":e<=4?"stat-day-L3-bg":"stat-day-L4-bg"}const ND={width:12,height:7},FD=(e,t)=>{const n=[];for(let r=0;r<=e;r++)n.push({timestamp:parseInt(N.moment(t).add(r,"days").format("x")),count:0,list:0});return n},RN=()=>{const e=parseInt(N.moment().endOf("day").format("x")),t=new Date(e).getDay()||7,n=parseInt(N.moment().startOf("day").format("x")),r=new Array(7-(t===7?1:t)).fill(0),o=(ND.width-1)*ND.height+t,i=parseInt(N.moment().startOf("day").subtract(o,"days").format("x")),s=N.moment().startOf("day").subtract(o,"days"),{memoState:{memos:c},dailyNotesState:{view:d,app:h,settings:g,verifyState:m}}=A.useContext(Nt),[w,b]=Or(_N(h)||"heatmap"),[T,E]=Or(N.moment().startOf("day").valueOf()),[k,C]=Or(g.HeatmapColorScheme||"default"),[I,B]=Or(FD(o,i)),[F,_]=Or(null),[R,j]=Or(null),[z,q,$]=Or(""),J=A.useRef(null),ae=A.useRef(null);A.useEffect(()=>{const re=FD(o,i),be=c.filter(V=>!V.deletedAt);for(const V of be){const G=N.moment(V.createdAt.replaceAll("/","-"),"YYYY-MM-DD HH:mm:ss").startOf("day");V.createdAt.replaceAll("/","-").startsWith("2024-03-14");const le=G.diff(s,"days");le>=0&&le<re.length&&(re[le].count+=1,V.thinoType==="JOURNAL"&&(re[le].list+=1))}B([...re])},[c]),A.useEffect(()=>{g.HeatmapColorScheme&&C(g.HeatmapColorScheme)},[g.HeatmapColorScheme]);const ie=A.useCallback((re,be)=>{var ue;if(_(be),!ae.current)return;const{isMobileView:V}=rt.getState(),G=re.target,le=document.querySelector(".memos-sidebar-wrapper");ae.current.style.left=G.offsetLeft-(((ue=J.current)==null?void 0:ue.offsetLeft)??0)+"px";let we=G.offsetTop;V||(we-=le==null?void 0:le.scrollTop),ae.current.style.top=we+"px"},[]),ge=A.useCallback(()=>{_(null)},[]),pe=()=>{b(w==="heatmap"?"basic":"heatmap"),LN(h,w==="heatmap"?"basic":"heatmap"),E(N.moment().startOf("day").valueOf())},fe=A.useCallback(async(re,be)=>{if(be.count===0)return;const V=it.getState().query.duration,G=V==null?void 0:V.from,le=V==null?void 0:V.to,we=N.moment(G).diff(le,"day")==0;if(G===be.timestamp&&we)it.setFromAndToQuery(0,0),j(null),q(null);else if(G!==be.timestamp&&G>0&&re.shiftKey){const ue=N.moment(be.timestamp).endOf("day").diff(le,"day");G===0&&re.shiftKey?q("from"):ue<0&&we&&q("to"),N.moment(G).isBefore(be.timestamp)?$.current==="to"?ue<0?it.setFromAndToQuery(be.timestamp,le):(it.setFromAndToQuery(parseInt(N.moment(le).startOf("day").format("x")),parseInt(N.moment(be.timestamp).endOf("day").format("x"))),q("from")):$.current==="from"&&(ue<0,it.setFromAndToQuery(G,parseInt(N.moment(be.timestamp).endOf("day").format("x")))):$.current==="to"?it.setFromAndToQuery(be.timestamp,le):$.current==="from"&&(it.setFromAndToQuery(be.timestamp,parseInt(N.moment(G).endOf("day").format("x"))),q("to"))}else if(G===0&&re.shiftKey)it.setFromAndToQuery(be.timestamp,parseInt(N.moment().endOf("day").format("x")));else if(be.count>0&&(re.ctrlKey||re.metaKey)){const{app:ue,dailyNotes:Se}=ut.getState(),Re=Sv(N.moment(be.timestamp),Se);if(!N.Platform.isMobile)await ue.workspace.getLeaf("split").openFile(Re);else{let Ye=ue.workspace.activeLeaf;Ye===null&&(Ye=ue.workspace.getLeaf(!0)),Ye.openFile(Re)}}else be.count>0&&!re.shiftKey&&!re.ctrlKey&&!re.metaKey&&(["/","/recycle"].includes(it.getState().pathname)||it.setPathname("/"),it.setFromAndToQuery(be.timestamp,Ue.getTimeStampByDate(N.moment(be.timestamp+Si).subtract(1,"days").endOf("day").format("YYYY-MM-DD HH:mm:ss"))),j(be))},[]),De=A.useMemo(()=>D.jsx(IN,{className:`heatmap-${k}`,view:d,datestamp:T,dailyStat:I,handleMonthChange:re=>{E(re)},handleDateStampChange:re=>{},handleDateItemClick:(re,be)=>fe(re,be)}),[JSON.stringify(I),d,T,k]);return D.jsxs(D.Fragment,{children:[w==="basic"&&De,w==="heatmap"&&D.jsxs("div",{className:`usage-heat-map-wrapper heatmap-${k}`,ref:J,children:[D.jsxs("div",{className:"day-tip-text-container",children:[D.jsx("span",{className:"tip-text",children:O("weekDaysShort")[0]}),D.jsx("span",{className:"tip-text"}),D.jsx("span",{className:"tip-text",children:O("weekDaysShort")[2]}),D.jsx("span",{className:"tip-text"}),D.jsx("span",{className:"tip-text",children:O("weekDaysShort")[4]}),D.jsx("span",{className:"tip-text"}),D.jsx("span",{className:"tip-text",children:O("weekDaysShort")[6]})]}),D.jsxs("div",{ref:ae,className:"usage-detail-container pop-up "+(F?"":"hidden"),children:[F==null?void 0:F.count," thino ",O("on")," ",D.jsx("span",{className:"date-text",children:N.moment(F==null?void 0:F.timestamp,"x").format("YYYY/MM/DD ddd")})]}),D.jsxs("div",{className:"usage-heat-map",children:[I.map((re,be)=>{const V=re.count,G=V<=0?"":V<=1?"stat-day-L1-bg":V<=2?"stat-day-L2-bg":V<=4?"stat-day-L3-bg":"stat-day-L4-bg";return D.jsx("span",{className:`stat-container ${G} ${R===re?"current":""} ${n===re.timestamp?"today":""}`,onMouseEnter:le=>ie(le,re),onMouseLeave:ge,onClick:le=>fe(le,re)},be)}),r.map((re,be)=>D.jsx("span",{className:"stat-container null"},be))]})]}),m&&D.jsx(FN,{allStat:I,todayTimeStamp:n,calendarType:w,handleCalendarTypeChange:pe})]})};function LN(e,t){try{e==null||e.saveLocalStorage("calendarType",t)}catch(n){console.error(n)}}function _N(e){try{return(e==null?void 0:e.loadLocalStorage("calendarType"))||"heatmap"}catch(t){return console.error(t),"heatmap"}}const PN=()=>{const{dailyNotesState:{app:e,settings:t,verifyState:n}}=A.useContext(Nt),r=[{name:O("Random Review"),path:"/review",iconID:"star"},{name:O("ARCHIVE"),path:"/archive",iconID:"archive"},{name:O("Recycle bin"),path:"/recycle",iconID:"recycle"}],o=A.useRef([]);return A.useEffect(()=>{o.current.forEach((i,s)=>{i&&N.setIcon(i,r[s].iconID)})},[t,o]),D.jsx(D.Fragment,{children:D.jsx("div",{className:"path-entry-wrapper",children:r.map((i,s)=>D.jsx(D.Fragment,{children:D.jsxs("div",{className:`path-entry-container ${it.getState().pathname===i.path?"active":""} ${t.DeleteThinoDirectly&&i.path==="/recycle"?"hidden":""}`,onClick:async()=>{var h;const c=!N.Platform.isDesktop&&await((h=window.Capacitor)==null?void 0:h.Plugins.Device.getId()),d=N.Platform.isDesktop?await Un():c.identifier||c.uuid;if(!n&&(n==null?void 0:n.appId)!==d&&i.path==="/review"){yr();return}it.setPathname(i.path),i.path==="/review"&&it.getState().pathname==="/review"&&e.workspace.trigger("refresh-review-memos")},children:[D.jsx("span",{ref:c=>o.current[s]=c,className:"path-entry-icon"}),D.jsx("span",{className:"path-entry-text",children:i.name})]},s)}))})})},jN=e=>{const{locationState:t,globalState:{isMobileView:n,showSiderbarInMobileView:r}}=A.useContext(Nt),o=A.useRef(null),i=A.useMemo(()=>s=>{var d,h,g;const c=rt.getState().showSiderbarInMobileView;if(!c){window.removeEventListener("click",i,{capture:!0});return}(d=o.current)!=null&&d.contains(s.target)||(g=(h=o.current)==null?void 0:h.parentNode)!=null&&g.contains(s.target)&&(c&&s.stopPropagation(),rt.setShowSiderbarInMobileView(!1),window.removeEventListener("click",i,{capture:!0}))},[]);return A.useEffect(()=>{rt.setShowSiderbarInMobileView(!1)},[t]),A.useEffect(()=>{r?document.body.classList.add(Nb):document.body.classList.remove(Nb)},[r]),A.useEffect(()=>{n&&r&&window.addEventListener("click",i,{capture:!0})},[n,r]),D.jsxs("aside",{className:"memos-sidebar-wrapper",ref:o,children:[e.children,D.jsx(W7,{}),D.jsx(RN,{}),D.jsx(PN,{}),D.jsx(SN,{}),D.jsx(TN,{})]})},C0=()=>({type:"initialText",value:"",timestamp:Date.now(),selectionStart:0,selectionEnd:0}),ID={initialValue:"",interval:300};class BN{constructor(t,n=ID){this.listeners=[],this.runUndo=()=>{const r=this.actions[this.currentIndex].selectionStart;this.currentIndex>0&&this.currentIndex--,this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(r,r),this.dispatchChange()},this.runRedo=()=>{this.currentIndex<this.actions.length-1&&this.currentIndex++;const r=this.actions[this.currentIndex].selectionEnd;this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(r,r),this.dispatchChange()},this.getActions=()=>this.actions,this.setState=(r,o)=>{this.actions=[...r],this.currentIndex=o<this.actions.length?o:this.actions.length-1,this.dispatchChange()},this.resetState=()=>{this.actions=[C0()],this.currentIndex=0,this.dispatchChange()},this.destroy=()=>{this.rmEventListeners()},this.subscribe=r=>{this.listeners.push(r)},this.handleElementKeydown=r=>{const o=r;o.key==="z"&&!o.shiftKey&&(o.metaKey||o.ctrlKey)?(r.preventDefault(),this.runUndo()):(o.key==="z"&&o.shiftKey&&(o.metaKey||o.ctrlKey)||o.key==="y"&&(o.metaKey||o.ctrlKey))&&(r.preventDefault(),this.runRedo())},this.handleElementInput=r=>{const o=r,i=this.actions[this.currentIndex];this.pushNewAction({type:o.inputType,value:this.element.value,timestamp:Date.now(),selectionStart:this.element.selectionEnd-(this.element.value.length-i.value.length),selectionEnd:this.element.selectionEnd})},this.addEventListeners=()=>{this.element.addEventListener("keydown",this.handleElementKeydown),this.element.addEventListener("input",this.handleElementInput)},this.rmEventListeners=()=>{this.element.removeEventListener("keydown",this.handleElementKeydown),this.element.removeEventListener("input",this.handleElementInput)},this.pushNewAction=r=>{const o=this.actions[this.currentIndex];o&&o.type===r.type&&r.timestamp-o.timestamp<this.config.interval?this.actions[this.currentIndex]=Object.assign(Object.assign({},o),{value:r.value,selectionEnd:r.selectionEnd,timestamp:r.timestamp}):(this.config.maxSize&&this.currentIndex>=this.config.maxSize?(this.actions.shift(),this.actions[0]=C0()):this.currentIndex++,this.actions[this.currentIndex]=r,this.actions=this.actions.slice(0,this.currentIndex+1)),this.dispatchChange()},this.dispatchChange=()=>{for(const r of this.listeners)r([...this.actions],this.currentIndex)},this.element=t,this.config=Object.assign(Object.assign({},ID),n),this.config.initialActions&&this.config.initialActions.length>0?(this.actions=this.config.initialActions,this.config.initialIndex!==void 0&&this.config.initialIndex<this.actions.length?this.currentIndex=this.config.initialIndex:this.currentIndex=this.actions.length-1):(this.actions=[C0()],this.currentIndex=0,this.config.initialValue!==""&&(this.actions.push({type:"insertText",value:this.config.initialValue,timestamp:Date.now(),selectionStart:0,selectionEnd:this.config.initialValue.length}),this.currentIndex++)),this.element.value=this.actions[this.currentIndex].value,this.addEventListeners()}}function YN(){const[,e]=A.useState(!1);return A.useCallback(()=>{e(n=>!n)},[])}var G3={exports:{}};(function(e){(function(){var t=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n=typeof window<"u",r=n&&window.mozInnerScreenX!=null;function o(i,s,c){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var d=c&&c.debug||!1;if(d){var h=document.querySelector("#input-textarea-caret-position-mirror-div");h&&h.parentNode.removeChild(h)}var g=document.createElement("div");g.id="input-textarea-caret-position-mirror-div",document.body.appendChild(g);var m=g.style,w=window.getComputedStyle?getComputedStyle(i):i.currentStyle;m.whiteSpace="pre-wrap",i.nodeName!=="INPUT"&&(m.wordWrap="break-word"),m.position="absolute",d||(m.visibility="hidden"),t.forEach(function(E){m[E]=w[E]}),r?i.scrollHeight>parseInt(w.height)&&(m.overflowY="scroll"):m.overflow="hidden",g.textContent=i.value.substring(0,s),i.nodeName==="INPUT"&&(g.textContent=g.textContent.replace(/\s/g," "));var b=document.createElement("span");b.textContent=i.value.substring(s)||".",g.appendChild(b);var T={top:b.offsetTop+parseInt(w.borderTopWidth),left:b.offsetLeft+parseInt(w.borderLeftWidth)};return d?b.style.backgroundColor="#aaa":document.body.removeChild(g),T}e.exports=o})()})(G3);var HN=G3.exports;const UN=qn(HN);var K3=Vn.CustomEvent;function VN(){try{var e=new K3("cat",{detail:{foo:"bar"}});return e.type==="cat"&&e.detail.foo==="bar"}catch{}return!1}var zN=VN()?K3:typeof document<"u"&&typeof document.createEvent=="function"?function(t,n){var r=document.createEvent("CustomEvent");return n?r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):r.initCustomEvent(t,!1,!1,void 0),r}:function(t,n){var r=document.createEventObject();return r.type=t,n?(r.bubbles=!!n.bubbles,r.cancelable=!!n.cancelable,r.detail=n.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r};const $N=qn(zN);function qN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){qN(e,o,n[o])})}return e}function Mh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Av(e,t,n){return t&&AD(e.prototype,t),n&&AD(e,n),e}function bf(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?bf=function(n){return typeof n}:bf=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},bf(e)}function Vg(e){return typeof Symbol=="function"&&bf(Symbol.iterator)==="symbol"?Vg=function(n){return bf(n)}:Vg=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":bf(n)},Vg(e)}function GN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ov(e,t){return t&&(Vg(t)==="object"||typeof t=="function")?t:GN(e)}function Mf(e){return Mf=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Mf(e)}function D1(e,t){return D1=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},D1(e,t)}function Rv(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D1(e,t)}function KN(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function QN(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function ZN(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function JN(e){return KN(e)||QN(e)||ZN()}var Lo={ESC:27,UP:38,DOWN:40,LEFT:37,RIGHT:39,ENTER:13,TAB:9},XN=function e(){var t=this;Mh(this,e),this.startListen=function(n){n&&n.addEventListener("keydown",t.f)},this.stopListen=function(n){n&&n.removeEventListener("keydown",t.f)},this.add=function(n,r){var o=n;return typeof o!="object"&&(o=[o]),t.listeners[t.index]={keyCode:o,fn:r},t.index++},this.remove=function(n){delete t.listeners[n]},this.removeAll=function(){t.listeners={},t.index=1},this.index=1,this.listeners={},this.f=function(n){if(n){var r=n.keyCode||n.which;Object.values(t.listeners).forEach(function(o){var i=o.keyCode,s=o.fn;i.includes(r)&&(n.stopPropagation(),n.preventDefault(),s(n))})}}},wu=new XN,eF=function(e){Rv(t,e);function t(){var n,r;Mh(this,t);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=Ov(this,(n=Mf(t)).call.apply(n,[this].concat(i))),r.selectItem=function(){var c=r.props,d=c.item,h=c.onSelectHandler;h(d)},r}return Av(t,[{key:"shouldComponentUpdate",value:function(r){return this.props.item!==r.item||this.props.selected!==r.selected||this.props.style!==r.style||this.props.className!==r.className}},{key:"render",value:function(){var r=this,o=this.props,i=o.component,s=o.style,c=o.onClickHandler,d=o.item,h=o.selected,g=o.className,m=o.innerRef;return Q.createElement("li",{className:"rta__item ".concat(h===!0?"rta__item--selected":""," ").concat(g||""),style:s},Q.createElement("div",{className:"rta__entity ".concat(h===!0?"rta__entity--selected":""),role:"button",tabIndex:0,onClick:c,onFocus:this.selectItem,onMouseEnter:this.selectItem,onTouchStart:function(){r.clicked=!0,r.selectItem()},onTouchEnd:function(b){b.preventDefault(),r.clicked&&c(b)},onTouchMove:function(){r.clicked=!1},onTouchCancel:function(){r.clicked=!1},ref:m},Q.createElement(i,{selected:h,entity:d})))}}]),t}(Q.Component),tF=function(e){Rv(t,e);function t(){var n,r;Mh(this,t);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=Ov(this,(n=Mf(t)).call.apply(n,[this].concat(i))),r.state={selectedItem:null},r.cachedIdOfItems=new Map,r.onPressEnter=function(c){typeof c<"u"&&c.preventDefault();var d=r.props.values;r.modifyText(d[r.getPositionInList()])},r.getPositionInList=function(){var c=r.props.values,d=r.state.selectedItem;return d?c.findIndex(function(h){return r.getId(h)===r.getId(d)}):0},r.getId=function(c){if(r.cachedIdOfItems.has(c))return r.cachedIdOfItems.get(c);var d=r.props.getTextToReplace(c),h=function(){if(d){if(d.key)return d.key;if(typeof c=="string"||!c.key)return d.text}if(!c.key)throw new Error("Item ".concat(JSON.stringify(c),' has to have defined "key" property'));return c.key},g=h();return r.cachedIdOfItems.set(c,g),g},r.listeners=[],r.itemsRef={},r.modifyText=function(c){if(c){var d=r.props.onSelect;d(c)}},r.selectItem=function(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h=r.props.onItemHighlighted;r.state.selectedItem!==c&&r.setState({selectedItem:c},function(){h(c),d&&r.props.dropdownScroll(r.itemsRef[r.getId(c)])})},r.scroll=function(c){c.preventDefault();var d=r.props.values,h=c.keyCode||c.which,g=r.getPositionInList(),m;switch(h){case Lo.DOWN:m=g+1;break;case Lo.UP:m=g-1;break;default:m=g;break}m=(m%d.length+d.length)%d.length,r.selectItem(d[m],[Lo.DOWN,Lo.UP].includes(h))},r.isSelected=function(c){var d=r.state.selectedItem;return d?r.getId(d)===r.getId(c):!1},r}return Av(t,[{key:"componentDidMount",value:function(){this.listeners.push(wu.add([Lo.DOWN,Lo.UP],this.scroll),wu.add([Lo.ENTER,Lo.TAB],this.onPressEnter));var r=this.props.values;r&&r[0]&&this.selectItem(r[0])}},{key:"componentDidUpdate",value:function(r){var o=this,i=r.values,s=this.props.values,c=i.map(function(h){return o.getId(h)}).join(""),d=s.map(function(h){return o.getId(h)}).join("");c!==d&&s&&s[0]&&this.selectItem(s[0])}},{key:"componentWillUnmount",value:function(){for(var r;this.listeners.length;)r=this.listeners.pop(),wu.remove(r)}},{key:"render",value:function(){var r=this,o=this.props,i=o.values,s=o.component,c=o.style,d=o.itemClassName,h=o.className,g=o.itemStyle;return Q.createElement("ul",{className:"rta__list ".concat(h||""),style:c},i.map(function(m){return Q.createElement(eF,{key:r.getId(m),innerRef:function(b){r.itemsRef[r.getId(m)]=b},selected:r.isSelected(m),item:m,className:d,style:g,onClickHandler:r.onPressEnter,onSelectHandler:r.selectItem,component:s})}))}}]),t}(Q.Component);function nF(e,t){var n=parseInt(getComputedStyle(t).getPropertyValue("height"),10),r=parseInt(getComputedStyle(e).getPropertyValue("height"),10)-n,o=t.offsetTop,i=e.scrollTop;o<i+r&&i<o||(e.scrollTop=o)}var OD="next",ol={X:{LEFT:"rta__autocomplete--left",RIGHT:"rta__autocomplete--right"},Y:{TOP:"rta__autocomplete--top",BOTTOM:"rta__autocomplete--bottom"}},RD=function(t){return console.error("RTA: dataProvider fails: ".concat(t,`
Check the documentation or create issue if you think it's bug. https://github.com/webscopeio/react-textarea-autocomplete/issues`))},rF=[".","^","$","*","+","-","?","(",")","[","]","{","}","\\","|"],Sg=function(t){return JN(t).map(function(n){return rF.includes(n)?"\\".concat(n):n}).join("")},oF=function(e){Rv(t,e);function t(){return Mh(this,t),Ov(this,Mf(t).apply(this,arguments))}return Av(t,[{key:"componentDidMount",value:function(){var r=this.props.boundariesElement;if(typeof r=="string"){var o=document.querySelector(r);if(!o)throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");this.containerElem=o}else if(r instanceof HTMLElement)this.containerElem=r;else throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");if(!this.containerElem||!this.containerElem.contains(this.ref))throw new Error("RTA: Invalid prop boundariesElement: it has to be one of the parents of the RTA.")}},{key:"componentDidUpdate",value:function(){var r,o,i=this.props.top||0,s=this.props.left||0,c=[],d=[],h=0,g=0,m=this.containerElem.getBoundingClientRect(),w=this.ref.getBoundingClientRect(),b=this.props.textareaRef.getBoundingClientRect(),T=window.getComputedStyle(this.ref),E=parseInt(T.getPropertyValue("margin-top"),10),k=parseInt(T.getPropertyValue("margin-bottom"),10),C=parseInt(T.getPropertyValue("margin-left"),10),I=parseInt(T.getPropertyValue("margin-right"),10),B=E+k+b.top+i+w.height,F=C+I+b.left+s+w.width;F>m.right&&b.left+s>w.width?(g=s-w.width,c.push(ol.X.LEFT),d.push(ol.X.RIGHT)):(g=s,c.push(ol.X.RIGHT),d.push(ol.X.LEFT)),B>m.bottom&&b.top+i>w.height?(h=i-w.height,c.push(ol.Y.TOP),d.push(ol.Y.BOTTOM)):(h=i,c.push(ol.Y.BOTTOM),d.push(ol.Y.TOP)),this.props.renderToBody&&(h+=b.top,g+=b.left),this.ref.style.top="".concat(h,"px"),this.ref.style.left="".concat(g,"px"),(r=this.ref.classList).remove.apply(r,d),(o=this.ref.classList).add.apply(o,c)}},{key:"render",value:function(){var r=this,o=this.props,i=o.style,s=o.className,c=o.innerRef,d=o.children,h=o.renderToBody,g=document.body,m=Q.createElement("div",{ref:function(b){r.ref=b,c(b)},className:"rta__autocomplete ".concat(s||""),style:i},d);return h&&g!==null?cw.createPortal(m,g):m}}]),t}(Q.Component),Q3=function(e){Rv(t,e);function t(n){var r;Mh(this,t),r=Ov(this,Mf(t).call(this,n)),r.state={top:null,left:null,currentTrigger:null,actualToken:"",data:null,value:"",dataLoading:!1,selectionEnd:0,component:null,textToReplace:null},r.escListenerInit=function(){r.escListener||(r.escListener=wu.add(Lo.ESC,r._closeAutocomplete))},r.escListenerDestroy=function(){r.escListener&&(wu.remove(r.escListener),r.escListener=null)},r.getSelectionPosition=function(){return r.textareaRef?{selectionStart:r.textareaRef.selectionStart,selectionEnd:r.textareaRef.selectionEnd}:null},r.getSelectedText=function(){if(!r.textareaRef)return null;var d=r.textareaRef,h=d.selectionStart,g=d.selectionEnd;return h===g?null:r.state.value.substr(h,g-h)},r.setCaretPosition=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;r.textareaRef&&(r.textareaRef.focus(),r.textareaRef.setSelectionRange(d,d))},r.getCaretPosition=function(){if(!r.textareaRef)return 0;var d=r.textareaRef.selectionEnd;return d},r._handleCaretChange=function(d){var h=function(){var w=r.getCaretPosition()-1;r.lastTrigger=r.lastTrigger?w:0};if(d.type==="keydown"){var g=d.keyCode||d.which;switch(g){case Lo.UP:case Lo.DOWN:r._isAutocompleteOpen()||h();break;case Lo.LEFT:case Lo.RIGHT:h();break}return}h()},r._onSelect=function(d){var h=r.state,g=h.selectionEnd,m=h.currentTrigger,w=h.value,b=r.props.onItemSelected;if(m){var T=r._getTextToReplace(m);if(!T){r._closeAutocomplete();return}var E=T(d);if(!E){r._closeAutocomplete();return}b&&b({currentTrigger:m,item:d});var k=function($,J,ae){switch($){case"start":return ae;case"next":case"end":return ae+J.length;default:if(!Number.isInteger($))throw new Error('RTA: caretPosition should be "start", "next", "end" or number.');return $}},C=w.slice(0,g),I=Sg(m),B=C.length-C.lastIndexOf(m),F=C.search(new RegExp("(?!".concat(I,")$")))-B,_=E.caretPosition==="next"?"".concat(E.text," "):E.text,R=k(E.caretPosition,_,F),j=C.substring(0,F)+_,z=w.replace(C,j);r.setState({value:z,dataLoading:!1},function(){var q=r.tokenRegExpEnding.exec(_),$=q?q[0].length:1;r.lastTrigger=R&&R-$,r.textareaRef.value=z,r.textareaRef.selectionEnd=R,r._changeHandler();var J=r.textareaRef.scrollTop;r.setCaretPosition(R),window.chrome&&(r.textareaRef.scrollTop=J)})}},r._getTextToReplace=function(d){var h=r.props.trigger[d];if(!d||!h)return null;var g=h.output;return function(m){if(typeof m=="object"&&(!g||typeof g!="function"))throw new Error('Output functor is not defined! If you are using items as object you have to define "output" function. https://github.com/webscopeio/react-textarea-autocomplete#trigger-type');if(g){var w=g(m,d);if(w===void 0||typeof w=="number")throw new Error(`Output functor should return string or object in shape {text: string, caretPosition: string | number}.
Got "`.concat(String(w),'". Check the implementation for trigger "').concat(d,`"
See https://github.com/webscopeio/react-textarea-autocomplete#trigger-type for more information.
`));if(w===null)return null;if(typeof w=="string")return{text:w,caretPosition:OD};if(!w.text&&typeof w.text!="string")throw new Error('Output "text" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(d,`"
`));if(!w.caretPosition)throw new Error('Output "caretPosition" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(d,`"
`));return w}if(typeof m!="string")throw new Error(`Output item should be string
`);return{text:"".concat(d).concat(m).concat(d),caretPosition:OD}}},r._getCurrentTriggerSettings=function(){var d=r.state.currentTrigger;return d?r.props.trigger[d]:null},r._getValuesFromProvider=function(){var d=r.state,h=d.currentTrigger,g=d.actualToken,m=r._getCurrentTriggerSettings();if(!(!h||!m)){var w=m.dataProvider,b=m.component;if(typeof w!="function")throw new Error("Trigger provider has to be a function!");r.setState({dataLoading:!0});var T=w(g);T instanceof Promise||(T=Promise.resolve(T)),T.then(function(E){if(!Array.isArray(E))throw new Error("Trigger provider has to provide an array!");if(typeof b!="function")throw new Error("Component should be defined!");if(h===r.state.currentTrigger){if(!E.length){r._closeAutocomplete();return}r.setState({dataLoading:!1,data:E,component:b})}}).catch(function(E){return RD(E.message)})}},r._getSuggestions=function(){var d=r.state,h=d.currentTrigger,g=d.data;return!h||!g||g&&!g.length?null:g},r._createRegExp=function(){var d=r.props.trigger;r.tokenRegExp=new RegExp("(".concat(Object.keys(d).sort(function(h,g){return h<g?1:h>g?-1:0}).map(function(h){return Sg(h)}).join("|"),")((?:(?!\\1)[^\\s])*$)")),r.tokenRegExpEnding=new RegExp("(".concat(Object.keys(d).sort(function(h,g){return h<g?1:h>g?-1:0}).map(function(h){return Sg(h)}).join("|"),")$"))},r._closeAutocomplete=function(){var d=r.state.currentTrigger;r.escListenerDestroy(),r.setState({data:null,dataLoading:!1,currentTrigger:null},function(){d&&r._onItemHighlightedHandler(null)})},r._cleanUpProps=function(){var d=WN({},r.props),h=["loadingComponent","boundariesElement","containerStyle","minChar","scrollToItem","ref","innerRef","onChange","onCaretPositionChange","className","value","trigger","listStyle","itemStyle","containerStyle","loaderStyle","className","containerClassName","listClassName","itemClassName","loaderClassName","dropdownStyle","dropdownClassName","movePopupAsYouType","textAreaComponent","renderToBody","onItemSelected","onItemHighlighted"];for(var g in d)h.includes(g)&&delete d[g];return d},r._changeHandler=function(d){var h=r.props,g=h.trigger,m=h.onChange,w=h.minChar,b=h.onCaretPositionChange,T=h.movePopupAsYouType,E=r.state,k=E.top,C=E.left,I=d;I||(I=new $N("change",{bubbles:!0}),r.textareaRef.dispatchEvent(I));var B=I.target||r.textareaRef,F=B.selectionEnd,_=B.value;if(r.lastValueBubbledEvent=_,m&&I&&(I.persist&&I.persist(),m(new Proxy(I,{get:function(V,G,le){return G==="target"?B:Reflect.get(V,G,le)}}))),b){var R=r.getCaretPosition();b(R)}r.setState({value:_});var j=function(){var V=UN(B,F),G=V.top,le=V.left;r.setState({top:G-r.textareaRef.scrollTop||0,left:le})},z=function(V){r.lastTrigger=F-V,r._closeAutocomplete(),j()};if(F<=r.lastTrigger){var q=_.slice(0,F),$=r.tokenRegExp.exec(q);z($?$[0].length:0)}var J=_.slice(r.lastTrigger,F),ae=r.tokenRegExp.exec(J),ie=ae&&ae[0],ge=ae&&ae[1]||null,pe=ge?ge.length-1:0,fe=r.tokenRegExpEnding.exec(J);if(fe?z(fe[0].length):r._isAutocompleteOpen()||r._closeAutocomplete(),(!ie||ie.length<=w+pe)&&(r.state.currentTrigger&&!g[r.state.currentTrigger].allowWhitespace||!r.state.currentTrigger)){r._closeAutocomplete();return}if(ge&&g[ge].afterWhitespace&&!/\s/.test(_[F-ie.length-1])&&_[F-ie.length-1]!==void 0){r._closeAutocomplete();return}if(r.state.currentTrigger&&g[r.state.currentTrigger].allowWhitespace){if(ae=new RegExp("".concat(Sg(r.state.currentTrigger),".*$")).exec(_.slice(0,F)),ie=ae&&ae[0],!ie){r._closeAutocomplete();return}ge=Object.keys(g).find(function(be){return be.slice(0,pe+1)===ie.slice(0,pe+1)})||null}var De=ie.slice(1);if(ge){(T||k===null&&C===null||r.state.currentTrigger!==ge)&&j(),r.escListenerInit();var re=r._getTextToReplace(ge);r.setState({selectionEnd:F,currentTrigger:ge,textToReplace:re,actualToken:De},function(){try{r._getValuesFromProvider()}catch(be){RD(be.message)}})}},r._selectHandler=function(d){var h=r.props,g=h.onCaretPositionChange,m=h.onSelect;if(g){var w=r.getCaretPosition();g(w)}m&&(d.persist(),m(d))},r._shouldStayOpen=function(d){var h=d.relatedTarget;return h===null&&(h=document.activeElement),!!(r.dropdownRef&&h instanceof Node&&r.dropdownRef.contains(h))},r._onClick=function(d){var h=r.props.onClick;h&&(d.persist(),h(d)),!r._shouldStayOpen(d)&&r._closeAutocomplete()},r._onBlur=function(d){var h=r.props.onBlur;h&&(d.persist(),h(d)),!r._shouldStayOpen(d)&&r._closeAutocomplete()},r._onScrollHandler=function(){r._closeAutocomplete()},r._onItemHighlightedHandler=function(d){var h=r.props.onItemHighlighted,g=r.state.currentTrigger;if(h)if(typeof h=="function")h({currentTrigger:g,item:d});else throw new Error("`onItemHighlighted` has to be a function")},r._dropdownScroll=function(d){var h=r.props.scrollToItem;if(h){if(h===!0){nF(r.dropdownRef,d);return}if(typeof h!="function"||h.length!==2)throw new Error("`scrollToItem` has to be boolean (true for default implementation) or function with two parameters: container, item.");h(r.dropdownRef,d)}},r._isAutocompleteOpen=function(){var d=r.state,h=d.dataLoading,g=d.currentTrigger,m=r._getSuggestions();return!!((h||m)&&g)},r._textareaRef=function(d){r.props.innerRef&&r.props.innerRef(d),r.textareaRef=d},r.lastTrigger=0,r.escListener=null;var o=r.props,i=o.loadingComponent,s=o.trigger,c=o.value;if(c&&(r.state.value=c),r._createRegExp(),!i)throw new Error("RTA: loadingComponent is not defined");if(!s)throw new Error("RTA: trigger is not defined");return r}return Av(t,[{key:"componentDidMount",value:function(){wu.startListen(this.textareaRef),this.textareaRef&&this.textareaRef.addEventListener("focus",this._handleCaretChange),this.textareaRef&&this.textareaRef.addEventListener("click",this._handleCaretChange),this.textareaRef&&this.textareaRef.addEventListener("keydown",this._handleCaretChange)}},{key:"componentDidUpdate",value:function(r){var o=r.trigger,i=r.value,s=this.props,c=s.trigger,d=s.value;Object.keys(c).join("")!==Object.keys(o).join("")&&this._createRegExp(),i!==d&&this.lastValueBubbledEvent!==d&&(this.lastTrigger=0,this._changeHandler())}},{key:"componentWillUnmount",value:function(){this.escListenerDestroy(),wu.stopListen(this.textareaRef),this.textareaRef&&this.textareaRef.removeEventListener("focus",this._handleCaretChange),this.textareaRef&&this.textareaRef.removeEventListener("click",this._handleCaretChange),this.textareaRef&&this.textareaRef.removeEventListener("keydown",this._handleCaretChange)}},{key:"render",value:function(){var r=this,o=this.props,i=o.loadingComponent,s=o.style,c=o.className,d=o.listStyle,h=o.itemStyle,g=o.boundariesElement,m=o.movePopupAsYouType,w=o.listClassName,b=o.itemClassName,T=o.dropdownClassName,E=o.dropdownStyle,k=o.containerStyle,C=o.containerClassName,I=o.loaderStyle,B=o.loaderClassName,F=o.textAreaComponent,_=o.renderToBody,R=this.state,j=R.left,z=R.top,q=R.dataLoading,$=R.component,J=R.value,ae=R.textToReplace,ie=this._isAutocompleteOpen(),ge=this._getSuggestions(),pe={},fe;return F.component?(fe=F.component,pe[F.ref]=this._textareaRef):(fe=F,pe.ref=this._textareaRef),Q.createElement("div",{className:"rta ".concat(q===!0?"rta--loading":""," ").concat(C||""),style:k},Q.createElement(fe,Object.assign({},this._cleanUpProps(),{className:"rta__textarea ".concat(c||""),onChange:this._changeHandler,onSelect:this._selectHandler,onScroll:this._onScrollHandler,onClick:this._onClick,onBlur:this._onBlur,value:J,style:s},pe)),ie&&Q.createElement(oF,{innerRef:function(re){r.dropdownRef=re},top:z,left:j,style:E,className:T,movePopupAsYouType:m,boundariesElement:g,textareaRef:this.textareaRef,renderToBody:_},ge&&$&&ae&&Q.createElement(tF,{values:ge,component:$,style:d,className:w,itemClassName:b,itemStyle:h,getTextToReplace:ae,onItemHighlighted:this._onItemHighlightedHandler,onSelect:this._onSelect,dropdownScroll:this._dropdownScroll}),q&&Q.createElement("div",{className:"rta__loader ".concat(ge!==null?"rta__loader--suggestion-data":"rta__loader--empty-suggestion-data"," ").concat(B||""),style:I},Q.createElement(i,{data:ge}))))}}],[{key:"getDerivedStateFromProps",value:function(r){var o=r.value;return o==null?null:{value:o}}}]),t}(Q.Component);Q3.defaultProps={movePopupAsYouType:!1,value:null,minChar:1,boundariesElement:"body",scrollToItem:!0,textAreaComponent:"textarea",renderToBody:!1};const aF=()=>{const{app:e}=ut.getState(),t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())},iF=e=>{let t=[];const n=ut.getState().settings;if(n&&(n!=null&&n.UseVaultTags))t=aF();else{const{tags:i}=Me.getState();t=i}const r=e.toLowerCase(),o=[];return t.forEach(i=>{i&&i.toLowerCase().contains(r)&&o.push({name:i,char:i})}),o},sF=e=>{const{app:t}=ut.getState(),n=t.vault.getAllLoadedFiles(),r=[];let o;return n.forEach(i=>{e==="["?o="":e.contains("[")&&(o=e.slice(1));const s=o.toLowerCase();i instanceof N.TFile&&["md","png","jpg","canvas","jpeg","gif"].contains(i.extension)&&i.path.toLowerCase().contains(s)&&r.push({name:i.basename,char:i.name,file:i})}),r};function av(e,t){const n=Object.keys(t).map(r=>lF(e,r,t[r]));return n.length===1?n[0]:function(){n.forEach(r=>r())}}function lF(e,t,n){const r=e[t],o=e.hasOwnProperty(t);let i=n(r);return r&&Object.setPrototypeOf(i,r),Object.setPrototypeOf(s,i),e[t]=s,c;function s(...d){return i===r&&e[t]===s&&c(),i.apply(this,d)}function c(){e[t]===s&&(o?e[t]=r:delete e[t]),i!==r&&(i=r,Object.setPrototypeOf(s,r||Function))}}function uF(e){return e.containerEl.matches(".memos-list-view")}const cF=e=>{const{dailyNotesState:{app:t,plugin:n,editor:r,view:o,dailyNotes:i}}=A.useContext(Nt),[s,c]=A.useState(null),[d,h]=A.useState(!1),[g,m]=A.useState(""),[w,b]=A.useState(null),T=A.useRef(N.debounce((j,z)=>{dF(j,z)},100));A.useEffect(()=>{if(!w){for(const j in i)if(i[j]instanceof N.TFile){b(i[j]);break}}},[i]),A.useEffect(()=>{if(!(!e||!r)&&!d)return I(e),()=>{h(!1),s==null||s.destroy()}},[r,e]),A.useEffect(()=>{if(!s||!t)return;const j=fF(t);m(j),(s==null?void 0:s.editor).replaceSelection(j)},[s,t]),A.useEffect(()=>{!s||!t||T.current(g,t)},[g,t]);const E=()=>{s&&s.toggleSource()},k=N.debounce((j,z)=>C(j,z),500,!0),C=(j,z)=>{j&&m(z)},I=j=>{if(r&&o){o.register(av(r.constructor.prototype,{onUpdate:q=>function(...$){if(q.call(this,$),$[1]===!0&&this.owner&&this.owner instanceof bu){const J=this.get();k(this.owner,J)}},getMode:()=>function(){return"source"}})),o.register(av(N.Workspace.prototype,{getActiveViewOfType:q=>function($){const J=q.call(this,$);if(!J&&($==null?void 0:$.VIEW_TYPE)==="markdown"){const ae=this.activeLeaf;if(ae.view instanceof bu)return ae.view}return J},setActiveLeaf:q=>function($,J){if(uF($)&&(q.call(this,$,J),$.activeTime=17e11),q.call(this,$,J),$.view instanceof bu){const ae=rt.getState().instanceList.get($.id);if(!ae)return;self.app.workspace.activeEditor=ae.owner,$.view.editor=ae.editor}},getActiveFile:q=>function(){var J;const $=q.call(this);return((J=this.activeLeaf)==null?void 0:J.view)instanceof bu&&w||$}}));const z=new r.constructor(o.app,j,o);z.owner.editor=z.editor,z.owner.onMarkdownScroll=()=>{},t.workspace.trigger("thino-editor-created",j,z.editor),h(!0),c(z),rt.setInstance(`${o.leaf.id}`,z)}};return{instance:s,value:g,set:j=>{try{s&&((s==null?void 0:s.editor).replaceSelection(j),m(j))}catch(z){console.error(z)}},get:()=>s?s.get():"",append:(j,z)=>{if(!s||z&&z!==s.owner.leaf.id)return;const $=(s.get()||"")+j;(s==null?void 0:s.editor).replaceSelection(j),m($)},clear:()=>{s&&(s.clear(),m(""))},toggleSource:E}};function Z3(e){return`thinoEditorContentCache:${e}`}function fF(e){try{const t=Z3(e.appId);return zn.get([t])[t]??""}catch(t){return console.error(t),""}}function dF(e,t){try{const n=Z3(t.appId);zn.set({[n]:e})}catch(n){console.error(n)}}const LD=({entity:{name:e,char:t,file:n}})=>D.jsx("div",{children:`${t}`}),pF=({data:e})=>D.jsx("div",{children:"Loading"});let gi;const hF=A.forwardRef((e,t)=>{var we;const{globalState:{useTinyUndoHistoryCache:n,globalEditorShown:r},dailyNotesState:{settings:o,app:i}}=A.useContext(Nt),{SaveMemoButtonLabel:s,SaveMemoButtonIcon:c}=o,{className:d,inputerType:h,initialContent:g,placeholder:m,showConfirmBtn:w,showCancelBtn:b,onConfirmBtnClick:T,onCancelBtnClick:E,onContentChange:k}=e,C=A.useRef(null),I=A.useRef(null),B=A.useRef(null),F=YN(),{instance:_,value:R,set:j,get:z,append:q,clear:$,toggleSource:J}=cF(I.current),[,ae,ie]=Or(0),[ge,pe]=Or(!1);A.useEffect(()=>{var ue,Se;if(o&&o.FocusOnEditor)switch(h){case"minimal":case"memos":(ue=C.current)==null||ue.focus();break;case"obsidian":_&&((Se=_.editor)==null||Se.focus())}},[o,_]),A.useEffect(()=>{if(!i)return;const ue=i.workspace.getLeavesOfType(Ar);let Se,Re;ue.length>0?(Re=ue[0].view.containerEl,Se=Re.offsetHeight):(Re=document,Se=window.outerHeight),ae(Se)},[i]),A.useEffect(()=>{!C.current||h==="obsidian"||g&&(C.current.value=g,F())},[]),A.useEffect(()=>{var ue;if(h!=="obsidian")if(n){if(!C.current)return;const{tinyUndoActionsCache:Se,tinyUndoIndexCache:Re}=zn.get(["tinyUndoActionsCache","tinyUndoIndexCache"]);return B.current=new BN(C.current,{interval:5e3,initialActions:Se,initialIndex:Re}),B.current.subscribe((Ye,Be)=>{zn.set({tinyUndoActionsCache:Ye,tinyUndoIndexCache:Be})}),()=>{var Ye;(Ye=B.current)==null||Ye.destroy()}}else(ue=B.current)==null||ue.destroy(),B.current=null,zn.remove(["tinyUndoActionsCache","tinyUndoIndexCache"])},[n]),A.useEffect(()=>{C.current&&(C.current.style.height="auto",C.current.style.height=(C.current.scrollHeight??0)+"px")},[(we=C.current)==null?void 0:we.value]),A.useImperativeHandle(t,()=>({element:C.current,blur:()=>{var ue,Se;switch(h){case"minimal":case"memos":(ue=C.current)==null||ue.blur();break;case"obsidian":_&&((Se=_.editor)==null||Se.blur())}},focus:ue=>{var Se,Re,Ye,Be,yt;switch(h){case"minimal":case"memos":o!=null&&o.FocusOnEditor&&((Se=C.current)==null||Se.focus());break;case"obsidian":if(o!=null&&o.FocusOnEditor&&_){if(ue&&ue!==((Be=(Ye=(Re=_==null?void 0:_.owner)==null?void 0:Re.view)==null?void 0:Ye.leaf)==null?void 0:Be.id))return;(yt=_.editor)==null||yt.focus()}}},insertText:(ue,Se)=>{switch(h){case"minimal":case"memos":{if(!C.current)return;const Re=C.current.value;C.current.value=Re.slice(0,C.current.selectionStart)+ue+Re.slice(C.current.selectionStart),k(C.current.value),F()}break;case"obsidian":_&&q(ue,Se);break}},setContent:ue=>{switch(h){case"minimal":case"memos":C.current&&(C.current.value=ue,k(C.current.value),F());break;case"obsidian":_&&j(ue);break}},getContent:()=>{switch(h){case"minimal":case"memos":return C.current?C.current.value:"";case"obsidian":return z()}},toggleSource:()=>{switch(h){case"minimal":case"memos":break;case"obsidian":J();break}},clear:()=>{switch(h){case"minimal":case"memos":C.current&&(C.current.value="",k(C.current.value),F());break;case"obsidian":$();break}}}),[_,h]);const fe=ue=>{if(!C.current)return;const{fileManager:Se}=xe.getState().dailyNotesState.app;if(ue.currentTrigger==="#"){const Re=C.current.value;let Ye;gi!=null?Ye=gi.length:Ye=0;let Be=C.current.selectionStart;for(let yt=0;yt<Re.length;yt++)/\s/g.test(Re[Be])||Be++;C.current.value=Re.slice(0,C.current.selectionStart-Ye)+ue.item.char+Re.slice(Be),k(C.current.value),F()}else if(ue.currentTrigger==="[["){const Re=Se.generateMarkdownLink(ue.item.file,ue.item.file.path,"",""),Ye=C.current.value;let Be;gi!=null?Re.contains("[[")||ue.item.file.extension!=="md"?Be=gi.length+1:Be=gi.length+2:Be=2;let yt=C.current.selectionStart;for(let Ee=0;Ee<Ye.length;Ee++)/\s/g.test(Ye[yt])||yt++;C.current.value=Ye.slice(0,C.current.selectionStart-Be)+Re+Ye.slice(yt),k(C.current.value),F()}},De=A.useCallback(()=>{var ue;k(((ue=C.current)==null?void 0:ue.value)??""),F()},[]),re=()=>{var ue;switch(h){case"minimal":case"memos":if(!C.current)return;C.current.value=V(),T(C.current.value),C.current.value="",F(),(ue=B.current)==null||ue.resetState();break;case"obsidian":T(z()),$(),F();break}},be=A.useCallback(()=>{switch(h){case"minimal":case"memos":C.current&&(C.current.value="",k(C.current.value),F());break;case"obsidian":$();break}E()},[h,_,C]),V=()=>zn.get(["thinoEditorContentCache"]).thinoEditorContentCache??"",G=()=>{if(C.current)return C.current.value=V(),C.current.value},le=ue=>{switch(ue){case"memos":return D.jsx(Q3,{className:`common-editor-inputer scroll ${ge?" editing":""}`,loadingComponent:pF,placeholder:m,movePopupAsYouType:!0,value:G(),innerRef:Se=>{C.current=Se},onFocus:()=>{pe(!0)},onBlur:()=>{pe(!1)},onInput:De,style:{maxHeight:`${ie.current>400?ie.current-400:100}px`},dropdownStyle:{minWidth:180,maxHeight:250,overflowY:"auto"},minChar:0,onItemSelected:fe,scrollToItem:!0,trigger:{"#":{dataProvider:Se=>(gi=Se,iF(Se).map(({name:Re,char:Ye})=>({name:Re,char:Ye}))),component:LD,afterWhitespace:!0,output:Se=>Se.char},"[[":{dataProvider:Se=>(gi=Se,sF(Se).slice(0,10).map(({name:Re,char:Ye,file:Be})=>({name:Re,char:Ye,file:Be}))),component:LD,afterWhitespace:!0,output:Se=>Se.char}}});case"minimal":return D.jsx("textarea",{style:{minHeight:48},className:"common-editor-inputer scroll",rows:1,placeholder:m,ref:C,onInput:De});case"obsidian":return D.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",ref:I});default:return D.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",ref:I})}};return D.jsxs("div",{className:"common-editor-wrapper "+d,children:[le(h),D.jsxs("div",{className:"common-tools-wrapper",children:[D.jsx("div",{className:"common-tools-container",children:D.jsx(Fa,{when:e.tools!==void 0,children:e.tools})}),D.jsxs("div",{className:"btns-container",children:[D.jsx(Fa,{when:b,children:D.jsx("button",{className:"action-btn cancel-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&be()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&be()},children:O("CANCEL EDIT")})}),D.jsx(Fa,{when:w,children:D.jsxs("button",{title:"Ctrl/Cmd + Enter to save thino",className:"action-btn confirm-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&re()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&re()},children:[s,D.jsxs("span",{className:"icon-text",children:[c,""]})]})})]})]})]})}),mF=(e,t)=>({placement:e,modifiers:[{name:"flip",options:{allowedAutoPlacements:t,rootBoundary:"document"}},{name:"preventOverflow",options:{rootBoundary:"document"}}]}),gF=e=>{const n=A.useRef(null),[r,o]=A.useState(null),[i,s]=A.useState(0);let c,d;const h=()=>{if(N.Platform.isMobile){c="right-end",d=["bottom"];return}const m=window.innerWidth-i>280*1.2,w=window.innerWidth-i<280,b=window.innerWidth>280*1.5;if(e.DefaultEditorLocation!=="Bottom"){m?(c="right-end",d=["left-end"]):w&&b?(c="left-end",d=["right-end"]):(c="bottom",d=["bottom"]);return}m?(c="top-end",d=["top-start"]):w&&i>280?(c="top-start",d=["top-end"]):(c="top",d=["top"])};A.useEffect(()=>{e&&h()},[i,e==null?void 0:e.DefaultEditorLocation]);const g=Iv(n.current,r,mF(c,d));return{setPosX:s,popperRef:n,setPopperElement:o,popper:g}},vF=e=>{const{offsetLeft:t,offsetTop:n,offsetHeight:r,offsetWidth:o,selectionEnd:i}=e,s=document.createElement("div"),c=window.getComputedStyle(e);for(const E of c)s.style.setProperty(E,c.getPropertyValue(E));s.style.position="fixed",s.style.visibility="hidden",s.style.whiteSpace="pre-wrap";const h=e.tagName==="INPUT"?e.value.replace(/ /g,"."):e.value;s.textContent=h.substring(0,i||0),e.tagName==="TEXTAREA"&&(s.style.height="auto");const g=document.createElement("span");g.textContent=h.substring(i||0)||".",s.appendChild(g),document.body.appendChild(s);const{offsetLeft:m,offsetTop:w,offsetHeight:b,offsetWidth:T}=g;return document.body.removeChild(s),{x:t+m,y:n+w,h:r+b,w:o+T}},Zp=({className:e,editorType:t="block"})=>{const{globalState:n,dailyNotesState:{app:r,settings:o,view:i,verifyState:s}}=A.useContext(Nt),[c,d]=Oa(!0),h=A.useRef(c),[g,m]=Or(!0),w=A.useRef(null),b=A.useRef(null),T=A.useRef(n),[E,k]=Or(!1),[C,I]=Or(!1),{setPosX:B,popperRef:F,setPopperElement:_,popper:R}=gF(o),[j]=Or(parseInt(N.moment().format("x"))),z=A.useRef(null),[q,$]=Or((o==null?void 0:o.EnabledLocationList.length)===1?o==null?void 0:o.EnabledLocationList[0].value:(o==null?void 0:o.MemoSaveLocation)||"DAILY"),J=A.useRef(o.MemoSaveLocation||"DAILY");A.useEffect(()=>{h.current=c},[c]),A.useEffect(()=>{!b.current||!r||!i||(i.registerEvent(r.workspace.on("focus-on-textarea",Ee=>{var Ve;(Ve=b.current)==null||Ve.focus(Ee==null?void 0:Ee.id)})),i.registerEvent(r.workspace.on("blur-on-memos",()=>{var Ee;(Ee=b.current)==null||Ee.blur()})),i.registerEvent(r.workspace.on("send-to-thino",async(Ee,Ve)=>{var Ke,Xe;if(typeof Ee=="string")(Ke=b.current)==null||Ke.insertText(Ee+`
`,Ve.id);else{const Ge=Ee.toPNG(),tt=new Blob([Ge],{type:"image/png"}),Dt=new File([tt],"image.png",{type:"image/png",lastModified:Date.now()});if(!Dt)return;const dt=await De(Dt);dt&&((Xe=b.current)==null||Xe.insertText(dt+`
`,Ve.id))}})))},[b,i,r]),A.useEffect(()=>{o&&d(o.DefaultPrefix==="List")},[o==null?void 0:o.DefaultPrefix]),A.useEffect(()=>{if(o){if(o.EnabledLocationList.length===1){$(o.EnabledLocationList[0].value);return}$(o.MemoSaveLocation||"DAILY")}},[o==null?void 0:o.MemoSaveLocation,o==null?void 0:o.EnabledLocationList]),A.useEffect(()=>{var Ke;if(!o||!z.current)return;const Ee=(Ke=Df.find(Xe=>Xe.title===q))==null?void 0:Ke.icon;N.setIcon(z.current,Ee),N.requireApiVersion("1.4.4")&&N.setTooltip(z.current,O("Thino Save To: ")+q),J.current=q;const Ve=n.manifest;if(Ve){const Xe=r==null?void 0:r.plugins.getPlugin(Ve.id);if(Xe){if(Xe.settings.MemoSaveLocation===q)return;Xe.settings.MemoSaveLocation=q,Xe.saveSettings()}}},[q,g]),A.useEffect(()=>{b.current&&o.MemoSaveLocation&&$(o.MemoSaveLocation)},[z,o]),A.useEffect(()=>{if(!b.current||!o||N.Platform.isDesktop||n.globalEditorShown)return;const Ee=N.Platform.isMobile===!0,Ve=o.UseButtonToShowEditor&&o.DefaultEditorLocation==="Bottom";m(Ee&&!Ve);const Ke=document.body.find(".memolist-wrapper");Ke&&(Ke.onscroll=()=>{if(n.globalEditorShown)return;const Xe=b.current.getContent();Ee&&Ve&&!Xe&&m(!1)})},[n.globalEditorShown,b,o==null?void 0:o.UseButtonToShowEditor,o==null?void 0:o.DefaultEditorLocation]);const ae=()=>{I(!1)};A.useEffect(()=>{var Ee,Ve,Ke,Xe,Ge,tt,Dt,dt;if(n.markMemoId){const Vt=`${O("MARK")}: [@THINO](${n.markMemoId})`;(Ee=b.current)==null||Ee.insertText(Vt),(Ve=b.current)==null||Ve.focus(),rt.setMarkMemoId("");return}if((Ke=n.editMemoId)!=null&&Ke.trim()&&n.editMemoId!==T.current.editMemoId){const Vt=Me.getMemoById(n.editMemoId);if(Vt)switch(o.EditorType){case"memos":(Xe=b.current)==null||Xe.setContent(Vt.content.replace(/<br>/g,`
`).replace(/ \^\S{6}$/,"")??""),(Ge=b.current)==null||Ge.focus();break;case"obsidian":(tt=b.current)==null||tt.clear(),(Dt=b.current)==null||Dt.setContent(Vt.content.replace(/<br>/g,`
`).replace(/ \^\S{6}$/,"")??""),(dt=b.current)==null||dt.focus();break}}T.current=n},[n.markMemoId,n.editMemoId]),A.useEffect(()=>{var Ee,Ve,Ke;!b.current||E||o.EditorType==="memos"&&((Ee=b.current)==null||Ee.element.addEventListener("paste",ie),(Ve=b.current)==null||Ve.element.addEventListener("drop",ge),(Ke=b.current)==null||Ke.element.addEventListener("click",pe),k(!0))},[b.current]);const ie=async Ee=>{var Ve;if(Ee.clipboardData&&Ee.clipboardData.files.length>0){Ee.preventDefault();const Ke=Ee.clipboardData.files;for(const Xe of Ke){const Ge=await De(Xe);Ge&&((Ve=b.current)==null||Ve.insertText(Ge))}}},ge=async Ee=>{var Ve;if(Ee.dataTransfer&&Ee.dataTransfer.files.length>0){Ee.preventDefault();const Ke=Ee.dataTransfer.files;for(const Xe of Ke){const Ge=await De(Xe);Ge&&((Ve=b.current)==null||Ve.insertText(Ge))}}},pe=()=>{var Ee;V(((Ee=b.current)==null?void 0:Ee.element.value)??"")},fe=async(Ee,Ve)=>{var Ge,tt,Dt;const Ke=Ee.ctrlKey||Ee.metaKey,Xe=Ee.altKey;if(Ee.key==="Escape"&&n.globalEditorShown&&(rt.setGlobalEditorShown(!1),Ee.preventDefault()),Ke&&Ee.key==="Enter"){Ee.preventDefault(),Ee.stopPropagation(),Ve?(await re((tt=b.current)==null?void 0:tt.getContent()),(Dt=b.current)==null||Dt.clear()):await re((Ge=b.current)==null?void 0:Ge.element.value);return}if(Xe)for(let dt=0;dt<o.EnabledLocationList.length;dt++)Ee.key===(dt+1).toString()&&$(o.EnabledLocationList[dt].value);setTimeout(()=>{var dt;Ve||V(((dt=b.current)==null?void 0:dt.element.value)??"")})},De=A.useCallback(async Ee=>{const{type:Ve}=Ee;if(Ve.startsWith("image"))try{return`${await lw.upload(Ee)}`}catch(Ke){new N.Notice(Ke)}},[]),re=async Ee=>{if(!Ee||Ee.trim()===""){new N.Notice(O("Content cannot be empty"));return}const Ve=async(Xe,Ge)=>{Ge=Ge.replaceAll("&nbsp;"," "),Eg("");try{if(!Xe){let Dt;switch(J.current){case"CANVAS":Dt=await Me.createMemoCanvas({text:Ge,isList:h.current});break;case"MULTI":Dt=await Me.createMemoMultiFile({content:Ge,isList:h.current});break;case"DAILY":Dt=await Me.createMemoDaily(Ge,h.current);break;case"FILE":Dt=await Me.createMemoSingleFile({content:Ge,isList:h.current});break}if(!Dt)return;Me.pushMemo(Dt),it.clearQuery();const dt=r||ut.getState().app,Vt=dt==null?void 0:dt.loadLocalStorage("tokenForSync");Dt&&Vt&&o.startSync&&setTimeout(async()=>{const Yo=await h3({content:Ge,thinoType:J.current==="DAILY"?"DAILY":"FILE"});await Me.updateMemoById(Dt.id,Yo,!0)},200);return}const tt=Me.getMemoById(Xe);if(tt&&tt.content!==Ge){const Dt=await Me.updateMemo(tt.id,Ge,h.current?"JOURNAL":"TASK-TODO");Dt.updatedAt=Ue.getDateTimeString(Date.now()),Me.editMemo(Dt)}rt.setEditMemoId("")}catch(tt){new N.Notice(tt.message)}},{editMemoId:Ke}=rt.getState();await Ve(Ke,Ee),Eg("")},be=A.useCallback(()=>{var Ee;rt.setEditMemoId(""),(Ee=b.current)==null||Ee.setContent(""),Eg("")},[]),V=A.useCallback(Ee=>{if(Eg(Ee??""),!b.current)return;const Ve=b.current.getContent(),Ke=b.current.element.selectionStart,Xe=Ve.slice(0,Ke),Ge=Ve.slice(Ke);(Xe.endsWith("@")||Xe.endsWith("📆"))&&Ge.startsWith(" ")||(Xe.endsWith("@")||Xe.endsWith("📆"))&&Ge===""?(Re(),I(!0)):I(!1),setTimeout(()=>{var tt;(tt=b.current)==null||tt.focus()})},[o.EditorType]),G=Ee=>{if(!b.current||!o)return;Ee&&(ae(),d(!1));const Ve=b.current.getContent(),Ke=b.current.element.selectionStart,Xe=Ve.slice(0,Ke),Ge=Ve.slice(Ke),tt=N.moment(Ee);if(Xe.endsWith("@"))switch(o.InsertDateFormat){case"Dataview":b.current.element.value=Ve.slice(0,b.current.element.selectionStart-1)+"[due::"+tt.format("YYYY-MM-DD")+"]"+Ge,b.current.element.setSelectionRange(Ke+17,Ke+17),b.current.focus(),V(b.current.element.value);break;case"Tasks":b.current.element.value=Ve.slice(0,b.current.element.selectionStart-1)+"📆"+tt.format("YYYY-MM-DD")+Ge,b.current.element.setSelectionRange(Ke+11,Ke+11),b.current.focus(),V(b.current.element.value)}else{b.current.element.value=Xe+tt.format("YYYY-MM-DD")+Ge,b.current.element.setSelectionRange(Ke+10,Ke+10),b.current.focus(),V(b.current.element.value);return}},le=()=>{b.current&&d()},we=async()=>{var Ke;const Ee=!N.Platform.isDesktop&&await((Ke=window.Capacitor)==null?void 0:Ke.Plugins.Device.getId()),Ve=N.Platform.isDesktop?await Un():Ee.identifier||Ee.uuid;return!s&&(s==null?void 0:s.appId)!==Ve?(yr(),!1):!0},ue=Ee=>{if(!we())return;const Ve=new N.Menu;o.EnabledLocationList.forEach(tt=>{Ve.addItem(Dt=>{var dt;Dt.setTitle(tt.value).setIcon(((dt=Df.find(Vt=>Vt.title===tt.value))==null?void 0:dt.icon)??"file").setChecked(q===tt.value).onClick(()=>{$(tt.value)})})});let Ke=Ee.target,Xe=null;for(;!Ke.hasClass("location-wrapper")&&(Xe=Ke.parentElement,Xe);)Ke=Xe;const Ge=Ke.getBoundingClientRect();setTimeout(()=>{Ve.showAtPosition({x:Ge.x,y:Ge.bottom,width:Ge.width,left:!1,overlap:!0})},200)},Se=A.useCallback(()=>{var Ee,Ve;if(!(!b.current&&o.EditorType==="memos"))switch(o.EditorType){case"obsidian":(Ee=b.current)==null||Ee.focus(),(Ve=r==null?void 0:r.commands)==null||Ve.executeCommandById("editor:insert-tag");break;case"memos":{const Ke=b.current.getContent(),Xe=b.current.element.selectionStart,Ge=Ke.slice(0,Xe),tt=Ke.slice(Xe);let Dt=Ge+"# "+tt,dt=Ge.length+1;Ge.endsWith("#")&&tt.startsWith(" ")&&(Dt=Ge.slice(0,Ge.length-1)+tt.slice(1),dt=Ge.length-1),b.current.element.value=Dt,b.current.element.setSelectionRange(dt,dt),b.current.focus();const Vt=new Event("input",{bubbles:!0,cancelable:!0});b.current.element.dispatchEvent(Vt),V(b.current.element.value)}}},[r]),Re=A.useCallback(()=>{if(!b.current||!F.current||!o||!r)return;const Ke=r.workspace.getLeavesOfType(Ar)[0].view.containerEl,Xe=280,Ge=Ke.clientWidth,{x:tt,y:Dt}=vF(b.current.element);let dt,Vt;N.Platform.isMobile?(window.innerWidth-tt>Xe?dt=(tt+Xe+16>Ge,tt+18):window.innerWidth-tt<Xe?dt=(tt+Xe+16>Ge,tt+34):dt=b.current.element.clientWidth/2,o.DefaultEditorLocation==="Bottom"&&window.innerWidth>875?Vt=Dt+4:o.DefaultEditorLocation==="Bottom"&&window.innerWidth<=875?Vt=Dt+19:o.DefaultEditorLocation==="Top"&&window.innerWidth<=875&&(Vt=Dt+36)):(dt=(tt+Xe+16>Ge,tt+18),Vt=Dt+34),B(tt),F.current.style.left=`${dt}px`,F.current.style.top=`${Vt}px`},[o,r]),Ye=A.useCallback(()=>{const Ee=document.createElement("input");document.body.appendChild(Ee),Ee.type="file",Ee.multiple=!1,Ee.accept="image/png, image/gif, image/jpeg",Ee.onchange=async()=>{var Xe;if(!Ee.files||Ee.files.length===0)return;const Ve=Ee.files[0],Ke=await De(Ve);Ke&&((Xe=b.current)==null||Xe.insertText(Ke)),document.body.removeChild(Ee)},Ee.click()},[]),Be=!!n.editMemoId,yt=A.useMemo(()=>({className:"memo-editor",inputerType:o.EditorType||"obsidian",initialContent:yF(),placeholder:O("What do you think now..."),showConfirmBtn:!0,showCancelBtn:Be,showTools:!0,onConfirmBtnClick:re,onCancelBtnClick:be,onContentChange:V}),[Be,o.EditorType]);return D.jsxs(D.Fragment,{children:[!n.globalEditorShown&&t==="block"&&D.jsx("div",{ref:Ee=>{w.current=Ee,Ee&&N.setIcon&&N.setIcon(Ee,"plus-circle")},className:`memo-show-editor-button ${g?"hidden":""}`,onClick:()=>{var Ee;(Ee=w.current.firstElementChild)==null||Ee.toggleClass("rotate-hidden",!0),setTimeout(()=>{m(!0),w.current.firstElementChild.toggleClass("rotate-hidden",!1)},500),setTimeout(()=>{var Ve;(Ve=b.current)==null||Ve.focus()},600)}}),D.jsxs("div",{className:`memo-editor-wrapper ${e||""} ${Be?"edit-ing":""} ${n.globalEditorShown?"fullscreen-editor":""} ${g?"":"hidden"}`,onKeyDownCapture:Ee=>fe(Ee,!0),children:[D.jsx("span",{className:`tip-text ${Be?"":"hidden"}`,children:"Modifying..."}),D.jsx(hF,{ref:b,...yt,tools:D.jsxs(D.Fragment,{children:[D.jsx("span",{ref:Ee=>{Ee&&N.setIcon(Ee,"hash")},className:"btn action-btn add-tag",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!n.globalEditorShown&&Se()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||n.globalEditorShown)&&Se()}}),D.jsx("span",{ref:Ee=>{Ee&&N.setIcon(Ee,"paperclip")},className:"btn action-btn file-upload",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!n.globalEditorShown&&Ye()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||n.globalEditorShown)&&Ye()}}),D.jsx("span",{ref:Ee=>{Ee&&N.setIcon(Ee,c?"check-square":"layout-list")},className:"btn action-btn list-or-task",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!n.globalEditorShown&&le()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||n.globalEditorShown)&&le()}}),D.jsx("div",{ref:Ee=>{Ee&&(N.setIcon&&N.setIcon(Ee,n.globalEditorShown?"shrink":"expand"),N.setTooltip&&N.setTooltip(Ee,n.globalEditorShown?O("Exit fullscreen mode"):O("Enter fullscreen mode")))},className:"action-btn show-editor",onPointerDown:()=>{we()&&(m(!0),rt.setGlobalEditorShown(!n.globalEditorShown))}}),D.jsx("div",{className:"action-btn split-line"}),D.jsx("div",{className:"action-btn location-wrapper",onClick:Ee=>{o&&o.DefaultEditorLocation==="Top"&&!n.globalEditorShown&&ue(Ee)},onPointerDown:Ee=>{(o&&o.DefaultEditorLocation==="Bottom"||n.globalEditorShown)&&ue(Ee)},children:D.jsx("div",{ref:z,className:"action-btn file-location-btn"})})]})}),D.jsx("div",{ref:F,className:"date-picker",children:C&&D.jsx("div",{tabIndex:-1,style:R.styles.popper,...R.attributes.popper,ref:_,role:"dialog",children:D.jsx(kv,{className:`editor-date-picker ${C?"":"hidden"}`,datestamp:j,handleDateStampChange:G})})})]})]})};function yF(){return zn.get(["thinoEditorContentCache"]).thinoEditorContentCache??""}function Eg(e){zn.set({thinoEditorContentCache:e})}function wF(){const{locationState:{pathname:e},globalState:{memoListView:t,globalEditorShown:n}}=A.useContext(Nt);return D.jsxs(D.Fragment,{children:[n&&D.jsx(Zp,{}),!n&&D.jsx("section",{id:"page-wrapper",className:`memos-${e==="/"?t:"list"}-view`,children:D.jsxs(D.Fragment,{children:[D.jsx(jN,{}),D.jsx("main",{className:"content-wrapper",children:yQ(e)})]})})]})}const bF={"*":D.jsx(wF,{})},DF=()=>{const{dailyNotesState:{app:e,view:t},locationState:{query:{type:n}}}=A.useContext(Nt),r=Q.useRef(null),o=Q.useRef(null),[i,s]=Oa(!1);A.useEffect(()=>{!r||!t||!e||(t.registerEvent(e.workspace.on("blur-on-memos",()=>{var m;(m=r.current)==null||m.blur()})),t.registerEvent(e.workspace.on("focus-on-searchBar",()=>{var m;(m=r.current)==null||m.focus()})))},[r,e,t]),A.useEffect(()=>{o&&N.setIcon(o.current,"search")},[o]);const c=m=>{const{type:w}=it.getState().query;m===w&&(m=""),it.setMemoTypeQuery(m)},d=m=>{const w=m.currentTarget.value;if(!w.contains(" -time: ")){it.setTextQuery(w);return}const b=w.split(" -time: ")[1],T=b.length>10?b.match(/\d{4}-\d{2}-\d{2}/g):null;if(T==null){it.setTextQuery(w.split(" -time: ")[0]);return}if(T.length===1){const E=N.moment(T[0]);it.setTimeQuery({from:E.startOf("day").valueOf(),to:E.endOf("day").valueOf()})}else if(T.length===2){const E=N.moment(T[0]),k=N.moment(T[1]);it.setTimeQuery({from:E.startOf("day").valueOf(),to:k.endOf("day").valueOf()})}it.setTextQuery(w.split(" -time: ")[0])},h=()=>{s(!0)},g=()=>{s(!1)};return D.jsxs("div",{className:"search-bar-container",children:[D.jsxs("div",{className:"search-bar-inputer",children:[D.jsx("span",{ref:o,className:"btn icon-img"}),D.jsx("input",{ref:r,className:"text-input",type:"text",onMouseOver:h,onMouseOut:g,placeholder:i?O("Type here"):"",onChange:d})]}),D.jsx("div",{className:"quickly-action-wrapper",children:D.jsxs("div",{className:"quickly-action-container",children:[D.jsx("span",{className:"title-text",children:O("Quick filter")}),D.jsxs("div",{className:"section-container types-container",children:[D.jsxs("span",{className:"section-text",children:[O("TYPE"),":"]}),D.jsx("div",{className:"values-container",children:v1.map((m,w)=>D.jsxs("div",{children:[D.jsx("span",{className:`type-item ${n===m.value?"selected":""}`,onClick:()=>{c(m.value)},children:m.text}),w+1<v1.length?D.jsx("span",{className:"split-text",children:"/"}):null]},m.value))})]})]})})]})},_D={list:"align-justify",waterfall:"layout-grid",calendar:"calendar",minimal:"list",table:"table"},SF=e=>{const{dailyNotesState:{app:t,view:n,verifyState:r},globalState:{manifest:o}}=A.useContext(Nt),i=A.useRef(null),s=A.useRef(null),[c,d]=A.useState("list"),[h,g]=A.useState(null);A.useEffect(()=>{if(!o||!t)return;const w=t==null?void 0:t.plugins.getPlugin(o.id);g(w),d(w==null?void 0:w.settings.MemoListView),rt.setMemoListView(w==null?void 0:w.settings.MemoListView)},[o,t]),A.useEffect(()=>{if(!t||!n||!h)return;const w=()=>{if(n.leaf.height===0)return;const b=h==null?void 0:h.settings.MemoListView;n.leaf.width>876?(d(b||"list"),rt.setMemoListView(b||"list")):n.leaf.width<875&&(rt.setMemoListView("list"),d("list"))};w(),s.current||(s.current=t.workspace.on("resize",w),n.registerEvent(s.current))},[t,n,h]),A.useEffect(()=>{i&&(N.setIcon(i.current,_D[c]),rt.setMemoListView(c),N.requireApiVersion("1.4.4")&&N.setTooltip(i.current,O("Switch view")))},[c]);const m=async w=>{var I;const b=!N.Platform.isDesktop&&await((I=window.Capacitor)==null?void 0:I.Plugins.Device.getId()),T=N.Platform.isDesktop?await Un():b.identifier||b.uuid;if(!r||(r==null?void 0:r.appId)!==T){yr();return}const E=async B=>{rt.setMemoListView(B),h&&(h.settings.MemoListView=B,await h.saveSettings()),d(B)},k=[{view:"list",title:O("List")},{view:"waterfall",title:O("Waterfall")},{view:"calendar",title:O("Calendar")},{view:"table",title:O("Table")}],C=new N.Menu;k.forEach(({view:B,title:F})=>{C.addItem(_=>{_.setChecked(c===B).setIcon(_D[B]).setTitle(F).onClick(()=>{c!==B&&E(B)})})}),C.showAtMouseEvent(w.nativeEvent)};return D.jsx("div",{className:`memos-view-switcher-wrapper ${e.className?e.className:""}`,ref:i,onClick:m})},EF=()=>{const e=A.useRef(null);return A.useEffect(()=>{e&&(N.setIcon(e.current,"calendar-check"),N.setTooltip&&N.setTooltip(e.current,O("Daily Memos")))},[e]),D.jsx("div",{className:"memos-review-entry-wrapper",ref:e,onClick:()=>{Up()}})},TF=e=>{var b,T;const{dailyNotesState:{app:t,verifyState:n},locationState:{query:r}}=A.useContext(Nt),o=Q.useRef(null),[i,s]=Q.useState(!1),c=Q.useRef(null),[d,h]=Q.useState(""),g=Iv(o.current,c.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,10]}}]});A.useEffect(()=>{i&&g.update&&(g==null||g.update())},[i]),A.useEffect(()=>{o&&N.setIcon(o.current,"filter")},[o]);const m=async()=>{var C;const E=!N.Platform.isDesktop&&await((C=window.Capacitor)==null?void 0:C.Plugins.Device.getId()),k=N.Platform.isDesktop?await Un():E.identifier||E.uuid;return!n&&(n==null?void 0:n.appId)!==k?(yr(),!1):!0};return Eh(c,()=>{s(!1),d&&it.getState().query.filter===d&&it.setMemoFilter("")}),D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"thino-inline-filter-wrapper",ref:o,onClick:async()=>{await m()&&(N.Platform.isDesktop?(s(!i),await(g==null?void 0:g.update())):new CF(ut.getState().app,r.filter,k=>{h(k)}).open())}}),D.jsx("div",{ref:c,className:`thino-inline-filter-container ${i?"":"hidden"}`,style:g.styles.popper,children:i&&D.jsx(ww,{type:"inline",queryId:(b=r.filter)!=null&&b.startsWith("Filter [Temp] ")&&!((T=r.filter)!=null&&T.includes("Filter [Temp]"))?"":r.filter,destroy:()=>{s(!1)},setPreview:E=>{h(E)}})})]})};class CF extends N.Modal{constructor(n,r,o){super(n);ye(this,"root");ye(this,"setPreview");this.filter=r,this.setPreview=o}onOpen(){var r,o;const{contentEl:n}=this;this.root=Mv(n),this.root.render(D.jsx(If,{store:xe,context:Nt,children:D.jsx("div",{className:"thino-inline-filter-container",children:D.jsx(ww,{type:"modal",queryId:(r=this.filter)!=null&&r.startsWith("Filter [Temp] ")&&!((o=this.filter)!=null&&o.includes("Filter [Temp]"))?"":this.filter,destroy:()=>{this.close()},setPreview:i=>{this.setPreview(i)}})})}))}onClose(){var n;(n=this.root)==null||n.unmount()}}const PD=({syncThino:e})=>{const{locationState:{query:{filter:t}},dailyNotesState:{app:n},globalState:{isMobileView:r,showSiderbarInMobileView:o},queryState:{queries:i}}=A.useContext(Nt),[s]=A.useState(Q.createRef()),[c,d]=A.useState("THINO");A.useEffect(()=>{const m=ln.getQueryById(t);d(m?m.title:"THINO")},[t,i]),A.useEffect(()=>{const m=s.current;N.setIcon(m,"refresh-cw")},[s]);const h=A.useCallback(()=>{if(!(r&&o)){if(e){const m=H1(n);e(m)}Me.fetchAllMemos()}},[]),g=A.useCallback(m=>{m.stopPropagation(),rt.setShowSiderbarInMobileView(!0)},[]);return D.jsxs("div",{className:"section-header-container memos-header-container",children:[D.jsxs("div",{className:"title-text",onClick:()=>{h(),s&&s.current.firstElementChild.toggleClass("rotate-hidden",!0),setTimeout(()=>{s&&s.current.firstElementChild.toggleClass("rotate-hidden",!1)},1e3)},children:[D.jsx(Fa,{when:r,children:D.jsx("button",{ref:m=>{m&&N.setIcon(m,"menu")},className:"btn action-btn clickable-icon",onClick:g})}),D.jsx("span",{className:"normal-text",children:c}),D.jsx("span",{className:"refresh-icon",ref:s})]}),D.jsxs("div",{className:"memos-header-search-section",children:[D.jsx(EF,{}),D.jsx(SF,{className:r?"hidden":""}),D.jsx(TF,{}),D.jsx(DF,{})]})]})},xF='<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" width="1146.31828" height="801.00361" viewBox="0 0 1146.31828 801.00361" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M1050.69918,514.5082a456.24913,456.24913,0,0,1-37.38013-261.87c3.6001-23.1,9.44006-46.85,24.43018-64.79,14.38989-17.23,39.34985-27.37,60.0299-19.29-13.56994-29.61-47.76-46.5-80.59-47.33-34.09-.86-66.92,12.5-97.25,28.1-30.33,15.6-59.65,33.81006-92.21,43.99-53.5,16.72-111.91,10.34-165.5-6.09-53.58-16.44-103.62-42.47-154.62-65.71-51.01-23.24-104.17-44.03-160.01-48.91-55.84-4.87-115.25,7.89-157.24,45.01s-61.87,101.28-38.27,152.11c14.25,30.7,42.22,54.32,52.04,86.7,12.32,40.65-7.08,83.96-30.41,119.45-23.34,35.49-51.8,69.58-60.47,111.16-8.01,38.38,2.72,78.02,24.05,111.38a197.34468,197.34468,0,0,0,35.74,41.61c43.09,37.91,98.77,58.15,154.17,73.13,200.27,54.17,416.13,49.29,613.75-13.88,34.99-11.18,69.95-24.43,99.32-46.48,19.16-14.38,35.83-33.02,46.39-54.35a114.10574,114.10574,0,0,0,11.13-36.18005C1104.43917,610.17819,1072.9692,562.05819,1050.69918,514.5082Z" transform="translate(-26.84086 -49.49819)" fill="#6c63ff"/><g opacity="0.17"><path d="M890.75032,246.45145c9.64171-4.20394-9.91163-6.65119-32.09585-7.45582s-49.02061-.76011-63.19756-3.04875c-13.71114-2.21343-12.7009-6.14907-13.85427-9.71489s-6.42446-7.222-27.81928-8.0147c-26.6607-.98774-70.62581,2.81434-90.75171.53173-18.78121-2.13011-7.61723-8.81182-35.00344-9.06755-15.63837-.146-35.7849,2.05682-53.18577,2.58844-16.33647.49909-28.42216-.53441-36.90357-1.924s-14.38875-3.15126-23.93413-4.37864c-25.06068-3.2224-74.09133-2.13925-117.853,1.99071s-81.27344,10.89816-102.42889,17.60175-27.00029,13.30376-22.07239,18.90071c3.14674,3.574,11.19915,6.91585,30.73235,8.352,36.53555,2.68621,101.58387-1.9375,139.33713.50645,21.0415,1.36213,30.3764,4.73924,48.83812,6.58716,19.83407,1.98528,48.86935,2.09051,77.39656,2.04341,59.39721-.09807,120.3137-.70829,182.42994-1.82747,25.94486-.46745,53.13-1.0752,80.73761-3.30289s55.76623-6.52591,61.59076-10.5553" transform="translate(-26.84086 -49.49819)" fill="#fff"/></g><path d="M1099.25911,172.04818c-.46-1.18-.96-2.35-1.48-3.49.84.33,1.68006.69,2.51,1.08Z" transform="translate(-26.84086 -49.49819)" fill="#6c63ff"/><path d="M648.74482,314.5843c-7.66935-12.68445-16.75721-26.22767-30.98955-30.36953-16.482-4.7965-33.41319,4.73193-47.77473,14.13453a1392.15692,1392.15692,0,0,0-123.89338,91.28311l.04331.49239q46.22556-3.18781,92.451-6.37555c22.26532-1.53546,45.29557-3.2827,64.97195-13.8156,7.46652-3.99683,14.74475-9.33579,23.20555-9.70782,10.51175-.46217,19.67733,6.87923,26.8802,14.54931,42.60732,45.371,54.937,114.7541,102.73817,154.61592A1516.99458,1516.99458,0,0,0,648.74482,314.5843Z" transform="translate(-26.84086 -49.49819)" fill="#f2f2f2"/><path d="M910.64576,699.4127c-4.71168-5.94958-6.63691-7.343-11.28457-13.34761Q842.5968,612.64872,792.65327,534.27272q-33.92353-53.23005-64.48275-108.50439-14.54863-26.27808-28.29961-52.96872-10.67043-20.6952-20.8646-41.63793c-1.94357-3.98781-3.83209-7.99393-5.71122-12.00922-4.42788-9.44232-8.7734-18.93047-13.43942-28.24449-5.31687-10.61571-11.78905-21.74485-21.55259-28.877a29.4049,29.4049,0,0,0-15.31855-5.89457c-7.948-.51337-15.28185,2.76854-22.17569,6.35294-50.43858,26.301-97.65921,59.27589-140.36959,96.79771A730.77781,730.77781,0,0,0,346.39748,485.87843c-1.008,1.43927-3.39163.06418-2.37419-1.38422q6.00935-8.49818,12.25681-16.81288A734.81742,734.81742,0,0,1,543.87972,292.6956q18.24825-11.82579,37.18269-22.54245c6.36206-3.60275,12.75188-7.15967,19.25136-10.49653,6.37147-3.27274,13.13684-6.21547,20.41563-6.32547,24.77011-.385,37.5954,27.667,46.40506,46.54248q4.15283,8.9106,8.40636,17.76626,16.07481,33.62106,33.38729,66.628,10.68453,20.379,21.83683,40.51955,34.7071,62.71816,73.77854,122.897c34.5059,53.1429,68.73651,100.08874,108.04586,149.78473C913.67124,698.84433,911.73706,700.80615,910.64576,699.4127Z" transform="translate(-26.84086 -49.49819)" fill="#e4e4e4"/><path d="M457.9912,345.4352c-1.43911-1.60428-2.86926-3.20856-4.31777-4.81284-11.42244-12.63259-23.6788-25.11847-39.3644-32.36067a57.11021,57.11021,0,0,0-23.92678-5.54622c-8.56213.02753-16.93178,2.27348-24.84307,5.41792-3.74034,1.49428-7.39831,3.19021-11.00078,4.99614-4.11634,2.07182-8.15927,4.28118-12.1834,6.50883q-11.33112,6.27044-22.36816,13.0909-21.9606,13.5722-42.54565,29.21623-10.67111,8.11311-20.90175,16.75788-9.51557,8.03052-18.64618,16.492c-1.30168,1.20091-3.24526-.74255-1.94358-1.94347,1.60428-1.49428,3.22692-2.97938,4.84955-4.44612q6.87549-6.21547,13.9712-12.19258,12.93921-10.91827,26.54851-20.99312,21.16295-15.67614,43.78289-29.2254,11.3036-6.76547,22.91829-12.9626c2.33793-1.24674,4.70317-2.466,7.09571-3.6211a113.11435,113.11435,0,0,1,16.86778-6.86631,60.00626,60.00626,0,0,1,25.476-2.50266,66.32725,66.32725,0,0,1,23.50512,8.1314c15.40091,8.60812,27.34573,21.919,38.97005,34.90916C461.10844,344.80265,459.17382,346.75529,457.9912,345.4352Z" transform="translate(-26.84086 -49.49819)" fill="#e4e4e4"/><path d="M773.55166,476.34216l36.90462-13.498,18.32327-6.70182c5.96758-2.18267,11.92082-4.66747,18.08989-6.23037a28.53868,28.53868,0,0,1,16.37355.20862,37.73731,37.73731,0,0,1,12.771,7.91667,103.63871,103.63871,0,0,1,10.47488,11.18642c3.98932,4.79426,7.9197,9.63878,11.86772,14.46706q24.44135,29.89093,48.56306,60.04134,24.12118,30.14991,47.91981,60.556,23.85681,30.48042,47.38548,61.21573,2.8823,3.76519,5.75967,7.53415c1.0598,1.38809,3.44948.01962,2.37471-1.38807q-23.70225-31.04441-47.73491-61.83464-24.09177-30.86383-48.51646-61.46586-24.42423-30.60142-49.17854-60.93744-6.167-7.5576-12.35444-15.09858c-3.47954-4.24072-6.91984-8.52718-10.73629-12.47426-7.00538-7.24516-15.75772-13.64794-26.23437-13.82167-6.15972-.10214-12.121,1.85248-17.844,3.92288-6.16967,2.232-12.32455,4.50571-18.48632,6.7594L782.11123,470.2921l-9.29068,3.39811c-1.64874.603-.9365,3.26189.73111,2.65195Z" transform="translate(-26.84086 -49.49819)" fill="#e4e4e4"/><path d="M409.45248,324.15733c-18.75411-9.63866-42.77137-7.75087-60.00507,4.29119A855.84532,855.84532,0,0,1,446.818,351.17434C433.53537,343.3904,423.14521,331.19475,409.45248,324.15733Z" transform="translate(-26.84086 -49.49819)" fill="#f2f2f2"/><path d="M349.26282,328.41534,345.6524,331.35c1.22123-1.02713,2.4908-1.99013,3.795-2.90144C349.3858,328.43789,349.32442,328.426,349.26282,328.41534Z" transform="translate(-26.84086 -49.49819)" fill="#f2f2f2"/><path d="M874.62436,476.477c-3.63279-4.42206-7.56046-9.05222-12.99421-10.84836l-5.07308.20009a575.43629,575.43629,0,0,0,153.26729,175.22056Q942.22437,558.76317,874.62436,476.477Z" transform="translate(-26.84086 -49.49819)" fill="#f2f2f2"/><path d="M1086.66915,698.4482c-10.56006,21.33-27.23,39.97-46.39,54.35-29.37,22.05-64.33,35.3-99.32,46.48-197.62,63.17-413.48,68.05-613.75,13.88-55.4-14.98-111.08-35.22-154.17-73.13a197.34468,197.34468,0,0,1-35.74-41.61c57.35-31.52,126.86-43.4,193.19-41.95,95.09,2.08,187.96,27.46,282.16,40.59a1102.669,1102.669,0,0,0,334.04-4.6c38.31994-6.43,77.98-14.84,115.49-4.66A95.14954,95.14954,0,0,1,1086.66915,698.4482Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><circle cx="179.31828" cy="51" r="51" fill="#ccc"/><path d="M362.30892,97.84042C348.81185,83.6816,333.13643,70.765,314.57961,63.93948a76.71521,76.71521,0,0,0-15.98633-4.01734c-.04388-.006-.08545.00287-.12909-.00067a2.35576,2.35576,0,0,0-.26965-.05292,61.5388,61.5388,0,0,0-22.84131,1.379,63.10735,63.10735,0,0,0-10.63519,3.7049,93.00467,93.00467,0,0,0-9.97943,5.65557A64.90832,64.90832,0,0,1,232.6863,78.8348a74.1877,74.1877,0,0,1-11.84406,1.16248c-3.44714.06915-6.698.1889-9.964,1.43426a23.91573,23.91573,0,0,0-14.56494,15.77051,1.55078,1.55078,0,0,0,.68933,1.694c.88349.63275,1.74476,1.35065,2.673,1.91437a8.33922,8.33922,0,0,0,2.611.71209q2.21366.46711,4.43292.90693,8.17584,1.61992,16.41962,2.86792,16.681,2.5252,33.54217,3.55755a373.48132,373.48132,0,0,0,67.51026-2.029A374.77144,374.77144,0,0,0,361.647,100.3475,1.5139,1.5139,0,0,0,362.30892,97.84042Z" transform="translate(-26.84086 -49.49819)" fill="#f0f0f0"/><path d="M208.57961,131.93948a76.71521,76.71521,0,0,0-15.98633-4.01734c-.04388-.006-.08545.00287-.12909-.00067a2.35576,2.35576,0,0,0-.26965-.05292,61.5388,61.5388,0,0,0-22.84131,1.379,63.10735,63.10735,0,0,0-10.63519,3.7049,93.00467,93.00467,0,0,0-9.97943,5.65557,64.90832,64.90832,0,0,1-22.05231,8.22681,74.1877,74.1877,0,0,1-11.84406,1.16248c-3.44714.06915-6.698.1889-9.964,1.43426a23.91573,23.91573,0,0,0-14.56494,15.77051,1.55078,1.55078,0,0,0,.68933,1.694c.88349.63275,1.74476,1.35065,2.673,1.91437a8.33922,8.33922,0,0,0,2.611.71209q2.21366.46712,4.43292.90693,8.17584,1.61992,16.41962,2.86792,16.681,2.5252,33.54217,3.55755a373.48132,373.48132,0,0,0,67.51026-2.029A374.77144,374.77144,0,0,0,255.647,168.3475a1.5139,1.5139,0,0,0,.66193-2.50708C242.81185,151.6816,227.13643,138.765,208.57961,131.93948Z" transform="translate(-26.84086 -49.49819)" fill="#f0f0f0"/><polygon points="1047.411 588.142 1074.576 567.518 1087.816 580.759 1043.563 611.042 1047.411 588.142" fill="#2f2e41"/><path d="M1048.91635,694.42781H955.99269l3.25907-10.55987,0,0c20.1993-7.31227,8.85333-23.02957,28.06751-32.63666,46.9968-23.4984,65.19118-93.62006,58.30932-121.33935l30.798-1.30221S1118.95877,649.37476,1048.91635,694.42781Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M1128.24653,644.78888a15.61893,15.61893,0,0,1-20.18272.37759l-.0604-.04961-.00207-.07767a14.96483,14.96483,0,0,0-.6-3.81936,10.69077,10.69077,0,0,1-.38818,2.64366l-.07784.28991-.20873-.21549c-.18027-.18589-.35474-.37472-.51859-.561a15.75088,15.75088,0,0,1-2.399-3.63269,45.91623,45.91623,0,0,0-12.74-15.87972,22.29237,22.29237,0,0,1-2.6727-2.57172,22.03415,22.03415,0,0,1,27.66955-33.56911l.13767.0806-.07148.1425a11.47756,11.47756,0,0,1-2.04788,2.954,14.96829,14.96829,0,0,0,3.15395-2.27865l.10006-.09436.11337.07818a22.12793,22.12793,0,0,1,4.0294,3.5867l.12844.14726a9.83643,9.83643,0,0,0,7.28375,3.36123,15.614,15.614,0,0,1,15.11947,18.29291l-.01769.10315-.10034.0304a13.39866,13.39866,0,0,1-5.45694.68088,15.22208,15.22208,0,0,0,4.86061,1.2174l.21654.01718-.06874.20619a15.6035,15.6035,0,0,1-4.50339,6.79l-.05928.05187-.06294.05509a15.3329,15.3329,0,0,0-5.297,10.64272A15.73345,15.73345,0,0,1,1128.24653,644.78888Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M1131.089,639.76934a15.57418,15.57418,0,0,1-.1756,1.67894,15.78521,15.78521,0,0,0,2.53772-7.82047c.02071-.42637.06546-.8511.12549-1.27393A14.8141,14.8141,0,0,0,1131.089,639.76934Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M1136.00331,620.789a15.19815,15.19815,0,0,0,3.88418,1.09822,15.63,15.63,0,0,0,1.42322-1.73647A13.24363,13.24363,0,0,1,1136.00331,620.789Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M1141.72736,615.66082a15.70907,15.70907,0,0,1-.11112,4.05194,15.52908,15.52908,0,0,0,1.75758-3.62455l.06874-.2062-.21655-.01718A15.09472,15.09472,0,0,1,1141.72736,615.66082Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M1140.28241,600.83967a15.65079,15.65079,0,0,0-11.46149-5.29958,9.83649,9.83649,0,0,1-7.28378-3.36124l-.12843-.14726a22.12785,22.12785,0,0,0-4.02939-3.58669l-.11338-.07817-.10005.09434a14.9676,14.9676,0,0,1-3.154,2.27865,11.47832,11.47832,0,0,0,2.04794-2.954l.07146-.1425-.13766-.08059a22.01777,22.01777,0,0,0-32.62113,14.2542,22.02182,22.02182,0,0,1,30.259-8.11268l.13765.08059-.07145.1425a11.47814,11.47814,0,0,1-2.04794,2.954,14.96754,14.96754,0,0,0,3.154-2.27865l.10006-.09434.11338.07817a22.12857,22.12857,0,0,1,4.02939,3.5867l.12843.14725a9.83643,9.83643,0,0,0,7.28377,3.36124,15.61675,15.61675,0,0,1,15.10347,12.83488,18.92714,18.92714,0,0,0,2.26005-.55l.10034-.03039.01776-.10314A15.554,15.554,0,0,0,1140.28241,600.83967Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M1173.15913,536.54065a50.29141,50.29141,0,0,1-42.007,49.59965l-.2484.04053-.19219-.16016a48.18565,48.18565,0,0,0-10.51008-6.67159,34.42316,34.42316,0,0,1,5.5662,6.56047l.53537.80469-.96485.04641c-.8328.04053-1.66038.0608-2.45919.0608a50.71554,50.71554,0,0,1-13.88445-1.92513c-20.51748-5.83748-42.55022-6.83567-65.48571-2.96711a71.77856,71.77856,0,0,1-11.90147.993A70.94787,70.94787,0,0,1,1009.287,444.63723l.48765-.16146.19251.47589a36.95659,36.95659,0,0,1,2.787,11.23306,48.19635,48.19635,0,0,0,1.19789-12.47116l-.01536-.44255.43013-.10786a71.24939,71.24939,0,0,1,17.24051-2.1147l.62918.00262a31.67228,31.67228,0,0,0,23.616-10.46237,50.27568,50.27568,0,0,1,76.38016,2.34611l.2118.26213-.1399.30723c-2.93769,6.47484-6.13818,11.19189-9.95836,14.64143a49.01343,49.01343,0,0,0,13.27978-9.16282l.502-.487.35234.60466A50.24214,50.24214,0,0,1,1143.32,464.4278l-.00065.25363c-.00065.08956-.00065.17977-.00065.26932,0,13.61317,5.26419,26.51577,14.46689,35.43934A50.66021,50.66021,0,0,1,1173.15913,536.54065Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><g opacity="0.15"><path d="M1111.68868,417.71713a35.519,35.519,0,0,1-6.33509,7.77159,48.88929,48.88929,0,0,0,9.89823-6.1865Q1113.50228,418.44038,1111.68868,417.71713Z" transform="translate(-26.84086 -49.49819)"/><path d="M1140.79293,477.73323a50.48191,50.48191,0,0,1,7.22981,8.80775,51.39288,51.39288,0,0,1-4.70405-21.59022c0-.08957,0-.17978.00065-.26932l.00064-.25364a50.24245,50.24245,0,0,0-6.83956-25.32735l-.35235-.60468-.50207.487a49.12616,49.12616,0,0,1-9.17043,6.983A48.97185,48.97185,0,0,0,1140.79293,477.73323Z" transform="translate(-26.84086 -49.49819)"/><path d="M1126.32733,441.77093l-.00065.25364c-.00064.08954-.00064.17975-.00064.26931,0,.49355.00894.98585.02272,1.47739a52.3648,52.3648,0,0,0,5.95587-10.26709l.13985-.30725-.21176-.26212a50.68811,50.68811,0,0,0-9.096-8.79733A50.35621,50.35621,0,0,1,1126.32733,441.77093Z" transform="translate(-26.84086 -49.49819)"/><path d="M1157.78559,500.3901a45.45934,45.45934,0,0,1-6.40838-7.79666,50.2297,50.2297,0,0,1-37.21772,70.89l-.24841.04054-.19217-.16016a48.188,48.188,0,0,0-10.5101-6.67159,34.42262,34.42262,0,0,1,5.56617,6.56046l.5354.80471-.96482.0464c-.83286.04054-1.66041.0608-2.4592.0608a50.71549,50.71549,0,0,1-13.88448-1.92514c-20.51749-5.83747-42.55022-6.83566-65.4857-2.9671a71.7793,71.7793,0,0,1-11.90145.993,70.62389,70.62389,0,0,1-47.12-17.969,71.01118,71.01118,0,0,0,64.1127,40.6259,71.77947,71.77947,0,0,0,11.90145-.99294c22.93547-3.86857,44.96821-2.87037,65.4857,2.96709a50.71543,50.71543,0,0,0,13.88448,1.92514c.79878,0,1.62634-.02026,2.45919-.0608l.96483-.0464-.5354-.80471a34.42263,34.42263,0,0,0-5.56618-6.56045,48.18774,48.18774,0,0,1,10.51011,6.67159l.19217.16016.24841-.04055a50.25392,50.25392,0,0,0,26.63344-85.75019Z" transform="translate(-26.84086 -49.49819)"/></g><polygon points="134.035 560.973 97.223 533.025 79.28 550.968 139.25 592.007 134.035 560.973" fill="#2f2e41"/><path d="M195.21,687.42781h125.9266L316.72,673.11747l0,0c-27.37332-9.9093-11.99769-31.20879-38.036-44.228-63.68827-31.84414-88.3446-126.87035-79.01856-164.43447l-41.73625-1.76471S100.29113,626.37364,195.21,687.42781Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M80.55365,605.25219a20.7786,20.7786,0,0,0-7.17833-14.42261c-.0283-.02489-.05681-.05-.08529-.07465l-.08034-.0703a21.14539,21.14539,0,0,1-6.10283-9.20148l-.09315-.27942.29345-.02329a20.6283,20.6283,0,0,0,6.58691-1.64977,18.15726,18.15726,0,0,1-7.395-.9227l-.136-.0412-.024-.13979a21.15953,21.15953,0,0,1,20.48932-24.78985,13.32987,13.32987,0,0,0,9.87066-4.555l.17406-.19956a29.9868,29.9868,0,0,1,5.46049-4.86055l.15364-.106.13559.12786a20.2845,20.2845,0,0,0,4.27411,3.088,15.554,15.554,0,0,1-2.77519-4.00312l-.09688-.19312.18657-.10923A29.85984,29.85984,0,0,1,141.70818,588.318a30.209,30.209,0,0,1-3.62195,3.48511,62.224,62.224,0,0,0-17.26483,21.51959,21.34447,21.34447,0,0,1-3.251,4.92289c-.222.25244-.45848.50834-.70277.76026l-.28286.292-.10549-.39287a14.48742,14.48742,0,0,1-.526-3.58259,20.27961,20.27961,0,0,0-.813,5.17585l-.00281.10525-.08185.06724a21.15037,21.15037,0,0,1-34.50192-15.41853Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M83.85266,613.35673a21.10374,21.10374,0,0,0,.238,2.27524,21.39156,21.39156,0,0,1-3.439-10.598c-.02806-.57781-.08871-1.15339-.17006-1.72639A20.07562,20.07562,0,0,1,83.85266,613.35673Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M77.193,587.63524a20.59681,20.59681,0,0,1-5.2637,1.48826,21.18029,21.18029,0,0,1-1.92868-2.3532A17.94731,17.94731,0,0,0,77.193,587.63524Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M69.436,580.68579a21.28893,21.28893,0,0,0,.1506,5.491,21.04389,21.04389,0,0,1-2.3818-4.91186l-.09316-.27943.29346-.02329A20.4517,20.4517,0,0,0,69.436,580.68579Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M71.39415,560.60073a21.20931,21.20931,0,0,1,15.53218-7.18179,13.33,13.33,0,0,0,9.87069-4.555l.174-.19955a29.98717,29.98717,0,0,1,5.46048-4.86056l.15364-.10593.13559.12785a20.28377,20.28377,0,0,0,4.27415,3.08794,15.55474,15.55474,0,0,1-2.77529-4.00312l-.09683-.19312.18655-.10921A29.83764,29.83764,0,0,1,148.51627,561.925a29.84315,29.84315,0,0,0-41.00585-10.994l-.18655.10921.09683.19311a15.5548,15.5548,0,0,0,2.77529,4.00313,20.28412,20.28412,0,0,1-4.27415-3.08794l-.13559-.12786-.15364.10594a29.98711,29.98711,0,0,0-5.46048,4.86055l-.174.19956a13.33,13.33,0,0,1-9.87069,4.555A21.16316,21.16316,0,0,0,69.65975,579.135a25.64845,25.64845,0,0,1-3.06273-.74529l-.136-.04118-.02407-.13978A21.07824,21.07824,0,0,1,71.39415,560.60073Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M47.67454,424.47529c12.47114-12.09289,19.605-29.578,19.605-48.026,0-.12136,0-.24361-.00089-.365l-.00088-.34372a68.08611,68.08611,0,0,1,9.26876-34.32266l.47748-.81942.68034.66a66.42122,66.42122,0,0,0,17.99625,12.41711c-5.177-4.67469-9.51414-11.06706-13.4952-19.8415l-.18957-.41636.287-.35523a68.13168,68.13168,0,0,1,103.50749-3.17935,42.9211,42.9211,0,0,0,32.00348,14.1782l.85264-.00355a96.55467,96.55467,0,0,1,23.36369,2.86576l.58289.14617-.02081.59973a65.31307,65.31307,0,0,0,1.62334,16.90044,50.08227,50.08227,0,0,1,3.77686-15.22262l.26089-.64491.66085.21881a96.14585,96.14585,0,0,1-30.24771,187.39848A97.27192,97.27192,0,0,1,202.538,534.974c-31.0813-5.24253-60.93923-3.88982-88.74374,4.02092a68.72787,68.72787,0,0,1-18.81567,2.60886c-1.08252,0-2.204-.02747-3.33261-.08239l-1.30753-.0629L91.064,540.368a46.64968,46.64968,0,0,1,7.5431-8.8905,65.29981,65.29981,0,0,0-14.24286,9.0411l-.26045.217-.33662-.05492A68.10219,68.10219,0,0,1,47.67454,424.47529Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><g opacity="0.15"><path d="M110.14328,312.44a48.13438,48.13438,0,0,0,8.58508,10.53176,66.25283,66.25283,0,0,1-13.4137-8.38371Q107.68556,313.42016,110.14328,312.44Z" transform="translate(-26.84086 -49.49819)"/><path d="M70.70231,393.77157a68.411,68.411,0,0,0-9.79756,11.93592,69.64577,69.64577,0,0,0,6.37475-29.25825c0-.12137,0-.24362-.00088-.365l-.00087-.34372a68.08661,68.08661,0,0,1,9.26871-34.32266l.4775-.81944.68039.66a66.5738,66.5738,0,0,0,12.42741,9.46305C88.97194,367.31049,82.046,382.77189,70.70231,393.77157Z" transform="translate(-26.84086 -49.49819)"/><path d="M90.30555,345.03683l.00087.34372c.00088.12134.00088.24359.00088.365,0,.66884-.01212,1.336-.0308,2.0021A70.9624,70.9624,0,0,1,82.20534,333.834l-.18953-.41637.287-.35522a68.69044,68.69044,0,0,1,12.32659-11.92181A68.24086,68.24086,0,0,0,90.30555,345.03683Z" transform="translate(-26.84086 -49.49819)"/><path d="M47.67451,424.4753a61.60525,61.60525,0,0,0,8.6844-10.56575,68.06938,68.06938,0,0,0,50.436,96.06741l.33664.05494.26042-.217a65.30253,65.30253,0,0,1,14.24289-9.04108,46.64767,46.64767,0,0,0-7.54306,8.89047l-.72556,1.09052,1.3075.06287c1.12865.05494,2.25012.08239,3.33261.08239a68.72762,68.72762,0,0,0,18.81572-2.60886c27.80451-7.91072,57.66244-9.26344,88.74372-4.0209a97.27262,97.27262,0,0,0,16.12839,1.3456,95.7069,95.7069,0,0,0,63.8553-24.35094,96.23165,96.23165,0,0,1-86.88309,55.05467A97.27245,97.27245,0,0,1,202.538,534.974c-31.08129-5.24254-60.93922-3.88982-88.74373,4.0209a68.72763,68.72763,0,0,1-18.81572,2.60887c-1.08249,0-2.204-.02746-3.33261-.0824l-1.30749-.06287L91.064,540.368a46.64834,46.64834,0,0,1,7.54306-8.89047,65.30253,65.30253,0,0,0-14.24289,9.04108l-.26042.217-.33663-.05494A68.10219,68.10219,0,0,1,47.67451,424.4753Z" transform="translate(-26.84086 -49.49819)"/></g><circle cx="460.31828" cy="185" r="5" fill="#fff"/><circle cx="834.31828" cy="305" r="3" fill="#fff"/><circle cx="892.31828" cy="170" r="3" fill="#fff"/><circle cx="355.31828" cy="80" r="3" fill="#fff"/><circle cx="325.31828" cy="201" r="3" fill="#fff"/><circle cx="179.31828" cy="170" r="3" fill="#fff"/><circle cx="696.31828" cy="195" r="3" fill="#fff"/><circle cx="1003.31828" cy="98" r="3" fill="#fff"/><path d="M328.95929,413.56327c-3.79958-7.035-4.33-16.25537.33531-22.74859a36.83843,36.83843,0,0,0,14.67507,20.5993c2.77181,1.88719,6.05124,3.69758,6.99947,6.914a8.23488,8.23488,0,0,1-.85864,6.04445,24.4571,24.4571,0,0,1-3.79505,4.95494l-.13433.50325C339.30268,425.75443,332.75886,420.59829,328.95929,413.56327Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M910.95929,612.56327c-3.79958-7.035-4.33-16.25537.33531-22.74859a36.83843,36.83843,0,0,0,14.67507,20.5993c2.77181,1.88719,6.05124,3.69758,6.99947,6.914a8.23488,8.23488,0,0,1-.85864,6.04445,24.4571,24.4571,0,0,1-3.795,4.95494l-.13433.50325C921.30268,624.75443,914.75886,619.59829,910.95929,612.56327Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M591.95929,449.56327c-3.79958-7.035-4.33-16.25537.33531-22.74859a36.83843,36.83843,0,0,0,14.67507,20.5993c2.77181,1.88719,6.05124,3.69758,6.99947,6.914a8.23488,8.23488,0,0,1-.85864,6.04445,24.4571,24.4571,0,0,1-3.795,4.95494l-.13433.50325C602.30268,461.75443,595.75886,456.59829,591.95929,449.56327Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M287.95929,565.56327c-3.79958-7.035-4.33-16.25537.33531-22.74859a36.83843,36.83843,0,0,0,14.67507,20.5993c2.77181,1.88719,6.05124,3.69758,6.99947,6.914a8.23488,8.23488,0,0,1-.85864,6.04445,24.4571,24.4571,0,0,1-3.79505,4.95494l-.13433.50325C298.30268,577.75443,291.75886,572.59829,287.95929,565.56327Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M249.95929,651.56327c-3.79958-7.035-4.33-16.25537.33531-22.74859a36.83843,36.83843,0,0,0,14.67507,20.5993c2.77181,1.88719,6.05124,3.69758,6.99947,6.914a8.23488,8.23488,0,0,1-.85864,6.04445,24.4571,24.4571,0,0,1-3.79505,4.95494l-.13433.50325C260.30268,663.75443,253.75886,658.59829,249.95929,651.56327Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><rect x="843.31828" y="68" width="11" height="589" fill="#3f3d56"/><rect x="813.31828" y="20" width="72" height="72" rx="35.99996" fill="#ff6582"/><path d="M418.64263,424.1385c0,11.47771,12.51572,21.67823,23.99344,21.67823s17.571-10.20052,17.571-21.67823a20.78224,20.78224,0,0,0-41.56448,0Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><polygon points="398.471 484.489 437.067 483.005 439.294 442.925 394.76 442.925 398.471 484.489" fill="#ffb8b8"/><path d="M400.81364,561.4928a6.18231,6.18231,0,0,0-.36494-9.4728l7.00739-20.82235-11.03775,2.917-4.96213,19.32605a6.21581,6.21581,0,0,0,9.35743,8.05215Z" transform="translate(-26.84086 -49.49819)" fill="#ffb6b6"/><circle cx="415.75835" cy="381.62478" r="14.69804" fill="#ffb8b8"/><path d="M442.96047,429.64379l-10.73253-.28426a1.504,1.504,0,0,1-1.28014-.78738l-3.58787-6.65514a1.49783,1.49783,0,0,1,.39563-1.89138L441.79818,409.047a1.49679,1.49679,0,0,1,1.25618-.28037l11.34184,2.58422a1.499,1.499,0,0,1,1.1066,1.04314l4.4413,15.29492a1.49935,1.49935,0,0,1-1.51389,1.916l-5.5602-.27779a1.50724,1.50724,0,0,1-1.34747-1.0276l-.23052-.69867a.17342.17342,0,0,0-.338.05439,1.49974,1.49974,0,0,1-1.57346,1.4977l-1.84088-.09194a1.4954,1.4954,0,0,1-1.396-1.205l-.79385-3.99256a.1732.1732,0,0,0-.34188.01359l-.51866,4.442a1.492,1.492,0,0,1-1.48734,1.32546Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M432.2515,449.58079l19.00323.25331,6.18481,7.85346,9.95684,2.3481,2.5878,14.95427c1.29375,7.47624-.07979,12.21089-3.88076,18.77751l0,0-.45522,12.91771.503.91426a2.09364,2.09364,0,0,1-.63119,2.72267h0a4.27726,4.27726,0,0,1,.11752,2.81491l-.24528.81046s-.70783,5.66261-40.83239-.29293a3.95632,3.95632,0,0,1-3.34345-3.3986h0a2.95406,2.95406,0,0,1-.547-3.4038l.08175-.16348-.412-.48529a3.177,3.177,0,0,1-.1608-3.90659h0l-5.76652-41.25217,11.91192-3.71Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M419.16862,464.99288l-4.75684-3.94828s-4.22952,1.25013-7.18334,9.58077-13.08957,71.52656-13.08957,71.52656l11.87557-5.93778,16.8392-46.43085Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M524.81946,532.274a6.18228,6.18228,0,0,1-7.09116-6.29147l-20.54147-7.79242,9.257-6.682,18.08733,8.42424a6.21581,6.21581,0,0,1,.28831,12.34162Z" transform="translate(-26.84086 -49.49819)" fill="#ffb6b6"/><path d="M461.88061,464.63253l3.22471-5.27425s4.40655-.18456,9.89528,6.74353c2.81373,3.55161,21.04874,34.01719,21.04874,34.01719l16.86311,14.05546-13.80628,4.93081-16.27169-6.90314-18.244-30.078Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><polygon points="435.555 666.81 444.739 666.81 449.108 631.385 435.553 631.386 435.555 666.81" fill="#ffb6b6"/><polygon points="355.157 661.099 364.044 663.415 377.208 630.238 364.091 626.819 355.157 661.099" fill="#ffb6b6"/><path d="M460.11787,711.77763l14.51826-.86655v6.22026l13.80293,9.53279a3.88541,3.88541,0,0,1-2.20782,7.08274H468.9467l-2.97925-6.15279-1.16325,6.15279h-6.517Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M380.13111,705.42858l14.2674,2.8235-1.569,6.01913,10.95211,12.70615a3.88541,3.88541,0,0,1-3.923,6.29683L383.133,728.91441l-1.331-6.70531-2.67759,5.66043-6.30624-1.64381Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M383.1248,688.31931l26.92081-55.33021,2.11353-65.49091C406.33233,556.677,423.491,532.805,423.491,532.805v-9.24491l41.91852,7.90812v0a201.21489,201.21489,0,0,1,12.26151,73.06026L475.982,694.04734h.52987a3.31527,3.31527,0,1,1,0,6.63053H459.9355a3.31527,3.31527,0,1,1,0-6.63053h.4274L448.4631,580.16351l-13.83654,56.19881L401.189,688.1066a3.3069,3.3069,0,0,1-.26524,6.60379H384.34739a3.31182,3.31182,0,0,1-1.22259-6.39108Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M382.75841,426.29647c6.19395-6.05935,10.09279-14.02773,15.22255-21.01108,5.1296-6.98327,12.35472-13.3824,21.01083-13.77026a13.03786,13.03786,0,0,1,8.16579,2.129,8.30541,8.30541,0,0,1,3.60455,7.36741c.9138-2.56674,4.99718-3.1453,6.588-.93331,1.59062,2.21191-.25722,5.89893-2.98115,5.94838l-.2671-1.05666a18.24877,18.24877,0,0,1-11.80141,7.83613,2.9783,2.9783,0,0,1-3.35526-3.85425C409.59087,410.80666,412.56052,428.25234,407,436s-21.45259,6.99551-30.82907,8.7353c-9.05466,1.68-17.85857-3.34756-25.69931-8.178A38.2715,38.2715,0,0,0,382.75841,426.29647Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M732.68989,636.90373,704.47275,624.455V613.75265l10.0561-.05651a7.46918,7.46918,0,0,0,7.044-5.10714l7.06437-21.19305a7.46924,7.46924,0,0,0-7.086-9.83122H704.47275v-9.959H725.913a7.46925,7.46925,0,0,0,7.27937-5.79584l4.865-21.16286a7.46923,7.46923,0,0,0-7.27937-9.14265H704.47275v-2.48975a4.97949,4.97949,0,0,0-9.959,0v2.48975H518.1566v-2.48975a4.9795,4.9795,0,0,0-9.959,0v2.48975H487.2868a7.46923,7.46923,0,0,0-7.27937,9.14265l4.865,21.16286a7.46925,7.46925,0,0,0,7.27937,5.79584H508.1976v9.959H496.51328a7.46923,7.46923,0,0,0-7.10927,9.76l7.21041,22.37711a7.46925,7.46925,0,0,0,7.15123,5.17837l4.432-.0249V624.455l-22.82269,12.44874a7.46922,7.46922,0,0,0-7.46924,7.46922v0a7.46925,7.46925,0,0,0,7.46924,7.46925H508.1976v54.77446a4.9795,4.9795,0,0,0,9.959,0V651.84222H694.51376v54.77446a4.97949,4.97949,0,0,0,9.959,0V651.84222h28.21714a7.46925,7.46925,0,0,0,7.46925-7.46925v0A7.46922,7.46922,0,0,0,732.68989,636.90373Zm-214.53329-69.298H694.51376v9.959H518.1566Zm0,56.84925v-9.65563l176.35716-.99076V624.455Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/></svg>',MF='<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" width="855.93958" height="630.06608" viewBox="0 0 855.93958 630.06608" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M935.43234,472.55767c-3.73,43.08-22.51,84.71-49.3,119.14q-1.68,2.16-3.4,4.28-3.87,4.77-7.94,9.36-4.98,5.655-10.25,11.05005-4.29,4.43994-8.78,8.68994-3.465,3.315-7.01,6.5c-28.43,25.69-61.09,46.89-94.74,65.43005-65.67,36.17-137.65,63.56995-212.52,67.56-74.86,3.98-153.01-17.46-207.91-68.52-73.99-68.81-94.63995-183.58-64.6-280.05,19.98-64.18,60.76-122.24,116.26-160.16,55.02-37.59,124.43-54.51,190.12-43.44995,52.44-31.87006,121.09-32.48,178.1-8.89,30.42,12.59,57.72,31.31,81.67,53.93a339.34337,339.34337,0,0,1,30.72,33.23q1.455,1.785,2.88,3.6,5.97,7.545,11.55,15.4,8.01,11.265,15.21,23.03c1.32,2.16,2.63,4.33,3.91,6.52.86,1.47,1.73,2.95,2.58,4.44a.29776.29776,0,0,1,.04.1c13.31,23.41,24.19,48.39,29.86005,74.5,1,4.62,1.84,9.26,2.49,13.94v.01q.855,5.955,1.29,11.97A176.97711,176.97711,0,0,1,935.43234,472.55767Z" transform="translate(-172.03021 -134.96696)" fill="#3f3d56"/><path d="M740.07386,537.68412,591.61233,414.00627,735.84027,542.638a3.44161,3.44161,0,1,0,4.23359-4.95386Z" transform="translate(-172.03021 -134.96696)" fill="#f0f0f0" opacity="0.3"/><circle cx="227.58212" cy="250.78071" r="89" fill="#f2f2f2"/><path d="M478.61233,379.74767a80.99369,80.99369,0,0,1-81,81,81.57161,81.57161,0,0,1-27.8-4.9,81.05489,81.05489,0,1,1,108.8-76.1Z" transform="translate(-172.03021 -134.96696)" fill="#fff"/><circle cx="211.58212" cy="217.78071" r="25" fill="#e4e4e4"/><path d="M475.45236,357.27764a25.00115,25.00115,0,0,1-27.6-41.08A81.05279,81.05279,0,0,1,475.45236,357.27764Z" transform="translate(-172.03021 -134.96696)" fill="#f2f2f2"/><circle cx="252.58212" cy="271.78071" r="9" fill="#e4e4e4"/><path d="M387.61233,457.74767a9.04581,9.04581,0,0,1-.31,2.34,79.52774,79.52774,0,0,1-17.49-4.24,9.00157,9.00157,0,0,1,17.8,1.9Z" transform="translate(-172.03021 -134.96696)" fill="#f2f2f2"/><path d="M334.61233,375.74767a18.002,18.002,0,0,1-16.8,17.96,81.54773,81.54773,0,0,1,1.76-35.71A18.00026,18.00026,0,0,1,334.61233,375.74767Z" transform="translate(-172.03021 -134.96696)" fill="#f2f2f2"/><circle cx="606.45653" cy="208.48305" r="3.70234" fill="#6c63ff"/><circle cx="572.30231" cy="119.94851" r="2.16307" fill="#f0f0f0"/><circle cx="225.30231" cy="543.94851" r="2.16307" fill="#f0f0f0"/><circle cx="584.58144" cy="331.59402" r="2.16307" fill="#f0f0f0"/><circle cx="305.45653" cy="350.48305" r="3.70234" fill="#6c63ff"/><circle cx="171.45653" cy="416.48305" r="17.48305" fill="#6c63ff"/><circle cx="267.30231" cy="435.94851" r="2.16307" fill="#f0f0f0"/><circle cx="487.30231" cy="97.94851" r="2.16307" fill="#f0f0f0"/><circle cx="358.30231" cy="558.94851" r="2.16307" fill="#f0f0f0"/><circle cx="326.30231" cy="117.94851" r="2.16307" fill="#f0f0f0"/><circle cx="382.30231" cy="222.94851" r="2.16307" fill="#f0f0f0"/><circle cx="296.58144" cy="480.59402" r="2.16307" fill="#f0f0f0"/><circle cx="549.58144" cy="494.59402" r="2.16307" fill="#f0f0f0"/><circle cx="437.58144" cy="368.59402" r="2.16307" fill="#f0f0f0"/><circle cx="494.58144" cy="222.59402" r="2.16307" fill="#f0f0f0"/><circle cx="598.21204" cy="292.65473" r="4.28889" fill="#ff6584"/><circle cx="424.21204" cy="150.65473" r="4.28889" fill="#ff6584"/><circle cx="424.21204" cy="445.65473" r="4.28889" fill="#ff6584"/><path d="M863.45236,605.33764a7.694,7.694,0,0,0-7.39,5.58,7.3896,7.3896,0,0,0-.3,2.12v12.04q4.485-4.24494,8.78-8.68994,5.265-5.40006,10.25-11.05005Z" transform="translate(-172.03021 -134.96696)" fill="#6c63ff"/><path d="M890.68118,667.89806q-19.36816,0-42.45654-1.46386c-79.61377-5.05567-182.7378-22.63282-290.376-49.49219-107.6377-26.85938-206.93018-59.79395-279.58545-92.73438-35.39258-16.04687-62.55615-31.23632-80.73535-45.14746-19.24707-14.72705-27.666-27.564-25.02393-38.15283,5.148-20.62891,50.731-25.14209,88.064-25.29541l.01269,3c-51.26806.21045-81.51367,8.38672-85.16552,23.022-4.65186,18.64014,33.28662,47.74073,104.08691,79.84131,72.49561,32.86817,171.60547,65.73926,279.07324,92.55664,107.46729,26.81641,210.40137,44.36328,289.83985,49.40821,77.57861,4.92773,124.74316-2.9375,129.39453-21.57813,3.86181-15.47656-21.59815-38.27539-71.68946-64.19824l1.37891-2.66406c36.397,18.83593,78.64551,45.85156,73.22168,67.58886-2.64258,10.58887-16.10547,17.96485-40.01514,21.92285C927.0762,666.7672,910.33548,667.89806,890.68118,667.89806Z" transform="translate(-172.03021 -134.96696)" fill="#6c63ff"/><circle cx="714.58212" cy="208.78071" r="100.5" fill="#fff"/><path d="M886.61233,241.74767a102,102,0,1,0,102,102A101.635,101.635,0,0,0,886.61233,241.74767Zm0,201a99,99,0,1,1,99-99A98.61767,98.61767,0,0,1,886.61233,442.74767Z" transform="translate(-172.03021 -134.96696)" fill="#2f2e41"/><path d="M798.417,367.81847a2.00078,2.00078,0,0,1-1.957-1.59765,97.66924,97.66924,0,0,1,22.34082-83.13526,2,2,0,0,1,2.98633,2.66114A93.59682,93.59682,0,0,0,800.378,365.41515a2.00228,2.00228,0,0,1-1.96094,2.40332Z" transform="translate(-172.03021 -134.96696)" fill="#2f2e41"/><circle cx="714.51924" cy="238.27373" r="63.87702" fill="#6c63ff"/><path d="M866.24805,397.35666c-4.14062-.115-9.29385-.25869-13.26384-3.15874a10.18618,10.18618,0,0,1-4.00806-7.60607,6.85213,6.85213,0,0,1,2.33007-5.62763c2.07352-1.75216,5.10139-2.16313,8.36441-1.2042l-3.38076-24.7061,2.48174-.34,3.97444,29.04518-2.07245-.951c-2.4027-1.10205-5.70088-1.66285-7.7504.06911a4.40263,4.40263,0,0,0-1.44375,3.62659,7.69887,7.69887,0,0,0,2.98246,5.67107c3.08949,2.25668,7.19708,2.54779,11.85585,2.678Z" transform="translate(-172.03021 -134.96696)" fill="#2f2e41"/><rect x="658.49493" y="222.21767" width="13.49133" height="2.50498" fill="#2f2e41"/><rect x="701.07961" y="222.21765" width="13.49133" height="2.50498" fill="#2f2e41"/><path d="M889.23233,452.90765h-57.9a8.14716,8.14716,0,0,0-8.13995,8.14v128.33a47.66955,47.66955,0,0,0,25.56,42.19995q3.555-3.18,7.01-6.5,4.485-4.24494,8.78-8.68994,5.265-5.40006,10.25-11.05005,4.08006-4.59,7.94-9.36,1.725-2.115,3.4-4.28c26.79-34.43,45.57-76.06,49.3-119.14A64.04854,64.04854,0,0,0,889.23233,452.90765Z" transform="translate(-172.03021 -134.96696)" fill="#2f2e41"/><path d="M891.34231,479.68767a14.61136,14.61136,0,0,0-10.43-4.17,14.465,14.465,0,0,0-9.16,3.36005,13.12263,13.12263,0,0,0-1.17,1.07l-47.38995,48.6-34.37,35.25a6.80061,6.80061,0,0,0-1.28,1.8,7.29573,7.29573,0,0,0-.77,3.32,7.16751,7.16751,0,0,0,2.18006,5.07l1.35,1.32,9.8,9.55.01-.01a7.29073,7.29073,0,0,0,4.66,1.63,7.167,7.167,0,0,0,5.07-2.18l1.59-1.62,11.38-11.67.38-.39,68.41-70.16a14.69128,14.69128,0,0,0-.26-20.77Z" transform="translate(-172.03021 -134.96696)" fill="#6c63ff"/><path d="M890.86152,343.44c2.1124-4.46658-.05349-9.23761-3.76378-12.09072-4.67557-3.59539-10.7221-3.00085-16.04008-1.29905-5.82238,1.8632-11.51366,5.21608-17.80383,5.02337a11.13058,11.13058,0,0,1-10.24407-7.27764c-3.3687-8.639.43561-18.29488,6.29971-24.84681a34.26766,34.26766,0,0,1,26.544-11.586,34.64989,34.64989,0,0,1,28.068,16.9026,1.54079,1.54079,0,0,0,2.05229.53813,36.88225,36.88225,0,0,1,28.39377-.71432,36.28984,36.28984,0,0,1,22.58042,34.49188c-.05,1.93122,2.95005,1.9301,3,0a39.89155,39.89155,0,0,0-10.59928-27.81249,38.71871,38.71871,0,0,0-27.56681-12.16772,39.33641,39.33641,0,0,0-17.32226,3.61223l2.05229.53813a37.69886,37.69886,0,0,0-25.0988-17.728,36.48542,36.48542,0,0,0-29.42384,7.32772c-7.70165,6.02707-13.53849,15.38016-13.17519,25.41071.15721,4.34047,1.44713,8.796,4.4606,12.03051,3.85981,4.14287,9.62229,4.85944,14.94631,3.798,7.07554-1.41071,13.53533-6.06449,20.91133-5.92113a10.21164,10.21164,0,0,1,7.6417,3.4453c1.62455,1.83335,2.6042,4.47042,1.49716,6.81122-.82094,1.73585,1.76463,3.26026,2.59041,1.51416Z" transform="translate(-172.03021 -134.96696)" fill="#2f2e41"/><path d="M412.09426,704.32287c-35.59912.001-68.69433-1.22071-98.32226-3.68555-38.72656-3.22266-69.41455-8.40332-91.21045-15.39648-23.07666-7.40528-35.31934-16.667-36.38818-27.52832-2.083-21.15821,39.334-40.72461,74.44531-53.41309l1.01953,2.82227c-48.2168,17.42382-73.957,35.28613-72.47949,50.29785,1.88183,19.11914,47.39209,33.78125,124.86181,40.22754,79.3252,6.60058,183.71729,4.26172,293.94727-6.58985,110.23-10.84863,213.07568-28.90625,289.59131-50.8457,74.72607-21.42578,116.50488-44.67969,114.623-63.79883-1.5625-15.874-33.20264-28.793-89.0918-36.3789l.40332-2.97266c40.60986,5.51172,89.47949,16.76172,91.67383,39.05762,1.06933,10.86132-9.1333,22.332-30.32276,34.09375-20.01465,11.10937-49.10351,22.17285-86.45849,32.88281-76.68506,21.98828-179.71973,40.08105-290.12451,50.94824C539.00247,700.86,472.01663,704.32287,412.09426,704.32287Z" transform="translate(-172.03021 -134.96696)" fill="#6c63ff"/><circle cx="838.45653" cy="434.48305" r="17.48305" fill="#6c63ff"/><circle cx="331.45653" cy="17.48305" r="17.48305" fill="#e6e6e6"/><circle cx="19.45653" cy="433.48305" r="17.48305" fill="#e6e6e6"/><circle cx="127.45653" cy="108.48305" r="10.70234" fill="#ff6584"/><circle cx="77.45653" cy="514.48305" r="10.70234" fill="#ff6584"/><circle cx="807.45653" cy="339.48305" r="10.70234" fill="#ff6584"/><circle cx="645.45653" cy="598.48305" r="17.48305" fill="#e6e6e6"/></svg>',kF=(e,t)=>{const n=window.atob(e),r=new ArrayBuffer(n.length),o=new Uint8Array(r);for(let i=0;i<n.length;i++)o[i]=n.charCodeAt(i);return new Blob([r],{type:t})},NF=async e=>{const{vault:t}=ut.getState().app,n=await t.adapter.readBinary(e),r=new Uint8Array(n),o=new Blob([r],{type:"image/png"});return new Promise(i=>{const s=new FileReader;s.onloadend=()=>{const c=s.result;i(c)},s.readAsDataURL(o)})},FF=async()=>{const{app:e,settings:t}=ut.getState();let n,r;const o=document.body.hasClass("theme-light"),i=o?t==null?void 0:t.DefaultLightBackgroundImage:t==null?void 0:t.DefaultDarkBackgroundImage;await e.vault.adapter.exists(t==null?void 0:t.DefaultLightBackgroundImage)&&/\.(png|svg|jpg|jpeg)/g.test(t==null?void 0:t.DefaultLightBackgroundImage)?(r=i,n=await NF(r)):n="data:image/svg+xml;base64,"+btoa(o?xF:MF);const c=document.querySelector(".dialog-wrapper .memo-background .property-image");c.style.backgroundImage="url('"+n+"')",document.body.className.contains("theme-dark")&&(c.style.backgroundColor="#1f1f1f")},IF=e=>{const{memo:t,destroy:n}=e,{memos:r}=xe.getState().memoState,{view:o,app:i,settings:s}=xe.getState().dailyNotesState,c={...t,createdAtStr:Ue.getDateTimeString(t.createdAt)},[d,h]=A.useState(!1),[g,m]=A.useState(c.content),[w,b]=A.useState(!1),T=A.useRef(null),E=A.useRef(null),[k,C]=A.useState(""),I=A.useRef(null),B=A.useRef(null);let F,_;r.length&&(F=r.length>0?r[r.length-1]:null,F?_=r?Math.ceil((Date.now()-Ue.getTimeStampByDate(F==null?void 0:F.createdAt))/1e3/3600/24)+1:0:_=0);const R=s==null?void 0:s.ShareFooterEnd.replace("{UserName}",s==null?void 0:s.UserName),j=s==null?void 0:s.ShareFooterStart.replace("{ThinoNum}",r.length.toString()).replace("{UsedDay}",_.toString());A.useEffect(()=>{!T.current||!E.current||(N.setIcon(T.current,"copy"),N.setIcon(E.current,"x"))},[T,E]),A.useEffect(()=>{N.setIcon(T.current,w?"loader":"copy"),T.current.disabled=w,T.current.toggleClass("copying",w)},[w]),A.useEffect(()=>{if(!B.current||!o||d)return;m(t.content),B.current.hasChildNodes()&&B.current.empty();async function J(){await N.MarkdownRenderer.render(i,t.content.replaceAll(/<br>/g,`
`)+`
`,B.current,t.path,o)}J(),setTimeout(()=>{if(FF(),!I.current)return;let ae;document.body.hasClass("theme-dark")?ae="#727171":ae="#eaeaea",w3(I.current,{backgroundColor:ae,pixelRatio:window.devicePixelRatio*2}).then(ie=>{C(ie),h(!0)}).catch(()=>{})},oE)},[I,B,c]);const z=()=>{n()},q=A.useCallback(J=>{b(J)},[w]),$=async()=>{q(!0);const{vault:J}=xe.getState().dailyNotesState.app,ae=I.current.querySelector(".memo-shortcut-img");if(!ae)return;const ie=ae==null?void 0:ae.getAttribute("src").split("base64,")[1],ge=kF(ie,"image/png");let pe;if(s!=null&&s.AutoSaveWhenOnMobile&&N.Platform.isMobile&&ge.arrayBuffer().then(async De=>{const re="png",be=Au();for(const V in be)if(be[V]instanceof N.TFile){pe=be[V];break}pe!==void 0&&await J.createBinary(await J.getAvailablePathForAttachments(`Pasted Image ${N.moment().format("YYYYMMDDHHmmss")}`,re,pe),De)}),!ge){new N.Notice("Copy to clipboard failed");return}const fe=new ClipboardItem({"image/png":ge});window.navigator.clipboard.write([fe]).then(()=>{setTimeout(()=>{q(!1)},500)}),new N.Notice("Copy to clipboard successfully")};return D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"dialog-header-container",children:[D.jsxs("p",{className:"title-text",children:[D.jsx("span",{className:"icon-text",children:"🥰"}),O("Share Memo Image")]}),D.jsxs("div",{className:"btn-group",children:[D.jsx("button",{ref:T,className:"btn copy-btn",onClick:$}),D.jsx("button",{ref:E,className:"btn close-btn",onClick:z})]})]}),D.jsxs("div",{className:"dialog-content-container",children:[D.jsx("div",{className:`tip-words-container ${k?"finish":"loading"}`,children:D.jsx("p",{className:"tip-text",children:O(k?"↗Click the button to save":"Image is generating...")})}),D.jsxs("div",{className:"memo-container",ref:I,children:[D.jsx(Fa,{when:k!=="",children:D.jsx("img",{className:"memo-shortcut-img",onClick:$,src:k})}),D.jsxs("div",{className:"memo-background",children:[D.jsx("div",{className:"property-image",style:{backgroundSize:"cover",backgroundRepeat:"no-repeat"}}),D.jsx("span",{className:"background-container"}),D.jsx("div",{ref:B,className:"memo-content-text"}),D.jsxs("div",{className:"watermark-container",children:[D.jsxs("span",{className:"normal-text footer-start",children:[D.jsx("div",{className:"property-social-icons"}),D.jsx("span",{className:"name-text",children:j})]}),D.jsx("span",{className:"normal-text footer-end",children:D.jsx("span",{className:"name-text",children:R})})]})]})]})]})]})};function AF(e){Sh({className:"share-memo-image-dialog"},IF,{memo:e})}const OF=A.forwardRef((e,t)=>{const{memo:n,handlePinMemoClick:r,handleFixMemoClick:o,handleSourceMemoClick:i,handleShowMemoStoryDialog:s,handleCopyMemoClick:c,handleEditMemoClick:d,handleGenMemoImageBtnClick:h,handleMarkMemoClick:g,handleArchiveMemo:m,handleDeleteMemoClick:w}=e,b=xe.getState().dailyNotesState.settings,[T,E]=Oa(!1),k=A.useRef(null),C={pinRef:A.useRef(null),fixRef:A.useRef(null),typeRef:A.useRef(null),moreRef:A.useRef(null)},I={copy:A.useRef(null),read:A.useRef(null),mark:A.useRef(null),share:A.useRef(null),edit:A.useRef(null),source:A.useRef(null),archive:A.useRef(null),delete:A.useRef(null)};return A.useEffect(()=>{k.current&&(N.setIcon(I.copy.current,"copy"),N.setIcon(I.read.current,"book-open"),N.setIcon(I.mark.current,"bookmark"),N.setIcon(I.share.current,"share-2"),N.setIcon(I.edit.current,"pencil"),N.setIcon(I.source.current,"home"),N.setIcon(I.archive.current,"archive"),N.setIcon(I.delete.current,"trash"))},[k]),A.useEffect(()=>{if(!C.typeRef)return;const B=Df.find(F=>F.title===n.sourceType);N.setIcon(C.typeRef.current,B.icon),N.requireApiVersion("1.4.4")&&N.setTooltip(C.typeRef.current,n.path),C.fixRef&&(N.setIcon(C.fixRef.current,"shield-alert"),N.requireApiVersion("1.4.4")&&N.setTooltip(C.fixRef.current,"Update Thino property"))},[C.typeRef]),A.useEffect(()=>{C.pinRef&&(n.pinned?(N.setIcon(C.pinRef.current,"pin-off"),N.requireApiVersion("1.4.4")&&N.setTooltip(C.pinRef.current,O("UNPIN"))):(N.setIcon(C.pinRef.current,"pin"),N.requireApiVersion("1.4.4")&&N.setTooltip(C.pinRef.current,O("PIN"))))},[C.pinRef,n.pinned]),A.useImperativeHandle(t,()=>({toggleConfirm:B=>E(B),confirmStatus:T})),D.jsx("div",{ref:k,className:"memo-top-right-wrapper",children:D.jsxs("div",{className:"btns-container",children:[D.jsx("span",{ref:C.fixRef,className:`btn ${n.sourceType!=="MULTI"||n.id!==""?"hidden":""} fix-memo-btn`,onClick:()=>o(n)}),D.jsx("span",{ref:C.typeRef,className:`btn ${n.sourceType==="DAILY"?"hidden":""} source-type-btn`,onClick:()=>i(n)}),D.jsx("span",{ref:C.pinRef,className:`btn ${e.memo.pinned?"pinned-btn":"unpinned-btn"}`,onClick:r}),D.jsx("span",{ref:B=>{C.moreRef.current=B,B&&N.setIcon(B,"more-horizontal")},className:"btn more-action-btn"}),D.jsx("div",{className:"more-action-btns-wrapper",children:D.jsxs("div",{className:"more-action-btns-container",children:[D.jsxs("div",{className:"more-action-btn-group more-action-menu-item",children:[D.jsx("span",{ref:I.copy,className:"more-action-item-icon",onClick:c}),D.jsx("span",{ref:I.edit,className:"more-action-item-icon",onClick:d}),D.jsx("span",{ref:I.share,className:"more-action-item-icon",onClick:h})]}),D.jsx("hr",{className:"menu-hr"}),D.jsxs("div",{className:"more-action-menu-item",onClick:s,children:[D.jsx("span",{ref:I.read,className:"more-action-item-icon"}),D.jsx("span",{className:"btn",children:O("READ")})]}),D.jsxs("div",{className:"more-action-menu-item",children:[D.jsx("span",{ref:I.mark,className:"more-action-item-icon"}),D.jsx("span",{className:"btn",onClick:g,children:O("MARK")})]}),D.jsxs("div",{className:"more-action-menu-item",children:[D.jsx("span",{ref:I.source,className:"more-action-item-icon"}),D.jsx("span",{className:"btn",onClick:()=>i(n),children:O("SOURCE")})]}),D.jsx("hr",{className:"menu-hr"}),D.jsxs("div",{className:"more-action-menu-item archive-menu-item",children:[D.jsx("span",{ref:I.archive,className:"more-action-item-icon"}),D.jsx("span",{className:"btn delete-btn",onClick:()=>m(n),children:O("ARCHIVE").toUpperCase()})]}),D.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[D.jsx("span",{ref:I.delete,className:"more-action-item-icon"}),D.jsx("span",{className:`btn delete-btn ${T?"final-confirm":""}`,onClick:async B=>{B.stopPropagation(),B.preventDefault(),await w(B)},children:T?O("CONFIRM"):b.DeleteThinoDirectly?O("DELETE"):O("Recycle bin").toUpperCase()})]}),D.jsx("hr",{className:"menu-hr"}),D.jsx("div",{className:"text-count-item more-action-menu-item",children:D.jsx("span",{className:"btn text-count-btn",children:Ue.countWords(n.content)+` ${O("words")}`})})]})})]})})}),RF=e=>{const{memo:t,handleMemoTypeToggle:n,handleShowMemoStoryDialog:r,settings:o}=e;return D.jsxs("div",{className:"memo-top-left-wrapper",children:[e.children,D.jsx("span",{title:t.createdAt,className:"time-text",onClick:r,children:t.createdAt}),D.jsx("div",{className:`btn memo-type-img ${o!=null&&o.ShowTaskLabel?"":"hidden"}`,onClick:n,children:t.thinoType!=="JOURNAL"&&D.jsx("input",{className:"task-list-item-checkbox",type:"checkbox",checked:t.thinoType!=="TASK-TODO","data-task":t.thinoType==="TASK-TODO"?"":t.thinoType==="TASK-DONE"?"x":t.thinoType.slice(5)})})]})},LF=async(e,t,n)=>{const r=n.getAttribute("href"),o=n.className;if(o.contains("tag"))_F(n.innerText.slice(1));else if(o.contains("internal-link")){const i=n.getAttribute("data-href"),s=Me.getMemoById(i??"");s?Nv(s):await e.workspace.openLinkText(i,i,!N.Platform.isMobile&&t.navigation!==!0)}else r&&window.open(r,"_blank")},_F=e=>{const t=it.getState().query.tag;it.setTagQuery(t===e?"":e)},PF=(e,t)=>{const n=t==null?void 0:t.getAttribute("src"),r=t==null?void 0:t.parentElement.getAttribute("src"),o=[...(e==null?void 0:e.querySelectorAll("img"))??[]],i=o.indexOf(t);D3({imgUrl:n,filepath:n.startsWith("app")?r:void 0,otherIMGEls:o,currentIndex:i})},jF=e=>{var r;const t=(r=e.dataset)==null?void 0:r.value,n=Me.getMemoById(t??"");n?Nv(n):(new N.Notice("Thino Not Found"),e.classList.remove("memo-link-text"))},BF=async(e,t,n)=>{var i;const r=((i=n.parentElement.dataset)==null?void 0:i.task)==="x"?"DONE":"TODO",o=[...(t==null?void 0:t.querySelectorAll("li.task-list-item"))??[]];for(const s of o)if(s===n||s===n.closest("li.task-list-item")){const c=o.indexOf(s),d=e.content.replace(/<br>/g,`
`).split(/\n/),h=[];for(let T=0;T<d.length;T++)(d[T].trim().startsWith("- [ ]")||d[T].trim().startsWith("- [x]"))&&h.push(T);const g=h[c],w=d[g].replace(/- \[ \] |- \[x\] /g,r==="TODO"?"- [x] ":"- [ ] ");d[g]=w;const b=d.join(`
`).trim();if(e&&e.content!==b){const T=await Me.updateMemo(e.id,b);Me.editMemo(T)}}},YF=e=>{const{globalState:{editMemoId:t},dailyNotesState:{app:n,view:r,settings:o,verifyState:i},locationState:{pathname:s}}=A.useContext(Nt),{memo:c,type:d="inline"}=e,h=A.useRef(null),g=A.useRef(null),[m,w]=A.useState(!1);A.useEffect(()=>{m&&setTimeout(()=>{rt.setEditMemoId(c.id)},100)},[m]),A.useEffect(()=>{s==="/review"&&t!==c.id&&m&&w(!1)},[t]);const b=()=>{Nv(c)},T=()=>{if(o!=null&&o.UseButtonToShowEditor&&(o==null?void 0:o.DefaultEditorLocation)==="Bottom"){const pe=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.hidden)");pe&&pe.trigger("click")}rt.setMarkMemoId(c.id)},E=async()=>{var De;const pe=!N.Platform.isDesktop&&await((De=window.Capacitor)==null?void 0:De.Plugins.Device.getId()),fe=N.Platform.isDesktop?await Un():pe.identifier||pe.uuid;if(!i&&(i==null?void 0:i.appId)!==fe){yr();return}c.pinned?await Me.unpinMemoById(c.id):await Me.pinMemoById(c.id)},k=()=>{if(o!=null&&o.UseButtonToShowEditor&&(o==null?void 0:o.DefaultEditorLocation)==="Bottom"&&N.Platform.isMobile){const pe=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.hidden)");pe&&pe.trigger("click")}s==="/review"&&w(!0),s!=="/review"&&rt.setEditMemoId(c.id)},C=async pe=>{pe.sourceType==="MULTI"&&pe.id.trim()===""&&await Me.updateMemoProperty(pe)},I=async pe=>{await Me.openThinoByID(pe.id)},B=async pe=>{try{const fe=await Me.archiveMemo(pe);fe&&Me.editMemo(fe)}catch(fe){console.error(fe),new N.Notice(fe.message)}},F=async()=>{if(g.current&&!g.current.confirmStatus){g.current&&g.current.toggleConfirm();return}try{if(o.DeleteThinoDirectly)await Me.deleteMemoById(c.id);else{const pe=await Me.hideMemoById(c.id);pe&&Me.editMemo(pe)}}catch(pe){new N.Notice(pe.message)}rt.getState().editMemoId===c.id&&rt.setEditMemoId("")},_=()=>{if(g.current&&!g.current.confirmStatus){g.current&&g.current.toggleConfirm(!1);return}},R=()=>{AF(c)},j=async()=>{const pe=await Me.updateMemo(c.id,c.content,c.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");pe&&Me.editMemo(pe)},z=async pe=>{pe.stopPropagation(),navigator.clipboard.writeText(c.content.replace(/(<br>|<p>)/g,`
`)).then(()=>{new N.Notice(O("COPY SUCCEED"))}).catch(()=>{new N.Notice(O("COPY FAILED"))})},q=pe=>{pe&&k()},$=async(pe,fe)=>{pe.preventDefault();const De=pe.target;if(pe.ctrlKey||pe.metaKey){await I(fe);return}if(De.tagName==="A"){await LF(n,r,De);return}if(De.tagName==="IMG"){PF(h.current,De);return}if(De.tagName==="A"&&De.getAttribute("href")){const re=De.getAttribute("href");window.open(re,"_blank");return}if(De.className==="memo-link-text"){jF(De);return}if(De.tagName==="INPUT"&&De.hasClass("task-list-item-checkbox")){await BF(fe,h.current,De);return}},J=pe=>{const fe=new N.Menu;fe.dom.toggleClass("memo-context-menu",!0);const De=window.getSelection();(De==null?void 0:De.toString().length)>0&&fe.addItem(re=>{re.setIcon("copy").setTitle(O("COPY")).onClick(()=>{navigator.clipboard.writeText(De.toString()).then(()=>{new N.Notice(O("COPY SUCCEED"))}).catch(()=>{new N.Notice(O("COPY FAILED"))})})}).addSeparator(),fe.addItem(re=>{re.setIcon("book-open").setTitle(O("READ")).onClick(b)}).addItem(re=>{re.setIcon(c.pinned?"pin-off":"pin").setTitle(c.pinned?O("UNPIN"):O("PIN")).onClick(E)}).addItem(re=>{re.setIcon("bookmark").setTitle(O("MARK")).onClick(T)}).addItem(re=>{re.setIcon("share-2").setTitle(O("SHARE")).onClick(R)}).addItem(re=>{re.setIcon("pencil").setTitle(O("EDIT")).onClick(k)}).addItem(re=>{re.setIcon("home").setTitle(O("SOURCE")).onClick(()=>I(c))}).addSeparator().addItem(re=>{re.setIcon("archive").setTitle(O("ARCHIVE")).onClick(()=>B(c))}).addItem(re=>{re.setIcon("trash").setTitle(O("DELETE")).onClick(F)}),fe.showAtMouseEvent(pe.nativeEvent)},ae=A.useMemo(()=>({memo:c,handlePinMemoClick:E,handleFixMemoClick:C,handleSourceMemoClick:I,handleArchiveMemo:B,handleDeleteMemoClick:F,handleGenMemoImageBtnClick:R,handleMarkMemoClick:T,handleEditMemoClick:k,handleCopyMemoClick:z,handleShowMemoStoryDialog:b}),[c]),ie=A.useMemo(()=>({memo:c,handleMemoTypeToggle:j,handleShowMemoStoryDialog:b,settings:o}),[c,o]),ge=A.useMemo(()=>D.jsxs("div",{ref:h,className:`memo-wrapper ${c.pinned?"pinned":""}`,"data-source-type":c.sourceType,"data-thino-type":c.thinoType,"data-thino-id":c.id,onMouseLeave:_,onContextMenu:J,children:[m&&D.jsx(Zp,{editorType:"inline"}),!m&&D.jsxs(D.Fragment,{children:[d==="inline"&&D.jsxs("div",{className:"memo-top-wrapper",draggable:!0,onDragStart:pe=>{pe.target.classList.add("dragging"),pe.dataTransfer.setDragImage(h.current,0,0),pe.dataTransfer.setData("text/plain",c.content.replace(/<br>/g,`
`))},onDragEnd:pe=>{pe.target.classList.remove("dragging")},children:[D.jsx(RF,{...ie}),D.jsx(OF,{ref:g,...ae})]}),D.jsx(T3,{memo:c,handleMemoContentClick:$,handleMemoDoubleClick:q})]})]}),[c,m]);return D.jsx(D.Fragment,{children:ge})},ml=A.memo(YF);function HF(e,t){if(e==null)return{};var n=UF(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UF(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function iv(){return iv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iv.apply(this,arguments)}function jD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ip(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jD(Object(n),!0).forEach(function(r){VF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const zF={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0},x0=2;class bw extends Q.Component{constructor(t){super(t),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this);let n;this.props.breakpointCols&&this.props.breakpointCols.default?n=this.props.breakpointCols.default:n=parseInt(this.props.breakpointCols)||x0,this.state={columnCount:n}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){if(!window||!window.requestAnimationFrame){this.reCalculateColumnCount();return}window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})}reCalculateColumnCount(){const t=window&&window.innerWidth||1/0;let n=this.props.breakpointCols;typeof n!="object"&&(n={default:parseInt(n)||x0});let r=1/0,o=n.default||x0;for(let i in n){const s=parseInt(i);s>0&&t<=s&&s<r&&(r=s,o=n[i])}o=Math.max(1,parseInt(o)||1),this.state.columnCount!==o&&this.setState({columnCount:o})}itemsInColumns(){const t=this.state.columnCount,n=new Array(t),r=Q.Children.toArray(this.props.children);for(let o=0;o<r.length;o++){const i=o%t;n[i]||(n[i]=[]),n[i].push(r[o])}return n}renderColumns(){const{column:t,columnAttrs:n={},columnClassName:r}=this.props,o=this.itemsInColumns(),i=`${100/o.length}%`;let s=r;s&&typeof s!="string"&&(this.logDeprecated('The property "columnClassName" requires a string'),typeof s>"u"&&(s="my-masonry-grid_column"));const c=Ip(Ip(Ip({},t),n),{},{style:Ip(Ip({},n.style),{},{width:i}),className:s});return o.map((d,h)=>Q.createElement("div",iv({},c,{key:h}),d))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:n,breakpointCols:r,columnClassName:o,columnAttrs:i,column:s,className:c}=t,d=HF(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let h=c;return typeof c!="string"&&(this.logDeprecated('The property "className" requires a string'),typeof c>"u"&&(h="my-masonry-grid")),Q.createElement("div",iv({},d,{className:h}),this.renderColumns())}}bw.defaultProps=zF;const BD=e=>{const{thinos:t,dayMark:n}=e,[r,o]=Q.useState(!0),i=Q.useRef(null);A.useEffect(()=>{i&&N.setTooltip&&N.setTooltip(i.current,O("Click to expand or fold, Cmd+Click to show all thinos of the day"))},[i]);const s=d=>{if(N.Keymap.isModifier(d.nativeEvent,"Mod")){const h=N.moment(n,"YYYY-MM-DD");it.setFromAndToQuery(h.startOf("day").valueOf(),h.endOf("day").valueOf());return}o(!r)},c=A.useMemo(()=>D.jsx(D.Fragment,{children:e.type==="list"?D.jsxs(D.Fragment,{children:[D.jsx("div",{ref:i,className:`day-mark ${r?"":"folded"}`,onClick:s,children:D.jsxs("span",{className:"day-mark-text",children:[r?"▼ ":"▶ ",n==="PINNED"?n+" 📌":n]})},n),r&&t.map((d,h)=>D.jsx(ml,{memo:d},`${d.id}-${N.moment(d.updatedAt,"YYYY-MM-DD HH:mm:ss").format("x")}-${h}`))]}):D.jsxs(D.Fragment,{children:[D.jsx("div",{ref:i,className:`day-mark ${r?"":"folded"}`,onClick:s,children:D.jsxs("span",{className:"day-mark-text",children:[r?"▼ ":"▶ ",n==="PINNED"?n+" 📌":n]})},n),D.jsx(bw,{breakpointCols:e.type==="waterfall"?3:1,className:`${e.type}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:r&&t.map((d,h)=>D.jsx(ml,{memo:d},`${d.id}-${N.moment(d.updatedAt,"YYYY-MM-DD HH:mm:ss").format("x")}-${h}`))})]})}),[t,r]);return D.jsx(D.Fragment,{children:c})};function us(e){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},us(e)}function $F(e,t){if(us(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(us(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function J3(e){var t=$F(e,"string");return us(t)=="symbol"?t:String(t)}function yu(e,t,n){return t=J3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Xt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YD(Object(n),!0).forEach(function(r){yu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lv(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Ci(e,t){if(e==null)return{};var n=Lv(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,J3(r.key),r)}}function lr(e,t,n){return t&&HD(e.prototype,t),n&&HD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sv(e){return sv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sv(e)}function X3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(X3=function(){return!!e})()}function eT(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qF(e,t){if(t&&(us(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eT(e)}function Gr(e,t,n){return t=sv(t),qF(e,X3()?Reflect.construct(t,n||[],sv(e).constructor):t.apply(e,n))}function lv(e,t){return lv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},lv(e,t)}function Kr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lv(e,t)}function tT(e){if(Array.isArray(e))return e}function WF(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,c=[],d=!0,h=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(g){h=!0,o=g}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw o}}return c}}function S1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Dw(e,t){if(e){if(typeof e=="string")return S1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S1(e,t)}}function nT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function as(e,t){return tT(e)||WF(e,t)||Dw(e,t)||nT()}function Cn(){return Cn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cn.apply(this,arguments)}var GF=function(e,t,n,r,o,i,s,c){if(!e){var d;if(t===void 0)d=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var h=[n,r,o,i,s,c],g=0;d=new Error(t.replace(/%s/g,function(){return h[g++]})),d.name="Invariant Violation"}throw d.framesToPop=1,d}},KF=GF;const Jp=qn(KF);var QF=function(){};function ZF(e,t){var n={};return Object.keys(e).forEach(function(r){n[zg(r)]=QF}),n}function UD(e,t){return e[t]!==void 0}function zg(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}function JF(e){return!!e&&(typeof e!="function"||e.prototype&&e.prototype.isReactComponent)}function XF(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,lv(e,t)}function rT(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function oT(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r??null}this.setState(t.bind(this))}function aT(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}rT.__suppressDeprecationWarning=!0;oT.__suppressDeprecationWarning=!0;aT.__suppressDeprecationWarning=!0;function eI(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var n=null,r=null,o=null;if(typeof t.componentWillMount=="function"?n="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?o="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(o="UNSAFE_componentWillUpdate"),n!==null||r!==null||o!==null){var i=e.displayName||e.name,s=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
`+i+" uses "+s+" but also contains the following legacy lifecycles:"+(n!==null?`
`+n:"")+(r!==null?`
`+r:"")+(o!==null?`
`+o:"")+`
The above lifecycles should be removed. Learn more about this warning here:
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=rT,t.componentWillReceiveProps=oT),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=aT;var c=t.componentDidUpdate;t.componentDidUpdate=function(h,g,m){var w=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:m;c.call(this,h,g,w)}}return e}var tI="/Users/jquense/src/uncontrollable/src/uncontrollable.js";function iT(e,t,n){n===void 0&&(n=[]);var r=e.displayName||e.name||"Component",o=JF(e),i=Object.keys(t),s=i.map(zg);o||!n.length||Jp(!1);var c=function(h){XF(g,h);function g(){for(var w,b=arguments.length,T=new Array(b),E=0;E<b;E++)T[E]=arguments[E];w=h.call.apply(h,[this].concat(T))||this,w.handlers=Object.create(null),i.forEach(function(C){var I=t[C],B=function(_){if(w.props[I]){var R;w._notifying=!0;for(var j=arguments.length,z=new Array(j>1?j-1:0),q=1;q<j;q++)z[q-1]=arguments[q];(R=w.props)[I].apply(R,[_].concat(z)),w._notifying=!1}w.unmounted||w.setState(function($){var J,ae=$.values;return{values:Cn(Object.create(null),ae,(J={},J[C]=_,J))}})};w.handlers[I]=B}),n.length&&(w.attachRef=function(C){w.inner=C});var k=Object.create(null);return i.forEach(function(C){k[C]=w.props[zg(C)]}),w.state={values:k,prevProps:{}},w}var m=g.prototype;return m.shouldComponentUpdate=function(){return!this._notifying},g.getDerivedStateFromProps=function(b,T){var E=T.values,k=T.prevProps,C={values:Cn(Object.create(null),E),prevProps:{}};return i.forEach(function(I){C.prevProps[I]=b[I],!UD(b,I)&&UD(k,I)&&(C.values[I]=b[zg(I)])}),C},m.componentWillUnmount=function(){this.unmounted=!0},m.render=function(){var b=this,T=this.props,E=T.innerRef,k=Lv(T,["innerRef"]);s.forEach(function(I){delete k[I]});var C={};return i.forEach(function(I){var B=b.props[I];C[I]=B!==void 0?B:b.state.values[I]}),Q.createElement(e,Cn({},k,C,this.handlers,{ref:E||this.attachRef}))},g}(Q.Component);eI(c),c.displayName="Uncontrolled("+r+")",c.propTypes=Cn({innerRef:function(){}},ZF(t)),n.forEach(function(h){c.prototype[h]=function(){var m;return(m=this.inner)[h].apply(m,arguments)}});var d=c;return Q.forwardRef&&(d=Q.forwardRef(function(h,g){return Q.createElement(c,Cn({},h,{innerRef:g,__source:{fileName:tI,lineNumber:128},__self:this}))}),d.propTypes=c.propTypes),d.ControlledComponent=e,d.deferControlTo=function(h,g,m){return g===void 0&&(g={}),iT(h,Cn({},t,g),m)},d}function sT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=sT(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function $n(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=sT(e))&&(r&&(r+=" "),r+=t);return r}var lT={exports:{}},M0,VD;function nI(){if(VD)return M0;VD=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return M0=e,M0}var k0,zD;function rI(){if(zD)return k0;zD=1;var e=nI();function t(){}function n(){}return n.resetWarningCache=t,k0=function(){function r(s,c,d,h,g,m){if(m!==e){var w=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw w.name="Invariant Violation",w}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},k0}lT.exports=rI()();var oI=lT.exports;const Fe=qn(oI);var uv="milliseconds",Xp="seconds",eh="minutes",th="hours",xu="day",kf="week",nh="month",Mu="year",ku="decade",Nu="century",uT={milliseconds:1,seconds:1e3,minutes:60*1e3,hours:60*60*1e3,day:24*60*60*1e3,week:7*24*60*60*1e3},aI={month:1,year:12,decade:10*12,century:100*12};function iI(e){return[31,sI(e),31,30,31,30,31,31,30,31,30,31]}function sI(e){return e%4===0&&e%100!==0||e%400===0?29:28}function Ra(e,t,n){switch(e=new Date(e),n){case uv:case Xp:case eh:case th:case xu:case kf:return lI(e,t*uT[n]);case nh:case Mu:case ku:case Nu:return uI(e,t*aI[n])}throw new TypeError('Invalid units: "'+n+'"')}function lI(e,t){var n=new Date(+e+t);return cI(e,n)}function uI(e,t){var n=e.getFullYear(),r=e.getMonth(),o=e.getDate(),i=n*12+r+t,s=Math.trunc(i/12),c=i%12,d=Math.min(o,iI(s)[c]),h=new Date(e);return h.setFullYear(s),h.setDate(1),h.setMonth(c),h.setDate(d),h}function cI(e,t){var n=e.getTimezoneOffset(),r=t.getTimezoneOffset(),o=r-n;return new Date(+t+o*uT.minutes)}function rh(e,t,n){return Ra(e,-t,n)}function wr(e,t,n){switch(e=new Date(e),t){case Nu:case ku:case Mu:e=fv(e,0);case nh:e=hT(e,1);case kf:case xu:e=ih(e,0);case th:e=Nf(e,0);case eh:e=ah(e,0);case Xp:e=oh(e,0)}return t===ku&&(e=rh(e,Fu(e)%10,"year")),t===Nu&&(e=rh(e,Fu(e)%100,"year")),t===kf&&(e=mT(e,0,n)),e}function cv(e,t,n){switch(e=new Date(e),e=wr(e,t,n),t){case Nu:case ku:case Mu:case nh:case kf:e=Ra(e,1,t),e=rh(e,1,xu),e.setHours(23,59,59,999);break;case xu:e.setHours(23,59,59,999);break;case th:case eh:case Xp:e=Ra(e,1,t),e=rh(e,1,uv)}return e}var kh=$f(function(e,t){return e===t}),Sw=$f(function(e,t){return e!==t}),_v=$f(function(e,t){return e>t}),Nh=$f(function(e,t){return e>=t}),Ew=$f(function(e,t){return e<t}),zf=$f(function(e,t){return e<=t});function cT(){return new Date(Math.min.apply(Math,arguments))}function fT(){return new Date(Math.max.apply(Math,arguments))}function dT(e,t,n,r){return r=r||"day",(!t||Nh(e,t,r))&&(!n||zf(e,n,r))}var oh=bl("Milliseconds"),ah=bl("Seconds"),Nf=bl("Minutes"),ih=bl("Hours"),pT=bl("Day"),hT=bl("Date"),fv=bl("Month"),Fu=bl("FullYear");function fI(e,t){return t===void 0?Fu(wr(e,ku)):Ra(e,t+10,Mu)}function dI(e,t){return t===void 0?Fu(wr(e,Nu)):Ra(e,t+100,Mu)}function mT(e,t,n){var r=(pT(e)+7-(n||0))%7;return t===void 0?r:Ra(e,t-r,xu)}function pI(e,t,n,r){var o,i,s;switch(n){case uv:case Xp:case eh:case th:case xu:case kf:o=t.getTime()-e.getTime();break;case nh:case Mu:case ku:case Nu:o=(Fu(t)-Fu(e))*12+fv(t)-fv(e);break;default:throw new TypeError('Invalid units: "'+n+'"')}switch(n){case uv:i=1;break;case Xp:i=1e3;break;case eh:i=1e3*60;break;case th:i=1e3*60*60;break;case xu:i=1e3*60*60*24;break;case kf:i=1e3*60*60*24*7;break;case nh:i=1;break;case Mu:i=12;break;case ku:i=120;break;case Nu:i=1200;break;default:throw new TypeError('Invalid units: "'+n+'"')}return s=o/i,r?s:Math.round(s)}function bl(e){var t=function(n){switch(n){case"Milliseconds":return 36e5;case"Seconds":return 3600;case"Minutes":return 60;case"Hours":return 1;default:return null}}(e);return function(n,r){if(r===void 0)return n["get"+e]();var o=new Date(n);return o["set"+e](r),t&&o["get"+e]()!=r&&(e==="Hours"||r>=t&&o.getHours()-n.getHours()<Math.floor(r/t))&&o["set"+e](r+t),o}}function $f(e){return function(t,n,r){return e(+wr(t,r),+wr(n,r))}}const $D=Object.freeze(Object.defineProperty({__proto__:null,add:Ra,century:dI,date:hT,day:pT,decade:fI,diff:pI,endOf:cv,eq:kh,gt:_v,gte:Nh,hours:ih,inRange:dT,lt:Ew,lte:zf,max:fT,milliseconds:oh,min:cT,minutes:Nf,month:fv,neq:Sw,seconds:ah,startOf:wr,subtract:rh,weekday:mT,year:Fu},Symbol.toStringTag,{value:"Module"}));function hI(e){if(Array.isArray(e))return S1(e)}function gT(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mI(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $g(e){return hI(e)||gT(e)||Dw(e)||mI()}function gI(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}var vT=gI;function vI(e,t){return e===t||e!==e&&t!==t}var Fh=vI,yI=typeof Vn=="object"&&Vn&&Vn.Object===Object&&Vn,yT=yI,wI=yT,bI=typeof self=="object"&&self&&self.Object===Object&&self,DI=wI||bI||Function("return this")(),xi=DI,SI=xi,EI=SI.Symbol,qf=EI,qD=qf,wT=Object.prototype,TI=wT.hasOwnProperty,CI=wT.toString,Ap=qD?qD.toStringTag:void 0;function xI(e){var t=TI.call(e,Ap),n=e[Ap];try{e[Ap]=void 0;var r=!0}catch{}var o=CI.call(e);return r&&(t?e[Ap]=n:delete e[Ap]),o}var MI=xI,kI=Object.prototype,NI=kI.toString;function FI(e){return NI.call(e)}var II=FI,WD=qf,AI=MI,OI=II,RI="[object Null]",LI="[object Undefined]",GD=WD?WD.toStringTag:void 0;function _I(e){return e==null?e===void 0?LI:RI:GD&&GD in Object(e)?AI(e):OI(e)}var Wf=_I;function PI(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ms=PI,jI=Wf,BI=ms,YI="[object AsyncFunction]",HI="[object Function]",UI="[object GeneratorFunction]",VI="[object Proxy]";function zI(e){if(!BI(e))return!1;var t=jI(e);return t==HI||t==UI||t==YI||t==VI}var Tw=zI,$I=9007199254740991;function qI(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$I}var Cw=qI,WI=Tw,GI=Cw;function KI(e){return e!=null&&GI(e.length)&&!WI(e)}var Ih=KI,QI=9007199254740991,ZI=/^(?:0|[1-9]\d*)$/;function JI(e,t){var n=typeof e;return t=t??QI,!!t&&(n=="number"||n!="symbol"&&ZI.test(e))&&e>-1&&e%1==0&&e<t}var xw=JI,XI=Fh,eA=Ih,tA=xw,nA=ms;function rA(e,t,n){if(!nA(n))return!1;var r=typeof t;return(r=="number"?eA(n)&&tA(t,n.length):r=="string"&&t in n)?XI(n[t],e):!1}var Pv=rA,oA=/\s/;function aA(e){for(var t=e.length;t--&&oA.test(e.charAt(t)););return t}var iA=aA,sA=iA,lA=/^\s+/;function uA(e){return e&&e.slice(0,sA(e)+1).replace(lA,"")}var cA=uA;function fA(e){return e!=null&&typeof e=="object"}var Dl=fA,dA=Wf,pA=Dl,hA="[object Symbol]";function mA(e){return typeof e=="symbol"||pA(e)&&dA(e)==hA}var Ah=mA,gA=cA,KD=ms,vA=Ah,QD=NaN,yA=/^[-+]0x[0-9a-f]+$/i,wA=/^0b[01]+$/i,bA=/^0o[0-7]+$/i,DA=parseInt;function SA(e){if(typeof e=="number")return e;if(vA(e))return QD;if(KD(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=KD(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=gA(e);var n=wA.test(e);return n||bA.test(e)?DA(e.slice(2),n?2:8):yA.test(e)?QD:+e}var EA=SA,TA=EA,ZD=1/0,CA=17976931348623157e292;function xA(e){if(!e)return e===0?e:0;if(e=TA(e),e===ZD||e===-ZD){var t=e<0?-1:1;return t*CA}return e===e?e:0}var bT=xA,MA=bT;function kA(e){var t=MA(e),n=t%1;return t===t?n?t-n:t:0}var DT=kA,NA=vT,FA=Pv,IA=DT,AA=Math.ceil,OA=Math.max;function RA(e,t,n){(n?FA(e,t,n):t===void 0)?t=1:t=OA(IA(t),0);var r=e==null?0:e.length;if(!r||t<1)return[];for(var o=0,i=0,s=Array(AA(r/t));o<r;)s[i++]=NA(e,o,o+=t);return s}var LA=RA;const _A=qn(LA);function Oh(e){return e&&e.ownerDocument||document}function PA(e){var t=Oh(e);return t&&t.defaultView||window}function jA(e,t){return PA(e).getComputedStyle(e,t)}var BA=/([A-Z])/g;function YA(e){return e.replace(BA,"-$1").toLowerCase()}var HA=/^ms-/;function Tg(e){return YA(e).replace(HA,"-ms-")}var UA=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function VA(e){return!!(e&&UA.test(e))}function gf(e,t){var n="",r="";if(typeof t=="string")return e.style.getPropertyValue(Tg(t))||jA(e).getPropertyValue(Tg(t));Object.keys(t).forEach(function(o){var i=t[o];!i&&i!==0?e.style.removeProperty(Tg(o)):VA(o)?r+=o+"("+i+") ":n+=Tg(o)+": "+i+";"}),r&&(n+="transform: "+r+";"),e.style.cssText+=";"+n}function sh(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}function zA(e){return"nodeType"in e&&e.nodeType===document.DOCUMENT_NODE}function Mw(e){return"window"in e&&e.window===e?e:zA(e)&&e.defaultView||!1}function ST(e){var t=e==="pageXOffset"?"scrollLeft":"scrollTop";function n(r,o){var i=Mw(r);if(o===void 0)return i?i[e]:r[t];i?i.scrollTo(i[e],o):r[t]=o}return n}const ET=ST("pageXOffset"),TT=ST("pageYOffset");function Tu(e){var t=Oh(e),n={top:0,left:0,height:0,width:0},r=t&&t.documentElement;return!r||!sh(r,e)||(e.getBoundingClientRect!==void 0&&(n=e.getBoundingClientRect()),n={top:n.top+TT(r)-(r.clientTop||0),left:n.left+ET(r)-(r.clientLeft||0),width:n.width,height:n.height}),n}var $A=function(t){return!!t&&"offsetParent"in t};function qA(e){for(var t=Oh(e),n=e&&e.offsetParent;$A(n)&&n.nodeName!=="HTML"&&gf(n,"position")==="static";)n=n.offsetParent;return n||t.documentElement}var WA=function(t){return t.nodeName&&t.nodeName.toLowerCase()};function CT(e,t){var n={top:0,left:0},r;if(gf(e,"position")==="fixed")r=e.getBoundingClientRect();else{var o=t||qA(e);r=Tu(e),WA(o)!=="html"&&(n=Tu(o));var i=String(gf(o,"borderTopWidth")||0);n.top+=parseInt(i,10)-TT(o)||0;var s=String(gf(o,"borderLeftWidth")||0);n.left+=parseInt(s,10)-ET(o)||0}var c=String(gf(e,"marginTop")||0),d=String(gf(e,"marginLeft")||0);return Cn({},r,{top:r.top-n.top-(parseInt(c,10)||0),left:r.left-n.left-(parseInt(d,10)||0)})}const kw=!!(typeof window<"u"&&window.document&&window.document.createElement);var JD=new Date().getTime();function GA(e){var t=new Date().getTime(),n=Math.max(0,16-(t-JD)),r=setTimeout(e,n);return JD=t,r}var KA=["","webkit","moz","o","ms"],E1="clearTimeout",T1=GA,XD=function(t,n){return t+(t?n[0].toUpperCase()+n.substr(1):n)+"AnimationFrame"};kw&&KA.some(function(e){var t=XD(e,"request");return t in window&&(E1=XD(e,"cancel"),T1=function(r){return window[t](r)}),!!T1});var eS=function(t){typeof window[E1]=="function"&&window[E1](t)},xT=T1,N0;function QA(e,t){if(!N0){var n=document.body,r=n.matches||n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;N0=function(i,s){return r.call(i,s)}}return N0(e,t)}var ZA=Function.prototype.bind.call(Function.prototype.call,[].slice);function JA(e,t){return ZA(e.querySelectorAll(t))}var C1=!1,x1=!1;try{var F0={get passive(){return C1=!0},get once(){return x1=C1=!0}};kw&&(window.addEventListener("test",F0,F0),window.removeEventListener("test",F0,!0))}catch{}function XA(e,t,n,r){if(r&&typeof r!="boolean"&&!x1){var o=r.once,i=r.capture,s=n;!x1&&o&&(s=n.__once||function c(d){this.removeEventListener(t,c,i),n.call(this,d)},n.__once=s),e.addEventListener(t,s,C1?r:i)}e.addEventListener(t,n,r)}function eO(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e},[e]),t}function tS(e){const t=eO(e);return A.useCallback(function(...n){return t.current&&t.current(...n)},[t])}function nS(){return A.useState(null)}function tO(){const e=A.useRef(!0),t=A.useRef(()=>e.current);return A.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function nO(e){const t=tO();return[e[0],A.useCallback(n=>{if(t())return e[1](n)},[t,e[1]])]}var rO=U3({defaultModifiers:[j3,Y3,O3,R3,B3,P3,H3,A3]}),rS=function(t){return{position:t,top:"0",left:"0",opacity:"0",pointerEvents:"none"}},oO={name:"applyStyles",enabled:!1},aO={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:function(t){var n=t.state;return function(){var r=n.elements,o=r.reference,i=r.popper;if("removeAttribute"in o){var s=(o.getAttribute("aria-describedby")||"").split(",").filter(function(c){return c.trim()!==i.id});s.length?o.setAttribute("aria-describedby",s.join(",")):o.removeAttribute("aria-describedby")}}},fn:function(t){var n,r=t.state,o=r.elements,i=o.popper,s=o.reference,c=(n=i.getAttribute("role"))==null?void 0:n.toLowerCase();if(i.id&&c==="tooltip"&&"setAttribute"in s){var d=s.getAttribute("aria-describedby");if(d&&d.split(",").indexOf(i.id)!==-1)return;s.setAttribute("aria-describedby",d?d+","+i.id:i.id)}}},iO=[];function sO(e,t,n){var r=n===void 0?{}:n,o=r.enabled,i=o===void 0?!0:o,s=r.placement,c=s===void 0?"bottom":s,d=r.strategy,h=d===void 0?"absolute":d,g=r.modifiers,m=g===void 0?iO:g,w=Lv(r,["enabled","placement","strategy","modifiers"]),b=A.useRef(),T=A.useCallback(function(){var F;(F=b.current)==null||F.update()},[]),E=A.useCallback(function(){var F;(F=b.current)==null||F.forceUpdate()},[]),k=nO(A.useState({placement:c,update:T,forceUpdate:E,attributes:{},styles:{popper:rS(h),arrow:{}}})),C=k[0],I=k[1],B=A.useMemo(function(){return{name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(_){var R=_.state,j={},z={};Object.keys(R.elements).forEach(function(q){j[q]=R.styles[q],z[q]=R.attributes[q]}),I({state:R,styles:j,attributes:z,update:T,forceUpdate:E,placement:R.placement})}}},[T,E,I]);return A.useEffect(function(){!b.current||!i||b.current.setOptions({placement:c,strategy:h,modifiers:[].concat(m,[B,oO])})},[h,c,B,i]),A.useEffect(function(){if(!(!i||e==null||t==null))return b.current=rO(e,t,Cn({},w,{placement:c,strategy:h,modifiers:[].concat(m,[aO,B])})),function(){b.current!=null&&(b.current.destroy(),b.current=void 0,I(function(F){return Cn({},F,{attributes:{},styles:{popper:rS(h)}})}))}},[i,e,t]),C}function lO(e,t,n,r){var o=r&&typeof r!="boolean"?r.capture:r;e.removeEventListener(t,n,o),n.__once&&e.removeEventListener(t,n.__once,o)}function Pp(e,t,n,r){return XA(e,t,n,r),function(){lO(e,t,n,r)}}function uO(e){return e&&"setState"in e?cw.findDOMNode(e):e??null}const cO=function(e){return Oh(uO(e))};var fO=27,oS=function(){};function dO(e){return e.button===0}function pO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var aS=function(t){return t&&("current"in t?t.current:t)};function hO(e,t,n){var r=n===void 0?{}:n,o=r.disabled,i=r.clickTrigger,s=i===void 0?"click":i,c=A.useRef(!1),d=t||oS,h=A.useCallback(function(w){var b,T=aS(e);sN(!!T,"RootClose captured a close event but does not have a ref to compare it to. useRootClose(), should be passed a ref that resolves to a DOM node"),c.current=!T||pO(w)||!dO(w)||!!sh(T,(b=w.composedPath==null?void 0:w.composedPath()[0])!=null?b:w.target)},[e]),g=tS(function(w){c.current||d(w)}),m=tS(function(w){w.keyCode===fO&&d(w)});A.useEffect(function(){if(!(o||e==null)){var w=window.event,b=cO(aS(e)),T=Pp(b,s,h,!0),E=Pp(b,s,function(I){if(I===w){w=void 0;return}g(I)}),k=Pp(b,"keyup",function(I){if(I===w){w=void 0;return}m(I)}),C=[];return"ontouchstart"in b.documentElement&&(C=[].slice.call(b.body.children).map(function(I){return Pp(I,"mousemove",oS)})),function(){T(),E(),k(),C.forEach(function(I){return I()})}}},[e,o,s,h,g,m])}function mO(e){var t={};return Array.isArray(e)?(e==null||e.forEach(function(n){t[n.name]=n}),t):e||t}function gO(e){return e===void 0&&(e={}),Array.isArray(e)?e:Object.keys(e).map(function(t){return e[t].name=t,e[t]})}function vO(e){var t,n,r,o,i=e.enabled,s=e.enableEvents,c=e.placement,d=e.flip,h=e.offset,g=e.fixed,m=e.containerPadding,w=e.arrowElement,b=e.popperConfig,T=b===void 0?{}:b,E=mO(T.modifiers);return Cn({},T,{placement:c,enabled:i,strategy:g?"fixed":T.strategy,modifiers:gO(Cn({},E,{eventListeners:{enabled:s},preventOverflow:Cn({},E.preventOverflow,{options:m?Cn({padding:m},(t=E.preventOverflow)==null?void 0:t.options):(n=E.preventOverflow)==null?void 0:n.options}),offset:{options:Cn({offset:h},(r=E.offset)==null?void 0:r.options)},arrow:Cn({},E.arrow,{enabled:!!w,options:Cn({},(o=E.arrow)==null?void 0:o.options,{element:w})}),flip:Cn({enabled:!!d},E.flip)}))})}function yO(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function wO(e,t){e.classList?e.classList.add(t):yO(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function iS(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function bO(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=iS(e.className,t):e.setAttribute("class",iS(e.className&&e.className.baseVal||"",t))}var Cg;function MT(e){if((!Cg&&Cg!==0||e)&&kw){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),Cg=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Cg}var I0=function(t){var n;return typeof document>"u"?null:t==null?Oh().body:(typeof t=="function"&&(t=t()),t&&"current"in t&&(t=t.current),(n=t)!=null&&n.nodeType&&t||null)};function sS(e,t){var n=A.useState(function(){return I0(e)}),r=n[0],o=n[1];if(!r){var i=I0(e);i&&o(i)}return A.useEffect(function(){t&&r&&t(r)},[t,r]),A.useEffect(function(){var s=I0(e);s!==r&&o(s)},[e,r]),r}const lS=e=>!e||typeof e=="function"?e:t=>{e.current=t};function DO(e,t){const n=lS(e),r=lS(t);return o=>{n&&n(o),r&&r(o)}}function SO(e,t){return A.useMemo(()=>DO(e,t),[e,t])}var Nw=Q.forwardRef(function(e,t){var n=e.flip,r=e.offset,o=e.placement,i=e.containerPadding,s=i===void 0?5:i,c=e.popperConfig,d=c===void 0?{}:c,h=e.transition,g=nS(),m=g[0],w=g[1],b=nS(),T=b[0],E=b[1],k=SO(w,t),C=sS(e.container),I=sS(e.target),B=A.useState(!e.show),F=B[0],_=B[1],R=sO(I,m,vO({placement:o,enableEvents:!!e.show,containerPadding:s||5,flip:n,offset:r,arrowElement:T,popperConfig:d})),j=R.styles,z=R.attributes,q=Lv(R,["styles","attributes"]);e.show?F&&_(!1):!e.transition&&!F&&_(!0);var $=function(){_(!0),e.onExited&&e.onExited.apply(e,arguments)},J=e.show||h&&!F;if(hO(m,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!J)return null;var ae=e.children(Cn({},q,{show:!!e.show,props:Cn({},z.popper,{style:j.popper,ref:k}),arrowProps:Cn({},z.arrow,{style:j.arrow,ref:E})}));if(h){var ie=e.onExit,ge=e.onExiting,pe=e.onEnter,fe=e.onEntering,De=e.onEntered;ae=Q.createElement(h,{in:e.show,appear:!0,onExit:ie,onExiting:ge,onExited:$,onEnter:pe,onEntering:fe,onEntered:De},ae)}return C?cw.createPortal(ae,C):null});Nw.displayName="Overlay";Nw.propTypes={show:Fe.bool,placement:Fe.oneOf(dw),target:Fe.any,container:Fe.any,flip:Fe.bool,children:Fe.func.isRequired,containerPadding:Fe.number,popperConfig:Fe.object,rootClose:Fe.bool,rootCloseEvent:Fe.oneOf(["click","mousedown"]),rootCloseDisabled:Fe.bool,onHide:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if(t.rootClose){var i;return(i=Fe.func).isRequired.apply(i,[t].concat(r))}return Fe.func.apply(Fe,[t].concat(r))},transition:Fe.elementType,onEnter:Fe.func,onEntering:Fe.func,onEntered:Fe.func,onExit:Fe.func,onExiting:Fe.func,onExited:Fe.func};const EO=Nw;function TO(){this.__data__=[],this.size=0}var CO=TO,xO=Fh;function MO(e,t){for(var n=e.length;n--;)if(xO(e[n][0],t))return n;return-1}var jv=MO,kO=jv,NO=Array.prototype,FO=NO.splice;function IO(e){var t=this.__data__,n=kO(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():FO.call(t,n,1),--this.size,!0}var AO=IO,OO=jv;function RO(e){var t=this.__data__,n=OO(t,e);return n<0?void 0:t[n][1]}var LO=RO,_O=jv;function PO(e){return _O(this.__data__,e)>-1}var jO=PO,BO=jv;function YO(e,t){var n=this.__data__,r=BO(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var HO=YO,UO=CO,VO=AO,zO=LO,$O=jO,qO=HO;function Gf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gf.prototype.clear=UO;Gf.prototype.delete=VO;Gf.prototype.get=zO;Gf.prototype.has=$O;Gf.prototype.set=qO;var Bv=Gf,WO=Bv;function GO(){this.__data__=new WO,this.size=0}var KO=GO;function QO(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var ZO=QO;function JO(e){return this.__data__.get(e)}var XO=JO;function eR(e){return this.__data__.has(e)}var tR=eR,nR=xi,rR=nR["__core-js_shared__"],oR=rR,A0=oR,uS=function(){var e=/[^.]+$/.exec(A0&&A0.keys&&A0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function aR(e){return!!uS&&uS in e}var iR=aR,sR=Function.prototype,lR=sR.toString;function uR(e){if(e!=null){try{return lR.call(e)}catch{}try{return e+""}catch{}}return""}var kT=uR,cR=Tw,fR=iR,dR=ms,pR=kT,hR=/[\\^$.*+?()[\]{}|]/g,mR=/^\[object .+?Constructor\]$/,gR=Function.prototype,vR=Object.prototype,yR=gR.toString,wR=vR.hasOwnProperty,bR=RegExp("^"+yR.call(wR).replace(hR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function DR(e){if(!dR(e)||fR(e))return!1;var t=cR(e)?bR:mR;return t.test(pR(e))}var SR=DR;function ER(e,t){return e==null?void 0:e[t]}var TR=ER,CR=SR,xR=TR;function MR(e,t){var n=xR(e,t);return CR(n)?n:void 0}var _u=MR,kR=_u,NR=xi,FR=kR(NR,"Map"),Fw=FR,IR=_u,AR=IR(Object,"create"),Yv=AR,cS=Yv;function OR(){this.__data__=cS?cS(null):{},this.size=0}var RR=OR;function LR(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _R=LR,PR=Yv,jR="__lodash_hash_undefined__",BR=Object.prototype,YR=BR.hasOwnProperty;function HR(e){var t=this.__data__;if(PR){var n=t[e];return n===jR?void 0:n}return YR.call(t,e)?t[e]:void 0}var UR=HR,VR=Yv,zR=Object.prototype,$R=zR.hasOwnProperty;function qR(e){var t=this.__data__;return VR?t[e]!==void 0:$R.call(t,e)}var WR=qR,GR=Yv,KR="__lodash_hash_undefined__";function QR(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=GR&&t===void 0?KR:t,this}var ZR=QR,JR=RR,XR=_R,eL=UR,tL=WR,nL=ZR;function Kf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Kf.prototype.clear=JR;Kf.prototype.delete=XR;Kf.prototype.get=eL;Kf.prototype.has=tL;Kf.prototype.set=nL;var rL=Kf,fS=rL,oL=Bv,aL=Fw;function iL(){this.size=0,this.__data__={hash:new fS,map:new(aL||oL),string:new fS}}var sL=iL;function lL(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var uL=lL,cL=uL;function fL(e,t){var n=e.__data__;return cL(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Hv=fL,dL=Hv;function pL(e){var t=dL(this,e).delete(e);return this.size-=t?1:0,t}var hL=pL,mL=Hv;function gL(e){return mL(this,e).get(e)}var vL=gL,yL=Hv;function wL(e){return yL(this,e).has(e)}var bL=wL,DL=Hv;function SL(e,t){var n=DL(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var EL=SL,TL=sL,CL=hL,xL=vL,ML=bL,kL=EL;function Qf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Qf.prototype.clear=TL;Qf.prototype.delete=CL;Qf.prototype.get=xL;Qf.prototype.has=ML;Qf.prototype.set=kL;var Iw=Qf,NL=Bv,FL=Fw,IL=Iw,AL=200;function OL(e,t){var n=this.__data__;if(n instanceof NL){var r=n.__data__;if(!FL||r.length<AL-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new IL(r)}return n.set(e,t),this.size=n.size,this}var RL=OL,LL=Bv,_L=KO,PL=ZO,jL=XO,BL=tR,YL=RL;function Zf(e){var t=this.__data__=new LL(e);this.size=t.size}Zf.prototype.clear=_L;Zf.prototype.delete=PL;Zf.prototype.get=jL;Zf.prototype.has=BL;Zf.prototype.set=YL;var Aw=Zf,HL="__lodash_hash_undefined__";function UL(e){return this.__data__.set(e,HL),this}var VL=UL;function zL(e){return this.__data__.has(e)}var $L=zL,qL=Iw,WL=VL,GL=$L;function dv(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new qL;++t<n;)this.add(e[t])}dv.prototype.add=dv.prototype.push=WL;dv.prototype.has=GL;var KL=dv;function QL(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var ZL=QL;function JL(e,t){return e.has(t)}var XL=JL,e_=KL,t_=ZL,n_=XL,r_=1,o_=2;function a_(e,t,n,r,o,i){var s=n&r_,c=e.length,d=t.length;if(c!=d&&!(s&&d>c))return!1;var h=i.get(e),g=i.get(t);if(h&&g)return h==t&&g==e;var m=-1,w=!0,b=n&o_?new e_:void 0;for(i.set(e,t),i.set(t,e);++m<c;){var T=e[m],E=t[m];if(r)var k=s?r(E,T,m,t,e,i):r(T,E,m,e,t,i);if(k!==void 0){if(k)continue;w=!1;break}if(b){if(!t_(t,function(C,I){if(!n_(b,I)&&(T===C||o(T,C,n,r,i)))return b.push(I)})){w=!1;break}}else if(!(T===E||o(T,E,n,r,i))){w=!1;break}}return i.delete(e),i.delete(t),w}var NT=a_,i_=xi,s_=i_.Uint8Array,FT=s_;function l_(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}var u_=l_;function c_(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var f_=c_,dS=qf,pS=FT,d_=Fh,p_=NT,h_=u_,m_=f_,g_=1,v_=2,y_="[object Boolean]",w_="[object Date]",b_="[object Error]",D_="[object Map]",S_="[object Number]",E_="[object RegExp]",T_="[object Set]",C_="[object String]",x_="[object Symbol]",M_="[object ArrayBuffer]",k_="[object DataView]",hS=dS?dS.prototype:void 0,O0=hS?hS.valueOf:void 0;function N_(e,t,n,r,o,i,s){switch(n){case k_:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case M_:return!(e.byteLength!=t.byteLength||!i(new pS(e),new pS(t)));case y_:case w_:case S_:return d_(+e,+t);case b_:return e.name==t.name&&e.message==t.message;case E_:case C_:return e==t+"";case D_:var c=h_;case T_:var d=r&g_;if(c||(c=m_),e.size!=t.size&&!d)return!1;var h=s.get(e);if(h)return h==t;r|=v_,s.set(e,t);var g=p_(c(e),c(t),r,o,i,s);return s.delete(e),g;case x_:if(O0)return O0.call(e)==O0.call(t)}return!1}var F_=N_;function I_(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var Ow=I_,A_=Array.isArray,sa=A_,O_=Ow,R_=sa;function L_(e,t,n){var r=t(e);return R_(e)?r:O_(r,n(e))}var IT=L_;function __(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}var P_=__;function j_(){return[]}var AT=j_,B_=P_,Y_=AT,H_=Object.prototype,U_=H_.propertyIsEnumerable,mS=Object.getOwnPropertySymbols,V_=mS?function(e){return e==null?[]:(e=Object(e),B_(mS(e),function(t){return U_.call(e,t)}))}:Y_,Rw=V_;function z_(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var $_=z_,q_=Wf,W_=Dl,G_="[object Arguments]";function K_(e){return W_(e)&&q_(e)==G_}var Q_=K_,gS=Q_,Z_=Dl,OT=Object.prototype,J_=OT.hasOwnProperty,X_=OT.propertyIsEnumerable,eP=gS(function(){return arguments}())?gS:function(e){return Z_(e)&&J_.call(e,"callee")&&!X_.call(e,"callee")},Lw=eP,pv={exports:{}};function tP(){return!1}var nP=tP;pv.exports;(function(e,t){var n=xi,r=nP,o=t&&!t.nodeType&&t,i=o&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===o,c=s?n.Buffer:void 0,d=c?c.isBuffer:void 0,h=d||r;e.exports=h})(pv,pv.exports);var Uv=pv.exports,rP=Wf,oP=Cw,aP=Dl,iP="[object Arguments]",sP="[object Array]",lP="[object Boolean]",uP="[object Date]",cP="[object Error]",fP="[object Function]",dP="[object Map]",pP="[object Number]",hP="[object Object]",mP="[object RegExp]",gP="[object Set]",vP="[object String]",yP="[object WeakMap]",wP="[object ArrayBuffer]",bP="[object DataView]",DP="[object Float32Array]",SP="[object Float64Array]",EP="[object Int8Array]",TP="[object Int16Array]",CP="[object Int32Array]",xP="[object Uint8Array]",MP="[object Uint8ClampedArray]",kP="[object Uint16Array]",NP="[object Uint32Array]",sn={};sn[DP]=sn[SP]=sn[EP]=sn[TP]=sn[CP]=sn[xP]=sn[MP]=sn[kP]=sn[NP]=!0;sn[iP]=sn[sP]=sn[wP]=sn[lP]=sn[bP]=sn[uP]=sn[cP]=sn[fP]=sn[dP]=sn[pP]=sn[hP]=sn[mP]=sn[gP]=sn[vP]=sn[yP]=!1;function FP(e){return aP(e)&&oP(e.length)&&!!sn[rP(e)]}var IP=FP;function AP(e){return function(t){return e(t)}}var Vv=AP,hv={exports:{}};hv.exports;(function(e,t){var n=yT,r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===r,s=i&&n.process,c=function(){try{var d=o&&o.require&&o.require("util").types;return d||s&&s.binding&&s.binding("util")}catch{}}();e.exports=c})(hv,hv.exports);var _w=hv.exports,OP=IP,RP=Vv,vS=_w,yS=vS&&vS.isTypedArray,LP=yS?RP(yS):OP,Pw=LP,_P=$_,PP=Lw,jP=sa,BP=Uv,YP=xw,HP=Pw,UP=Object.prototype,VP=UP.hasOwnProperty;function zP(e,t){var n=jP(e),r=!n&&PP(e),o=!n&&!r&&BP(e),i=!n&&!r&&!o&&HP(e),s=n||r||o||i,c=s?_P(e.length,String):[],d=c.length;for(var h in e)(t||VP.call(e,h))&&!(s&&(h=="length"||o&&(h=="offset"||h=="parent")||i&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||YP(h,d)))&&c.push(h);return c}var RT=zP,$P=Object.prototype;function qP(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||$P;return e===n}var jw=qP;function WP(e,t){return function(n){return e(t(n))}}var LT=WP,GP=LT,KP=GP(Object.keys,Object),QP=KP,ZP=jw,JP=QP,XP=Object.prototype,ej=XP.hasOwnProperty;function tj(e){if(!ZP(e))return JP(e);var t=[];for(var n in Object(e))ej.call(e,n)&&n!="constructor"&&t.push(n);return t}var nj=tj,rj=RT,oj=nj,aj=Ih;function ij(e){return aj(e)?rj(e):oj(e)}var Rh=ij,sj=IT,lj=Rw,uj=Rh;function cj(e){return sj(e,uj,lj)}var _T=cj,wS=_T,fj=1,dj=Object.prototype,pj=dj.hasOwnProperty;function hj(e,t,n,r,o,i){var s=n&fj,c=wS(e),d=c.length,h=wS(t),g=h.length;if(d!=g&&!s)return!1;for(var m=d;m--;){var w=c[m];if(!(s?w in t:pj.call(t,w)))return!1}var b=i.get(e),T=i.get(t);if(b&&T)return b==t&&T==e;var E=!0;i.set(e,t),i.set(t,e);for(var k=s;++m<d;){w=c[m];var C=e[w],I=t[w];if(r)var B=s?r(I,C,w,t,e,i):r(C,I,w,e,t,i);if(!(B===void 0?C===I||o(C,I,n,r,i):B)){E=!1;break}k||(k=w=="constructor")}if(E&&!k){var F=e.constructor,_=t.constructor;F!=_&&"constructor"in e&&"constructor"in t&&!(typeof F=="function"&&F instanceof F&&typeof _=="function"&&_ instanceof _)&&(E=!1)}return i.delete(e),i.delete(t),E}var mj=hj,gj=_u,vj=xi,yj=gj(vj,"DataView"),wj=yj,bj=_u,Dj=xi,Sj=bj(Dj,"Promise"),Ej=Sj,Tj=_u,Cj=xi,xj=Tj(Cj,"Set"),Mj=xj,kj=_u,Nj=xi,Fj=kj(Nj,"WeakMap"),Ij=Fj,M1=wj,k1=Fw,N1=Ej,F1=Mj,I1=Ij,PT=Wf,Jf=kT,bS="[object Map]",Aj="[object Object]",DS="[object Promise]",SS="[object Set]",ES="[object WeakMap]",TS="[object DataView]",Oj=Jf(M1),Rj=Jf(k1),Lj=Jf(N1),_j=Jf(F1),Pj=Jf(I1),vu=PT;(M1&&vu(new M1(new ArrayBuffer(1)))!=TS||k1&&vu(new k1)!=bS||N1&&vu(N1.resolve())!=DS||F1&&vu(new F1)!=SS||I1&&vu(new I1)!=ES)&&(vu=function(e){var t=PT(e),n=t==Aj?e.constructor:void 0,r=n?Jf(n):"";if(r)switch(r){case Oj:return TS;case Rj:return bS;case Lj:return DS;case _j:return SS;case Pj:return ES}return t});var zv=vu,R0=Aw,jj=NT,Bj=F_,Yj=mj,CS=zv,xS=sa,MS=Uv,Hj=Pw,Uj=1,kS="[object Arguments]",NS="[object Array]",xg="[object Object]",Vj=Object.prototype,FS=Vj.hasOwnProperty;function zj(e,t,n,r,o,i){var s=xS(e),c=xS(t),d=s?NS:CS(e),h=c?NS:CS(t);d=d==kS?xg:d,h=h==kS?xg:h;var g=d==xg,m=h==xg,w=d==h;if(w&&MS(e)){if(!MS(t))return!1;s=!0,g=!1}if(w&&!g)return i||(i=new R0),s||Hj(e)?jj(e,t,n,r,o,i):Bj(e,t,d,n,r,o,i);if(!(n&Uj)){var b=g&&FS.call(e,"__wrapped__"),T=m&&FS.call(t,"__wrapped__");if(b||T){var E=b?e.value():e,k=T?t.value():t;return i||(i=new R0),o(E,k,n,r,i)}}return w?(i||(i=new R0),Yj(e,t,n,r,o,i)):!1}var $j=zj,qj=$j,IS=Dl;function jT(e,t,n,r,o){return e===t?!0:e==null||t==null||!IS(e)&&!IS(t)?e!==e&&t!==t:qj(e,t,n,r,jT,o)}var Bw=jT,Wj=Bw;function Gj(e,t){return Wj(e,t)}var Kj=Gj;const Qj=qn(Kj);function L0(e,t){var n=Mw(e);return n?n.innerHeight:t?e.clientHeight:Tu(e).height}function BT(e,t,n){e.closest&&!n&&e.closest(t);var r=e;do{if(QA(r,t))return r;r=r.parentElement}while(r&&r!==n&&r.nodeType===document.ELEMENT_NODE);return null}function Zj(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}var Jj=Zj,Xj=Aw,eB=Bw,tB=1,nB=2;function rB(e,t,n,r){var o=n.length,i=o,s=!r;if(e==null)return!i;for(e=Object(e);o--;){var c=n[o];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<i;){c=n[o];var d=c[0],h=e[d],g=c[1];if(s&&c[2]){if(h===void 0&&!(d in e))return!1}else{var m=new Xj;if(r)var w=r(h,g,d,e,t,m);if(!(w===void 0?eB(g,h,tB|nB,r,m):w))return!1}}return!0}var oB=rB,aB=ms;function iB(e){return e===e&&!aB(e)}var YT=iB,sB=YT,lB=Rh;function uB(e){for(var t=lB(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,sB(o)]}return t}var cB=uB;function fB(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var HT=fB,dB=oB,pB=cB,hB=HT;function mB(e){var t=pB(e);return t.length==1&&t[0][2]?hB(t[0][0],t[0][1]):function(n){return n===e||dB(n,e,t)}}var gB=mB,vB=sa,yB=Ah,wB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bB=/^\w*$/;function DB(e,t){if(vB(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||yB(e)?!0:bB.test(e)||!wB.test(e)||t!=null&&e in Object(t)}var Yw=DB,UT=Iw,SB="Expected a function";function Hw(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(SB);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Hw.Cache||UT),n}Hw.Cache=UT;var EB=Hw,TB=EB,CB=500;function xB(e){var t=TB(e,function(r){return n.size===CB&&n.clear(),r}),n=t.cache;return t}var MB=xB,kB=MB,NB=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,FB=/\\(\\)?/g,IB=kB(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(NB,function(n,r,o,i){t.push(o?i.replace(FB,"$1"):r||n)}),t}),AB=IB;function OB(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var Uw=OB,AS=qf,RB=Uw,LB=sa,_B=Ah,PB=1/0,OS=AS?AS.prototype:void 0,RS=OS?OS.toString:void 0;function VT(e){if(typeof e=="string")return e;if(LB(e))return RB(e,VT)+"";if(_B(e))return RS?RS.call(e):"";var t=e+"";return t=="0"&&1/e==-PB?"-0":t}var jB=VT,BB=jB;function YB(e){return e==null?"":BB(e)}var HB=YB,UB=sa,VB=Yw,zB=AB,$B=HB;function qB(e,t){return UB(e)?e:VB(e,t)?[e]:zB($B(e))}var $v=qB,WB=Ah,GB=1/0;function KB(e){if(typeof e=="string"||WB(e))return e;var t=e+"";return t=="0"&&1/e==-GB?"-0":t}var Lh=KB,QB=$v,ZB=Lh;function JB(e,t){t=QB(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ZB(t[n++])];return n&&n==r?e:void 0}var qv=JB,XB=qv;function eY(e,t,n){var r=e==null?void 0:XB(e,t);return r===void 0?n:r}var tY=eY;function nY(e,t){return e!=null&&t in Object(e)}var rY=nY,oY=$v,aY=Lw,iY=sa,sY=xw,lY=Cw,uY=Lh;function cY(e,t,n){t=oY(t,e);for(var r=-1,o=t.length,i=!1;++r<o;){var s=uY(t[r]);if(!(i=e!=null&&n(e,s)))break;e=e[s]}return i||++r!=o?i:(o=e==null?0:e.length,!!o&&lY(o)&&sY(s,o)&&(iY(e)||aY(e)))}var fY=cY,dY=rY,pY=fY;function hY(e,t){return e!=null&&pY(e,t,dY)}var mY=hY,gY=Bw,vY=tY,yY=mY,wY=Yw,bY=YT,DY=HT,SY=Lh,EY=1,TY=2;function CY(e,t){return wY(e)&&bY(t)?DY(SY(e),t):function(n){var r=vY(n,e);return r===void 0&&r===t?yY(n,e):gY(t,r,EY|TY)}}var xY=CY;function MY(e){return e}var Wv=MY;function kY(e){return function(t){return t==null?void 0:t[e]}}var NY=kY,FY=qv;function IY(e){return function(t){return FY(t,e)}}var AY=IY,OY=NY,RY=AY,LY=Yw,_Y=Lh;function PY(e){return LY(e)?OY(_Y(e)):RY(e)}var jY=PY,BY=gB,YY=xY,HY=Wv,UY=sa,VY=jY;function zY(e){return typeof e=="function"?e:e==null?HY:typeof e=="object"?UY(e)?YY(e[0],e[1]):BY(e):VY(e)}var Gv=zY,$Y=Jj,qY=Gv,WY=DT,GY=Math.max;function KY(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var o=n==null?0:WY(n);return o<0&&(o=GY(r+o,0)),$Y(e,qY(t),o)}var QY=KY;const ZY=qn(QY);var JY=Math.ceil,XY=Math.max;function eH(e,t,n,r){for(var o=-1,i=XY(JY((t-e)/(n||1)),0),s=Array(i);i--;)s[r?i:++o]=e,e+=n;return s}var tH=eH,nH=tH,rH=Pv,_0=bT;function oH(e){return function(t,n,r){return r&&typeof r!="number"&&rH(t,n,r)&&(n=r=void 0),t=_0(t),n===void 0?(n=t,t=0):n=_0(n),r=r===void 0?t<n?1:-1:_0(r),nH(t,n,r,e)}}var aH=oH,iH=aH,sH=iH(),lH=sH;const uH=qn(lH);var LS=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function cH(e,t){return!!(e===t||LS(e)&&LS(t))}function fH(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!cH(e[n],t[n]))return!1;return!0}function zT(e,t){t===void 0&&(t=fH);var n=null;function r(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var s=e.apply(this,o);return n={lastResult:s,lastArgs:o,lastThis:this},s}return r.clear=function(){n=null},r}var _S=qf,dH=Lw,pH=sa,PS=_S?_S.isConcatSpreadable:void 0;function hH(e){return pH(e)||dH(e)||!!(PS&&e&&e[PS])}var mH=hH,gH=Ow,vH=mH;function $T(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=vH),o||(o=[]);++i<s;){var c=e[i];t>0&&n(c)?t>1?$T(c,t-1,n,r,o):gH(o,c):r||(o[o.length]=c)}return o}var qT=$T;function yH(e){return function(t,n,r){for(var o=-1,i=Object(t),s=r(t),c=s.length;c--;){var d=s[e?c:++o];if(n(i[d],d,i)===!1)break}return t}}var wH=yH,bH=wH,DH=bH(),SH=DH,EH=SH,TH=Rh;function CH(e,t){return e&&EH(e,t,TH)}var Vw=CH,xH=Ih;function MH(e,t){return function(n,r){if(n==null)return n;if(!xH(n))return e(n,r);for(var o=n.length,i=t?o:-1,s=Object(n);(t?i--:++i<o)&&r(s[i],i,s)!==!1;);return n}}var kH=MH,NH=Vw,FH=kH,IH=FH(NH),AH=IH,OH=AH,RH=Ih;function LH(e,t){var n=-1,r=RH(e)?Array(e.length):[];return OH(e,function(o,i,s){r[++n]=t(o,i,s)}),r}var _H=LH;function PH(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var jH=PH,jS=Ah;function BH(e,t){if(e!==t){var n=e!==void 0,r=e===null,o=e===e,i=jS(e),s=t!==void 0,c=t===null,d=t===t,h=jS(t);if(!c&&!h&&!i&&e>t||i&&s&&d&&!c&&!h||r&&s&&d||!n&&d||!o)return 1;if(!r&&!i&&!h&&e<t||h&&n&&o&&!r&&!i||c&&n&&o||!s&&o||!d)return-1}return 0}var YH=BH,HH=YH;function UH(e,t,n){for(var r=-1,o=e.criteria,i=t.criteria,s=o.length,c=n.length;++r<s;){var d=HH(o[r],i[r]);if(d){if(r>=c)return d;var h=n[r];return d*(h=="desc"?-1:1)}}return e.index-t.index}var VH=UH,P0=Uw,zH=qv,$H=Gv,qH=_H,WH=jH,GH=Vv,KH=VH,QH=Wv,ZH=sa;function JH(e,t,n){t.length?t=P0(t,function(i){return ZH(i)?function(s){return zH(s,i.length===1?i[0]:i)}:i}):t=[QH];var r=-1;t=P0(t,GH($H));var o=qH(e,function(i,s,c){var d=P0(t,function(h){return h(i)});return{criteria:d,index:++r,value:i}});return WH(o,function(i,s){return KH(i,s,n)})}var XH=JH;function eU(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var tU=eU,nU=tU,BS=Math.max;function rU(e,t,n){return t=BS(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=BS(r.length-t,0),s=Array(i);++o<i;)s[o]=r[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=r[o];return c[t]=n(s),nU(e,this,c)}}var WT=rU;function oU(e){return function(){return e}}var aU=oU,iU=_u,sU=function(){try{var e=iU(Object,"defineProperty");return e({},"",{}),e}catch{}}(),GT=sU,lU=aU,YS=GT,uU=Wv,cU=YS?function(e,t){return YS(e,"toString",{configurable:!0,enumerable:!1,value:lU(t),writable:!0})}:uU,fU=cU,dU=800,pU=16,hU=Date.now;function mU(e){var t=0,n=0;return function(){var r=hU(),o=pU-(r-n);if(n=r,o>0){if(++t>=dU)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var gU=mU,vU=fU,yU=gU,wU=yU(vU),KT=wU,bU=Wv,DU=WT,SU=KT;function EU(e,t){return SU(DU(e,t,bU),e+"")}var QT=EU,TU=qT,CU=XH,xU=QT,HS=Pv,MU=xU(function(e,t){if(e==null)return[];var n=t.length;return n>1&&HS(e,t[0],t[1])?t=[]:n>2&&HS(t[0],t[1],t[2])&&(t=[t[0]]),CU(e,TU(t,1),[])}),kU=MU;const NU=qn(kU);function A1(e,t){var n=Mw(e);return n?n.innerWidth:t?e.clientWidth:Tu(e).width}function ZT(e){return tT(e)||gT(e)||Dw(e)||nT()}function FU(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var JT=FU,US=GT;function IU(e,t,n){t=="__proto__"&&US?US(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var zw=IU,AU=zw,OU=Fh,RU=Object.prototype,LU=RU.hasOwnProperty;function _U(e,t,n){var r=e[t];(!(LU.call(e,t)&&OU(r,n))||n===void 0&&!(t in e))&&AU(e,t,n)}var XT=_U,PU=XT,jU=zw;function BU(e,t,n,r){var o=!n;n||(n={});for(var i=-1,s=t.length;++i<s;){var c=t[i],d=r?r(n[c],e[c],c,n,e):void 0;d===void 0&&(d=e[c]),o?jU(n,c,d):PU(n,c,d)}return n}var _h=BU,YU=_h,HU=Rh;function UU(e,t){return e&&YU(t,HU(t),e)}var VU=UU;function zU(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var $U=zU,qU=ms,WU=jw,GU=$U,KU=Object.prototype,QU=KU.hasOwnProperty;function ZU(e){if(!qU(e))return GU(e);var t=WU(e),n=[];for(var r in e)r=="constructor"&&(t||!QU.call(e,r))||n.push(r);return n}var JU=ZU,XU=RT,eV=JU,tV=Ih;function nV(e){return tV(e)?XU(e,!0):eV(e)}var Kv=nV,rV=_h,oV=Kv;function aV(e,t){return e&&rV(t,oV(t),e)}var iV=aV,mv={exports:{}};mv.exports;(function(e,t){var n=xi,r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===r,s=i?n.Buffer:void 0,c=s?s.allocUnsafe:void 0;function d(h,g){if(g)return h.slice();var m=h.length,w=c?c(m):new h.constructor(m);return h.copy(w),w}e.exports=d})(mv,mv.exports);var sV=mv.exports;function lV(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var uV=lV,cV=_h,fV=Rw;function dV(e,t){return cV(e,fV(e),t)}var pV=dV,hV=LT,mV=hV(Object.getPrototypeOf,Object),Qv=mV,gV=Ow,vV=Qv,yV=Rw,wV=AT,bV=Object.getOwnPropertySymbols,DV=bV?function(e){for(var t=[];e;)gV(t,yV(e)),e=vV(e);return t}:wV,e4=DV,SV=_h,EV=e4;function TV(e,t){return SV(e,EV(e),t)}var CV=TV,xV=IT,MV=e4,kV=Kv;function NV(e){return xV(e,kV,MV)}var t4=NV,FV=Object.prototype,IV=FV.hasOwnProperty;function AV(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&IV.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var OV=AV,VS=FT;function RV(e){var t=new e.constructor(e.byteLength);return new VS(t).set(new VS(e)),t}var $w=RV,LV=$w;function _V(e,t){var n=t?LV(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var PV=_V,jV=/\w*$/;function BV(e){var t=new e.constructor(e.source,jV.exec(e));return t.lastIndex=e.lastIndex,t}var YV=BV,zS=qf,$S=zS?zS.prototype:void 0,qS=$S?$S.valueOf:void 0;function HV(e){return qS?Object(qS.call(e)):{}}var UV=HV,VV=$w;function zV(e,t){var n=t?VV(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var $V=zV,qV=$w,WV=PV,GV=YV,KV=UV,QV=$V,ZV="[object Boolean]",JV="[object Date]",XV="[object Map]",ez="[object Number]",tz="[object RegExp]",nz="[object Set]",rz="[object String]",oz="[object Symbol]",az="[object ArrayBuffer]",iz="[object DataView]",sz="[object Float32Array]",lz="[object Float64Array]",uz="[object Int8Array]",cz="[object Int16Array]",fz="[object Int32Array]",dz="[object Uint8Array]",pz="[object Uint8ClampedArray]",hz="[object Uint16Array]",mz="[object Uint32Array]";function gz(e,t,n){var r=e.constructor;switch(t){case az:return qV(e);case ZV:case JV:return new r(+e);case iz:return WV(e,n);case sz:case lz:case uz:case cz:case fz:case dz:case pz:case hz:case mz:return QV(e,n);case XV:return new r;case ez:case rz:return new r(e);case tz:return GV(e);case nz:return new r;case oz:return KV(e)}}var vz=gz,yz=ms,WS=Object.create,wz=function(){function e(){}return function(t){if(!yz(t))return{};if(WS)return WS(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),n4=wz,bz=n4,Dz=Qv,Sz=jw;function Ez(e){return typeof e.constructor=="function"&&!Sz(e)?bz(Dz(e)):{}}var Tz=Ez,Cz=zv,xz=Dl,Mz="[object Map]";function kz(e){return xz(e)&&Cz(e)==Mz}var Nz=kz,Fz=Nz,Iz=Vv,GS=_w,KS=GS&&GS.isMap,Az=KS?Iz(KS):Fz,Oz=Az,Rz=zv,Lz=Dl,_z="[object Set]";function Pz(e){return Lz(e)&&Rz(e)==_z}var jz=Pz,Bz=jz,Yz=Vv,QS=_w,ZS=QS&&QS.isSet,Hz=ZS?Yz(ZS):Bz,Uz=Hz,Vz=Aw,zz=JT,$z=XT,qz=VU,Wz=iV,Gz=sV,Kz=uV,Qz=pV,Zz=CV,Jz=_T,Xz=t4,e$=zv,t$=OV,n$=vz,r$=Tz,o$=sa,a$=Uv,i$=Oz,s$=ms,l$=Uz,u$=Rh,c$=Kv,f$=1,d$=2,p$=4,r4="[object Arguments]",h$="[object Array]",m$="[object Boolean]",g$="[object Date]",v$="[object Error]",o4="[object Function]",y$="[object GeneratorFunction]",w$="[object Map]",b$="[object Number]",a4="[object Object]",D$="[object RegExp]",S$="[object Set]",E$="[object String]",T$="[object Symbol]",C$="[object WeakMap]",x$="[object ArrayBuffer]",M$="[object DataView]",k$="[object Float32Array]",N$="[object Float64Array]",F$="[object Int8Array]",I$="[object Int16Array]",A$="[object Int32Array]",O$="[object Uint8Array]",R$="[object Uint8ClampedArray]",L$="[object Uint16Array]",_$="[object Uint32Array]",rn={};rn[r4]=rn[h$]=rn[x$]=rn[M$]=rn[m$]=rn[g$]=rn[k$]=rn[N$]=rn[F$]=rn[I$]=rn[A$]=rn[w$]=rn[b$]=rn[a4]=rn[D$]=rn[S$]=rn[E$]=rn[T$]=rn[O$]=rn[R$]=rn[L$]=rn[_$]=!0;rn[v$]=rn[o4]=rn[C$]=!1;function qg(e,t,n,r,o,i){var s,c=t&f$,d=t&d$,h=t&p$;if(n&&(s=o?n(e,r,o,i):n(e)),s!==void 0)return s;if(!s$(e))return e;var g=o$(e);if(g){if(s=t$(e),!c)return Kz(e,s)}else{var m=e$(e),w=m==o4||m==y$;if(a$(e))return Gz(e,c);if(m==a4||m==r4||w&&!o){if(s=d||w?{}:r$(e),!c)return d?Zz(e,Wz(s,e)):Qz(e,qz(s,e))}else{if(!rn[m])return o?e:{};s=n$(e,m,c)}}i||(i=new Vz);var b=i.get(e);if(b)return b;i.set(e,s),l$(e)?e.forEach(function(k){s.add(qg(k,t,n,k,e,i))}):i$(e)&&e.forEach(function(k,C){s.set(C,qg(k,t,n,C,e,i))});var T=h?d?Xz:Jz:d?c$:u$,E=g?void 0:T(e);return zz(E||e,function(k,C){E&&(C=k,k=e[C]),$z(s,C,qg(k,t,n,C,e,i))}),s}var P$=qg;function j$(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var B$=j$,Y$=qv,H$=vT;function U$(e,t){return t.length<2?e:Y$(e,H$(t,0,-1))}var V$=U$,z$=$v,$$=B$,q$=V$,W$=Lh;function G$(e,t){return t=z$(t,e),e=q$(e,t),e==null||delete e[W$($$(t))]}var K$=G$,Q$=Wf,Z$=Qv,J$=Dl,X$="[object Object]",eq=Function.prototype,tq=Object.prototype,i4=eq.toString,nq=tq.hasOwnProperty,rq=i4.call(Object);function oq(e){if(!J$(e)||Q$(e)!=X$)return!1;var t=Z$(e);if(t===null)return!0;var n=nq.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&i4.call(n)==rq}var aq=oq,iq=aq;function sq(e){return iq(e)?void 0:e}var lq=sq,uq=qT;function cq(e){var t=e==null?0:e.length;return t?uq(e,1):[]}var fq=cq,dq=fq,pq=WT,hq=KT;function mq(e){return hq(pq(e,void 0,dq),e+"")}var gq=mq,vq=Uw,yq=P$,wq=K$,bq=$v,Dq=_h,Sq=lq,Eq=gq,Tq=t4,Cq=1,xq=2,Mq=4,kq=Eq(function(e,t){var n={};if(e==null)return n;var r=!1;t=vq(t,function(i){return i=bq(i,e),r||(r=i.length>1),i}),Dq(e,Tq(e),n),r&&(n=yq(n,Cq|xq|Mq,Sq));for(var o=t.length;o--;)wq(n,t[o]);return n}),Nq=kq;const Fq=qn(Nq);var Iq=QT,Aq=Fh,Oq=Pv,Rq=Kv,s4=Object.prototype,Lq=s4.hasOwnProperty,_q=Iq(function(e,t){e=Object(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&Oq(t[0],t[1],o)&&(r=1);++n<r;)for(var i=t[n],s=Rq(i),c=-1,d=s.length;++c<d;){var h=s[c],g=e[h];(g===void 0||Aq(g,s4[h])&&!Lq.call(e,h))&&(e[h]=i[h])}return e}),Pq=_q;const jq=qn(Pq);var Bq=JT,Yq=n4,Hq=Vw,Uq=Gv,Vq=Qv,zq=sa,$q=Uv,qq=Tw,Wq=ms,Gq=Pw;function Kq(e,t,n){var r=zq(e),o=r||$q(e)||Gq(e);if(t=Uq(t),n==null){var i=e&&e.constructor;o?n=r?new i:[]:Wq(e)?n=qq(i)?Yq(Vq(e)):{}:n={}}return(o?Bq:Hq)(e,function(s,c,d){return t(n,s,c,d)}),n}var Qq=Kq;const Zq=qn(Qq);var Jq=zw,Xq=Vw,eW=Gv;function tW(e,t){var n={};return t=eW(t),Xq(e,function(r,o,i){Jq(n,o,t(r,o,i))}),n}var nW=tW;const rW=qn(nW);var oW={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Vn,function(){return function(n,r,o){r.prototype.isBetween=function(i,s,c,d){var h=o(i),g=o(s),m=(d=d||"()")[0]==="(",w=d[1]===")";return(m?this.isAfter(h,c):!this.isBefore(h,c))&&(w?this.isBefore(g,c):!this.isAfter(g,c))||(m?this.isBefore(h,c):!this.isAfter(h,c))&&(w?this.isAfter(g,c):!this.isBefore(g,c))}}})})(oW);var aW={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Vn,function(){return function(n,r){r.prototype.isSameOrAfter=function(o,i){return this.isSame(o,i)||this.isAfter(o,i)}}})})(aW);var iW={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Vn,function(){return function(n,r){r.prototype.isSameOrBefore=function(o,i){return this.isSame(o,i)||this.isBefore(o,i)}}})})(iW);var sW={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Vn,function(){return function(n,r,o){var i=r.prototype,s=function(m){return m&&(m.indexOf?m:m.s)},c=function(m,w,b,T,E){var k=m.name?m:m.$locale(),C=s(k[w]),I=s(k[b]),B=C||I.map(function(_){return _.slice(0,T)});if(!E)return B;var F=k.weekStart;return B.map(function(_,R){return B[(R+(F||0))%7]})},d=function(){return o.Ls[o.locale()]},h=function(m,w){return m.formats[w]||function(b){return b.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(T,E,k){return E||k.slice(1)})}(m.formats[w.toUpperCase()])},g=function(){var m=this;return{months:function(w){return w?w.format("MMMM"):c(m,"months")},monthsShort:function(w){return w?w.format("MMM"):c(m,"monthsShort","months",3)},firstDayOfWeek:function(){return m.$locale().weekStart||0},weekdays:function(w){return w?w.format("dddd"):c(m,"weekdays")},weekdaysMin:function(w){return w?w.format("dd"):c(m,"weekdaysMin","weekdays",2)},weekdaysShort:function(w){return w?w.format("ddd"):c(m,"weekdaysShort","weekdays",3)},longDateFormat:function(w){return h(m.$locale(),w)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return g.bind(this)()},o.localeData=function(){var m=d();return{firstDayOfWeek:function(){return m.weekStart||0},weekdays:function(){return o.weekdays()},weekdaysShort:function(){return o.weekdaysShort()},weekdaysMin:function(){return o.weekdaysMin()},months:function(){return o.months()},monthsShort:function(){return o.monthsShort()},longDateFormat:function(w){return h(m,w)},meridiem:m.meridiem,ordinal:m.ordinal}},o.months=function(){return c(d(),"months")},o.monthsShort=function(){return c(d(),"monthsShort","months",3)},o.weekdays=function(m){return c(d(),"weekdays",null,null,m)},o.weekdaysShort=function(m){return c(d(),"weekdaysShort","weekdays",3,m)},o.weekdaysMin=function(m){return c(d(),"weekdaysMin","weekdays",2,m)}}})})(sW);var lW={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Vn,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,i){var s=o.prototype,c=s.format;i.en.formats=n,s.format=function(d){d===void 0&&(d="YYYY-MM-DDTHH:mm:ssZ");var h=this.$locale().formats,g=function(m,w){return m.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(b,T,E){var k=E&&E.toUpperCase();return T||w[E]||n[E]||w[k].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(C,I,B){return I||B.slice(1)})})}(d,h===void 0?{}:h);return c.call(this,g)}}})})(lW);var uW={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Vn,function(){return function(n,r,o){var i=function(s,c){if(!c||!c.length||c.length===1&&!c[0]||c.length===1&&Array.isArray(c[0])&&!c[0].length)return null;var d;c.length===1&&c[0].length>0&&(c=c[0]),d=(c=c.filter(function(g){return g}))[0];for(var h=1;h<c.length;h+=1)c[h].isValid()&&!c[h][s](d)||(d=c[h]);return d};o.max=function(){var s=[].slice.call(arguments,0);return i("isAfter",s)},o.min=function(){var s=[].slice.call(arguments,0);return i("isBefore",s)}}})})(uW);var cW={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Vn,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,o=/([+-]|\d\d)/g;return function(i,s,c){var d=s.prototype;c.utc=function(E){var k={date:E,utc:!0,args:arguments};return new s(k)},d.utc=function(E){var k=c(this.toDate(),{locale:this.$L,utc:!0});return E?k.add(this.utcOffset(),n):k},d.local=function(){return c(this.toDate(),{locale:this.$L,utc:!1})};var h=d.parse;d.parse=function(E){E.utc&&(this.$u=!0),this.$utils().u(E.$offset)||(this.$offset=E.$offset),h.call(this,E)};var g=d.init;d.init=function(){if(this.$u){var E=this.$d;this.$y=E.getUTCFullYear(),this.$M=E.getUTCMonth(),this.$D=E.getUTCDate(),this.$W=E.getUTCDay(),this.$H=E.getUTCHours(),this.$m=E.getUTCMinutes(),this.$s=E.getUTCSeconds(),this.$ms=E.getUTCMilliseconds()}else g.call(this)};var m=d.utcOffset;d.utcOffset=function(E,k){var C=this.$utils().u;if(C(E))return this.$u?0:C(this.$offset)?m.call(this):this.$offset;if(typeof E=="string"&&(E=function(_){_===void 0&&(_="");var R=_.match(r);if(!R)return null;var j=(""+R[0]).match(o)||["-",0,0],z=j[0],q=60*+j[1]+ +j[2];return q===0?0:z==="+"?q:-q}(E),E===null))return this;var I=Math.abs(E)<=16?60*E:E,B=this;if(k)return B.$offset=I,B.$u=E===0,B;if(E!==0){var F=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(B=this.local().add(I+F,n)).$offset=I,B.$x.$localOffset=F}else B=this.utc();return B};var w=d.format;d.format=function(E){var k=E||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return w.call(this,k)},d.valueOf=function(){var E=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*E},d.isUTC=function(){return!!this.$u},d.toISOString=function(){return this.toDate().toISOString()},d.toString=function(){return this.toDate().toUTCString()};var b=d.toDate;d.toDate=function(E){return E==="s"&&this.$offset?c(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():b.call(this)};var T=d.diff;d.diff=function(E,k,C){if(E&&this.$u===E.$u)return T.call(this,E,k,C);var I=this.local(),B=c(E).local();return T.call(I,B,k,C)}}})})(cW);function rs(e){return e.children}var vo={PREVIOUS:"PREV",NEXT:"NEXT",TODAY:"TODAY",DATE:"DATE"},qr={MONTH:"month",WEEK:"week",WORK_WEEK:"work_week",DAY:"day",AGENDA:"agenda"},JS=Object.keys(qr).map(function(e){return qr[e]});Fe.oneOfType([Fe.string,Fe.func]);Fe.any;Fe.func;Fe.oneOfType([Fe.arrayOf(Fe.oneOf(JS)),Fe.objectOf(function(e,t){var n=JS.indexOf(t)!==-1&&typeof e[t]=="boolean";if(n)return null;for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return Fe.elementType.apply(Fe,[e,t].concat(o))})]);Fe.oneOfType([Fe.oneOf(["overlap","no-overlap"]),Fe.func]);function hn(e,t){e&&e.apply(null,[].concat(t))}var XS={seconds:1e3,minutes:1e3*60,hours:1e3*60*60,day:1e3*60*60*24};function l4(e,t){var n=wr(e,"month");return wr(n,"week",t.startOfWeek())}function u4(e,t){var n=cv(e,"month");return cv(n,"week",t.startOfWeek())}function fW(e,t){for(var n=l4(e,t),r=u4(e,t),o=[];zf(n,r,"day");)o.push(n),n=Ra(n,1,"day");return o}function dW(e,t){var n=wr(e,t);return kh(n,e)?n:Ra(n,1,t)}function pW(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",r=e,o=[];zf(r,t,n);)o.push(r),r=Ra(r,1,n);return o}function hW(e,t){return t==null&&e==null?null:(t==null&&(t=new Date),e==null&&(e=new Date),e=wr(e,"day"),e=ih(e,ih(t)),e=Nf(e,Nf(t)),e=ah(e,ah(t)),oh(e,oh(t)))}function e2(e){return ih(e)===0&&Nf(e)===0&&ah(e)===0&&oh(e)===0}function mW(e,t,n,r){return n==="day"&&(n="date"),Math.abs($D[n](e,void 0,r)-$D[n](t,void 0,r))}function qw(e,t,n){return!n||n==="milliseconds"?Math.abs(+e-+t):Math.round(Math.abs(+wr(e,n)/XS[n]-+wr(t,n)/XS[n]))}var gW=Fe.oneOfType([Fe.string,Fe.func]);function vW(e,t,n,r,o){var i=typeof r=="function"?r(n,o,e):t.call(e,n,r,o);return Jp(i==null||typeof i=="string","`localizer format(..)` must return a string, null, or undefined"),i}function yW(e,t,n){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,t+n,0,0)}function Ww(e,t){return e.getTimezoneOffset()-t.getTimezoneOffset()}function wW(e,t){return qw(e,t,"minutes")+Ww(e,t)}function bW(e){var t=wr(e,"day");return qw(t,e,"minutes")+Ww(t,e)}function DW(e,t){return Ew(e,t,"day")}function SW(e,t,n){var r=kh(e,t,"minutes");return r?Nh(t,n,"minutes"):_v(t,n,"minutes")}function O1(e,t){return mW(e,t,"day")}function EW(e){var t=e.evtA,n=t.start,r=t.end,o=t.allDay,i=e.evtB,s=i.start,c=i.end,d=i.allDay,h=+wr(n,"day")-+wr(s,"day"),g=O1(n,r),m=O1(s,c);return h||m-g||!!d-!!o||+n-+s||+r-+c}function TW(e){var t=e.event,n=t.start,r=t.end,o=e.range,i=o.start,s=o.end,c=wr(n,"day"),d=zf(c,s,"day"),h=Sw(c,r,"minutes"),g=h?_v(r,i,"minutes"):Nh(r,i,"minutes");return d&&g}function CW(e,t){return kh(e,t,"day")}function xW(e,t){return e2(e)&&e2(t)}var MW=lr(function e(t){var n=this;sr(this,e),Jp(typeof t.format=="function","date localizer `format(..)` must be a function"),Jp(typeof t.firstOfWeek=="function","date localizer `firstOfWeek(..)` must be a function"),this.propType=t.propType||gW,this.formats=t.formats,this.format=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return vW.apply(void 0,[n,t.format].concat(o))},this.startOfWeek=t.firstOfWeek,this.merge=t.merge||hW,this.inRange=t.inRange||dT,this.lt=t.lt||Ew,this.lte=t.lte||zf,this.gt=t.gt||_v,this.gte=t.gte||Nh,this.eq=t.eq||kh,this.neq=t.neq||Sw,this.startOf=t.startOf||wr,this.endOf=t.endOf||cv,this.add=t.add||Ra,this.range=t.range||pW,this.diff=t.diff||qw,this.ceil=t.ceil||dW,this.min=t.min||cT,this.max=t.max||fT,this.minutes=t.minutes||Nf,this.daySpan=t.daySpan||O1,this.firstVisibleDay=t.firstVisibleDay||l4,this.lastVisibleDay=t.lastVisibleDay||u4,this.visibleDays=t.visibleDays||fW,this.getSlotDate=t.getSlotDate||yW,this.getTimezoneOffset=t.getTimezoneOffset||function(r){return r.getTimezoneOffset()},this.getDstOffset=t.getDstOffset||Ww,this.getTotalMin=t.getTotalMin||wW,this.getMinutesFromMidnight=t.getMinutesFromMidnight||bW,this.continuesPrior=t.continuesPrior||DW,this.continuesAfter=t.continuesAfter||SW,this.sortEvents=t.sortEvents||EW,this.inEventRange=t.inEventRange||TW,this.isSameDate=t.isSameDate||CW,this.startAndEndAreDateOnly=t.startAndEndAreDateOnly||xW,this.segmentOffset=t.browserTZOffset?t.browserTZOffset():0});function kW(e,t,n,r){var o=Xt(Xt({},e.formats),n);return Xt(Xt({},e),{},{messages:r,startOfWeek:function(){return e.startOfWeek(t)},format:function(s,c){return e.format(s,o[c]||c,t)}})}var NW={date:"Date",time:"Time",event:"Event",allDay:"All Day",week:"Week",work_week:"Work Week",day:"Day",month:"Month",previous:"Back",next:"Next",yesterday:"Yesterday",tomorrow:"Tomorrow",today:"Today",agenda:"Agenda",noEventsInRange:"There are no events in this range.",showMore:function(t){return"+".concat(t," more")}};function FW(e){return Xt(Xt({},NW),e)}function IW(e){var t=e.ref,n=e.callback;A.useEffect(function(){var r=function(i){t.current&&!t.current.contains(i.target)&&n()};return document.addEventListener("mousedown",r),function(){document.removeEventListener("mousedown",r)}},[t,n])}var AW=["style","className","event","selected","isAllDay","onSelect","onDoubleClick","onKeyPress","localizer","continuesPrior","continuesAfter","accessors","getters","children","components","slotStart","slotEnd"],c4=function(e){Kr(t,e);function t(){return sr(this,t),Gr(this,t,arguments)}return lr(t,[{key:"render",value:function(){var r=this.props,o=r.style,i=r.className,s=r.event,c=r.selected,d=r.isAllDay,h=r.onSelect,g=r.onDoubleClick,m=r.onKeyPress,w=r.localizer,b=r.continuesPrior,T=r.continuesAfter,E=r.accessors,k=r.getters,C=r.children,I=r.components,B=I.event,F=I.eventWrapper,_=r.slotStart,R=r.slotEnd,j=Ci(r,AW);delete j.resizable;var z=E.title(s),q=E.tooltip(s),$=E.end(s),J=E.start(s),ae=E.allDay(s),ie=d||ae||w.diff(J,w.ceil($,"day"),"day")>1,ge=k.eventProp(s,J,$,c),pe=Q.createElement("div",{className:"rbc-event-content",title:q||void 0},B?Q.createElement(B,{event:s,continuesPrior:b,continuesAfter:T,title:z,isAllDay:ae,localizer:w,slotStart:_,slotEnd:R}):z);return Q.createElement(F,Object.assign({},this.props,{type:"date"}),Q.createElement("div",Object.assign({},j,{style:Xt(Xt({},ge.style),o),className:$n("rbc-event",i,ge.className,{"rbc-selected":c,"rbc-event-allday":ie,"rbc-event-continues-prior":b,"rbc-event-continues-after":T}),onClick:function(De){return h&&h(s,De)},onDoubleClick:function(De){return g&&g(s,De)},onKeyDown:function(De){return m&&m(s,De)}}),typeof C=="function"?C(pe):pe))}}]),t}(Q.Component);function Zv(e,t){return!e||t==null?!1:Qj(e,t)}function f4(e,t){var n=e.right-e.left,r=n/t;return r}function d4(e,t,n,r){var o=f4(e,r);return n?r-1-Math.floor((t-e.left)/o):Math.floor((t-e.left)/o)}function OW(e,t){var n=t.x,r=t.y;return r>=e.top&&r<=e.bottom&&n>=e.left&&n<=e.right}function RW(e,t,n,r,o){var i=-1,s=-1,c=r-1,d=f4(t,r),h=d4(t,n.x,o,r),g=t.top<n.y&&t.bottom>n.y,m=t.top<e.y&&t.bottom>e.y,w=e.y>t.bottom,b=t.top>e.y,T=n.top<t.top&&n.bottom>t.bottom;return T&&(i=0,s=c),g&&(b?(i=0,s=h):w&&(i=h,s=c)),m&&(i=s=o?c-Math.floor((e.x-t.left)/d):Math.floor((e.x-t.left)/d),g?h<i?i=h:s=h:e.y<n.y?s=c:i=0),{startIdx:i,endIdx:s}}function LW(e){var t=e.target,n=e.offset,r=e.container,o=e.box,i=Tu(t),s=i.top,c=i.left,d=i.width,h=i.height,g=Tu(r),m=g.top,w=g.left,b=g.width,T=g.height,E=Tu(o),k=E.width,C=E.height,I=m+T,B=w+b,F=s+C,_=c+k,R=n.x,j=n.y,z=F>I?s-C-j:s+j+h,q=_>B?c+R-k+d:c+R;return{topOffset:z,leftOffset:q}}function _W(e){var t=e.containerRef,n=e.accessors,r=e.getters,o=e.selected,i=e.components,s=e.localizer,c=e.position,d=e.show,h=e.events,g=e.slotStart,m=e.slotEnd,w=e.onSelect,b=e.onDoubleClick,T=e.onKeyPress,E=e.handleDragStart,k=e.popperRef,C=e.target,I=e.offset;IW({ref:k,callback:d}),A.useLayoutEffect(function(){var _=LW({target:C,offset:I,container:t.current,box:k.current}),R=_.topOffset,j=_.leftOffset;k.current.style.top="".concat(R,"px"),k.current.style.left="".concat(j,"px")},[I.x,I.y,C]);var B=c.width,F={minWidth:B+B/2};return Q.createElement("div",{style:F,className:"rbc-overlay",ref:k},Q.createElement("div",{className:"rbc-overlay-header"},s.format(g,"dayHeaderFormat")),h.map(function(_,R){return Q.createElement(c4,{key:R,type:"popup",localizer:s,event:_,getters:r,onSelect:w,accessors:n,components:i,onDoubleClick:b,onKeyPress:T,continuesPrior:s.lt(n.end(_),g,"day"),continuesAfter:s.gte(n.start(_),m,"day"),slotStart:g,slotEnd:m,selected:Zv(_,o),draggable:!0,onDragStart:function(){return E(_)},onDragEnd:function(){return d()}})}))}var p4=Q.forwardRef(function(e,t){return Q.createElement(_W,Object.assign({},e,{popperRef:t}))});p4.propTypes={accessors:Fe.object.isRequired,getters:Fe.object.isRequired,selected:Fe.object,components:Fe.object.isRequired,localizer:Fe.object.isRequired,position:Fe.object.isRequired,show:Fe.func.isRequired,events:Fe.array.isRequired,slotStart:Fe.instanceOf(Date).isRequired,slotEnd:Fe.instanceOf(Date),onSelect:Fe.func,onDoubleClick:Fe.func,onKeyPress:Fe.func,handleDragStart:Fe.func,style:Fe.object,offset:Fe.shape({x:Fe.number,y:Fe.number})};function PW(e){var t=e.containerRef,n=e.popupOffset,r=n===void 0?5:n,o=e.overlay,i=e.accessors,s=e.localizer,c=e.components,d=e.getters,h=e.selected,g=e.handleSelectEvent,m=e.handleDoubleClickEvent,w=e.handleKeyPressEvent,b=e.handleDragStart,T=e.onHide,E=e.overlayDisplay,k=A.useRef(null);if(!o.position)return null;var C=r;isNaN(r)||(C={x:r,y:r});var I=o.position,B=o.events,F=o.date,_=o.end;return Q.createElement(EO,{rootClose:!0,flip:!0,show:!0,placement:"bottom",onHide:T,target:o.target},function(R){var j=R.props;return Q.createElement(p4,Object.assign({},j,{containerRef:t,ref:k,target:o.target,offset:C,accessors:i,getters:d,selected:h,components:c,localizer:s,position:I,show:E,events:B,slotStart:F,slotEnd:_,onSelect:g,onDoubleClick:m,onKeyPress:w,handleDragStart:b}))})}var Gw=Q.forwardRef(function(e,t){return Q.createElement(PW,Object.assign({},e,{containerRef:t}))});Gw.propTypes={popupOffset:Fe.oneOfType([Fe.number,Fe.shape({x:Fe.number,y:Fe.number})]),overlay:Fe.shape({position:Fe.object,events:Fe.array,date:Fe.instanceOf(Date),end:Fe.instanceOf(Date)}),accessors:Fe.object.isRequired,localizer:Fe.object.isRequired,components:Fe.object.isRequired,getters:Fe.object.isRequired,selected:Fe.object,handleSelectEvent:Fe.func,handleDoubleClickEvent:Fe.func,handleKeyPressEvent:Fe.func,handleDragStart:Fe.func,onHide:Fe.func,overlayDisplay:Fe.func};function Nr(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document;return Pp(n,e,t,{passive:!1})}function jW(e,t,n){return!e||sh(e,document.elementFromPoint(t,n))}function BW(e,t){var n=t.clientX,r=t.clientY,o=document.elementFromPoint(n,r);return BT(o,".rbc-event",e)}function YW(e,t){var n=t.clientX,r=t.clientY,o=document.elementFromPoint(n,r);return BT(o,".rbc-show-more",e)}function gv(e,t){return!!BW(e,t)}function HW(e,t){return!!YW(e,t)}function hf(e){var t=e;return e.touches&&e.touches.length&&(t=e.touches[0]),{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY}}var t2=5,UW=250,h4=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.global,o=r===void 0?!1:r,i=n.longPressThreshold,s=i===void 0?250:i,c=n.validContainers,d=c===void 0?[]:c;sr(this,e),this.isDetached=!1,this.container=t,this.globalMouse=!t||o,this.longPressThreshold=s,this.validContainers=d,this._listeners=Object.create(null),this._handleInitialEvent=this._handleInitialEvent.bind(this),this._handleMoveEvent=this._handleMoveEvent.bind(this),this._handleTerminatingEvent=this._handleTerminatingEvent.bind(this),this._keyListener=this._keyListener.bind(this),this._dropFromOutsideListener=this._dropFromOutsideListener.bind(this),this._dragOverFromOutsideListener=this._dragOverFromOutsideListener.bind(this),this._removeTouchMoveWindowListener=Nr("touchmove",function(){},window),this._removeKeyDownListener=Nr("keydown",this._keyListener),this._removeKeyUpListener=Nr("keyup",this._keyListener),this._removeDropFromOutsideListener=Nr("drop",this._dropFromOutsideListener),this._removeDragOverFromOutsideListener=Nr("dragover",this._dragOverFromOutsideListener),this._addInitialEventListener()}return lr(e,[{key:"on",value:function(n,r){var o=this._listeners[n]||(this._listeners[n]=[]);return o.push(r),{remove:function(){var s=o.indexOf(r);s!==-1&&o.splice(s,1)}}}},{key:"emit",value:function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];var s,c=this._listeners[n]||[];return c.forEach(function(d){s===void 0&&(s=d.apply(void 0,o))}),s}},{key:"teardown",value:function(){this.isDetached=!0,this._listeners=Object.create(null),this._removeTouchMoveWindowListener&&this._removeTouchMoveWindowListener(),this._removeInitialEventListener&&this._removeInitialEventListener(),this._removeEndListener&&this._removeEndListener(),this._onEscListener&&this._onEscListener(),this._removeMoveListener&&this._removeMoveListener(),this._removeKeyUpListener&&this._removeKeyUpListener(),this._removeKeyDownListener&&this._removeKeyDownListener(),this._removeDropFromOutsideListener&&this._removeDropFromOutsideListener(),this._removeDragOverFromOutsideListener&&this._removeDragOverFromOutsideListener()}},{key:"isSelected",value:function(n){var r=this._selectRect;return!r||!this.selecting?!1:n2(r,Iu(n))}},{key:"filter",value:function(n){var r=this._selectRect;return!r||!this.selecting?[]:n.filter(this.isSelected,this)}},{key:"_addLongPressListener",value:function(n,r){var o=this,i=null,s=null,c=null,d=function(w){i=setTimeout(function(){g(),n(w)},o.longPressThreshold),s=Nr("touchmove",function(){return g()}),c=Nr("touchend",function(){return g()})},h=Nr("touchstart",d),g=function(){i&&clearTimeout(i),s&&s(),c&&c(),i=null,s=null,c=null};return r&&d(r),function(){g(),h()}}},{key:"_addInitialEventListener",value:function(){var n=this,r=Nr("mousedown",function(i){n._removeInitialEventListener(),n._handleInitialEvent(i),n._removeInitialEventListener=Nr("mousedown",n._handleInitialEvent)}),o=Nr("touchstart",function(i){n._removeInitialEventListener(),n._removeInitialEventListener=n._addLongPressListener(n._handleInitialEvent,i)});this._removeInitialEventListener=function(){r(),o()}}},{key:"_dropFromOutsideListener",value:function(n){var r=hf(n),o=r.pageX,i=r.pageY,s=r.clientX,c=r.clientY;this.emit("dropFromOutside",{x:o,y:i,clientX:s,clientY:c}),n.preventDefault()}},{key:"_dragOverFromOutsideListener",value:function(n){var r=hf(n),o=r.pageX,i=r.pageY,s=r.clientX,c=r.clientY;this.emit("dragOverFromOutside",{x:o,y:i,clientX:s,clientY:c}),n.preventDefault()}},{key:"_handleInitialEvent",value:function(n){if(!this.isDetached){var r=hf(n),o=r.clientX,i=r.clientY,s=r.pageX,c=r.pageY,d=this.container(),h,g;if(!(n.which===3||n.button===2||!jW(d,o,i))){if(!this.globalMouse&&d&&!sh(d,n.target)){var m=VW(0),w=m.top,b=m.left,T=m.bottom,E=m.right;if(g=Iu(d),h=n2({top:g.top-w,left:g.left-b,bottom:g.bottom+T,right:g.right+E},{top:c,left:s}),!h)return}var k=this.emit("beforeSelect",this._initialEventData={isTouch:/^touch/.test(n.type),x:s,y:c,clientX:o,clientY:i});if(k!==!1)switch(n.type){case"mousedown":this._removeEndListener=Nr("mouseup",this._handleTerminatingEvent),this._onEscListener=Nr("keydown",this._handleTerminatingEvent),this._removeMoveListener=Nr("mousemove",this._handleMoveEvent);break;case"touchstart":this._handleMoveEvent(n),this._removeEndListener=Nr("touchend",this._handleTerminatingEvent),this._removeMoveListener=Nr("touchmove",this._handleMoveEvent);break}}}}},{key:"_isWithinValidContainer",value:function(n){var r=n.target,o=this.validContainers;return!o||!o.length||!r?!0:o.some(function(i){return!!r.closest(i)})}},{key:"_handleTerminatingEvent",value:function(n){var r=hf(n),o=r.pageX,i=r.pageY;if(this.selecting=!1,this._removeEndListener&&this._removeEndListener(),this._removeMoveListener&&this._removeMoveListener(),!!this._initialEventData){var s=!this.container||sh(this.container(),n.target),c=this._isWithinValidContainer(n),d=this._selectRect,h=this.isClick(o,i);return this._initialEventData=null,n.key==="Escape"||!c?this.emit("reset"):h&&s?this._handleClickEvent(n):h?this.emit("reset"):this.emit("select",d)}}},{key:"_handleClickEvent",value:function(n){var r=hf(n),o=r.pageX,i=r.pageY,s=r.clientX,c=r.clientY,d=new Date().getTime();return this._lastClickData&&d-this._lastClickData.timestamp<UW?(this._lastClickData=null,this.emit("doubleClick",{x:o,y:i,clientX:s,clientY:c})):(this._lastClickData={timestamp:d},this.emit("click",{x:o,y:i,clientX:s,clientY:c}))}},{key:"_handleMoveEvent",value:function(n){if(!(this._initialEventData===null||this.isDetached)){var r=this._initialEventData,o=r.x,i=r.y,s=hf(n),c=s.pageX,d=s.pageY,h=Math.abs(o-c),g=Math.abs(i-d),m=Math.min(c,o),w=Math.min(d,i),b=this.selecting;this.isClick(c,d)&&!b&&!(h||g)||(this.selecting=!0,this._selectRect={top:w,left:m,x:c,y:d,right:m+h,bottom:w+g},b||this.emit("selectStart",this._initialEventData),this.isClick(c,d)||this.emit("selecting",this._selectRect),n.preventDefault())}}},{key:"_keyListener",value:function(n){this.ctrl=n.metaKey||n.ctrlKey}},{key:"isClick",value:function(n,r){var o=this._initialEventData,i=o.x,s=o.y,c=o.isTouch;return!c&&Math.abs(n-i)<=t2&&Math.abs(r-s)<=t2}}]),e}();function VW(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return us(e)!=="object"&&(e={top:e,left:e,right:e,bottom:e}),e}function n2(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=Iu(e),o=r.top,i=r.left,s=r.right,c=s===void 0?i:s,d=r.bottom,h=d===void 0?o:d,g=Iu(t),m=g.top,w=g.left,b=g.right,T=b===void 0?w:b,E=g.bottom,k=E===void 0?m:E;return!(h-n<m||o+n>k||c-n<w||i+n>T)}function Iu(e){if(!e.getBoundingClientRect)return e;var t=e.getBoundingClientRect(),n=t.left+r2("left"),r=t.top+r2("top");return{top:r,left:n,right:(e.offsetWidth||0)+n,bottom:(e.offsetHeight||0)+r}}function r2(e){if(e==="left")return window.pageXOffset||document.body.scrollLeft||0;if(e==="top")return window.pageYOffset||document.body.scrollTop||0}var zW=function(e){Kr(t,e);function t(n,r){var o;return sr(this,t),o=Gr(this,t,[n,r]),o.state={selecting:!1},o.containerRef=A.createRef(),o}return lr(t,[{key:"componentDidMount",value:function(){this.props.selectable&&this._selectable()}},{key:"componentWillUnmount",value:function(){this._teardownSelectable()}},{key:"componentDidUpdate",value:function(r){!r.selectable&&this.props.selectable&&this._selectable(),r.selectable&&!this.props.selectable&&this._teardownSelectable()}},{key:"render",value:function(){var r=this.props,o=r.range,i=r.getNow,s=r.getters,c=r.date,d=r.components.dateCellWrapper,h=r.localizer,g=this.state,m=g.selecting,w=g.startIdx,b=g.endIdx,T=i();return Q.createElement("div",{className:"rbc-row-bg",ref:this.containerRef},o.map(function(E,k){var C=m&&k>=w&&k<=b,I=s.dayProp(E),B=I.className,F=I.style;return Q.createElement(d,{key:k,value:E,range:o},Q.createElement("div",{style:F,className:$n("rbc-day-bg",B,C&&"rbc-selected-cell",h.isSameDate(E,T)&&"rbc-today",c&&h.neq(c,E,"month")&&"rbc-off-range-bg")}))}))}},{key:"_selectable",value:function(){var r=this,o=this.containerRef.current,i=this._selector=new h4(this.props.container,{longPressThreshold:this.props.longPressThreshold}),s=function(d,h){if(!gv(o,d)&&!HW(o,d)){var g=Iu(o),m=r.props,w=m.range,b=m.rtl;if(OW(g,d)){var T=d4(g,d.x,b,w.length);r._selectSlot({startIdx:T,endIdx:T,action:h,box:d})}}r._initial={},r.setState({selecting:!1})};i.on("selecting",function(c){var d=r.props,h=d.range,g=d.rtl,m=-1,w=-1;if(r.state.selecting||(hn(r.props.onSelectStart,[c]),r._initial={x:c.x,y:c.y}),i.isSelected(o)){var b=Iu(o),T=RW(r._initial,b,c,h.length,g);m=T.startIdx,w=T.endIdx}r.setState({selecting:!0,startIdx:m,endIdx:w})}),i.on("beforeSelect",function(c){if(r.props.selectable==="ignoreEvents")return!gv(r.containerRef.current,c)}),i.on("click",function(c){return s(c,"click")}),i.on("doubleClick",function(c){return s(c,"doubleClick")}),i.on("select",function(c){r._selectSlot(Xt(Xt({},r.state),{},{action:"select",bounds:c})),r._initial={},r.setState({selecting:!1}),hn(r.props.onSelectEnd,[r.state])})}},{key:"_teardownSelectable",value:function(){this._selector&&(this._selector.teardown(),this._selector=null)}},{key:"_selectSlot",value:function(r){var o=r.endIdx,i=r.startIdx,s=r.action,c=r.bounds,d=r.box;o!==-1&&i!==-1&&this.props.onSelectSlot&&this.props.onSelectSlot({start:i,end:o,action:s,bounds:c,box:d,resourceId:this.props.resourceId})}}]),t}(Q.Component),Di={propTypes:{slotMetrics:Fe.object.isRequired,selected:Fe.object,isAllDay:Fe.bool,accessors:Fe.object.isRequired,localizer:Fe.object.isRequired,components:Fe.object.isRequired,getters:Fe.object.isRequired,onSelect:Fe.func,onDoubleClick:Fe.func,onKeyPress:Fe.func},defaultProps:{segments:[],selected:{}},renderEvent:function(t,n){var r=t.selected;t.isAllDay;var o=t.accessors,i=t.getters,s=t.onSelect,c=t.onDoubleClick,d=t.onKeyPress,h=t.localizer,g=t.slotMetrics,m=t.components,w=t.resizable,b=g.continuesPrior(n),T=g.continuesAfter(n);return Q.createElement(c4,{event:n,getters:i,localizer:h,accessors:o,components:m,onSelect:s,onDoubleClick:c,onKeyPress:d,continuesPrior:b,continuesAfter:T,slotStart:g.first,slotEnd:g.last,selected:Zv(n,r),resizable:w})},renderSpan:function(t,n,r){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:" ",i=Math.abs(n)/t*100+"%";return Q.createElement("div",{key:r,className:"rbc-row-segment",style:{WebkitFlexBasis:i,flexBasis:i,maxWidth:i}},o)}},m4=function(e){Kr(t,e);function t(){return sr(this,t),Gr(this,t,arguments)}return lr(t,[{key:"render",value:function(){var r=this,o=this.props,i=o.segments,s=o.slotMetrics.slots,c=o.className,d=1;return Q.createElement("div",{className:$n(c,"rbc-row")},i.reduce(function(h,g,m){var w=g.event,b=g.left,T=g.right,E=g.span,k="_lvl_"+m,C=b-d,I=Di.renderEvent(r.props,w);return C&&h.push(Di.renderSpan(s,C,"".concat(k,"_gap"))),h.push(Di.renderSpan(s,E,k,I)),d=T+1,h},[]))}}]),t}(Q.Component);m4.defaultProps=Xt({},Di.defaultProps);function g4(e){var t=e.dateRange,n=e.unit,r=n===void 0?"day":n,o=e.localizer;return{first:t[0],last:o.add(t[t.length-1],1,r)}}function $W(e,t,n,r){var o=g4({dateRange:t,localizer:r}),i=o.first,s=o.last,c=r.diff(i,s,"day"),d=r.max(r.startOf(n.start(e),"day"),i),h=r.min(r.ceil(n.end(e),"day"),s),g=ZY(t,function(w){return r.isSameDate(w,d)}),m=r.diff(d,h,"day");return m=Math.min(m,c),m=Math.max(m-r.segmentOffset,1),{event:e,span:m,left:g+1,right:Math.max(g+m,1)}}function v4(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0,n,r,o,i=[],s=[];for(n=0;n<e.length;n++){for(o=e[n],r=0;r<i.length&&qW(o,i[r]);r++);r>=t?s.push(o):(i[r]||(i[r]=[])).push(o)}for(n=0;n<i.length;n++)i[n].sort(function(c,d){return c.left-d.left});return{levels:i,extra:s}}function lh(e,t,n,r,o){var i={start:r.start(e),end:r.end(e)},s={start:t,end:n};return o.inEventRange({event:i,range:s})}function qW(e,t){return t.some(function(n){return n.left<=e.right&&n.right>=e.left})}function WW(e,t,n){var r=$g(e),o=[],i=[];r.forEach(function(d){var h=t.start(d),g=t.end(d);n.daySpan(h,g)>1?o.push(d):i.push(d)});var s=o.sort(function(d,h){return R1(d,h,t,n)}),c=i.sort(function(d,h){return R1(d,h,t,n)});return[].concat($g(s),$g(c))}function R1(e,t,n,r){var o={start:n.start(e),end:n.end(e),allDay:n.allDay(e)},i={start:n.start(t),end:n.end(t),allDay:n.allDay(t)};return r.sortEvents({evtA:o,evtB:i})}var y4=function(t,n){return t.left<=n&&t.right>=n},o2=function(t,n){return t.filter(function(r){return y4(r,n)}).map(function(r){return r.event})},w4=function(e){Kr(t,e);function t(){return sr(this,t),Gr(this,t,arguments)}return lr(t,[{key:"render",value:function(){for(var r=this.props,o=r.segments,i=r.slotMetrics.slots,s=v4(o).levels[0],c=1,d=1,h=[];c<=i;){var g="_lvl_"+c,m=s.filter(function(I){return y4(I,c)})[0]||{},w=m.event,b=m.left,T=m.right,E=m.span;if(!w){c++;continue}var k=Math.max(0,b-d);if(this.canRenderSlotEvent(b,E)){var C=Di.renderEvent(this.props,w);k&&h.push(Di.renderSpan(i,k,g+"_gap")),h.push(Di.renderSpan(i,E,g,C)),d=c=T+1}else k&&h.push(Di.renderSpan(i,k,g+"_gap")),h.push(Di.renderSpan(i,1,g,this.renderShowMore(o,c))),d=c+=1}return Q.createElement("div",{className:"rbc-row"},h)}},{key:"canRenderSlotEvent",value:function(r,o){var i=this.props.segments;return uH(r,r+o).every(function(s){var c=o2(i,s).length;return c===1})}},{key:"renderShowMore",value:function(r,o){var i=this,s=this.props,c=s.localizer,d=s.slotMetrics,h=d.getEventsForSlot(o),g=o2(r,o),m=g.length;return m?Q.createElement("button",{type:"button",key:"sm_"+o,className:$n("rbc-button-link","rbc-show-more"),onClick:function(b){return i.showMore(o,b)}},c.messages.showMore(m,g,h)):!1}},{key:"showMore",value:function(r,o){o.preventDefault(),o.stopPropagation(),this.props.onShowMore(r,o.target)}}]),t}(Q.Component);w4.defaultProps=Xt({},Di.defaultProps);var GW=function(t){var n=t.children;return Q.createElement("div",{className:"rbc-row-content-scroll-container"},n)},KW=function(t,n){return t.left<=n&&t.right>=n},QW=function(t,n){return t[0].range===n[0].range&&t[0].events===n[0].events};function b4(){return zT(function(e){for(var t=e.range,n=e.events,r=e.maxRows,o=e.minRows,i=e.accessors,s=e.localizer,c=g4({dateRange:t,localizer:s}),d=c.first,h=c.last,g=n.map(function(E){return $W(E,t,i,s)}),m=v4(g,Math.max(r-1,1)),w=m.levels,b=m.extra,T=b.length>0?o-1:o;w.length<T;)w.push([]);return{first:d,last:h,levels:w,extra:b,range:t,slots:t.length,clone:function(k){var C=b4();return C(Xt(Xt({},e),k))},getDateForSlot:function(k){return t[k]},getSlotForDate:function(k){return t.find(function(C){return s.isSameDate(C,k)})},getEventsForSlot:function(k){return g.filter(function(C){return KW(C,k)}).map(function(C){return C.event})},continuesPrior:function(k){return s.continuesPrior(i.start(k),d)},continuesAfter:function(k){var C=i.start(k),I=i.end(k);return s.continuesAfter(C,I,h)}}},QW)}var vv=function(e){Kr(t,e);function t(){var n;sr(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=Gr(this,t,[].concat(o)),n.handleSelectSlot=function(s){var c=n.props,d=c.range,h=c.onSelectSlot;h(d.slice(s.start,s.end+1),s)},n.handleShowMore=function(s,c){var d=n.props,h=d.range,g=d.onShowMore,m=n.slotMetrics(n.props),w=JA(n.containerRef.current,".rbc-row-bg")[0],b;w&&(b=w.children[s-1]);var T=m.getEventsForSlot(s);g(T,h[s-1],b,s,c)},n.getContainer=function(){var s=n.props.container;return s?s():n.containerRef.current},n.renderHeadingCell=function(s,c){var d=n.props,h=d.renderHeader,g=d.getNow,m=d.localizer;return h({date:s,key:"header_".concat(c),className:$n("rbc-date-cell",m.isSameDate(s,g())&&"rbc-now")})},n.renderDummy=function(){var s=n.props,c=s.className,d=s.range,h=s.renderHeader,g=s.showAllEvents;return Q.createElement("div",{className:c,ref:n.containerRef},Q.createElement("div",{className:$n("rbc-row-content",g&&"rbc-row-content-scrollable")},h&&Q.createElement("div",{className:"rbc-row",ref:n.headingRowRef},d.map(n.renderHeadingCell)),Q.createElement("div",{className:"rbc-row",ref:n.eventRowRef},Q.createElement("div",{className:"rbc-row-segment"},Q.createElement("div",{className:"rbc-event"},Q.createElement("div",{className:"rbc-event-content"}," "))))))},n.containerRef=A.createRef(),n.headingRowRef=A.createRef(),n.eventRowRef=A.createRef(),n.slotMetrics=b4(),n}return lr(t,[{key:"getRowLimit",value:function(){var r,o=L0(this.eventRowRef.current),i=(r=this.headingRowRef)!==null&&r!==void 0&&r.current?L0(this.headingRowRef.current):0,s=L0(this.containerRef.current)-i;return Math.max(Math.floor(s/o),1)}},{key:"render",value:function(){var r=this.props,o=r.date,i=r.rtl,s=r.range,c=r.className,d=r.selected,h=r.selectable,g=r.renderForMeasure,m=r.accessors,w=r.getters,b=r.components,T=r.getNow,E=r.renderHeader,k=r.onSelect,C=r.localizer,I=r.onSelectStart,B=r.onSelectEnd,F=r.onDoubleClick,_=r.onKeyPress,R=r.resourceId,j=r.longPressThreshold,z=r.isAllDay,q=r.resizable,$=r.showAllEvents;if(g)return this.renderDummy();var J=this.slotMetrics(this.props),ae=J.levels,ie=J.extra,ge=$?GW:rs,pe=b.weekWrapper,fe={selected:d,accessors:m,getters:w,localizer:C,components:b,onSelect:k,onDoubleClick:F,onKeyPress:_,resourceId:R,slotMetrics:J,resizable:q};return Q.createElement("div",{className:c,role:"rowgroup",ref:this.containerRef},Q.createElement(zW,{localizer:C,date:o,getNow:T,rtl:i,range:s,selectable:h,container:this.getContainer,getters:w,onSelectStart:I,onSelectEnd:B,onSelectSlot:this.handleSelectSlot,components:b,longPressThreshold:j,resourceId:R}),Q.createElement("div",{className:$n("rbc-row-content",$&&"rbc-row-content-scrollable"),role:"row"},E&&Q.createElement("div",{className:"rbc-row ",ref:this.headingRowRef},s.map(this.renderHeadingCell)),Q.createElement(ge,null,Q.createElement(pe,Object.assign({isAllDay:z},fe,{rtl:this.props.rtl}),ae.map(function(De,re){return Q.createElement(m4,Object.assign({key:re,segments:De},fe))}),!!ie.length&&Q.createElement(w4,Object.assign({segments:ie,onShowMore:this.handleShowMore},fe))))))}}]),t}(Q.Component);vv.defaultProps={minRows:0,maxRows:1/0};var D4=function(t){var n=t.label;return Q.createElement("span",{role:"columnheader","aria-sort":"none"},n)},ZW=function(t){var n=t.label,r=t.drilldownView,o=t.onDrillDown;return r?Q.createElement("button",{type:"button",className:"rbc-button-link",onClick:o,role:"cell"},n):Q.createElement("span",null,n)},JW=["date","className"],XW=function(t,n,r,o,i){return t.filter(function(s){return lh(s,n,r,o,i)})},Jv=function(e){Kr(t,e);function t(){var n;sr(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=Gr(this,t,[].concat(o)),n.getContainer=function(){return n.containerRef.current},n.renderWeek=function(s,c){var d=n.props,h=d.events,g=d.components,m=d.selectable,w=d.getNow,b=d.selected,T=d.date,E=d.localizer,k=d.longPressThreshold,C=d.accessors,I=d.getters,B=d.showAllEvents,F=n.state,_=F.needLimitMeasure,R=F.rowLimit,j=XW($g(h),s[0],s[s.length-1],C,E),z=WW(j,C,E);return Q.createElement(vv,{key:c,ref:c===0?n.slotRowRef:void 0,container:n.getContainer,className:"rbc-month-row",getNow:w,date:T,range:s,events:z,maxRows:B?1/0:R,selected:b,selectable:m,components:g,accessors:C,getters:I,localizer:E,renderHeader:n.readerDateHeading,renderForMeasure:_,onShowMore:n.handleShowMore,onSelect:n.handleSelectEvent,onDoubleClick:n.handleDoubleClickEvent,onKeyPress:n.handleKeyPressEvent,onSelectSlot:n.handleSelectSlot,longPressThreshold:k,rtl:n.props.rtl,resizable:n.props.resizable,showAllEvents:B})},n.readerDateHeading=function(s){var c=s.date,d=s.className,h=Ci(s,JW),g=n.props,m=g.date,w=g.getDrilldownView,b=g.localizer,T=b.neq(c,m,"month"),E=b.isSameDate(c,m),k=w(c),C=b.format(c,"dateFormat"),I=n.props.components.dateHeader||ZW;return Q.createElement("div",Object.assign({},h,{className:$n(d,T&&"rbc-off-range",E&&"rbc-current"),role:"cell"}),Q.createElement(I,{label:C,date:c,drilldownView:k,isOffRange:T,onDrillDown:function(F){return n.handleHeadingClick(c,k,F)}}))},n.handleSelectSlot=function(s,c){n._pendingSelection=n._pendingSelection.concat(s),clearTimeout(n._selectTimer),n._selectTimer=setTimeout(function(){return n.selectDates(c)})},n.handleHeadingClick=function(s,c,d){d.preventDefault(),n.clearSelection(),hn(n.props.onDrillDown,[s,c])},n.handleSelectEvent=function(){n.clearSelection();for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];hn(n.props.onSelectEvent,c)},n.handleDoubleClickEvent=function(){n.clearSelection();for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];hn(n.props.onDoubleClickEvent,c)},n.handleKeyPressEvent=function(){n.clearSelection();for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];hn(n.props.onKeyPressEvent,c)},n.handleShowMore=function(s,c,d,h,g){var m=n.props,w=m.popup,b=m.onDrillDown,T=m.onShowMore,E=m.getDrilldownView,k=m.doShowMoreDrillDown;if(n.clearSelection(),w){var C=CT(d,n.containerRef.current);n.setState({overlay:{date:c,events:s,position:C,target:g}})}else k&&hn(b,[c,E(c)||qr.DAY]);hn(T,[s,c,h])},n.overlayDisplay=function(){n.setState({overlay:null})},n.state={rowLimit:5,needLimitMeasure:!0,date:null},n.containerRef=A.createRef(),n.slotRowRef=A.createRef(),n._bgRows=[],n._pendingSelection=[],n}return lr(t,[{key:"componentDidMount",value:function(){var r=this,o;this.state.needLimitMeasure&&this.measureRowLimit(this.props),window.addEventListener("resize",this._resizeListener=function(){o||xT(function(){o=!1,r.setState({needLimitMeasure:!0})})},!1)}},{key:"componentDidUpdate",value:function(){this.state.needLimitMeasure&&this.measureRowLimit(this.props)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this._resizeListener,!1)}},{key:"render",value:function(){var r=this.props,o=r.date,i=r.localizer,s=r.className,c=i.visibleDays(o,i),d=_A(c,7);return this._weekCount=d.length,Q.createElement("div",{className:$n("rbc-month-view",s),role:"table","aria-label":"Month View",ref:this.containerRef},Q.createElement("div",{className:"rbc-row rbc-month-header",role:"row"},this.renderHeaders(d[0])),d.map(this.renderWeek),this.props.popup&&this.renderOverlay())}},{key:"renderHeaders",value:function(r){var o=this.props,i=o.localizer,s=o.components,c=r[0],d=r[r.length-1],h=s.header||D4;return i.range(c,d,"day").map(function(g,m){return Q.createElement("div",{key:"header_"+m,className:"rbc-header"},Q.createElement(h,{date:g,localizer:i,label:i.format(g,"weekdayFormat")}))})}},{key:"renderOverlay",value:function(){var r,o,i=this,s=(r=(o=this.state)===null||o===void 0?void 0:o.overlay)!==null&&r!==void 0?r:{},c=this.props,d=c.accessors,h=c.localizer,g=c.components,m=c.getters,w=c.selected,b=c.popupOffset,T=c.handleDragStart,E=function(){return i.setState({overlay:null})};return Q.createElement(Gw,{overlay:s,accessors:d,localizer:h,components:g,getters:m,selected:w,popupOffset:b,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:T,show:!!s.position,overlayDisplay:this.overlayDisplay,onHide:E})}},{key:"measureRowLimit",value:function(){this.setState({needLimitMeasure:!1,rowLimit:this.slotRowRef.current.getRowLimit()})}},{key:"selectDates",value:function(r){var o=this._pendingSelection.slice();this._pendingSelection=[],o.sort(function(c,d){return+c-+d});var i=new Date(o[0]),s=new Date(o[o.length-1]);s.setDate(o[o.length-1].getDate()+1),hn(this.props.onSelectSlot,{slots:o,start:i,end:s,action:r.action,bounds:r.bounds,box:r.box})}},{key:"clearSelection",value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}}],[{key:"getDerivedStateFromProps",value:function(r,o){var i=r.date,s=r.localizer;return{date:i,needLimitMeasure:s.neq(i,o.date,"month")}}}]),t}(Q.Component);Jv.range=function(e,t){var n=t.localizer,r=n.firstVisibleDay(e,n),o=n.lastVisibleDay(e,n);return{start:r,end:o}};Jv.navigate=function(e,t,n){var r=n.localizer;switch(t){case vo.PREVIOUS:return r.add(e,-1,"month");case vo.NEXT:return r.add(e,1,"month");default:return e}};Jv.title=function(e,t){var n=t.localizer;return n.format(e,"monthHeaderFormat")};var a2=function(t){var n=t.min,r=t.max,o=t.step,i=t.slots,s=t.localizer;return"".concat(+s.startOf(n,"minutes"))+"".concat(+s.startOf(r,"minutes"))+"".concat(o,"-").concat(i)};function Kw(e){for(var t=e.min,n=e.max,r=e.step,o=e.timeslots,i=e.localizer,s=a2({start:t,end:n,step:r,timeslots:o,localizer:i}),c=1+i.getTotalMin(t,n),d=i.getMinutesFromMidnight(t),h=Math.ceil((c-1)/(r*o)),g=h*o,m=new Array(h),w=new Array(g),b=0;b<h;b++){m[b]=new Array(o);for(var T=0;T<o;T++){var E=b*o+T,k=E*r;w[E]=m[b][T]=i.getSlotDate(t,d,k)}}var C=w.length*r;w.push(i.getSlotDate(t,d,C));function I(B){var F=i.diff(t,B,"minutes")+i.getDstOffset(t,B);return Math.min(F,c)}return{groups:m,update:function(F){return a2(F)!==s?Kw(F):this},dateIsInGroup:function(F,_){var R=m[_+1];return i.inRange(F,m[_][0],R?R[0]:n,"minutes")},nextSlot:function(F){var _=w[Math.min(w.indexOf(F)+1,w.length-1)];return _===F&&(_=i.add(F,r,"minutes")),_},closestSlotToPosition:function(F){var _=Math.min(w.length-1,Math.max(0,Math.floor(F*g)));return w[_]},closestSlotFromPoint:function(F,_){var R=Math.abs(_.top-_.bottom);return this.closestSlotToPosition((F.y-_.top)/R)},closestSlotFromDate:function(F){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(i.lt(F,t,"minutes"))return w[0];if(i.gt(F,n,"minutes"))return w[w.length-1];var R=i.diff(t,F,"minutes");return w[(R-R%r)/r+_]},startsBeforeDay:function(F){return i.lt(F,t,"day")},startsAfterDay:function(F){return i.gt(F,n,"day")},startsBefore:function(F){return i.lt(i.merge(t,F),t,"minutes")},startsAfter:function(F){return i.gt(i.merge(n,F),n,"minutes")},getRange:function(F,_,R,j){R||(F=i.min(n,i.max(t,F))),j||(_=i.min(n,i.max(t,_)));var z=I(F),q=I(_),$=q>r*g&&!i.eq(n,_)?(z-r)/(r*g)*100:z/(r*g)*100;return{top:$,height:q/(r*g)*100-$,start:I(F),startDate:F,end:I(_),endDate:_}},getCurrentTimePosition:function(F){var _=I(F),R=_/(r*g)*100;return R}}}var eG=function(){function e(t,n){var r=n.accessors,o=n.slotMetrics;sr(this,e);var i=o.getRange(r.start(t),r.end(t)),s=i.start,c=i.startDate,d=i.end,h=i.endDate,g=i.top,m=i.height;this.start=s,this.end=d,this.startMs=+c,this.endMs=+h,this.top=g,this.height=m,this.data=t}return lr(e,[{key:"_width",get:function(){if(this.rows){var n=this.rows.reduce(function(o,i){return Math.max(o,i.leaves.length+1)},0)+1;return 100/n}if(this.leaves){var r=100-this.container._width;return r/(this.leaves.length+1)}return this.row._width}},{key:"width",get:function(){var n=this._width,r=Math.min(100,this._width*1.7);if(this.rows)return r;if(this.leaves)return this.leaves.length>0?r:n;var o=this.row.leaves,i=o.indexOf(this);return i===o.length-1?n:r}},{key:"xOffset",get:function(){if(this.rows)return 0;if(this.leaves)return this.container._width;var n=this.row,r=n.leaves,o=n.xOffset,i=n._width,s=r.indexOf(this)+1;return o+s*i}}]),e}();function tG(e,t,n){return Math.abs(t.start-e.start)<n||t.start>e.start&&t.start<e.end}function nG(e){for(var t=NU(e,["startMs",function(c){return-c.endMs}]),n=[];t.length>0;){var r=t.shift();n.push(r);for(var o=0;o<t.length;o++){var i=t[o];if(!(r.endMs>i.startMs)){if(o>0){var s=t.splice(o,1)[0];n.push(s)}break}}}return n}function S4(e){for(var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,o=e.accessors,i=t.map(function(g){return new eG(g,{slotMetrics:r,accessors:o})}),s=nG(i),c=[],d=function(){var m=s[h],w=c.find(function(E){return E.end>m.start||Math.abs(m.start-E.start)<n});if(!w)return m.rows=[],c.push(m),1;m.container=w;for(var b=null,T=w.rows.length-1;!b&&T>=0;T--)tG(w.rows[T],m,n)&&(b=w.rows[T]);b?(b.leaves.push(m),m.row=b):(m.leaves=[],w.rows.push(m))},h=0;h<s.length;h++)d();return s.map(function(g){return{event:g.data,style:{top:g.top,height:g.height,width:g.width,xOffset:Math.max(0,g.xOffset)}}})}function E4(e,t,n){for(var r=0;r<e.friends.length;++r)if(!(n.indexOf(e.friends[r])>-1)){t=t>e.friends[r].idx?t:e.friends[r].idx,n.push(e.friends[r]);var o=E4(e.friends[r],t,n);t=t>o?t:o}return t}function rG(e){var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,o=e.accessors,i=S4({events:t,minimumStartDifference:n,slotMetrics:r,accessors:o});i.sort(function(pe,fe){return pe=pe.style,fe=fe.style,pe.top!==fe.top?pe.top>fe.top?1:-1:pe.height!==fe.height?pe.top+pe.height<fe.top+fe.height?1:-1:0});for(var s=0;s<i.length;++s)i[s].friends=[],delete i[s].style.left,delete i[s].style.left,delete i[s].idx,delete i[s].size;for(var c=0;c<i.length-1;++c)for(var d=i[c],h=d.style.top,g=d.style.top+d.style.height,m=c+1;m<i.length;++m){var w=i[m],b=w.style.top,T=w.style.top+w.style.height;(b>=h&&T<=g||T>h&&T<=g||b>=h&&b<g)&&(d.friends.push(w),w.friends.push(d))}for(var E=0;E<i.length;++E){for(var k=i[E],C=[],I=0;I<100;++I)C.push(1);for(var B=0;B<k.friends.length;++B)k.friends[B].idx!==void 0&&(C[k.friends[B].idx]=0);k.idx=C.indexOf(1)}for(var F=0;F<i.length;++F){var _=0;if(!i[F].size){var R=[],j=E4(i[F],0,R);_=100/(j+1),i[F].size=_;for(var z=0;z<R.length;++z)R[z].size=_}}for(var q=0;q<i.length;++q){var $=i[q];$.style.left=$.idx*$.size;for(var J=0,ae=0;ae<$.friends.length;++ae){var ie=$.friends[ae].idx;J=J>ie?J:ie}J<=$.idx&&($.size=100-$.idx*$.size);var ge=$.idx===0?0:3;$.style.width="calc(".concat($.size,"% - ").concat(ge,"px)"),$.style.height="calc(".concat($.style.height,"% - 2px)"),$.style.xOffset="calc(".concat($.style.left,"% + ").concat(ge,"px)")}return i}var i2={overlap:S4,"no-overlap":rG};function oG(e){return!!(e&&e.constructor&&e.call&&e.apply)}function aG(e){e.events,e.minimumStartDifference,e.slotMetrics,e.accessors;var t=e.dayLayoutAlgorithm,n=t;return t in i2&&(n=i2[t]),oG(n)?n.apply(this,arguments):[]}var T4=function(e){Kr(t,e);function t(){return sr(this,t),Gr(this,t,arguments)}return lr(t,[{key:"render",value:function(){var r=this.props,o=r.renderSlot,i=r.resource,s=r.group,c=r.getters,d=r.components,h=d===void 0?{}:d,g=h.timeSlotWrapper,m=g===void 0?rs:g,w=c?c.slotGroupProp(s):{};return Q.createElement("div",Object.assign({className:"rbc-timeslot-group"},w),s.map(function(b,T){var E=c?c.slotProp(b,i):{};return Q.createElement(m,{key:T,value:b,resource:i},Q.createElement("div",Object.assign({},E,{className:$n("rbc-time-slot",E.className)}),o&&o(b,T)))}))}}]),t}(A.Component);function Mg(e){return typeof e=="string"?e:e+"%"}function iG(e){var t=e.style,n=e.className,r=e.event,o=e.accessors,i=e.rtl,s=e.selected,c=e.label,d=e.continuesPrior,h=e.continuesAfter,g=e.getters,m=e.onClick,w=e.onDoubleClick,b=e.isBackgroundEvent,T=e.onKeyPress,E=e.components,k=E.event,C=E.eventWrapper,I=o.title(r),B=o.tooltip(r),F=o.end(r),_=o.start(r),R=g.eventProp(r,_,F,s),j=[Q.createElement("div",{key:"1",className:"rbc-event-label"},c),Q.createElement("div",{key:"2",className:"rbc-event-content"},k?Q.createElement(k,{event:r,title:I}):I)],z=t.height,q=t.top,$=t.width,J=t.xOffset,ae=Xt(Xt({},R.style),{},yu({top:Mg(q),height:Mg(z),width:Mg($)},i?"right":"left",Mg(J)));return Q.createElement(C,Object.assign({type:"time"},e),Q.createElement("div",{role:"button",tabIndex:0,onClick:m,onDoubleClick:w,style:ae,onKeyDown:T,title:B?(typeof c=="string"?c+": ":"")+B:void 0,className:$n(b?"rbc-background-event":"rbc-event",n,R.className,{"rbc-selected":s,"rbc-event-continues-earlier":d,"rbc-event-continues-later":h})},j))}var sG=function(t){var n=t.children,r=t.className,o=t.style,i=t.innerRef;return Q.createElement("div",{className:r,style:o,ref:i},n)},lG=Q.forwardRef(function(e,t){return Q.createElement(sG,Object.assign({},e,{innerRef:t}))}),uG=["dayProp"],cG=["eventContainerWrapper"],C4=function(e){Kr(t,e);function t(){var n;sr(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=Gr(this,t,[].concat(o)),n.state={selecting:!1,timeIndicatorPosition:null},n.intervalTriggered=!1,n.renderEvents=function(s){var c=s.events,d=s.isBackgroundEvent,h=n.props,g=h.rtl,m=h.selected,w=h.accessors,b=h.localizer,T=h.getters,E=h.components,k=h.step,C=h.timeslots,I=h.dayLayoutAlgorithm,B=h.resizable,F=eT(n),_=F.slotMetrics,R=b.messages,j=aG({events:c,accessors:w,slotMetrics:_,minimumStartDifference:Math.ceil(k*C/2),dayLayoutAlgorithm:I});return j.map(function(z,q){var $=z.event,J=z.style,ae=w.end($),ie=w.start($),ge="eventTimeRangeFormat",pe,fe=_.startsBeforeDay(ie),De=_.startsAfterDay(ae);fe?ge="eventTimeRangeEndFormat":De&&(ge="eventTimeRangeStartFormat"),fe&&De?pe=R.allDay:pe=b.format({start:ie,end:ae},ge);var re=fe||_.startsBefore(ie),be=De||_.startsAfter(ae);return Q.createElement(iG,{style:J,event:$,label:pe,key:"evt_"+q,getters:T,rtl:g,components:E,continuesPrior:re,continuesAfter:be,accessors:w,resource:n.props.resource,selected:Zv($,m),onClick:function(G){return n._select(Xt(Xt(Xt({},$),n.props.resource&&{sourceResource:n.props.resource}),d&&{isBackgroundEvent:!0}),G)},onDoubleClick:function(G){return n._doubleClick($,G)},isBackgroundEvent:d,onKeyPress:function(G){return n._keyPress($,G)},resizable:B})})},n._selectable=function(){var s=n.containerRef.current,c=n.props,d=c.longPressThreshold,h=c.localizer,g=n._selector=new h4(function(){return s},{longPressThreshold:d}),m=function(E){var k=n.props.onSelecting,C=n.state||{},I=w(E),B=I.startDate,F=I.endDate;k&&(h.eq(C.startDate,B,"minutes")&&h.eq(C.endDate,F,"minutes")||k({start:B,end:F,resourceId:n.props.resource})===!1)||(n.state.start!==I.start||n.state.end!==I.end||n.state.selecting!==I.selecting)&&n.setState(I)},w=function(E){var k=n.slotMetrics.closestSlotFromPoint(E,Iu(s));n.state.selecting||(n._initialSlot=k);var C=n._initialSlot;h.lte(C,k)?k=n.slotMetrics.nextSlot(k):h.gt(C,k)&&(C=n.slotMetrics.nextSlot(C));var I=n.slotMetrics.getRange(h.min(C,k),h.max(C,k));return Xt(Xt({},I),{},{selecting:!0,top:"".concat(I.top,"%"),height:"".concat(I.height,"%")})},b=function(E,k){if(!gv(n.containerRef.current,E)){var C=w(E),I=C.startDate,B=C.endDate;n._selectSlot({startDate:I,endDate:B,action:k,box:E})}n.setState({selecting:!1})};g.on("selecting",m),g.on("selectStart",m),g.on("beforeSelect",function(T){if(n.props.selectable==="ignoreEvents")return!gv(n.containerRef.current,T)}),g.on("click",function(T){return b(T,"click")}),g.on("doubleClick",function(T){return b(T,"doubleClick")}),g.on("select",function(T){n.state.selecting&&(n._selectSlot(Xt(Xt({},n.state),{},{action:"select",bounds:T})),n.setState({selecting:!1}))}),g.on("reset",function(){n.state.selecting&&n.setState({selecting:!1})})},n._teardownSelectable=function(){n._selector&&(n._selector.teardown(),n._selector=null)},n._selectSlot=function(s){for(var c=s.startDate,d=s.endDate,h=s.action,g=s.bounds,m=s.box,w=c,b=[];n.props.localizer.lte(w,d);)b.push(w),w=new Date(+w+n.props.step*60*1e3);hn(n.props.onSelectSlot,{slots:b,start:c,end:d,resourceId:n.props.resource,action:h,bounds:g,box:m})},n._select=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];hn(n.props.onSelectEvent,c)},n._doubleClick=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];hn(n.props.onDoubleClickEvent,c)},n._keyPress=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];hn(n.props.onKeyPressEvent,c)},n.slotMetrics=Kw(n.props),n.containerRef=A.createRef(),n}return lr(t,[{key:"componentDidMount",value:function(){this.props.selectable&&this._selectable(),this.props.isNow&&this.setTimeIndicatorPositionUpdateInterval()}},{key:"componentWillUnmount",value:function(){this._teardownSelectable(),this.clearTimeIndicatorInterval()}},{key:"componentDidUpdate",value:function(r,o){this.props.selectable&&!r.selectable&&this._selectable(),!this.props.selectable&&r.selectable&&this._teardownSelectable(),this.slotMetrics=this.slotMetrics.update(this.props);var i=this.props,s=i.getNow,c=i.isNow,d=i.localizer,h=i.date,g=i.min,m=i.max,w=d.neq(r.getNow(),s(),"minutes");if(r.isNow!==c||w){if(this.clearTimeIndicatorInterval(),c){var b=!w&&d.eq(r.date,h,"minutes")&&o.timeIndicatorPosition===this.state.timeIndicatorPosition;this.setTimeIndicatorPositionUpdateInterval(b)}}else c&&(d.neq(r.min,g,"minutes")||d.neq(r.max,m,"minutes"))&&this.positionTimeIndicator()}},{key:"setTimeIndicatorPositionUpdateInterval",value:function(){var r=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;!this.intervalTriggered&&!o&&this.positionTimeIndicator(),this._timeIndicatorTimeout=window.setTimeout(function(){r.intervalTriggered=!0,r.positionTimeIndicator(),r.setTimeIndicatorPositionUpdateInterval()},6e4)}},{key:"clearTimeIndicatorInterval",value:function(){this.intervalTriggered=!1,window.clearTimeout(this._timeIndicatorTimeout)}},{key:"positionTimeIndicator",value:function(){var r=this.props,o=r.min,i=r.max,s=r.getNow,c=s();if(c>=o&&c<=i){var d=this.slotMetrics.getCurrentTimePosition(c);this.intervalTriggered=!0,this.setState({timeIndicatorPosition:d})}else this.clearTimeIndicatorInterval()}},{key:"render",value:function(){var r=this.props,o=r.date,i=r.max,s=r.rtl,c=r.isNow,d=r.resource,h=r.accessors,g=r.localizer,m=r.getters,w=m.dayProp,b=Ci(m,uG),T=r.components,E=T.eventContainerWrapper,k=Ci(T,cG),C=this.slotMetrics,I=this.state,B=I.selecting,F=I.top,_=I.height,R=I.startDate,j=I.endDate,z={start:R,end:j},q=w(i),$=q.className,J=q.style,ae=k.dayColumnWrapper||lG;return Q.createElement(ae,{ref:this.containerRef,date:o,style:J,className:$n($,"rbc-day-slot","rbc-time-column",c&&"rbc-now",c&&"rbc-today",B&&"rbc-slot-selecting"),slotMetrics:C},C.groups.map(function(ie,ge){return Q.createElement(T4,{key:ge,group:ie,resource:d,getters:b,components:k})}),Q.createElement(E,{localizer:g,resource:d,accessors:h,getters:b,components:k,slotMetrics:C},Q.createElement("div",{className:$n("rbc-events-container",s&&"rtl")},this.renderEvents({events:this.props.backgroundEvents,isBackgroundEvent:!0}),this.renderEvents({events:this.props.events}))),B&&Q.createElement("div",{className:"rbc-slot-selection",style:{top:F,height:_}},Q.createElement("span",null,g.format(z,"selectRangeFormat"))),c&&this.intervalTriggered&&Q.createElement("div",{className:"rbc-current-time-indicator",style:{top:"".concat(this.state.timeIndicatorPosition,"%")}}))}}]),t}(Q.Component);C4.defaultProps={dragThroughEvents:!0,timeslots:2};function fG(e){var t=e.min,n=e.max,r=e.localizer;return r.getTimezoneOffset(t)!==r.getTimezoneOffset(n)?{start:r.add(t,-1,"day"),end:r.add(n,-1,"day")}:{start:t,end:n}}var dG=function(t){var n=t.min,r=t.max,o=t.timeslots,i=t.step,s=t.localizer,c=t.getNow,d=t.resource,h=t.components,g=t.getters,m=t.gutterRef,w=h.timeGutterWrapper,b=A.useMemo(function(){return fG({min:n,max:r,localizer:s})},[n==null?void 0:n.toISOString(),r==null?void 0:r.toISOString(),s]),T=b.start,E=b.end,k=A.useState(Kw({min:T,max:E,timeslots:o,step:i,localizer:s})),C=as(k,2),I=C[0],B=C[1];A.useEffect(function(){I&&B(I.update({min:T,max:E,timeslots:o,step:i,localizer:s}))},[T==null?void 0:T.toISOString(),E==null?void 0:E.toISOString(),o,i]);var F=A.useCallback(function(_,R){if(R)return null;var j=I.dateIsInGroup(c(),R);return Q.createElement("span",{className:$n("rbc-label",j&&"rbc-now")},s.format(_,"timeGutterFormat"))},[I,s,c]);return Q.createElement(w,{slotMetrics:I},Q.createElement("div",{className:"rbc-time-gutter rbc-time-column",ref:m},I.groups.map(function(_,R){return Q.createElement(T4,{key:R,group:_,resource:d,components:h,renderSlot:F,getters:g})})))},pG=Q.forwardRef(function(e,t){return Q.createElement(dG,Object.assign({gutterRef:t},e))}),hG=function(t){var n=t.label;return Q.createElement(Q.Fragment,null,n)},mG=function(e){Kr(t,e);function t(){var n;sr(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=Gr(this,t,[].concat(o)),n.handleHeaderClick=function(s,c,d){d.preventDefault(),hn(n.props.onDrillDown,[s,c])},n.renderRow=function(s){var c=n.props,d=c.events,h=c.rtl,g=c.selectable,m=c.getNow,w=c.range,b=c.getters,T=c.localizer,E=c.accessors,k=c.components,C=c.resizable,I=E.resourceId(s),B=s?d.filter(function(F){return E.resource(F)===I}):d;return Q.createElement(vv,{isAllDay:!0,rtl:h,getNow:m,minRows:2,maxRows:n.props.allDayMaxRows+1,range:w,events:B,resourceId:I,className:"rbc-allday-cell",selectable:g,selected:n.props.selected,components:k,accessors:E,getters:b,localizer:T,onSelect:n.props.onSelectEvent,onShowMore:n.props.onShowMore,onDoubleClick:n.props.onDoubleClickEvent,onKeyPress:n.props.onKeyPressEvent,onSelectSlot:n.props.onSelectSlot,longPressThreshold:n.props.longPressThreshold,resizable:C})},n}return lr(t,[{key:"renderHeaderCells",value:function(r){var o=this,i=this.props,s=i.localizer,c=i.getDrilldownView,d=i.getNow,h=i.getters.dayProp,g=i.components.header,m=g===void 0?D4:g,w=d();return r.map(function(b,T){var E=c(b),k=s.format(b,"dayFormat"),C=h(b),I=C.className,B=C.style,F=Q.createElement(m,{date:b,label:k,localizer:s});return Q.createElement("div",{key:T,style:B,className:$n("rbc-header",I,s.isSameDate(b,w)&&"rbc-today")},E?Q.createElement("button",{type:"button",className:"rbc-button-link",onClick:function(R){return o.handleHeaderClick(b,E,R)}},F):Q.createElement("span",null,F))})}},{key:"render",value:function(){var r=this,o=this.props,i=o.width,s=o.rtl,c=o.resources,d=o.range,h=o.events,g=o.getNow,m=o.accessors,w=o.selectable,b=o.components,T=o.getters,E=o.scrollRef,k=o.localizer,C=o.isOverflowing,I=o.components,B=I.timeGutterHeader,F=I.resourceHeader,_=F===void 0?hG:F,R=o.resizable,j={};C&&(j[s?"marginLeft":"marginRight"]="".concat(MT()-1,"px"));var z=c.groupEvents(h);return Q.createElement("div",{style:j,ref:E,className:$n("rbc-time-header",C&&"rbc-overflowing")},Q.createElement("div",{className:"rbc-label rbc-time-header-gutter",style:{width:i,minWidth:i,maxWidth:i}},B&&Q.createElement(B,null)),c.map(function(q,$){var J=as(q,2),ae=J[0],ie=J[1];return Q.createElement("div",{className:"rbc-time-header-content",key:ae||$},ie&&Q.createElement("div",{className:"rbc-row rbc-row-resource",key:"resource_".concat($)},Q.createElement("div",{className:"rbc-header"},Q.createElement(_,{index:$,label:m.resourceTitle(ie),resource:ie}))),Q.createElement("div",{className:"rbc-row rbc-time-header-cell".concat(d.length<=1?" rbc-time-header-cell-single-day":"")},r.renderHeaderCells(d)),Q.createElement(vv,{isAllDay:!0,rtl:s,getNow:g,minRows:2,maxRows:r.props.allDayMaxRows+1,range:d,events:z.get(ae)||[],resourceId:ie&&ae,className:"rbc-allday-cell",selectable:w,selected:r.props.selected,components:b,accessors:m,getters:T,localizer:k,onSelect:r.props.onSelectEvent,onShowMore:r.props.onShowMore,onDoubleClick:r.props.onDoubleClickEvent,onKeyDown:r.props.onKeyPressEvent,onSelectSlot:r.props.onSelectSlot,longPressThreshold:r.props.longPressThreshold,resizable:R}))}))}}]),t}(Q.Component),j0={};function gG(e,t){return{map:function(r){return e?e.map(function(o,i){return r([t.resourceId(o),o],i)}):[r([j0,null],0)]},groupEvents:function(r){var o=new Map;return e?(r.forEach(function(i){var s=t.resource(i)||j0;if(Array.isArray(s))s.forEach(function(d){var h=o.get(d)||[];h.push(i),o.set(d,h)});else{var c=o.get(s)||[];c.push(i),o.set(s,c)}}),o):(o.set(j0,r),o)}}}var Xf=function(e){Kr(t,e);function t(n){var r;return sr(this,t),r=Gr(this,t,[n]),r.handleScroll=function(o){r.scrollRef.current&&(r.scrollRef.current.scrollLeft=o.target.scrollLeft)},r.handleResize=function(){eS(r.rafHandle),r.rafHandle=xT(r.checkOverflow)},r.handleKeyPressEvent=function(){r.clearSelection();for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];hn(r.props.onKeyPressEvent,i)},r.handleSelectEvent=function(){r.clearSelection();for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];hn(r.props.onSelectEvent,i)},r.handleDoubleClickEvent=function(){r.clearSelection();for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];hn(r.props.onDoubleClickEvent,i)},r.handleShowMore=function(o,i,s,c,d){var h=r.props,g=h.popup,m=h.onDrillDown,w=h.onShowMore,b=h.getDrilldownView,T=h.doShowMoreDrillDown;if(r.clearSelection(),g){var E=CT(s,r.containerRef.current);r.setState({overlay:{date:i,events:o,position:Xt(Xt({},E),{},{width:"200px"}),target:d}})}else T&&hn(m,[i,b(i)||qr.DAY]);hn(w,[o,i,c])},r.handleSelectAllDaySlot=function(o,i){var s=r.props.onSelectSlot,c=new Date(o[0]),d=new Date(o[o.length-1]);d.setDate(o[o.length-1].getDate()+1),hn(s,{slots:o,start:c,end:d,action:i.action,resourceId:i.resourceId})},r.overlayDisplay=function(){r.setState({overlay:null})},r.checkOverflow=function(){if(!r._updatingOverflow){var o=r.contentRef.current;if(o!=null&&o.scrollHeight){var i=o.scrollHeight>o.clientHeight;r.state.isOverflowing!==i&&(r._updatingOverflow=!0,r.setState({isOverflowing:i},function(){r._updatingOverflow=!1}))}}},r.memoizedResources=zT(function(o,i){return gG(o,i)}),r.state={gutterWidth:void 0,isOverflowing:null},r.scrollRef=Q.createRef(),r.contentRef=Q.createRef(),r.containerRef=Q.createRef(),r._scrollRatio=null,r.gutterRef=A.createRef(),r}return lr(t,[{key:"getSnapshotBeforeUpdate",value:function(){return this.checkOverflow(),null}},{key:"componentDidMount",value:function(){this.props.width==null&&this.measureGutter(),this.calculateScroll(),this.applyScroll(),window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize),eS(this.rafHandle),this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest)}},{key:"componentDidUpdate",value:function(){this.applyScroll()}},{key:"renderEvents",value:function(r,o,i,s){var c=this,d=this.props,h=d.min,g=d.max,m=d.components,w=d.accessors,b=d.localizer,T=d.dayLayoutAlgorithm,E=this.memoizedResources(this.props.resources,w),k=E.groupEvents(o),C=E.groupEvents(i);return E.map(function(I,B){var F=as(I,2),_=F[0],R=F[1];return r.map(function(j,z){var q=(k.get(_)||[]).filter(function(J){return b.inRange(j,w.start(J),w.end(J),"day")}),$=(C.get(_)||[]).filter(function(J){return b.inRange(j,w.start(J),w.end(J),"day")});return Q.createElement(C4,Object.assign({},c.props,{localizer:b,min:b.merge(j,h),max:b.merge(j,g),resource:R&&_,components:m,isNow:b.isSameDate(j,s),key:B+"-"+z,date:j,events:q,backgroundEvents:$,dayLayoutAlgorithm:T}))})})}},{key:"render",value:function(){var r,o=this.props,i=o.events,s=o.backgroundEvents,c=o.range,d=o.width,h=o.rtl,g=o.selected,m=o.getNow,w=o.resources,b=o.components,T=o.accessors,E=o.getters,k=o.localizer,C=o.min,I=o.max,B=o.showMultiDayTimes,F=o.longPressThreshold,_=o.resizable;d=d||this.state.gutterWidth;var R=c[0],j=c[c.length-1];this.slots=c.length;var z=[],q=[],$=[];return i.forEach(function(J){if(lh(J,R,j,T,k)){var ae=T.start(J),ie=T.end(J);T.allDay(J)||k.startAndEndAreDateOnly(ae,ie)||!B&&!k.isSameDate(ae,ie)?z.push(J):q.push(J)}}),s.forEach(function(J){lh(J,R,j,T,k)&&$.push(J)}),z.sort(function(J,ae){return R1(J,ae,T,k)}),Q.createElement("div",{className:$n("rbc-time-view",w&&"rbc-time-view-resources"),ref:this.containerRef},Q.createElement(mG,{range:c,events:z,width:d,rtl:h,getNow:m,localizer:k,selected:g,allDayMaxRows:this.props.showAllEvents?1/0:(r=this.props.allDayMaxRows)!==null&&r!==void 0?r:1/0,resources:this.memoizedResources(w,T),selectable:this.props.selectable,accessors:T,getters:E,components:b,scrollRef:this.scrollRef,isOverflowing:this.state.isOverflowing,longPressThreshold:F,onSelectSlot:this.handleSelectAllDaySlot,onSelectEvent:this.handleSelectEvent,onShowMore:this.handleShowMore,onDoubleClickEvent:this.props.onDoubleClickEvent,onKeyPressEvent:this.props.onKeyPressEvent,onDrillDown:this.props.onDrillDown,getDrilldownView:this.props.getDrilldownView,resizable:_}),this.props.popup&&this.renderOverlay(),Q.createElement("div",{ref:this.contentRef,className:"rbc-time-content",onScroll:this.handleScroll},Q.createElement(pG,{date:R,ref:this.gutterRef,localizer:k,min:k.merge(R,C),max:k.merge(R,I),step:this.props.step,getNow:this.props.getNow,timeslots:this.props.timeslots,components:b,className:"rbc-time-gutter",getters:E}),this.renderEvents(c,q,$,m())))}},{key:"renderOverlay",value:function(){var r,o,i=this,s=(r=(o=this.state)===null||o===void 0?void 0:o.overlay)!==null&&r!==void 0?r:{},c=this.props,d=c.accessors,h=c.localizer,g=c.components,m=c.getters,w=c.selected,b=c.popupOffset,T=c.handleDragStart,E=function(){return i.setState({overlay:null})};return Q.createElement(Gw,{overlay:s,accessors:d,localizer:h,components:g,getters:m,selected:w,popupOffset:b,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:T,show:!!s.position,overlayDisplay:this.overlayDisplay,onHide:E})}},{key:"clearSelection",value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}},{key:"measureGutter",value:function(){var r=this;this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest),this.measureGutterAnimationFrameRequest=window.requestAnimationFrame(function(){var o,i=(o=r.gutterRef)!==null&&o!==void 0&&o.current?A1(r.gutterRef.current):void 0;i&&r.state.gutterWidth!==i&&r.setState({gutterWidth:i})})}},{key:"applyScroll",value:function(){if(this._scrollRatio!=null&&this.props.enableAutoScroll===!0){var r=this.contentRef.current;r.scrollTop=r.scrollHeight*this._scrollRatio,this._scrollRatio=null}}},{key:"calculateScroll",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,o=r.min,i=r.max,s=r.scrollToTime,c=r.localizer,d=c.diff(c.merge(s,o),s,"milliseconds"),h=c.diff(o,i,"milliseconds");this._scrollRatio=d/h}}]),t}(A.Component);Xf.defaultProps={step:30,timeslots:2};var vG=["date","localizer","min","max","scrollToTime","enableAutoScroll"],Xv=function(e){Kr(t,e);function t(){return sr(this,t),Gr(this,t,arguments)}return lr(t,[{key:"render",value:function(){var r=this.props,o=r.date,i=r.localizer,s=r.min,c=s===void 0?i.startOf(new Date,"day"):s,d=r.max,h=d===void 0?i.endOf(new Date,"day"):d,g=r.scrollToTime,m=g===void 0?i.startOf(new Date,"day"):g,w=r.enableAutoScroll,b=w===void 0?!0:w,T=Ci(r,vG),E=t.range(o,{localizer:i});return Q.createElement(Xf,Object.assign({},T,{range:E,eventOffset:10,localizer:i,min:c,max:h,scrollToTime:m,enableAutoScroll:b}))}}]),t}(Q.Component);Xv.range=function(e,t){var n=t.localizer;return[n.startOf(e,"day")]};Xv.navigate=function(e,t,n){var r=n.localizer;switch(t){case vo.PREVIOUS:return r.add(e,-1,"day");case vo.NEXT:return r.add(e,1,"day");default:return e}};Xv.title=function(e,t){var n=t.localizer;return n.format(e,"dayHeaderFormat")};var yG=["date","localizer","min","max","scrollToTime","enableAutoScroll"],gl=function(e){Kr(t,e);function t(){return sr(this,t),Gr(this,t,arguments)}return lr(t,[{key:"render",value:function(){var r=this.props,o=r.date,i=r.localizer,s=r.min,c=s===void 0?i.startOf(new Date,"day"):s,d=r.max,h=d===void 0?i.endOf(new Date,"day"):d,g=r.scrollToTime,m=g===void 0?i.startOf(new Date,"day"):g,w=r.enableAutoScroll,b=w===void 0?!0:w,T=Ci(r,yG),E=t.range(o,this.props);return Q.createElement(Xf,Object.assign({},T,{range:E,eventOffset:15,localizer:i,min:c,max:h,scrollToTime:m,enableAutoScroll:b}))}}]),t}(Q.Component);gl.defaultProps=Xf.defaultProps;gl.navigate=function(e,t,n){var r=n.localizer;switch(t){case vo.PREVIOUS:return r.add(e,-1,"week");case vo.NEXT:return r.add(e,1,"week");default:return e}};gl.range=function(e,t){var n=t.localizer,r=n.startOfWeek(),o=n.startOf(e,"week",r),i=n.endOf(e,"week",r);return n.range(o,i)};gl.title=function(e,t){var n=t.localizer,r=gl.range(e,{localizer:n}),o=ZT(r),i=o[0],s=o.slice(1);return n.format({start:i,end:s.pop()},"dayRangeHeaderFormat")};var wG=["date","localizer","min","max","scrollToTime","enableAutoScroll"];function Qw(e,t){return gl.range(e,t).filter(function(n){return[6,0].indexOf(n.getDay())===-1})}var Ph=function(e){Kr(t,e);function t(){return sr(this,t),Gr(this,t,arguments)}return lr(t,[{key:"render",value:function(){var r=this.props,o=r.date,i=r.localizer,s=r.min,c=s===void 0?i.startOf(new Date,"day"):s,d=r.max,h=d===void 0?i.endOf(new Date,"day"):d,g=r.scrollToTime,m=g===void 0?i.startOf(new Date,"day"):g,w=r.enableAutoScroll,b=w===void 0?!0:w,T=Ci(r,wG),E=Qw(o,this.props);return Q.createElement(Xf,Object.assign({},T,{range:E,eventOffset:15,localizer:i,min:c,max:h,scrollToTime:m,enableAutoScroll:b}))}}]),t}(Q.Component);Ph.defaultProps=Xf.defaultProps;Ph.range=Qw;Ph.navigate=gl.navigate;Ph.title=function(e,t){var n=t.localizer,r=Qw(e,{localizer:n}),o=ZT(r),i=o[0],s=o.slice(1);return n.format({start:i,end:s.pop()},"dayRangeHeaderFormat")};function vl(e){var t=e.accessors,n=e.components,r=e.date,o=e.events,i=e.getters,s=e.length,c=e.localizer,d=e.onDoubleClickEvent,h=e.onSelectEvent,g=e.selected,m=A.useRef(null),w=A.useRef(null),b=A.useRef(null),T=A.useRef(null),E=A.useRef(null);A.useEffect(function(){I()});var k=function(j,z,q){var $=n.event,J=n.date;return z=z.filter(function(ae){return lh(ae,c.startOf(j,"day"),c.endOf(j,"day"),t,c)}),z.map(function(ae,ie){var ge=t.title(ae),pe=t.end(ae),fe=t.start(ae),De=i.eventProp(ae,fe,pe,Zv(ae,g)),re=ie===0&&c.format(j,"agendaDateFormat"),be=ie===0?Q.createElement("td",{rowSpan:z.length,className:"rbc-agenda-date-cell"},J?Q.createElement(J,{day:j,label:re}):re):!1;return Q.createElement("tr",{key:q+"_"+ie,className:De.className,style:De.style},be,Q.createElement("td",{className:"rbc-agenda-time-cell"},C(j,ae)),Q.createElement("td",{className:"rbc-agenda-event-cell",onClick:function(G){return h&&h(ae,G)},onDoubleClick:function(G){return d&&d(ae,G)}},$?Q.createElement($,{event:ae,title:ge}):ge))},[])},C=function(j,z){var q="",$=n.time,J=c.messages.allDay,ae=t.end(z),ie=t.start(z);return t.allDay(z)||(c.eq(ie,ae)?J=c.format(ie,"agendaTimeFormat"):c.isSameDate(ie,ae)?J=c.format({start:ie,end:ae},"agendaTimeRangeFormat"):c.isSameDate(j,ie)?J=c.format(ie,"agendaTimeFormat"):c.isSameDate(j,ae)&&(J=c.format(ae,"agendaTimeFormat"))),c.gt(j,ie,"day")&&(q="rbc-continues-prior"),c.lt(j,ae,"day")&&(q+=" rbc-continues-after"),Q.createElement("span",{className:q.trim()},$?Q.createElement($,{event:z,day:j,label:J}):J)},I=function(){if(E.current){var j=m.current,z=E.current.firstChild;if(z){var q=T.current.scrollHeight>T.current.clientHeight,$=[],J=$;$=[A1(z.children[0]),A1(z.children[1])],(J[0]!==$[0]||J[1]!==$[1])&&(w.current.style.width=$[0]+"px",b.current.style.width=$[1]+"px"),q?(wO(j,"rbc-header-overflowing"),j.style.marginRight=MT()+"px"):bO(j,"rbc-header-overflowing")}}},B=c.messages,F=c.add(r,s,"day"),_=c.range(r,F,"day");return o=o.filter(function(R){return lh(R,c.startOf(r,"day"),c.endOf(F,"day"),t,c)}),o.sort(function(R,j){return+t.start(R)-+t.start(j)}),Q.createElement("div",{className:"rbc-agenda-view"},o.length!==0?Q.createElement(Q.Fragment,null,Q.createElement("table",{ref:m,className:"rbc-agenda-table"},Q.createElement("thead",null,Q.createElement("tr",null,Q.createElement("th",{className:"rbc-header",ref:w},B.date),Q.createElement("th",{className:"rbc-header",ref:b},B.time),Q.createElement("th",{className:"rbc-header"},B.event)))),Q.createElement("div",{className:"rbc-agenda-content",ref:T},Q.createElement("table",{className:"rbc-agenda-table"},Q.createElement("tbody",{ref:E},_.map(function(R,j){return k(R,o,j)}))))):Q.createElement("span",{className:"rbc-agenda-empty"},B.noEventsInRange))}vl.defaultProps={length:30};vl.range=function(e,t){var n=t.length,r=n===void 0?vl.defaultProps.length:n,o=t.localizer,i=o.add(e,r,"day");return{start:e,end:i}};vl.navigate=function(e,t,n){var r=n.length,o=r===void 0?vl.defaultProps.length:r,i=n.localizer;switch(t){case vo.PREVIOUS:return i.add(e,-o,"day");case vo.NEXT:return i.add(e,o,"day");default:return e}};vl.title=function(e,t){var n=t.length,r=n===void 0?vl.defaultProps.length:n,o=t.localizer,i=o.add(e,r,"day");return o.format({start:e,end:i},"agendaHeaderFormat")};var Wg=yu(yu(yu(yu(yu({},qr.MONTH,Jv),qr.WEEK,gl),qr.WORK_WEEK,Ph),qr.DAY,Xv),qr.AGENDA,vl),bG=["action","date","today"];function DG(e,t){var n=t.action,r=t.date,o=t.today,i=Ci(t,bG);switch(e=typeof e=="string"?Wg[e]:e,n){case vo.TODAY:r=o||new Date;break;case vo.DATE:break;default:Jp(e&&typeof e.navigate=="function","Calendar View components must implement a static `.navigate(date, action)` method.s"),r=e.navigate(r,n,i)}return r}var SG=function(e){Kr(t,e);function t(){var n;sr(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=Gr(this,t,[].concat(o)),n.navigate=function(s){n.props.onNavigate(s)},n.view=function(s){n.props.onView(s)},n}return lr(t,[{key:"render",value:function(){var r=this.props,o=r.localizer.messages,i=r.label;return Q.createElement("div",{className:"rbc-toolbar"},Q.createElement("span",{className:"rbc-btn-group"},Q.createElement("button",{type:"button",onClick:this.navigate.bind(null,vo.TODAY)},o.today),Q.createElement("button",{type:"button",onClick:this.navigate.bind(null,vo.PREVIOUS)},o.previous),Q.createElement("button",{type:"button",onClick:this.navigate.bind(null,vo.NEXT)},o.next)),Q.createElement("span",{className:"rbc-toolbar-label"},i),Q.createElement("span",{className:"rbc-btn-group"},this.viewNamesGroup(o)))}},{key:"viewNamesGroup",value:function(r){var o=this,i=this.props.views,s=this.props.view;if(i.length>1)return i.map(function(c){return Q.createElement("button",{type:"button",key:c,className:$n({"rbc-active":s===c}),onClick:o.view.bind(null,c)},r[c])})}}]),t}(Q.Component);function EG(e,t){var n=null;return typeof t=="function"?n=t(e):typeof t=="string"&&us(e)==="object"&&e!=null&&t in e&&(n=e[t]),n}var al=function(t){return function(n){return EG(n,t)}},TG=["view","date","getNow","onNavigate"],CG=["view","toolbar","events","backgroundEvents","style","className","elementProps","date","getNow","length","showMultiDayTimes","onShowMore","doShowMoreDrillDown","components","formats","messages","culture"];function x4(e){if(Array.isArray(e))return e;for(var t=[],n=0,r=Object.entries(e);n<r.length;n++){var o=as(r[n],2),i=o[0],s=o[1];s&&t.push(i)}return t}function xG(e,t){var n=t.views,r=x4(n);return r.indexOf(e)!==-1}var M4=function(e){Kr(t,e);function t(){var n;sr(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=Gr(this,t,[].concat(o)),n.getViews=function(){var s=n.props.views;return Array.isArray(s)?Zq(s,function(c,d){return c[d]=Wg[d]},{}):us(s)==="object"?rW(s,function(c,d){return c===!0?Wg[d]:c}):Wg},n.getView=function(){var s=n.getViews();return s[n.props.view]},n.getDrilldownView=function(s){var c=n.props,d=c.view,h=c.drilldownView,g=c.getDrilldownView;return g?g(s,d,Object.keys(n.getViews())):h},n.handleRangeChange=function(s,c,d){var h=n.props,g=h.onRangeChange,m=h.localizer;g&&c.range&&g(c.range(s,{localizer:m}),d)},n.handleNavigate=function(s,c){var d=n.props,h=d.view,g=d.date,m=d.getNow,w=d.onNavigate,b=Ci(d,TG),T=n.getView(),E=m();g=DG(T,Xt(Xt({},b),{},{action:s,date:c||g||E,today:E})),w(g,h,s),n.handleRangeChange(g,T)},n.handleViewChange=function(s){s!==n.props.view&&xG(s,n.props)&&n.props.onView(s);var c=n.getViews();n.handleRangeChange(n.props.date||n.props.getNow(),c[s],s)},n.handleSelectEvent=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];hn(n.props.onSelectEvent,c)},n.handleDoubleClickEvent=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];hn(n.props.onDoubleClickEvent,c)},n.handleKeyPressEvent=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];hn(n.props.onKeyPressEvent,c)},n.handleSelectSlot=function(s){hn(n.props.onSelectSlot,s)},n.handleDrillDown=function(s,c){var d=n.props.onDrillDown;if(d){d(s,c,n.drilldownView);return}c&&n.handleViewChange(c),n.handleNavigate(vo.DATE,s)},n.state={context:t.getContext(n.props)},n}return lr(t,[{key:"render",value:function(){var r=this.props,o=r.view,i=r.toolbar,s=r.events,c=r.backgroundEvents,d=r.style,h=r.className,g=r.elementProps,m=r.date,w=r.getNow,b=r.length,T=r.showMultiDayTimes,E=r.onShowMore,k=r.doShowMoreDrillDown;r.components,r.formats,r.messages,r.culture;var C=Ci(r,CG);m=m||w();var I=this.getView(),B=this.state.context,F=B.accessors,_=B.components,R=B.getters,j=B.localizer,z=B.viewNames,q=_.toolbar||SG,$=I.title(m,{localizer:j,length:b});return Q.createElement("div",Object.assign({},g,{className:$n(h,"rbc-calendar",C.rtl&&"rbc-rtl"),style:d}),i&&Q.createElement(q,{date:m,view:o,views:z,label:$,onView:this.handleViewChange,onNavigate:this.handleNavigate,localizer:j}),Q.createElement(I,Object.assign({},C,{events:s,backgroundEvents:c,date:m,getNow:w,length:b,localizer:j,getters:R,components:_,accessors:F,showMultiDayTimes:T,getDrilldownView:this.getDrilldownView,onNavigate:this.handleNavigate,onDrillDown:this.handleDrillDown,onSelectEvent:this.handleSelectEvent,onDoubleClickEvent:this.handleDoubleClickEvent,onKeyPressEvent:this.handleKeyPressEvent,onSelectSlot:this.handleSelectSlot,onShowMore:E,doShowMoreDrillDown:k})))}}],[{key:"getDerivedStateFromProps",value:function(r){return{context:t.getContext(r)}}},{key:"getContext",value:function(r){var o=r.startAccessor,i=r.endAccessor,s=r.allDayAccessor,c=r.tooltipAccessor,d=r.titleAccessor,h=r.resourceAccessor,g=r.resourceIdAccessor,m=r.resourceTitleAccessor,w=r.eventPropGetter,b=r.backgroundEventPropGetter,T=r.slotPropGetter,E=r.slotGroupPropGetter,k=r.dayPropGetter,C=r.view,I=r.views,B=r.localizer,F=r.culture,_=r.messages,R=_===void 0?{}:_,j=r.components,z=j===void 0?{}:j,q=r.formats,$=q===void 0?{}:q,J=x4(I),ae=FW(R);return{viewNames:J,localizer:kW(B,F,$,ae),getters:{eventProp:function(){return w&&w.apply(void 0,arguments)||{}},backgroundEventProp:function(){return b&&b.apply(void 0,arguments)||{}},slotProp:function(){return T&&T.apply(void 0,arguments)||{}},slotGroupProp:function(){return E&&E.apply(void 0,arguments)||{}},dayProp:function(){return k&&k.apply(void 0,arguments)||{}}},components:jq(z[C]||{},Fq(z,J),{eventWrapper:rs,backgroundEventWrapper:rs,eventContainerWrapper:rs,dateCellWrapper:rs,weekWrapper:rs,timeSlotWrapper:rs,timeGutterWrapper:rs}),accessors:{start:al(o),end:al(i),allDay:al(s),tooltip:al(c),title:al(d),resource:al(h),resourceId:al(g),resourceTitle:al(m)}}}}]),t}(Q.Component);M4.defaultProps={events:[],backgroundEvents:[],elementProps:{},popup:!1,toolbar:!0,view:qr.MONTH,views:[qr.MONTH,qr.WEEK,qr.DAY,qr.AGENDA],step:30,length:30,allDayMaxRows:1/0,doShowMoreDrillDown:!0,drilldownView:qr.DAY,titleAccessor:"title",tooltipAccessor:"title",allDayAccessor:"allDay",startAccessor:"start",endAccessor:"end",resourceAccessor:"resourceId",resourceIdAccessor:"id",resourceTitleAccessor:"title",longPressThreshold:250,getNow:function(){return new Date},dayLayoutAlgorithm:"overlap"};var MG=iT(M4,{view:"onView",date:"onNavigate",selected:"onSelectEvent"}),kG=function(t,n,r){var o=t.start,i=t.end;return r.format(o,"MMMM DD",n)+" "+r.format(i,r.eq(o,i,"month")?"DD":"MMMM DD",n)},NG=function(t,n,r){var o=t.start,i=t.end;return r.format(o,"L",n)+" "+r.format(i,"L",n)},B0=function(t,n,r){var o=t.start,i=t.end;return r.format(o,"LT",n)+" "+r.format(i,"LT",n)},FG=function(t,n,r){var o=t.start;return r.format(o,"LT",n)+" "},IG=function(t,n,r){var o=t.end;return" "+r.format(o,"LT",n)},AG={dateFormat:"DD",dayFormat:"DD ddd",weekdayFormat:"ddd",selectRangeFormat:B0,eventTimeRangeFormat:B0,eventTimeRangeStartFormat:FG,eventTimeRangeEndFormat:IG,timeGutterFormat:"LT",monthHeaderFormat:"MMMM YYYY",dayHeaderFormat:"dddd MMM DD",dayRangeHeaderFormat:kG,agendaHeaderFormat:NG,agendaDateFormat:"ddd MMM DD",agendaTimeFormat:"LT",agendaTimeRangeFormat:B0};function il(e){var t=e&&e.toLowerCase();return t==="FullYear"?t="year":t||(t=void 0),t}function OG(e){var t=function(le,we){return we?le.locale(we):le};function n(G){return e(G).toDate().getTimezoneOffset()}function r(G,le){var we,ue,Se=e(G).local(),Re=e(le).local();if(!e.tz)return Se.toDate().getTimezoneOffset()-Re.toDate().getTimezoneOffset();var Ye=(we=Se==null||(ue=Se._z)===null||ue===void 0?void 0:ue.name)!==null&&we!==void 0?we:e.tz.guess(),Be=e.tz.zone(Ye).utcOffset(+Se),yt=e.tz.zone(Ye).utcOffset(+Re);return Be-yt}function o(G){var le=e(G).startOf("day");return r(le,G)}function i(G,le,we){var ue=il(we),Se=ue?e(G).startOf(ue):e(G),Re=ue?e(le).startOf(ue):e(le);return[Se,Re,ue]}function s(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,le=arguments.length>1?arguments[1]:void 0,we=il(le);return we?e(G).startOf(we).toDate():e(G).toDate()}function c(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,le=arguments.length>1?arguments[1]:void 0,we=il(le);return we?e(G).endOf(we).toDate():e(G).toDate()}function d(G,le,we){var ue=i(G,le,we),Se=as(ue,3),Re=Se[0],Ye=Se[1],Be=Se[2];return Re.isSame(Ye,Be)}function h(G,le,we){return!d(G,le,we)}function g(G,le,we){var ue=i(G,le,we),Se=as(ue,3),Re=Se[0],Ye=Se[1],Be=Se[2];return Re.isAfter(Ye,Be)}function m(G,le,we){var ue=i(G,le,we),Se=as(ue,3),Re=Se[0],Ye=Se[1],Be=Se[2];return Re.isBefore(Ye,Be)}function w(G,le,we){var ue=i(G,le,we),Se=as(ue,3),Re=Se[0],Ye=Se[1],Be=Se[2];return Re.isSameOrBefore(Ye,Be)}function b(G,le,we){var ue=i(G,le,we),Se=as(ue,3),Re=Se[0],Ye=Se[1],Be=Se[2];return Re.isSameOrBefore(Ye,Be)}function T(G,le,we){var ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"day",Se=il(ue),Re=e(G),Ye=e(le),Be=e(we);return Re.isBetween(Ye,Be,Se,"[]")}function E(G,le){var we=e(G),ue=e(le),Se=e.min(we,ue);return Se.toDate()}function k(G,le){var we=e(G),ue=e(le),Se=e.max(we,ue);return Se.toDate()}function C(G,le){if(!G&&!le)return null;var we=e(le).format("HH:mm:ss"),ue=e(G).startOf("day").format("MM/DD/YYYY");return e("".concat(ue," ").concat(we),"MM/DD/YYYY HH:mm:ss").toDate()}function I(G,le,we){var ue=il(we);return e(G).add(le,ue).toDate()}function B(G,le){for(var we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",ue=il(we),Se=e(G).toDate(),Re=[];b(Se,le);)Re.push(Se),Se=I(Se,1,ue);return Re}function F(G,le){var we=il(le),ue=s(G,we);return d(ue,G)?ue:I(ue,1,we)}function _(G,le){var we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",ue=il(we),Se=e(G),Re=e(le);return Re.diff(Se,ue)}function R(G){var le=e(G);return le.minutes()}function j(G){var le=G?e.localeData(G):e.localeData();return le?le.firstDayOfWeek():0}function z(G){return e(G).startOf("month").startOf("week").toDate()}function q(G){return e(G).endOf("month").endOf("week").toDate()}function $(G){for(var le=z(G),we=q(G),ue=[];b(le,we);)ue.push(le),le=I(le,1,"d");return ue}function J(G,le,we){return e(G).startOf("day").minute(le+we).toDate()}function ae(G,le){return _(G,le,"minutes")}function ie(G){var le=e(G).startOf("day"),we=e(G);return we.diff(le,"minutes")+o(G)}function ge(G,le){var we=e(G),ue=e(le);return we.isBefore(ue,"day")}function pe(G,le,we){var ue=e(le),Se=e(we);return ue.isSameOrAfter(Se,"minutes")}function fe(G,le){var we=e(G),ue=e(le),Se=e.duration(ue.diff(we));return Se.days()}function De(G){var le=G.evtA,we=le.start,ue=le.end,Se=le.allDay,Re=G.evtB,Ye=Re.start,Be=Re.end,yt=Re.allDay,Ee=+s(we,"day")-+s(Ye,"day"),Ve=fe(we,ue),Ke=fe(Ye,Be);return Ee||Ke-Ve||!!yt-!!Se||+we-+Ye||+ue-+Be}function re(G){var le=G.event,we=le.start,ue=le.end,Se=G.range,Re=Se.start,Ye=Se.end,Be=e(we).startOf("day"),yt=e(ue),Ee=e(Re),Ve=e(Ye),Ke=Be.isSameOrBefore(Ve,"day"),Xe=!Be.isSame(yt,"minutes"),Ge=Xe?yt.isAfter(Ee,"minutes"):yt.isSameOrAfter(Ee,"minutes");return Ke&&Ge}function be(G,le){var we=e(G),ue=e(le);return we.isSame(ue,"day")}function V(){var G=new Date,le=/-/.test(G.toString())?"-":"",we=G.getTimezoneOffset(),ue=Number("".concat(le).concat(Math.abs(we))),Se=e().utcOffset();return Se>ue?1:0}return new MW({formats:AG,firstOfWeek:j,firstVisibleDay:z,lastVisibleDay:q,visibleDays:$,format:function(le,we,ue){return t(e(le),ue).format(we)},lt:m,lte:b,gt:g,gte:w,eq:d,neq:h,merge:C,inRange:T,startOf:s,endOf:c,range:B,add:I,diff:_,ceil:F,min:E,max:k,minutes:R,getSlotDate:J,getTimezoneOffset:n,getDstOffset:r,getTotalMin:ae,getMinutesFromMidnight:ie,continuesPrior:ge,continuesAfter:pe,sortEvents:De,inEventRange:re,isSameDate:be,daySpan:fe,browserTZOffset:V})}function s2(e,t,n,r,o){const i={start:r.start(e),end:r.end(e)},s={start:t,end:n};return o.inEventRange({event:i,range:s})}function RG(e,t){return!e||t==null?!1:uE.isEqual(e,t)}const yf={PREVIOUS:"PREV",NEXT:"NEXT",TODAY:"TODAY",DATE:"DATE"};function cs({accessors:e,components:t,date:n,events:r,getters:o,length:i,localizer:s,onDoubleClickEvent:c,onSelectEvent:d,selected:h}){const g=A.useRef(null),m=A.useRef(null),w=A.useRef(null),b=A.useRef(null),T=A.useRef(null),E=(_,R,j)=>{const{event:z,date:q}=t;return R=R.filter($=>s2($,s.startOf(_,"day"),s.endOf(_,"day"),e,s)),R.map(($,J)=>{const ae=e.title($),ie=e.end($),ge=e.start($),pe=o.eventProp($,ge,ie,RG($,h)),fe=J===0&&s.format(_,"agendaDateFormat"),De=J===0?D.jsx("td",{rowSpan:R.length,className:"rbc-agenda-date-cell",children:q?D.jsx(q,{day:_,label:fe}):fe}):!1;return D.jsxs("tr",{className:pe.className,style:pe.style,children:[De,D.jsx("td",{className:"rbc-agenda-time-cell",children:k(_,$)}),D.jsx("td",{className:"rbc-agenda-event-cell",onClick:re=>d&&d($,re),onDoubleClick:re=>c&&c($,re),children:z?D.jsx(z,{event:$,title:ae}):ae})]},j+"_"+J)},[])},k=(_,R)=>{const j=t.time;let z="",q=s.messages.allDay;const $=e.end(R),J=e.start(R);return e.allDay(R)||(s.eq(J,$)?q=s.format(J,"agendaTimeFormat"):s.isSameDate(J,$)?q=s.format({start:J,end:$},"agendaTimeRangeFormat"):s.isSameDate(_,J)?q=s.format(J,"agendaTimeFormat"):s.isSameDate(_,$)&&(q=s.format($,"agendaTimeFormat"))),s.gt(_,J,"day")&&(z="rbc-continues-prior"),s.lt(_,$,"day")&&(z+=" rbc-continues-after"),D.jsx("span",{className:z.trim(),children:j?D.jsx(j,{event:R,day:_,label:q}):q})},{messages:C}=s,I=s.add(n,-i/2,"day"),B=s.add(n,i/2,"day"),F=s.range(I,B,"day");return r=r.filter(_=>s2(_,s.startOf(I,"day"),s.endOf(B,"day"),e,s)),r.sort((_,R)=>+e.start(_)-+e.start(R)),D.jsx("div",{className:"rbc-agenda-view",children:r.length!==0?D.jsxs(Q.Fragment,{children:[D.jsx("table",{ref:g,className:"rbc-agenda-table",children:D.jsx("thead",{children:D.jsxs("tr",{children:[D.jsx("th",{className:"rbc-header",ref:m,children:C.date}),D.jsx("th",{className:"rbc-header",ref:w,children:C.time}),D.jsx("th",{className:"rbc-header",children:C.event})]})})}),D.jsx("div",{className:"rbc-agenda-content",ref:b,children:D.jsx("table",{className:"rbc-agenda-table",children:D.jsx("tbody",{ref:T,children:F.map((_,R)=>E(_,r,R))})})})]}):D.jsx("span",{className:"rbc-agenda-empty",children:C.noEventsInRange})})}cs.propTypes={accessors:Fe.object.isRequired,components:Fe.object.isRequired,date:Fe.instanceOf(Date),events:Fe.array,getters:Fe.object.isRequired,length:Fe.number.isRequired,localizer:Fe.object.isRequired,onSelectEvent:Fe.func,onDoubleClickEvent:Fe.func,selected:Fe.object};cs.defaultProps={length:30};cs.range=(e,{length:t=cs.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),o=n.add(e,t/2,"day");return{customStart:r,customEnd:o}};cs.navigate=(e,t,{length:n=cs.defaultProps.length,localizer:r})=>{switch(t){case yf.PREVIOUS:return r.add(e,-n,"day");case yf.NEXT:return r.add(e,n,"day");default:return e}};cs.title=(e,{length:t=cs.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),o=n.add(e,t/2,"day");return n.format({start:r,end:o},"agendaHeaderFormat")};function k4(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=k4(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fs(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=k4(e))&&(r&&(r+=" "),r+=t);return r}function LG(e,t){e.hoverEl.toggleClass("thino-hover-popover",!0);const n=Mv(e.hoverEl);return n.render(D.jsx(If,{store:xe,context:Nt,children:D.jsx(ml,{memo:t})})),n}function _G({event:e}){const t=e.resource,n=t.content.split(`
`)[0].slice(0,20),r=Q.useRef(null),o=Q.useRef(null),i=Q.useRef(null);A.useEffect(()=>{if(o.current)return N.setIcon(o.current,"calendar"),()=>{r.current&&(r.current=null)}},[r]);const s=A.useCallback(d=>{i.current&&(i.current.unmount(),i.current=null),i.current=d},[]),c=A.useCallback(d=>{if(!r.current||!N.Keymap.isModifier(d.nativeEvent,"Mod"))return;const h=new N.HoverPopover(ut.getState().view,r.current,100),g=LG(h,t);s(g)},[r.current]);return D.jsxs("span",{className:"rbc-event-renderer","data-source-type":t.sourceType,"data-thino-type":t.thinoType,"data-thino-id":t.id,ref:r,"aria-label":t.path,onMouseOver:c,children:[D.jsx(PG,{event:e}),D.jsx("strong",{children:n})]})}const PG=({event:e})=>{const t=Q.useRef(null),n=e.resource;A.useEffect(()=>{t.current&&N.setIcon(t.current,n.thinoType==="JOURNAL"?"calendar":n.thinoType==="TASK-TODO"?"square":"check-square")},[n==null?void 0:n.thinoType,t]);const r=A.useCallback(async o=>{o.stopPropagation(),o.preventDefault(),await(async()=>{const s=await Me.updateMemo(n.id,n.content,n.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");s&&Me.editMemo(s)})()},[n==null?void 0:n.thinoType,n==null?void 0:n.id,n==null?void 0:n.content]);return D.jsx(D.Fragment,{children:D.jsxs("span",{className:"rbc-event-icon-group",children:[D.jsx("span",{className:"rbc-event-icon",ref:t,onClick:r}),D.jsx("span",{className:fs("rbc-event-time","hidden"),children:D.jsx("span",{className:"rbc-event-time-text",children:N.moment(e.start).format("HH:mm")})})]})})};function N4({views:e,view:t,messages:n,onView:r}){return e.map(o=>D.jsx("button",{type:"button",className:fs({"rbc-active":t===o}),onClick:()=>r(o),children:n[o]},o))}N4.propTypes={messages:Fe.object,onView:Fe.func,view:Fe.string,views:Fe.array};function F4({date:e,label:t,localizer:{messages:n},onNavigate:r,onView:o,view:i,views:s}){const c={previous:A.useRef(null),today:A.useRef(null),next:A.useRef(null)};A.useEffect(()=>{c&&(N.setIcon(c.previous.current,"chevron-left"),N.setIcon(c.today.current,"dot"),N.setIcon(c.next.current,"chevron-right"))},[c]);const d=A.useMemo(()=>D.jsxs(D.Fragment,{children:[D.jsx("button",{ref:c.previous,type:"button",onClick:()=>r(yf.PREVIOUS),"aria-label":n.previous,children:"<"}),D.jsx("button",{ref:c.today,type:"button",onClick:()=>r(yf.TODAY),"aria-label":n.today,children:"•"}),D.jsx("button",{ref:c.next,type:"button",onClick:()=>r(yf.NEXT),"aria-label":n.next,children:">"})]}),[n]);return D.jsxs("div",{className:"rbc-toolbar",children:[D.jsx("span",{className:fs("rbc-btn-group","thino-view-custom-toolbar"),children:d}),D.jsx("span",{className:"rbc-toolbar-label",children:D.jsx(ov,{type:"text",handleValueChange:h=>{r(yf.DATE,N.moment(h,"YYYY-MM-DD").format("YYYY-MM-DDTHH:mm:ssZ"))},defaultText:t+(i==="week"?N.moment(e.valueOf(),"x").format(" [W]WW"):""),defaultValue:N.moment(e.valueOf(),"x").valueOf()})}),D.jsx("span",{className:"rbc-btn-group",children:D.jsx(N4,{view:i,views:s,messages:n,onView:o})})]})}F4.propTypes={date:Fe.instanceOf(Date),label:Fe.string,localizer:Fe.object,messages:Fe.object,onNavigate:Fe.func,onView:Fe.func,view:Fe.string,views:Fe.array};function jG({event:e,children:t,showPopup:n,callRender:r,...o}){const i=A.useRef(null),s=A.useRef(null),c=A.useCallback(d=>{if(!d.isTrusted){r();return}s.current=d.nativeEvent.target,s.current&&(s.current.hasClass("rbc-event")||(s.current=s.current.closest(".rbc-event")),i.current!==null?(window.clearTimeout(i.current),i.current=null):i.current=window.setTimeout(()=>{n(e,s.current),i.current=null},250))},[e,n]);return D.jsx(D.Fragment,{children:D.jsx("div",{className:"rbc-event-wrapper","aria-describedby":"thino",onClick:c,children:t})})}const BG=OG(N.moment),YG=({event:e})=>{const t=e.resource;return D.jsx(D.Fragment,{children:D.jsx(ml,{memo:t})})},HG=e=>{var ae;const{thinos:t}=e,[n,r]=Q.useState([]),[o,i]=Q.useState((app==null?void 0:app.loadLocalStorage("thino-calendar-view"))||"month"),[s,c]=Q.useState(null),d=Q.useRef(null),h=Q.useRef(null),[g,m]=Q.useState(!1),w=A.useRef(null),[b,T]=A.useState(new Date);A.useEffect(()=>()=>{d.current&&(d.current=null),h.current&&(h.current=null),w.current&&(w.current=null)},[]),A.useEffect(()=>{const ie=t.map(ge=>{const pe=N.moment(ge.createdAt,"YYYY-MM-DD HH:mm:ss"),fe=pe.clone().add(1,"minute");return{title:ge.content,start:new Date(pe.format("YYYY-MM-DDTHH:mm:ss")),end:new Date(fe.format("YYYY-MM-DDTHH:mm:ss")),resource:ge}});r(ie)},[t]),A.useEffect(()=>{app.saveLocalStorage("thino-calendar-view",o)},[o]),A.useEffect(()=>{g&&c(t.find(ie=>ie.id===s.id))},[t]),A.useEffect(()=>{s&&w.current.update()},[s]),w.current=Iv(d.current,h.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,4]}}]});const E=A.useCallback(()=>{w.current.update(),w.current.update()},[]),k=A.useCallback((ie,ge)=>{c(null),F(),w.current.state.elements.reference=ge,c(ie.resource),_()},[]),C=A.useCallback(()=>{F(),c(null)},[]),I=A.useCallback((ie,ge,pe)=>{var fe;if(B(ie),ge==="week"||ge==="day"){const De=d.current.find(".rbc-event-wrapper");if(d.current.closest(".memolist-wrapper"),De){(fe=De.children[0])==null||fe.click();return}else{setTimeout(()=>{var be,V;const re=d.current.find(".rbc-event-wrapper");(V=(be=re==null?void 0:re.children)==null?void 0:be[0])==null||V.click()},0);return}}},[]),B=A.useCallback(ie=>{T(ie)},[T]);Eh(h,C);const F=A.useCallback(()=>{m(!1)},[m]),_=A.useCallback(()=>{w.current.update(),m(!0)},[m]),R=A.useCallback(ie=>{const ge=ie.resource;rt.setEditMemoId(ge.id)},[]),j=A.useCallback(ie=>{i(ie)},[i]),{components:z,views:q,messages:$}=A.useMemo(()=>({components:{toolbar:F4,eventWrapper:ie=>D.jsx(jG,{...ie,callRender:E,showPopup:k}),agenda:{event:YG},event:_G},views:{month:!0,agenda:cs,week:!0,day:!0},messages:{month:O("Month"),day:O("Day"),next:O("Next"),previous:O("Previous"),today:O("Today"),agenda:O("Agenda"),week:O("Week"),yesterday:O("Yesterday"),tomorrow:O("Tomorrow"),noEventsInRange:O("No thinos in range")}}),[]),J=A.useMemo(()=>({timeGutterFormat:(ie,ge,pe)=>pe.format(ie,"HH:mm",ge),agendaTimeRangeFormat:({start:ie,end:ge},pe,fe)=>fe.format(ie,"HH:mm",pe)+" — "+fe.format(ge,"HH:mm",pe),agendaHeaderFormat:({start:ie,end:ge},pe,fe)=>fe.format(ie,"YYYY-MM-DD")+" — "+fe.format(ge,"YYYY-MM-DD")}),[]);return D.jsxs("div",{ref:d,className:"calendar-view",children:[D.jsx(MG,{date:b,messages:$,components:z,localizer:BG,events:n,views:q,onView:j,onDoubleClickEvent:R,onNavigate:I,formats:J,defaultView:o,tooltipAccessor:null,startAccessor:"start",endAccessor:"end"}),D.jsx("div",{ref:h,style:(ae=w.current)==null?void 0:ae.styles.popper,className:fs("thino-popup-container",g?"":"hidden"),children:s&&D.jsx(ml,{memo:s})})]})};function hl(e,t){return typeof e=="function"?e(t):e}function Bo(e,t){return n=>{t.setState(r=>({...r,[e]:hl(n,r[e])}))}}function yv(e){return e instanceof Function}function UG(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function VG(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function pt(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const c=e(i);if(!(c.length!==r.length||c.some((g,m)=>r[m]!==g)))return o;r=c;let h;if(n.key&&n.debug&&(h=Date.now()),o=t(...c),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-s)*100)/100,w=Math.round((Date.now()-h)*100)/100/16,b=(T,E)=>{for(T=String(T);T.length<E;)T=" "+T;return T}}return o}}function ht(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function zG(e,t,n,r){var o,i;const c={...e._getDefaultColumnDef(),...t},d=c.accessorKey;let h=(o=(i=c.id)!=null?i:d?d.replace(".","_"):void 0)!=null?o:typeof c.header=="string"?c.header:void 0,g;if(c.accessorFn?g=c.accessorFn:d&&(d.includes(".")?g=w=>{let b=w;for(const E of d.split(".")){var T;b=(T=b)==null?void 0:T[E]}return b}:g=w=>w[c.accessorKey]),!h)throw new Error;let m={id:`${String(h)}`,accessorFn:g,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:pt(()=>[!0],()=>{var w;return[m,...(w=m.columns)==null?void 0:w.flatMap(b=>b.getFlatColumns())]},ht(e.options,"debugColumns")),getLeafColumns:pt(()=>[e._getOrderColumnsFn()],w=>{var b;if((b=m.columns)!=null&&b.length){let T=m.columns.flatMap(E=>E.getLeafColumns());return w(T)}return[m]},ht(e.options,"debugColumns"))};for(const w of e._features)w.createColumn==null||w.createColumn(m,e);return m}const Fr="debugHeaders";function l2(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],c=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(c),s.push(d)};return c(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const $G={createTable:e=>{e.getHeaderGroups=pt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const c=(i=r==null?void 0:r.map(m=>n.find(w=>w.id===m)).filter(Boolean))!=null?i:[],d=(s=o==null?void 0:o.map(m=>n.find(w=>w.id===m)).filter(Boolean))!=null?s:[],h=n.filter(m=>!(r!=null&&r.includes(m.id))&&!(o!=null&&o.includes(m.id)));return kg(t,[...c,...h,...d],e)},ht(e.options,Fr)),e.getCenterHeaderGroups=pt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),kg(t,n,e,"center")),ht(e.options,Fr)),e.getLeftHeaderGroups=pt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(c=>c.id===s)).filter(Boolean))!=null?o:[];return kg(t,i,e,"left")},ht(e.options,Fr)),e.getRightHeaderGroups=pt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(c=>c.id===s)).filter(Boolean))!=null?o:[];return kg(t,i,e,"right")},ht(e.options,Fr)),e.getFooterGroups=pt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ht(e.options,Fr)),e.getLeftFooterGroups=pt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ht(e.options,Fr)),e.getCenterFooterGroups=pt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ht(e.options,Fr)),e.getRightFooterGroups=pt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ht(e.options,Fr)),e.getFlatHeaders=pt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ht(e.options,Fr)),e.getLeftFlatHeaders=pt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ht(e.options,Fr)),e.getCenterFlatHeaders=pt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ht(e.options,Fr)),e.getRightFlatHeaders=pt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ht(e.options,Fr)),e.getCenterLeafHeaders=pt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ht(e.options,Fr)),e.getLeftLeafHeaders=pt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ht(e.options,Fr)),e.getRightLeafHeaders=pt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ht(e.options,Fr)),e.getLeafHeaders=pt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,c,d,h;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(c=n[0])==null?void 0:c.headers)!=null?s:[],...(d=(h=r[0])==null?void 0:h.headers)!=null?d:[]].map(g=>g.getLeafHeaders()).flat()},ht(e.options,Fr))}};function kg(e,t,n,r){var o,i;let s=0;const c=function(w,b){b===void 0&&(b=1),s=Math.max(s,b),w.filter(T=>T.getIsVisible()).forEach(T=>{var E;(E=T.columns)!=null&&E.length&&c(T.columns,b+1)},0)};c(e);let d=[];const h=(w,b)=>{const T={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},E=[];w.forEach(k=>{const C=[...E].reverse()[0],I=k.column.depth===T.depth;let B,F=!1;if(I&&k.column.parent?B=k.column.parent:(B=k.column,F=!0),C&&(C==null?void 0:C.column)===B)C.subHeaders.push(k);else{const _=l2(n,B,{id:[r,b,B.id,k==null?void 0:k.id].filter(Boolean).join("_"),isPlaceholder:F,placeholderId:F?`${E.filter(R=>R.column===B).length}`:void 0,depth:b,index:E.length});_.subHeaders.push(k),E.push(_)}T.headers.push(k),k.headerGroup=T}),d.push(T),b>0&&h(E,b-1)},g=t.map((w,b)=>l2(n,w,{depth:s,index:b}));h(g,s-1),d.reverse();const m=w=>w.filter(T=>T.column.getIsVisible()).map(T=>{let E=0,k=0,C=[0];T.subHeaders&&T.subHeaders.length?(C=[],m(T.subHeaders).forEach(B=>{let{colSpan:F,rowSpan:_}=B;E+=F,C.push(_)})):E=1;const I=Math.min(...C);return k+=I,T.colSpan=E,T.rowSpan=k,{colSpan:E,rowSpan:k}});return m((o=(i=d[0])==null?void 0:i.headers)!=null?o:[]),d}const Ng={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Y0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),qG={getDefaultColumnDef:()=>Ng,getInitialState:e=>({columnSizing:{},columnSizingInfo:Y0(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Bo("columnSizing",e),onColumnSizingInfoChange:Bo("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Ng.minSize,(r=i??e.columnDef.size)!=null?r:Ng.size),(o=e.columnDef.maxSize)!=null?o:Ng.maxSize)},e.getStart=pt(n=>[n,$p(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),ht(t.options,"debugColumns")),e.getAfter=pt(n=>[n,$p(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),ht(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),H0(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),c=e?e.getLeafHeaders().map(C=>[C.column.id,C.column.getSize()]):[[r.id,r.getSize()]],d=H0(i)?Math.round(i.touches[0].clientX):i.clientX,h={},g=(C,I)=>{typeof I=="number"&&(t.setColumnSizingInfo(B=>{var F,_;const R=t.options.columnResizeDirection==="rtl"?-1:1,j=(I-((F=B==null?void 0:B.startOffset)!=null?F:0))*R,z=Math.max(j/((_=B==null?void 0:B.startSize)!=null?_:0),-.999999);return B.columnSizingStart.forEach(q=>{let[$,J]=q;h[$]=Math.round(Math.max(J+J*z,0)*100)/100}),{...B,deltaOffset:j,deltaPercentage:z}}),(t.options.columnResizeMode==="onChange"||C==="end")&&t.setColumnSizing(B=>({...B,...h})))},m=C=>g("move",C),w=C=>{g("end",C),t.setColumnSizingInfo(I=>({...I,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=n||typeof document<"u"?document:null,T={moveHandler:C=>m(C.clientX),upHandler:C=>{b==null||b.removeEventListener("mousemove",T.moveHandler),b==null||b.removeEventListener("mouseup",T.upHandler),w(C.clientX)}},E={moveHandler:C=>(C.cancelable&&(C.preventDefault(),C.stopPropagation()),m(C.touches[0].clientX),!1),upHandler:C=>{var I;b==null||b.removeEventListener("touchmove",E.moveHandler),b==null||b.removeEventListener("touchend",E.upHandler),C.cancelable&&(C.preventDefault(),C.stopPropagation()),w((I=C.touches[0])==null?void 0:I.clientX)}},k=WG()?{passive:!1}:!1;H0(i)?(b==null||b.addEventListener("touchmove",E.moveHandler,k),b==null||b.addEventListener("touchend",E.upHandler,k)):(b==null||b.addEventListener("mousemove",T.moveHandler,k),b==null||b.addEventListener("mouseup",T.upHandler,k)),t.setColumnSizingInfo(C=>({...C,startOffset:d,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Y0():(n=e.initialState.columnSizingInfo)!=null?n:Y0())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Fg=null;function WG(){if(typeof Fg=="boolean")return Fg;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Fg=e,Fg}function H0(e){return e.type==="touchstart"}const GG={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Bo("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(c=>{s[c]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:c,...d}=s;return d}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},I4=(e,t,n)=>{var r;const o=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(o))};I4.autoRemove=e=>Ia(e);const A4=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};A4.autoRemove=e=>Ia(e);const O4=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};O4.autoRemove=e=>Ia(e);const R4=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};R4.autoRemove=e=>Ia(e)||!(e!=null&&e.length);const L4=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});L4.autoRemove=e=>Ia(e)||!(e!=null&&e.length);const _4=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});_4.autoRemove=e=>Ia(e)||!(e!=null&&e.length);const P4=(e,t,n)=>e.getValue(t)===n;P4.autoRemove=e=>Ia(e);const j4=(e,t,n)=>e.getValue(t)==n;j4.autoRemove=e=>Ia(e);const Zw=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};Zw.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const c=i;i=s,s=c}return[i,s]};Zw.autoRemove=e=>Ia(e)||Ia(e[0])&&Ia(e[1]);const ts={includesString:I4,includesStringSensitive:A4,equalsString:O4,arrIncludes:R4,arrIncludesAll:L4,arrIncludesSome:_4,equals:P4,weakEquals:j4,inNumberRange:Zw};function Ia(e){return e==null||e===""}const KG={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Bo("columnFilters",e),onGlobalFilterChange:Bo("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?ts.includesString:typeof r=="number"?ts.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ts.equals:Array.isArray(r)?ts.arrIncludes:ts.weakEquals},e.getFilterFn=()=>{var n,r;return yv(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ts[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(g=>g.id===e.id),s=hl(n,i?i.value:void 0);if(u2(o,s,e)){var c;return(c=r==null?void 0:r.filter(g=>g.id!==e.id))!=null?c:[]}const d={id:e.id,value:s};if(i){var h;return(h=r==null?void 0:r.map(g=>g.id===e.id?d:g))!=null?h:[]}return r!=null&&r.length?[...r,d]:[d]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ts.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return yv(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ts[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=hl(t,o))==null?void 0:i.filter(s=>{const c=n.find(d=>d.id===s.id);if(c){const d=c.getFilterFn();if(u2(d,s.value,c))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function u2(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const QG=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),ZG=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},JG=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},XG=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},eK=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},tK=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!UG(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},nK=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),rK=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,oK=(e,t)=>t.length,U0={sum:QG,min:ZG,max:JG,extent:XG,mean:eK,median:tK,unique:nK,uniqueCount:rK,count:oK},aK={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Bo("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r,o,i;return(n=(r=(o=(i=e.columnDef.enableGrouping)!=null?i:!0)!=null?o:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return U0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return U0.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return yv(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:U0[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function iK(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const sK={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Bo("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=pt(n=>[$p(t,n)],n=>n.findIndex(r=>r.id===e.id),ht(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=$p(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=$p(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=pt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],c=[...o];for(;c.length&&s.length;){const d=s.shift(),h=c.findIndex(g=>g.id===d);h>-1&&i.push(c.splice(h,1)[0])}i=[...i,...c]}return iK(i,n,r)},ht(e.options,"debugTable"))}},L1=0,_1=10,V0=()=>({pageIndex:L1,pageSize:_1}),lK={getInitialState:e=>({...e,pagination:{...V0(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Bo("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>hl(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?V0():(o=e.initialState.pagination)!=null?o:V0())},e.setPageIndex=r=>{e.setPagination(o=>{let i=hl(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?L1:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:L1)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?_1:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:_1)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,hl(r,o.pageSize)),s=o.pageSize*o.pageIndex,c=Math.floor(s/i);return{...o,pageIndex:c,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=hl(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=pt(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},ht(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},z0=()=>({left:[],right:[]}),$0=()=>({top:[],bottom:[]}),uK={getInitialState:e=>({columnPinning:z0(),rowPinning:$0(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Bo("columnPinning",e),onRowPinningChange:Bo("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var c,d;return{left:((c=o==null?void 0:o.left)!=null?c:[]).filter(m=>!(r!=null&&r.includes(m))),right:[...((d=o==null?void 0:o.right)!=null?d:[]).filter(m=>!(r!=null&&r.includes(m))),...r]}}if(n==="left"){var h,g;return{left:[...((h=o==null?void 0:o.left)!=null?h:[]).filter(m=>!(r!=null&&r.includes(m))),...r],right:((g=o==null?void 0:o.right)!=null?g:[]).filter(m=>!(r!=null&&r.includes(m)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(m=>!(r!=null&&r.includes(m))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(m=>!(r!=null&&r.includes(m)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(c=>c.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(c=>r==null?void 0:r.includes(c)),s=n.some(c=>o==null?void 0:o.includes(c));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(d=>{let{id:h}=d;return h}):[],s=o?e.getParentRows().map(d=>{let{id:h}=d;return h}):[],c=new Set([...s,e.id,...i]);t.setRowPinning(d=>{var h,g;if(n==="bottom"){var m,w;return{top:((m=d==null?void 0:d.top)!=null?m:[]).filter(E=>!(c!=null&&c.has(E))),bottom:[...((w=d==null?void 0:d.bottom)!=null?w:[]).filter(E=>!(c!=null&&c.has(E))),...Array.from(c)]}}if(n==="top"){var b,T;return{top:[...((b=d==null?void 0:d.top)!=null?b:[]).filter(E=>!(c!=null&&c.has(E))),...Array.from(c)],bottom:((T=d==null?void 0:d.bottom)!=null?T:[]).filter(E=>!(c!=null&&c.has(E)))}}return{top:((h=d==null?void 0:d.top)!=null?h:[]).filter(E=>!(c!=null&&c.has(E))),bottom:((g=d==null?void 0:d.bottom)!=null?g:[]).filter(E=>!(c!=null&&c.has(E)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(c=>r==null?void 0:r.includes(c)),s=n.some(c=>o==null?void 0:o.includes(c));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=t._getPinnedRows(o))==null?void 0:n.map(s=>{let{id:c}=s;return c});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=pt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},ht(t.options,"debugRows")),e.getLeftVisibleCells=pt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ht(t.options,"debugRows")),e.getRightVisibleCells=pt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ht(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?z0():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:z0())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=pt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ht(e.options,"debugColumns")),e.getRightLeafColumns=pt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ht(e.options,"debugColumns")),e.getCenterLeafColumns=pt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},ht(e.options,"debugColumns")),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?$0():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:$0())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=pt(t=>[e.getRowModel().rows,e.getState().rowPinning[t],t],(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const c=e.getRow(s,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(s=>t.find(c=>c.id===s))).filter(Boolean).map(s=>({...s,position:r}))},ht(e.options,"debugRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=pt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},ht(e.options,"debugRows"))}},cK={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Bo("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{P1(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=pt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?q0(e,n):{rows:[],flatRows:[],rowsById:{}},ht(e.options,"debugTable")),e.getFilteredSelectedRowModel=pt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?q0(e,n):{rows:[],flatRows:[],rowsById:{}},ht(e.options,"debugTable")),e.getGroupedSelectedRowModel=pt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?q0(e,n):{rows:[],flatRows:[],rowsById:{}},ht(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const c={...i};return P1(c,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),c})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Jw(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return j1(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return j1(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},P1=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(c=>delete e[c]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(c=>P1(e,c.id,n,r,o))};function q0(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,c){return s.map(d=>{var h;const g=Jw(d,n);if(g&&(r.push(d),o[d.id]=d),(h=d.subRows)!=null&&h.length&&(d={...d,subRows:i(d.subRows)}),g)return d}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function Jw(e,t){var n;return(n=t[e.id])!=null?n:!1}function j1(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(Jw(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const c=j1(s,t);c==="all"?i=!0:(c==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const B1=/([0-9]+)/gm,fK=(e,t,n)=>B4(yl(e.getValue(n)).toLowerCase(),yl(t.getValue(n)).toLowerCase()),dK=(e,t,n)=>B4(yl(e.getValue(n)),yl(t.getValue(n))),pK=(e,t,n)=>Xw(yl(e.getValue(n)).toLowerCase(),yl(t.getValue(n)).toLowerCase()),hK=(e,t,n)=>Xw(yl(e.getValue(n)),yl(t.getValue(n))),mK=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},gK=(e,t,n)=>Xw(e.getValue(n),t.getValue(n));function Xw(e,t){return e===t?0:e>t?1:-1}function yl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function B4(e,t){const n=e.split(B1).filter(Boolean),r=t.split(B1).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),c=parseInt(i,10),d=[s,c].sort();if(isNaN(d[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(d[1]))return isNaN(s)?-1:1;if(s>c)return 1;if(c>s)return-1}return n.length-r.length}const vf={alphanumeric:fK,alphanumericCaseSensitive:dK,text:pK,textCaseSensitive:hK,datetime:mK,basic:gK},vK={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Bo("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return vf.datetime;if(typeof i=="string"&&(r=!0,i.split(B1).length>1))return vf.alphanumeric}return r?vf.text:vf.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return yv(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:vf[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const c=s==null?void 0:s.find(b=>b.id===e.id),d=s==null?void 0:s.findIndex(b=>b.id===e.id);let h=[],g,m=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?c?g="toggle":g="add":s!=null&&s.length&&d!==s.length-1?g="replace":c?g="toggle":g="replace",g==="toggle"&&(i||o||(g="remove")),g==="add"){var w;h=[...s,{id:e.id,desc:m}],h.splice(0,h.length-((w=t.options.maxMultiSortColCount)!=null?w:Number.MAX_SAFE_INTEGER))}else g==="toggle"?h=s.map(b=>b.id===e.id?{...b,desc:m}:b):g==="remove"?h=s.filter(b=>b.id!==e.id):h=[{id:e.id,desc:m}];return h})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},yK={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Bo("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=pt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ht(t.options,"debugRows")),e.getVisibleCells=pt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ht(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>pt(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ht(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function $p(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const c2=[$G,yK,sK,uK,KG,vK,aK,GG,lK,cK,qG];function wK(e){var t;e.debugAll||e.debugTable;let n={_features:c2};const r=n._features.reduce((g,m)=>Object.assign(g,m.getDefaultOptions==null?void 0:m.getDefaultOptions(n)),{}),o=g=>n.options.mergeOptions?n.options.mergeOptions(r,g):{...r,...g};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(g=>{var m;s=(m=g.getInitialState==null?void 0:g.getInitialState(s))!=null?m:s});const c=[];let d=!1;const h={_features:c2,options:{...r,...e},initialState:s,_queue:g=>{c.push(g),d||(d=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();d=!1}).catch(m=>setTimeout(()=>{throw m})))},reset:()=>{n.setState(n.initialState)},setOptions:g=>{const m=hl(g,n.options);n.options=o(m)},getState:()=>n.options.state,setState:g=>{n.options.onStateChange==null||n.options.onStateChange(g)},_getRowId:(g,m,w)=>{var b;return(b=n.options.getRowId==null?void 0:n.options.getRowId(g,m,w))!=null?b:`${w?[w.id,m].join("."):m}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(g,m)=>{let w=(m?n.getPrePaginationRowModel():n.getRowModel()).rowsById[g];if(!w&&(w=n.getCoreRowModel().rowsById[g],!w))throw new Error;return w},_getDefaultColumnDef:pt(()=>[n.options.defaultColumn],g=>{var m;return g=(m=g)!=null?m:{},{header:w=>{const b=w.header.column.columnDef;return b.accessorKey?b.accessorKey:b.accessorFn?b.id:null},cell:w=>{var b,T;return(b=(T=w.renderValue())==null||T.toString==null?void 0:T.toString())!=null?b:null},...n._features.reduce((w,b)=>Object.assign(w,b.getDefaultColumnDef==null?void 0:b.getDefaultColumnDef()),{}),...g}},ht(e,"debugColumns")),_getColumnDefs:()=>n.options.columns,getAllColumns:pt(()=>[n._getColumnDefs()],g=>{const m=function(w,b,T){return T===void 0&&(T=0),w.map(E=>{const k=zG(n,E,T,b),C=E;return k.columns=C.columns?m(C.columns,k,T+1):[],k})};return m(g)},ht(e,"debugColumns")),getAllFlatColumns:pt(()=>[n.getAllColumns()],g=>g.flatMap(m=>m.getFlatColumns()),ht(e,"debugColumns")),_getAllFlatColumnsById:pt(()=>[n.getAllFlatColumns()],g=>g.reduce((m,w)=>(m[w.id]=w,m),{}),ht(e,"debugColumns")),getAllLeafColumns:pt(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(g,m)=>{let w=g.flatMap(b=>b.getLeafColumns());return m(w)},ht(e,"debugColumns")),getColumn:g=>n._getAllFlatColumnsById()[g]};Object.assign(n,h);for(let g=0;g<n._features.length;g++){const m=n._features[g];m==null||m.createTable==null||m.createTable(n)}return n}function bK(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:pt(()=>[e,n,t,i],(s,c,d,h)=>({table:s,column:c,row:d,cell:h,getValue:h.getValue,renderValue:h.renderValue}),ht(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}const eb=(e,t,n,r,o,i,s)=>{let c={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(c._valuesCache.hasOwnProperty(d))return c._valuesCache[d];const h=e.getColumn(d);if(h!=null&&h.accessorFn)return c._valuesCache[d]=h.accessorFn(c.original,r),c._valuesCache[d]},getUniqueValues:d=>{if(c._uniqueValuesCache.hasOwnProperty(d))return c._uniqueValuesCache[d];const h=e.getColumn(d);if(h!=null&&h.accessorFn)return h.columnDef.getUniqueValues?(c._uniqueValuesCache[d]=h.columnDef.getUniqueValues(c.original,r),c._uniqueValuesCache[d]):(c._uniqueValuesCache[d]=[c.getValue(d)],c._uniqueValuesCache[d])},renderValue:d=>{var h;return(h=c.getValue(d))!=null?h:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>VG(c.subRows,d=>d.subRows),getParentRow:()=>c.parentId?e.getRow(c.parentId,!0):void 0,getParentRows:()=>{let d=[],h=c;for(;;){const g=h.getParentRow();if(!g)break;d.push(g),h=g}return d.reverse()},getAllCells:pt(()=>[e.getAllLeafColumns()],d=>d.map(h=>bK(e,c,h,h.id)),ht(e.options,"debugRows")),_getAllCellsByColumnId:pt(()=>[c.getAllCells()],d=>d.reduce((h,g)=>(h[g.column.id]=g,h),{}),ht(e.options,"debugRows"))};for(let d=0;d<e._features.length;d++){const h=e._features[d];h==null||h.createRow==null||h.createRow(c,e)}return c};function DK(){return e=>pt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const c=[];for(let h=0;h<o.length;h++){const g=eb(e,e._getRowId(o[h],h,s),o[h],h,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,c.push(g),e.options.getSubRows){var d;g.originalSubRows=e.options.getSubRows(o[h],h),(d=g.originalSubRows)!=null&&d.length&&(g.subRows=r(g.originalSubRows,i+1,g))}}return c};return n.rows=r(t),n},ht(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Y4(e,t,n){return n.options.filterFromLeafRows?SK(e,t,n):EK(e,t,n)}function SK(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(d,h){h===void 0&&(h=0);const g=[];for(let w=0;w<d.length;w++){var m;let b=d[w];const T=eb(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(T.columnFilters=b.columnFilters,(m=b.subRows)!=null&&m.length&&h<s){if(T.subRows=c(b.subRows,h+1),b=T,t(b)&&!T.subRows.length){g.push(b),i[b.id]=b,o.push(b);continue}if(t(b)||T.subRows.length){g.push(b),i[b.id]=b,o.push(b);continue}}else b=T,t(b)&&(g.push(b),i[b.id]=b,o.push(b))}return g};return{rows:c(e),flatRows:o,rowsById:i}}function EK(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(d,h){h===void 0&&(h=0);const g=[];for(let w=0;w<d.length;w++){let b=d[w];if(t(b)){var m;if((m=b.subRows)!=null&&m.length&&h<s){const E=eb(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);E.subRows=c(b.subRows,h+1),b=E}g.push(b),o.push(b),i[b.id]=b}}return g};return{rows:c(e),flatRows:o,rowsById:i}}function TK(){return e=>pt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let w=0;w<t.flatRows.length;w++)t.flatRows[w].columnFilters={},t.flatRows[w].columnFiltersMeta={};return t}const o=[],i=[];(n??[]).forEach(w=>{var b;const T=e.getColumn(w.id);if(!T)return;const E=T.getFilterFn();E&&o.push({id:w.id,filterFn:E,resolvedValue:(b=E.resolveFilterValue==null?void 0:E.resolveFilterValue(w.value))!=null?b:w.value})});const s=n.map(w=>w.id),c=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(w=>w.getCanGlobalFilter());r&&c&&d.length&&(s.push("__global__"),d.forEach(w=>{var b;i.push({id:w.id,filterFn:c,resolvedValue:(b=c.resolveFilterValue==null?void 0:c.resolveFilterValue(r))!=null?b:r})}));let h,g;for(let w=0;w<t.flatRows.length;w++){const b=t.flatRows[w];if(b.columnFilters={},o.length)for(let T=0;T<o.length;T++){h=o[T];const E=h.id;b.columnFilters[E]=h.filterFn(b,E,h.resolvedValue,k=>{b.columnFiltersMeta[E]=k})}if(i.length){for(let T=0;T<i.length;T++){g=i[T];const E=g.id;if(g.filterFn(b,E,g.resolvedValue,k=>{b.columnFiltersMeta[E]=k})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const m=w=>{for(let b=0;b<s.length;b++)if(w.columnFilters[s[b]]===!1)return!1;return!0};return Y4(t.rows,m,e)},ht(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function CK(){return(e,t)=>pt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,o)=>{if(!n.rows.length||!(r!=null&&r.length)&&!o)return n;const i=[...r.map(c=>c.id).filter(c=>c!==t),o?"__global__":void 0].filter(Boolean),s=c=>{for(let d=0;d<i.length;d++)if(c.columnFilters[i[d]]===!1)return!1;return!0};return Y4(n.rows,s,e)},ht(e.options,"debugTable"))}function xK(){return(e,t)=>pt(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let i=0;i<n.flatRows.length;i++){const s=n.flatRows[i].getUniqueValues(t);for(let c=0;c<s.length;c++){const d=s[c];if(r.has(d)){var o;r.set(d,((o=r.get(d))!=null?o:0)+1)}else r.set(d,1)}}return r},ht(e.options,"debugTable"))}function MK(){return(e,t)=>pt(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{var r;if(!n)return;const o=(r=n.flatRows[0])==null?void 0:r.getUniqueValues(t);if(typeof o>"u")return;let i=[o,o];for(let s=0;s<n.flatRows.length;s++){const c=n.flatRows[s].getUniqueValues(t);for(let d=0;d<c.length;d++){const h=c[d];h<i[0]?i[0]=h:h>i[1]&&(i[1]=h)}}return i},ht(e.options,"debugTable"))}function kK(){return e=>pt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(d=>{var h;return(h=e.getColumn(d.id))==null?void 0:h.getCanSort()}),s={};i.forEach(d=>{const h=e.getColumn(d.id);h&&(s[d.id]={sortUndefined:h.columnDef.sortUndefined,invertSorting:h.columnDef.invertSorting,sortingFn:h.getSortingFn()})});const c=d=>{const h=d.map(g=>({...g}));return h.sort((g,m)=>{for(let b=0;b<i.length;b+=1){var w;const T=i[b],E=s[T.id],k=(w=T==null?void 0:T.desc)!=null?w:!1;let C=0;if(E.sortUndefined){const I=g.getValue(T.id),B=m.getValue(T.id),F=I===void 0,_=B===void 0;(F||_)&&(C=F&&_?0:F?E.sortUndefined:-E.sortUndefined)}if(C===0&&(C=E.sortingFn(g,m,T.id)),C!==0)return k&&(C*=-1),E.invertSorting&&(C*=-1),C}return g.index-m.index}),h.forEach(g=>{var m;o.push(g),(m=g.subRows)!=null&&m.length&&(g.subRows=c(g.subRows))}),h};return{rows:c(n.rows),flatRows:o,rowsById:n.rowsById}},ht(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function NK(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function FK(e){return t=>pt(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:c,rowsById:d}=r;const h=o*i,g=h+o;s=s.slice(h,g);let m;t.options.paginateExpandedRows?m={rows:s,flatRows:c,rowsById:d}:m=NK({rows:s,flatRows:c,rowsById:d}),m.flatRows=[];const w=b=>{m.flatRows.push(b),b.subRows.length&&b.subRows.forEach(w)};return m.rows.forEach(w),m},ht(t.options,"debugTable"))}function f2(e,t){return e?IK(e)?A.createElement(e,t):e:null}function IK(e){return AK(e)||typeof e=="function"||OK(e)}function AK(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function OK(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function RK(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=A.useState(()=>({current:wK(t)})),[r,o]=A.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const H4={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},LK=Object.keys(H4).join("|"),_K=new RegExp(LK,"g");function PK(e){return e.replace(_K,t=>H4[t])}const ho={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function jK(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:ho.MATCHES,!n.accessors){const s=d2(e,t,n);return{rankedValue:e,rank:s,accessorIndex:-1,accessorThreshold:n.threshold,passed:s>=n.threshold}}const o=VK(e,n.accessors),i={rankedValue:e,rank:ho.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<o.length;s++){const c=o[s];let d=d2(c.itemValue,t,n);const{minRanking:h,maxRanking:g,threshold:m=n.threshold}=c.attributes;d<h&&d>=ho.MATCHES?d=h:d>g&&(d=g),d=Math.min(d,g),d>=m&&d>i.rank&&(i.rank=d,i.passed=!0,i.accessorIndex=s,i.accessorThreshold=m,i.rankedValue=c.itemValue)}return i}function d2(e,t,n){return e=p2(e,n),t=p2(t,n),t.length>e.length?ho.NO_MATCH:e===t?ho.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?ho.EQUAL:e.startsWith(t)?ho.STARTS_WITH:e.includes(` ${t}`)?ho.WORD_STARTS_WITH:e.includes(t)?ho.CONTAINS:t.length===1?ho.NO_MATCH:BK(e).includes(t)?ho.ACRONYM:YK(e,t))}function BK(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(i=>{t+=i.substr(0,1)})}),t}function YK(e,t){let n=0,r=0;function o(d,h,g){for(let m=g,w=h.length;m<w;m++)if(h[m]===d)return n+=1,m+1;return-1}function i(d){const h=1/d,g=n/t.length;return ho.MATCHES+g*h}const s=o(t[0],e,0);if(s<0)return ho.NO_MATCH;r=s;for(let d=1,h=t.length;d<h;d++){const g=t[d];if(r=o(g,e,r),!(r>-1))return ho.NO_MATCH}const c=r-s;return i(c)}function HK(e,t){return e.rank===t.rank?0:e.rank>t.rank?-1:1}function p2(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=PK(e)),e}function UK(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function VK(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const i=t[r],s=zK(i),c=UK(e,i);for(let d=0,h=c.length;d<h;d++)n.push({itemValue:c[d],attributes:s})}return n}const h2={maxRanking:1/0,minRanking:-1/0};function zK(e){return typeof e=="function"?h2:{...h2,...e}}const $K=({thino:e})=>{const t=A.useRef(null);A.useEffect(()=>(t.current&&N.setIcon(t.current,"pin"),()=>{t.current&&(t.current=null)}),[t]);const n=A.useCallback(async()=>{e.pinned?await Me.unpinMemoById(e.id):await Me.pinMemoById(e.id)},[e]);return D.jsx("span",{ref:t,className:fs("pinned-status",e.pinned?"pinned":"not-pinned"),onClick:n})},qK=({thino:e})=>{const t=A.useRef(null);A.useEffect(()=>(t.current&&N.setIcon(t.current,e.thinoType==="TASK-TODO"?"square":e.thinoType==="JOUNRAL"?"calendar":"check-square"),()=>{t.current&&(t.current=null)}),[t,e==null?void 0:e.thinoType]);const n=A.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const r=await Me.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");r&&Me.editMemo(r)},[e]);return D.jsx("span",{ref:t,className:fs("thino-type-status"),onClick:n})},WK=({id:e,path:t})=>{const n=A.useRef(null);A.useEffect(()=>(n.current&&N.setIcon(n.current,"link"),()=>{n.current&&(n.current=null)}),[]);const r=A.useCallback(()=>{!e||!t||Me.openThinoByID(e)},[e,t]);return D.jsxs("span",{className:"source-thino",onClick:r,children:[D.jsx("span",{children:t}),D.jsx("span",{ref:n,className:"source-thino-icon"})]})},GK=({id:e,sourceType:t})=>{const n=A.useRef(null);A.useEffect(()=>{var o;return n.current&&N.setIcon(n.current,((o=Df.find(i=>i.title===t))==null?void 0:o.icon)||"list"),()=>{n.current&&(n.current=null)}},[]);const r=A.useCallback(async()=>{e&&await Me.openThinoByID(e)},[e]);return D.jsx("span",{ref:n,className:"source-type-icon",onClick:r})},m2=(e,t,n,r)=>{const o=jK(e.getValue(t),n);return r({itemRank:o}),o.passed},g2=(e,t,n)=>{var o,i;let r=0;return e.columnFiltersMeta[n]&&(r=HK((o=e.columnFiltersMeta[n])==null?void 0:o.itemRank,(i=t.columnFiltersMeta[n])==null?void 0:i.itemRank)),r===0?vf.alphanumeric(e,t,n):r};function KK({thinos:e}){var g;Q.useReducer(()=>({}),{})[1];const[t,n]=Q.useState([]),[r,o]=Q.useState(""),i=Q.useMemo(()=>[{header:O("Basic Info"),footer:m=>m.column.id,columns:[{accessorKey:"createdAt",header:()=>D.jsx("span",{className:"create-at-header-cell",children:O("Created At")}),cell:m=>m.getValue(),footer:m=>m.column.id,enableColumnFilter:!1},{accessorFn:m=>m.content,id:"content",header:()=>D.jsx("span",{className:"thino-header-cell",children:O("Thino")}),cell:m=>D.jsx(ml,{memo:m.row.original,type:"table"}),footer:m=>m.column.id,filterFn:"fuzzy",sortingFn:g2},{accessorFn:m=>m.thinoType,id:"thinoType",cell:m=>D.jsx(qK,{thino:m.row.original}),header:()=>D.jsx("span",{children:O("Thino Type")}),footer:m=>m.column.id},{accessorFn:m=>m.sourceType,id:"sourceType",cell:m=>D.jsx(GK,{id:m.row.original.id,sourceType:m.getValue()}),header:()=>D.jsx("span",{children:O("Source Type")}),footer:m=>m.column.id}]},{header:O("Additional Info"),footer:m=>m.column.id,columns:[{accessorKey:"pinned",header:()=>D.jsx("span",{children:O("Pinned Status")}),cell:m=>D.jsx($K,{thino:m.row.original}),footer:m=>m.column.id,filterFn:"fuzzy",sortingFn:g2},{accessorKey:"rowStatus",header:()=>D.jsx("span",{children:O("Row status")}),cell:m=>D.jsx("span",{children:m.getValue()==="NORMAL"?"":m.getValue()}),footer:m=>m.column.id},{accessorKey:"path",header:()=>O("Path"),cell:m=>D.jsx(WK,{id:m.row.original.id,path:m.getValue()}),footer:m=>m.column.id}]}],[]),[s,c]=Q.useState(()=>e),d=()=>c(m=>e);A.useEffect(()=>{d()},[e]);const h=RK({data:s,columns:i,filterFns:{fuzzy:m2},initialState:{pagination:{pageSize:20}},state:{columnFilters:t,globalFilter:r},onColumnFiltersChange:n,onGlobalFilterChange:o,globalFilterFn:m2,getCoreRowModel:DK(),getFilteredRowModel:TK(),getSortedRowModel:kK(),getPaginationRowModel:FK(),getFacetedRowModel:CK(),getFacetedUniqueValues:xK(),getFacetedMinMaxValues:MK(),debugTable:!1,debugHeaders:!1,debugColumns:!1});return Q.useEffect(()=>{var m,w;((m=h.getState().columnFilters[0])==null?void 0:m.id)==="createdAt"&&((w=h.getState().sorting[0])==null?void 0:w.id)!=="createdAt"&&h.setSorting([{id:"createdAt",desc:!1}])},[(g=h.getState().columnFilters[0])==null?void 0:g.id]),D.jsxs("div",{className:"table-view",children:[D.jsx("div",{children:D.jsx(Gg,{value:r??"",onChange:m=>o(String(m)),className:"table-search-bar",placeholder:O("Search all columns...")})}),D.jsxs("table",{children:[D.jsx("thead",{children:h.getHeaderGroups().map(m=>D.jsx("tr",{children:m.headers.map(w=>D.jsx("th",{colSpan:w.colSpan,children:w.isPlaceholder?null:D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:fs(w.column.getCanSort()?"filter-header":"","table-header",w.column.id==="content"?"content-header":""),onClick:w.column.getToggleSortingHandler(),children:[f2(w.column.columnDef.header,w.getContext()),{asc:" 🔼",desc:" 🔽"}[w.column.getIsSorted()]??null]}),w.column.getCanFilter()?D.jsx(QK,{column:w.column,table:h}):null]})},w.id))},m.id))}),D.jsx("tbody",{children:h.getRowModel().rows.map(m=>D.jsx("tr",{className:fs(m.getValue("pinned")?"pinned":""),children:m.getVisibleCells().map(w=>D.jsx("td",{children:f2(w.column.columnDef.cell,w.getContext())},w.id))},m.id))})]}),D.jsxs("div",{className:"table-nav-bar",children:[D.jsx("button",{className:"prev-start-btn",onClick:()=>h.setPageIndex(0),disabled:!h.getCanPreviousPage(),children:"<<"}),D.jsx("button",{className:"prev-btn",onClick:()=>h.previousPage(),disabled:!h.getCanPreviousPage(),children:"<"}),D.jsx("button",{className:"next-btn",onClick:()=>h.nextPage(),disabled:!h.getCanNextPage(),children:">"}),D.jsx("button",{className:"next-end-btn",onClick:()=>h.setPageIndex(h.getPageCount()-1),disabled:!h.getCanNextPage(),children:">>"}),D.jsxs("span",{className:"table-page-info",children:[D.jsx("div",{children:O("Page")}),D.jsxs("strong",{children:[h.getState().pagination.pageIndex+1," of ",h.getPageCount()]})]}),D.jsxs("span",{className:"table-page-jump",children:["| ",O("Go to page"),":",D.jsx("input",{type:"number",defaultValue:h.getState().pagination.pageIndex+1,onChange:m=>{const w=m.target.value?Number(m.target.value)-1:0;h.setPageIndex(w)},className:"jump-inputer"})]}),D.jsx("select",{value:h.getState().pagination.pageSize,onChange:m=>{h.setPageSize(Number(m.target.value))},children:[10,20,30,40,50].map(m=>D.jsxs("option",{value:m,children:[O("Show")," ",m," ",O("rows")]},m))})]})]})}function QK({column:e,table:t}){var i,s,c,d,h,g,m,w,b;const n=(i=t.getPreFilteredRowModel().flatRows[0])==null?void 0:i.getValue(e.id),r=e.getFilterValue(),o=Q.useMemo(()=>typeof n=="number"?[]:Array.from(e.getFacetedUniqueValues().keys()).sort(),[e.getFacetedUniqueValues()]);return typeof n=="number"?D.jsx("div",{children:D.jsxs("div",{className:"filter-input-group",children:[D.jsx(Gg,{type:"number",min:Number(((s=e.getFacetedMinMaxValues())==null?void 0:s[0])??""),max:Number(((c=e.getFacetedMinMaxValues())==null?void 0:c[1])??""),value:(r==null?void 0:r[0])??"",onChange:T=>e.setFilterValue(E=>[T,E==null?void 0:E[1]]),placeholder:`Min ${(d=e.getFacetedMinMaxValues())!=null&&d[0]?`(${(h=e.getFacetedMinMaxValues())==null?void 0:h[0]})`:""}`,className:"filter-input-short"}),D.jsx(Gg,{type:"number",min:Number(((g=e.getFacetedMinMaxValues())==null?void 0:g[0])??""),max:Number(((m=e.getFacetedMinMaxValues())==null?void 0:m[1])??""),value:(r==null?void 0:r[1])??"",onChange:T=>e.setFilterValue(E=>[E==null?void 0:E[0],T]),placeholder:`Max ${(w=e.getFacetedMinMaxValues())!=null&&w[1]?`(${(b=e.getFacetedMinMaxValues())==null?void 0:b[1]})`:""}`,className:"filter-input-short"})]})}):D.jsx(D.Fragment,{children:o.length>1?D.jsxs(D.Fragment,{children:[e.id!=="path"&&e.id!=="content"&&D.jsx("datalist",{id:e.id+"list",children:o.slice(0,5e3).map(T=>D.jsx("option",{value:T},T))}),D.jsx(Gg,{type:"text",value:r??"",onChange:T=>e.setFilterValue(T),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,className:"filter-input-long",list:e.id+"list"})]}):""})}function Gg({value:e,onChange:t,debounce:n=500,...r}){const[o,i]=Q.useState(e);return Q.useEffect(()=>{i(e)},[e]),Q.useEffect(()=>{const s=setTimeout(()=>{t(o)},n);return()=>clearTimeout(s)},[o]),D.jsx("input",{...r,value:o,onChange:s=>i(s.target.value)})}let Y1;function ZK(e){const t=e.filter(r=>r.pinned),n=e.filter(r=>!r.pinned);return[...t,...n]}function JK(e){const t={};for(const n of e){const r=N.moment(n.createdAt,"YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD");if(n.pinned){t.PINNED||(t.PINNED=[]),t.PINNED.push(n);continue}t[r]||(t[r]=[]),t[r].push(n)}return t}function Ig(e){const{tag:t,duration:n,type:r,text:o,filter:i}=e,s=ln.getQueryById(i);return!(!!(t||n&&n.from<n.to||r||o||s)||s)}const XK=({tempMemos:e,query:t,HideDoneTasks:n})=>{const r=e.filter(m=>m.rowStatus!=="ARCHIVED"&&!(m.deletedAt!==""&&m.deletedAt)),{tag:o,duration:i,type:s,text:c,filter:d}=t,h=ln.getQueryById(d);return!!(o||i&&i.from<i.to||s||c||h)||h||n?r.filter(m=>{let w=!0;if(m.thinoType!==void 0&&n&&m.thinoType==="TASK-DONE"&&(w=!1),m.content.contains("comment:")&&(w=!1),h){const b=JSON.parse(h.querystring);Array.isArray(b)&&(w=Th(m,b))}if(o){const b=new Set;for(const T of Array.from(m.content.match(ir)??[])){const k=T.replace(ir,"$1").trim().split("/");let C="";for(const I of k)C+=I,b.add(C),C+="/"}for(const T of Array.from(m.content.match(Lr)??[])){const k=T.replace(Lr,"$1").trim().split("/");let C="";for(const I of k)C+=I,b.add(C),C+="/"}for(const T of Array.from(m.content.match(_o)??[])){const k=T.replace(_o,"$2").trim().split("/");let C="";for(const I of k)C+=I,b.add(C),C+="/"}b.has(o)||(w=!1)}return i&&i.from<i.to&&(Ue.getTimeStampByDate(m.createdAt)<i.from||Ue.getTimeStampByDate(m.createdAt)>i.to)&&(w=!1),s&&(s==="NOT_TAGGED"&&(m.content.match(ir)!==null||m.content.match(_o)!==null||m.content.match(Lr)!==null)||s==="LINKED"&&m.content.match(Rf)===null||s==="IMAGED"&&m.content.match(Lf)===null||s==="CONNECTED"&&m.content.match(Ou)===null)&&(w=!1),c&&!m.content.toLowerCase().includes(c.toLowerCase())&&(w=!1),w}):r.filter(m=>!m.content.contains("comment:"))},eQ=({updateThinosCount:e})=>{const{locationState:{query:t},memoState:{memos:n},globalState:{memoListView:r},dailyNotesState:{app:o,settings:i,verifyState:s,plugin:c}}=A.useContext(Nt),[d,h]=A.useState(!1),[g,m]=A.useState(!1),[w,b,T]=Or([]),[E,k]=A.useState([]),[C,I]=A.useState({}),[B,F]=A.useState((o==null?void 0:o.loadLocalStorage("showDayMark"))||!1),[_,R,j]=Or([]),z=A.useRef(0),q=A.useRef(!1),$=A.useRef(null),J=A.useRef(null),ae=A.useRef(null),ie=A.useRef(null),ge=A.useRef(!1);A.useEffect(()=>()=>{J.current&&(J.current=null),ae.current&&(ae.current=null),ie.current&&(ie.current=null)},[]),A.useLayoutEffect(()=>{if((n.length!==0||!o)&&ge.current===!0)return;const fe=tQ(o);!fe||fe.length===0||(R(fe),k(fe),F((o==null?void 0:o.loadLocalStorage("showDayMark"))||!1))},[o]),A.useEffect(()=>{if(n.length===0&&!Me.initialized)return;h(!1);const fe=ZK(n),De=XK({tempMemos:fe,query:t,HideDoneTasks:(i==null?void 0:i.HideDoneTasks)||!1});return ge.current=!0,e&&e(De.length),R(De),()=>{ge.current=!1}},[n,t,i==null?void 0:i.HideDoneTasks]),A.useEffect(()=>{b(_.slice(0,w.length>20?Math.min(w.length,40):40))},[_]),A.useEffect(()=>{var fe;w.length<40&&((fe=ae.current)==null||fe.click()),Y1=_},[_]),A.useEffect(()=>{(Ig(t)&&w.length<_.length||w.length<_.length&&!Ig(t))&&m(!1),(Ig(t)&&w.length===n.length&&n.length>0||!Ig(t)&&w.length===_.length&&_.length>0)&&m(!0),nQ(w||[],o),k(w),o.saveLocalStorage("showDayMark",i==null?void 0:i.showDayMark),F((i==null?void 0:i.showDayMark)||!1),i!=null&&i.showDayMark&&I(JK(w))},[w,i==null?void 0:i.showDayMark]),A.useEffect(()=>{if(!J.current)return;const fe=async()=>{q.current||(z.current++,await pe(),z.current>=1&&(q.current=!0,setTimeout(()=>{z.current=0,q.current=!1},3e3)))};w.length<40&&fe();const De=new IntersectionObserver(([re])=>{if(re.isIntersecting){if(g)return;fe()}else z.current=0,q.current=!1});return J!=null&&J.current&&De.observe(J.current),()=>{J!=null&&J.current&&De.unobserve(J.current)}},[d,g,J]),A.useEffect(()=>{var fe;(fe=ie.current)==null||fe.scrollTo({top:0})},[t]);const pe=async()=>{try{if(j.current.length>T.current.length){h(!0);const fe=Math.min(T.current.length+40,j.current.length)-T.current.length,De=j.current.slice(T.current.length,T.current.length+fe);b(re=>[...re,...De]),h(!1),m(De.length<40)}}catch(fe){console.error(fe),new N.Notice(fe.response.data.message)}};return D.jsxs("div",{className:`memolist-wrapper ${g?"completed":""}`,ref:ie,children:[D.jsxs("div",{ref:$,className:"memolist-container",children:[r==="calendar"&&D.jsx(HG,{thinos:_}),r==="table"&&D.jsx(KK,{thinos:_}),(!B||r!=="waterfall")&&r!=="calendar"&&D.jsxs(bw,{breakpointCols:r==="waterfall"?3:1,className:`${r}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:[B&&r==="list"&&Object.keys(C).length>0&&D.jsx(D.Fragment,{children:Object.keys(C).map(fe=>D.jsx(BD,{type:"list",thinos:C[fe],dayMark:fe},fe))}),!B&&E.map((fe,De)=>D.jsx(ml,{memo:fe},`${fe.id}-${N.moment(fe.updatedAt,"YYYY-MM-DD HH:mm:ss").format("x")}-${De}`))]}),B&&r==="waterfall"&&Object.keys(C).length>0&&D.jsx(D.Fragment,{children:Object.keys(C).map(fe=>D.jsx(BD,{type:"waterfall",thinos:C[fe],dayMark:fe},fe))})]}),D.jsx("div",{ref:J,className:fs("status-text-container",r==="calendar"||r==="table"?"hidden":""),children:D.jsx("p",{className:"status-text",children:d?O("Fetching data..."):g?_.length===0?O("Noooop!"):O("All Data is Loaded 🎉"):D.jsx(D.Fragment,{children:D.jsx("span",{ref:ae,className:"cursor-pointer hover:text-green-600",onClick:pe,children:O("fetch more")})})})})]})};function U4(e){return`memosListCache:${e}`}function tQ(e){var t;try{const n=U4(e.appId),r=zn.get([n])[n];return r?((t=JSON.parse(r))==null?void 0:t.memos)??[]:[]}catch(n){return console.error(n),[]}}function nQ(e,t){try{if(!e)return;const n=e==null?void 0:e.slice(0,100),r=U4(t.appId);zn.set({[r]:JSON.stringify({memos:n})})}catch(n){console.error(n)}}const rQ=e=>{const t=[];return e.map(n=>{t.length==0?t.push({date:N.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]}):t.some(o=>{if(o.date==N.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"))return o.have.push(n),!0})||t.push({date:N.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]})}),t},oQ=e=>Me.getState().commentMemos.filter(t=>t.linkId===e.hasId).sort((t,n)=>Ue.getTimeStampByDate(t.createdAt)-Ue.getTimeStampByDate(n.createdAt)).map(t=>({...t,createdAtStr:Ue.getDateTimeString(t.createdAt),dateStr:Ue.getDateString(t.createdAt)})),aQ=e=>{const t=ut.getState().settings,n=q8(),r=t!=null&&t.ShowDate?" ":"",o="YYYY/MM/DD HH:mm:ss",i=/comment:(.*)$/g,s=/^\d{14}/g,c=(m,w,b)=>{const T=N.moment(m.createdAt,o).format("HH:mm");return b?b.replace(/{TIME}/g,T).replace(/{CONTENT}/g,w):`${T} ${w}`},d=m=>{const w=m.match(/TASK-(.*)?/g);return w?w[1]:""},h=m=>m==="TASK-TODO"?"- [ ] ":m==="TASK-DONE"?"- [x] ":m.match(/TASK-(.*)?/g)?`- [${d(m)}] `:"- ",g=m=>m.reduce((w,b)=>{const T=b.sourceType!=="MULTI"?`${b.content}`:`[[${b.path}]]`,E=t!=null&&t.ShowTime?c(b,T,t==null?void 0:t.DefaultMemoComposition):T,k=`${h(b.thinoType)}${E}`;let C="";return t.CommentOnMemos&&b.hasId!==void 0&&b.hasId!==""&&(C=oQ(b).reduce((B,F)=>{const _=h(F.thinoType),R=F.content.replace(i,"").replace(s,""),j=t!=null&&t.ShowDate?`${_}[[${N.moment(F.createdAt).format(n)}]] ${N.moment(F.createdAt).format("HH:mm")} ${R}`:`${_}${R}`;return B+r+" "+j+`
`},"")),w+r+k.replace(/ \^\S{6}/g,"")+`
`+C},"");return e.reduce((m,w)=>{const b=t!=null&&t.ShowDate?`- [[${N.moment(w.date,"YYYY-MM-DD").format(n)}]]
`:"",T=g(w.have),E=t!=null&&t.ShowDate&&(t!=null&&t.AddBlankLineWhenDate)&&!(t!=null&&t.CommentOnMemos)?`
`:"";return m+b+T+E},"").replace(/<br>/g,`
`)},ey=({thinosCount:e})=>{const{locationState:{query:t}}=A.useContext(Nt),{tag:n,duration:r,type:o,text:i,filter:s}=t,c=ln.getQueryById(s),d=!!(n||r&&r.from<r.to||o||i||c),h=async()=>{if(!(Y1.length>0))return;const g=rQ(Y1),m=aQ(g);await Ue.copyTextToClipboard(m),new N.Notice(O("Copied to clipboard Successfully"))};return D.jsxs("div",{className:`filter-query-container ${d?"":"hidden"}`,children:[D.jsxs("div",{className:"filter-query",children:[D.jsx("span",{className:"tip-text",children:O("FILTER")}),D.jsxs("div",{className:"filter-item-container "+(c?"":"hidden"),onClick:()=>{it.setMemoFilter("")},children:[D.jsx("span",{className:"icon-text",children:"🔖"})," ",c==null?void 0:c.title]}),D.jsxs("div",{className:"filter-item-container "+(n?"":"hidden"),onClick:()=>{it.setTagQuery("")},children:[D.jsx("span",{className:"icon-text",children:"🏷️"})," ",n]}),D.jsxs("div",{className:"filter-item-container "+(o?"":"hidden"),onClick:()=>{it.setMemoTypeQuery("")},children:[D.jsx("span",{className:"icon-text",children:"📦"})," ",J7(o)]}),r&&r.from<r.to&&D.jsxs("div",{className:"filter-item-container",children:[D.jsxs("div",{className:"day-picker-component-group",children:[D.jsx("span",{className:"icon-text",children:"🗓️"})," ",D.jsx(ov,{type:"text",startOrEnd:"start",defaultValue:N.moment(r.from,"x").valueOf(),handleValueChange:g=>{const m=N.moment(r.to,"x"),w=N.moment(g,"x"),b=w.isAfter(m)||w.isSame(m);it.setFromAndToQuery(b?m.startOf("day").valueOf():N.moment(g,"x").startOf("day").valueOf(),r.to)}}),D.jsx("span",{children:O("to")}),D.jsx(ov,{type:"text",startOrEnd:"end",defaultValue:N.moment(r.to,"x").add(1,"days").valueOf(),handleValueChange:g=>{const m=N.moment(r.from,"x"),w=N.moment(g,"x"),b=w.isBefore(m)||w.isSame(m),T=N.moment(g,"x").endOf("day").valueOf();it.setFromAndToQuery(r.from,b?m.endOf("day").valueOf():T)}})]}),D.jsx("div",{ref:g=>g&&N.setIcon(g,"x"),className:"btn close-btn",onClick:()=>{it.setFromAndToQuery(0,0)}})]}),D.jsxs("div",{className:"filter-item-container "+(i?"":"hidden"),onClick:()=>{it.setTextQuery("")},children:[D.jsx("span",{className:"icon-text",children:"🔍"})," ",i]})]}),D.jsxs("div",{className:"thino-filter-items",children:[e&&D.jsx("div",{className:"thinos-count",children:`${e?`${e} Thinos `:""}`}),D.jsx("div",{ref:g=>{g&&N.setIcon(g,"copy"),g&&N.setTooltip&&N.setTooltip(g,O("Copy filtered thinos to clipboard"))},className:"btn copy-memo",onClick:h})]})]})};function iQ(){const{settings:e,app:t,view:n}=ut.getState(),{globalState:{loaded:r}}=A.useContext(Nt),o=N.Platform.isMobile&&e.DefaultEditorLocation==="Bottom",i=Q.useRef(null),[s,c]=Q.useState(0);A.useEffect(()=>{if(!t||!r||!n||!(t==null?void 0:t.loadLocalStorage("tokenForSync"))||!e.startSync)return;i.current=window.setInterval(async()=>{const w=H1(t);await d(w)},3e4),n.registerInterval(i.current);const m=H1(t);return d(m),()=>{i.current&&window.clearInterval(i.current)}},[n,t,r,e.startSync]);const d=async g=>{if(!e.startSync||!(t!=null&&t.loadLocalStorage("tokenForSync")))return;const m=await g7(g);if(!m||m.length===0)return;m.sort((T,E)=>N.moment(T.createdAt,"YYYY-MM-DD HH:mm:ss").isAfter(N.moment(E.createdAt,"YYYY-MM-DD HH:mm:ss"))?1:-1);const w=m.filter(T=>!T.deleted),b=m.filter(T=>T.deleted);for(let T=0;T<w.length;T++){const E=w[T],k=await Me.createOrPatchThinoFromWeb(E);k&&Me.pushMemo(k)}for(let T=0;T<b.length;T++){const E=b[T],k=Me.getMemoByWebId(E.id);k&&await Me.deleteMemoById(k.id,"local")}Me.updateTagsState(),lQ(t)},h=[D.jsx(ey,{thinosCount:s},"filter"),D.jsx(eQ,{updateThinosCount:g=>{c(g)}},"list")];return D.jsx(D.Fragment,{children:o?[D.jsx(PD,{syncThino:d},"header"),...h,D.jsx(Zp,{className:"mod-editor-bottom"},"editor")]:[D.jsx(PD,{syncThino:d},"header"),D.jsx(Zp,{},"editor"),...h]})}function sQ(e){try{e!=null&&e.saveLocalStorage&&e.saveLocalStorage("thinoLastUpdated",N.moment("2000-01-01 00:01:00","YYYY-MM-DD HH:mm:ss").format("x"))}catch(t){console.error(t)}}function H1(e){try{const t=(e==null?void 0:e.loadLocalStorage)&&(e==null?void 0:e.loadLocalStorage("thinoLastUpdated"));return t||N.moment("2000-01-01 00:01:00","YYYY-MM-DD HH:mm:ss").format("x")}catch(t){return console.error(t),N.moment().format("x")}}function lQ(e){try{e!=null&&e.saveLocalStorage&&e.saveLocalStorage("thinoLastUpdated",N.moment().format("x"))}catch(t){console.error(t)}}const uQ=e=>{const{memo:t,handleDeletedMemoAction:n}=e,{dailyNotesState:r}=A.useContext(Nt),o={...t,createdAtStr:Ue.getDateTimeString(t.createdAt),deletedAtStr:Ue.getDateTimeString(t.deletedAt??t.createdAt)},i=Q.useRef(null),s=Q.useRef(null),[c,d]=Q.useState(""),[h,g]=Oa(!1),m={restore:A.useRef(null),delete:A.useRef(null),source:A.useRef(null)};A.useEffect(()=>{s&&(N.setIcon(m.restore.current,"archive-restore"),N.setIcon(m.delete.current,"trash"),N.setIcon(m.source.current,"home"))},[s]),A.useEffect(()=>{if(!i.current||!s.current||i.current.hasChildNodes()&&t.content===c||!r.view)return;const k=r.view;d(t.content),i.current.hasChildNodes()&&i.current.empty();async function C(){var B;await N.MarkdownRenderer.render(r.app,t.content.replaceAll(/<br>/g,`
`)+`
`,i.current,t.path,k);const I=(B=i.current)==null?void 0:B.querySelectorAll(".internal-link");I==null||I.forEach(F=>{const _=F,R=_.getAttribute("data-href");if(!R)return;r.app.metadataCache.getFirstLinkpathDest(R,t.path)||F.classList.add("is-unresolved"),_.addEventListener("mouseover",z=>{z.stopPropagation(),r.app.workspace.trigger("hover-link",{event:z,source:"thino",hoverParent:k.containerEl,targetEl:_,linktext:R,sourcePath:_.href})})})}C()},[t.content,s]);const w=async()=>{if(h)try{await Me.deleteMemoById(o.id),n(o.id)}catch(k){new N.Notice(k.message)}else g()},b=async()=>{switch(o.sourceType){case"DAILY":await aw(o.id,o.path);break;case"CANVAS":await sw(o.id,o.path);break;case"MULTI":await ow(o.path);break;case"FILE":await iw(o.id,o.path);break}},T=async()=>{try{const k=await Me.restoreMemoById(o.id),C=r.app,I=C==null?void 0:C.loadLocalStorage("tokenForSync");k&&k.webId&&I&&r.settings.startSync&&await w7(k.webId),k&&Me.editMemo(k),n(o.id),new N.Notice(O("RESTORE SUCCEED"))}catch(k){new N.Notice(k.message)}},E=()=>{h&&g(!1)};return D.jsxs("div",{ref:s,className:`memo-wrapper ${"memos-"+o.id}`,onMouseLeave:E,children:[D.jsxs("div",{className:"memo-top-wrapper",children:[D.jsxs("span",{className:"time-text",children:[O("DELETE AT")," ",o.deletedAtStr]}),D.jsxs("div",{className:"btns-container",children:[D.jsx("span",{ref:k=>{k&&N.setIcon(k,"more-horizontal")},className:"btn more-action-btn"}),D.jsx("div",{className:"more-action-btns-wrapper",children:D.jsxs("div",{className:"more-action-btns-container",children:[D.jsxs("div",{className:"more-action-menu-item",children:[D.jsx("span",{ref:m.restore,className:"more-action-item-icon"}),D.jsx("span",{className:"btn restore-btn",onClick:T,children:O("RESTORE")})]}),D.jsxs("div",{className:"more-action-menu-item",children:[D.jsx("span",{ref:m.source,className:"more-action-item-icon"}),D.jsx("span",{className:"btn",onClick:b,children:O("SOURCE")})]}),D.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[D.jsx("span",{ref:m.delete,className:"more-action-item-icon"}),D.jsx("span",{className:`btn delete-btn ${h?"final-confirm":""}`,onClick:w,children:O(h?"CONFIRM":"DELETE")})]})]})})]})]}),D.jsx("div",{ref:i,className:"memo-content-text",onContextMenu:k=>{k.preventDefault(),k.stopPropagation()}})]})},cQ=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=A.useContext(Nt),r=Vf(),[o,i]=A.useState([]),s=Q.useRef(null),c=A.useCallback(({memos:g,query:m,HideDoneTasks:w})=>{const{tag:b,duration:T,type:E,text:k,filter:C}=m,I=ln.getQueryById(C);return!!(b||T&&T.from<T.to||E||k||I)||I||w?g.filter(F=>{let _=!0;if(F.thinoType!==void 0&&w&&F.thinoType==="TASK-DONE"&&(_=!1),F.content.contains("comment:")&&(_=!1),I){const R=JSON.parse(I.querystring);Array.isArray(R)&&(_=Th(F,R))}if(b){const R=new Set;for(const j of Array.from(F.content.match(ir)??[])){const q=j.replace(ir,"$1").trim().split("/");let $="";for(const J of q)$+=J,R.add($),$+="/"}for(const j of Array.from(F.content.match(Lr)??[])){const q=j.replace(Lr,"$1").trim().split("/");let $="";for(const J of q)$+=J,R.add($),$+="/"}for(const j of Array.from(F.content.match(_o)??[])){const q=j.replace(_o,"$2").trim().split("/");let $="";for(const J of q)$+=J,R.add($),$+="/"}R.has(b)||(_=!1)}return T&&T.from<T.to&&(Ue.getTimeStampByDate(F.createdAt)<T.from||Ue.getTimeStampByDate(F.createdAt)>T.to)&&(_=!1),E&&(E==="NOT_TAGGED"&&(F.content.match(ir)!==null||F.content.match(Lr)!==null)||E==="LINKED"&&F.content.match(Rf)===null||E==="IMAGED"&&F.content.match(Lf)===null||E==="CONNECTED"&&F.content.match(Ou)===null)&&(_=!1),k&&!F.content.toLowerCase().includes(k.toLowerCase())&&(_=!1),_}):g},[]);A.useEffect(()=>{i(c({memos:n.filter(g=>g.deletedAt!==""&&g.deletedAt),query:e,HideDoneTasks:!1})),r.setFinish(),it.clearQuery()},[n,s.current]);const d=A.useCallback(g=>{i(m=>m.filter(w=>w.id!==g))},[]),h=A.useCallback(()=>{rt.setShowSiderbarInMobileView(!0)},[]);return D.jsxs("div",{className:"memo-trash-wrapper",ref:s,children:[D.jsx("div",{className:"section-header-container",children:D.jsxs("div",{className:"title-text",children:[D.jsx(Fa,{when:t,children:D.jsx("button",{ref:g=>{g&&N.setIcon(g,"menu")},className:"btn action-btn clickable-icon",onClick:h})}),D.jsx("span",{className:"normal-text",children:O("Recycle bin")}),D.jsxs("span",{className:"go-home-btn",onClick:()=>{it.setPathname("/")},children:["🏠 ",O("Return To Home Page")]})]})}),D.jsx(ey,{}),r.isLoading?D.jsx("div",{className:"tip-text-container",children:D.jsx("span",{className:"tip-text",children:O("Fetching data...")})}):o.length===0?D.jsx("div",{className:"tip-text-container",children:D.jsx("span",{className:"tip-text",children:O("Here is No Memos.")})}):D.jsx("div",{className:"deleted-memos-container",children:o.map(g=>D.jsx(uQ,{memo:g,handleDeletedMemoAction:d},`${g.id}-${g.updatedAt}`))})]})},Ag="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='currentColor'%3e%3cpath%20d='M0%200h24v24H0V0z'%20fill='none'/%3e%3cpath%20d='M19%203H5c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h14c1.1%200%202-.9%202-2V5c0-1.1-.9-2-2-2zm0%2016H5V5h14v14zM17.99%209l-1.41-1.42-6.59%206.59-2.58-2.57-1.42%201.41%204%203.99z'/%3e%3c/svg%3e",Og="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='currentColor'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='none'%20d='M0%200h24v24H0V0z'/%3e%3cpath%20d='M19%205v14H5V5h14m0-2H5c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h14c1.1%200%202-.9%202-2V5c0-1.1-.9-2-2-2z'/%3e%3c/svg%3e",fQ=()=>{const{globalState:e}=A.useContext(Nt),{useTinyUndoHistoryCache:t,shouldHideImageUrl:n,shouldSplitMemoWord:r,shouldUseMarkdownParser:o}=e,i=`👋 你好呀欢迎使用memos!
* ✨ **开源项目**
* 😋 精美且细节的视觉样式;
* 📑 体验优良的交互逻辑;`,s=()=>{rt.setAppSetting({useTinyUndoHistoryCache:!t})},c=()=>{rt.setAppSetting({shouldSplitMemoWord:!r})},d=()=>{rt.setAppSetting({shouldHideImageUrl:!n})},h=()=>{rt.setAppSetting({shouldUseMarkdownParser:!o})},g=async()=>{const m=Me.getState().memos.map(T=>({...T})),w=JSON.stringify(m),b=document.createElement("a");b.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(w)),b.setAttribute("download","data.json"),b.style.display="none",document.body.appendChild(b),b.click(),document.body.removeChild(b)};return D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"section-container preferences-section-container",children:[D.jsx("p",{className:"title-text",children:"Memo 显示相关"}),D.jsx("div",{className:"demo-content-container memo-content-text",dangerouslySetInnerHTML:{__html:n1(i)}}),D.jsxs("label",{className:"form-label checkbox-form-label",onClick:c,children:[D.jsx("span",{className:"normal-text",children:"中英文内容自动间隔"}),D.jsx("img",{className:"icon-img",src:r?Ag:Og})]}),D.jsxs("label",{className:"form-label checkbox-form-label",onClick:h,children:[D.jsx("span",{className:"normal-text",children:"部分 markdown 格式解析"}),D.jsx("img",{className:"icon-img",src:o?Ag:Og})]}),D.jsxs("label",{className:"form-label checkbox-form-label",onClick:d,children:[D.jsx("span",{className:"normal-text",children:"隐藏图片链接地址"}),D.jsx("img",{className:"icon-img",src:n?Ag:Og})]})]}),D.jsxs("div",{className:"section-container preferences-section-container",children:[D.jsx("p",{className:"title-text",children:"编辑器"}),D.jsxs("label",{className:"form-label checkbox-form-label",onClick:s,children:[D.jsxs("span",{className:"normal-text",children:["启用"," ",D.jsx("a",{target:"_blank",href:"https://github.com/boojack/tiny-undo",onClick:m=>m.stopPropagation(),rel:"noreferrer",children:"tiny-undo"})]}),D.jsx("img",{className:"icon-img",src:t?Ag:Og})]})]}),D.jsxs("div",{className:"section-container hidden",children:[D.jsx("p",{className:"title-text",children:"其他"}),D.jsx("div",{className:"btn-container",children:D.jsx("button",{className:"btn export-btn",onClick:g,children:"导出数据(JSON)"})})]})]})},dQ=()=>{const{globalState:{isMobileView:e}}=A.useContext(Nt);A.useEffect(()=>{Me.fetchAllMemos()},[]);const t=A.useCallback(()=>{rt.setShowSiderbarInMobileView(!0)},[]);return D.jsxs("div",{className:"preference-wrapper",children:[D.jsx("div",{className:"section-header-container",children:D.jsxs("div",{className:"title-text",children:[D.jsx(Fa,{when:e,children:D.jsx("button",{className:"action-btn",onClick:t})}),D.jsx("span",{className:"normal-text",children:"账号与设置"})]})}),D.jsx("div",{className:"sections-wrapper",children:D.jsx(fQ,{})})]})},pQ=e=>{const{dailyNotesState:{app:t,settings:n,view:r}}=A.useContext(Nt),{memo:o,handleUnarchivedMemoAction:i}=e,s=Q.useRef(null),c=Q.useRef(null),[d,h]=Q.useState(""),g={...o,createdAtStr:Ue.getDateTimeString(o.createdAt),deletedAtStr:Ue.getDateTimeString(o.deletedAt??o.createdAt)},[m,w]=Oa(!1),b={restore:A.useRef(null),delete:A.useRef(null),source:A.useRef(null)};A.useEffect(()=>{c&&(N.setIcon(b.restore.current,"archive-restore"),N.setIcon(b.delete.current,"trash"),N.setIcon(b.source.current,"home"))},[c]),A.useEffect(()=>{if(!s.current||!c.current||s.current.hasChildNodes()&&o.content===d||!r)return;h(o.content),s.current.hasChildNodes()&&s.current.empty();async function I(){var F;await N.MarkdownRenderer.render(t,o.content.replaceAll(/<br>/g,`
`)+`
`,s.current,o.path,r);const B=(F=s.current)==null?void 0:F.querySelectorAll(".internal-link");B==null||B.forEach(_=>{const R=_,j=R.getAttribute("data-href");if(!j)return;t.metadataCache.getFirstLinkpathDest(j,o.path)||_.classList.add("is-unresolved"),R.addEventListener("mouseover",q=>{q.stopPropagation(),t.workspace.trigger("hover-link",{event:q,source:"thino",hoverParent:r.containerEl,targetEl:R,linktext:j,sourcePath:R.href})})})}I()},[o.content,c]);const T=async()=>{switch(g.sourceType){case"DAILY":await aw(g.id,g.path);break;case"CANVAS":await sw(g.id,g.path);break;case"MULTI":await ow(g.path);break;case"FILE":await iw(g.id,g.path);break}},E=async()=>{if(m)try{if(n.DeleteThinoDirectly)await Me.deleteMemoById(g.id);else{const I=await Me.hideMemoById(g.id);I&&Me.editMemo(I)}}catch(I){new N.Notice(I.message)}else w()},k=async()=>{try{const I=await Me.unarchiveMemo(g);I&&Me.editMemo(I),i(g.id),new N.Notice(O("RESTORE SUCCEED"))}catch(I){new N.Notice(I.message)}},C=()=>{m&&w(!1)};return D.jsxs("div",{ref:c,className:`memo-wrapper ${"memos-"+g.id}`,onMouseLeave:C,children:[D.jsxs("div",{className:"memo-top-wrapper",children:[D.jsxs("span",{className:"time-text",children:[O("ARCHIVED AT")," ",g.updatedAt]}),D.jsxs("div",{className:"btns-container",children:[D.jsx("span",{ref:I=>{I&&N.setIcon(I,"more-horizontal")},className:"btn more-action-btn"}),D.jsx("div",{className:"more-action-btns-wrapper",children:D.jsxs("div",{className:"more-action-btns-container",children:[D.jsxs("div",{className:"more-action-menu-item",children:[D.jsx("span",{ref:b.restore,className:"more-action-item-icon"}),D.jsx("span",{className:"btn restore-btn",onClick:k,children:O("RESTORE")})]}),D.jsxs("div",{className:"more-action-menu-item",children:[D.jsx("span",{ref:b.source,className:"more-action-item-icon"}),D.jsx("span",{className:"btn",onClick:T,children:O("SOURCE")})]}),D.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[D.jsx("span",{ref:b.delete,className:"more-action-item-icon"}),D.jsx("span",{className:`btn delete-btn ${m?"final-confirm":""}`,onClick:E,children:O(m?"CONFIRM":"DELETE")})]})]})})]})]}),D.jsx("div",{ref:s,className:"memo-content-text"})]})},hQ=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=A.useContext(Nt),r=Vf(),[o,i]=A.useState([]),s=Q.useRef(null),c=A.useCallback(({memos:m,query:w,HideDoneTasks:b})=>{const{tag:T,duration:E,type:k,text:C,filter:I}=w,B=ln.getQueryById(I);return!!(T||E&&E.from<E.to||k||C||B)||B||b?m.filter(_=>{let R=!0;if(_.thinoType!==void 0&&b&&_.thinoType==="TASK-DONE"&&(R=!1),_.content.contains("comment:")&&(R=!1),B){const j=JSON.parse(B.querystring);Array.isArray(j)&&(R=Th(_,j))}if(T){const j=new Set;for(const z of Array.from(_.content.match(ir)??[])){const $=z.replace(ir,"$1").trim().split("/");let J="";for(const ae of $)J+=ae,j.add(J),J+="/"}for(const z of Array.from(_.content.match(Lr)??[])){const $=z.replace(Lr,"$1").trim().split("/");let J="";for(const ae of $)J+=ae,j.add(J),J+="/"}for(const z of Array.from(_.content.match(_o)??[])){const $=z.replace(_o,"$2").trim().split("/");let J="";for(const ae of $)J+=ae,j.add(J),J+="/"}j.has(T)||(R=!1)}return E&&E.from<E.to&&(Ue.getTimeStampByDate(_.createdAt)<E.from||Ue.getTimeStampByDate(_.createdAt)>E.to)&&(R=!1),k&&(k==="NOT_TAGGED"&&(_.content.match(ir)!==null||_.content.match(Lr)!==null)||k==="LINKED"&&_.content.match(Rf)===null||k==="IMAGED"&&_.content.match(Lf)===null||k==="CONNECTED"&&_.content.match(Ou)===null)&&(R=!1),C&&!_.content.toLowerCase().includes(C.toLowerCase())&&(R=!1),R}):m},[]);A.useEffect(()=>{i(c({memos:n.filter(m=>m.rowStatus==="ARCHIVED"&&m.deletedAt===""),query:e,HideDoneTasks:!1})),r.setFinish(),it.clearQuery()},[n,s.current]);const d=A.useCallback(m=>{i(w=>w.filter(b=>b.id!==m))},[]),h=A.useCallback(m=>{i(w=>w.filter(b=>b.id!==m))},[]),g=A.useCallback(()=>{rt.setShowSiderbarInMobileView(!0)},[]);return D.jsxs("div",{className:"memo-trash-wrapper",ref:s,children:[D.jsx("div",{className:"section-header-container",children:D.jsxs("div",{className:"title-text",children:[D.jsx(Fa,{when:t,children:D.jsx("button",{ref:m=>{m&&N.setIcon(m,"menu")},className:"btn action-btn clickable-icon",onClick:g})}),D.jsx("span",{className:"normal-text",children:O("ARCHIVE")}),D.jsxs("span",{className:"go-home-btn",onClick:()=>{it.setPathname("/")},children:["🏠 ",O("Return To Home Page")]})]})}),D.jsx(ey,{}),r.isLoading?D.jsx("div",{className:"tip-text-container",children:D.jsx("p",{className:"tip-text",children:O("Fetching data...")})}):o.length===0?D.jsx("div",{className:"tip-text-container",children:D.jsx("p",{className:"tip-text",children:O("Here is No Memos.")})}):D.jsx("div",{className:"deleted-memos-container",children:o.map(m=>D.jsx(pQ,{memo:m,handleUnarchivedMemoAction:h,handleDeletedMemoAction:d},`${m.id}-${m.updatedAt}`))})]})},mQ=()=>{const{dailyNotesState:{app:e},locationState:{query:t},globalState:{isMobileView:n,changedByMemos:r},memoState:{memos:o}}=A.useContext(Nt),i=Vf(),[s,c]=A.useState([]),[d,h]=A.useState([]),g=Q.useRef(null),m=Q.useRef(null),[w,b]=A.useState(!1),[T,E]=A.useState([]),k=Q.useRef([]),C=A.useCallback(({memos:F,query:_,HideDoneTasks:R})=>{const{tag:j,duration:z,type:q,text:$,filter:J}=_,ae=ln.getQueryById(J);return!!(j||z&&z.from<z.to||q||$||ae)||ae||R?F.filter(ge=>{let pe=!0;if(ge.thinoType!==void 0&&R&&ge.thinoType==="TASK-DONE"&&(pe=!1),ge.content.contains("comment:")&&(pe=!1),ae){const fe=JSON.parse(ae.querystring);Array.isArray(fe)&&(pe=Th(ge,fe))}if(j){const fe=new Set;for(const De of Array.from(ge.content.match(ir)??[])){const be=De.replace(ir,"$1").trim().split("/");let V="";for(const G of be)V+=G,fe.add(V),V+="/"}for(const De of Array.from(ge.content.match(Lr)??[])){const be=De.replace(Lr,"$1").trim().split("/");let V="";for(const G of be)V+=G,fe.add(V),V+="/"}for(const De of Array.from(ge.content.match(_o)??[])){const be=De.replace(_o,"$2").trim().split("/");let V="";for(const G of be)V+=G,fe.add(V),V+="/"}fe.has(j)||(pe=!1)}return z&&z.from<z.to&&(Ue.getTimeStampByDate(ge.createdAt)<z.from||Ue.getTimeStampByDate(ge.createdAt)>z.to)&&(pe=!1),q&&(q==="NOT_TAGGED"&&(ge.content.match(ir)!==null||ge.content.match(Lr)!==null)||q==="LINKED"&&ge.content.match(Rf)===null||q==="IMAGED"&&ge.content.match(Lf)===null||q==="CONNECTED"&&ge.content.match(Ou)===null)&&(pe=!1),$&&!ge.content.toLowerCase().includes($.toLowerCase())&&(pe=!1),pe}):F},[]);A.useEffect(()=>{m.current&&(N.setIcon(m.current,"refresh-cw"),e.workspace.on("refresh-review-memos",B))},[m]),A.useEffect(()=>{if(!w)return;const F=[...T].sort(()=>Math.random()-Math.random()).slice(0,10);c(F),b(!1)},[w]),A.useEffect(()=>{if(!(T.length>0))return;const F=[...T].sort(()=>Math.random()-Math.random()).slice(0,10);c(F),b(!1)},[T]),A.useEffect(()=>{g.current&&(E(C({memos:o,query:t,HideDoneTasks:!1}).filter(F=>F.rowStatus!=="ARCHIVED"&&!(F.deletedAt!==""&&F.deletedAt))),i.setFinish(),it.clearQuery())},[o,g.current]),A.useEffect(()=>{if(r&&k.current.length>0){const F=T.filter(R=>k.current.includes(R.id)),_=k.current.map(R=>F.find(j=>j.id===R)).filter(R=>R!==void 0);h(_);return}k.current=s.map(F=>F.id),h(s)},[s]),A.useEffect(()=>{if(s.length===0)return;const F=C({memos:s,query:t,HideDoneTasks:!1});h(F)},[t]);const I=A.useCallback(()=>{rt.setShowSiderbarInMobileView(!0)},[]),B=()=>{b(!0)};return D.jsxs("div",{className:"memo-review-wrapper",ref:g,children:[D.jsx("div",{className:"section-header-container",children:D.jsxs("div",{className:"title-wrapper",children:[D.jsxs("div",{className:"title-btns-left-wrapper",children:[D.jsx(Fa,{when:n,children:D.jsx("button",{ref:F=>{F&&N.setIcon(F,"menu")},className:"btn action-btn clickable-icon",onClick:I})}),D.jsx("span",{className:"normal-text",children:O("Random Review")}),D.jsx("span",{ref:m,onClick:B,className:"refresh-icon"})]}),D.jsx("div",{className:"title-btns-right-wrapper",children:D.jsxs("span",{className:"go-home-btn",onClick:()=>{it.setPathname("/")},children:["🏠 ",O("Return To Home Page")]})})]})}),D.jsx(ey,{}),i.isLoading?D.jsx("div",{className:"tip-text-container",children:D.jsx("span",{className:"tip-text",children:O("Fetching data...")})}):o.length===0?D.jsx("div",{className:"tip-text-container",children:D.jsx("span",{className:"tip-text",children:O("Here is No Memos.")})}):D.jsx("div",{className:"review-memos-container",children:d.map(F=>D.jsx(ml,{memo:F},`${F==null?void 0:F.id}-${F.createdAt}`))})]})},gQ={"/recycle":D.jsx(cQ,{}),"/setting":D.jsx(dQ,{}),"/archive":D.jsx(hQ,{}),"/review":D.jsx(mQ,{}),"*":D.jsx(iQ,{})},V4=e=>t=>{for(const n of Object.keys(e))if(n===t)return e[n];return e["*"]},vQ=V4(bF),yQ=V4(gQ);function wQ({app:e}){const{locationState:{pathname:t},dailyNotesState:{settings:n}}=A.useContext(Nt);return A.useEffect(()=>{Me.fetchAllMemos()},[]),!tE()&&!e.plugins.getPlugin("periodic-notes")&&(n!=null&&n.EnabledLocationList.find(r=>r.value==="DAILY"))&&new N.Notice(O("Check if you opened Daily Notes Plugin Or Periodic Notes Plugin")),D.jsx(If,{store:xe,context:Nt,children:vQ(t)})}const Ar="thino_view";class bQ extends N.EditorSuggest{constructor(n,r){super(n);ye(this,"root");ye(this,"editor");ye(this,"cursor");ye(this,"plugin");this.plugin=r}checkInMemosView(n){var i;const r=n.containerEl;if(!r)return!1;const o=(i=r.parentElement)==null?void 0:i.parentElement;return(o==null?void 0:o.classList.contains("common-editor-inputer"))||!1}onTrigger(n,r){const i=r.getLine(n.line)[n.ch-1];return this.checkInMemosView(r)&&i==="@"?(this.cursor=n,this.editor=r,N.Platform.isMobile?(new $3(this.app,"text",s=>{this.selectSuggestion(parseInt(s),new MouseEvent("click"))}).open(),null):{start:{line:n.line,ch:n.ch-1},end:n,query:""}):null}getSuggestions(){return[parseInt(N.moment().startOf("day").format("x"))]}renderSuggestion(n,r){var o;(o=this.suggestEl)==null||o.addClass("memos-date-selector"),r.empty(),this.root=Lu.createRoot(r),this.root.render(D.jsx(Q.StrictMode,{children:D.jsx(kv,{className:"editor-date-picker",datestamp:n,handleDateStampChange:this.selectSuggestion.bind(this)})}))}selectSuggestion(n,r){var s;if(r instanceof KeyboardEvent||r instanceof PointerEvent&&!r.target.hasClass("day-item")&&!r.target.hasClass("null"))return;let o="",i="";switch(this.plugin.settings.InsertDateFormat){case"Dataview":o="[due::",i="]";break;case"Tasks":o="📆";break}this.editor.replaceRange(o+N.moment(n).format("YYYY-MM-DD")+i,{line:this.cursor.line,ch:this.cursor.ch-1},this.cursor),(s=this.root)==null||s.unmount(),this.close()}}class DQ extends N.EditorSuggest{constructor(n,r){super(n);ye(this,"root");ye(this,"editor");ye(this,"cursor");ye(this,"plugin");ye(this,"memos",[]);this.plugin=r,this.memos=Me.getState().memos.filter(o=>!o.deletedAt&&o.rowStatus!=="ARCHIVED")}checkInMemosView(n){var i;const r=n.containerEl;if(!r)return!1;const o=(i=r.parentElement)==null?void 0:i.parentElement;return(o==null?void 0:o.classList.contains("common-editor-inputer"))||!1}fuzzySearchItemsOptimized(n,r){const o=N.prepareFuzzySearch(n);return r.map(i=>{const s=o(i.content);return s?{item:i,match:s}:null}).filter(Boolean)}onTrigger(n,r){if(!this.checkInMemosView(r))return null;const i=r.getLine(n.line).slice(0,n.ch);if(i.lastIndexOf("~")===-1)return null;const s=i.slice(i.lastIndexOf("~")+1,n.ch);if(i[i.lastIndexOf("~")-1]!==" "&&i.lastIndexOf("~")!==0)return null;const c=s.trim();return this.memos=Me.getState().memos.filter(d=>!d.deletedAt&&d.rowStatus!=="ARCHIVED"),{start:{line:n.line,ch:n.ch-c.length},end:n,query:c}}getSuggestions(n){return n.query?this.fuzzySearchItemsOptimized(n.query,this.memos).sort((o,i)=>i.match.score-o.match.score).map(o=>o.item).map(o=>({time:o.createdAt,id:o.id,content:o.content})):this.memos.map(o=>({time:o.createdAt,id:o.id,content:o.content}))}renderSuggestion(n,r){r.toggleClass("thino-suggestion",!0),r.createEl("div",{cls:"thino-suggestion-time",text:n.time}),r.createEl("div",{cls:"thino-suggestion-container"}).createEl("div",{cls:"thino-suggestion-content",text:n.content})}selectSuggestion(n){const r=n.id;this.context.editor.replaceRange("MARK: [@THINO]("+r+")",{line:this.context.end.line,ch:this.context.start.ch-1},this.context.end)}}class SQ{constructor(){ye(this,"path","/fake-file-that-generated-for-thino.png");ye(this,"basename","fake-file-that-generated-for-thino");ye(this,"extension","png");ye(this,"deleted",!1);ye(this,"name","fake-file-that-generated-for-thino.png");ye(this,"parent",null);ye(this,"stat");ye(this,"vault",null)}static[Symbol.hasInstance](t){return t instanceof N.TFile}setPath(t){}getNewPathAfterRename(t){}getShortName(){}cache(t){}updateCacheLimit(){}}function EQ(e){try{const t=Lu.createRoot(e);return t.render(D.jsx(Q.StrictMode,{children:D.jsx(If,{store:xe,context:Nt,children:D.jsx(Zp,{})})})),t}catch(t){console.error(t)}}class bu extends N.ItemView{constructor(n,r){super(n);ye(this,"scope",new N.Scope(this.app.scope));ye(this,"root");ye(this,"plugin");ye(this,"hoverPopover");ye(this,"memosComponent");ye(this,"editor",null);ye(this,"navigation",!1);ye(this,"file",new SQ);this.plugin=r,this.registerScope()}getDisplayText(){return"Thino"}getIcon(){return"Memos"}getViewType(){return Ar}getMode(){return"source"}registerScope(){const{scope:n}=this;n.register(["Mod"],"Enter",()=>{});for(let r=0;r<Df.length-1;r++)n.register(["Alt"],(r+1).toString(),()=>{});n.register([],"i",r=>{const o=r.target;o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.hasClass("cm-line")||o.hasClass("cm-content")||(r.preventDefault(),this.plugin.app.workspace.trigger("focus-on-textarea"))}),n.register(["Mod"],"f",r=>{const o=r.target;o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.hasClass("cm-line")||o.hasClass("cm-content")||(r.preventDefault(),this.plugin.app.workspace.trigger("focus-on-searchBar"))}),n.register([],"o",r=>{const o=r.target;o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.hasClass("cm-line")||o.hasClass("cm-content")||(r.preventDefault(),this.plugin.app.workspace.trigger("focus-on-searchBar"))}),n.register([],"Escape",()=>{setTimeout(()=>{this.plugin.app.workspace.trigger("blur-on-memos")},20)})}async onFileDeleted(n){var d,h,g;const r=Bp(n,"day"),o=n.path.contains(".thino")&&n.path.contains(".canvas"),i=n.path.contains(".thino")&&n.path.contains(".md"),s=((d=this.plugin.settings)==null?void 0:d.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",c=(g=((h=n.parent)==null?void 0:h.path)||n.path)==null?void 0:g.contains(s==null?void 0:s.trim());(r||o&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="CANVAS"))&&(await Me.removeMemosInFile(n),Me.updateTagsState()),c&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="MULTI")&&(await Me.removeMemosInFile(n,s),Me.updateTagsState()),i&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="FILE")&&(await Me.removeMemosInFile(n),Me.updateTagsState())}async onFileModified(n){var d;if(rt.getState().changedByMemos){rt.setChangedByMemos(!1);return}const r=Bp(n,"day"),o=n.path.contains(".thino")&&n.path.contains(".canvas"),i=n.path.contains(".thino")&&n.path.contains(".md"),s=((d=this.plugin.settings)==null?void 0:d.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",c=n.parent.path.contains(s==null?void 0:s.trim());if(r||o&&this.plugin.settings.EnabledLocationList.find(h=>h.value==="CANVAS")){await Me.updateMemosInFile(n),Me.updateTagsState();return}c&&this.plugin.settings.EnabledLocationList.find(h=>h.value==="MULTI")&&(await Me.updateMemosInFile(n,s),Me.updateTagsState()),i&&this.plugin.settings.EnabledLocationList.find(h=>h.value==="FILE")&&(await Me.updateMemosInFile(n),Me.updateTagsState())}async onFileCreated(n){var r;if(this.app.workspace.layoutReady&&this.memosComponent){const o=Bp(n,"day"),i=n.path.contains(".thino")&&n.path.contains(".canvas"),s=n.path.contains(".thino")&&n.path.contains(".md"),c=((r=this.plugin.settings)==null?void 0:r.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",d=n.parent.path.contains(c==null?void 0:c.trim());if(o){await ut.updateDailyNotes(n,!1),await Me.updateMemosInFile(n),Me.updateTagsState();return}if(i&&this.plugin.settings.EnabledLocationList.find(h=>h.value==="CANVAS")){await Me.updateMemosInFile(n),Me.updateTagsState();return}d&&this.plugin.settings.EnabledLocationList.find(h=>h.value==="MULTI")&&(await Me.updateMemosInFile(n,c),Me.updateTagsState()),s&&this.plugin.settings.EnabledLocationList.find(h=>h.value==="FILE")&&(await Me.updateMemosInFile(n),Me.updateTagsState())}}async onResize(){var r;super.onResize();const n=this.leaf;if(n&&n.height!==0){if(n.width>950){n.view.containerEl.classList.toggle("mobile-view",!1),rt.setIsMobileView(n.width<=950);return}if((r=this.plugin.settings)!=null&&r.ShowLeftSideBar&&!N.Platform.isMobile)return;n.view.containerEl.classList.toggle("mobile-view",!0),rt.setIsMobileView(n.width<=950)}}async onOpen(){this.navigation=this.plugin.settings.navigation,await this.onResize(),this.onFileCreated=this.onFileCreated.bind(this),this.onFileDeleted=this.onFileDeleted.bind(this),this.onFileModified=this.onFileModified.bind(this),this.registerEvent(this.app.vault.on("create",this.onFileCreated)),this.registerEvent(this.app.vault.on("delete",this.onFileDeleted)),this.registerEvent(this.app.vault.on("modify",N.debounce(this.onFileModified,2e3,!0)));try{this.root=Lu.createRoot(this.contentEl),ut.setView(this),this.root.render(D.jsx(Q.StrictMode,{children:D.jsx(wQ,{app:this.plugin.app})}))}catch(n){console.error(n)}}onunload(){super.onunload(),this.root.unmount()}}const v2={Memos:'<svg t="1641348507339" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2120" width="100" height="100"><path d="M126.692653 478.099639l-90.757281 0c-19.019408 0-34.437336 15.423923-34.437336 34.417356 0 18.992434 15.416929 34.477297 34.437336 34.477297l90.757281 0c19.013414 0 34.42335-15.484863 34.42335-34.477297C161.116003 493.523561 145.706067 478.099639 126.692653 478.099639zM244.662333 243.526943c13.742566-13.110184 14.310011-34.948836 1.185841-48.706388l-62.644762-65.668806c-13.128167-13.762547-34.974811-14.229091-48.717377-1.118906s-14.261059 34.911872-1.132893 48.674419l62.644762 65.668806C209.123074 256.13262 230.919767 256.637127 244.662333 243.526943zM543.066631 957.422083l-60.603757 0c-18.654764 0-33.794964 15.147193-33.794964 33.862898 0 18.661757 15.1402 32.71502 33.794964 32.71502l60.603757 0c18.654764 0 33.794964-14.053262 33.794964-32.71502C576.861595 972.568277 561.721395 957.422083 543.066631 957.422083zM988.076617 479.050709l-90.757281 0c-19.019408 0-34.437336 15.423923-34.437336 34.417356s15.416929 34.477297 34.437336 34.477297l90.757281 0c19.013414 0 34.42335-15.484863 34.42335-34.477297S1007.09003 479.050709 988.076617 479.050709zM512.268737 192.765564c-172.737143 0-312.75527 150.079292-312.75527 322.746503 0 125.630192 74.080583 233.957298 180.936128 283.703669l0 84.51838c0 16.762614 15.410935 31.35435 34.42335 31.35435 0.598415 0 1.193833-0.014985 1.785255-0.042958 0.618395 0.026974 1.239788 0.042958 1.867175 0.042958l187.479731 0c5.905227 0 11.455802-1.220807 16.288078-3.477601 12.231044-4.657447 20.795671-15.383962 20.795671-27.87575l0-84.052835c107.391021-49.534578 181.935151-158.147405 181.935151-284.168214C825.024007 342.843857 684.997888 192.765564 512.268737 192.765564zM574.863548 742.713968l0 80.17063c0 3.159911-0.221783 5.976158-0.642372 8.496694l0 19.092336-124.910895 0 0-17.71768c-0.423586-2.856208-0.642372-6.123015-0.642372-9.870351l0-80.443363c-99.204024-27.75387-171.970892-118.821847-171.970892-226.930167 0-130.094827 105.4689-245.507007 235.571719-245.507007s235.563727 115.41218 235.563727 245.507007C747.832465 623.984031 674.578074 715.293772 574.863548 742.713968zM895.407204 129.328576c-13.429872-13.429872-35.233558-13.439862-48.677416 0.004995l-64.174267 64.175266c-13.448853 13.448853-13.443858 35.257534-0.013986 48.687406 13.429872 13.429872 35.281511 13.477825 48.730364 0.028972l64.175266-64.175266C908.889025 164.605092 908.837076 142.758448 895.407204 129.328576zM511.796199 159.617967c18.992434 0 34.417356-15.410935 34.417356-34.42335l0-90.757281c0-19.019408-15.423923-34.437336-34.417356-34.437336-18.992434 0-34.477297 15.416929-34.477297 34.437336l0 90.757281C477.317903 144.208031 492.802766 159.617967 511.796199 159.617967z" fill="currentColor" p-id="2121"></path></svg>'};function TQ(){Object.keys(v2).forEach(e=>{N.addIcon(e,v2[e])})}class y2 extends q3{fuzzySearchItemsOptimized(t,n){const r=N.prepareFuzzySearch(t);return n.map(o=>{const i=r(o.path);return i?{item:o,match:i,score:i.score}:null}).sort((o,i)=>(i==null?void 0:i.score)-(o==null?void 0:o.score)).filter(Boolean)}getSuggestions(t){const r=app.vault.getFiles().filter(i=>["png","jpg","jpeg","gif"].includes(i.extension)),o=t.toLowerCase();return this.fuzzySearchItemsOptimized(o,r).map(i=>i.item)}renderSuggestion(t,n){var i;const r=t.basename,o=((i=t.parent)==null?void 0:i.path)??"";n.toggleClass("thino-image-suggest-item",!0),n.createSpan({cls:"suggestion-name",text:r}),n.createSpan({cls:"suggestion-path",text:o})}selectSuggestion(t){this.inputEl.value=t.path,this.inputEl.trigger("input"),this.close()}}const tb=typeof Buffer=="function";typeof TextDecoder=="function"&&new TextDecoder;const w2=typeof TextEncoder=="function"?new TextEncoder:void 0,CQ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",jp=Array.prototype.slice.call(CQ);(e=>{let t={};return e.forEach((n,r)=>t[n]=r),t})(jp);const vi=String.fromCharCode.bind(String);typeof Uint8Array.from=="function"&&Uint8Array.from.bind(Uint8Array);const xQ=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),MQ=e=>{let t,n,r,o,i="";const s=e.length%3;for(let c=0;c<e.length;){if((n=e.charCodeAt(c++))>255||(r=e.charCodeAt(c++))>255||(o=e.charCodeAt(c++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|o,i+=jp[t>>18&63]+jp[t>>12&63]+jp[t>>6&63]+jp[t&63]}return s?i.slice(0,s-3)+"===".substring(s):i},z4=typeof btoa=="function"?e=>btoa(e):tb?e=>Buffer.from(e,"binary").toString("base64"):MQ,kQ=tb?e=>Buffer.from(e).toString("base64"):e=>{let n=[];for(let r=0,o=e.length;r<o;r+=4096)n.push(vi.apply(null,e.subarray(r,r+4096)));return z4(n.join(""))},NQ=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?vi(192|t>>>6)+vi(128|t&63):vi(224|t>>>12&15)+vi(128|t>>>6&63)+vi(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return vi(240|t>>>18&7)+vi(128|t>>>12&63)+vi(128|t>>>6&63)+vi(128|t&63)}},FQ=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,IQ=e=>e.replace(FQ,NQ),b2=tb?e=>Buffer.from(e,"utf8").toString("base64"):w2?e=>kQ(w2.encode(e)):e=>z4(IQ(e)),AQ=(e,t=!1)=>t?xQ(b2(e)):b2(e),W0=N.Platform.isDesktop&&require("os"),OQ=async()=>{var t;let e="";if(N.Platform.isDesktop)e=await Un();else{const n=await((t=window.Capacitor)==null?void 0:t.Plugins.Device.getId());e=n.identifier||n.uuid}return e},RQ={General:"chef-hat",Thino:"Memos",Theme:"brush",Share:"share-2",Advanced:"cog"},$4=[{value:"DAILY",target:"ProcessEntriesBelow",insert:"InsertAfter"},{value:"CANVAS",target:"MemoDefaultCanvasPath"},{value:"MULTI",target:"MemoDefaultMultiFilePath"},{value:"FILE",target:"MemoDefaultSingleFilePath"}],Ma={StartDate:"Sunday",InsertAfter:"# Journal",UserName:"THINO 😉",ProcessEntriesBelow:"",Language:"en",SaveMemoButtonLabel:"NOTEIT",SaveMemoButtonIcon:"✍️",ShareFooterStart:"{ThinoNum} Thino {UsedDay} Day",ShareFooterEnd:"✍️ by {UserName}",DefaultPrefix:"List",UseDailyOrPeriodic:"Daily",InsertDateFormat:"Tasks",DefaultEditorLocation:"Top",UseButtonToShowEditor:!1,FocusOnEditor:!0,OpenDailyMemosWithMemos:!0,HideDoneTasks:!1,ShowTaskLabel:!1,MobileAndDesktop:"All",OpenMemosAutomatically:!1,ShowTime:!0,ShowDate:!0,AddBlankLineWhenDate:!1,AutoSaveWhenOnMobile:!1,DeleteFileName:"delete",QueryFileName:"query",UseVaultTags:!1,SetCustomBackgroundImage:!1,SetCustomMemoFooter:!1,DefaultLightBackgroundImage:"",DefaultDarkBackgroundImage:"",DefaultMemoComposition:"{TIME} {CONTENT}",CommentOnMemos:!1,CommentsInOriginalNotes:!1,FetchMemosMark:"#memo",FetchMemosFromNote:!1,ShowCommentOnMemos:!1,ShowLeftSideBar:!1,MemoListView:"list",MemoSaveLocation:"DAILY",MemoOtherSaveLocation:{MemoDefaultCanvasPath:"basic.thino.canvas",MemoDefaultMultiFilePath:"Thino",MemoDefaultSingleFilePath:"basic.thino.md"},MemoDailyTarget:5,HeatmapColorScheme:"default",EnabledHttpApi:!1,HttpApiIpType:"localhost",HttpApiPort:"43999",AutoDownloadImage:!1,EditorType:"obsidian",EnabledLocationList:$4,DeleteThinoDirectly:!1,CaptureKey:{EnableCaptureKey:!1,OpenThinoGlobally:"CommandOrControl+Shift+T",ShowNearMouse:!1},startSync:!1,tokenForVerify:{},saveThinoType:"FILE",showDayMark:!1,navigation:!1};function LQ({plugin:e}){const{dailyNotesState:{verifyState:t}}=A.useContext(Nt),[n,r]=A.useState(!1),[o,i]=A.useState(!1),[s,c]=A.useState(""),[d,h]=A.useState("");A.useEffect(()=>{OQ().then(w=>{h(w)})},[]);const g=async()=>{var E;const w=s,b=!N.Platform.isDesktop&&await((E=window.Capacitor)==null?void 0:E.Plugins.Device.getId()),T=N.Platform.isDesktop?await Un():b.identifier||b.uuid;w&&(e.settingTab.updateSettings("tokenForVerify",{...e.settings.tokenForVerify,[T]:w}),e.verify().then(k=>{k&&(r(!0),rt.setRefresh(!0),setTimeout(()=>{e.settingTab.display()},200),e.registerToolbarCheck()),new N.Notice(O(k?"Verify successfully":"Failed to verify"))}).catch(k=>{new N.Notice(O("Failed to verify"))}))},m=async w=>{c(w)};return D.jsx("div",{className:"thino-verify-component",children:t?D.jsxs("div",{className:"thino-verify-content verified",children:[D.jsx("div",{className:"thino-verified-text",children:O("You have verified your account. Congrats!")}),D.jsx("div",{className:"thino-description-link",children:D.jsxs("p",{children:[O("If you have any questions, please contact us."),D.jsx("span",{className:"thino-url",onClick:()=>{const w=localStorage.getItem("language");w&&(w==="zh"||w==="zh-TW")?window.open("https://pkmer.cn"):window.open("https://thino.pkmer.net/en/")},children:"@ PKMer"})]})})]}):D.jsxs("div",{className:"thino-verify-content",children:[D.jsxs("div",{className:"thino-description-link",children:[O("You can buy a license from")+"->",D.jsxs("span",{className:"thino-url",onClick:()=>{const w=localStorage.getItem("language");w&&(w==="zh"||w==="zh-TW")?window.open("https://pkmer.cn/products/thino"):window.open("https://thino.pkmer.net/en/#price")},children:[" ","PKMer"]})]}),D.jsx("textarea",{className:"thino-verify-textarea",value:s,onChange:w=>m(w.target.value),placeholder:O("Input activation code here")}),D.jsxs("div",{className:"thino-button-container",children:[D.jsxs("div",{className:"thino-button-group",children:[D.jsx("button",{onClick:async()=>{var w,b;try{let T="";if(N.Platform.isDesktop)T=await Un();else{const C=await((w=window.Capacitor)==null?void 0:w.Plugins.Device.getId());T=C.identifier||C.uuid}let E;if(W0)E=JSON.stringify({hostname:W0.hostname(),platform:W0.platform(),machineid:T});else{const C=await((b=window.Capacitor)==null?void 0:b.Plugins.Device.getInfo()),I=C==null?void 0:C.model,B=C==null?void 0:C.platform;E=JSON.stringify({hostname:I||("mobile"+N.Platform.isMobile?Math.random().toString(36).substring(7):""),platform:B||"mobile",machineid:T})}const k=AQ(E);await navigator.clipboard.writeText(k),i(!0)}catch(T){console.error(T),new N.Notice("Failed to copy id")}new N.Notice(O("Copied to clipboard Successfully"))},children:O("Copy Thino id")}),D.jsx("button",{onClick:()=>{if(!o){new N.Notice(O("Please copy Thino id first"));return}const w=localStorage.getItem("language");w&&(w==="zh"||w==="zh-TW")?window.open("https://pkmer.cn/products/UserProfile/#tab-21&getCode"):window.open("https://pkmer.net/en/userprofile/#tab-21&getCode"),r(!0)},children:O("Get activation code")}),s&&D.jsx(D.Fragment,{children:D.jsx("button",{onClick:async()=>{await g()},children:O("Verify")})})]}),n?D.jsx("p",{children:O("After you verify your account, please refresh this page.")}):""]}),D.jsxs("div",{className:"thino-description-link",children:[O("If you have any questions, please contact us."),D.jsx("span",{className:"thino-url",onClick:()=>{const w=localStorage.getItem("language");w&&(w==="zh"||w==="zh-TW")?window.open("https://pkmer.cn"):window.open("https://thino.pkmer.net/en/")},children:"@ PKMer"})]})]})})}class _Q extends N.PluginSettingTab{constructor(n,r){super(n,r);ye(this,"plugin");ye(this,"applyDebounceTimer",0);ye(this,"tabContent",new Map);ye(this,"selectedTab","General");ye(this,"search");ye(this,"searchSettingInfo",new Map);ye(this,"searchZeroState");ye(this,"navigateEl");ye(this,"root");ye(this,"debounceApplySettingsUpdate",N.debounce(async()=>{await this.plugin.saveSettings()},100,!0));this.plugin=r}updateSettings(n,r){this.plugin.settings={...this.plugin.settings,[n]:r},this.applySettingsUpdate()}applySettingsUpdate(){this.debounceApplySettingsUpdate(),Me.updateTagsState()}async hide(){var n;(n=this.root)==null||n.unmount()}async display(){var n;await this.plugin.loadSettings(),this.root&&((n=this.root)==null||n.unmount()),this.containerEl.empty(),this.containerEl.toggleClass("memos-settings",!0),N.Platform.isMobile&&this.containerEl.toggleClass("memos-mobile",!0),this.generateSettingsTitle(),this.addTabHeader()}generateSettingsTitle(){const n=this.containerEl.createDiv("memos-setting-title");n.createEl("h2",{text:"Thino"}),this.generateSearchBar(n)}addTabHeader(){const n=this.containerEl.createEl("nav",{cls:"memos-setting-header"});this.navigateEl=n.createDiv("memos-setting-tab-group");const r=this.containerEl.createDiv("memos-setting-content");this.updateOldData(),this.createTabAndContent("General",this.navigateEl,r,(o,i)=>this.generateGeneralSettings(i,o)),this.createTabAndContent("Thino",this.navigateEl,r,(o,i)=>this.generateMemosSettings(i,o)),this.createTabAndContent("Theme",this.navigateEl,r,(o,i)=>this.generateThemeSettings(i,o)),this.createTabAndContent("Share",this.navigateEl,r,(o,i)=>this.generateShareSettings(i,o)),this.createTabAndContent("Advanced",this.navigateEl,r,(o,i)=>this.generateAdvancedSettings(i,o)),this.createSearchZeroState(r)}updateOldData(){this.plugin.settings.UserName.startsWith("MEMO ")&&(this.plugin.settings.UserName="THINO 😉"),this.plugin.settings.ShareFooterStart.contains("{Memo")&&(this.plugin.settings.ShareFooterStart=this.plugin.settings.ShareFooterStart.replace("{MemosNum}","{ThinoNum}").replace("memos","thino")),this.applySettingsUpdate()}generateSearchBar(n){const r=new N.Setting(n);r.settingEl.style.border="none",r.addSearch(o=>{this.search=o}),this.search.setPlaceholder(O("Search all settings")),this.search.inputEl.oninput=()=>{for(const o of this.tabContent){const i=o[1];i.navButton.removeClass("memos-navigation-item-selected"),i.content.show(),i.heading.show();const s=this.search.getValue();this.selectedTab==""&&s.trim()!=""&&this.searchSettings(s.toLowerCase()),this.selectedTab=""}this.navigateEl.addClass("memos-setting-searching")},this.search.inputEl.onblur=()=>{this.navigateEl.removeClass("memos-setting-searching")},this.search.onChange(o=>{var i;if(o===""){this.triggerTabChange((i=this.tabContent.get("General"))==null?void 0:i.navButton,"General");return}this.searchSettings(o.toLowerCase())})}triggerTabChange(n,r){if(this.selectedTab==r)return;n.toggleClass("memos-navigation-item-selected",!0);const o=this.tabContent.get(r);if((o==null?void 0:o.content).show(),this.selectedTab!=""){const i=this.tabContent.get(this.selectedTab);i==null||i.navButton.removeClass("memos-navigation-item-selected"),(i==null?void 0:i.content).hide()}else{this.searchZeroState.hide();for(const i of this.searchSettingInfo)for(const s of i[1])s.containerEl.show();for(const i of this.tabContent){const s=i[1];s.heading.hide(),r!==i[0]&&s.content.hide()}}this.selectedTab=r}createTabAndContent(n,r,o,i){const s=this.selectedTab===n,c=r.createDiv("memos-navigation-item");c.toggleClass("memos-desktop",!0),N.setIcon(c.createEl("div",{cls:"memos-navigation-item-icon"}),RQ[n]),c.createSpan({text:O(n)}),c.onclick=()=>{this.triggerTabChange(c,n)};const d=o.createDiv("memos-tab-settings"),h=d.createEl("h2",{cls:"memos-setting-heading",text:n+" Settings"});h.hide(),d.id=n.toLowerCase().replace(" ","-"),s?c.addClass("memos-navigation-item-selected"):d.hide(),i&&i(d,n),this.tabContent.set(n,{content:d,heading:h,navButton:c})}searchSettings(n){var i;const r=new Set,o=(s,c)=>{s.show(),r.has(c)||r.add(c)};for(const s of this.searchSettingInfo){const c=s[0],d=s[1];for(const h of d)if(n.trim()===""||(i=h.alias)!=null&&i.includes(n)||h.description.includes(n)||h.name.includes(n))o(h.containerEl,c);else if(h.options&&h.options.length>0)for(const g of h.options){if(g.description.toLowerCase().includes(n)||g.name.toLowerCase().includes(n)){o(h.containerEl,c);break}else if(g.options){for(const m of g.options)if(m.description.toLowerCase().includes(n)||m.value.toLowerCase().includes(n)){o(h.containerEl,c);break}}h.containerEl.hide()}else h.containerEl.hide()}for(const s of this.tabContent)r.has(s[0])?s[1].heading.show():s[1].heading.hide();r.size===0?this.searchZeroState.show():this.searchZeroState.hide()}addSettingToMasterSettingsList(n,r,o="",i="",s=[],c=""){var h;const d={containerEl:r,name:o.toLowerCase(),description:i.toLowerCase(),options:s,alias:c};this.searchSettingInfo.has(n)?(h=this.searchSettingInfo.get(n))==null||h.push(d):this.searchSettingInfo.set(n,[d])}createSearchZeroState(n){this.searchZeroState=n.createDiv(),this.searchZeroState.hide(),this.searchZeroState.createEl(N.Platform.isMobile?"h3":"h2",{text:"No settings match search"}).style.textAlign="center"}generateGeneralSettings(n,r){this.customHeading(n,r)}async generateThemeSettings(n,r){var d;const o=ut.getState().verifyState,i=!N.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=N.Platform.isDesktop?await Un():i.identifier||i.uuid,c=o&&o.appId===s;await this.customNameAndTheme(n,r,c)}generateMemosSettings(n,r){this.addMemoSettings(n,r)}generateShareSettings(n,r){this.copyMemosSettings(n,r),this.shareMemosSettings(n,r)}async generateAdvancedSettings(n,r){var d;this.saveDataSettings(n,r),this.fetchDataSettings(n,r),this.navigationSettings(n,r);const o=ut.getState().verifyState,i=!N.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=N.Platform.isDesktop?await Un():i.identifier||i.uuid,c=o&&o.appId===s;this.customFileNameSettings(n,r,c),this.setGlobalSettings(n,r,c)}async customNameAndTheme(n,r,o){let i;new ft(r,this).setName(O("Heatmap Color Scheme")).setDesc(O("Set different color scheme for heatmap.")).setTab(n).addDropdown(async s=>{i=s,i.addOption("default","default"),i.addOption("gray","gray"),i.addOption("grass","grass"),i.addOption("frame","frame"),i.addOption("olive","olive"),i.addOption("ice","ice"),i.addOption("magenta","magenta"),i.setValue(this.plugin.settings.HeatmapColorScheme).onChange(async c=>{this.plugin.settings.HeatmapColorScheme=c,this.applySettingsUpdate()})}),new ft(r,this).setName(O("Hide done tasks in Memo list")).setDesc(O("Hide all done tasks in Memo list. Show done tasks by default.")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.HideDoneTasks).onChange(async c=>{this.plugin.settings.HideDoneTasks=c,this.applySettingsUpdate()})),new ft(r,this).setName(O("Show Tasks Label")).setDesc(O("Show tasks label near the time text. False by default")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.ShowTaskLabel).onChange(async c=>{this.plugin.settings.ShowTaskLabel=c,this.applySettingsUpdate()})),new ft(r,this).setName(O("Save Memo button label")).setDesc(O("The text shown on the save Memo button in the UI. 'NOTEIT' by default.")).setTab(n).addText(s=>s.setPlaceholder(Ma.SaveMemoButtonLabel).setValue(this.plugin.settings.SaveMemoButtonLabel).onChange(async c=>{this.plugin.settings.SaveMemoButtonLabel=c,this.applySettingsUpdate()})),new ft(r,this).setName(O("Save Memo button icon")).setDesc(O("The icon shown on the save Memo button in the UI.")).setTab(n).addText(s=>s.setPlaceholder(Ma.SaveMemoButtonIcon).setValue(this.plugin.settings.SaveMemoButtonIcon).onChange(async c=>{this.plugin.settings.SaveMemoButtonIcon=c,this.applySettingsUpdate()})),N.Platform.isDesktop&&new ft(r,this).setName(O("Always Show Leaf Sidebar on PC")).setDesc(O("Show left sidebar on PC even when the leaf width is less than 875px. False by default.")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.ShowLeftSideBar).onChange(async c=>{this.plugin.settings.ShowLeftSideBar=c,this.applySettingsUpdate()})),await this.getEditorLocation(r,n),new ft(r,this).setHeading().setTab(n).setName(O("Pro Features")),new ft(r,this).setName(O("Show day mark on list mode")).setDesc(O("Show day mark on the top of daily range thino. False by default.")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.showDayMark).onChange(async c=>{if(!o){yr();return}this.plugin.settings.showDayMark=c,this.applySettingsUpdate()}))}async getEditorLocation(n,r){let o;N.Platform.isMobile&&(new ft(n,this).setName(O("Default editor position on mobile")).setDesc(O("Set the default editor position on Mobile, 'Top' by default.")).setTab(r).addDropdown(async i=>{o=i,o.addOption("Top",O("Top")),o.addOption("Bottom",O("Bottom")),o.setValue(this.plugin.settings.DefaultEditorLocation).onChange(async s=>{this.plugin.settings.DefaultEditorLocation=s,this.applySettingsUpdate(),setTimeout(()=>{this.display()},200)})}),this.plugin.settings.DefaultEditorLocation!=="Top"&&new ft(n,this).setName(O("Use button to show editor on mobile")).setDesc(O("Set a float button to call editor on mobile. Only when editor located at the bottom works.")).setTab(r).addToggle(i=>i.setValue(this.plugin.settings.UseButtonToShowEditor).onChange(async s=>{this.plugin.settings.UseButtonToShowEditor=s,this.applySettingsUpdate()})))}customHeading(n,r){var b;new ft(r,this).setName(O("User name in Memos")).setDesc(O("Set your user name here. 'Memos 😏' By default")).setTab(n).addText(T=>T.setPlaceholder(Ma.UserName).setValue(this.plugin.settings.UserName).onChange(async E=>{this.plugin.settings.UserName=E,this.applySettingsUpdate()}));let o=!1;const i=document.createDocumentFragment();i.createEl("span",{text:O("Connect to PKMer Sync, you can check it in ")});const s=localStorage.getItem("language");let c;s&&s==="zh"?c="https://pkmer.cn/products/UserProfile/#tab-21&activateSync":c="https://thino.pkmer.net/en/",i.createEl("a",{text:O("PKMer Sync"),attr:{href:c}});const d=!!((b=this.plugin.app)!=null&&b.loadLocalStorage("tokenForSync"));d&&new ft(r,this).setHeading().setName(O("Sync service")).setTab(n),(s==="zh"||s==="zh-TW")&&new ft(r,this).setName(O("Sync Thino via PKMer")).setDesc(i).setTab(n).addButton(T=>{var k;const E=(k=this.plugin.app)==null?void 0:k.loadLocalStorage("tokenForSync");T.setButtonText(O(E?"Unlink":"Link")).onClick(async()=>{var C;if(!E){const I=localStorage.getItem("language");I&&(I==="zh"||I==="zh-TW")?window.open("https://pkmer.cn/products/UserProfile/#tab-21&activateSync"):window.open("https://thino.pkmer.net/en/");return}if(!o){T.setButtonText(O("Confirm?")),o=!0;return}o=!1,E&&((C=this.plugin.app)==null||C.saveLocalStorage("tokenForSync",""),new N.Notice(O("Remove successfully"))),rt.setRefresh(!0),setTimeout(()=>{this.display()},20)})}),(s==="zh"||s==="zh-TW")&&this.showSyncStatus(r,n),d&&new ft(r,this).setHeading().setName(O("Pro verification status")).setTab(n);const h=document.createDocumentFragment(),g=h.createEl("div",{cls:"thino-activation"}),m=new ft(r,this).setName(O("Activate Pro Version")).setDesc(h).setTab(n);m.settingEl.toggleClass("thino-activation-setting",!0),m.nameEl.toggleClass("thino-activation-title",!0),this.root=Lu.createRoot(g),this.root.render(D.jsx(If,{store:xe,context:Nt,children:D.jsx(LQ,{plugin:this.plugin})}));let w=!1;new ft(r,this).setName(O("Deactivate")).setTab(n).addButton(T=>{T.setWarning().setButtonText(O("Remove")).onClick(async()=>{var C;if(!w){T.setButtonText(O("Confirm?")),w=!0;return}w=!1;const E=!N.Platform.isDesktop&&await((C=window.Capacitor)==null?void 0:C.Plugins.Device.getId()),k=N.Platform.isDesktop?await Un():E.identifier||E.uuid;this.plugin.settings.tokenForVerify[k]&&(delete this.plugin.settings.tokenForVerify[k],await this.plugin.saveSettings(),new N.Notice(O("Remove successfully"))),await this.plugin.verify(),rt.setRefresh(!0),setTimeout(()=>{this.display()},20)})})}showSyncStatus(n,r){var i;(i=this.plugin.app)!=null&&i.loadLocalStorage("tokenForSync")&&(new ft(n,this).setName(O("Save thino type when sync local")).setDesc(O("Set the default save thino type when sync local, FILE by default.")).setTab(r).addDropdown(async s=>{s.addOption("DAILY",O("DAILY")),s.addOption("FILE",O("FILE")),s.setValue(this.plugin.settings.saveThinoType).onChange(async c=>{this.plugin.settings.saveThinoType=c,this.applySettingsUpdate()})}),new ft(n,this).setName(O("Sync Status")).setDesc(O("Start or stop sync")).setTab(r).addButton(s=>{s.setButtonText(this.plugin.settings.startSync?O("Stop"):O("Start")).onClick(async()=>{this.plugin.settings.startSync=!this.plugin.settings.startSync,await this.plugin.saveSettings(),rt.setRefresh(!0),new N.Notice(this.plugin.settings.startSync?O("Start sync successfully"):O("Stop sync successfully")),setTimeout(()=>{this.display()},200)})}))}addMemoSettings(n,r){new ft(r,this).setName(O("Use Tags In Vault")).setDesc(O("Use tags in vault rather than only in Memos. False by default.")).setTab(n).addToggle(i=>i.setValue(this.plugin.settings.UseVaultTags).onChange(async s=>{this.plugin.settings.UseVaultTags=s,this.applySettingsUpdate()})),new ft(r,this).setName(O("Focus on editor when open memos")).setDesc(O("Focus on editor when open memos. Focus by default.")).setTab(n).addToggle(i=>i.setValue(this.plugin.settings.FocusOnEditor).onChange(async s=>{this.plugin.settings.FocusOnEditor=s,this.applySettingsUpdate()})),new ft(r,this).setName(O("Open daily memos with open memos")).setDesc(O("Open daily memos with open memos. Open by default.")).setTab(n).addToggle(i=>i.setValue(this.plugin.settings.OpenDailyMemosWithMemos).onChange(async s=>{this.plugin.settings.OpenDailyMemosWithMemos=s,this.applySettingsUpdate()})),new ft(r,this).setName(O("Open Memos when obsidian opens")).setDesc(O("When enable this, Memos will open when Obsidian opens. False by default.")).setTab(n).addDropdown(i=>{i.addOption("Desktop","Desktop"),i.addOption("Mobile","Mobile"),i.addOption("All","All"),i.setValue(this.plugin.settings.MobileAndDesktop).onChange(async s=>{this.plugin.settings.MobileAndDesktop=s,this.applySettingsUpdate()})}).addToggle(i=>i.setValue(this.plugin.settings.OpenMemosAutomatically).onChange(async s=>{this.plugin.settings.OpenMemosAutomatically=s,this.applySettingsUpdate()}));let o;new ft(r,this).setName(O("Default prefix")).setDesc(O("Set the default prefix when create memo, 'List' by default.")).setTab(n).addDropdown(async i=>{o=i,o.addOption("List",O("List")),o.addOption("Task",O("Task")),o.setValue(this.plugin.settings.DefaultPrefix).onChange(async s=>{this.plugin.settings.DefaultPrefix=s,this.applySettingsUpdate()})}),new ft(r,this).setName(O("Default insert date format")).setDesc(O("Set the default date format when insert date by @, 'Tasks' by default.")).setTab(n).addDropdown(async i=>{o=i,o.addOption("Tasks","Tasks"),o.addOption("Dataview","Dataview"),o.setValue(this.plugin.settings.InsertDateFormat).onChange(async s=>{this.plugin.settings.InsertDateFormat=s,this.applySettingsUpdate()})})}memosCommentSettings(n,r){new ft(r,this).setName(O("Allow Comments On Memos")).setDesc(O("You can comment on memos. False by default")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.CommentOnMemos).onChange(async i=>{this.plugin.settings.CommentOnMemos=i,this.applySettingsUpdate(),this.display()})),this.plugin.settings.CommentOnMemos&&(new ft(r,this).setName(O("Always Show Memo Comments")).setDesc(O("Always show memo comments on memos. False by default")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.ShowCommentOnMemos).onChange(async i=>{this.plugin.settings.ShowCommentOnMemos=i,this.applySettingsUpdate()})),new ft(r,this).setName(O("Comments In Original DailyNotes/Notes")).setDesc(O("You should install Dataview Plugin ver 0.5.9 or later to use this feature.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.CommentsInOriginalNotes).onChange(async i=>{this.plugin.settings.CommentsInOriginalNotes=i,this.applySettingsUpdate()})))}copyMemosSettings(n,r){new ft(r,this).setName(O("Show Time When Copy Results")).setDesc(O("Show time when you copy results, like 12:00. Copy time by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.ShowTime).onChange(async i=>{this.plugin.settings.ShowTime=i,this.applySettingsUpdate()})),new ft(r,this).setName(O("Show Date When Copy Results")).setDesc(O("Show date when you copy results, like [[2022-01-01]]. Copy date by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.ShowDate).onChange(async i=>{this.plugin.settings.ShowDate=i,this.applySettingsUpdate()})),new ft(r,this).setName(O("Add Blank Line Between Different Date")).setDesc(O("Add blank line when copy result with date. No blank line by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.AddBlankLineWhenDate).onChange(async i=>{this.plugin.settings.AddBlankLineWhenDate=i,this.applySettingsUpdate()}))}shareMemosSettings(n,r){new ft(r,this).setName(O("Save Shared Image To Folder For Mobile")).setDesc(O("Save image to folder for mobile. False by Default")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.AutoSaveWhenOnMobile).onChange(async i=>{this.plugin.settings.AutoSaveWhenOnMobile=i,this.applySettingsUpdate()})),this.customMemoFooter(n,r),new ft(r,this).setName(O("Custom Background Image")).setDesc(O("Set custom background image.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.SetCustomBackgroundImage).onChange(async i=>{this.plugin.settings.SetCustomBackgroundImage=i,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.SetCustomBackgroundImage&&(new ft(r,this).setName(O("Background Image in Light Theme")).setDesc(O('Set background image in light theme. Set something like "Daily/one.png"')).setTab(n).addText(o=>{new y2(o.inputEl),o.setPlaceholder(Ma.DefaultLightBackgroundImage).setValue(this.plugin.settings.DefaultLightBackgroundImage).onChange(async i=>{this.plugin.settings.DefaultLightBackgroundImage=i,this.applySettingsUpdate()})}),new ft(r,this).setName(O("Background Image in Dark Theme")).setDesc(O('Set background image in dark theme. Set something like "Daily/one.png"')).setTab(n).addText(o=>{new y2(o.inputEl),o.setPlaceholder(Ma.DefaultDarkBackgroundImage).setValue(this.plugin.settings.DefaultDarkBackgroundImage).onChange(async i=>{this.plugin.settings.DefaultDarkBackgroundImage=i,this.applySettingsUpdate()})}))}customMemoFooter(n,r){new ft(r,this).setName(O("Custom Memo Footer")).setDesc(O("Set custom memo footer.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.SetCustomMemoFooter).onChange(async i=>{this.plugin.settings.SetCustomMemoFooter=i,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.SetCustomMemoFooter&&(new ft(r,this).setName(O("Share Memos Image Footer Start")).setDesc(O("Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default")).setTab(n).addText(o=>o.setPlaceholder(Ma.ShareFooterStart).setValue(this.plugin.settings.ShareFooterStart).onChange(async i=>{this.plugin.settings.ShareFooterStart=i,this.applySettingsUpdate()})),new ft(r,this).setName(O("Share Memos Image Footer End")).setDesc(O("Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default")).setTab(n).addText(o=>o.setPlaceholder(Ma.ShareFooterEnd).setValue(this.plugin.settings.ShareFooterEnd).onChange(async i=>{this.plugin.settings.ShareFooterEnd=i,this.applySettingsUpdate()})))}saveDataSettings(n,r){new ft(r,this).setName(O("Default Memo Composition")).setDesc(O('Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default')).setTab(n).addText(i=>i.setPlaceholder(Ma.DefaultMemoComposition).setValue(this.plugin.settings.DefaultMemoComposition).setDisabled(!0).onChange(async s=>{this.plugin.settings.DefaultMemoComposition=s,this.applySettingsUpdate()}));let o;new ft(r,this).setName(O("Default Editor Mode")).setDesc(O("Live-Preview Mode OR Source Mode.")).setTab(n).addDropdown(async i=>{o=i,o.addOption("obsidian",O("Live-preview")),o.addOption("memos",O("Source")),o.setValue(this.plugin.settings.EditorType).onChange(async s=>{this.plugin.settings.EditorType=s,this.applySettingsUpdate()})}),new ft(r,this).setName(O("Delete Thino Directly")).setDesc(O("When delete thino directly, it will not be moved to trash. False by default.")).setTab(n).addToggle(i=>{i.setValue(this.plugin.settings.DeleteThinoDirectly).onChange(async s=>{this.plugin.settings.DeleteThinoDirectly=s,this.applySettingsUpdate()})})}async initHttpServer(n,r){var d;const o=ut.getState().verifyState,i=!N.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=N.Platform.isDesktop?await Un():i.identifier||i.uuid,c=o&&(o==null?void 0:o.appId)===s;new ft(n,this).setName(O("Enable Local Http Server")).setTab(r).setDisabled(!c).addToggle(h=>h.setValue(this.plugin.settings.EnabledHttpApi).onChange(async g=>{if(!c){yr();return}this.plugin.settings.EnabledHttpApi=g,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.settings.EnabledHttpApi?this.plugin.initServer():this.plugin.stopServer(),this.display()},100)})),this.plugin.settings.EnabledHttpApi&&(new ft(n,this).setName(O("Memos Http Server Port")).setDesc(O("Set memos http server port to listen. '43999' by default")).setTab(r).addText(h=>h.setPlaceholder(Ma.HttpApiPort).setValue(this.plugin.settings.HttpApiPort).onChange(async g=>{if(!c){yr();return}this.plugin.settings.HttpApiPort=g,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})),new ft(n,this).setName("Auto Download Image").setDesc("Auto download image when save to thino. 'false' by default").setTab(r).setDisabled(!c).addToggle(h=>{h.setValue(this.plugin.settings.AutoDownloadImage).onChange(async g=>{if(!c){yr();return}this.plugin.settings.AutoDownloadImage=g,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})}),new ft(n,this).setName("Thino Http IP Type").setDesc("Set Thino http server ip to listen. 'localhost' by default").setTab(r).addDropdown(h=>{h.addOption("localhost","localhost"),h.addOption("127.0.0.1","127.0.0.1"),h.setValue(this.plugin.settings.HttpApiIpType).onChange(async g=>{if(!o&&(o==null?void 0:o.appId)!==s){yr();return}this.plugin.settings.HttpApiIpType=g,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})}))}fetchDataSettings(n,r){let o;new ft(r,this).setName(O("Use which plugin's default configuration")).setDesc(O("Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.")).setTab(n).addDropdown(async i=>{o=i,o.addOption("Daily",O("Daily")),o.addOption("Periodic","Periodic"),o.setValue(this.plugin.settings.UseDailyOrPeriodic).onChange(async s=>{this.plugin.settings.UseDailyOrPeriodic=s,this.applySettingsUpdate()})})}navigationSettings(n,r){new ft(r,this).setName(O("Allow navigation from view to Thino or Thino to view")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.navigation).onChange(async i=>{this.plugin.settings.navigation=i,this.applySettingsUpdate()}))}setGlobalSettings(n,r,o){new ft(r,this).setHeading().setTab(n).setName(O("Pro Features")),new ft(r,this).setName(O("Default save location")).setDesc(O('Set the default save location for thino. "DAILY" by default')).setTab(n).addDropdown(async i=>{for(const s of this.plugin.settings.EnabledLocationList)i.addOption(s.value,O(s.value));i.setValue(this.plugin.settings.MemoSaveLocation||this.plugin.settings.EnabledLocationList[0].value).onChange(async s=>{if(!o){yr();return}this.plugin.settings.MemoSaveLocation=s,this.applySettingsUpdate()})}),this.initHttpServer(r,n),new ft(r,this).setName(O("Enable opening thino globally")).setDesc(O("Enable opening thino globally. False by default.")).setTab(n).addToggle(i=>i.setValue(this.plugin.settings.CaptureKey.EnableCaptureKey).onChange(async s=>{if(!o){yr();return}this.plugin.settings.CaptureKey.EnableCaptureKey=s,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.CaptureKey.EnableCaptureKey&&(new ft(r,this).setName(O("Key for opening thino globally")).setDesc(O("Set key for opening thino globally. CTRL + SHIFT + T by default.")).setTab(n).addText(i=>i.setPlaceholder(Ma.CaptureKey.OpenThinoGlobally).setValue(this.plugin.settings.CaptureKey.OpenThinoGlobally).onChange(async s=>{if(!o){yr();return}this.plugin.settings.CaptureKey.OpenThinoGlobally=s,this.applySettingsUpdate()})),new ft(r,this).setName(O("Show thino near mouse")).setTab(n).addToggle(i=>i.setValue(this.plugin.settings.CaptureKey.ShowNearMouse).onChange(async s=>{if(!o){yr();return}this.plugin.settings.CaptureKey.ShowNearMouse=s,this.applySettingsUpdate()})))}checkInList(n){return this.plugin.settings.EnabledLocationList.find(r=>r.value===n)!==void 0}customFileNameSettings(n,r,o){var d;const i=document.createDocumentFragment(),s=i.createEl("div",{cls:"memo-save-location-desc"});for(const h of $4){const g=s.createEl("div",{cls:`memo-save-location-desc-item ${h.value}`}),m=g.createEl("span",{cls:"memo-save-location-desc-item-icon"});N.setIcon(m,((d=Df.find(k=>k.title===h.value))==null?void 0:d.icon)||""),g.createEl("span",{cls:"memo-save-location-desc-item-desc",text:`${O(h.value)}`});const w=g.createEl("span",{cls:"memo-save-location-desc-item-toggle"}),b=g.createEl("span",{cls:"memo-save-location-desc-item-setting"});h.value!=="DAILY"&&g.createEl("span",{cls:["memo-save-location-desc-item-pro","user-pro-badge"],text:"PRO"}),new N.ToggleComponent(w).setValue(this.checkInList(h.value)).onChange(async k=>{if(!o){yr();return}k?(await Me.updateTypeMemos(h.value),this.plugin.settings.EnabledLocationList=[...this.plugin.settings.EnabledLocationList,h]):(await Me.removeTypeMemos(h.value),this.plugin.settings.EnabledLocationList=this.plugin.settings.EnabledLocationList.filter(C=>C.value!==h.value)),this.plugin.settings.EnabledLocationList.length===1&&(this.plugin.settings.MemoSaveLocation=h.value),this.applySettingsUpdate(),setTimeout(()=>{this.display()},500)}).setDisabled(this.plugin.settings.EnabledLocationList.length===1&&this.checkInList(h.value)),new N.ExtraButtonComponent(b).setIcon("settings").onClick(()=>{new PQ(this.app,this,this.plugin,h,o).open()})}const c=new ft(r,this).setName(O("Save Location for Memos")).setDesc(i).setTab(n);c.settingEl.toggleClass("memo-save-location-setting",!0),c.nameEl.toggleClass("memo-save-location-title",!0)}}class PQ extends N.Modal{constructor(n,r,o,i,s){super(n);ye(this,"plugin");ye(this,"settingTab");ye(this,"LocationList");ye(this,"target","");ye(this,"insertTarget","");ye(this,"verified");ye(this,"updateValue",N.debounce(n=>{this.LocationList.value!=="DAILY"&&this.LocationList.value!=="MULTI"?this.target=n.trim()===""?"basic":n.trim():this.target=n.trim()===""&&this.LocationList.value==="MULTI"?"Memos":n.trim()},400,!0));this.verified=s,this.app=n,this.settingTab=r,this.plugin=o,this.LocationList=i,this.target=i.target!=="ProcessEntriesBelow"?o.settings.MemoOtherSaveLocation[i.target]:o.settings[i.target],this.insertTarget=o.settings.InsertAfter}onOpen(){var g;const{contentEl:n}=this;(g=n.parentElement)==null||g.classList.add("memo-save-location-modal"),this.titleEl.toggleClass("modal-title",!0),this.titleEl.setText(O("Save Location for Memos")+` [${O(this.LocationList.value)}]`),(this.LocationList.value==="FILE"||this.LocationList.value==="CANVAS")&&n.createDiv("modal-desc",m=>{m.setText(O('You can set folder name with file name like "folder/file"'))}),this.LocationList.value==="MULTI"&&n.createDiv("modal-desc",m=>{m.setText(O('You can set folder name like "folder1/folder2/folder3" to create sub-folder'))});const r=n.createDiv("modal-setting"),o=this.LocationList.value==="DAILY"?O("Process Memos below"):this.LocationList.value==="MULTI"?O("Set the folder name"):O("Set the filename"),i=O("Insert after heading"),s=new ft(r,this.settingTab).setName(o).addText(m=>m.setPlaceholder(O("Set the filename for current location file")).setValue(this.LocationList.value!=="DAILY"&&this.LocationList.value!=="MULTI"?this.target.replace(/\.thino\.(canvas|md)/g,""):this.target).onChange(async w=>{const b=this.LocationList.value==="CANVAS"?".thino.canvas":this.LocationList.value==="FILE"?".thino.md":"";this.updateValue(w.replace(/\.thino\.(canvas|md)/g,"")+b)}));this.LocationList.value==="DAILY"&&s.setDesc(O("Only entries below this string/section in your notes will be processed. If it does not exist no notes will be processed for that file.")),this.LocationList.value!=="DAILY"&&this.LocationList.value!=="MULTI"&&s.controlEl.createEl("span",{text:`${this.LocationList.value==="FILE"?".thino.md":".thino.canvas"}`}),this.LocationList.value==="DAILY"&&new ft(r,this.settingTab).setName(i).setDesc(O("You should set the same heading below if you want to insert and process memos below the same heading.")).addText(m=>m.setPlaceholder(O("Set the filename for current location file")).setValue(this.insertTarget).onChange(async w=>{this.insertTarget=w}));const c=n.createDiv("button-group"),d=c.createEl("button",{text:O("Cancel")}),h=c.createEl("button",{text:O("Save")});h.onclick=async()=>{if(!this.verified&&this.LocationList.value!=="DAILY"){this.close(),yr();return}this.LocationList.target!=="ProcessEntriesBelow"?this.plugin.settings.MemoOtherSaveLocation[this.LocationList.target]=this.target:this.plugin.settings[this.LocationList.target]=this.target,this.LocationList.target==="ProcessEntriesBelow"&&(this.plugin.settings.InsertAfter=this.insertTarget),this.settingTab.applySettingsUpdate(),setTimeout(()=>{Me.updateTypeMemos(this.LocationList.value)},1e3),this.close()},d.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}function ty(e){return e.split("-")[0]}function q4(e){return e.split("-")[1]}function nb(e){return["top","bottom"].includes(ty(e))?"x":"y"}function W4(e){return e==="y"?"height":"width"}function D2(e){let{reference:t,floating:n,placement:r}=e;const o=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2;let s;switch(ty(r)){case"top":s={x:o,y:t.y-n.height};break;case"bottom":s={x:o,y:t.y+t.height};break;case"right":s={x:t.x+t.width,y:i};break;case"left":s={x:t.x-n.width,y:i};break;default:s={x:t.x,y:t.y}}const c=nb(r),d=W4(c);switch(q4(r)){case"start":s[c]=s[c]-(t[d]/2-n[d]/2);break;case"end":s[c]=s[c]+(t[d]/2-n[d]/2);break}return s}const jQ=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n;let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=D2({...c,placement:r}),g=r,m={};for(let w=0;w<i.length;w++){const{name:b,fn:T}=i[w],{x:E,y:k,data:C,reset:I}=await T({x:d,y:h,initialPlacement:r,placement:g,strategy:o,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});if(d=E??d,h=k??h,m={...m,[b]:C??{}},I){typeof I=="object"&&(I.placement&&(g=I.placement),I.rects&&(c=I.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:d,y:h}=D2({...c,placement:g})),w=-1;continue}}return{x:d,y:h,placement:g,strategy:o,middlewareData:m}};function BQ(e){return{top:0,right:0,bottom:0,left:0,...e}}function YQ(e){return typeof e!="number"?BQ(e):{top:e,right:e,bottom:e,left:e}}function U1(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function V1(e,t){t===void 0&&(t={});const{x:n,y:r,platform:o,rects:i,elements:s,strategy:c}=e,{boundary:d="clippingParents",rootBoundary:h="viewport",elementContext:g="floating",altBoundary:m=!1,padding:w=0}=t,b=YQ(w),E=s[m?g==="floating"?"reference":"floating":g],k=await o.getClippingClientRect({element:await o.isElement(E)?E:E.contextElement||await o.getDocumentElement({element:s.floating}),boundary:d,rootBoundary:h}),C=U1(await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g==="floating"?{...i.floating,x:n,y:r}:i.reference,offsetParent:await o.getOffsetParent({element:s.floating}),strategy:c}));return{top:k.top-C.top+b.top,bottom:C.bottom-k.bottom+b.bottom,left:k.left-C.left+b.left,right:C.right-k.right+b.right}}const HQ={left:"right",right:"left",bottom:"top",top:"bottom"};function wv(e){return e.replace(/left|right|bottom|top/g,t=>HQ[t])}function UQ(e,t){const n=q4(e)==="start",r=nb(e),o=W4(r);let i=r==="x"?n?"right":"left":n?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=wv(i)),{main:i,cross:wv(i)}}const VQ={start:"end",end:"start"};function S2(e){return e.replace(/start|end/g,t=>VQ[t])}function zQ(e){const t=wv(e);return[S2(e),t,S2(t)]}const $Q=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:c}=t;if((n=i.flip)!=null&&n.skip)return{};const{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",flipAlignment:w=!0,...b}=e,T=ty(o),k=g||(T===c||!w?[wv(c)]:zQ(c)),C=[c,...k],I=await V1(t,b),B=[];let F=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&B.push(I[T]),h){const{main:z,cross:q}=UQ(o,s);B.push(I[z],I[q])}if(F=[...F,{placement:o,overflows:B}],!B.every(z=>z<=0)){var _,R;const z=((_=(R=i.flip)==null?void 0:R.index)!=null?_:0)+1,q=C[z];if(q)return{data:{index:z,overflows:F},reset:{placement:q}};let $="bottom";switch(m){case"bestFit":{var j;const J=(j=F.slice().sort((ae,ie)=>ae.overflows.filter(ge=>ge>0).reduce((ge,pe)=>ge+pe,0)-ie.overflows.filter(ge=>ge>0).reduce((ge,pe)=>ge+pe,0))[0])==null?void 0:j.placement;J&&($=J);break}case"initialPlacement":$=c;break}return{data:{skip:!0},reset:{placement:$}}}return{}}}};function qQ(e){let{placement:t,rects:n,value:r}=e;const o=ty(t),i=["left","top"].includes(o)?-1:1,s=typeof r=="function"?r({...n,placement:t}):r,{mainAxis:c,crossAxis:d}=typeof s=="number"?{mainAxis:s,crossAxis:0}:{mainAxis:0,crossAxis:0,...s};return nb(o)==="x"?{x:d,y:c*i}:{x:c*i,y:d}}const WQ=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(t){const{x:n,y:r,placement:o,rects:i}=t,s=qQ({placement:o,rects:i,value:e});return{x:n+s.x,y:r+s.y,data:s}}}};function rb(e){return(e==null?void 0:e.toString())==="[object Window]"}function Sl(e){if(e==null)return window;if(!rb(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function ny(e){return Sl(e).getComputedStyle(e)}function ds(e){return rb(e)?"":e?(e.nodeName||"").toLowerCase():""}function ps(e){return e instanceof Sl(e).HTMLElement}function bv(e){return e instanceof Sl(e).Element}function GQ(e){return e instanceof Sl(e).Node}function G4(e){const t=Sl(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function ry(e){const{overflow:t,overflowX:n,overflowY:r}=ny(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function KQ(e){return["table","td","th"].includes(ds(e))}function K4(e){const t=navigator.userAgent.toLowerCase().includes("firefox"),n=ny(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)}const E2=Math.min,qp=Math.max,Dv=Math.round;function Ff(e,t){t===void 0&&(t=!1);const n=e.getBoundingClientRect();let r=1,o=1;return t&&ps(e)&&(r=e.offsetWidth>0&&Dv(n.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Dv(n.height)/e.offsetHeight||1),{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function El(e){return((GQ(e)?e.ownerDocument:e.document)||window.document).documentElement}function oy(e){return rb(e)?{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}:{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Q4(e){return Ff(El(e)).left+oy(e).scrollLeft}function QQ(e){const t=Ff(e);return Dv(t.width)!==e.offsetWidth||Dv(t.height)!==e.offsetHeight}function ZQ(e,t,n){const r=ps(t),o=El(t),i=Ff(e,r&&QQ(t));let s={scrollLeft:0,scrollTop:0};const c={x:0,y:0};if(r||!r&&n!=="fixed")if((ds(t)!=="body"||ry(o))&&(s=oy(t)),ps(t)){const d=Ff(t,!0);c.x=d.x+t.clientLeft,c.y=d.y+t.clientTop}else o&&(c.x=Q4(o));return{x:i.left+s.scrollLeft-c.x,y:i.top+s.scrollTop-c.y,width:i.width,height:i.height}}function ay(e){return ds(e)==="html"?e:e.assignedSlot||e.parentNode||(G4(e)?e.host:null)||El(e)}function T2(e){return!ps(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function JQ(e){let t=ay(e);for(;ps(t)&&!["html","body"].includes(ds(t));){if(K4(t))return t;t=t.parentNode}return null}function z1(e){const t=Sl(e);let n=T2(e);for(;n&&KQ(n)&&getComputedStyle(n).position==="static";)n=T2(n);return n&&(ds(n)==="html"||ds(n)==="body"&&getComputedStyle(n).position==="static"&&!K4(n))?t:n||JQ(e)||t}function C2(e){return{width:e.offsetWidth,height:e.offsetHeight}}function XQ(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=ps(n),i=El(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0};const c={x:0,y:0};if((o||!o&&r!=="fixed")&&((ds(n)!=="body"||ry(i))&&(s=oy(n)),ps(n))){const d=Ff(n,!0);c.x=d.x+n.clientLeft,c.y=d.y+n.clientTop}return{...t,x:t.x-s.scrollLeft+c.x,y:t.y-s.scrollTop+c.y}}function eZ(e){const t=Sl(e),n=El(e),r=t.visualViewport;let o=n.clientWidth,i=n.clientHeight,s=0,c=0;return r&&(o=r.width,i=r.height,Math.abs(t.innerWidth/r.scale-r.width)<.01&&(s=r.offsetLeft,c=r.offsetTop)),{width:o,height:i,x:s,y:c}}function tZ(e){var t;const n=El(e),r=oy(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=qp(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=qp(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let c=-r.scrollLeft+Q4(e);const d=-r.scrollTop;return ny(o||n).direction==="rtl"&&(c+=qp(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:c,y:d}}function Z4(e){return["html","body","#document"].includes(ds(e))?e.ownerDocument.body:ps(e)&&ry(e)?e:Z4(ay(e))}function J4(e,t){var n;t===void 0&&(t=[]);const r=Z4(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=Sl(r),s=o?[i].concat(i.visualViewport||[],ry(r)?r:[]):r,c=t.concat(s);return o?c:c.concat(J4(ay(s)))}function nZ(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&G4(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function rZ(e){const t=Ff(e),n=t.top+e.clientTop,r=t.left+e.clientLeft;return{top:n,left:r,x:r,y:n,right:r+e.clientWidth,bottom:n+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}function x2(e,t){return t==="viewport"?U1(eZ(e)):bv(t)?rZ(t):U1(tZ(El(e)))}function oZ(e){const t=J4(ay(e)),r=["absolute","fixed"].includes(ny(e).position)&&ps(e)?z1(e):e;return bv(r)?t.filter(o=>bv(o)&&nZ(o,r)&&ds(o)!=="body"):[]}function aZ(e){let{element:t,boundary:n,rootBoundary:r}=e;const i=[...n==="clippingParents"?oZ(t):[].concat(n),r],s=i[0],c=i.reduce((d,h)=>{const g=x2(t,h);return d.top=qp(g.top,d.top),d.right=E2(g.right,d.right),d.bottom=E2(g.bottom,d.bottom),d.left=qp(g.left,d.left),d},x2(t,s));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}const iZ={getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:ZQ(t,z1(n),r),floating:{...C2(n),x:0,y:0}}},convertOffsetParentRelativeRectToViewportRelativeRect:e=>XQ(e),getOffsetParent:e=>{let{element:t}=e;return z1(t)},isElement:e=>bv(e),getDocumentElement:e=>{let{element:t}=e;return El(t)},getClippingClientRect:e=>aZ(e),getDimensions:e=>{let{element:t}=e;return C2(t)},getClientRects:e=>{let{element:t}=e;return t.getClientRects()}},sZ=(e,t,n)=>jQ(e,t,{platform:iZ,...n});var lZ=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n};const uZ=qn(lZ),G0=Wp.Facet.define({combine:e=>{var t,n;return{defaultPlacement:((t=e.find(r=>r.defaultPlacement))==null?void 0:t.defaultPlacement)||"top",padding:((n=e.find(r=>r.padding))==null?void 0:n.padding)||8}}}),X4=e=>e.split("-")[0],cZ=e=>e==="x"?"y":"x",fZ=e=>["top","bottom"].includes(X4(e))?"x":"y",Op=(e,t,n)=>Math.max(e,Math.min(t,n)),dZ=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r],o)=>[n,t(r,n,o)])),pZ=e=>e===void 0?e:typeof e=="number"?-e:dZ(e,t=>t!==void 0?-t:t),hZ=(e={})=>({name:"shift",fn:async t=>{const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:c=({x:k,y:C})=>({x:k,y:C}),editorMenu:d,...h}=e,g={x:n,y:r},m=await V1(t,h),w=fZ(X4(o)),b=cZ(w);let T=g[w],E=g[b];if(i){const k=w==="y"?"top":"left",C=w==="y"?"bottom":"right",I=T+m[k],B=T-m[C];if(d){const F=await V1(t,{...h,boundary:d.dom,padding:pZ(h.padding)});if((b==="y"?["top","bottom"]:["left","right"]).every(R=>F[R]<=0)){const R=t.rects.floating.width,j=T+F[k]-R,z=T-F[C]+R,q=Math.abs(m[k]-F[k]),$=Math.abs(m[C]-F[C]);q>=R||$<q?T=Op(I,T,j):T=Op(z,T,B)}else T=Op(I,T,B)}else T=Op(I,T,B)}if(s){const k=b==="y"?"top":"left",C=b==="y"?"bottom":"right",I=E+m[k],B=E-m[C];E=Op(I,E,B)}return c({...t,[w]:T,[b]:E})}}),mZ="thino-mini-toolbar",gZ=(e=0,t=0)=>({width:0,height:0,top:t,left:e,bottom:t,right:e,x:e,y:t}),vZ=(e,t)=>{if(!e)return null;const n=Math.min(e.left,(t==null?void 0:t.left)??e.left),r=Math.max(e.right,(t==null?void 0:t.right)??e.right),o=Math.max(e.bottom,(t==null?void 0:t.bottom)??e.bottom)-Math.min(e.top,(t==null?void 0:t.top)??e.top),i=Math.min(e.top,(t==null?void 0:t.top)??e.top),s=i+o,c={left:n,right:r,top:i,bottom:s,width:0,height:o,x:i,y:n};return t&&(c.width=Math.abs(r-n)),c},yZ=gZ();class wZ{constructor(t){ye(this,"containerEl");ye(this,"virtualEl");ye(this,"toolbar",null);ye(this,"isThinoView");ye(this,"tooltipInfo");ye(this,"inView",!0);ye(this,"defaultPlacement");ye(this,"editorMenu");ye(this,"cachedRefRect",null);ye(this,"readFromDOM",()=>{if(this.tooltipInfo){const{start:t}=this.tooltipInfo;let{end:n}=this.tooltipInfo;n&&t===n&&(n=void 0);const r=this.view.coordsAtPos(t);let o=n?this.view.coordsAtPos(n):null;if(r&&o&&r.top!==o.top){const s=this.view.contentDOM.getBoundingClientRect();o={left:s.right,right:s.right,top:r.top,bottom:r.bottom}}const i=vZ(r,o);i&&(this.cachedRefRect=i,this.computePosition(i))}});this.view=t,this.containerEl=this.view.dom.parentElement,this.defaultPlacement=this.view.state.facet(G0).defaultPlacement,this.tooltipInfo=t.state.facet($1),this.virtualEl={rect:yZ,getBoundingClientRect(){return this.rect}},this.maybeMeasure(),this.editorMenu={currMenu:null,evtRef:t.state.field(N.editorInfoField)},this.isThinoView=this.checkThinoView()}get workspace(){return this.view.state.field(N.editorInfoField).app.workspace}checkThinoView(){return this.view.state.field(N.editorInfoField)&&this.view.state.field(N.editorInfoField)instanceof bu}shouldRemoveToolbar(t){const n=t??this.tooltipInfo;return!(n!=null&&n.end||this.editorMenu.currMenu)}onEditorMenuOpen(t){this.editorMenu.currMenu||(this.editorMenu.currMenu=t,this.cachedRefRect?this.computePosition(this.cachedRefRect):this.maybeMeasure(),!N.Platform.isMacOS&&this.tooltipInfo&&(this.createToolbar(),this.maybeMeasure()))}onEditorMenuClose(t){this.editorMenu.currMenu===t&&(this.editorMenu.currMenu=null),!N.Platform.isMacOS&&this.toolbar&&this.shouldRemoveToolbar()&&this.removeToolbar()}createToolbar(t){const n=t??this.tooltipInfo;if(!n)return;this.removeToolbar();const r=n.create(this.containerEl),o=this.view.state.field(N.editorInfoField);if(!o||!(o!=null&&o.editor))return;const i=o.editor.offsetToPos(n.start),s=n.end?o.editor.offsetToPos(n.end):i;this.workspace.trigger(mZ,r,{from:i,to:s},o.editor,o),this.toolbar=r}removeToolbar(){this.toolbar&&(this.toolbar.hide(),this.toolbar=null)}update(t){if(!this.isThinoView)return;const n=t.state.facet($1),r=n!==this.tooltipInfo&&!uZ(n,this.tooltipInfo);r&&(this.tooltipInfo=n,this.shouldRemoveToolbar()?this.removeToolbar():n&&!this.toolbar&&this.createToolbar(n));const o=r||t.geometryChanged,i=t.state.facet(G0);i.defaultPlacement!=this.defaultPlacement&&(i.defaultPlacement=this.defaultPlacement),o&&this.maybeMeasure()}destroy(){this.editorMenu.currMenu=null,this.removeToolbar(),this.toolbar=null,this.view.state.field(N.editorInfoField).app.workspace.offref(this.editorMenu.evtRef)}async computePosition(t){if(!this.toolbar)return;this.virtualEl.rect=t;const{padding:n}=this.view.state.facet(G0),{x:r,y:o}=await sZ(this.virtualEl,this.toolbar.dom,{placement:this.defaultPlacement,middleware:[WQ({mainAxis:5}),$Q({padding:n,boundary:this.view.scrollDOM}),hZ({padding:n,boundary:this.view.scrollDOM,editorMenu:this.editorMenu.currMenu})]});Object.assign(this.toolbar.dom.style,{top:"0",left:"0",transform:`translate(${Math.round(r)}px,${Math.round(o)}px)`})}maybeMeasure(){this.view.inView&&this.toolbar&&this.view.requestMeasure({read:this.readFromDOM}),this.inView!=this.view.inView&&(this.inView=this.view.inView,this.inView||this.removeToolbar())}}const bZ=bi.ViewPlugin.fromClass(wZ,{eventHandlers:{scroll(){this.maybeMeasure()}}}),$1=Wp.Facet.define({enables:[bZ],combine:e=>e.filter(t=>t!=null).first()??null}),DZ=e=>{const t=xZ(e);t&&window.navigator.clipboard.writeText(t==null?void 0:t.getSelection())},SZ=e=>{e.commands.executeCommandById("editor:toggle-bold",e)},EZ=e=>{e.commands.executeCommandById("editor:toggle-strikethrough",e)},TZ=e=>{e.commands.executeCommandById("editor:toggle-highlight",e)},CZ=e=>{e.commands.executeCommandById("editor:toggle-italics",e)},xZ=e=>{const{editor:t}=e.field(N.editorInfoField);return t},M2=(e,t)=>{const n=e.selection.ranges[0];if(!n)return null;const{anchor:r,head:o,empty:i}=n,[s,c]=[r,o].sort();return{start:s,end:i?void 0:c,create:h=>new FZ(h).addSmallButton(m=>m.setClass("clickable-icon").setIcon("copy").onClick(()=>DZ(e))).addSmallButton(m=>m.setClass("clickable-icon").setIcon("bold").onClick(()=>SZ(t))).addSmallButton(m=>m.setClass("clickable-icon").setIcon("italic").onClick(()=>CZ(t))).addSmallButton(m=>m.setClass("clickable-icon").setIcon("strikethrough").onClick(()=>EZ(t))).addSmallButton(m=>m.setClass("clickable-icon").setIcon("highlighter").onClick(()=>TZ(t)))}},MZ=e=>Wp.StateField.define({create:t=>M2(t,e),update:(t,n)=>!n.docChanged&&!n.selection?t:M2(n.state,e),provide:t=>$1.from(t)}),kZ=e=>[MZ(e)];class NZ extends N.BaseComponent{constructor(n){super();ye(this,"button");ye(this,"disabled",!1);ye(this,"dropdownOptions",[]);ye(this,"menu");ye(this,"menuOpened",!1);this.button=new N.ButtonComponent(n)}setDisabled(n){return this.button.setDisabled(n),this.disabled=n,this}setIcon(n){return this.button.setIcon(n),this}setClass(n){return this.button.setClass(n),this}setDropdownText(n){var d;const r=this.button.buttonEl.createDiv("mini-toolbar-text"),o=this.button.buttonEl.createDiv("mini-toolbar-icon-with-text");N.setIcon(o,"chevron-down");const i=(d=n.doc.lineAt(n.selection.ranges[0].from))==null?void 0:d.from,s=u0.syntaxTree(n).resolveInner(i+1),c=s.type.prop(u0.tokenClassNodeProp);return r.setText(this.detectFormat(c,s)||"Text"),this}setDropdownIcon(){const n=this.button.buttonEl.createDiv("mini-toolbar-highlight-icon"),r=this.button.buttonEl.createDiv("mini-toolbar-icon-with-icon");return N.setIcon(n,"highlighter"),N.setIcon(r,"chevron-down"),this}detectFormat(n,r){var o;if(!n)return"Text";if(n.includes("strong"))return"Bold";if(n.includes("em"))return"Italic";if(n.includes("strikethrough"))return"Strike";if(n.contains("hmd-codeblock"))return"CodeBlock";if(n.contains("hmd-inline-code"))return"Code";if(n.contains("formatting-header")){const i=n.match(/header-\d{1,}/);if(i)return"Heading "+i[0].slice(-1)}if(n.contains("formatting-list")||n.contains("hmd-list-indent")){if(r!=null&&r.parent){const i=(o=r.parent)==null?void 0:o.type.prop(u0.lineClassNodeProp);if(i!=null&&i.contains("HyperMD-task-line"))return"To-do list"}if(n.contains("formatting-list-ol"))return"Numbered list";if(n.contains("formatting-list-ul"))return"Bulleted list"}}setTooltip(n){return this.button.setTooltip(n),this}setOptionsList(n){return this.dropdownOptions=n,this}onClick(n){return this.dropdownOptions.length>0?(this.button.onClick(r=>this.showEditMenu(r)),this):(this.button.onClick(n),this)}showEditMenu(n){var s,c;if(this.menuOpened=!this.menuOpened,!this.menuOpened)return;this.menu=new N.Menu,this.menu.onHide(()=>{this.menuOpened=!1});const r=n.currentTarget,o=(s=n.currentTarget)==null?void 0:s.getBoundingClientRect(),i={x:o.left-6,y:o.bottom+6};for(let d=0;d<((c=this.dropdownOptions)==null?void 0:c.length);d++)this.menu.addItem(h=>{h.setIcon("zap").setTitle(this.dropdownOptions[d]).onClick(()=>{})});this.menu.setParentElement(r).showAtPosition(i)}then(n){return n(this),this}}class FZ extends N.Component{constructor(n){super();ye(this,"dom");ye(this,"smallBtnContainer");ye(this,"unloading",!1);this.dom=n==null?void 0:n.createDiv({cls:"cm-mini-toolbar"},r=>r.style.position="absolute"),this.smallBtnContainer=this.dom}addSmallButton(n){return n(new NZ(this.smallBtnContainer)),this}hide(){return this.unload(),this.unloading?this:(this.unloading=!0,this.dom.detach(),this.unloading=!1,this)}}const IZ=bi.Decoration.line({attributes:{"data-ph":O("What do you think now...")},class:"thino-editor-placeholder"}),AZ=Wp.StateField.define({create(){return bi.Decoration.none},update(e,t){const n=t.state.field(N.editorInfoField);if(!(n!=null&&n.view)&&!((n==null?void 0:n.view)instanceof bu))return e;const r=new Wp.RangeSetBuilder,o=t.state.doc.toString(),i=t.state.doc.lineAt(0);return(o==null?void 0:o.length)==0&&r.add(i.from,i.from,IZ),r.finish()},provide:e=>bi.EditorView.decorations.from(e)});function eC(e){return`userId:${e}`}function OZ(e,t){return`expiryDate:${t}:${e}`}function RZ(e){try{const t=eC(e.appId);return zn.get([t])[t]??""}catch(t){return console.error(t),""}}function LZ(e,t){try{const n=eC(t.appId);return zn.set({[n]:e}),{userId:e,key:n}}catch(n){console.error(n)}}function _Z(e,t){try{const n=OZ(RZ(t),t.appId);zn.set({[n]:e})}catch(n){console.error(n)}}const PZ=Ue.grabImageFromUrl,jZ=require("http"),BZ=require("url");function YZ(e){const t=e.indexOf(";base64,"),n=e.substring(5,t),r=e.substr(t+8),o=atob(r),i=new ArrayBuffer(o.length),s=new Uint8Array(i);for(let d=0;d<o.length;d++)s[d]=o.charCodeAt(d);return new Blob([i],{type:n})}const k2=async e=>{const{type:t}=e;if(t.startsWith("image"))try{return`${await lw.upload(e)}`}catch(n){new N.Notice(n)}};function HZ(e){const t=jZ.createServer(async function(n,r){r.setHeader("Access-Control-Allow-Origin","*"),r.setHeader("Access-Control-Allow-Methods","GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE"),r.setHeader("Access-Control-Allow-Headers","Access-Control-Allow-Headers, Origin, Authorization,Accept,x-client-id, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, hypothesis-client-version"),r.setHeader("Access-Control-Allow-Credentials","true");try{if(n.url){const o=BZ.parse(n.url,!0);if(o.pathname==="/create"&&n.method==="POST"){let i="";n.on("data",s=>{i+=s}),n.on("end",async()=>{const s=JSON.parse(i),{text:c,isList:d,type:h,imageList:g}=s;let m=c;if(!m){r.statusCode=200,r.setHeader("Content-Type","application/json"),r.end(JSON.stringify({status:"success",thino:null,link:null}));return}new RegExp(/(<([^>]+)>)/g).test(c)&&(m=N.htmlToMarkdown(c));let b=[];const T=[];if(e.AutoDownloadImage){const k=m.match(Lf)||[];if(k.length>0){for(const C of k)try{const I=await PZ(C);if(I.size===0)continue;const B=new File([I],"image.png",{type:"image/png"}),F=await k2(B);T.push({oldUrl:C,newUrl:F})}catch(I){console.error(I)}T.forEach(C=>{m=m.replace(C.oldUrl,C.newUrl)}),g&&g.length>0&&(b=await Promise.all(g.map(async C=>{const I=YZ(C);return new File([I],"image.png",{type:"image/png"})})));for(const C of b){const I=await k2(C);m+=`
${I}`}}}const E=await Me.createThino({content:m,isList:d,type:h});E&&(Me.pushMemo(E),it.clearQuery()),r.statusCode=200,r.setHeader("Content-Type","application/json"),r.end(JSON.stringify({status:"success",thino:E,link:`obsidian://thino?openId=${E.id}`}))})}else if(o.pathname==="/search"&&n.method==="GET"){const i=o.query,{keyword:s}=i,c=Me.getThinoViaKeyword(s);r.statusCode=200,r.setHeader("Content-Type","application/json");const d=JSON.stringify({status:"success",thinos:c});r.end(d)}else r.statusCode=404,r.end()}}catch(o){console.error(o),r.statusCode=500,r.end({status:"error",message:o.message})}});return{listen(n,r){try{t.listen({port:parseInt(r),host:n})}catch(o){console.error(o),new N.Notice(O("Thino - Failed to start HTTP server, please check the port is available."))}new N.Notice(`${O("Thino - Started HTTP server on port")} ${r}`)},close(){t.close(),new N.Notice(O("Thino - Terminated HTTP server"))}}}const{clipboard:pn}=N.Platform.isDesktop?require("electron"):"";class UZ{constructor(){ye(this,"eventListeners");this.eventListeners={}}on(t,n){this.eventListeners[t]=this.eventListeners[t]||[],this.eventListeners[t].push(n)}once(t,n){n.$emitOnce=!0,this.on(t,n)}removeListener(t,n){if(this.eventListeners[t]){const r=this.eventListeners[t].findIndex(o=>o===n);r>=0&&this.eventListeners[t].splice(r,1)}}removeAllListeners(t){this.eventListeners[t]&&(this.eventListeners[t].length=0)}emit(t,...n){this.eventListeners[t]&&this.eventListeners[t].forEach(r=>{r.call(this,...n),r.$emitOnce&&this.removeListener(t,r)})}}const mf=new UZ;let Rp=null,N2=pn==null?void 0:pn.readText(),F2=pn==null?void 0:pn.readImage();pn&&(pn.on=(e,t)=>(mf.on(e,t),pn),pn.once=(e,t)=>(mf.once(e,t),pn),pn.off=(e,t)=>(t?mf.removeListener(e,t):mf.removeAllListeners(e),pn),pn.startWatching=()=>(Rp||(Rp=setInterval(()=>{VZ(N2,N2=pn==null?void 0:pn.readText())&&mf.emit("text-changed"),zZ(F2,F2=pn==null?void 0:pn.readImage())&&mf.emit("image-changed")},500)),pn),pn.stopWatching=()=>(Rp&&clearInterval(Rp),Rp=null,pn));function VZ(e,t){return t&&e!==t}function zZ(e,t){return!t.isEmpty()&&e.toDataURL()!==t.toDataURL()}var _2;const K0=(_2=require("electron"))==null?void 0:_2.remote;var P2,j2;const I2=(j2=(P2=require("electron"))==null?void 0:P2.remote)==null?void 0:j2.screen;class $Z{constructor(t,n){ye(this,"isRegisted");ye(this,"leaf");ye(this,"clipboard");ye(this,"isScreenTop",!1);ye(this,"currentSplitWindow");ye(this,"intervalNum");ye(this,"allowsCopy",!1);ye(this,"plugin");ye(this,"actionEl",null);this.app=t,this.plugin=n,this.isRegisted=!1,this.leaf=null,this.clipboard=pn}async onload(){N.Platform.isDesktop&&(this.initGlobalCopyEvents(),await this.registerAllShortcuts(),this.registerEvents())}registerEvents(){this.plugin.registerEvent(this.app.workspace.on("quit",()=>{K0.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally)}))}initGlobalCopyEvents(){this.plugin.addCommand({id:"init-global-copy-events",name:O("Global copy"),callback:()=>{this.allowsCopy=!this.allowsCopy,!this.allowsCopy&&this.clipboard.stopWatching(),this.allowsCopy&&this.clipboard.startWatching(),this.leaf&&this.allowsCopy&&(this.actionEl=this.leaf.view.addAction("clipboard-x","Stop global copying",()=>{var t;this.allowsCopy=!1,this.clipboard.stopWatching(),(t=this.actionEl)==null||t.remove()}))}})}onunload(){this.isRegisted&&(K0.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally),this.clipboard.off("text-changed"),this.clipboard.off("image-changed"),this.clipboard.stopWatching(),this.leaf&&this.leaf.detach())}getCurrentLeaf(){var n;return this.leaf?this.app.workspace.getLeavesOfType("thino_view").length>0&&!!this.app.workspace.getLeafById(this.leaf.id)?!0:((n=this.leaf)==null||n.detach(),this.currentSplitWindow.close(),this.currentSplitWindow=null,this.leaf=null,this.isScreenTop=!1,!1):!1}async registerAllShortcuts(){K0.globalShortcut.register(this.plugin.settings.CaptureKey.OpenThinoGlobally,()=>{this.getCurrentLeaf()?this.showThinoView():this.openThinoView()}),this.isRegisted=!0}showThinoView(){var r,o,i,s;const t=I2.getCursorScreenPoint(),n=(s=(i=(o=(r=this.leaf)==null?void 0:r.parent)==null?void 0:o.parent)==null?void 0:i.win)==null?void 0:s.electronWindow;if(n){if(n.setAlwaysOnTop(!this.isScreenTop,"screen"),this.leaf.setPinned(!this.isScreenTop),n.isMinimized()&&n.restore(),n.focus(),this.plugin.settings.CaptureKey.ShowNearMouse){const{width:c,height:d}=n.getBounds();n.setBounds({x:t.x,y:t.y,width:c,height:d})}if(this.app.workspace.trigger("focus-on-textarea"),this.isScreenTop){this.isScreenTop=!1,setTimeout(()=>{n.setAlwaysOnTop(!1,"screen")},200);return}this.isScreenTop=!0}}openThinoView(){var i,s,c,d,h;this.leaf=this.app.workspace.openPopoutLeaf({size:{width:400,height:400}});const t=this.leaf;this.leaf.setViewState({type:"thino_view"}),setTimeout(()=>{t.view.containerEl.classList.toggle("mobile-view",!0)},0),this.currentSplitWindow=(s=(i=this.leaf)==null?void 0:i.parent)==null?void 0:s.parent;const n=(h=(d=(c=this.leaf)==null?void 0:c.parent)==null?void 0:d.parent)==null?void 0:h.win.electronWindow;if(!n)return;n.setAlwaysOnTop(!this.isScreenTop,"screen"),this.leaf.setPinned(!this.isScreenTop),this.isScreenTop=!0;const r=this.app,o=g=>{var b,T,E;const m=I2.getCursorScreenPoint(),w=(E=(T=(b=t==null?void 0:t.parent)==null?void 0:b.parent)==null?void 0:T.win)==null?void 0:E.electronWindow;if(w){if(w.isMinimized()&&w.restore(),!this.isScreenTop&&this.plugin.settings.CaptureKey.ShowNearMouse){const{width:k,height:C}=w.getBounds();w.setBounds({x:m.x,y:m.y-200,width:k,height:C})}w.setAlwaysOnTop(!0,"screen"),r.workspace.trigger("focus-on-textarea"),r.workspace.trigger("send-to-thino",g,t)}};this.clipboard.on("text-changed",()=>{const g=this.clipboard.readText();o(g)}).on("image-changed",()=>{const g=this.clipboard.readImage();o(g)})}}class qZ extends N.Modal{constructor(n){super(n);ye(this,"root")}onOpen(){const{contentEl:n,modalEl:r}=this;try{this.root=EQ(n),r.toggleClass("memos-editor-modal",!0),setTimeout(()=>{var o;(o=n.querySelector("textarea"))==null||o.focus()},10)}catch(o){console.error(o)}}onClose(){this.root.unmount(),this.containerEl&&this.containerEl.empty()}}class A2 extends N.EditorSuggest{constructor(n,r){super(n);ye(this,"root");ye(this,"editor");ye(this,"cursor");ye(this,"plugin");ye(this,"tags");ye(this,"type","customTag");ye(this,"HASHTAG_REGEX",/(^|\s)#[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]*$/g);this.plugin=r}checkSettings(){return this.plugin.settings.UseVaultTags}checkInMemosView(n){var i;const r=n.containerEl;if(!r)return!1;const o=(i=r.parentElement)==null?void 0:i.parentElement;return(o==null?void 0:o.classList.contains("common-editor-inputer"))||!1}fuzzySearchItemsOptimized(n,r){const o=N.prepareFuzzySearch(n);return r.map(s=>{const c=o(s);return c?{item:s,match:c}:null}).filter(Boolean)}onTrigger(n,r){if(!this.checkInMemosView(r)||this.checkSettings())return null;this.tags=Me.getState().tags,this.cursor=n,this.editor=r;const o=n.line,i=r.getLine(o),s=i.substr(0,n.ch);if(s.match(this.HASHTAG_REGEX)&&i.substr(n.ch,1)!=="#"){const c=s.lastIndexOf("#"),d=s.substr(c+1);return{start:{line:o,ch:c},end:{line:o,ch:n.ch},query:d}}return null}getSuggestions(n){return this.fuzzySearchItemsOptimized(n.query,this.tags).map(r=>r.item).sort((r,o)=>r.localeCompare(o))||[]}renderSuggestion(n,r){r.setText(n)}selectSuggestion(n){if(this.context){const r=this.context.editor,o=this.context.start,i=this.context.end;r.transaction({changes:[{from:o,to:i,text:"#"+n+" "}]}),setTimeout(function(){return r.focus()})}this.close()}}const ob=crypto,tC=e=>e instanceof CryptoKey,Rg=new TextEncoder,ab=new TextDecoder;function WZ(...e){const t=e.reduce((o,{length:i})=>o+i,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}const GZ=e=>{const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n},Q0=e=>{let t=e;t instanceof Uint8Array&&(t=ab.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return GZ(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class iy extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(t){var n;super(t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}}class KZ extends iy{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class sy extends iy{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class vr extends iy{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class QZ extends iy{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}function ns(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Lg(e,t){return e.name===t}function Z0(e){return parseInt(e.name.slice(4),10)}function ZZ(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function JZ(e,t){if(t.length&&!t.some(n=>e.usages.includes(n))){let n="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();n+=`one of ${t.join(", ")}, or ${r}.`}else t.length===2?n+=`one of ${t[0]} or ${t[1]}.`:n+=`${t[0]}.`;throw new TypeError(n)}}function XZ(e,t,...n){switch(t){case"HS256":case"HS384":case"HS512":{if(!Lg(e.algorithm,"HMAC"))throw ns("HMAC");const r=parseInt(t.slice(2),10);if(Z0(e.algorithm.hash)!==r)throw ns(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Lg(e.algorithm,"RSASSA-PKCS1-v1_5"))throw ns("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(Z0(e.algorithm.hash)!==r)throw ns(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Lg(e.algorithm,"RSA-PSS"))throw ns("RSA-PSS");const r=parseInt(t.slice(2),10);if(Z0(e.algorithm.hash)!==r)throw ns(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if(e.algorithm.name!=="Ed25519"&&e.algorithm.name!=="Ed448")throw ns("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!Lg(e.algorithm,"ECDSA"))throw ns("ECDSA");const r=ZZ(t);if(e.algorithm.namedCurve!==r)throw ns(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}JZ(e,n)}function nC(e,t,...n){var r;if(n.length>2){const o=n.pop();e+=`one of type ${n.join(", ")}, or ${o}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&(r=t.constructor)!=null&&r.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const O2=(e,...t)=>nC("Key must be ",e,...t);function rC(e,t,...n){return nC(`Key for the ${e} algorithm must be `,t,...n)}const oC=e=>tC(e),wi=["CryptoKey"],eJ=(...e)=>{const t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(const r of t){const o=Object.keys(r);if(!n||n.size===0){n=new Set(o);continue}for(const i of o){if(n.has(i))return!1;n.add(i)}}return!0};function tJ(e){return typeof e=="object"&&e!==null}function R2(e){if(!tJ(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}const nJ=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if(typeof n!="number"||n<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}},ll=(e,t,n=0)=>{n===0&&(t.unshift(t.length),t.unshift(6));const r=e.indexOf(t[0],n);if(r===-1)return!1;const o=e.subarray(r,r+t.length);return o.length!==t.length?!1:o.every((i,s)=>i===t[s])||ll(e,t,r+1)},L2=e=>{switch(!0){case ll(e,[42,134,72,206,61,3,1,7]):return"P-256";case ll(e,[43,129,4,0,34]):return"P-384";case ll(e,[43,129,4,0,35]):return"P-521";case ll(e,[43,101,110]):return"X25519";case ll(e,[43,101,111]):return"X448";case ll(e,[43,101,112]):return"Ed25519";case ll(e,[43,101,113]):return"Ed448";default:throw new sy("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},rJ=async(e,t,n,r,o)=>{let i,s;const c=new Uint8Array(atob(n.replace(e,"")).split("").map(h=>h.charCodeAt(0))),d=t==="spki";switch(r){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},s=d?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.slice(-3)}`},s=d?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},s=d?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":i={name:"ECDSA",namedCurve:"P-256"},s=d?["verify"]:["sign"];break;case"ES384":i={name:"ECDSA",namedCurve:"P-384"},s=d?["verify"]:["sign"];break;case"ES512":i={name:"ECDSA",namedCurve:"P-521"},s=d?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const h=L2(c);i=h.startsWith("P-")?{name:"ECDH",namedCurve:h}:{name:h},s=d?[]:["deriveBits"];break}case"EdDSA":i={name:L2(c)},s=d?["verify"]:["sign"];break;default:throw new sy('Invalid or unsupported "alg" (Algorithm) value')}return ob.subtle.importKey(t,c,i,(o==null?void 0:o.extractable)??!1,s)},oJ=(e,t,n)=>rJ(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,n);async function aJ(e,t,n){if(typeof e!="string"||e.indexOf("-----BEGIN PUBLIC KEY-----")!==0)throw new TypeError('"spki" must be SPKI formatted string');return oJ(e,t,n)}const iJ=(e,t)=>{if(!(t instanceof Uint8Array)){if(!oC(t))throw new TypeError(rC(e,t,...wi,"Uint8Array"));if(t.type!=="secret")throw new TypeError(`${wi.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}},sJ=(e,t,n)=>{if(!oC(t))throw new TypeError(rC(e,t,...wi));if(t.type==="secret")throw new TypeError(`${wi.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if(n==="sign"&&t.type==="public")throw new TypeError(`${wi.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if(n==="decrypt"&&t.type==="public")throw new TypeError(`${wi.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n==="verify"&&t.type==="private")throw new TypeError(`${wi.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n==="encrypt"&&t.type==="private")throw new TypeError(`${wi.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)},lJ=(e,t,n)=>{e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?iJ(e,t):sJ(e,t,n)};function uJ(e,t,n,r,o){if(o.crit!==void 0&&r.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(s=>typeof s!="string"||s.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;n!==void 0?i=new Map([...Object.entries(n),...t.entries()]):i=t;for(const s of r.crit){if(!i.has(s))throw new sy(`Extension Header Parameter "${s}" is not recognized`);if(o[s]===void 0)throw new e(`Extension Header Parameter "${s}" is missing`);if(i.get(s)&&r[s]===void 0)throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`)}return new Set(r.crit)}const cJ=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(n=>typeof n!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};function fJ(e,t){const n=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new sy(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function dJ(e,t,n){if(tC(t))return XZ(t,e,n),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(O2(t,...wi));return ob.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[n])}throw new TypeError(O2(t,...wi,"Uint8Array"))}const pJ=async(e,t,n,r)=>{const o=await dJ(e,t,"verify");nJ(e,o);const i=fJ(e,o.algorithm);try{return await ob.subtle.verify(i,o,n,r)}catch{return!1}};async function hJ(e,t,n){if(!R2(e))throw new vr("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new vr('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new vr("JWS Protected Header incorrect type");if(e.payload===void 0)throw new vr("JWS Payload missing");if(typeof e.signature!="string")throw new vr("JWS Signature missing or incorrect type");if(e.header!==void 0&&!R2(e.header))throw new vr("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{const E=Q0(e.protected);r=JSON.parse(ab.decode(E))}catch{throw new vr("JWS Protected Header is invalid")}if(!eJ(r,e.header))throw new vr("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...r,...e.header},i=uJ(vr,new Map([["b64",!0]]),n==null?void 0:n.crit,r,o);let s=!0;if(i.has("b64")&&(s=r.b64,typeof s!="boolean"))throw new vr('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:c}=o;if(typeof c!="string"||!c)throw new vr('JWS "alg" (Algorithm) Header Parameter missing or invalid');const d=n&&cJ("algorithms",n.algorithms);if(d&&!d.has(c))throw new KZ('"alg" (Algorithm) Header Parameter value not allowed');if(s){if(typeof e.payload!="string")throw new vr("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new vr("JWS Payload must be a string or an Uint8Array instance");let h=!1;typeof t=="function"&&(t=await t(r,e),h=!0),lJ(c,t,"verify");const g=WZ(Rg.encode(e.protected??""),Rg.encode("."),typeof e.payload=="string"?Rg.encode(e.payload):e.payload);let m;try{m=Q0(e.signature)}catch{throw new vr("Failed to base64url decode the signature")}if(!await pJ(c,t,m,g))throw new QZ;let b;if(s)try{b=Q0(e.payload)}catch{throw new vr("Failed to base64url decode the payload")}else typeof e.payload=="string"?b=Rg.encode(e.payload):b=e.payload;const T={payload:b};return e.protected!==void 0&&(T.protectedHeader=r),e.header!==void 0&&(T.unprotectedHeader=e.header),h?{...T,key:t}:T}async function mJ(e,t,n){if(e instanceof Uint8Array&&(e=ab.decode(e)),typeof e!="string")throw new vr("Compact JWS must be a string or Uint8Array");const{0:r,1:o,2:i,length:s}=e.split(".");if(s!==3)throw new vr("Invalid Compact JWS");const c=await hJ({payload:o,protected:r,signature:i},t,n),d={payload:c.payload,protectedHeader:c.protectedHeader};return typeof t=="function"?{...d,key:c.key}:d}const gJ={webId:"globe-2",pinned:"pin",archived:"archive",visibility:"eye",deleted:"trash"};class vJ extends bi.WidgetType{constructor(n,r,o,i,s){super();ye(this,"error",!1);this.view=n,this.plugin=r,this.target=o,this.type=i,this.to=s}eq(n){return this.target===n.target}toDOM(){const n=createSpan();return n.toggleClass("thino-inline-widget",!0),N.setIcon(n,gJ[this.type]||"help-circle"),N.setTooltip&&N.setTooltip(n,this.target),n}}function yJ(e){class t{constructor(o){ye(this,"view");ye(this,"match",new bi.MatchDecorator({regexp:/\[(webId|pinned|archived|visibility|deleted)::([^\]]+)\]/g,decorate:(o,i,s,c,d)=>{this.shouldRender(d,i,s)&&o(i,s,bi.Decoration.replace({widget:new vJ(d,e,c[0],c[1],s)}))}}));ye(this,"decorations",bi.Decoration.none);this.view=o,this.updateDecorations(o)}update(o){this.updateDecorations(o.view,o)}destroy(){this.decorations=bi.Decoration.none}updateDecorations(o,i){!i||this.decorations.size===0?this.decorations=this.match.createDeco(o):this.decorations=this.match.updateDeco(i,this.decorations)}isLivePreview(o){return o.field(N.editorLivePreviewField)}shouldRender(o,i,s){return!o.state.selection.ranges.some(d=>d.from<=i?d.to>=i:d.from<=s)&&this.isLivePreview(o.state)}}const n={decorations:r=>r.decorations.update({filter:(o,i,s)=>{const c=s.spec.widget;return c&&c.error?!1:o===i||!r.view.state.selection.ranges.filter(d=>{const h=d.from,g=d.to;return h<=o?g>=o:h<=i}).length}})};return bi.ViewPlugin.fromClass(t,n)}const wJ=e=>e.ctrlKey!==void 0||e.metaKey!==void 0||e.shiftKey!==void 0||e.altKey!==void 0,_g=()=>{new N.Notice(O("Open Memos Successfully"))},Pg=[{id:"open-thino-in-left-sidebar",shortName:O("Left sidebar"),name:O("Open thino in left sidebar"),icon:"arrow-left",location:"left",cb:_g,modKeys:"shift"},{id:"open-thino-in-right-sidebar",shortName:O("Right sidebar"),name:O("Open thino in right sidebar"),icon:"arrow-right",location:"right",cb:_g,modKeys:["ctrl","meta"]},{id:"open-thino-in-float",shortName:O("Float window"),name:O("Open thino in float window"),icon:"layout",location:"float",cb:_g,modKeys:"alt"},{id:"open-thino-in-center",shortName:O("Center window"),name:O("Open thino in center window"),icon:"tv-2",location:"center",cb:_g,modKeys:void 0}];class bJ extends N.Plugin{constructor(){super(...arguments);ye(this,"settings");ye(this,"settingTab");ye(this,"triggerBySelf",!1);ye(this,"updatedID","");ye(this,"debounceTimer",0);ye(this,"apiHttpServer",null);ye(this,"captureService",null);ye(this,"loaded",!1)}async onload(){await this.loadSettings(),TQ(),this.registerRibbon(),await this.verify(),this.settingTab=new _Q(this.app,this),this.addSettingTab(this.settingTab),this.initEditor(),this.initURIHandler(),this.registerMobileEvent(),this.registerCommands(),this.registerCanvasNodeMemos(),this.registerHoverEvent(),this.registerEditorSuggest(new bQ(this.app,this)),this.registerEditorExtension([AZ]),this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this)),this.registerView(Ar,n=>new bu(n,this))}async loadSettings(){this.settings=Object.assign({},Ma,await this.loadData()),ut.setSettings(this.settings)}async saveSettings(){await this.saveData(this.settings),ut.setSettings(this.settings)}onunload(){var r;this.app.workspace.detachLeavesOfType(Ar),Me.clearMemos(),xe.dispatch({type:"CLEAR_MEMOS",payload:null}),xe.dispatch({type:"CLEAR_FILES",payload:null}),xe.dispatch({type:"CLEAR_VIEW",payload:null});const n=document.body.find(".dialog-wrapper");n&&((r=n.parentElement)==null||r.detach()),this.apiHttpServer&&(this.apiHttpServer.close(),this.apiHttpServer=null),this.captureService&&this.captureService.onunload(),new N.Notice(O("Close Memos Successfully"))}initEditor(){const n=()=>{const r=this.app.embedRegistry;if(!r)return!1;const o=r.embedByExtension.md,i=createEl("div"),s=o({app:this.app,containerEl:i},null,null);if(s.editable=!0,s.set(""),s.showEditor(),!s.editMode)return!1;const c=Object.getPrototypeOf(Object.getPrototypeOf(s.editMode));return ut.setEditor(c),i.detach(),!0};this.app.workspace.onLayoutReady(()=>{n()||this.app.workspace.onLayoutReady(()=>{setTimeout(()=>{n()},100)})}),this.register(av(N.MetadataCache.prototype,{getFileCache:r=>function(o){return!(o!=null&&o.path)&&!o?null:r.call(this,o)}}))}initApp(){ut.setApp(this.app)}initURIHandler(){this.registerObsidianProtocolHandler("thino",async n=>{var s,c,d,h;if(!n)return;if(n.userid)try{const g=n.userid;LZ(g,this.app),_Z(N.moment().add(30,"days").valueOf(),this.app),rt.setRefresh(!0)}catch(g){console.error(g),new N.Notice(O("Failed to verify"))}if(n.token)try{const g=n.token;(s=this.app)==null||s.saveLocalStorage("tokenForSync",g),setTimeout(()=>{this.app.setting.open(),this.app.setting.openTabById(this.manifest.id??"obsidian-memos"),this.settingTab.display()},200),new N.Notice(O("Saved sync token successfully"))}catch(g){console.error(g),new N.Notice(O("Failed to save"))}if(n.copyToken){this.app.setting.open(),this.app.setting.openTabById(this.manifest.id??"obsidian-memos");const g=!N.Platform.isDesktop&&await((c=window.Capacitor)==null?void 0:c.Plugins.Device.getId()),m=N.Platform.isDesktop?await Un():g.identifier||g.uuid;await navigator.clipboard.writeText(m),new N.Notice(O("Copied app id successfully"))}const r=(d=ut.getState())==null?void 0:d.verifyState,o=!N.Platform.isDesktop&&await((h=window.Capacitor)==null?void 0:h.Plugins.Device.getId()),i=N.Platform.isDesktop?await Un():o.identifier||o.uuid;if(!(!r||r.appId!==i)){if(n.content){const g=n.type,m=decodeURI(n.content)!==n.content?decodeURI(n.content):n.content,w=n.task,b=await Me.createThino({content:m,type:g,isList:!!w});if(!b)return;Me.pushMemo(b),it.clearQuery()}n.openId&&await Me.openThinoByID(n.openId)}})}initGlobalManifest(){rt.setPluginManifest(this.manifest)}stopServer(){this.apiHttpServer&&(this.apiHttpServer.close(),this.apiHttpServer=null)}async initServer(){var i,s;if(N.Platform.isMobile||!this.settings.EnabledHttpApi)return;const n=(i=ut.getState())==null?void 0:i.verifyState,r=!N.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),o=N.Platform.isDesktop?await Un():r.identifier||r.uuid;!n||n.appId!==o||(this.apiHttpServer=HZ(this.settings),this.initServerPort())}initServerPort(){this.apiHttpServer&&this.settings.EnabledHttpApi&&this.apiHttpServer.listen(this.settings.HttpApiIpType,this.settings.HttpApiPort)}async initCaptureService(){var i,s;if(N.Platform.isMobile||!this.settings.CaptureKey.EnableCaptureKey)return;const n=(i=ut.getState())==null?void 0:i.verifyState,r=!N.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),o=N.Platform.isDesktop?await Un():r.identifier||r.uuid;!n||n.appId!==o||(this.captureService=new $Z(this.app,this),await this.captureService.onload())}registerMobileEvent(){N.Platform.isMobile&&(this.registerEvent(this.app.workspace.on("receive-text-menu",(n,r)=>{n.addItem(o=>{o.setIcon("popup-open").setTitle(O("Insert as Memo")).onClick(async()=>{const i=await Me.createMemoDaily(r,!1);Me.pushMemo(i)})})})),this.registerEvent(this.app.workspace.on("receive-files-menu",(n,r)=>{n.addItem(o=>{o.setIcon("popup-open").setTitle(O("Insert file as memo content")).onClick(async()=>{const i=r.map(c=>this.app.fileManager.generateMarkdownLink(c,c.path)),s=await Me.createMemoDaily(i.join(`
`),!1);Me.pushMemo(s)})})})))}registerCommands(){Pg.forEach(n=>{this.addCommand({id:n.id,name:n.name,callback:()=>this.openMemos(n.location,n.cb),hotkeys:[]})}),N.Platform.isDesktop&&this.addCommand({id:"show-thino-editor",name:O("Show thino editor"),checkCallback:n=>{if(Me.initialized&&ut.initialized)return n||new qZ(this.app).open(),!0}}),this.addCommand({id:"toggle-minimal-thino",name:O("Toggle minimal mode"),callback:()=>{const n=document.body.hasClass("minimal-thino");document.body.toggleClass("minimal-thino",!n)}}),this.addCommand({id:"focus-on-thino-editor",name:O("Focus on thino editor"),callback:()=>this.focusOnEditor(),hotkeys:[]}),this.addCommand({id:"reinit-thino-sync",name:O("ReSync web thinos to local"),callback:()=>{sQ(this.app)}}),this.addCommand({id:"init-thino-sync",name:O("Sync local thinos to web"),callback:async()=>{var r;if(!((r=this.app)==null?void 0:r.loadLocalStorage("tokenForSync"))){new N.Notice(O("Please input token first"));return}if(!this.settings.startSync){new N.Notice(O("Please enable sync first"));return}try{await Me.initSync()}catch(o){console.error(o),new N.Notice(O("Init Failed"))}}}),this.addCommand({id:"show-daily-thino",name:O("Show daily thino view"),callback:()=>this.openDailyMemo(),hotkeys:[]}),this.addCommand({id:"focus-on-search-bar",name:O("Focus on search bar"),callback:()=>this.searchIt(),hotkeys:[]}),this.addCommand({id:"show-thino-in-popover",name:O("Show-thino in popover(Hover editor)"),callback:()=>this.showInPopover(),hotkeys:[]})}async onLayoutReady(){this.initApp(),this.initServer(),this.initGlobalManifest(),await this.initMemos(),this.autoOpenMemos(),this.registerThinoWidget(),this.registerToolbarCheck(),await this.initCaptureService(),ut.setPlugin(this);const n=this.app.workspace.editorSuggest.suggests.findIndex(r=>r.type==="customTag");n!==-1?(this.app.workspace.editorSuggest.suggests.splice(n,1),this.app.workspace.editorSuggest.suggests.unshift(new A2(this.app,this))):this.app.workspace.editorSuggest.suggests.unshift(new A2(this.app,this))}async initMemos(){await ut.fechLocalDailyNotes(),await Me.fetchAllMemos(),ut.getState(),Me.getState()}registerCanvasNodeMemos(){if(!N.requireApiVersion("1.2.0"))return;const n=i=>{clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{setTimeout(async()=>{const s=i.canvas.getData(),c=s.nodes.find(d=>d.id===i.id);if(c&&(r(c),i.canvas.setData(s),Me.getMemoById(i.id))){const h=await Me.updateMemo(i.id,c.text,c.thinoType);Me.editMemo(h)}i.canvas.requestSave(!0)},0)},800)},r=i=>{i.createdAt||(i.createdAt=N.moment().format("YYYY-MM-DD HH:mm:ss")),i.updatedAt=N.moment().format("YYYY-MM-DD HH:mm:ss"),i.deletedAt=i.deletedAt?i.deletedAt:"",i.pinned=i.pinned?i.pinned:!1,i.visibility=i.visibility?i.visibility:"PUBLIC",i.rowStatus=i.rowStatus?i.rowStatus:"NORMAL",i.thinoType=i.thinoType?i.thinoType:"JOURNAL",i.hasId=i.hasId?i.hasId:"",i.linkId=i.linkId?i.linkId:"",i.resourceList=[]},o=()=>{var w,b;const i=(w=this.app.workspace.getLeavesOfType("canvas").first())==null?void 0:w.view;if(!i||!(i==null?void 0:i.canvas))return!1;const c=((b=this.app.workspace.getLeavesOfType("canvas").first())==null?void 0:b.view).canvas.nodes.values(),h=Array.from(c).filter(T=>T.text!==void 0);if(!h||h.length===0)return!1;const g=h[0].child;if(!g)return!1;const m=av(g.constructor.prototype,{save:T=>function(...E){T.call(this,...E),this.node.isEditing&&n(this.node)}});return this.register(m),!0};this.app.workspace.onLayoutReady(()=>{if(!o()){const i=this.app.workspace.on("layout-change",()=>{o()&&this.app.workspace.offref(i)});this.registerEvent(i)}})}registerHoverEvent(){this.registerHoverLinkSource("thino",{defaultMod:!0,display:"Thino"})}registerRibbon(){this.addRibbonIcon("Memos",O("ribbonIconTitle"),async n=>{if(n.button===2){n.preventDefault();const r=new N.Menu;Pg.forEach(o=>{r.addItem(i=>{i.setTitle(o.shortName).setIcon(o.icon).onClick(async()=>{await this.openMemos(o.location,o.cb)})})}),r.showAtMouseEvent(n);return}for(let r=0;r<Pg.length;r++){const o=Pg[r];if(!o.modKeys){await this.openMemos(o.location,o.cb);break}if(!wJ(n))continue;const i=s=>n[`${s}Key`];if(typeof o.modKeys=="string"&&i(o.modKeys)||Array.isArray(o.modKeys)&&o.modKeys.some(i)){await this.openMemos(o.location,o.cb);break}}})}registerThinoWidget(){this.registerEditorExtension([yJ(this)])}async registerToolbarCheck(){var i,s;if(this.loaded)return;const n=(i=ut.getState())==null?void 0:i.verifyState,r=!N.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),o=N.Platform.isDesktop?await Un():r.identifier||r.uuid;!n||n.appId!==o||(this.registerEditorExtension([kZ(this.app)]),this.registerEditorSuggest(new DQ(this.app,this)),this.loaded=!0)}async verify(){let n="";if(N.Platform.isDesktop)n=await Un();else{const o=await window.Capacitor.Plugins.Device.getId();n=o.identifier||o.uuid}async function r(o){if(!o)return ut.setVerifyState(null),!1;const c=await aJ(`-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr+i4MLzI40gGFHl7gdRH
UL1mH0NcWEs1/IBYDDbc9ALbvUGwDaUcVIKke+b+F4T7qISexyGd5qV0s1vNYeCk
iCTq4w3+CFDurIFYAgQYTcV6K5pL8Bpb79FEclsTnAcKgiuzKBxPZ1djKxbgnmFj
+PE+EcmX+JJK9hG1O8X+YFJoPJWl225eCoysONickiI7Ndwu9YLR8pIUb1VMyJSy
cMR87z466Nc5Hx2QhwyuiiQYL3Ru4WkNF3AVWgqeOlhBDybFFwDaV7OOMTiYtH46
3iKx6azEVS8W/gYfrW+hKp2VziPPw3oxouP/wCes/4qRlXkwyjSwtfLtpE4Rsa4+
swIDAQAB
-----END PUBLIC KEY-----`,"RS256");try{const{payload:d}=await mJ(o,c),h=JSON.parse(new TextDecoder().decode(d));return!h||h.iss!=="pkmer"||h.type!=="thino"||h.appId!==n?!1:(ut.setVerifyState(h),!0)}catch(d){console.error(d)}}return await r(this.settings.tokenForVerify[n])}autoOpenMemos(){this.app.workspace.getLeavesOfType(Ar).length>0||this.settings.MobileAndDesktop==="Mobile"&&N.Platform.isDesktop||this.settings.MobileAndDesktop==="Desktop"&&N.Platform.isMobile||this.settings.OpenMemosAutomatically&&this.openMemos()}openDailyMemo(){const n=this.app.workspace.getLeavesOfType(Ar);if(!this.settings.OpenDailyMemosWithMemos){Up();return}if(n.length>0){Up();return}this.openMemos(),Up()}async openMemos(n="center",r){const o=this.app.workspace;if(o.getLeavesOfType(Ar).length>0){const s=o.getLeavesOfType(Ar)[0];o.setActiveLeaf(s),o.revealLeaf(s);return}o.detachLeavesOfType(Ar);let i;switch(n){case"left":i=o.getLeftLeaf(!1);break;case"right":i=o.getRightLeaf(!1);break;case"float":i=o.getLeaf("window");break;default:i=o.getLeaf(!1);break}if(i&&(await i.setViewState({type:Ar}),o.revealLeaf(i)),this.settings.FocusOnEditor){const s=i.view.containerEl.querySelector("textarea");s&&s.focus()}r==null||r()}searchIt(){const n=this.app.workspace,r=n.getLeavesOfType(Ar);if(!(r.length>0)){this.openMemos();return}const o=r[0];n.setActiveLeaf(o),o.view.containerEl.querySelector(".search-bar-inputer .text-input").focus()}async focusOnEditor(){if(!(this.app.workspace.getLeavesOfType(Ar).length>0)){await this.openMemos();return}this.app.workspace.trigger("focus-on-textarea")}changeStatus(){const n=this.app.workspace,r=n.getLeavesOfType(Ar);if(!(r.length>0)){new N.Notice(O("Please Open Memos First"));return}const o=r[0];n.setActiveLeaf(o),o.view.containerEl.querySelector(".list-or-task").click()}async showInPopover(){var i,s,c;const n=this.app.workspace;if(n.detachLeavesOfType(Ar),!this.app.plugins.getPlugin("obsidian-hover-editor")){new N.Notice(O("Please install obsidian-hover-editor plugin first"));return}const o=await((i=this.app.plugins.getPlugin("obsidian-hover-editor"))==null?void 0:i.spawnPopover());o&&(await o.setViewState({type:Ar}),n.revealLeaf(o),o.view.containerEl.classList.add("mobile-view"),(s=this.settings)!=null&&s.FocusOnEditor&&o.view.containerEl.querySelector("textarea")!==void 0&&((c=o.view.containerEl.querySelector("textarea"))==null||c.focus()))}}module.exports=bJ;