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.

148 lines
1.1 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 G3=Object.defineProperty;var q3=(e,t,n)=>t in e?G3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var he=(e,t,n)=>(q3(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const x=require("obsidian"),y0=require("@codemirror/language"),Qh=require("@codemirror/state"),Ci=require("@codemirror/view");var Jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tI={exports:{}},Nh={},nI={exports:{}},Nt={},Pb;function J3(){if(Pb)return Nt;Pb=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function w(Z){return Z===null||typeof Z!="object"?null:(Z=g&&Z[g]||Z["@@iterator"],typeof Z=="function"?Z:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,T={};function E(Z,$,X){this.props=Z,this.context=$,this.refs=T,this.updater=X||D}E.prototype.isReactComponent={},E.prototype.setState=function(Z,$){if(typeof Z!="object"&&typeof Z!="function"&&Z!=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,Z,$,"setState")},E.prototype.forceUpdate=function(Z){this.updater.enqueueForceUpdate(this,Z,"forceUpdate")};function A(){}A.prototype=E.prototype;function N(Z,$,X){this.props=Z,this.context=$,this.refs=T,this.updater=X||D}var R=N.prototype=new A;R.constructor=N,S(R,E.prototype),R.isPureReactComponent=!0;var F=Array.isArray,H=Object.prototype.hasOwnProperty,P={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function z(Z,$,X){var ve,De={},be=null,ke=null;if($!=null)for(ve in $.ref!==void 0&&(ke=$.ref),$.key!==void 0&&(be=""+$.key),$)H.call($,ve)&&!L.hasOwnProperty(ve)&&(De[ve]=$[ve]);var Be=arguments.length-2;if(Be===1)De.children=X;else if(1<Be){for(var _e=Array(Be),it=0;it<Be;it++)_e[it]=arguments[it+2];De.children=_e}if(Z&&Z.defaultProps)for(ve in Be=Z.defaultProps,Be)De[ve]===void 0&&(De[ve]=Be[ve]);return{$$typeof:e,type:Z,key:be,ref:ke,props:De,_owner:P.current}}function U(Z,$){return{$$typeof:e,type:Z.type,key:$,ref:Z.ref,props:Z.props,_owner:Z._owner}}function W(Z){return typeof Z=="object"&&Z!==null&&Z.$$typeof===e}function K(Z){var $={"=":"=0",":":"=2"};return"$"+Z.replace(/[=:]/g,function(X){return $[X]})}var ae=/\/+/g;function ce(Z,$){return typeof Z=="object"&&Z!==null&&Z.key!=null?K(""+Z.key):$.toString(36)}function fe(Z,$,X,ve,De){var be=typeof Z;(be==="undefined"||be==="boolean")&&(Z=null);var ke=!1;if(Z===null)ke=!0;else switch(be){case"string":case"number":ke=!0;break;case"object":switch(Z.$$typeof){case e:case t:ke=!0}}if(ke)return ke=Z,De=De(ke),Z=ve===""?"."+ce(ke,0):ve,F(De)?(X="",Z!=null&&(X=Z.replace(ae,"$&/")+"/"),fe(De,$,X,"",function(it){return it})):De!=null&&(W(De)&&(De=U(De,X+(!De.key||ke&&ke.key===De.key?"":(""+De.key).replace(ae,"$&/")+"/")+Z)),$.push(De)),1;if(ke=0,ve=ve===""?".":ve+":",F(Z))for(var Be=0;Be<Z.length;Be++){be=Z[Be];var _e=ve+ce(be,Be);ke+=fe(be,$,X,_e,De)}else if(_e=w(Z),typeof _e=="function")for(Z=_e.call(Z),Be=0;!(be=Z.next()).done;)be=be.value,_e=ve+ce(be,Be++),ke+=fe(be,$,X,_e,De);else if(be==="object")throw $=String(Z),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(Z).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return ke}function ie(Z,$,X){if(Z==null)return Z;var ve=[],De=0;return fe(Z,ve,"","",function(be){return $.call(X,be,De++)}),ve}function ge(Z){if(Z._status===-1){var $=Z._result;$=$(),$.then(function(X){(Z._status===0||Z._status===-1)&&(Z._status=1,Z._result=X)},function(X){(Z._status===0||Z._status===-1)&&(Z._status=2,Z._result=X)}),Z._status===-1&&(Z._status=0,Z._result=$)}if(Z._status===1)return Z._result.default;throw Z._result}var Te={current:null},se={transition:null},we={ReactCurrentDispatcher:Te,ReactCurrentBatchConfig:se,ReactCurrentOwner:P};return Nt.Children={map:ie,forEach:function(Z,$,X){ie(Z,function(){$.apply(this,arguments)},X)},count:function(Z){var $=0;return ie(Z,function(){$++}),$},toArray:function(Z){return ie(Z,function($){return $})||[]},only:function(Z){if(!W(Z))throw Error("React.Children.only expected to receive a single React element child.");return Z}},Nt.Component=E,Nt.Fragment=n,Nt.Profiler=a,Nt.PureComponent=N,Nt.StrictMode=r,Nt.Suspense=d,Nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=we,Nt.cloneElement=function(Z,$,X){if(Z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Z+".");var ve=S({},Z.props),De=Z.key,be=Z.ref,ke=Z._owner;if($!=null){if($.ref!==void 0&&(be=$.ref,ke=P.current),$.key!==void 0&&(De=""+$.key),Z.type&&Z.type.defaultProps)var Be=Z.type.defaultProps;for(_e in $)H.call($,_e)&&!L.hasOwnProperty(_e)&&(ve[_e]=$[_e]===void 0&&Be!==void 0?Be[_e]:$[_e])}var _e=arguments.length-2;if(_e===1)ve.children=X;else if(1<_e){Be=Array(_e);for(var it=0;it<_e;it++)Be[it]=arguments[it+2];ve.children=Be}return{$$typeof:e,type:Z.type,key:De,ref:be,props:ve,_owner:ke}},Nt.createContext=function(Z){return Z={$$typeof:s,_currentValue:Z,_currentValue2:Z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Z.Provider={$$typeof:o,_context:Z},Z.Consumer=Z},Nt.createElement=z,Nt.createFactory=function(Z){var $=z.bind(null,Z);return $.type=Z,$},Nt.createRef=function(){return{current:null}},Nt.forwardRef=function(Z){return{$$typeof:u,render:Z}},Nt.isValidElement=W,Nt.lazy=function(Z){return{$$typeof:p,_payload:{_status:-1,_result:Z},_init:ge}},Nt.memo=function(Z,$){return{$$typeof:m,type:Z,compare:$===void 0?null:$}},Nt.startTransition=function(Z){var $=se.transition;se.transition={};try{Z()}finally{se.transition=$}},Nt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},Nt.useCallback=function(Z,$){return Te.current.useCallback(Z,$)},Nt.useContext=function(Z){return Te.current.useContext(Z)},Nt.useDebugValue=function(){},Nt.useDeferredValue=function(Z){return Te.current.useDeferredValue(Z)},Nt.useEffect=function(Z,$){return Te.current.useEffect(Z,$)},Nt.useId=function(){return Te.current.useId()},Nt.useImperativeHandle=function(Z,$,X){return Te.current.useImperativeHandle(Z,$,X)},Nt.useInsertionEffect=function(Z,$){return Te.current.useInsertionEffect(Z,$)},Nt.useLayoutEffect=function(Z,$){return Te.current.useLayoutEffect(Z,$)},Nt.useMemo=function(Z,$){return Te.current.useMemo(Z,$)},Nt.useReducer=function(Z,$,X){return Te.current.useReducer(Z,$,X)},Nt.useRef=function(Z){return Te.current.useRef(Z)},Nt.useState=function(Z){return Te.current.useState(Z)},Nt.useSyncExternalStore=function(Z,$,X){return Te.current.useSyncExternalStore(Z,$,X)},Nt.useTransition=function(){return Te.current.useTransition()},Nt.version="18.2.0",Nt}nI.exports=J3();var O=nI.exports;const q=Xn(O);var jb;function K3(){if(jb)return Nh;jb=1;var e=O,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(u,d,m){var p,g={},w=null,D=null;m!==void 0&&(w=""+m),d.key!==void 0&&(w=""+d.key),d.ref!==void 0&&(D=d.ref);for(p in d)r.call(d,p)&&!o.hasOwnProperty(p)&&(g[p]=d[p]);if(u&&u.defaultProps)for(p in d=u.defaultProps,d)g[p]===void 0&&(g[p]=d[p]);return{$$typeof:t,type:u,key:w,ref:D,props:g,_owner:a.current}}return Nh.Fragment=n,Nh.jsx=s,Nh.jsxs=s,Nh}tI.exports=K3();var y=tI.exports;const Sl=e=>{const{children:t,store:n,context:r}=e,[a,o]=O.useState(n.getState());return O.useEffect(()=>{const s=n.subscribe(u=>{o(u)});return()=>{s()}},[]),y.jsx(r.Provider,{value:a,children:t})};function Q3(e){const t=Object.keys(e),n={};for(const r of t)typeof e[r]=="function"&&(n[r]=e[r]);return(r={},a)=>{let o=!1;const s={};for(const u of t){const d=r[u],m=n[u](d,a);s[u]=m,o=o||m!==d}return o?s:r}}function X3(e,t){const n=[];let r=e;return{dispatch:u=>{const d=t(r,u),m=r;r=d;for(const p of n)p(r,m)},getState:()=>r,subscribe:u=>{let d=!0;return n.push(u),()=>{if(!d)return;const m=n.indexOf(u);n.splice(m,1),d=!1}}}}function e4(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: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_LOCKED":return{...e,locked:t.payload.locked};case"SET_APP_SETTING":return{...e,...t.payload};default:return e}}const t4={markMemoId:"",editMemoId:"",commentMemoId:"",shouldSplitMemoWord:!0,shouldHideImageUrl:!0,shouldUseMarkdownParser:!0,useTinyUndoHistoryCache:!1,isMobileView:!1,showSiderbarInMobileView:!1,changedByMemos:!1,memoListView:null,manifest:null,refresh:!1,loaded:!1,globalEditorShown:!1,instanceList:new Map,locked:!1};function n4(e,t){switch(t.type){case"RELOAD":return rI;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 rI={pathname:"/",hash:"",query:{tag:"",duration:null,type:"",text:"",filter:""}};var kt={};Object.defineProperty(kt,"__esModule",{value:!0});var Dn=x;const cw="YYYY-MM-DD",uw="gggg-[W]ww",aI="YYYY-MM",oI="YYYY-[Q]Q",iI="YYYY";function hm(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 mm(){var e,t,n,r;try{const{internalPlugins:a,plugins:o}=window.app;if(hm("daily")){const{format:m,folder:p,template:g}=((t=(e=o.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.daily)||{};return{format:m||cw,folder:(p==null?void 0:p.trim())||"",template:(g==null?void 0:g.trim())||""}}const{folder:s,format:u,template:d}=((r=(n=a.getPluginById("daily-notes"))==null?void 0:n.instance)==null?void 0:r.options)||{};return{format:u||cw,folder:(s==null?void 0:s.trim())||"",template:(d==null?void 0:d.trim())||""}}catch{}}function pm(){var e,t,n,r,a,o,s;try{const u=window.app.plugins,d=(e=u.getPlugin("calendar"))==null?void 0:e.options,m=(n=(t=u.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.weekly;if(hm("weekly"))return{format:m.format||uw,folder:((r=m.folder)==null?void 0:r.trim())||"",template:((a=m.template)==null?void 0:a.trim())||""};const p=d||{};return{format:p.weeklyNoteFormat||uw,folder:((o=p.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((s=p.weeklyNoteTemplate)==null?void 0:s.trim())||""}}catch{}}function gm(){var t,n,r,a;const e=window.app.plugins;try{const o=hm("monthly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.monthly)||{};return{format:o.format||aI,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function vm(){var t,n,r,a;const e=window.app.plugins;try{const o=hm("quarterly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.quarterly)||{};return{format:o.format||oI,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function ym(){var t,n,r,a;const e=window.app.plugins;try{const o=hm("yearly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.yearly)||{};return{format:o.format||iI,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function sI(...e){let t=[];for(let r=0,a=e.length;r<a;r++)t=t.concat(e[r].split("/"));const n=[];for(let r=0,a=t.length;r<a;r++){const o=t[r];!o||o==="."||n.push(o)}return t[0]===""&&n.unshift(""),n.join("/")}function r4(e){let t=e.substring(e.lastIndexOf("/")+1);return t.lastIndexOf(".")!=-1&&(t=t.substring(0,t.lastIndexOf("."))),t}async function a4(e){const t=e.replace(/\\/g,"/").split("/");if(t.pop(),t.length){const n=sI(...t);window.app.vault.getAbstractFileByPath(n)||await window.app.vault.createFolder(n)}}async function wm(e,t){t.endsWith(".md")||(t+=".md");const n=Dn.normalizePath(sI(e,t));return await a4(n),n}async function _d(e){const{metadataCache:t,vault:n}=window.app,r=Dn.normalizePath(e);if(r==="/")return Promise.resolve(["",null]);try{const a=t.getFirstLinkpathDest(r,""),o=await n.cachedRead(a),s=window.app.foldManager.load(a);return[o,s]}catch(a){return console.error(`Failed to read the daily note template '${r}'`,a),new Dn.Notice("Failed to read the daily note template"),["",null]}}function Bo(e,t="day"){const n=e.clone().startOf(t).format();return`${t}-${n}`}function lI(e){return e.replace(/\[[^\]]*\]/g,"")}function o4(e,t){if(t==="week"){const n=lI(e);return/w{1,2}/i.test(n)&&(/M{1,4}/.test(n)||/D{1,4}/.test(n))}return!1}function Hd(e,t){return cI(e.basename,t)}function i4(e,t){return cI(r4(e),t)}function cI(e,t){const r={day:mm,week:pm,month:gm,quarter:vm,year:ym}[t]().format.split("/").pop(),a=window.moment(e,r,!0);if(!a.isValid())return null;if(o4(r,t)&&t==="week"){const o=lI(r);if(/w{1,2}/i.test(o))return window.moment(e,r.replace(/M{1,4}/g,"").replace(/D{1,4}/g,""),!1)}return a}class s4 extends Error{}async function uI(e){const t=window.app,{vault:n}=t,r=window.moment,{template:a,format:o,folder:s}=mm(),[u,d]=await _d(a),m=e.format(o),p=await wm(s,m);try{const g=await n.create(p,u.replace(/{{\s*date\s*}}/gi,m).replace(/{{\s*time\s*}}/gi,r().format("HH:mm")).replace(/{{\s*title\s*}}/gi,m).replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(w,D,S,T,E,A)=>{const N=r(),R=e.clone().set({hour:N.get("hour"),minute:N.get("minute"),second:N.get("second")});return S&&R.add(parseInt(T,10),E),A?R.format(A.substring(1).trim()):R.format(o)}).replace(/{{\s*yesterday\s*}}/gi,e.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,e.clone().add(1,"d").format(o)));return t.foldManager.save(g,d),g}catch(g){console.error(`Failed to create file: '${p}'`,g),new Dn.Notice("Unable to create new file.")}}function l4(e,t){return t[Bo(e,"day")]??null}function c4(){const{vault:e}=window.app,{folder:t}=mm(),n=e.getAbstractFileByPath(Dn.normalizePath(t));if(!n)throw new s4("Failed to find daily notes folder");const r={};return Dn.Vault.recurseChildren(n,a=>{if(a instanceof Dn.TFile){const o=Hd(a,"day");if(o){const s=Bo(o,"day");r[s]=a}}}),r}class u4 extends Error{}function d4(){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 f4(e){return d4().indexOf(e.toLowerCase())}async function dI(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=pm(),[o,s]=await _d(n),u=e.format(r),d=await wm(a,u);try{const m=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,g,w,D,S,T)=>{const E=window.moment(),A=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return w&&A.add(parseInt(D,10),S),T?A.format(T.substring(1).trim()):A.format(r)}).replace(/{{\s*title\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(p,g,w)=>{const D=f4(g);return e.weekday(D).format(w.trim())}));return window.app.foldManager.save(m,s),m}catch(m){console.error(`Failed to create file: '${d}'`,m),new Dn.Notice("Unable to create new file.")}}function h4(e,t){return t[Bo(e,"week")]??null}function m4(){const e={};if(!hI())return e;const{vault:t}=window.app,{folder:n}=pm(),r=t.getAbstractFileByPath(Dn.normalizePath(n));if(!r)throw new u4("Failed to find weekly notes folder");return Dn.Vault.recurseChildren(r,a=>{if(a instanceof Dn.TFile){const o=Hd(a,"week");if(o){const s=Bo(o,"week");e[s]=a}}}),e}class p4 extends Error{}async function fI(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=gm(),[o,s]=await _d(n),u=e.format(r),d=await wm(a,u);try{const m=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,g,w,D,S,T)=>{const E=window.moment(),A=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return w&&A.add(parseInt(D,10),S),T?A.format(T.substring(1).trim()):A.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(m,s),m}catch(m){console.error(`Failed to create file: '${d}'`,m),new Dn.Notice("Unable to create new file.")}}function g4(e,t){return t[Bo(e,"month")]??null}function v4(){const e={};if(!mI())return e;const{vault:t}=window.app,{folder:n}=gm(),r=t.getAbstractFileByPath(Dn.normalizePath(n));if(!r)throw new p4("Failed to find monthly notes folder");return Dn.Vault.recurseChildren(r,a=>{if(a instanceof Dn.TFile){const o=Hd(a,"month");if(o){const s=Bo(o,"month");e[s]=a}}}),e}class y4 extends Error{}async function w4(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=vm(),[o,s]=await _d(n),u=e.format(r),d=await wm(a,u);try{const m=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,g,w,D,S,T)=>{const E=window.moment(),A=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return w&&A.add(parseInt(D,10),S),T?A.format(T.substring(1).trim()):A.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(m,s),m}catch(m){console.error(`Failed to create file: '${d}'`,m),new Dn.Notice("Unable to create new file.")}}function b4(e,t){return t[Bo(e,"quarter")]??null}function D4(){const e={};if(!pI())return e;const{vault:t}=window.app,{folder:n}=vm(),r=t.getAbstractFileByPath(Dn.normalizePath(n));if(!r)throw new y4("Failed to find quarterly notes folder");return Dn.Vault.recurseChildren(r,a=>{if(a instanceof Dn.TFile){const o=Hd(a,"quarter");if(o){const s=Bo(o,"quarter");e[s]=a}}}),e}class S4 extends Error{}async function I4(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=ym(),[o,s]=await _d(n),u=e.format(r),d=await wm(a,u);try{const m=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,g,w,D,S,T)=>{const E=window.moment(),A=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return w&&A.add(parseInt(D,10),S),T?A.format(T.substring(1).trim()):A.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(m,s),m}catch(m){console.error(`Failed to create file: '${d}'`,m),new Dn.Notice("Unable to create new file.")}}function T4(e,t){return t[Bo(e,"year")]??null}function E4(){const e={};if(!gI())return e;const{vault:t}=window.app,{folder:n}=ym(),r=t.getAbstractFileByPath(Dn.normalizePath(n));if(!r)throw new S4("Failed to find yearly notes folder");return Dn.Vault.recurseChildren(r,a=>{if(a instanceof Dn.TFile){const o=Hd(a,"year");if(o){const s=Bo(o,"year");e[s]=a}}}),e}function x4(){var r,a;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&&((a=(r=n.settings)==null?void 0:r.daily)==null?void 0:a.enabled)}function hI(){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 mI(){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 pI(){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 gI(){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 C4(e){const t={day:mm,week:pm,month:gm,quarter:vm,year:ym}[e];return t()}function M4(e,t){return{day:uI,month:fI,week:dI}[e](t)}kt.DEFAULT_DAILY_NOTE_FORMAT=cw;kt.DEFAULT_MONTHLY_NOTE_FORMAT=aI;kt.DEFAULT_QUARTERLY_NOTE_FORMAT=oI;kt.DEFAULT_WEEKLY_NOTE_FORMAT=uw;kt.DEFAULT_YEARLY_NOTE_FORMAT=iI;var vI=kt.appHasDailyNotesPluginLoaded=x4;kt.appHasMonthlyNotesPluginLoaded=mI;kt.appHasQuarterlyNotesPluginLoaded=pI;kt.appHasWeeklyNotesPluginLoaded=hI;kt.appHasYearlyNotesPluginLoaded=gI;var yI=kt.createDailyNote=uI;kt.createMonthlyNote=fI;kt.createPeriodicNote=M4;kt.createQuarterlyNote=w4;kt.createWeeklyNote=dI;kt.createYearlyNote=I4;var ws=kt.getAllDailyNotes=c4;kt.getAllMonthlyNotes=v4;kt.getAllQuarterlyNotes=D4;kt.getAllWeeklyNotes=m4;kt.getAllYearlyNotes=E4;var kv=kt.getDailyNote=l4,tv=kt.getDailyNoteSettings=mm,Zh=kt.getDateFromFile=Hd;kt.getDateFromPath=i4;kt.getDateUID=Bo;kt.getMonthlyNote=g4;kt.getMonthlyNoteSettings=gm;kt.getPeriodicNoteSettings=C4;kt.getQuarterlyNote=b4;kt.getQuarterlyNoteSettings=vm;kt.getTemplateInfo=_d;kt.getWeeklyNote=h4;kt.getWeeklyNoteSettings=pm;kt.getYearlyNote=T4;kt.getYearlyNoteSettings=ym;const N4={},k4={},A4={},O4={},wI={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",'You can set target heading like "# Heading" to control data location':'You can set target heading like "# Heading" to control data location',"Insert after heading":"Insert after heading","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"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","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.","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","DELETE SUCCEED":"DELETE 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",ALL:"ALL",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 dialog":"Show daily thino dialog","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":"Copy filtered thinos","Bulk delete":"Bulk delete","Bulk archive":"Bulk archive","Bulk tag operation":"Bulk tag operation","Bulk restore":"Bulk restore","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",Chat:"Chat",Moments:"Moments",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","Day mark range":"Day mark range","Set the range of day mark. Day by default.":"Set the range of day mark. Day by default.","Thino is locked":"Thino is locked","Please unlock Thino by input password":"Please unlock Thino by input password","Auto Download Image":"Auto Download Image","Auto download image when save to thino. 'false' by default":"Auto download image when save to thino. 'false' by default","Thino Http IP Type":"Thino Http IP Type","Set Thino http server ip to listen. 'localhost' by default":"Set Thino http server ip to listen. 'localhost' by default","Password to lock Thino":"Password to lock Thino",Unlock:"Unlock",Locked:"Locked","Password is incorrect":"Password is incorrect",Lock:"Lock","Need password to unlock Thino":"Need password to unlock Thino","You have not set a password or enable this feature yet":"You have not set a password or enable this feature yet",Password:"Password","Password for Thino":"Password for Thino","Please input your password to change password settings":"Please input your password to change password settings","Please input your password":"Please input your password","Lock thino":"Lock thino",date:"date",time:"time",event:"event","Add tag position":"Add tag position","Set the position of the tag when adding tag automatically":"Set the position of the tag when adding tag automatically","Add tag automatically":"Add tag automatically","Add tag to the end or beginning of the thino content when creating a thino and filtering tags":"Add tag to the end or beginning of the thino content when creating a thino and filtering tags","Add tag with new line":"Add tag with new line","Add tag with new line when adding tag automatically":"Add tag with new line when adding tag automatically","Input to select more tags":"Input to select more tags","Tag Bulk Edit":"Tag Bulk Edit","Exist Tags":"Exist Tags","Selected Tags":"Selected Tags","Click to remove exist tag":"Click to remove exist tag","Click to remove selected tag":"Click to remove selected tag","Select tags":"Select tags","Input to select exist tag":"Input to select exist tag",Beginning:"Beginning",End:"End","Set the heading for saving thino":"Set the heading for saving thino","# Heading":"# Heading","Chat view style":"Chat view style","Set the style of chat view":"Set the style of chat view","Background image for moments view":"Background image for moments view","Set the background image for moments view":"Set the background image for moments view","Icon for moments/chat view":"Icon for moments/chat view","Set the icon for moments/chat view":"Set the icon for moments/chat view","Quote for moments view":"Quote for moments view","Set the quote for moments view":"Set the quote for moments view","Theme for Thino":"Theme for Thino","Set the theme for Thino":"Set the theme for Thino","Theme Details":"Theme Details","Task amount":"Task amount","Thino status":"Thino status","Used tags":"Used tags","Used days":"Used days","Most active day":"Most active day","Most active hour":"Most active hour","Thino amount":"Thino amount","Latest version":"Latest version","Previous version":"Previous version","Thino update info":"Thino update info","Debug info copied to clipboard":"Debug info copied to clipboard","Copy debug info":"Copy debug info","Failed to load changelog":"Failed to load changelog","View online":"View online",ChangeLog:"ChangeLog"},F4={},P4={},j4={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","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"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","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"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"},L4={},R4={},_4={},H4={},B4={},Y4={},z4={},U4={},V4={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","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"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","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"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"},Z4={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","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"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","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"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"},W4={},$4={},G4={},q4={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 😏'",'You can set target heading like "# Heading" to control data location':'You can set target heading like "# Heading" to control data location',"Insert after heading":"在指定标题后插入 Thino","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"若留空,则记录的 thino 内容在日记末尾插入,若填写标题,则记录的 thino 内容统一都记录在该标题下","Process Memos below":"解析指定标题后的 Thino","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"若留空则在Thino界面会显示所有thino记录内容若填写标题则Thino界面只显示该标题下的内容写入其他位置的内容不显示","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","DELETE SUCCEED":"删除成功","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:"单文件",ALL:"所有","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 dialog":"显示每日 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":"复制筛选的 thino","Bulk delete":"批量删除","Bulk archive":"批量归档","Bulk tag operation":"标签编辑","Bulk restore":"批量恢复","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:"表格",Chat:"聊天",Moments:"动态",Waterfall:"瀑布流",Calendar:"日历","Go to page":"跳转到页",Page:"页",Show:"展示",rows:"行","Temp Filter":"临时筛选器","Set the heading for saving thino":"设置保存 Thino 的标题","# Heading":"# 标题","Allow navigation from view to Thino or Thino to view":"允许从视图到 Thino 或者从 Thino 到视图的导航","Day mark range":"日期标记范围","Set the range of day mark. Day by default.":"设置日期标记的范围,默认为天","Thino is locked":"Thino 已锁定","Please unlock Thino by input password":"请输入密码来解锁 Thino","Auto Download Image":"自动下载图片","Auto download image when save to thino. 'false' by default":"当保存到 Thino 时自动下载图片。默认为 'false'","Thino Http IP Type":"Thino HTTP 服务器 IP 类型","Set Thino http server ip to listen. 'localhost' by default":"设置 Thino HTTP 服务器 IP。默认为 'localhost'","Password to lock Thino":"锁定 Thino 的密码",Unlock:"解锁",Locked:"已锁定","Password is incorrect":"密码错误",Lock:"锁定","Need password to unlock Thino":"需要密码来解锁 Thino","You have not set a password or enable this feature yet":"你还没有设置密码或者启用该功能",Password:"密码","Password for Thino":"Thino 的密码","Please input your password to change password settings":"请输入原来的密码来修改密码设置","Please input your password":"请输入密码","Lock thino":"锁定 Thino",date:"日期",time:"时间",event:"事件","Add tag position":"添加标签位置","Set the position of the tag when adding tag automatically":"设置自动添加标签的位置","Add tag automatically":"自动添加标签","Add tag to the end or beginning of the thino content when creating a thino and filtering tags":"在创建 Thino 和筛选标签时,将标签添加到 Thino 内容的末尾或开头","Add tag with new line":"添加标签时换行","Add tag with new line when adding tag automatically":"自动添加标签时换行","Input to select more tags":"输入来选择更多标签","Tag Bulk Edit":"标签批量编辑","Exist Tags":"已有标签","Selected Tags":"已选标签","Click to remove exist tag":"点击移除已有标签","Click to remove selected tag":"点击移除已选标签","Select tags":"选择标签","Input to select exist tag":"输入来选择已有标签",Beginning:"开头",End:"末尾","Chat view style":"聊天视图样式","Set the style of chat view":"设置聊天视图的样式","Background image for moments view":"动态视图的背景图","Set the background image for moments view":"设置动态视图的背景图","Icon for moments/chat view":"动态/聊天视图的头像","Set the icon for moments/chat view":"设置动态/聊天视图的头像","Quote for moments view":"动态视图的个性签名","Set the quote for moments view":"设置动态视图的个性签名","Theme for Thino":"Thino 主题","Set the theme for Thino":"设置 Thino 的主题","Theme Details":"主题详情","Task amount":"任务数量","Thino status":"Thino 状态","Used tags":"使用的标签","Used days":"使用的天数","Most active day":"最活跃的一天","Most active hour":"最活跃的一小时","Thino amount":"Thino 数量","Latest version":"最新版本","Previous version":"之前版本","Thino update info":"Thino 更新信息","Debug info copied to clipboard":"调试信息已复制到剪贴板","Copy debug info":"复制调试信息","Failed to load changelog":"无法加载更新日志","View online":"在线查看",ChangeLog:"更新日志"},J4={},K4={ar:N4,cs:k4,da:A4,de:O4,en:wI,"en-gb":F4,es:P4,fr:j4,hi:L4,id:R4,it:_4,ja:H4,ko:B4,nl:Y4,nn:z4,pl:U4,pt:V4,"pt-br":Z4,ro:W4,ru:$4,tr:G4,"zh-cn":q4,"zh-tw":J4},Lb=K4[x.moment.locale()];function k(e){const t=Lb&&Lb[e]||wI[e];return t===null?t:t||e}const Q4=/```([\s\S]*?)```/g,X4=/\*\*(.+?)\*\*/g,eN=/\*(.+?)\*/g,tN=/\[ \] /g,nN=/\[.{1}\] /g,rN=/^[*-]/g,aN=/(\d+)\. /g,Rb=/\[\[([^\]]+)\]\]/g,dw=/\[([^\]]+)\]\((([^\]]+).md)\)/g,oN=(e,t)=>{const n=e.replace(Q4,"<pre lang=''>$1</pre>").replace(rN,"<span class='counter-block'>•</span>").replace(aN,"<span class='counter-block'>$1.</span>").replace(tN,"<span class='todo-block' data-type='todo'>⬜</span>").replace(nN,"<span class='todo-block' data-type='done'>✅</span>").replace(X4,"<strong>$1</strong>").replace(eN,"<em>$1</em>").replace(/&lt;br&gt;/g,"</p><p>").replace(/&amp;/g,"&");let r=n;if(t){if(Rb.test(n)){const a=n.match(Rb);for(let o=0;o<a.length;o++)if(!/(jpeg|jpg|gif|png|svg|bmp|wepg)/g.test(a[o])){const s=iN(a[o]);if(/\|/g.test(s)){const[u,d]=s.split("|"),m=w0(u,d);r=n.replace(a[o],m)}else{const m=w0(s,"");r=r.replace(a[o],m)}}}if(dw.test(n)){const a=n.match(dw);for(let o=0;o<a.length;o++)if(!/(jpeg|jpg|gif|png|svg|bmp|wepg)/g.test(a[o])){const s=lN(a[o]),u=sN(a[o]),d=w0(s,u);r=n.replace(a[o],d)}}}return r},w0=(e,t)=>{const{metadataCache:n}=Ee.getState().dailyNotesState.app;return n.getFirstLinkpathDest(decodeURIComponent(e),"")instanceof x.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>`},iN=e=>{var t;return(t=/\[\[([^\]]+)\]\]/g.exec(e))==null?void 0:t[1]},sN=e=>{var t;return(t=dw.exec(e))==null?void 0:t[1]},lN=e=>{var t;return(t=/\[([^\]]+)\]\((([^\]]+).md)\)/g.exec(e))==null?void 0:t[3]},_b=e=>{const t=document.createElement("div");return t.className="memo-content-text",t.innerHTML=e,t.innerText},cN=e=>e.replace(/\n/g,"<br>"),uN=e=>{const t=document.createElement("div");return t.textContent=e,t.innerHTML},Hb="mobile-show-sidebar",bI=200,Ba=3600*24*1e3,An=/\s#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,hr=/(<p>|<br>)#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,$n=/^#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/gu,Rc=/(\s||\(|>|^)((http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-]))/g,dN=/\[([\s\S]*?)\]\(([\s\S]*?)\)/gu,_c=/([^\s<\\*>'(]+\.(jpeg|jpg|gif|png|svg))(\]\])?(\))?/g,Il=/\[@(.+?)\]\((.+?)\)/g,fN=/^(-|\*|\d\.)\s(\[.\]\s)?(\d{1,2}:\d{2}(:\d{2})?)\s(.*)$/g,Md=[{title:"DAILY",icon:"list"},{title:"CANVAS",icon:"layout-dashboard"},{title:"MULTI",icon:"file-text"},{title:"FILE",icon:"edit"}];var fw;(e=>{function t(){return parseInt(x.moment().format("x"))}e.getNowTimeStamp=t;function n(){const P=navigator.userAgent;let L="Unknown";return P.indexOf("Win")!=-1?L="Windows":P.indexOf("Mac")!=-1?L="MacOS":P.indexOf("Linux")!=-1&&(L="Linux"),L}e.getOSVersion=n;function r(P){return typeof P=="string"&&(P=P.replaceAll("-","/")),new Date(P).getTime()}e.getTimeStampByDate=r;function a(P){const L=new Date(r(P));return new Date(L.getFullYear(),L.getMonth(),L.getDate()).getTime()}e.getDateStampByDate=a;function o(P){const L=new Date(r(P)),z=L.getFullYear(),U=L.getMonth()+1,W=L.getDate();return`${z}/${U}/${W}`}e.getDateString=o;function s(P){const L=new Date(r(P)),z=L.getHours(),U=L.getMinutes(),W=z<10?"0"+z:z,K=U<10?"0"+U:U;return`${W}:${K}`}e.getTimeString=s;function u(P){const L=new Date(r(P)),z=L.getFullYear(),U=L.getMonth()+1,W=L.getDate(),K=L.getHours(),ae=L.getMinutes(),ce=L.getSeconds(),fe=U<10?"0"+U:U,ie=W<10?"0"+W:W,ge=K<10?"0"+K:K,Te=ae<10?"0"+ae:ae,se=ce<10?"0"+ce:ce;return`${z}/${fe}/${ie} ${ge}:${Te}:${se}`}e.getDateTimeString=u;function d(P){return Array.from(new Set(P))}e.dedupe=d;function m(P){const L=new Set,z=[];for(const U of P)L.has(U.id)||(L.add(U.id),z.push(U));return z}e.dedupeObjectWithId=m;function p(P,L){let z=null;return()=>{z&&clearTimeout(z),z=setTimeout(P,L)}}e.debounce=p;function g(P,L,z=!1,U){let W=null,K=!1;function ae(...ce){if(W&&clearTimeout(W),z&&!K){const fe=P.apply(this,ce);U&&typeof U=="function"&&U(fe),K=!0}else W=setTimeout(()=>{const fe=P.apply(this,ce);U&&typeof U=="function"&&U(fe),K=!1,W=null},L)}return ae.cancel=function(){W&&clearTimeout(W),W=null,K=!1},ae}e.debouncePlus=g;function w(P,L){let z=!0;return()=>{if(!z)return!1;z=!1,setTimeout(()=>{P(),z=!0},L)}}e.throttle=w;function D(P){const L=[],z=Object.keys(P).sort();for(const U of z){const W=P[U];W&&(typeof W=="object"?L.push(...D(W).split("&")):L.push(`${U}=${W}`))}return L.join("&")}e.transformObjectToParamsString=D;function S(P){const L={},z=P.split("&");for(const U of z){const[W,K]=U.split("=");W&&K&&(L[W]=K)}return L}e.transformParamsStringToObject=S;function T(P){if(!P)return{};const L={},z=Object.keys(P).sort();for(const U of z){const W=P[U];if(typeof W=="object"){const K=T(JSON.parse(JSON.stringify(W)));K&&Object.keys(K).length>0&&(L[U]=K)}else W&&(L[U]=W)}return L}e.filterObjectNullKeys=T;async function E(P){if(navigator.clipboard&&navigator.clipboard.writeText)try{await navigator.clipboard.writeText(P)}catch(L){console.warn("Copy to clipboard failed.",L)}else console.warn("Copy to clipboard failed, methods not supports.")}e.copyTextToClipboard=E;function A(P){return new Promise(L=>{const z=new Image;z.onload=()=>{const{width:U,height:W}=z;U>0&&W>0?L({width:U,height:W}):L({width:0,height:0})},z.onerror=()=>{L({width:0,height:0})},z.className="hidden",z.src=P,document.body.appendChild(z),z.remove()})}e.getImageSize=A;async function N(P){var W,K,ae,ce;let L;const U=app.plugins.getPlugin("obsidian-memos").settings.UseDailyOrPeriodic==="Daily";try{return!U&&((ce=(ae=(K=(W=window.app.plugins)==null?void 0:W.getPlugin("periodic-notes"))==null?void 0:K.calendarSetManager)==null?void 0:ae.getActiveConfig("day"))!=null&&ce.enabled)?(L=await window.app.plugins.getPlugin("periodic-notes").createPeriodicNote("day",P),L):(L=await yI(P),L)}catch(fe){return console.error(fe),new x.Notice(k("Failed to create daily note. Please check if you created a folder for daily notes.")),null}}e.createDailyNoteCheck=N;function R(P){const L=[];let z=0;for(;z<P;z++)L.push((16*Math.random()|0).toString(16));return L.join("")}e.randomId=R;function F(P){return P.replace(/[\p{P}\p{Z}\p{S}]/gu,"").length}e.countWords=F;async function H(P){try{const L=await x.requestUrl(P),z=new Uint8Array(L.arrayBuffer);return new Blob([z],{type:"image/png"})}catch(L){return console.error("error in grabImageFromUrl",P,L),new Blob}}e.grabImageFromUrl=H})(fw||(fw={}));const Re=fw;function hN(){var o,s,u,d,m,p;let e="";const t=app.plugins.getPlugin("obsidian-memos").settings;let n="";const r=(u=(s=(o=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:o.calendarSetManager)==null?void 0:s.getActiveConfig("day"))==null?void 0:u.folder,a=(p=(m=(d=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:d.settings)==null?void 0:m.daily)==null?void 0:p.format;switch(r===void 0?n=a:n=r,(t==null?void 0:t.UseDailyOrPeriodic)||"Daily"){case"Daily":e=tv().format||"YYYY-MM-DD";break;case"Periodic":e=n||"YYYY-MM-DD";break;default:e=tv().format||"YYYY-MM-DD";break}return e===void 0&&new x.Notice(k("You didn't set format for daily notes in both periodic-notes and daily-notes plugins.")),e}function DI(){var o,s,u,d,m,p;let e="";const t=app.plugins.getPlugin("obsidian-memos").settings;let n="";const r=(u=(s=(o=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:o.calendarSetManager)==null?void 0:s.getActiveConfig("day"))==null?void 0:u.folder,a=(p=(m=(d=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:d.settings)==null?void 0:m.daily)==null?void 0:p.folder;switch(r===void 0?n=a:n=r,(t==null?void 0:t.UseDailyOrPeriodic)||"Daily"){case"Daily":e=tv().folder||"";break;case"Periodic":e=n||"";break;default:e=tv().folder||"";break}return e===void 0&&new x.Notice(k("You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.")),e}function hw(e,t){var r;e=uN(e),e=cN(e).split("<br>").map(a=>`<p>${a!==""?a:"<br>"}</p>`).join(""),e=oN(e,t),e=e.replace(An,"<span class='tag-span'>#$1</span>").replace(hr,"<p><span class='tag-span'>#$2</span>").replace(Rc,"$1<a class='link' target='_blank' rel='noreferrer' href='$2'>$2</a>").replace(dN,"<a class='link' target='_blank' rel='noreferrer' href='$2'>$1</a>").replace(Il,"<span class='memo-link-text' data-value='$2'>$1</span>").replace(/\^\S{6}/g,"");const n=document.createElement("div");n.innerHTML=e;for(let a=0;a<n.children.length;a++){const o=n.children[a];if(o.tagName==="P"&&o.textContent===""&&((r=o.firstElementChild)==null?void 0:r.tagName)!=="BR"){o.remove(),a--;continue}}return n.innerHTML}const Av=(e,t)=>{const n=window.atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let o=0;o<n.length;o++)a[o]=n.charCodeAt(o);return new Blob([r],{type:t})};function mN(e,t){switch(t.type){case"SET_MEMOS":{const n=t.payload.memos.sort((a,o)=>{const s=Re.getTimeStampByDate(a.createdAt),u=Re.getTimeStampByDate(o.createdAt);return s===u?o.id.localeCompare(a.id):Re.getTimeStampByDate(o.createdAt)-Re.getTimeStampByDate(a.createdAt)}),r=Re.dedupeObjectWithId(n);return{...e,memos:[...r]}}case"SET_COMMENT_MEMOS":{const n=Re.dedupeObjectWithId(t.payload.commentMemos.sort((r,a)=>Re.getTimeStampByDate(a.createdAt)-Re.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=Re.dedupeObjectWithId([t.payload.memo,...e.memos].sort((r,a)=>Re.getTimeStampByDate(a.createdAt)-Re.getTimeStampByDate(r.createdAt)));return{...e,memos:n}}case"INSERT_COMMENT_MEMO":{const n=Re.dedupeObjectWithId([t.payload.memo,...e.commentMemos].sort((r,a)=>Re.getTimeStampByDate(a.createdAt)-Re.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(a=>a.id===r),1)}),{...e,memos:[...n]}}case"CLEAR_MEMOS":return{...SI};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(a=>a.path!==t.payload.path),r=Re.dedupeObjectWithId([...t.payload.memos,...n].sort((a,o)=>Re.getTimeStampByDate(o.createdAt)-Re.getTimeStampByDate(a.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"ARCHIVE_MEMO_BY_ID_BULK":{const n=e.memos.map(r=>t.payload.some(a=>a.id===r.id)?{...r,...t.payload.filter(a=>a.id===r.id)[0]}: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 SI={memos:[],commentMemos:[],tags:[],tagsNum:{}};function pN(e,t){switch(t.type){case"SIGN_IN":return{user:t.payload.user};case"SIGN_OUT":return{user:null};default:return e}}const gN={user:null};function vN(e,t){switch(t.type){case"SET_QUERIES":{const n=Re.dedupeObjectWithId(t.payload.queries.sort((r,a)=>Re.getTimeStampByDate(a.createdAt)-Re.getTimeStampByDate(r.createdAt)).sort((r,a)=>Re.getTimeStampByDate(a.pinnedAt??0)-Re.getTimeStampByDate(r.pinnedAt??0)));return{...e,queries:n}}case"INSERT_QUERY":{const n=Re.dedupeObjectWithId([t.payload.query,...e.queries].sort((r,a)=>Re.getTimeStampByDate(a.createdAt)-Re.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 yN={queries:[]};function wN(e,t){var n,r,a,o;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)===((o=(a=t.payload.view)==null?void 0:a.leaf)==null?void 0:o.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 bN={dailyNotes:null,app:null,view:null,settings:null,editor:null,plugin:null,verifyState:null},Ee=X3({globalState:t4,locationState:rI,memoState:SI,userState:gN,queryState:yN,dailyNotesState:bN},Q3({globalState:e4,locationState:n4,memoState:mN,userState:pN,queryState:vN,dailyNotesState:wN})),wt=O.createContext(Ee.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 DN{constructor(){he(this,"initialized",!1)}getState(){return Ee.getState().dailyNotesState}setApp(t){return Ee.dispatch({type:"SET_APP",payload:{app:t}}),t}setPlugin(t){return Ee.dispatch({type:"SET_PLUGIN",payload:{plugin:t}}),t}setSettings(t){return Ee.dispatch({type:"SET_SETTINGS",payload:{settings:t}}),this.initialized||(this.initialized=!0),t}setView(t){return Ee.dispatch({type:"SET_VIEW",payload:{view:t}}),t}setEditor(t){return Ee.dispatch({type:"SET_EDITOR",payload:{editor:t}}),t}async updateDailyNotes(t,n){const r=this.getState().dailyNotes,a=Zh(t,"day");return n?delete r[`day-${a.format("YYYY-MM-DD")}T00:00:00+08:00}`]:r[`day-${a.format("YYYY-MM-DD")}T00:00:00+08:00}`]=t,Ee.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:r}}),r}setVerifyState(t){return Ee.dispatch({type:"SET_VERIFY_STATE",payload:{verifyState:t}}),t}async fechLocalDailyNotes(){try{const t=ws();return Ee.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:t}}),t}catch(t){console.error(t)}}}const rt=new DN;var Kn;(e=>{function t(o){const s={};for(const u of o)try{const d=localStorage.getItem(u);if(d!==null){const m=JSON.parse(d);s[u]=m}}catch(d){console.error("Get storage failed in ",u,d)}return s}e.get=t;function n(o){for(const s in o)try{const u=JSON.stringify(o[s]);localStorage.setItem(s,u)}catch(u){console.error("Save storage failed in ",s,u)}}e.set=n;function r(o){for(const s of o)try{localStorage.removeItem(s)}catch(u){console.error("Remove storage failed in ",s,u)}}e.remove=r;function a(){var s;const o=document.createElement("iframe");o.style.display="none",document.body.appendChild(o),(s=o.contentWindow)==null||s.localStorage.setItem("t",Date.now().toString()),o.remove()}e.emitStorageChangedEvent=a})(Kn||(Kn={}));class SN{constructor(){he(this,"getState",()=>Ee.getState().globalState);he(this,"setEditMemoId",t=>{Ee.dispatch({type:"SET_EDIT_MEMO_ID",payload:{editMemoId:t}})});he(this,"setRefresh",t=>{Ee.dispatch({type:"SET_REFRESH",payload:{refresh:t}})});he(this,"setCommentMemoId",t=>{Ee.dispatch({type:"SET_COMMENT_MEMO_ID",payload:{commentMemoId:t}})});he(this,"setMarkMemoId",t=>{Ee.dispatch({type:"SET_MARK_MEMO_ID",payload:{markMemoId:t}})});he(this,"setLoaded",t=>{Ee.dispatch({type:"SET_LOADED",payload:{loaded:t}})});he(this,"setGlobalEditorShown",t=>{Ee.dispatch({type:"SET_GLOBAL_EDITOR_SHOWN",payload:{globalEditorShown:t}})});he(this,"setIsMobileView",t=>{Ee.dispatch({type:"SET_MOBILE_VIEW",payload:{isMobileView:t}})});he(this,"setChangedByMemos",t=>{Ee.dispatch({type:"SET_CHANGED_BY_MEMOS",payload:{changedByMemos:t}})});he(this,"setShowSiderbarInMobileView",t=>{Ee.dispatch({type:"SET_SHOW_SIDEBAR_IN_MOBILE_VIEW",payload:{showSiderbarInMobileView:t}})});he(this,"setAppSetting",t=>{Ee.dispatch({type:"SET_APP_SETTING",payload:t}),Kn.set(t)});he(this,"setMemoListView",t=>{Ee.dispatch({type:"SET_MEMO_LIST_VIEW",payload:{memoListView:t}})});he(this,"setInstance",(t,n)=>{Ee.dispatch({type:"SET_INSTANCE",payload:{id:t,instance:n}})});he(this,"setLocked",t=>{Ee.dispatch({type:"SET_LOCKED",payload:{locked:t}})});he(this,"setPluginManifest",t=>{Ee.dispatch({type:"SET_MEMO_PLUGIN_MANIFEST",payload:{manifest:t}})});const t=Kn.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 Qe=new SN;class IN{constructor(){he(this,"updateStateWithLocation",()=>{const{pathname:t,search:n,hash:r}=window.location,a=new URLSearchParams(n),o={pathname:"/",hash:"",query:{tag:"",duration:null,text:"",type:"",filter:""}};o.query.tag=a.get("tag")||"",o.query.type=a.get("type")??"",o.query.text=a.get("text")??"",o.query.filter=a.get("filter")??"";const s=parseInt(a.get("from")??"0"),u=parseInt(a.get("to")??"0");u>s&&u!==0&&(o.query.duration={from:s,to:u}),o.hash=r,o.pathname=this.getValidPathname(t),Ee.dispatch({type:"SET_LOCATION",payload:o})});he(this,"getState",()=>Ee.getState().locationState);he(this,"clearQuery",()=>{Ee.dispatch({type:"SET_QUERY",payload:{tag:"",duration:null,text:"",type:"",filter:""}})});he(this,"setQuery",t=>{Ee.dispatch({type:"SET_QUERY",payload:t})});he(this,"reloadApp",()=>{Ee.dispatch({type:"RELOAD"})});he(this,"setHash",t=>{Ee.dispatch({type:"SET_HASH",payload:{hash:t}})});he(this,"setPathname",t=>{Ee.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});he(this,"pushHistory",t=>{Ee.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});he(this,"replaceHistory",t=>{Ee.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});he(this,"setMemoTypeQuery",(t="")=>{Ee.dispatch({type:"SET_TYPE",payload:{type:t}})});he(this,"setMemoFilter",t=>{Ee.dispatch({type:"SET_QUERY_FILTER",payload:t})});he(this,"setTextQuery",t=>{Ee.dispatch({type:"SET_TEXT",payload:{text:t}})});he(this,"setTimeQuery",t=>{Ee.dispatch({type:"SET_DURATION_QUERY",payload:{duration:t}})});he(this,"setTagQuery",t=>{Ee.dispatch({type:"SET_TAG_QUERY",payload:{tag:t}})});he(this,"setFromAndToQuery",(t,n)=>{Ee.dispatch({type:"SET_DURATION_QUERY",payload:{duration:{from:t,to:n}}})});he(this,"getValidPathname",t=>["/","/homeboard","/recycle","/setting"].includes(t)?t:"/");this.updateStateWithLocation(),window.onpopstate=()=>{this.updateStateWithLocation()}}}const We=new IN,xc=e=>`${e.vault.configDir}/query.json`,II=async(e,t)=>{try{return await e.vault.adapter.read(t),!0}catch(n){return console.error(n),!1}},Bd=async e=>(await II(e,xc(e))||await TI(e),JSON.parse(await e.vault.adapter.read(xc(e))).queries||[]),bm=async(e,t)=>{await e.vault.adapter.write(xc(e),JSON.stringify({queries:t},null,2))},TI=async e=>{const t=Qe.getState().manifest,n=e.plugins.getPlugin(t.id||"obsidian-memos").settings,r=e.metadataCache.getFirstLinkpathDest(n.QueryFileName,"");if(!r)await e.vault.adapter.write(xc(e),JSON.stringify({queries:[]},null,2));else{const o=(await e.vault.read(r)).split(`
`);o.length===0&&await e.vault.adapter.write(xc(e),JSON.stringify({queries:[]},null,2));const s=[];for(let u=0;u<o.length;u++){const d=u,m="Memos";let p="未命名";const g=o[u];let w=x.moment().format("YYYY/MM/DD HH:mm:ss"),D="[]";const S=g.match(/^\d{14,16}/);S&&(w=x.moment(S[0].slice(0,14),"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:ss"));const T=g.match(/\[\{(.+)\}\]/);T&&(D=T[0]);const E=g.match(/\s(.+)\s\[\{/);E&&(p=E[0].slice(1,-3)),s.push({id:d,pinnedAt:"",createdAt:w,updatedAt:w,title:p,querystring:D,userId:m})}await e.vault.adapter.write(xc(e),JSON.stringify({queries:s},null,2))}},TN=async()=>{const{app:e}=Ee.getState().dailyNotesState;return await II(e,xc(e))||await TI(e),await Bd(e)||[]},EN=(e,t)=>({createdAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),id:e,pinnedAt:"",querystring:t,title:k("Temp Filter"),updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"}),xN=async(e,t)=>{const n=await Bd(Ee.getState().dailyNotesState.app)||[],r={createdAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),id:x.moment().format("YYYYMMDDHHmmss")+n.length,pinnedAt:"",querystring:t,title:e,updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"};return n.push(r),await bm(Ee.getState().dailyNotesState.app,n),r};var nv={exports:{}};nv.exports;(function(e,t){(function(){var n,r="4.17.21",a=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",u="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",m=500,p="__lodash_placeholder__",g=1,w=2,D=4,S=1,T=2,E=1,A=2,N=4,R=8,F=16,H=32,P=64,L=128,z=256,U=512,W=30,K="...",ae=800,ce=16,fe=1,ie=2,ge=3,Te=1/0,se=9007199254740991,we=17976931348623157e292,Z=NaN,$=4294967295,X=$-1,ve=$>>>1,De=[["ary",L],["bind",E],["bindKey",A],["curry",R],["curryRight",F],["flip",U],["partial",H],["partialRight",P],["rearg",z]],be="[object Arguments]",ke="[object Array]",Be="[object AsyncFunction]",_e="[object Boolean]",it="[object Date]",Vt="[object DOMException]",Se="[object Error]",Ue="[object Function]",Je="[object GeneratorFunction]",$e="[object Map]",lt="[object Number]",ft="[object Null]",Dt="[object Object]",Et="[object Promise]",$t="[object Proxy]",rn="[object RegExp]",At="[object Set]",an="[object String]",Sn="[object Symbol]",In="[object Undefined]",vr="[object WeakMap]",Sa="[object WeakSet]",Mr="[object ArrayBuffer]",Nr="[object DataView]",Ss="[object Float32Array]",mo="[object Float64Array]",po="[object Int8Array]",Nl="[object Int16Array]",Fi="[object Int32Array]",Pi="[object Uint8Array]",Is="[object Uint8ClampedArray]",Yo="[object Uint16Array]",ji="[object Uint32Array]",V=/\b__p \+= '';/g,ne=/\b(__p \+=) '' \+/g,me=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ce=/&(?:amp|lt|gt|quot|#39);/g,je=/[&<>"']/g,Ye=RegExp(Ce.source),ze=RegExp(je.source),pt=/<%-([\s\S]+?)%>/g,Yt=/<%([\s\S]+?)%>/g,On=/<%=([\s\S]+?)%>/g,yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,na=/^\w*$/,Fn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yr=/[\\^$.*+?()[\]{}|]/g,ra=RegExp(yr.source),kl=/^\s+/,Jt=/\s/,Ia=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ta=/\{\n\/\* \[wrapped with (.+)\] \*/,Ea=/,? & /,zo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Uo=/[()=,{}\[\]\/\s]/,vy=/\\(\\)?/g,Li=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,of=/\w*$/,Um=/^[-+]0x[0-9a-f]+$/i,yy=/^0b[01]+$/i,Vm=/^\[object .+?Constructor\]$/,Zm=/^0o[0-7]+$/i,Wm=/^(?:0|[1-9]\d*)$/,$m=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zc=/($^)/,wy=/['\n\r\u2028\u2029\\]/g,on="\\ud800-\\udfff",by="\\u0300-\\u036f",sf="\\ufe20-\\ufe2f",Gm="\\u20d0-\\u20ff",Al=by+sf+Gm,qm="\\u2700-\\u27bf",lf="a-z\\xdf-\\xf6\\xf8-\\xff",Uc="\\xac\\xb1\\xd7\\xf7",Za="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dy="\\u2000-\\u206f",xa=" \\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",Jm="A-Z\\xc0-\\xd6\\xd8-\\xde",Km="\\ufe0e\\ufe0f",Qm=Uc+Za+Dy+xa,Ts="[']",Vc="["+on+"]",Es="["+Qm+"]",Ri="["+Al+"]",Xm="\\d+",Sy="["+qm+"]",Zc="["+lf+"]",cf="[^"+on+Qm+Xm+qm+lf+Jm+"]",Ol="\\ud83c[\\udffb-\\udfff]",Fl="(?:"+Ri+"|"+Ol+")",ep="[^"+on+"]",Pl="(?:\\ud83c[\\udde6-\\uddff]){2}",_t="[\\ud800-\\udbff][\\udc00-\\udfff]",_i="["+Jm+"]",uf="\\u200d",Wc="(?:"+Zc+"|"+cf+")",tp="(?:"+_i+"|"+cf+")",df="(?:"+Ts+"(?:d|ll|m|re|s|t|ve))?",ff="(?:"+Ts+"(?:D|LL|M|RE|S|T|VE))?",$c=Fl+"?",jl="["+Km+"]?",Vo="(?:"+uf+"(?:"+[ep,Pl,_t].join("|")+")"+jl+$c+")*",Zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Wo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",xs=jl+$c+Vo,Ll="(?:"+[Sy,Pl,_t].join("|")+")"+xs,$o="(?:"+[ep+Ri+"?",Ri,Pl,_t,Vc].join("|")+")",Iy=RegExp(Ts,"g"),np=RegExp(Ri,"g"),Hi=RegExp(Ol+"(?="+Ol+")|"+$o+xs,"g"),Ty=RegExp([_i+"?"+Zc+"+"+df+"(?="+[Es,_i,"$"].join("|")+")",tp+"+"+ff+"(?="+[Es,_i+Wc,"$"].join("|")+")",_i+"?"+Wc+"+"+df,_i+"+"+ff,Wo,Zo,Xm,Ll].join("|"),"g"),rp=RegExp("["+uf+on+Al+Km+"]"),Gc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ap=["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"],Ey=-1,zt={};zt[Ss]=zt[mo]=zt[po]=zt[Nl]=zt[Fi]=zt[Pi]=zt[Is]=zt[Yo]=zt[ji]=!0,zt[be]=zt[ke]=zt[Mr]=zt[_e]=zt[Nr]=zt[it]=zt[Se]=zt[Ue]=zt[$e]=zt[lt]=zt[Dt]=zt[rn]=zt[At]=zt[an]=zt[vr]=!1;var Ht={};Ht[be]=Ht[ke]=Ht[Mr]=Ht[Nr]=Ht[_e]=Ht[it]=Ht[Ss]=Ht[mo]=Ht[po]=Ht[Nl]=Ht[Fi]=Ht[$e]=Ht[lt]=Ht[Dt]=Ht[rn]=Ht[At]=Ht[an]=Ht[Sn]=Ht[Pi]=Ht[Is]=Ht[Yo]=Ht[ji]=!0,Ht[Se]=Ht[Ue]=Ht[vr]=!1;var Cs={À:"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"},qc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},xy={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Cy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hf=parseFloat,Jc=parseInt,Kc=typeof Jn=="object"&&Jn&&Jn.Object===Object&&Jn,op=typeof self=="object"&&self&&self.Object===Object&&self,sn=Kc||op||Function("return this")(),Rl=t&&!t.nodeType&&t,Wa=Rl&&!0&&e&&!e.nodeType&&e,mf=Wa&&Wa.exports===Rl,Ms=mf&&Kc.process,wr=function(){try{var oe=Wa&&Wa.require&&Wa.require("util").types;return oe||Ms&&Ms.binding&&Ms.binding("util")}catch{}}(),pf=wr&&wr.isArrayBuffer,kr=wr&&wr.isDate,Bi=wr&&wr.isMap,Qc=wr&&wr.isRegExp,Ns=wr&&wr.isSet,ip=wr&&wr.isTypedArray;function br(oe,xe,pe){switch(pe.length){case 0:return oe.call(xe);case 1:return oe.call(xe,pe[0]);case 2:return oe.call(xe,pe[0],pe[1]);case 3:return oe.call(xe,pe[0],pe[1],pe[2])}return oe.apply(xe,pe)}function gf(oe,xe,pe,Ge){for(var bt=-1,Pt=oe==null?0:oe.length;++bt<Pt;){var Tn=oe[bt];xe(Ge,Tn,pe(Tn),oe)}return Ge}function er(oe,xe){for(var pe=-1,Ge=oe==null?0:oe.length;++pe<Ge&&xe(oe[pe],pe,oe)!==!1;);return oe}function Xc(oe,xe){for(var pe=oe==null?0:oe.length;pe--&&xe(oe[pe],pe,oe)!==!1;);return oe}function vf(oe,xe){for(var pe=-1,Ge=oe==null?0:oe.length;++pe<Ge;)if(!xe(oe[pe],pe,oe))return!1;return!0}function Go(oe,xe){for(var pe=-1,Ge=oe==null?0:oe.length,bt=0,Pt=[];++pe<Ge;){var Tn=oe[pe];xe(Tn,pe,oe)&&(Pt[bt++]=Tn)}return Pt}function eu(oe,xe){var pe=oe==null?0:oe.length;return!!pe&&ks(oe,xe,0)>-1}function yf(oe,xe,pe){for(var Ge=-1,bt=oe==null?0:oe.length;++Ge<bt;)if(pe(xe,oe[Ge]))return!0;return!1}function Gt(oe,xe){for(var pe=-1,Ge=oe==null?0:oe.length,bt=Array(Ge);++pe<Ge;)bt[pe]=xe(oe[pe],pe,oe);return bt}function qo(oe,xe){for(var pe=-1,Ge=xe.length,bt=oe.length;++pe<Ge;)oe[bt+pe]=xe[pe];return oe}function wf(oe,xe,pe,Ge){var bt=-1,Pt=oe==null?0:oe.length;for(Ge&&Pt&&(pe=oe[++bt]);++bt<Pt;)pe=xe(pe,oe[bt],bt,oe);return pe}function My(oe,xe,pe,Ge){var bt=oe==null?0:oe.length;for(Ge&&bt&&(pe=oe[--bt]);bt--;)pe=xe(pe,oe[bt],bt,oe);return pe}function bf(oe,xe){for(var pe=-1,Ge=oe==null?0:oe.length;++pe<Ge;)if(xe(oe[pe],pe,oe))return!0;return!1}var Ny=Sf("length");function sp(oe){return oe.split("")}function ky(oe){return oe.match(zo)||[]}function lp(oe,xe,pe){var Ge;return pe(oe,function(bt,Pt,Tn){if(xe(bt,Pt,Tn))return Ge=Pt,!1}),Ge}function tu(oe,xe,pe,Ge){for(var bt=oe.length,Pt=pe+(Ge?1:-1);Ge?Pt--:++Pt<bt;)if(xe(oe[Pt],Pt,oe))return Pt;return-1}function ks(oe,xe,pe){return xe===xe?au(oe,xe,pe):tu(oe,cp,pe)}function Df(oe,xe,pe,Ge){for(var bt=pe-1,Pt=oe.length;++bt<Pt;)if(Ge(oe[bt],xe))return bt;return-1}function cp(oe){return oe!==oe}function up(oe,xe){var pe=oe==null?0:oe.length;return pe?If(oe,xe)/pe:Z}function Sf(oe){return function(xe){return xe==null?n:xe[oe]}}function nu(oe){return function(xe){return oe==null?n:oe[xe]}}function dp(oe,xe,pe,Ge,bt){return bt(oe,function(Pt,Tn,Zt){pe=Ge?(Ge=!1,Pt):xe(pe,Pt,Tn,Zt)}),pe}function Ay(oe,xe){var pe=oe.length;for(oe.sort(xe);pe--;)oe[pe]=oe[pe].value;return oe}function If(oe,xe){for(var pe,Ge=-1,bt=oe.length;++Ge<bt;){var Pt=xe(oe[Ge]);Pt!==n&&(pe=pe===n?Pt:pe+Pt)}return pe}function Tf(oe,xe){for(var pe=-1,Ge=Array(oe);++pe<oe;)Ge[pe]=xe(pe);return Ge}function Oy(oe,xe){return Gt(xe,function(pe){return[pe,oe[pe]]})}function fp(oe){return oe&&oe.slice(0,ou(oe)+1).replace(kl,"")}function zr(oe){return function(xe){return oe(xe)}}function _l(oe,xe){return Gt(xe,function(pe){return oe[pe]})}function go(oe,xe){return oe.has(xe)}function hp(oe,xe){for(var pe=-1,Ge=oe.length;++pe<Ge&&ks(xe,oe[pe],0)>-1;);return pe}function Ef(oe,xe){for(var pe=oe.length;pe--&&ks(xe,oe[pe],0)>-1;);return pe}function mp(oe,xe){for(var pe=oe.length,Ge=0;pe--;)oe[pe]===xe&&++Ge;return Ge}var pp=nu(Cs),gp=nu(qc);function vp(oe){return"\\"+Cy[oe]}function As(oe,xe){return oe==null?n:oe[xe]}function Os(oe){return rp.test(oe)}function Fy(oe){return Gc.test(oe)}function Py(oe){for(var xe,pe=[];!(xe=oe.next()).done;)pe.push(xe.value);return pe}function ru(oe){var xe=-1,pe=Array(oe.size);return oe.forEach(function(Ge,bt){pe[++xe]=[bt,Ge]}),pe}function xf(oe,xe){return function(pe){return oe(xe(pe))}}function aa(oe,xe){for(var pe=-1,Ge=oe.length,bt=0,Pt=[];++pe<Ge;){var Tn=oe[pe];(Tn===xe||Tn===p)&&(oe[pe]=p,Pt[bt++]=pe)}return Pt}function Jo(oe){var xe=-1,pe=Array(oe.size);return oe.forEach(function(Ge){pe[++xe]=Ge}),pe}function jy(oe){var xe=-1,pe=Array(oe.size);return oe.forEach(function(Ge){pe[++xe]=[Ge,Ge]}),pe}function au(oe,xe,pe){for(var Ge=pe-1,bt=oe.length;++Ge<bt;)if(oe[Ge]===xe)return Ge;return-1}function Ly(oe,xe,pe){for(var Ge=pe+1;Ge--;)if(oe[Ge]===xe)return Ge;return Ge}function Yi(oe){return Os(oe)?wp(oe):Ny(oe)}function Ur(oe){return Os(oe)?bp(oe):sp(oe)}function ou(oe){for(var xe=oe.length;xe--&&Jt.test(oe.charAt(xe)););return xe}var yp=nu(xy);function wp(oe){for(var xe=Hi.lastIndex=0;Hi.test(oe);)++xe;return xe}function bp(oe){return oe.match(Hi)||[]}function Ry(oe){return oe.match(Ty)||[]}var _y=function oe(xe){xe=xe==null?sn:Fs.defaults(sn.Object(),xe,Fs.pick(sn,ap));var pe=xe.Array,Ge=xe.Date,bt=xe.Error,Pt=xe.Function,Tn=xe.Math,Zt=xe.Object,Hl=xe.RegExp,Hy=xe.String,oa=xe.TypeError,vo=pe.prototype,Cf=Pt.prototype,$a=Zt.prototype,Ps=xe["__core-js_shared__"],Bl=Cf.toString,jt=$a.hasOwnProperty,js=0,iu=function(){var c=/[^.]+$/.exec(Ps&&Ps.keys&&Ps.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),Yl=$a.toString,su=Bl.call(Zt),Dp=sn._,Sp=Hl("^"+Bl.call(jt).replace(yr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zl=mf?xe.Buffer:n,yo=xe.Symbol,Ul=xe.Uint8Array,Mf=zl?zl.allocUnsafe:n,Ca=xf(Zt.getPrototypeOf,Zt),lu=Zt.create,cu=$a.propertyIsEnumerable,uu=vo.splice,Ip=yo?yo.isConcatSpreadable:n,wo=yo?yo.iterator:n,zi=yo?yo.toStringTag:n,Vl=function(){try{var c=Eo(Zt,"defineProperty");return c({},"",{}),c}catch{}}(),Tp=xe.clearTimeout!==sn.clearTimeout&&xe.clearTimeout,Kt=Ge&&Ge.now!==sn.Date.now&&Ge.now,Nf=xe.setTimeout!==sn.setTimeout&&xe.setTimeout,Ui=Tn.ceil,Ko=Tn.floor,du=Zt.getOwnPropertySymbols,kf=zl?zl.isBuffer:n,Ls=xe.isFinite,fu=vo.join,Rs=xf(Zt.keys,Zt),En=Tn.max,tr=Tn.min,By=Ge.now,Ep=xe.parseInt,Zl=Tn.random,hu=vo.reverse,Wl=Eo(xe,"DataView"),Vi=Eo(xe,"Map"),$l=Eo(xe,"Promise"),Qo=Eo(xe,"Set"),Gl=Eo(xe,"WeakMap"),_s=Eo(Zt,"create"),mu=Gl&&new Gl,Hs={},Af=fi(Wl),Xo=fi(Vi),xp=fi($l),Bs=fi(Qo),Ga=fi(Gl),ei=yo?yo.prototype:n,Vr=ei?ei.valueOf:n,pu=ei?ei.toString:n;function B(c){if(Cn(c)&&!Tt(c)&&!(c instanceof St)){if(c instanceof nr)return c;if(jt.call(c,"__wrapped__"))return uh(c)}return new nr(c)}var Ys=function(){function c(){}return function(f){if(!bn(f))return{};if(lu)return lu(f);c.prototype=f;var b=new c;return c.prototype=n,b}}();function qa(){}function nr(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}B.templateSettings={escape:pt,evaluate:Yt,interpolate:On,variable:"",imports:{_:B}},B.prototype=qa.prototype,B.prototype.constructor=B,nr.prototype=Ys(qa.prototype),nr.prototype.constructor=nr;function St(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=$,this.__views__=[]}function gu(){var c=new St(this.__wrapped__);return c.__actions__=Ir(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Ir(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Ir(this.__views__),c}function Of(){if(this.__filtered__){var c=new St(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function zs(){var c=this.__wrapped__.value(),f=this.__dir__,b=Tt(c),M=f<0,j=b?c.length:0,Y=Jp(0,j,this.__views__),J=Y.start,te=Y.end,le=te-J,Me=M?te:J-1,Ne=this.__iteratees__,Pe=Ne.length,Ve=0,ot=tr(le,this.__takeCount__);if(!b||!M&&j==le&&ot==le)return Vf(c,this.__actions__);var gt=[];e:for(;le--&&Ve<ot;){Me+=f;for(var Ct=-1,vt=c[Me];++Ct<Pe;){var Mt=Ne[Ct],Ft=Mt.iteratee,Ra=Mt.type,Kr=Ft(vt);if(Ra==ie)vt=Kr;else if(!Kr){if(Ra==fe)continue e;break e}}gt[Ve++]=vt}return gt}St.prototype=Ys(qa.prototype),St.prototype.constructor=St;function Ar(c){var f=-1,b=c==null?0:c.length;for(this.clear();++f<b;){var M=c[f];this.set(M[0],M[1])}}function Qt(){this.__data__=_s?_s(null):{},this.size=0}function qt(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f}function ti(c){var f=this.__data__;if(_s){var b=f[c];return b===d?n:b}return jt.call(f,c)?f[c]:n}function rr(c){var f=this.__data__;return _s?f[c]!==n:jt.call(f,c)}function Or(c,f){var b=this.__data__;return this.size+=this.has(c)?0:1,b[c]=_s&&f===n?d:f,this}Ar.prototype.clear=Qt,Ar.prototype.delete=qt,Ar.prototype.get=ti,Ar.prototype.has=rr,Ar.prototype.set=Or;function Dr(c){var f=-1,b=c==null?0:c.length;for(this.clear();++f<b;){var M=c[f];this.set(M[0],M[1])}}function Us(){this.__data__=[],this.size=0}function Fr(c){var f=this.__data__,b=or(f,c);if(b<0)return!1;var M=f.length-1;return b==M?f.pop():uu.call(f,b,1),--this.size,!0}function vu(c){var f=this.__data__,b=or(f,c);return b<0?n:f[b][1]}function Cp(c){return or(this.__data__,c)>-1}function Mp(c,f){var b=this.__data__,M=or(b,c);return M<0?(++this.size,b.push([c,f])):b[M][1]=f,this}Dr.prototype.clear=Us,Dr.prototype.delete=Fr,Dr.prototype.get=vu,Dr.prototype.has=Cp,Dr.prototype.set=Mp;function ia(c){var f=-1,b=c==null?0:c.length;for(this.clear();++f<b;){var M=c[f];this.set(M[0],M[1])}}function Np(){this.size=0,this.__data__={hash:new Ar,map:new(Vi||Dr),string:new Ar}}function bo(c){var f=Vu(this,c).delete(c);return this.size-=f?1:0,f}function yu(c){return Vu(this,c).get(c)}function Ff(c){return Vu(this,c).has(c)}function kp(c,f){var b=Vu(this,c),M=b.size;return b.set(c,f),this.size+=b.size==M?0:1,this}ia.prototype.clear=Np,ia.prototype.delete=bo,ia.prototype.get=yu,ia.prototype.has=Ff,ia.prototype.set=kp;function Zi(c){var f=-1,b=c==null?0:c.length;for(this.__data__=new ia;++f<b;)this.add(c[f])}function ni(c){return this.__data__.set(c,d),this}function Vs(c){return this.__data__.has(c)}Zi.prototype.add=Zi.prototype.push=ni,Zi.prototype.has=Vs;function ar(c){var f=this.__data__=new Dr(c);this.size=f.size}function wu(){this.__data__=new Dr,this.size=0}function bu(c){var f=this.__data__,b=f.delete(c);return this.size=f.size,b}function sa(c){return this.__data__.get(c)}function la(c){return this.__data__.has(c)}function Wi(c,f){var b=this.__data__;if(b instanceof Dr){var M=b.__data__;if(!Vi||M.length<a-1)return M.push([c,f]),this.size=++b.size,this;b=this.__data__=new ia(M)}return b.set(c,f),this.size=b.size,this}ar.prototype.clear=wu,ar.prototype.delete=bu,ar.prototype.get=sa,ar.prototype.has=la,ar.prototype.set=Wi;function Ja(c,f){var b=Tt(c),M=!b&&wc(c),j=!b&&!M&&sl(c),Y=!b&&!M&&!j&&hd(c),J=b||M||j||Y,te=J?Tf(c.length,Hy):[],le=te.length;for(var Me in c)(f||jt.call(c,Me))&&!(J&&(Me=="length"||j&&(Me=="offset"||Me=="parent")||Y&&(Me=="buffer"||Me=="byteLength"||Me=="byteOffset")||ua(Me,le)))&&te.push(Me);return te}function Ka(c){var f=c.length;return f?c[nc(0,f-1)]:n}function $i(c,f){return Gr(Ir(c),Do(f,0,c.length))}function Ap(c){return Gr(Ir(c))}function ql(c,f,b){(b!==n&&!Mo(c[f],b)||b===n&&!(f in c))&&Qa(c,f,b)}function Gi(c,f,b){var M=c[f];(!(jt.call(c,f)&&Mo(M,b))||b===n&&!(f in c))&&Qa(c,f,b)}function or(c,f){for(var b=c.length;b--;)if(Mo(c[b][0],f))return b;return-1}function Zr(c,f,b,M){return eo(c,function(j,Y,J){f(M,j,b(j),J)}),M}function Xt(c,f){return c&&Fa(f,fr(f),c)}function Ma(c,f){return c&&Fa(f,ma(f),c)}function Qa(c,f,b){f=="__proto__"&&Vl?Vl(c,f,{configurable:!0,enumerable:!0,value:b,writable:!0}):c[f]=b}function Du(c,f){for(var b=-1,M=f.length,j=pe(M),Y=c==null;++b<M;)j[b]=Y?n:c0(c,f[b]);return j}function Do(c,f,b){return c===c&&(b!==n&&(c=c<=b?c:b),f!==n&&(c=c>=f?c:f)),c}function Pr(c,f,b,M,j,Y){var J,te=f&g,le=f&w,Me=f&D;if(b&&(J=j?b(c,M,j,Y):b(c)),J!==n)return J;if(!bn(c))return c;var Ne=Tt(c);if(Ne){if(J=Kp(c),!te)return Ir(c,J)}else{var Pe=cr(c),Ve=Pe==Ue||Pe==Je;if(sl(c))return Wf(c,te);if(Pe==Dt||Pe==be||Ve&&!j){if(J=le||Ve?{}:tl(c),!te)return le?zy(c,Ma(J,c)):Yp(c,Xt(J,c))}else{if(!Ht[Pe])return j?c:{};J=ur(c,Pe,te)}}Y||(Y=new ar);var ot=Y.get(c);if(ot)return ot;Y.set(c,J),wb(c)?c.forEach(function(vt){J.add(Pr(vt,f,b,vt,c,Y))}):vb(c)&&c.forEach(function(vt,Mt){J.set(Mt,Pr(vt,f,b,Mt,c,Y))});var gt=Me?le?cc:Uu:le?ma:fr,Ct=Ne?n:gt(c);return er(Ct||c,function(vt,Mt){Ct&&(Mt=vt,vt=c[Mt]),Gi(J,Mt,Pr(vt,f,b,Mt,c,Y))}),J}function Op(c){var f=fr(c);return function(b){return Jl(b,c,f)}}function Jl(c,f,b){var M=b.length;if(c==null)return!M;for(c=Zt(c);M--;){var j=b[M],Y=f[j],J=c[j];if(J===n&&!(j in c)||!Y(J))return!1}return!0}function Pf(c,f,b){if(typeof c!="function")throw new oa(s);return rl(function(){c.apply(n,b)},f)}function Xa(c,f,b,M){var j=-1,Y=eu,J=!0,te=c.length,le=[],Me=f.length;if(!te)return le;b&&(f=Gt(f,zr(b))),M?(Y=yf,J=!1):f.length>=a&&(Y=go,J=!1,f=new Zi(f));e:for(;++j<te;){var Ne=c[j],Pe=b==null?Ne:b(Ne);if(Ne=M||Ne!==0?Ne:0,J&&Pe===Pe){for(var Ve=Me;Ve--;)if(f[Ve]===Pe)continue e;le.push(Ne)}else Y(f,Pe,M)||le.push(Ne)}return le}var eo=zp(ca),Fp=zp(ri,!0);function Na(c,f){var b=!0;return eo(c,function(M,j,Y){return b=!!f(M,j,Y),b}),b}function qi(c,f,b){for(var M=-1,j=c.length;++M<j;){var Y=c[M],J=f(Y);if(J!=null&&(te===n?J===J&&!La(J):b(J,te)))var te=J,le=Y}return le}function Su(c,f,b,M){var j=c.length;for(b=xt(b),b<0&&(b=-b>j?0:j+b),M=M===n||M>j?j:xt(M),M<0&&(M+=j),M=b>M?0:Db(M);b<M;)c[b++]=f;return c}function Ji(c,f){var b=[];return eo(c,function(M,j,Y){f(M,j,Y)&&b.push(M)}),b}function Pn(c,f,b,M,j){var Y=-1,J=c.length;for(b||(b=Zy),j||(j=[]);++Y<J;){var te=c[Y];f>0&&b(te)?f>1?Pn(te,f-1,b,M,j):qo(j,te):M||(j[j.length]=te)}return j}var Kl=Kf(),Iu=Kf(!0);function ca(c,f){return c&&Kl(c,f,fr)}function ri(c,f){return c&&Iu(c,f,fr)}function Sr(c,f){return Go(f,function(b){return as(c[b])})}function Wr(c,f){f=So(f,c);for(var b=0,M=f.length;c!=null&&b<M;)c=c[Pa(f[b++])];return b&&b==M?c:n}function Tu(c,f,b){var M=f(c);return Tt(c)?M:qo(M,b(c))}function ir(c){return c==null?c===n?In:ft:zi&&zi in Zt(c)?qp(c):tg(c)}function ka(c,f){return c>f}function ai(c,f){return c!=null&&jt.call(c,f)}function jf(c,f){return c!=null&&f in Zt(c)}function Pp(c,f,b){return c>=tr(f,b)&&c<En(f,b)}function Aa(c,f,b){for(var M=b?yf:eu,j=c[0].length,Y=c.length,J=Y,te=pe(Y),le=1/0,Me=[];J--;){var Ne=c[J];J&&f&&(Ne=Gt(Ne,zr(f))),le=tr(Ne.length,le),te[J]=!b&&(f||j>=120&&Ne.length>=120)?new Zi(J&&Ne):n}Ne=c[0];var Pe=-1,Ve=te[0];e:for(;++Pe<j&&Me.length<le;){var ot=Ne[Pe],gt=f?f(ot):ot;if(ot=b||ot!==0?ot:0,!(Ve?go(Ve,gt):M(Me,gt,b))){for(J=Y;--J;){var Ct=te[J];if(!(Ct?go(Ct,gt):M(c[J],gt,b)))continue e}Ve&&Ve.push(gt),Me.push(ot)}}return Me}function oi(c,f,b,M){return ca(c,function(j,Y,J){f(M,b(j),Y,J)}),M}function ii(c,f,b){f=So(f,c),c=$u(c,f);var M=c==null?c:c[Pa(Hn(f))];return M==null?n:br(M,c,b)}function Lf(c){return Cn(c)&&ir(c)==be}function Eu(c){return Cn(c)&&ir(c)==Mr}function jp(c){return Cn(c)&&ir(c)==it}function Zs(c,f,b,M,j){return c===f?!0:c==null||f==null||!Cn(c)&&!Cn(f)?c!==c&&f!==f:Rf(c,f,b,M,Zs,j)}function Rf(c,f,b,M,j,Y){var J=Tt(c),te=Tt(f),le=J?ke:cr(c),Me=te?ke:cr(f);le=le==be?Dt:le,Me=Me==be?Dt:Me;var Ne=le==Dt,Pe=Me==Dt,Ve=le==Me;if(Ve&&sl(c)){if(!sl(f))return!1;J=!0,Ne=!1}if(Ve&&!Ne)return Y||(Y=new ar),J||hd(c)?zu(c,f,b,M,j,Y):Gp(c,f,le,b,M,j,Y);if(!(b&S)){var ot=Ne&&jt.call(c,"__wrapped__"),gt=Pe&&jt.call(f,"__wrapped__");if(ot||gt){var Ct=ot?c.value():c,vt=gt?f.value():f;return Y||(Y=new ar),j(Ct,vt,b,M,Y)}}return Ve?(Y||(Y=new ar),rh(c,f,b,M,j,Y)):!1}function xu(c){return Cn(c)&&cr(c)==$e}function Cu(c,f,b,M){var j=b.length,Y=j,J=!M;if(c==null)return!Y;for(c=Zt(c);j--;){var te=b[j];if(J&&te[2]?te[1]!==c[te[0]]:!(te[0]in c))return!1}for(;++j<Y;){te=b[j];var le=te[0],Me=c[le],Ne=te[1];if(J&&te[2]){if(Me===n&&!(le in c))return!1}else{var Pe=new ar;if(M)var Ve=M(Me,Ne,le,c,f,Pe);if(!(Ve===n?Zs(Ne,Me,S|T,M,Pe):Ve))return!1}}return!0}function _f(c){if(!bn(c)||sh(c))return!1;var f=as(c)?Sp:Vm;return f.test(fi(c))}function Lp(c){return Cn(c)&&ir(c)==rn}function Hf(c){return Cn(c)&&cr(c)==At}function Ql(c){return Cn(c)&&vg(c.length)&&!!zt[ir(c)]}function Xl(c){return typeof c=="function"?c:c==null?pa:typeof c=="object"?Tt(c)?Oa(c[0],c[1]):Ws(c):Ob(c)}function Mu(c){if(!fc(c))return Rs(c);var f=[];for(var b in Zt(c))jt.call(c,b)&&b!="constructor"&&f.push(b);return f}function Rp(c){if(!bn(c))return eg(c);var f=fc(c),b=[];for(var M in c)M=="constructor"&&(f||!jt.call(c,M))||b.push(M);return b}function si(c,f){return c<f}function Bf(c,f){var b=-1,M=ha(c)?pe(c.length):[];return eo(c,function(j,Y,J){M[++b]=f(j,Y,J)}),M}function Ws(c){var f=Zu(c);return f.length==1&&f[0][2]?hc(f[0][0],f[0][1]):function(b){return b===c||Cu(b,c,f)}}function Oa(c,f){return ih(c)&&nl(f)?hc(Pa(c),f):function(b){var M=c0(b,c);return M===n&&M===f?u0(b,c):Zs(f,M,S|T)}}function li(c,f,b,M,j){c!==f&&Kl(f,function(Y,J){if(j||(j=new ar),bn(Y))ec(c,f,J,b,li,M,j);else{var te=M?M($r(c,J),Y,J+"",c,f,j):n;te===n&&(te=Y),ql(c,J,te)}},ma)}function ec(c,f,b,M,j,Y,J){var te=$r(c,b),le=$r(f,b),Me=J.get(le);if(Me){ql(c,b,Me);return}var Ne=Y?Y(te,le,b+"",c,f,J):n,Pe=Ne===n;if(Pe){var Ve=Tt(le),ot=!Ve&&sl(le),gt=!Ve&&!ot&&hd(le);Ne=le,Ve||ot||gt?Tt(te)?Ne=te:Bn(te)?Ne=Ir(te):ot?(Pe=!1,Ne=Wf(le,!0)):gt?(Pe=!1,Ne=Gf(le,!0)):Ne=[]:Mh(le)||wc(le)?(Ne=te,wc(te)?Ne=Sb(te):(!bn(te)||as(te))&&(Ne=tl(le))):Pe=!1}Pe&&(J.set(le,Ne),j(Ne,le,M,Y,J),J.delete(le)),ql(c,b,Ne)}function ci(c,f){var b=c.length;if(b)return f+=f<0?b:0,ua(f,b)?c[f]:n}function Nu(c,f,b){f.length?f=Gt(f,function(Y){return Tt(Y)?function(J){return Wr(J,Y.length===1?Y[0]:Y)}:Y}):f=[pa];var M=-1;f=Gt(f,zr(ct()));var j=Bf(c,function(Y,J,te){var le=Gt(f,function(Me){return Me(Y)});return{criteria:le,index:++M,value:Y}});return Ay(j,function(Y,J){return Bp(Y,J,b)})}function $s(c,f){return Yf(c,f,function(b,M){return u0(c,M)})}function Yf(c,f,b){for(var M=-1,j=f.length,Y={};++M<j;){var J=f[M],te=Wr(c,J);b(te,J)&&un(Y,So(J,c),te)}return Y}function zf(c){return function(f){return Wr(f,c)}}function en(c,f,b,M){var j=M?Df:ks,Y=-1,J=f.length,te=c;for(c===f&&(f=Ir(f)),b&&(te=Gt(c,zr(b)));++Y<J;)for(var le=0,Me=f[Y],Ne=b?b(Me):Me;(le=j(te,Ne,le,M))>-1;)te!==c&&uu.call(te,le,1),uu.call(c,le,1);return c}function tc(c,f){for(var b=c?f.length:0,M=b-1;b--;){var j=f[b];if(b==M||j!==Y){var Y=j;ua(j)?uu.call(c,j,1):Qi(c,j)}}return c}function nc(c,f){return c+Ko(Zl()*(f-c+1))}function Uf(c,f,b,M){for(var j=-1,Y=En(Ui((f-c)/(b||1)),0),J=pe(Y);Y--;)J[M?Y:++j]=c,c+=b;return J}function Gs(c,f){var b="";if(!c||f<1||f>se)return b;do f%2&&(b+=c),f=Ko(f/2),f&&(c+=c);while(f);return b}function It(c,f){return Gu(Wu(c,f,pa),c+"")}function Ki(c){return Ka(md(c))}function cn(c,f){var b=md(c);return Gr(b,Do(f,0,b.length))}function un(c,f,b,M){if(!bn(c))return c;f=So(f,c);for(var j=-1,Y=f.length,J=Y-1,te=c;te!=null&&++j<Y;){var le=Pa(f[j]),Me=b;if(le==="__proto__"||le==="constructor"||le==="prototype")return c;if(j!=J){var Ne=te[le];Me=M?M(Ne,le,te):n,Me===n&&(Me=bn(Ne)?Ne:ua(f[j+1])?[]:{})}Gi(te,le,Me),te=te[le]}return c}var jn=mu?function(c,f){return mu.set(c,f),c}:pa,ku=Vl?function(c,f){return Vl(c,"toString",{configurable:!0,enumerable:!1,value:f0(f),writable:!0})}:pa;function rc(c){return Gr(md(c))}function sr(c,f,b){var M=-1,j=c.length;f<0&&(f=-f>j?0:j+f),b=b>j?j:b,b<0&&(b+=j),j=f>b?0:b-f>>>0,f>>>=0;for(var Y=pe(j);++M<j;)Y[M]=c[M+f];return Y}function Yy(c,f){var b;return eo(c,function(M,j,Y){return b=f(M,j,Y),!b}),!!b}function Ln(c,f,b){var M=0,j=c==null?M:c.length;if(typeof f=="number"&&f===f&&j<=ve){for(;M<j;){var Y=M+j>>>1,J=c[Y];J!==null&&!La(J)&&(b?J<=f:J<f)?M=Y+1:j=Y}return j}return ac(c,f,pa,b)}function ac(c,f,b,M){var j=0,Y=c==null?0:c.length;if(Y===0)return 0;f=b(f);for(var J=f!==f,te=f===null,le=La(f),Me=f===n;j<Y;){var Ne=Ko((j+Y)/2),Pe=b(c[Ne]),Ve=Pe!==n,ot=Pe===null,gt=Pe===Pe,Ct=La(Pe);if(J)var vt=M||gt;else Me?vt=gt&&(M||Ve):te?vt=gt&&Ve&&(M||!ot):le?vt=gt&&Ve&&!ot&&(M||!Ct):ot||Ct?vt=!1:vt=M?Pe<=f:Pe<f;vt?j=Ne+1:Y=Ne}return tr(Y,X)}function Au(c,f){for(var b=-1,M=c.length,j=0,Y=[];++b<M;){var J=c[b],te=f?f(J):J;if(!b||!Mo(te,le)){var le=te;Y[j++]=J===0?0:J}}return Y}function Ou(c){return typeof c=="number"?c:La(c)?Z:+c}function mn(c){if(typeof c=="string")return c;if(Tt(c))return Gt(c,mn)+"";if(La(c))return pu?pu.call(c):"";var f=c+"";return f=="0"&&1/c==-Te?"-0":f}function Rn(c,f,b){var M=-1,j=eu,Y=c.length,J=!0,te=[],le=te;if(b)J=!1,j=yf;else if(Y>=a){var Me=f?null:Tr(c);if(Me)return Jo(Me);J=!1,j=go,le=new Zi}else le=f?[]:te;e:for(;++M<Y;){var Ne=c[M],Pe=f?f(Ne):Ne;if(Ne=b||Ne!==0?Ne:0,J&&Pe===Pe){for(var Ve=le.length;Ve--;)if(le[Ve]===Pe)continue e;f&&le.push(Pe),te.push(Ne)}else j(le,Pe,b)||(le!==te&&le.push(Pe),te.push(Ne))}return te}function Qi(c,f){return f=So(f,c),c=$u(c,f),c==null||delete c[Pa(Hn(f))]}function Fu(c,f,b,M){return un(c,f,b(Wr(c,f)),M)}function qs(c,f,b,M){for(var j=c.length,Y=M?j:-1;(M?Y--:++Y<j)&&f(c[Y],Y,c););return b?sr(c,M?0:Y,M?Y+1:j):sr(c,M?Y+1:0,M?j:Y)}function Vf(c,f){var b=c;return b instanceof St&&(b=b.value()),wf(f,function(M,j){return j.func.apply(j.thisArg,qo([M],j.args))},b)}function Pu(c,f,b){var M=c.length;if(M<2)return M?Rn(c[0]):[];for(var j=-1,Y=pe(M);++j<M;)for(var J=c[j],te=-1;++te<M;)te!=j&&(Y[j]=Xa(Y[j]||J,c[te],f,b));return Rn(Pn(Y,1),f,b)}function Zf(c,f,b){for(var M=-1,j=c.length,Y=f.length,J={};++M<j;){var te=M<Y?f[M]:n;b(J,c[M],te)}return J}function ju(c){return Bn(c)?c:[]}function Lu(c){return typeof c=="function"?c:pa}function So(c,f){return Tt(c)?c:ih(c,f)?[c]:ng(Wt(c))}var _p=It;function Io(c,f,b){var M=c.length;return b=b===n?M:b,!f&&b>=M?c:sr(c,f,b)}var Js=Tp||function(c){return sn.clearTimeout(c)};function Wf(c,f){if(f)return c.slice();var b=c.length,M=Mf?Mf(b):new c.constructor(b);return c.copy(M),M}function Ks(c){var f=new c.constructor(c.byteLength);return new Ul(f).set(new Ul(c)),f}function Ru(c,f){var b=f?Ks(c.buffer):c.buffer;return new c.constructor(b,c.byteOffset,c.byteLength)}function Hp(c){var f=new c.constructor(c.source,of.exec(c));return f.lastIndex=c.lastIndex,f}function $f(c){return Vr?Zt(Vr.call(c)):{}}function Gf(c,f){var b=f?Ks(c.buffer):c.buffer;return new c.constructor(b,c.byteOffset,c.length)}function qf(c,f){if(c!==f){var b=c!==n,M=c===null,j=c===c,Y=La(c),J=f!==n,te=f===null,le=f===f,Me=La(f);if(!te&&!Me&&!Y&&c>f||Y&&J&&le&&!te&&!Me||M&&J&&le||!b&&le||!j)return 1;if(!M&&!Y&&!Me&&c<f||Me&&b&&j&&!M&&!Y||te&&b&&j||!J&&j||!le)return-1}return 0}function Bp(c,f,b){for(var M=-1,j=c.criteria,Y=f.criteria,J=j.length,te=b.length;++M<J;){var le=qf(j[M],Y[M]);if(le){if(M>=te)return le;var Me=b[M];return le*(Me=="desc"?-1:1)}}return c.index-f.index}function Jf(c,f,b,M){for(var j=-1,Y=c.length,J=b.length,te=-1,le=f.length,Me=En(Y-J,0),Ne=pe(le+Me),Pe=!M;++te<le;)Ne[te]=f[te];for(;++j<J;)(Pe||j<Y)&&(Ne[b[j]]=c[j]);for(;Me--;)Ne[te++]=c[j++];return Ne}function _u(c,f,b,M){for(var j=-1,Y=c.length,J=-1,te=b.length,le=-1,Me=f.length,Ne=En(Y-te,0),Pe=pe(Ne+Me),Ve=!M;++j<Ne;)Pe[j]=c[j];for(var ot=j;++le<Me;)Pe[ot+le]=f[le];for(;++J<te;)(Ve||j<Y)&&(Pe[ot+b[J]]=c[j++]);return Pe}function Ir(c,f){var b=-1,M=c.length;for(f||(f=pe(M));++b<M;)f[b]=c[b];return f}function Fa(c,f,b,M){var j=!b;b||(b={});for(var Y=-1,J=f.length;++Y<J;){var te=f[Y],le=M?M(b[te],c[te],te,b,c):n;le===n&&(le=c[te]),j?Qa(b,te,le):Gi(b,te,le)}return b}function Yp(c,f){return Fa(c,el(c),f)}function zy(c,f){return Fa(c,ro(c),f)}function oc(c,f){return function(b,M){var j=Tt(b)?gf:Zr,Y=f?f():{};return j(b,c,ct(M,2),Y)}}function Qs(c){return It(function(f,b){var M=-1,j=b.length,Y=j>1?b[j-1]:n,J=j>2?b[2]:n;for(Y=c.length>3&&typeof Y=="function"?(j--,Y):n,J&&Bt(b[0],b[1],J)&&(Y=j<3?n:Y,j=1),f=Zt(f);++M<j;){var te=b[M];te&&c(f,te,M,Y)}return f})}function zp(c,f){return function(b,M){if(b==null)return b;if(!ha(b))return c(b,M);for(var j=b.length,Y=f?j:-1,J=Zt(b);(f?Y--:++Y<j)&&M(J[Y],Y,J)!==!1;);return b}}function Kf(c){return function(f,b,M){for(var j=-1,Y=Zt(f),J=M(f),te=J.length;te--;){var le=J[c?te:++j];if(b(Y[le],le,Y)===!1)break}return f}}function Up(c,f,b){var M=f&E,j=ic(c);function Y(){var J=this&&this!==sn&&this instanceof Y?j:c;return J.apply(M?b:this,arguments)}return Y}function Qf(c){return function(f){f=Wt(f);var b=Os(f)?Ur(f):n,M=b?b[0]:f.charAt(0),j=b?Io(b,1).join(""):f.slice(1);return M[c]()+j}}function To(c){return function(f){return wf(kb(Nb(f).replace(Iy,"")),c,"")}}function ic(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var b=Ys(c.prototype),M=c.apply(b,f);return bn(M)?M:b}}function Uy(c,f,b){var M=ic(c);function j(){for(var Y=arguments.length,J=pe(Y),te=Y,le=ui(j);te--;)J[te]=arguments[te];var Me=Y<3&&J[0]!==le&&J[Y-1]!==le?[]:aa(J,le);if(Y-=Me.length,Y<b)return Wp(c,f,Xs,j.placeholder,n,J,Me,n,n,b-Y);var Ne=this&&this!==sn&&this instanceof j?M:c;return br(Ne,this,J)}return j}function Vp(c){return function(f,b,M){var j=Zt(f);if(!ha(f)){var Y=ct(b,3);f=fr(f),b=function(te){return Y(j[te],te,j)}}var J=c(f,b,M);return J>-1?j[Y?f[J]:J]:n}}function Xi(c){return no(function(f){var b=f.length,M=b,j=nr.prototype.thru;for(c&&f.reverse();M--;){var Y=f[M];if(typeof Y!="function")throw new oa(s);if(j&&!J&&dc(Y)=="wrapper")var J=new nr([],!0)}for(M=J?M:b;++M<b;){Y=f[M];var te=dc(Y),le=te=="wrapper"?uc(Y):n;le&&di(le[0])&&le[1]==(L|R|H|z)&&!le[4].length&&le[9]==1?J=J[dc(le[0])].apply(J,le[3]):J=Y.length==1&&di(Y)?J[te]():J.thru(Y)}return function(){var Me=arguments,Ne=Me[0];if(J&&Me.length==1&&Tt(Ne))return J.plant(Ne).value();for(var Pe=0,Ve=b?f[Pe].apply(this,Me):Ne;++Pe<b;)Ve=f[Pe].call(this,Ve);return Ve}})}function Xs(c,f,b,M,j,Y,J,te,le,Me){var Ne=f&L,Pe=f&E,Ve=f&A,ot=f&(R|F),gt=f&U,Ct=Ve?n:ic(c);function vt(){for(var Mt=arguments.length,Ft=pe(Mt),Ra=Mt;Ra--;)Ft[Ra]=arguments[Ra];if(ot)var Kr=ui(vt),_a=mp(Ft,Kr);if(M&&(Ft=Jf(Ft,M,j,ot)),Y&&(Ft=_u(Ft,Y,J,ot)),Mt-=_a,ot&&Mt<Me){var Yn=aa(Ft,Kr);return Wp(c,f,Xs,vt.placeholder,b,Ft,Yn,te,le,Me-Mt)}var No=Pe?b:this,is=Ve?No[c]:c;return Mt=Ft.length,te?Ft=Gn(Ft,te):gt&&Mt>1&&Ft.reverse(),Ne&&le<Mt&&(Ft.length=le),this&&this!==sn&&this instanceof vt&&(is=Ct||ic(is)),is.apply(No,Ft)}return vt}function Hu(c,f){return function(b,M){return oi(b,c,f(M),{})}}function Bu(c,f){return function(b,M){var j;if(b===n&&M===n)return f;if(b!==n&&(j=b),M!==n){if(j===n)return M;typeof b=="string"||typeof M=="string"?(b=mn(b),M=mn(M)):(b=Ou(b),M=Ou(M)),j=c(b,M)}return j}}function Yu(c){return no(function(f){return f=Gt(f,zr(ct())),It(function(b){var M=this;return c(f,function(j){return br(j,M,b)})})})}function sc(c,f){f=f===n?" ":mn(f);var b=f.length;if(b<2)return b?Gs(f,c):f;var M=Gs(f,Ui(c/Yi(f)));return Os(f)?Io(Ur(M),0,c).join(""):M.slice(0,c)}function Zp(c,f,b,M){var j=f&E,Y=ic(c);function J(){for(var te=-1,le=arguments.length,Me=-1,Ne=M.length,Pe=pe(Ne+le),Ve=this&&this!==sn&&this instanceof J?Y:c;++Me<Ne;)Pe[Me]=M[Me];for(;le--;)Pe[Me++]=arguments[++te];return br(Ve,j?b:this,Pe)}return J}function Xf(c){return function(f,b,M){return M&&typeof M!="number"&&Bt(f,b,M)&&(b=M=n),f=os(f),b===n?(b=f,f=0):b=os(b),M=M===n?f<b?1:-1:os(M),Uf(f,b,M,c)}}function lc(c){return function(f,b){return typeof f=="string"&&typeof b=="string"||(f=ao(f),b=ao(b)),c(f,b)}}function Wp(c,f,b,M,j,Y,J,te,le,Me){var Ne=f&R,Pe=Ne?J:n,Ve=Ne?n:J,ot=Ne?Y:n,gt=Ne?n:Y;f|=Ne?H:P,f&=~(Ne?P:H),f&N||(f&=~(E|A));var Ct=[c,f,j,ot,Pe,gt,Ve,te,le,Me],vt=b.apply(n,Ct);return di(c)&&xo(vt,Ct),vt.placeholder=M,da(vt,c,f)}function lr(c){var f=Tn[c];return function(b,M){if(b=ao(b),M=M==null?0:tr(xt(M),292),M&&Ls(b)){var j=(Wt(b)+"e").split("e"),Y=f(j[0]+"e"+(+j[1]+M));return j=(Wt(Y)+"e").split("e"),+(j[0]+"e"+(+j[1]-M))}return f(b)}}var Tr=Qo&&1/Jo(new Qo([,-0]))[1]==Te?function(c){return new Qo(c)}:p0;function eh(c){return function(f){var b=cr(f);return b==$e?ru(f):b==At?jy(f):Oy(f,c(f))}}function to(c,f,b,M,j,Y,J,te){var le=f&A;if(!le&&typeof c!="function")throw new oa(s);var Me=M?M.length:0;if(Me||(f&=~(H|P),M=j=n),J=J===n?J:En(xt(J),0),te=te===n?te:xt(te),Me-=j?j.length:0,f&P){var Ne=M,Pe=j;M=j=n}var Ve=le?n:uc(c),ot=[c,f,b,M,j,Ne,Pe,Y,J,te];if(Ve&&Xp(ot,Ve),c=ot[0],f=ot[1],b=ot[2],M=ot[3],j=ot[4],te=ot[9]=ot[9]===n?le?0:c.length:En(ot[9]-Me,0),!te&&f&(R|F)&&(f&=~(R|F)),!f||f==E)var gt=Up(c,f,b);else f==R||f==F?gt=Uy(c,f,te):(f==H||f==(E|H))&&!j.length?gt=Zp(c,f,b,M):gt=Xs.apply(n,ot);var Ct=Ve?jn:xo;return da(Ct(gt,ot),c,f)}function th(c,f,b,M){return c===n||Mo(c,$a[b])&&!jt.call(M,b)?f:c}function nh(c,f,b,M,j,Y){return bn(c)&&bn(f)&&(Y.set(f,c),li(c,f,n,nh,Y),Y.delete(f)),c}function $p(c){return Mh(c)?n:c}function zu(c,f,b,M,j,Y){var J=b&S,te=c.length,le=f.length;if(te!=le&&!(J&&le>te))return!1;var Me=Y.get(c),Ne=Y.get(f);if(Me&&Ne)return Me==f&&Ne==c;var Pe=-1,Ve=!0,ot=b&T?new Zi:n;for(Y.set(c,f),Y.set(f,c);++Pe<te;){var gt=c[Pe],Ct=f[Pe];if(M)var vt=J?M(Ct,gt,Pe,f,c,Y):M(gt,Ct,Pe,c,f,Y);if(vt!==n){if(vt)continue;Ve=!1;break}if(ot){if(!bf(f,function(Mt,Ft){if(!go(ot,Ft)&&(gt===Mt||j(gt,Mt,b,M,Y)))return ot.push(Ft)})){Ve=!1;break}}else if(!(gt===Ct||j(gt,Ct,b,M,Y))){Ve=!1;break}}return Y.delete(c),Y.delete(f),Ve}function Gp(c,f,b,M,j,Y,J){switch(b){case Nr:if(c.byteLength!=f.byteLength||c.byteOffset!=f.byteOffset)return!1;c=c.buffer,f=f.buffer;case Mr:return!(c.byteLength!=f.byteLength||!Y(new Ul(c),new Ul(f)));case _e:case it:case lt:return Mo(+c,+f);case Se:return c.name==f.name&&c.message==f.message;case rn:case an:return c==f+"";case $e:var te=ru;case At:var le=M&S;if(te||(te=Jo),c.size!=f.size&&!le)return!1;var Me=J.get(c);if(Me)return Me==f;M|=T,J.set(c,f);var Ne=zu(te(c),te(f),M,j,Y,J);return J.delete(c),Ne;case Sn:if(Vr)return Vr.call(c)==Vr.call(f)}return!1}function rh(c,f,b,M,j,Y){var J=b&S,te=Uu(c),le=te.length,Me=Uu(f),Ne=Me.length;if(le!=Ne&&!J)return!1;for(var Pe=le;Pe--;){var Ve=te[Pe];if(!(J?Ve in f:jt.call(f,Ve)))return!1}var ot=Y.get(c),gt=Y.get(f);if(ot&&gt)return ot==f&&gt==c;var Ct=!0;Y.set(c,f),Y.set(f,c);for(var vt=J;++Pe<le;){Ve=te[Pe];var Mt=c[Ve],Ft=f[Ve];if(M)var Ra=J?M(Ft,Mt,Ve,f,c,Y):M(Mt,Ft,Ve,c,f,Y);if(!(Ra===n?Mt===Ft||j(Mt,Ft,b,M,Y):Ra)){Ct=!1;break}vt||(vt=Ve=="constructor")}if(Ct&&!vt){var Kr=c.constructor,_a=f.constructor;Kr!=_a&&"constructor"in c&&"constructor"in f&&!(typeof Kr=="function"&&Kr instanceof Kr&&typeof _a=="function"&&_a instanceof _a)&&(Ct=!1)}return Y.delete(c),Y.delete(f),Ct}function no(c){return Gu(Wu(c,n,mc),c+"")}function Uu(c){return Tu(c,fr,el)}function cc(c){return Tu(c,ma,ro)}var uc=mu?function(c){return mu.get(c)}:p0;function dc(c){for(var f=c.name+"",b=Hs[f],M=jt.call(Hs,f)?b.length:0;M--;){var j=b[M],Y=j.func;if(Y==null||Y==c)return j.name}return f}function ui(c){var f=jt.call(B,"placeholder")?B:c;return f.placeholder}function ct(){var c=B.iteratee||h0;return c=c===h0?Xl:c,arguments.length?c(arguments[0],arguments[1]):c}function Vu(c,f){var b=c.__data__;return Xe(f)?b[typeof f=="string"?"string":"hash"]:b.map}function Zu(c){for(var f=fr(c),b=f.length;b--;){var M=f[b],j=c[M];f[b]=[M,j,nl(j)]}return f}function Eo(c,f){var b=As(c,f);return _f(b)?b:n}function qp(c){var f=jt.call(c,zi),b=c[zi];try{c[zi]=n;var M=!0}catch{}var j=Yl.call(c);return M&&(f?c[zi]=b:delete c[zi]),j}var el=du?function(c){return c==null?[]:(c=Zt(c),Go(du(c),function(f){return cu.call(c,f)}))}:g0,ro=du?function(c){for(var f=[];c;)qo(f,el(c)),c=Ca(c);return f}:g0,cr=ir;(Wl&&cr(new Wl(new ArrayBuffer(1)))!=Nr||Vi&&cr(new Vi)!=$e||$l&&cr($l.resolve())!=Et||Qo&&cr(new Qo)!=At||Gl&&cr(new Gl)!=vr)&&(cr=function(c){var f=ir(c),b=f==Dt?c.constructor:n,M=b?fi(b):"";if(M)switch(M){case Af:return Nr;case Xo:return $e;case xp:return Et;case Bs:return At;case Ga:return vr}return f});function Jp(c,f,b){for(var M=-1,j=b.length;++M<j;){var Y=b[M],J=Y.size;switch(Y.type){case"drop":c+=J;break;case"dropRight":f-=J;break;case"take":f=tr(f,c+J);break;case"takeRight":c=En(c,f-J);break}}return{start:c,end:f}}function ah(c){var f=c.match(Ta);return f?f[1].split(Ea):[]}function oh(c,f,b){f=So(f,c);for(var M=-1,j=f.length,Y=!1;++M<j;){var J=Pa(f[M]);if(!(Y=c!=null&&b(c,J)))break;c=c[J]}return Y||++M!=j?Y:(j=c==null?0:c.length,!!j&&vg(j)&&ua(J,j)&&(Tt(c)||wc(c)))}function Kp(c){var f=c.length,b=new c.constructor(f);return f&&typeof c[0]=="string"&&jt.call(c,"index")&&(b.index=c.index,b.input=c.input),b}function tl(c){return typeof c.constructor=="function"&&!fc(c)?Ys(Ca(c)):{}}function ur(c,f,b){var M=c.constructor;switch(f){case Mr:return Ks(c);case _e:case it:return new M(+c);case Nr:return Ru(c,b);case Ss:case mo:case po:case Nl:case Fi:case Pi:case Is:case Yo:case ji:return Gf(c,b);case $e:return new M;case lt:case an:return new M(c);case rn:return Hp(c);case At:return new M;case Sn:return $f(c)}}function Vy(c,f){var b=f.length;if(!b)return c;var M=b-1;return f[M]=(b>1?"& ":"")+f[M],f=f.join(b>2?", ":" "),c.replace(Ia,`{
/* [wrapped with `+f+`] */
`)}function Zy(c){return Tt(c)||wc(c)||!!(Ip&&c&&c[Ip])}function ua(c,f){var b=typeof c;return f=f??se,!!f&&(b=="number"||b!="symbol"&&Wm.test(c))&&c>-1&&c%1==0&&c<f}function Bt(c,f,b){if(!bn(b))return!1;var M=typeof f;return(M=="number"?ha(b)&&ua(f,b.length):M=="string"&&f in b)?Mo(b[f],c):!1}function ih(c,f){if(Tt(c))return!1;var b=typeof c;return b=="number"||b=="symbol"||b=="boolean"||c==null||La(c)?!0:na.test(c)||!yn.test(c)||f!=null&&c in Zt(f)}function Xe(c){var f=typeof c;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?c!=="__proto__":c===null}function di(c){var f=dc(c),b=B[f];if(typeof b!="function"||!(f in St.prototype))return!1;if(c===b)return!0;var M=uc(b);return!!M&&c===M[0]}function sh(c){return!!iu&&iu in c}var Qp=Ps?as:v0;function fc(c){var f=c&&c.constructor,b=typeof f=="function"&&f.prototype||$a;return c===b}function nl(c){return c===c&&!bn(c)}function hc(c,f){return function(b){return b==null?!1:b[c]===f&&(f!==n||c in Zt(b))}}function lh(c){var f=re(c,function(M){return b.size===m&&b.clear(),M}),b=f.cache;return f}function Xp(c,f){var b=c[1],M=f[1],j=b|M,Y=j<(E|A|L),J=M==L&&b==R||M==L&&b==z&&c[7].length<=f[8]||M==(L|z)&&f[7].length<=f[8]&&b==R;if(!(Y||J))return c;M&E&&(c[2]=f[2],j|=b&E?0:N);var te=f[3];if(te){var le=c[3];c[3]=le?Jf(le,te,f[4]):te,c[4]=le?aa(c[3],p):f[4]}return te=f[5],te&&(le=c[5],c[5]=le?_u(le,te,f[6]):te,c[6]=le?aa(c[5],p):f[6]),te=f[7],te&&(c[7]=te),M&L&&(c[8]=c[8]==null?f[8]:tr(c[8],f[8])),c[9]==null&&(c[9]=f[9]),c[0]=f[0],c[1]=j,c}function eg(c){var f=[];if(c!=null)for(var b in Zt(c))f.push(b);return f}function tg(c){return Yl.call(c)}function Wu(c,f,b){return f=En(f===n?c.length-1:f,0),function(){for(var M=arguments,j=-1,Y=En(M.length-f,0),J=pe(Y);++j<Y;)J[j]=M[f+j];j=-1;for(var te=pe(f+1);++j<f;)te[j]=M[j];return te[f]=b(J),br(c,this,te)}}function $u(c,f){return f.length<2?c:Wr(c,sr(f,0,-1))}function Gn(c,f){for(var b=c.length,M=tr(f.length,b),j=Ir(c);M--;){var Y=f[M];c[M]=ua(Y,b)?j[Y]:n}return c}function $r(c,f){if(!(f==="constructor"&&typeof c[f]=="function")&&f!="__proto__")return c[f]}var xo=ch(jn),rl=Nf||function(c,f){return sn.setTimeout(c,f)},Gu=ch(ku);function da(c,f,b){var M=f+"";return Gu(c,Vy(M,rg(ah(M),b)))}function ch(c){var f=0,b=0;return function(){var M=By(),j=ce-(M-b);if(b=M,j>0){if(++f>=ae)return arguments[0]}else f=0;return c.apply(n,arguments)}}function Gr(c,f){var b=-1,M=c.length,j=M-1;for(f=f===n?M:f;++b<f;){var Y=nc(b,j),J=c[Y];c[Y]=c[b],c[b]=J}return c.length=f,c}var ng=lh(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(Fn,function(b,M,j,Y){f.push(j?Y.replace(vy,"$1"):M||b)}),f});function Pa(c){if(typeof c=="string"||La(c))return c;var f=c+"";return f=="0"&&1/c==-Te?"-0":f}function fi(c){if(c!=null){try{return Bl.call(c)}catch{}try{return c+""}catch{}}return""}function rg(c,f){return er(De,function(b){var M="_."+b[0];f&b[1]&&!eu(c,M)&&c.push(M)}),c.sort()}function uh(c){if(c instanceof St)return c.clone();var f=new nr(c.__wrapped__,c.__chain__);return f.__actions__=Ir(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}function Wy(c,f,b){(b?Bt(c,f,b):f===n)?f=1:f=En(xt(f),0);var M=c==null?0:c.length;if(!M||f<1)return[];for(var j=0,Y=0,J=pe(Ui(M/f));j<M;)J[Y++]=sr(c,j,j+=f);return J}function qu(c){for(var f=-1,b=c==null?0:c.length,M=0,j=[];++f<b;){var Y=c[f];Y&&(j[M++]=Y)}return j}function dh(){var c=arguments.length;if(!c)return[];for(var f=pe(c-1),b=arguments[0],M=c;M--;)f[M-1]=arguments[M];return qo(Tt(b)?Ir(b):[b],Pn(f,1))}var fa=It(function(c,f){return Bn(c)?Xa(c,Pn(f,1,Bn,!0)):[]}),Ot=It(function(c,f){var b=Hn(f);return Bn(b)&&(b=n),Bn(c)?Xa(c,Pn(f,1,Bn,!0),ct(b,2)):[]}),Un=It(function(c,f){var b=Hn(f);return Bn(b)&&(b=n),Bn(c)?Xa(c,Pn(f,1,Bn,!0),n,b):[]});function xn(c,f,b){var M=c==null?0:c.length;return M?(f=b||f===n?1:xt(f),sr(c,f<0?0:f,M)):[]}function qn(c,f,b){var M=c==null?0:c.length;return M?(f=b||f===n?1:xt(f),f=M-f,sr(c,0,f<0?0:f)):[]}function qr(c,f){return c&&c.length?qs(c,ct(f,3),!0,!0):[]}function al(c,f){return c&&c.length?qs(c,ct(f,3),!0):[]}function _n(c,f,b,M){var j=c==null?0:c.length;return j?(b&&typeof b!="number"&&Bt(c,f,b)&&(b=0,M=j),Su(c,f,b,M)):[]}function ol(c,f,b){var M=c==null?0:c.length;if(!M)return-1;var j=b==null?0:xt(b);return j<0&&(j=En(M+j,0)),tu(c,ct(f,3),j)}function hi(c,f,b){var M=c==null?0:c.length;if(!M)return-1;var j=M-1;return b!==n&&(j=xt(b),j=b<0?En(M+j,0):tr(j,M-1)),tu(c,ct(f,3),j,!0)}function mc(c){var f=c==null?0:c.length;return f?Pn(c,1):[]}function fh(c){var f=c==null?0:c.length;return f?Pn(c,Te):[]}function pc(c,f){var b=c==null?0:c.length;return b?(f=f===n?1:xt(f),Pn(c,f)):[]}function jr(c){for(var f=-1,b=c==null?0:c.length,M={};++f<b;){var j=c[f];M[j[0]]=j[1]}return M}function Ju(c){return c&&c.length?c[0]:n}function il(c,f,b){var M=c==null?0:c.length;if(!M)return-1;var j=b==null?0:xt(b);return j<0&&(j=En(M+j,0)),ks(c,f,j)}function Co(c){var f=c==null?0:c.length;return f?sr(c,0,-1):[]}var Ku=It(function(c){var f=Gt(c,ju);return f.length&&f[0]===c[0]?Aa(f):[]}),hh=It(function(c){var f=Hn(c),b=Gt(c,ju);return f===Hn(b)?f=n:b.pop(),b.length&&b[0]===c[0]?Aa(b,ct(f,2)):[]}),mi=It(function(c){var f=Hn(c),b=Gt(c,ju);return f=typeof f=="function"?f:n,f&&b.pop(),b.length&&b[0]===c[0]?Aa(b,n,f):[]});function Qu(c,f){return c==null?"":fu.call(c,f)}function Hn(c){var f=c==null?0:c.length;return f?c[f-1]:n}function Xu(c,f,b){var M=c==null?0:c.length;if(!M)return-1;var j=M;return b!==n&&(j=xt(b),j=j<0?En(M+j,0):tr(j,M-1)),f===f?Ly(c,f,j):tu(c,cp,j,!0)}function gc(c,f){return c&&c.length?ci(c,xt(f)):n}var mh=It(vc);function vc(c,f){return c&&c.length&&f&&f.length?en(c,f):c}function ed(c,f,b){return c&&c.length&&f&&f.length?en(c,f,ct(b,2)):c}function Er(c,f,b){return c&&c.length&&f&&f.length?en(c,f,n,b):c}var pi=no(function(c,f){var b=c==null?0:c.length,M=Du(c,f);return tc(c,Gt(f,function(j){return ua(j,b)?+j:j}).sort(qf)),M});function ja(c,f){var b=[];if(!(c&&c.length))return b;var M=-1,j=[],Y=c.length;for(f=ct(f,3);++M<Y;){var J=c[M];f(J,M,c)&&(b.push(J),j.push(M))}return tc(c,j),b}function dr(c){return c==null?c:hu.call(c)}function ag(c,f,b){var M=c==null?0:c.length;return M?(b&&typeof b!="number"&&Bt(c,f,b)?(f=0,b=M):(f=f==null?0:xt(f),b=b===n?M:xt(b)),sr(c,f,b)):[]}function ph(c,f){return Ln(c,f)}function gh(c,f,b){return ac(c,f,ct(b,2))}function $y(c,f){var b=c==null?0:c.length;if(b){var M=Ln(c,f);if(M<b&&Mo(c[M],f))return M}return-1}function gi(c,f){return Ln(c,f,!0)}function og(c,f,b){return ac(c,f,ct(b,2),!0)}function vh(c,f){var b=c==null?0:c.length;if(b){var M=Ln(c,f,!0)-1;if(Mo(c[M],f))return M}return-1}function es(c){return c&&c.length?Au(c):[]}function yh(c,f){return c&&c.length?Au(c,ct(f,2)):[]}function ts(c){var f=c==null?0:c.length;return f?sr(c,1,f):[]}function ig(c,f,b){return c&&c.length?(f=b||f===n?1:xt(f),sr(c,0,f<0?0:f)):[]}function sg(c,f,b){var M=c==null?0:c.length;return M?(f=b||f===n?1:xt(f),f=M-f,sr(c,f<0?0:f,M)):[]}function wh(c,f){return c&&c.length?qs(c,ct(f,3),!1,!0):[]}function td(c,f){return c&&c.length?qs(c,ct(f,3)):[]}var Gy=It(function(c){return Rn(Pn(c,1,Bn,!0))}),qy=It(function(c){var f=Hn(c);return Bn(f)&&(f=n),Rn(Pn(c,1,Bn,!0),ct(f,2))}),lg=It(function(c){var f=Hn(c);return f=typeof f=="function"?f:n,Rn(Pn(c,1,Bn,!0),n,f)});function cg(c){return c&&c.length?Rn(c):[]}function ns(c,f){return c&&c.length?Rn(c,ct(f,2)):[]}function Jy(c,f){return f=typeof f=="function"?f:n,c&&c.length?Rn(c,n,f):[]}function vi(c){if(!(c&&c.length))return[];var f=0;return c=Go(c,function(b){if(Bn(b))return f=En(b.length,f),!0}),Tf(f,function(b){return Gt(c,Sf(b))})}function bh(c,f){if(!(c&&c.length))return[];var b=vi(c);return f==null?b:Gt(b,function(M){return br(f,n,M)})}var pn=It(function(c,f){return Bn(c)?Xa(c,f):[]}),Ky=It(function(c){return Pu(Go(c,Bn))}),ug=It(function(c){var f=Hn(c);return Bn(f)&&(f=n),Pu(Go(c,Bn),ct(f,2))}),Qy=It(function(c){var f=Hn(c);return f=typeof f=="function"?f:n,Pu(Go(c,Bn),n,f)}),Xy=It(vi);function dg(c,f){return Zf(c||[],f||[],Gi)}function fg(c,f){return Zf(c||[],f||[],un)}var e0=It(function(c){var f=c.length,b=f>1?c[f-1]:n;return b=typeof b=="function"?(c.pop(),b):n,bh(c,b)});function Jr(c){var f=B(c);return f.__chain__=!0,f}function Dh(c,f){return f(c),c}function nd(c,f){return f(c)}var yi=no(function(c){var f=c.length,b=f?c[0]:0,M=this.__wrapped__,j=function(Y){return Du(Y,c)};return f>1||this.__actions__.length||!(M instanceof St)||!ua(b)?this.thru(j):(M=M.slice(b,+b+(f?1:0)),M.__actions__.push({func:nd,args:[j],thisArg:n}),new nr(M,this.__chain__).thru(function(Y){return f&&!Y.length&&Y.push(n),Y}))});function rd(){return Jr(this)}function rs(){return new nr(this.value(),this.__chain__)}function ad(){this.__values__===n&&(this.__values__=bb(this.value()));var c=this.__index__>=this.__values__.length,f=c?n:this.__values__[this.__index__++];return{done:c,value:f}}function Sh(){return this}function Ih(c){for(var f,b=this;b instanceof qa;){var M=uh(b);M.__index__=0,M.__values__=n,f?j.__wrapped__=M:f=M;var j=M;b=b.__wrapped__}return j.__wrapped__=c,f}function t0(){var c=this.__wrapped__;if(c instanceof St){var f=c;return this.__actions__.length&&(f=new St(this)),f=f.reverse(),f.__actions__.push({func:nd,args:[dr],thisArg:n}),new nr(f,this.__chain__)}return this.thru(dr)}function Th(){return Vf(this.__wrapped__,this.__actions__)}var n0=oc(function(c,f,b){jt.call(c,b)?++c[b]:Qa(c,b,1)});function hg(c,f,b){var M=Tt(c)?vf:Na;return b&&Bt(c,f,b)&&(f=n),M(c,ct(f,3))}function mg(c,f){var b=Tt(c)?Go:Ji;return b(c,ct(f,3))}var od=Vp(ol),id=Vp(hi);function pg(c,f){return Pn(ud(c,f),1)}function Eh(c,f){return Pn(ud(c,f),Te)}function r0(c,f,b){return b=b===n?1:xt(b),Pn(ud(c,f),b)}function xh(c,f){var b=Tt(c)?er:eo;return b(c,ct(f,3))}function sd(c,f){var b=Tt(c)?Xc:Fp;return b(c,ct(f,3))}var ld=oc(function(c,f,b){jt.call(c,b)?c[b].push(f):Qa(c,b,[f])});function Ch(c,f,b,M){c=ha(c)?c:md(c),b=b&&!M?xt(b):0;var j=c.length;return b<0&&(b=En(j+b,0)),yg(c)?b<=j&&c.indexOf(f,b)>-1:!!j&&ks(c,f,b)>-1}var cd=It(function(c,f,b){var M=-1,j=typeof f=="function",Y=ha(c)?pe(c.length):[];return eo(c,function(J){Y[++M]=j?br(f,J,b):ii(J,f,b)}),Y}),gg=oc(function(c,f,b){Qa(c,b,f)});function ud(c,f){var b=Tt(c)?Gt:Bf;return b(c,ct(f,3))}function dd(c,f,b,M){return c==null?[]:(Tt(f)||(f=f==null?[]:[f]),b=M?n:b,Tt(b)||(b=b==null?[]:[b]),Nu(c,f,b))}var a0=oc(function(c,f,b){c[b?0:1].push(f)},function(){return[[],[]]});function yc(c,f,b){var M=Tt(c)?wf:dp,j=arguments.length<3;return M(c,ct(f,4),b,j,eo)}function o0(c,f,b){var M=Tt(c)?My:dp,j=arguments.length<3;return M(c,ct(f,4),b,j,Fp)}function fd(c,f){var b=Tt(c)?Go:Ji;return b(c,de(ct(f,3)))}function i(c){var f=Tt(c)?Ka:Ki;return f(c)}function l(c,f,b){(b?Bt(c,f,b):f===n)?f=1:f=xt(f);var M=Tt(c)?$i:cn;return M(c,f)}function h(c){var f=Tt(c)?Ap:rc;return f(c)}function v(c){if(c==null)return 0;if(ha(c))return yg(c)?Yi(c):c.length;var f=cr(c);return f==$e||f==At?c.size:Mu(c).length}function I(c,f,b){var M=Tt(c)?bf:Yy;return b&&Bt(c,f,b)&&(f=n),M(c,ct(f,3))}var C=It(function(c,f){if(c==null)return[];var b=f.length;return b>1&&Bt(c,f[0],f[1])?f=[]:b>2&&Bt(f[0],f[1],f[2])&&(f=[f[0]]),Nu(c,Pn(f,1),[])}),_=Kt||function(){return sn.Date.now()};function G(c,f){if(typeof f!="function")throw new oa(s);return c=xt(c),function(){if(--c<1)return f.apply(this,arguments)}}function ee(c,f,b){return f=b?n:f,f=c&&f==null?c.length:f,to(c,L,n,n,n,n,f)}function ye(c,f){var b;if(typeof f!="function")throw new oa(s);return c=xt(c),function(){return--c>0&&(b=f.apply(this,arguments)),c<=1&&(f=n),b}}var Fe=It(function(c,f,b){var M=E;if(b.length){var j=aa(b,ui(Fe));M|=H}return to(c,M,f,b,j)}),Le=It(function(c,f,b){var M=E|A;if(b.length){var j=aa(b,ui(Le));M|=H}return to(f,M,c,b,j)});function Oe(c,f,b){f=b?n:f;var M=to(c,R,n,n,n,n,n,f);return M.placeholder=Oe.placeholder,M}function qe(c,f,b){f=b?n:f;var M=to(c,F,n,n,n,n,n,f);return M.placeholder=qe.placeholder,M}function tt(c,f,b){var M,j,Y,J,te,le,Me=0,Ne=!1,Pe=!1,Ve=!0;if(typeof c!="function")throw new oa(s);f=ao(f)||0,bn(b)&&(Ne=!!b.leading,Pe="maxWait"in b,Y=Pe?En(ao(b.maxWait)||0,f):Y,Ve="trailing"in b?!!b.trailing:Ve);function ot(Yn){var No=M,is=j;return M=j=n,Me=Yn,J=c.apply(is,No),J}function gt(Yn){return Me=Yn,te=rl(Mt,f),Ne?ot(Yn):J}function Ct(Yn){var No=Yn-le,is=Yn-Me,Fb=f-No;return Pe?tr(Fb,Y-is):Fb}function vt(Yn){var No=Yn-le,is=Yn-Me;return le===n||No>=f||No<0||Pe&&is>=Y}function Mt(){var Yn=_();if(vt(Yn))return Ft(Yn);te=rl(Mt,Ct(Yn))}function Ft(Yn){return te=n,Ve&&M?ot(Yn):(M=j=n,J)}function Ra(){te!==n&&Js(te),Me=0,M=le=j=te=n}function Kr(){return te===n?J:Ft(_())}function _a(){var Yn=_(),No=vt(Yn);if(M=arguments,j=this,le=Yn,No){if(te===n)return gt(le);if(Pe)return Js(te),te=rl(Mt,f),ot(le)}return te===n&&(te=rl(Mt,f)),J}return _a.cancel=Ra,_a.flush=Kr,_a}var nt=It(function(c,f){return Pf(c,1,f)}),wn=It(function(c,f,b){return Pf(c,ao(f)||0,b)});function ue(c){return to(c,U)}function re(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new oa(s);var b=function(){var M=arguments,j=f?f.apply(this,M):M[0],Y=b.cache;if(Y.has(j))return Y.get(j);var J=c.apply(this,M);return b.cache=Y.set(j,J)||Y,J};return b.cache=new(re.Cache||ia),b}re.Cache=ia;function de(c){if(typeof c!="function")throw new oa(s);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}function He(c){return ye(2,c)}var at=_p(function(c,f){f=f.length==1&&Tt(f[0])?Gt(f[0],zr(ct())):Gt(Pn(f,1),zr(ct()));var b=f.length;return It(function(M){for(var j=-1,Y=tr(M.length,b);++j<Y;)M[j]=f[j].call(this,M[j]);return br(c,this,M)})}),ut=It(function(c,f){var b=aa(f,ui(ut));return to(c,H,n,f,b)}),dt=It(function(c,f){var b=aa(f,ui(dt));return to(c,P,n,f,b)}),yt=no(function(c,f){return to(c,z,n,n,n,f)});function Vn(c,f){if(typeof c!="function")throw new oa(s);return f=f===n?f:xt(f),It(c,f)}function Lt(c,f){if(typeof c!="function")throw new oa(s);return f=f==null?0:En(xt(f),0),It(function(b){var M=b[f],j=Io(b,0,f);return M&&qo(j,M),br(c,this,j)})}function wi(c,f,b){var M=!0,j=!0;if(typeof c!="function")throw new oa(s);return bn(b)&&(M="leading"in b?!!b.leading:M,j="trailing"in b?!!b.trailing:j),tt(c,f,{leading:M,maxWait:f,trailing:j})}function i0(c){return ee(c,1)}function xC(c,f){return ut(Lu(f),c)}function CC(){if(!arguments.length)return[];var c=arguments[0];return Tt(c)?c:[c]}function MC(c){return Pr(c,D)}function NC(c,f){return f=typeof f=="function"?f:n,Pr(c,D,f)}function kC(c){return Pr(c,g|D)}function AC(c,f){return f=typeof f=="function"?f:n,Pr(c,g|D,f)}function OC(c,f){return f==null||Jl(c,f,fr(f))}function Mo(c,f){return c===f||c!==c&&f!==f}var FC=lc(ka),PC=lc(function(c,f){return c>=f}),wc=Lf(function(){return arguments}())?Lf:function(c){return Cn(c)&&jt.call(c,"callee")&&!cu.call(c,"callee")},Tt=pe.isArray,jC=pf?zr(pf):Eu;function ha(c){return c!=null&&vg(c.length)&&!as(c)}function Bn(c){return Cn(c)&&ha(c)}function LC(c){return c===!0||c===!1||Cn(c)&&ir(c)==_e}var sl=kf||v0,RC=kr?zr(kr):jp;function _C(c){return Cn(c)&&c.nodeType===1&&!Mh(c)}function HC(c){if(c==null)return!0;if(ha(c)&&(Tt(c)||typeof c=="string"||typeof c.splice=="function"||sl(c)||hd(c)||wc(c)))return!c.length;var f=cr(c);if(f==$e||f==At)return!c.size;if(fc(c))return!Mu(c).length;for(var b in c)if(jt.call(c,b))return!1;return!0}function BC(c,f){return Zs(c,f)}function YC(c,f,b){b=typeof b=="function"?b:n;var M=b?b(c,f):n;return M===n?Zs(c,f,n,b):!!M}function s0(c){if(!Cn(c))return!1;var f=ir(c);return f==Se||f==Vt||typeof c.message=="string"&&typeof c.name=="string"&&!Mh(c)}function zC(c){return typeof c=="number"&&Ls(c)}function as(c){if(!bn(c))return!1;var f=ir(c);return f==Ue||f==Je||f==Be||f==$t}function gb(c){return typeof c=="number"&&c==xt(c)}function vg(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=se}function bn(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function Cn(c){return c!=null&&typeof c=="object"}var vb=Bi?zr(Bi):xu;function UC(c,f){return c===f||Cu(c,f,Zu(f))}function VC(c,f,b){return b=typeof b=="function"?b:n,Cu(c,f,Zu(f),b)}function ZC(c){return yb(c)&&c!=+c}function WC(c){if(Qp(c))throw new bt(o);return _f(c)}function $C(c){return c===null}function GC(c){return c==null}function yb(c){return typeof c=="number"||Cn(c)&&ir(c)==lt}function Mh(c){if(!Cn(c)||ir(c)!=Dt)return!1;var f=Ca(c);if(f===null)return!0;var b=jt.call(f,"constructor")&&f.constructor;return typeof b=="function"&&b instanceof b&&Bl.call(b)==su}var l0=Qc?zr(Qc):Lp;function qC(c){return gb(c)&&c>=-se&&c<=se}var wb=Ns?zr(Ns):Hf;function yg(c){return typeof c=="string"||!Tt(c)&&Cn(c)&&ir(c)==an}function La(c){return typeof c=="symbol"||Cn(c)&&ir(c)==Sn}var hd=ip?zr(ip):Ql;function JC(c){return c===n}function KC(c){return Cn(c)&&cr(c)==vr}function QC(c){return Cn(c)&&ir(c)==Sa}var XC=lc(si),eM=lc(function(c,f){return c<=f});function bb(c){if(!c)return[];if(ha(c))return yg(c)?Ur(c):Ir(c);if(wo&&c[wo])return Py(c[wo]());var f=cr(c),b=f==$e?ru:f==At?Jo:md;return b(c)}function os(c){if(!c)return c===0?c:0;if(c=ao(c),c===Te||c===-Te){var f=c<0?-1:1;return f*we}return c===c?c:0}function xt(c){var f=os(c),b=f%1;return f===f?b?f-b:f:0}function Db(c){return c?Do(xt(c),0,$):0}function ao(c){if(typeof c=="number")return c;if(La(c))return Z;if(bn(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=bn(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=fp(c);var b=yy.test(c);return b||Zm.test(c)?Jc(c.slice(2),b?2:8):Um.test(c)?Z:+c}function Sb(c){return Fa(c,ma(c))}function tM(c){return c?Do(xt(c),-se,se):c===0?c:0}function Wt(c){return c==null?"":mn(c)}var nM=Qs(function(c,f){if(fc(f)||ha(f)){Fa(f,fr(f),c);return}for(var b in f)jt.call(f,b)&&Gi(c,b,f[b])}),Ib=Qs(function(c,f){Fa(f,ma(f),c)}),wg=Qs(function(c,f,b,M){Fa(f,ma(f),c,M)}),rM=Qs(function(c,f,b,M){Fa(f,fr(f),c,M)}),aM=no(Du);function oM(c,f){var b=Ys(c);return f==null?b:Xt(b,f)}var iM=It(function(c,f){c=Zt(c);var b=-1,M=f.length,j=M>2?f[2]:n;for(j&&Bt(f[0],f[1],j)&&(M=1);++b<M;)for(var Y=f[b],J=ma(Y),te=-1,le=J.length;++te<le;){var Me=J[te],Ne=c[Me];(Ne===n||Mo(Ne,$a[Me])&&!jt.call(c,Me))&&(c[Me]=Y[Me])}return c}),sM=It(function(c){return c.push(n,nh),br(Tb,n,c)});function lM(c,f){return lp(c,ct(f,3),ca)}function cM(c,f){return lp(c,ct(f,3),ri)}function uM(c,f){return c==null?c:Kl(c,ct(f,3),ma)}function dM(c,f){return c==null?c:Iu(c,ct(f,3),ma)}function fM(c,f){return c&&ca(c,ct(f,3))}function hM(c,f){return c&&ri(c,ct(f,3))}function mM(c){return c==null?[]:Sr(c,fr(c))}function pM(c){return c==null?[]:Sr(c,ma(c))}function c0(c,f,b){var M=c==null?n:Wr(c,f);return M===n?b:M}function gM(c,f){return c!=null&&oh(c,f,ai)}function u0(c,f){return c!=null&&oh(c,f,jf)}var vM=Hu(function(c,f,b){f!=null&&typeof f.toString!="function"&&(f=Yl.call(f)),c[f]=b},f0(pa)),yM=Hu(function(c,f,b){f!=null&&typeof f.toString!="function"&&(f=Yl.call(f)),jt.call(c,f)?c[f].push(b):c[f]=[b]},ct),wM=It(ii);function fr(c){return ha(c)?Ja(c):Mu(c)}function ma(c){return ha(c)?Ja(c,!0):Rp(c)}function bM(c,f){var b={};return f=ct(f,3),ca(c,function(M,j,Y){Qa(b,f(M,j,Y),M)}),b}function DM(c,f){var b={};return f=ct(f,3),ca(c,function(M,j,Y){Qa(b,j,f(M,j,Y))}),b}var SM=Qs(function(c,f,b){li(c,f,b)}),Tb=Qs(function(c,f,b,M){li(c,f,b,M)}),IM=no(function(c,f){var b={};if(c==null)return b;var M=!1;f=Gt(f,function(Y){return Y=So(Y,c),M||(M=Y.length>1),Y}),Fa(c,cc(c),b),M&&(b=Pr(b,g|w|D,$p));for(var j=f.length;j--;)Qi(b,f[j]);return b});function TM(c,f){return Eb(c,de(ct(f)))}var EM=no(function(c,f){return c==null?{}:$s(c,f)});function Eb(c,f){if(c==null)return{};var b=Gt(cc(c),function(M){return[M]});return f=ct(f),Yf(c,b,function(M,j){return f(M,j[0])})}function xM(c,f,b){f=So(f,c);var M=-1,j=f.length;for(j||(j=1,c=n);++M<j;){var Y=c==null?n:c[Pa(f[M])];Y===n&&(M=j,Y=b),c=as(Y)?Y.call(c):Y}return c}function CM(c,f,b){return c==null?c:un(c,f,b)}function MM(c,f,b,M){return M=typeof M=="function"?M:n,c==null?c:un(c,f,b,M)}var xb=eh(fr),Cb=eh(ma);function NM(c,f,b){var M=Tt(c),j=M||sl(c)||hd(c);if(f=ct(f,4),b==null){var Y=c&&c.constructor;j?b=M?new Y:[]:bn(c)?b=as(Y)?Ys(Ca(c)):{}:b={}}return(j?er:ca)(c,function(J,te,le){return f(b,J,te,le)}),b}function kM(c,f){return c==null?!0:Qi(c,f)}function AM(c,f,b){return c==null?c:Fu(c,f,Lu(b))}function OM(c,f,b,M){return M=typeof M=="function"?M:n,c==null?c:Fu(c,f,Lu(b),M)}function md(c){return c==null?[]:_l(c,fr(c))}function FM(c){return c==null?[]:_l(c,ma(c))}function PM(c,f,b){return b===n&&(b=f,f=n),b!==n&&(b=ao(b),b=b===b?b:0),f!==n&&(f=ao(f),f=f===f?f:0),Do(ao(c),f,b)}function jM(c,f,b){return f=os(f),b===n?(b=f,f=0):b=os(b),c=ao(c),Pp(c,f,b)}function LM(c,f,b){if(b&&typeof b!="boolean"&&Bt(c,f,b)&&(f=b=n),b===n&&(typeof f=="boolean"?(b=f,f=n):typeof c=="boolean"&&(b=c,c=n)),c===n&&f===n?(c=0,f=1):(c=os(c),f===n?(f=c,c=0):f=os(f)),c>f){var M=c;c=f,f=M}if(b||c%1||f%1){var j=Zl();return tr(c+j*(f-c+hf("1e-"+((j+"").length-1))),f)}return nc(c,f)}var RM=To(function(c,f,b){return f=f.toLowerCase(),c+(b?Mb(f):f)});function Mb(c){return d0(Wt(c).toLowerCase())}function Nb(c){return c=Wt(c),c&&c.replace($m,pp).replace(np,"")}function _M(c,f,b){c=Wt(c),f=mn(f);var M=c.length;b=b===n?M:Do(xt(b),0,M);var j=b;return b-=f.length,b>=0&&c.slice(b,j)==f}function HM(c){return c=Wt(c),c&&ze.test(c)?c.replace(je,gp):c}function BM(c){return c=Wt(c),c&&ra.test(c)?c.replace(yr,"\\$&"):c}var YM=To(function(c,f,b){return c+(b?"-":"")+f.toLowerCase()}),zM=To(function(c,f,b){return c+(b?" ":"")+f.toLowerCase()}),UM=Qf("toLowerCase");function VM(c,f,b){c=Wt(c),f=xt(f);var M=f?Yi(c):0;if(!f||M>=f)return c;var j=(f-M)/2;return sc(Ko(j),b)+c+sc(Ui(j),b)}function ZM(c,f,b){c=Wt(c),f=xt(f);var M=f?Yi(c):0;return f&&M<f?c+sc(f-M,b):c}function WM(c,f,b){c=Wt(c),f=xt(f);var M=f?Yi(c):0;return f&&M<f?sc(f-M,b)+c:c}function $M(c,f,b){return b||f==null?f=0:f&&(f=+f),Ep(Wt(c).replace(kl,""),f||0)}function GM(c,f,b){return(b?Bt(c,f,b):f===n)?f=1:f=xt(f),Gs(Wt(c),f)}function qM(){var c=arguments,f=Wt(c[0]);return c.length<3?f:f.replace(c[1],c[2])}var JM=To(function(c,f,b){return c+(b?"_":"")+f.toLowerCase()});function KM(c,f,b){return b&&typeof b!="number"&&Bt(c,f,b)&&(f=b=n),b=b===n?$:b>>>0,b?(c=Wt(c),c&&(typeof f=="string"||f!=null&&!l0(f))&&(f=mn(f),!f&&Os(c))?Io(Ur(c),0,b):c.split(f,b)):[]}var QM=To(function(c,f,b){return c+(b?" ":"")+d0(f)});function XM(c,f,b){return c=Wt(c),b=b==null?0:Do(xt(b),0,c.length),f=mn(f),c.slice(b,b+f.length)==f}function e3(c,f,b){var M=B.templateSettings;b&&Bt(c,f,b)&&(f=n),c=Wt(c),f=wg({},f,M,th);var j=wg({},f.imports,M.imports,th),Y=fr(j),J=_l(j,Y),te,le,Me=0,Ne=f.interpolate||zc,Pe="__p += '",Ve=Hl((f.escape||zc).source+"|"+Ne.source+"|"+(Ne===On?Li:zc).source+"|"+(f.evaluate||zc).source+"|$","g"),ot="//# sourceURL="+(jt.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ey+"]")+`
`;c.replace(Ve,function(vt,Mt,Ft,Ra,Kr,_a){return Ft||(Ft=Ra),Pe+=c.slice(Me,_a).replace(wy,vp),Mt&&(te=!0,Pe+=`' +
__e(`+Mt+`) +
'`),Kr&&(le=!0,Pe+=`';
`+Kr+`;
__p += '`),Ft&&(Pe+=`' +
((__t = (`+Ft+`)) == null ? '' : __t) +
'`),Me=_a+vt.length,vt}),Pe+=`';
`;var gt=jt.call(f,"variable")&&f.variable;if(!gt)Pe=`with (obj) {
`+Pe+`
}
`;else if(Uo.test(gt))throw new bt(u);Pe=(le?Pe.replace(V,""):Pe).replace(ne,"$1").replace(me,"$1;"),Pe="function("+(gt||"obj")+`) {
`+(gt?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(te?", __e = _.escape":"")+(le?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Pe+`return __p
}`;var Ct=Ab(function(){return Pt(Y,ot+"return "+Pe).apply(n,J)});if(Ct.source=Pe,s0(Ct))throw Ct;return Ct}function t3(c){return Wt(c).toLowerCase()}function n3(c){return Wt(c).toUpperCase()}function r3(c,f,b){if(c=Wt(c),c&&(b||f===n))return fp(c);if(!c||!(f=mn(f)))return c;var M=Ur(c),j=Ur(f),Y=hp(M,j),J=Ef(M,j)+1;return Io(M,Y,J).join("")}function a3(c,f,b){if(c=Wt(c),c&&(b||f===n))return c.slice(0,ou(c)+1);if(!c||!(f=mn(f)))return c;var M=Ur(c),j=Ef(M,Ur(f))+1;return Io(M,0,j).join("")}function o3(c,f,b){if(c=Wt(c),c&&(b||f===n))return c.replace(kl,"");if(!c||!(f=mn(f)))return c;var M=Ur(c),j=hp(M,Ur(f));return Io(M,j).join("")}function i3(c,f){var b=W,M=K;if(bn(f)){var j="separator"in f?f.separator:j;b="length"in f?xt(f.length):b,M="omission"in f?mn(f.omission):M}c=Wt(c);var Y=c.length;if(Os(c)){var J=Ur(c);Y=J.length}if(b>=Y)return c;var te=b-Yi(M);if(te<1)return M;var le=J?Io(J,0,te).join(""):c.slice(0,te);if(j===n)return le+M;if(J&&(te+=le.length-te),l0(j)){if(c.slice(te).search(j)){var Me,Ne=le;for(j.global||(j=Hl(j.source,Wt(of.exec(j))+"g")),j.lastIndex=0;Me=j.exec(Ne);)var Pe=Me.index;le=le.slice(0,Pe===n?te:Pe)}}else if(c.indexOf(mn(j),te)!=te){var Ve=le.lastIndexOf(j);Ve>-1&&(le=le.slice(0,Ve))}return le+M}function s3(c){return c=Wt(c),c&&Ye.test(c)?c.replace(Ce,yp):c}var l3=To(function(c,f,b){return c+(b?" ":"")+f.toUpperCase()}),d0=Qf("toUpperCase");function kb(c,f,b){return c=Wt(c),f=b?n:f,f===n?Fy(c)?Ry(c):ky(c):c.match(f)||[]}var Ab=It(function(c,f){try{return br(c,n,f)}catch(b){return s0(b)?b:new bt(b)}}),c3=no(function(c,f){return er(f,function(b){b=Pa(b),Qa(c,b,Fe(c[b],c))}),c});function u3(c){var f=c==null?0:c.length,b=ct();return c=f?Gt(c,function(M){if(typeof M[1]!="function")throw new oa(s);return[b(M[0]),M[1]]}):[],It(function(M){for(var j=-1;++j<f;){var Y=c[j];if(br(Y[0],this,M))return br(Y[1],this,M)}})}function d3(c){return Op(Pr(c,g))}function f0(c){return function(){return c}}function f3(c,f){return c==null||c!==c?f:c}var h3=Xi(),m3=Xi(!0);function pa(c){return c}function h0(c){return Xl(typeof c=="function"?c:Pr(c,g))}function p3(c){return Ws(Pr(c,g))}function g3(c,f){return Oa(c,Pr(f,g))}var v3=It(function(c,f){return function(b){return ii(b,c,f)}}),y3=It(function(c,f){return function(b){return ii(c,b,f)}});function m0(c,f,b){var M=fr(f),j=Sr(f,M);b==null&&!(bn(f)&&(j.length||!M.length))&&(b=f,f=c,c=this,j=Sr(f,fr(f)));var Y=!(bn(b)&&"chain"in b)||!!b.chain,J=as(c);return er(j,function(te){var le=f[te];c[te]=le,J&&(c.prototype[te]=function(){var Me=this.__chain__;if(Y||Me){var Ne=c(this.__wrapped__),Pe=Ne.__actions__=Ir(this.__actions__);return Pe.push({func:le,args:arguments,thisArg:c}),Ne.__chain__=Me,Ne}return le.apply(c,qo([this.value()],arguments))})}),c}function w3(){return sn._===this&&(sn._=Dp),this}function p0(){}function b3(c){return c=xt(c),It(function(f){return ci(f,c)})}var D3=Yu(Gt),S3=Yu(vf),I3=Yu(bf);function Ob(c){return ih(c)?Sf(Pa(c)):zf(c)}function T3(c){return function(f){return c==null?n:Wr(c,f)}}var E3=Xf(),x3=Xf(!0);function g0(){return[]}function v0(){return!1}function C3(){return{}}function M3(){return""}function N3(){return!0}function k3(c,f){if(c=xt(c),c<1||c>se)return[];var b=$,M=tr(c,$);f=ct(f),c-=$;for(var j=Tf(M,f);++b<c;)f(b);return j}function A3(c){return Tt(c)?Gt(c,Pa):La(c)?[c]:Ir(ng(Wt(c)))}function O3(c){var f=++js;return Wt(c)+f}var F3=Bu(function(c,f){return c+f},0),P3=lr("ceil"),j3=Bu(function(c,f){return c/f},1),L3=lr("floor");function R3(c){return c&&c.length?qi(c,pa,ka):n}function _3(c,f){return c&&c.length?qi(c,ct(f,2),ka):n}function H3(c){return up(c,pa)}function B3(c,f){return up(c,ct(f,2))}function Y3(c){return c&&c.length?qi(c,pa,si):n}function z3(c,f){return c&&c.length?qi(c,ct(f,2),si):n}var U3=Bu(function(c,f){return c*f},1),V3=lr("round"),Z3=Bu(function(c,f){return c-f},0);function W3(c){return c&&c.length?If(c,pa):0}function $3(c,f){return c&&c.length?If(c,ct(f,2)):0}return B.after=G,B.ary=ee,B.assign=nM,B.assignIn=Ib,B.assignInWith=wg,B.assignWith=rM,B.at=aM,B.before=ye,B.bind=Fe,B.bindAll=c3,B.bindKey=Le,B.castArray=CC,B.chain=Jr,B.chunk=Wy,B.compact=qu,B.concat=dh,B.cond=u3,B.conforms=d3,B.constant=f0,B.countBy=n0,B.create=oM,B.curry=Oe,B.curryRight=qe,B.debounce=tt,B.defaults=iM,B.defaultsDeep=sM,B.defer=nt,B.delay=wn,B.difference=fa,B.differenceBy=Ot,B.differenceWith=Un,B.drop=xn,B.dropRight=qn,B.dropRightWhile=qr,B.dropWhile=al,B.fill=_n,B.filter=mg,B.flatMap=pg,B.flatMapDeep=Eh,B.flatMapDepth=r0,B.flatten=mc,B.flattenDeep=fh,B.flattenDepth=pc,B.flip=ue,B.flow=h3,B.flowRight=m3,B.fromPairs=jr,B.functions=mM,B.functionsIn=pM,B.groupBy=ld,B.initial=Co,B.intersection=Ku,B.intersectionBy=hh,B.intersectionWith=mi,B.invert=vM,B.invertBy=yM,B.invokeMap=cd,B.iteratee=h0,B.keyBy=gg,B.keys=fr,B.keysIn=ma,B.map=ud,B.mapKeys=bM,B.mapValues=DM,B.matches=p3,B.matchesProperty=g3,B.memoize=re,B.merge=SM,B.mergeWith=Tb,B.method=v3,B.methodOf=y3,B.mixin=m0,B.negate=de,B.nthArg=b3,B.omit=IM,B.omitBy=TM,B.once=He,B.orderBy=dd,B.over=D3,B.overArgs=at,B.overEvery=S3,B.overSome=I3,B.partial=ut,B.partialRight=dt,B.partition=a0,B.pick=EM,B.pickBy=Eb,B.property=Ob,B.propertyOf=T3,B.pull=mh,B.pullAll=vc,B.pullAllBy=ed,B.pullAllWith=Er,B.pullAt=pi,B.range=E3,B.rangeRight=x3,B.rearg=yt,B.reject=fd,B.remove=ja,B.rest=Vn,B.reverse=dr,B.sampleSize=l,B.set=CM,B.setWith=MM,B.shuffle=h,B.slice=ag,B.sortBy=C,B.sortedUniq=es,B.sortedUniqBy=yh,B.split=KM,B.spread=Lt,B.tail=ts,B.take=ig,B.takeRight=sg,B.takeRightWhile=wh,B.takeWhile=td,B.tap=Dh,B.throttle=wi,B.thru=nd,B.toArray=bb,B.toPairs=xb,B.toPairsIn=Cb,B.toPath=A3,B.toPlainObject=Sb,B.transform=NM,B.unary=i0,B.union=Gy,B.unionBy=qy,B.unionWith=lg,B.uniq=cg,B.uniqBy=ns,B.uniqWith=Jy,B.unset=kM,B.unzip=vi,B.unzipWith=bh,B.update=AM,B.updateWith=OM,B.values=md,B.valuesIn=FM,B.without=pn,B.words=kb,B.wrap=xC,B.xor=Ky,B.xorBy=ug,B.xorWith=Qy,B.zip=Xy,B.zipObject=dg,B.zipObjectDeep=fg,B.zipWith=e0,B.entries=xb,B.entriesIn=Cb,B.extend=Ib,B.extendWith=wg,m0(B,B),B.add=F3,B.attempt=Ab,B.camelCase=RM,B.capitalize=Mb,B.ceil=P3,B.clamp=PM,B.clone=MC,B.cloneDeep=kC,B.cloneDeepWith=AC,B.cloneWith=NC,B.conformsTo=OC,B.deburr=Nb,B.defaultTo=f3,B.divide=j3,B.endsWith=_M,B.eq=Mo,B.escape=HM,B.escapeRegExp=BM,B.every=hg,B.find=od,B.findIndex=ol,B.findKey=lM,B.findLast=id,B.findLastIndex=hi,B.findLastKey=cM,B.floor=L3,B.forEach=xh,B.forEachRight=sd,B.forIn=uM,B.forInRight=dM,B.forOwn=fM,B.forOwnRight=hM,B.get=c0,B.gt=FC,B.gte=PC,B.has=gM,B.hasIn=u0,B.head=Ju,B.identity=pa,B.includes=Ch,B.indexOf=il,B.inRange=jM,B.invoke=wM,B.isArguments=wc,B.isArray=Tt,B.isArrayBuffer=jC,B.isArrayLike=ha,B.isArrayLikeObject=Bn,B.isBoolean=LC,B.isBuffer=sl,B.isDate=RC,B.isElement=_C,B.isEmpty=HC,B.isEqual=BC,B.isEqualWith=YC,B.isError=s0,B.isFinite=zC,B.isFunction=as,B.isInteger=gb,B.isLength=vg,B.isMap=vb,B.isMatch=UC,B.isMatchWith=VC,B.isNaN=ZC,B.isNative=WC,B.isNil=GC,B.isNull=$C,B.isNumber=yb,B.isObject=bn,B.isObjectLike=Cn,B.isPlainObject=Mh,B.isRegExp=l0,B.isSafeInteger=qC,B.isSet=wb,B.isString=yg,B.isSymbol=La,B.isTypedArray=hd,B.isUndefined=JC,B.isWeakMap=KC,B.isWeakSet=QC,B.join=Qu,B.kebabCase=YM,B.last=Hn,B.lastIndexOf=Xu,B.lowerCase=zM,B.lowerFirst=UM,B.lt=XC,B.lte=eM,B.max=R3,B.maxBy=_3,B.mean=H3,B.meanBy=B3,B.min=Y3,B.minBy=z3,B.stubArray=g0,B.stubFalse=v0,B.stubObject=C3,B.stubString=M3,B.stubTrue=N3,B.multiply=U3,B.nth=gc,B.noConflict=w3,B.noop=p0,B.now=_,B.pad=VM,B.padEnd=ZM,B.padStart=WM,B.parseInt=$M,B.random=LM,B.reduce=yc,B.reduceRight=o0,B.repeat=GM,B.replace=qM,B.result=xM,B.round=V3,B.runInContext=oe,B.sample=i,B.size=v,B.snakeCase=JM,B.some=I,B.sortedIndex=ph,B.sortedIndexBy=gh,B.sortedIndexOf=$y,B.sortedLastIndex=gi,B.sortedLastIndexBy=og,B.sortedLastIndexOf=vh,B.startCase=QM,B.startsWith=XM,B.subtract=Z3,B.sum=W3,B.sumBy=$3,B.template=e3,B.times=k3,B.toFinite=os,B.toInteger=xt,B.toLength=Db,B.toLower=t3,B.toNumber=ao,B.toSafeInteger=tM,B.toString=Wt,B.toUpper=n3,B.trim=r3,B.trimEnd=a3,B.trimStart=o3,B.truncate=i3,B.unescape=s3,B.uniqueId=O3,B.upperCase=l3,B.upperFirst=d0,B.each=xh,B.eachRight=sd,B.first=Ju,m0(B,function(){var c={};return ca(B,function(f,b){jt.call(B.prototype,b)||(c[b]=f)}),c}(),{chain:!1}),B.VERSION=r,er(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){B[c].placeholder=B}),er(["drop","take"],function(c,f){St.prototype[c]=function(b){b=b===n?1:En(xt(b),0);var M=this.__filtered__&&!f?new St(this):this.clone();return M.__filtered__?M.__takeCount__=tr(b,M.__takeCount__):M.__views__.push({size:tr(b,$),type:c+(M.__dir__<0?"Right":"")}),M},St.prototype[c+"Right"]=function(b){return this.reverse()[c](b).reverse()}}),er(["filter","map","takeWhile"],function(c,f){var b=f+1,M=b==fe||b==ge;St.prototype[c]=function(j){var Y=this.clone();return Y.__iteratees__.push({iteratee:ct(j,3),type:b}),Y.__filtered__=Y.__filtered__||M,Y}}),er(["head","last"],function(c,f){var b="take"+(f?"Right":"");St.prototype[c]=function(){return this[b](1).value()[0]}}),er(["initial","tail"],function(c,f){var b="drop"+(f?"":"Right");St.prototype[c]=function(){return this.__filtered__?new St(this):this[b](1)}}),St.prototype.compact=function(){return this.filter(pa)},St.prototype.find=function(c){return this.filter(c).head()},St.prototype.findLast=function(c){return this.reverse().find(c)},St.prototype.invokeMap=It(function(c,f){return typeof c=="function"?new St(this):this.map(function(b){return ii(b,c,f)})}),St.prototype.reject=function(c){return this.filter(de(ct(c)))},St.prototype.slice=function(c,f){c=xt(c);var b=this;return b.__filtered__&&(c>0||f<0)?new St(b):(c<0?b=b.takeRight(-c):c&&(b=b.drop(c)),f!==n&&(f=xt(f),b=f<0?b.dropRight(-f):b.take(f-c)),b)},St.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},St.prototype.toArray=function(){return this.take($)},ca(St.prototype,function(c,f){var b=/^(?:filter|find|map|reject)|While$/.test(f),M=/^(?:head|last)$/.test(f),j=B[M?"take"+(f=="last"?"Right":""):f],Y=M||/^find/.test(f);j&&(B.prototype[f]=function(){var J=this.__wrapped__,te=M?[1]:arguments,le=J instanceof St,Me=te[0],Ne=le||Tt(J),Pe=function(Mt){var Ft=j.apply(B,qo([Mt],te));return M&&Ve?Ft[0]:Ft};Ne&&b&&typeof Me=="function"&&Me.length!=1&&(le=Ne=!1);var Ve=this.__chain__,ot=!!this.__actions__.length,gt=Y&&!Ve,Ct=le&&!ot;if(!Y&&Ne){J=Ct?J:new St(this);var vt=c.apply(J,te);return vt.__actions__.push({func:nd,args:[Pe],thisArg:n}),new nr(vt,Ve)}return gt&&Ct?c.apply(this,te):(vt=this.thru(Pe),gt?M?vt.value()[0]:vt.value():vt)})}),er(["pop","push","shift","sort","splice","unshift"],function(c){var f=vo[c],b=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",M=/^(?:pop|shift)$/.test(c);B.prototype[c]=function(){var j=arguments;if(M&&!this.__chain__){var Y=this.value();return f.apply(Tt(Y)?Y:[],j)}return this[b](function(J){return f.apply(Tt(J)?J:[],j)})}}),ca(St.prototype,function(c,f){var b=B[f];if(b){var M=b.name+"";jt.call(Hs,M)||(Hs[M]=[]),Hs[M].push({name:f,func:b})}}),Hs[Xs(n,A).name]=[{name:"wrapper",func:n}],St.prototype.clone=gu,St.prototype.reverse=Of,St.prototype.value=zs,B.prototype.at=yi,B.prototype.chain=rd,B.prototype.commit=rs,B.prototype.next=ad,B.prototype.plant=Ih,B.prototype.reverse=t0,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=Th,B.prototype.first=B.prototype.head,wo&&(B.prototype[wo]=Sh),B},Fs=_y();Wa?((Wa.exports=Fs)._=Fs,Rl._=Fs):sn._=Fs}).call(Jn)})(nv,nv.exports);var EI=nv.exports;function bg(e){const t=e.match(/^#+/);return t?t[0].length:0}function CN(e,t){const n=e.split(`
`);let r="",a=[],o=!1,s=1;for(let u=0;u<n.length;u++){const d=n[u];if(d.startsWith("#")){if(o&&bg(d)<=bg(t))break;r=d,r===t?(o=!0,s=u+1):o&&bg(d)>bg(t)?a.push(d):(o=!1,a=[])}else o&&a.push(d)}return t?EI.isEmpty(a)?{content:"",startLine:-1}:{content:a.join(`
`),startLine:s}:{content:e,startLine:0}}function MN(e){const t=e.split(/\r?\n/),n=[];for(let r=0;r<t.length;r++)new RegExp(fN).test(t[r])&&n.push({line:t[r],index:r+1});return n}async function NN(e,t){let n=t.vault.getAbstractFileByPath(e);return n||(new x.Notice(k("File not found for the given thino path, is creating a new file")),n=await t.vault.create(e,'{"nodes": [], "edges": []}'),Qe.setChangedByMemos(!0)),n}async function kN(e,t){let n;try{n=await t.vault.read(e)}catch(a){console.error(a),n=await t.vault.cachedRead(e)}const r=n.split(/---\n/);return r.length<3?n:r[2].trim()}function AN(e){const t=e.split(/\r?\n/),n=[];let r="",a=[],o=0;for(let s=0;s<t.length;s++){const u=t[s];u.startsWith("#")?(r&&n.push({header:r,content:a.join(`
`).trim(),pos:{start:o,end:s-1}}),r=u,a=[],o=s):a.push(u)}return r&&n.push({header:r,content:a.join(`
`).trim(),pos:{start:o,end:t.length-1}}),n}function ON(e){const t=e.split(/\r?\n/),n=[];let r=!1,a=[],o="";for(let s=0;s<t.length;s++){const u=t[s];u.startsWith("> [!thino]")?(r&&(n.push({metadata:o,content:a.join(`
`).trim()}),a=[]),r=!0,o=u.replace("> [!thino]","").trim()):r&&u.startsWith(">")?a.push(u.replace(/^> /,"")):r&&!u.startsWith(">")&&(r=!1,n.push({metadata:o,content:a.join(`
`).trim()}),a=[],o="")}return r&&n.push({metadata:o,content:a.join(`
`).trim()}),n}const FN=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 PN(e,t){if(!t)return 0;const{vault:n}=Ee.getState().dailyNotesState.app,r=e==null?void 0:e.DefaultMemoComposition,a=(e==null?void 0:e.ProcessEntriesBelow)||"";let o;try{o=await n.read(t)}catch(g){console.error(g),o=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}(\\:\\d{2})?)?").replace(/ {CONTENT}/g,""):s="(-|\\*) (\\[(.{1})\\]\\s)?((\\<time\\>)?\\d{1,2}\\:\\d{2}(\\:\\d{2})?)?";const u=new RegExp(s,"g"),d=(o.match(u)||[]).length,m=new RegExp(a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g"),p=(o.match(m)||[]).length;return o=null,p?d:0}function jN(e){return e.replace(/^(-|\*|\d\.) (\d{1,2}:\d{2}(:\d{2})?)\s(.*)$/g,"$4")}function LN(e,t){return RN(e,t)}const RN=(e,t)=>{var a;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?(.*)$",(a=new RegExp(n,"").exec(t))==null?void 0:a[8]},_N=(e,t)=>{var a;let n;e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)$"):n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)$";const r=new RegExp(n,"");return t.includes("42:22"),(a=r.exec(t))==null?void 0:a[6]},HN=(e,t)=>{var a;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)$"):n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)$",(a=new RegExp(n,"").exec(t))==null?void 0:a[7]},BN=e=>{var r;const t="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\d{1,2})\\:(\\d{2})\\:(\\d{2})(.*)$";return(r=new RegExp(t,"").exec(e))==null?void 0:r[7]},YN=e=>{var t;return(t=/^\s*[\-\*]\s(\[(.{1})\])\s(.*)$/.exec(e))==null?void 0:t[2]},xI=()=>vI()?!0:(new x.Notice(k("Check if you opened Daily Notes Plugin Or Periodic Notes Plugin")),!1);async function CI(e,t){if(!e)return t;const n=Ee.getState().dailyNotesState.app,r=await kN(e,n);if(!r.trim())return t;let a=x.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss");await n.fileManager.processFrontMatter(e,o=>{if(!o)return t;const s=!!o.pinned,u=o.rowStatus&&o.rowStatus==="ARCHIVED",d=!!o.deletedAt;o.createdAt&&(a=x.moment(o.createdAt,"YYYY/MM/DD HH:mm:ss").isValid()?o.createdAt:a);const m=o.deletedAt?o.deletedAt:"",p=o.visibility?o.visibility:"PRIVATE",g=o.thinoType?o.thinoType:"JOURNAL",w=o.webId?o.webId:"";o.id||(o.id=Re.randomId(16));const D=o.id?o.id:"",S=o.hasId?o.hasId:"",T=o.linkId?o.linkId:"",E=e.path,A="Memo",N="MULTI",R=[];return t.push({id:D,content:r,createdAt:a,updatedAt:a,deletedAt:d?x.moment(m,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:s,rowStatus:u?"ARCHIVED":"NORMAL",visibility:p,thinoType:g,hasId:S,linkId:T,path:E,creatorName:A,sourceType:N,resourceList:R,webId:w}),t})}async function mw(e,t){var D,S,T,E,A,N;if(!e)return t;const{vault:n}=Ee.getState().dailyNotesState.app;let r;try{r=await n.read(e)}catch(R){console.error(R),r=await n.cachedRead(e)}if(!r)return;const a=x.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss"),o=x.moment(e.stat.mtime).format("YYYY/MM/DD HH:mm:ss"),s=e.path,u="Thino",d="FILE",m="",p="",g=[],w=await AN(r);for(const R of w){const F=ON(R.content);for(const H of F){const P=H.metadata.match(/\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}/g);if(!P)continue;const L=(S=(D=H.metadata.match(/id::([^\]]*)/g))==null?void 0:D[0])==null?void 0:S.replace("id::","");if(!L)continue;const z=P?P[0]:a,U=P?P[0]:o,W=H.metadata.match(/webId::([^\]]*)/g)?(E=(T=H.metadata.match(/webId::([^\]]*)/g))==null?void 0:T[0])==null?void 0:E.replace("webId::",""):"",K=H.metadata.contains("[pinned::true]"),ae=H.metadata.contains("[archived::true]"),ce=H.metadata.contains("[deleted::"),fe=(A=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(H.metadata))==null?void 0:A[2],ie=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(H.metadata)?"PUBLIC":"PRIVATE",ge=(N=new RegExp(/\[(thinoType|THINOTYPE)::([^\]]*)\]/,"g").exec(H.metadata))==null?void 0:N[2];t.push({id:L,content:H.content,createdAt:z,updatedAt:U,deletedAt:ce?x.moment(fe,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:K,rowStatus:ae?"ARCHIVED":"NORMAL",visibility:ie,thinoType:ge||"JOURNAL",hasId:m,linkId:p,path:s,creatorName:u,sourceType:d,resourceList:g,webId:W})}}return t}async function pw(e,t){var g,w,D;if(!e)return[];const n=Ee.getState().dailyNotesState.settings,{vault:r}=Ee.getState().dailyNotesState.app;if(await PN(n,e)===0)return;const o=Zh(e,"day");let s,u;try{u=await r.read(e)}catch(S){console.error(S),u=await r.cachedRead(e)}const{content:d,startLine:m}=CN(u,n.ProcessEntriesBelow),p=MN(d);for(const S of p){const T=_N(n.DefaultMemoComposition,S.line),E=HN(n.DefaultMemoComposition,S.line),A=BN(S.line);let N=jN(S.line);if(o.hours(parseInt(T)),o.minutes(parseInt(E)),A&&o.seconds(parseInt(A)),!A&&o.seconds(0),/^\s*[-*]\s(\[(.)\])\s/g.test(S.line)){const K=YN(S.line);N=LN(n.DefaultMemoComposition,S.line),s=FN(K)}else s="JOURNAL";let R=N.replaceAll(/<br>/g,`
`);const F=new RegExp(/\[(pinned|PINNED)::true\]/,"g").test(N),H=new RegExp(/\[(archived|ARCHIVED)::true\]/,"g").test(N),P=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").test(N),L=(g=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(N))==null?void 0:g[2],z=(w=new RegExp(/\[(webId|WEBID)::([^\]]*)\]/,"g").exec(N))==null?void 0:w[2],U=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(N)?"PUBLIC":"PRIVATE",W=(D=new RegExp(/\s\^([0-9a-zA-Z-]+)$/).exec(N))==null?void 0:D[1];R=R.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:o.format("YYYYMMDDHHmmss")+`${S.index+m-1}`,content:R,createdAt:o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:o.format("YYYY/MM/DD HH:mm:ss"),thinoType:s,hasId:W||"",linkId:"",path:e.path,deletedAt:P?x.moment(L,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",rowStatus:H?"ARCHIVED":"NORMAL",visibility:U,pinned:F,creatorName:"Memo",resourceList:[],sourceType:"DAILY",webId:z})}}async function gw(e,t){const{app:n}=Ee.getState().dailyNotesState;if(!(e instanceof x.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 a=JSON.parse(r),o=a==null?void 0:a.nodes;for(const s of o){if(s.type==="group"||s.createdAt===void 0||s.text.trim()==="")continue;const u=x.moment(s==null?void 0:s.createdAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),d=x.moment(s==null?void 0:s.updatedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),m=s!=null&&s.deletedAt?x.moment(s==null?void 0:s.deletedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",p=!!(s!=null&&s.pinned),g=s!=null&&s.archived?"ARCHIVED":"NORMAL",w=s!=null&&s.visibility?s==null?void 0:s.visibility:"PRIVATE",D=s!=null&&s.thinoType?s==null?void 0:s.thinoType:"JOURNAL",S=s!=null&&s.text?s==null?void 0:s.text:"",T=s!=null&&s.id?s==null?void 0:s.id:"",E=s!=null&&s.hasId?s==null?void 0:s.hasId:"",A=s!=null&&s.linkId?s==null?void 0:s.linkId:"",N=e.path,R="Memo",F="CANVAS",H=[],P=s!=null&&s.webId?s==null?void 0:s.webId:void 0;t.push({id:T,content:S,createdAt:u,updatedAt:d,deletedAt:m,pinned:p,rowStatus:g,visibility:w,thinoType:D,hasId:E,linkId:A,path:N,creatorName:R,sourceType:F,resourceList:H,webId:P})}}async function Bb(e=[]){const t=[],n=[],r=Ee.getState().dailyNotesState.app,{vault:a}=r,{settings:o}=Ee.getState().dailyNotesState,s=r.loadLocalStorage("tokenForSync"),u=async(d,m)=>{for(const p of d)try{await m(p,t)}catch(g){console.error(g),new x.Notice(g)}};if(e.includes("CANVAS")){const d=zN(a);await u(d,gw)}if(e.includes("MULTI")){const d=UN(a,o);await u(d,CI)}if(e.includes("DAILY")){const d=await VN(a);await u(d,pw)}if(e.includes("FILE")||s){const d=ZN(a);await u(d,mw)}return{memos:t,commentMemos:n}}function zN(e){return e.getAllLoadedFiles().filter(t=>t instanceof x.TFile&&t.extension==="canvas"&&t.name.includes(".thino"))}function UN(e,t){return e.getMarkdownFiles().filter(n=>{var r;return n instanceof x.TFile&&((r=n.parent)==null?void 0:r.path.includes(t.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim()))})}async function VN(e){const t=DI();t===void 0&&new x.Notice(k("Please check your daily note plugin OR periodic notes plugin settings")+"folder path is empty or undefined"),e.getAbstractFileByPath(x.normalizePath(t))||new x.Notice(k("Failed to find daily notes folder"));const r=ws();return Object.values(r).filter(a=>a instanceof x.TFile&&a.extension==="md")}function ZN(e){return e.getMarkdownFiles().filter(t=>t instanceof x.TFile&&t.name.trim().includes("thino"))}const WN=async(e,t,n)=>{const r=await Bd(Ee.getState().dailyNotesState.app)||[],a=r.find(u=>u.id===e),o={...a,title:t,querystring:n},s=r.findIndex(u=>u.id===e);return r[s]=o,await bm(Ee.getState().dailyNotesState.app,r),[a]};function $N(e){return(e==null?void 0:e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"))||e}function GN(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 qN({content:e,isList:t}){const n=Ee.getState().dailyNotesState.settings,r=x.moment(),a=Re.randomId(16),o=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",s=`${o}/${r.format("YYYYMMDD")}-${a}.md`,u={id:a,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=rt.getState().app,{vault:m,fileManager:p}=d,g=m.getAbstractFileByPath(o);(!g||!(g instanceof x.TFolder))&&(new x.Notice(k("Folder not found for the given thino path, is creating a new folder")),await m.createFolder(o)),Qe.setChangedByMemos(!0);const w=await m.create(s,e);return await p.processFrontMatter(w,D=>{D.id=a,D.createdAt=r.format("YYYY/MM/DD HH:mm:ss"),D.updatedAt=r.format("YYYY/MM/DD HH:mm:ss"),D.thinoType=t?"JOURNAL":"TASK-TODO",D.pinned=!1,D.visibility="PUBLIC",D.rowStatus="NORMAL"}),u}async function JN({content:e,isList:t}){const n=Ee.getState().dailyNotesState.settings,r=x.moment(),a=Re.randomId(16),o=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",s={id:a,content:e,deletedAt:"",path:o,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"},u=rt.getState().app,{vault:d}=u;let m=d.getAbstractFileByPath(o);(!m||!(m instanceof x.TFile))&&(new x.Notice(k("File not found for the given thino path, is creating a new file")),m=await d.create(o,""));let p="";try{p=await d.read(m)||await d.cachedRead(m)}catch(A){console.error(A),new x.Notice(k("Failed to read current daily note, check if it exists."))}const g=p.indexOf(`# ${r.format("YYYY-MM-DD")}`);let w=p.indexOf(`
#`,g+1);w===-1&&(w=p.length);const D=`> [!thino] ${r.format("YYYY/MM/DD HH:mm:ss")} %% [id::${a}] [thinoType::${t?"JOURNAL":"TASK-TODO"}] %%`,S=e.replace(/\n/g,`
> `),T=`
${D}
> ${S}
`;let E;if(g===-1){const A=`# ${r.format("YYYY-MM-DD")}`;E=`${p.substring(0,w)}
${A}${T}
${p.substring(w)}`}else E=`${p.substring(0,w)}${T}${p.substring(w)}`;return setTimeout(async()=>{Qe.setChangedByMemos(!0),await d.modify(m,E)},200),s}async function Yb(e){const t=Ee.getState().dailyNotesState.settings,n=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),r=e.id,a=(t==null?void 0:t.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",o={id:r,content:e.content,deletedAt:e.deletedAt||"",path:a,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=rt.getState().app,{vault:u}=s;let d=u.getAbstractFileByPath(a);(!d||!(d instanceof x.TFile))&&(new x.Notice(k("File not found for the given thino path, is creating a new file")),d=await u.create(a,""));let m="";try{m=await u.read(d)||await u.cachedRead(d)}catch(E){console.error(E),new x.Notice(k("Failed to read current daily note, check if it exists."))}const p=m.indexOf(`# ${n.format("YYYY-MM-DD")}`);let g=m.indexOf(`
#`,p+1);g===-1&&(g=m.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}]`:""} %%`,D=e.content.replace(/\n/g,`
> `),S=`
${w}
> ${D}
`;let T;if(p===-1){const E=`# ${n.format("YYYY-MM-DD")}`;T=`${m.substring(0,g)}
${E}${S}
${m.substring(g)}`}else T=`${m.substring(0,g)}${S}${m.substring(g)}`;return Qe.setChangedByMemos(!0),await u.modify(d,T),o}async function KN({content:e,isList:t}){const n=Ee.getState().dailyNotesState.settings,r=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultCanvasPath)||"basic.thino.canvas",a=x.moment(),o=Re.randomId(16),s={id:o,content:e,deletedAt:"",path:r,createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.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"},u=rt.getState().app,{vault:d}=u,m=await NN(r,u);if(!m||!(m instanceof x.TFile)){new x.Notice(k("File not found for the given thino path, is creating a new file"));return}const p=await d.read(m),g=JSON.parse(p);if(g.nodes.find(E=>E.id===s.id))return;let D;g.nodes.length>0&&(D=[...g.nodes].reduce((E,A)=>{if(!E.createdAt)return A;const N=x.moment(E.createdAt,"YYYY/MM/DD HH:mm:ss"),R=x.moment(A.createdAt,"YYYY/MM/DD HH:mm:ss");return N.isAfter(R)?E:A}));const S=D?{x:D.x,y:D.y+100,width:D.width,height:D.height}:{x:0,y:0,width:200,height:100};g.nodes.push({...S,type:"text",id:o,text:e,deletedAt:"",createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[]}),Qe.setChangedByMemos(!0);const T=JSON.stringify(g,null,2);return await d.modify(m,T),s}async function zb(e,t,n){var N;const{vault:r}=Ee.getState().dailyNotesState.app||app,a=Ee.getState().dailyNotesState.settings,o=e.replace(/\n/g,"<br>"),s=n||x.moment(),u=s.format("HH"),d=s.format("mm"),m=`${u}:${d}`,p=t?"- ":"- [ ] ",g=a!=null&&a.DefaultMemoComposition?`${p}${(N=a==null?void 0:a.DefaultMemoComposition)==null?void 0:N.replace(/{TIME}/g,m).replace(/{CONTENT}/g,o)}`:`${p}${m} ${o}`,w=ws(),D=kv(s,w);let S;if(D?S=D:S=await Re.createDailyNoteCheck(s),!S){new x.Notice(k("Failed to create daily note, check if it exists."));return}D||await rt.fechLocalDailyNotes();let T="";try{T=await r.read(S)||await r.cachedRead(S)}catch(R){console.error(R),new x.Notice(k("Failed to read current daily note, check if it exists."))}const E=await MI(a==null?void 0:a.InsertAfter,g,T);n?await r.modify(S,E.content):setTimeout(async()=>{await r.modify(S,E.content)},200);const A=E.posNum===-1?NI(E.content).length-1:E.posNum+1;return Qe.setChangedByMemos(!0),{id:s.format("YYYYMMDDHHmm")+"00"+A,content:e,deletedAt:"",createdAt:s.format("YYYY/MM/DD HH:mm:ss"),updatedAt:s.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",path:S.path,hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"DAILY"}}async function QN(e){const{vault:t}=Ee.getState().dailyNotesState.app??app,{DefaultMemoComposition:n,InsertAfter:r}=Ee.getState().dailyNotesState.settings;let a=(e.pinned?" [pinned::true]":"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.visibility==="PRIVATE"?' [visibility::"PRIVATE"]':"");if(e.id){const R=" [webId::"+e.id+"]";a+=R}const o=x.moment();if(e.deletedAt){const R=" [deleted::"+o.format("YYYYMMDDHHmmss")+"]";a+=R}const s=e.content.replace(/\n/g,"<br>")+a,u=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),d=u.format("HH"),m=u.format("mm"),p=`${d}:${m}`,g=e.thinoType?"- [ ] ":"- ",w=n?`${g}${n==null?void 0:n.replace(/{TIME}/g,p).replace(/{CONTENT}/g,s)}`:`${g}${p} ${s}`,D=ws(),S=kv(u,D);let T;if(S?T=S:T=await Re.createDailyNoteCheck(u),!T){new x.Notice(k("Failed to create daily note, check if it exists."));return}S||await rt.fechLocalDailyNotes();let E="";try{E=await t.read(T)||await t.cachedRead(T)}catch(R){console.error(R),new x.Notice(k("Failed to read current daily note, check if it exists."))}const A=await MI(r,w,E);await t.modify(T,A.content);const N=A.posNum===-1?NI(A.content).length-1:A.posNum+1;return Qe.setChangedByMemos(!0),{id:u.format("YYYYMMDDHHmm")+"00"+N,content:e.content,deletedAt:e.deletedAt??"",createdAt:u.format("YYYY/MM/DD HH:mm:ss"),updatedAt:u.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType??"JOURNAL",path:T.path,hasId:"",linkId:"",pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY"}}async function MI(e,t,n){const r=new RegExp(`s*${await $N(e)}s*`),a=GN(n),o=a.findIndex(m=>r.test(m)),s=(e==null?void 0:e.trim())===""?!0:o===-1;s&&console.error("unable to find insert after line in file.");const u=a.slice(o+1).findIndex(m=>/^#+ |---/.test(m)),d=u!==-1;if(d){let m;for(let p=u+o;p>o;p--)if(!/^[\s\n ]*$/.test(a[p])){m=p;break}return m||(m=o),await Ub(t,n,s?-1:m,d)}else return await Ub(t,n,a.length-1,d)}async function Ub(e,t,n,r){if(n<-1)throw new Error("Invalid position");if(n===-1)return{content:`${t}
${e}`,posNum:-1};const a=t.split(`
`),o=a.slice(0,n+1).join(`
`),s=a.slice(n+1).join(`
`),u=s.trim().length>0;return{content:`${o}${!u&&!r||!o.endsWith(`
`)?`
`:""}${e}${(u||r?`
`:"")+s}`,posNum:n}}const NI=e=>e.split(/\r?\n/);async function XN(e){const t=Ee.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof x.TFile)){new x.Notice(k("File not found for the given thino path"));return}await t.vault.delete(n)}async function ek(e){const t=Ee.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof x.TFile)){new x.Notice(k("File not found for the given thino path"));return}const a=(await t.vault.read(n)).split(`
`),o=a.findIndex(d=>d.includes(e.id));if(o===-1){new x.Notice(k("Thino not found"));return}const s=a.findIndex((d,m)=>m>o&&d.trim()==="");s===-1?a.splice(o,a.length-o):a.splice(o,s-o);const u=a.join(`
`);if(!u){new x.Notice(k("Thino not found"));return}Qe.setChangedByMemos(!0),await t.vault.modify(n,u)}async function tk(e){const t=Ee.getState().dailyNotesState.app,n=t.metadataCache.getFirstLinkpathDest("",e.path);if(!n){new x.Notice(k("File not found for the given thino path"));return}const r=await t.vault.read(n),a=JSON.parse(r),o=a.nodes,s=o.findIndex(p=>p.id===e.id);if(s===-1){new x.Notice(k("Thino not found"));return}o.splice(s,1);const u=a.edges;u.filter(p=>p.fromNode===e.id||p.toNode===e.id).forEach(p=>{const g=u.findIndex(w=>w.id===p.id);g!==-1&&u.splice(g,1)}),Qe.setChangedByMemos(!0);const m=JSON.stringify(a,null,2);await t.vault.modify(n,m)}async function nk(e){xI()||new x.Notice(k("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}=Ee.getState().dailyNotesState.app,n=e.id.toString().slice(0,14),r=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(x.moment(n,"YYYYMMDDHHmmss"))?x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):x.moment(n,"YYYYMMDDHHmmss"),a=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(r,"day"),o=e.path,s=t.getAbstractFileByPath(o);if(!s){new x.Notice(k("Please check your daily note plugin OR periodic notes plugin settings"));return}const u=await t.read(s),d=u.split(`
`),m=a?x.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),p=d.findIndex(S=>S.includes(e.content.replace(/\n/g,"<br>").trim())&&S.includes(m)),g=parseInt(e.id.slice(14));let w=p;p===-1&&(w=g-1);const D=d[p]||d[g-1];if(!u){new x.Notice(k("Thino not found"));return}if(D===d[w]){Qe.setChangedByMemos(!0),d.splice(w,1),await t.modify(s,d.join(`
`));return}}async function rk(){const{vault:e,metadataCache:t}=Ee.getState().dailyNotesState.app,n=Ee.getState().dailyNotesState.settings,a=DI()+"/"+n.DeleteFileName+".md",o=[],s=t.getFirstLinkpathDest("",a);if(s instanceof x.TFile){let u=await e.read(s),d=ak(u);if(d.length===0)return o;for(let m=0;m<d.length;m++){const p=d[m];if(/- /.test(p)){const w=ok(p).slice(0,13),D=x.moment(w,"YYYYMMDDHHmmss"),S=sk(d[m]),T=x.moment(S.slice(0,13),"YYYYMMDDHHmmss"),E=ik(d[m]);o.push({id:S,content:E,user_id:1,createdAt:D.format("YYYY/MM/DD HH:mm:SS"),updatedAt:D.format("YYYY/MM/DD HH:mm:SS"),deletedAt:T})}else continue}d=null,u=null}return o}const ak=e=>e.split(/\r?\n/),ok=e=>{var t;return(t=/^- (\d{14})(\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[1]},ik=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[2]},sk=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[4]};async function lk(e){const t=await Bd(Ee.getState().dailyNotesState.app)||[],n=t.findIndex(r=>r.id===e);t.splice(n,1),await bm(Ee.getState().dailyNotesState.app,t)}const ck=async e=>{const{app:t}=Ee.getState().dailyNotesState,n=await Bd(t)||[],r=n.find(a=>a.id===e);if(r){const a=x.moment().format("YYYY/MM/DD HH:mm:ss");return r.pinnedAt=a,await bm(t,n),a}else{new x.Notice(k("Query not found"));return}},uk=async e=>{const{app:t}=Ee.getState().dailyNotesState,n=await Bd(t)||[],r=n.find(a=>a.id===e);if(r){r.pinnedAt="",await bm(t,n);return}else{new x.Notice(k("Query not found"));return}};function dk(e,t){const n=/%%(.*?)%%/,r=e.match(n);if(!r)return e;const a=r[1].trim(),o={};a.split(" ").forEach(u=>{const[d,m]=u.slice(1,-1).split("::");o[d]=m});for(const u of Object.keys(t))if(u!=="id"&&u!=="content"){if(u==="rowStatus"&&t.rowStatus==="ARCHIVED"){o.archived="true";continue}else if(u==="rowStatus"&&t.rowStatus==="NORMAL"){delete o.archived;continue}if(u==="deleted"&&t.deleted){const d=x.moment().format("YYYYMMDDHHmmss");o.deleted=d}else typeof t[u]=="boolean"?t[u]?o[u]="true":delete o[u]:t[u]&&(o[u]=t[u])}const s=Object.entries(o).map(([u,d])=>`[${u}::${d}]`).join(" ");return e.replace(n,`%% ${s} %%`)}async function Po(e,t){if(!e.sourceType||e.sourceType!=="MULTI")return e;const{vault:n,fileManager:r}=Ee.getState().dailyNotesState.app,a=n.getAbstractFileByPath(e.path);if(!a)return e;const o=x.moment();if(await r.processFrontMatter(a,s=>{(t.pinned||t.thinoType||t.rowStatus||t.visibility||t.deleted)&&Qe.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?o.format("YYYY/MM/DD HH:mm:ss"):""),s.createdAt||(s.createdAt=o.format("YYYY/MM/DD HH:mm:ss")),s.updatedAt=o.format("YYYY/MM/DD HH:mm:ss")}),t.content){const s=await n.read(a);let u=s;const d=t.content.replace(/\$/g,"$$$$");u=s.replace(e.content,d),await n.modify(a,u)}return Qe.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 Si(e,t){if(!e.sourceType||e.sourceType!=="FILE")return e;const{vault:n}=Ee.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const a=x.moment();let o="";try{o=await n.read(r)}catch(A){console.error(A),o=await n.cachedRead(r)}const s=o.split(/\r?\n/),u=s.findIndex(A=>A.includes(e.id)||e.webId&&A.includes(e.webId)),d=s[u];if(!d)return e;const m=dk(d,t);if(!d)return e;const p=m+`
`,g=s.findIndex((A,N)=>N>u&&A.trim()==="");let w="";g===-1&&(w=s.slice(u+1).join(`
`)),g!==-1&&(w=s.slice(u+1,g).join(`
`));let D=w;t!=null&&t.content&&(D=t.content.split(/\r?\n/).map(F=>"> "+F).join(`
`));const T=(p+D).split(/\r?\n/);s.splice(u,g?g-u:s.length-u,...T);const E=s.join(`
`);return await n.modify(r,E),Qe.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||a.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?a.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Ii(e,t){if(!e.sourceType||e.sourceType!=="CANVAS")return e;const{vault:n}=Ee.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const a=await n.read(r),o=JSON.parse(a),s=o.nodes.find(m=>m.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 u=x.moment();t.deleted!==void 0&&(s.deletedAt=t.deleted?u.format("YYYY/MM/DD HH:mm:ss"):""),s.updatedAt=u.format("YYYY/MM/DD HH:mm:ss");const d=JSON.stringify(o,null,2);return await n.modify(r,d),Qe.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?u.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Ti(e,t){xI()||new x.Notice(k("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}=Ee.getState().dailyNotesState.app,r=e.id.toString().slice(0,14),a=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(x.moment(r,"YYYYMMDDHHmmss"))?x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):x.moment(r,"YYYYMMDDHHmmss"),o=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(a,"day"),s=e.path,u=n.getAbstractFileByPath(s)||n.getAbstractFileByPath(e.path);if(!u)return new x.Notice(k("Please check your daily note plugin OR periodic notes plugin settings")),e;const m=(await n.read(u)).split(`
`),p=o?x.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 g,w,D;try{g=m.findIndex(A=>{const N=A.replace(/^(-|\*|\d\.|-\s\[.?\])\s\d{2}:\d{2}/,"").trim(),R=e.content.replace(/\n/g,"<br>").trim(),F=A.includes(p),H=N.includes(R);return F&&(H||N===R)}),D=!1,w=parseInt(e.id.slice(14))}catch(A){console.error(A)}let S=g!==-1&&g===w?g:w;g===-1&&(S=w,m[w-1]&&(D=!0));let T=m[w]||m[g];if(T=T.replace(/\s\^([0-9a-zA-Z-]+)$/g,""),!T)return new x.Notice(k("Thino not found")),e;if(t.content)if(D){const A=e.thinoType==="TASK-TODO"?"- [ ] ":e.thinoType==="TASK-DONE"?"- [x] ":e.thinoType.startsWith("TASK")?`- [${e.thinoType.slice(5)}] `:"- ",N=(e.pinned?" [pinned::true]":"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.visibility==="PUBLIC"?' [visibility::"PUBLIC"]':"");T=`${A}${p} ${t.content.trim()} ${N}`}else{const A=/^(((-|\*)|(\d\.)|(-\s\[.?\]))\s\d{2}:\d{2})/.exec(T)[1];T=T.replace(/^(((-|\*)|(\d\.)|(-\s\[.?\]))\s\d{2}:\d{2})/,"").replace(e.content.trim().replace(/\n/g,"<br>"),t.content.trim().replace(/\n/g,"<br>")).trim(),T=A+" "+T}if(t.thinoType){const A=t.thinoType==="TASK-TODO"?"- [ ] ":t.thinoType==="TASK-DONE"?"- [x] ":t.thinoType.startsWith("TASK")?`- [${t.thinoType.slice(5)}] `:"- ";T=T.replace(/^((- \[.\] )|((-|\*) ))/,A)}if(t.rowStatus){const A=t.rowStatus==="ARCHIVED"?"[archived::"+(t.rowStatus==="ARCHIVED"?"true":"false")+"]":"";T=T.includes("[archived::")?T.replace(/\[archived::(true|false)\]/,A):T+" "+A}if(t.visibility){const A='[visibility::"'+t.visibility+'"]';T=T.includes("[visibility::")?T.replace(/\[visibility::"(PUBLIC|PROTECTED)"\]/g,A):T+" "+A}if(t.pinned!==void 0){const A=t.pinned?"[pinned::"+(t.pinned?"true":"false")+"]":"";T=T.includes("[pinned::")?T.replace(/\[pinned::(true|false)\]/,t.pinned===!1?"":A):T+" "+A}if(t.webId!==void 0){const A="[webId::"+t.webId+"]";T=T.includes("[webId::")?T.replace(/\[webId::([^\]]+)\]/,t.webId===""?"":A):T+" "+A}const E=x.moment();if(t.deleted!==void 0){const A="[deleted::"+E.format("YYYYMMDDHHmmss")+"]";t.deleted?(T=T.replace(/\[deleted::([^\]]+)\]/,""),T=T+" "+A):t.deleted===!1&&(T=T.replace(/\[deleted::([^\]]+)\]/,""))}if(e.hasId){const A=" ^"+e.hasId;T=T.replace(/\s\^([0-9a-zA-Z-]+)$/g,"")+A}return T!==m[S]?(m.splice(S,1,T),await n.modify(u,m.join(`
`)),Qe.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?E.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}):e}const fk=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return Ii(e,{id:e.id,pinned:!0});case"DAILY":return Ti(e,{id:e.id,pinned:!0});case"MULTI":return Po(e,{id:e.id,pinned:!0});case"FILE":return Si(e,{id:e.id,pinned:!0})}},hk=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return Ii(e,{id:e.id,pinned:!1});case"DAILY":return Ti(e,{id:e.id,pinned:!1});case"MULTI":return Po(e,{id:e.id,pinned:!1});case"FILE":return Si(e,{id:e.id,pinned:!1})}};var vw;(e=>{async function t(T){return await Bb(T)}e.getMyMemos=t;async function n(T){return await Bb([T])}e.updateSpecificTypeMemo=n;function r(){return rk()}e.getMyDeletedMemos=r;function a(T){const E=Ie.getMemoById(T);if(E)switch(E==null?void 0:E.sourceType){case"DAILY":return Ti(E,{id:E.id,deleted:!1});case"CANVAS":return Ii(E,{id:E.id,deleted:!1});case"MULTI":return Po(E,{id:E.id,deleted:!1});case"FILE":return Si(E,{id:E.id,deleted:!1})}}e.restoreMemo=a;function o(T){return ek(T)}e.deleteMemoInSingleFile=o;function s(T){return XN(T)}e.deleteMemoInMultiFiles=s;function u(T){return nk(T)}e.deleteMemoInDailyNote=u;function d(T){return tk(T)}e.deleteMemoInCanvas=d;function m(){return TN()}e.getMyQueries=m;async function p(T,E){return await xN(T,E)}e.createQuery=p;function g(T,E,A){return WN(T,E,A)}e.updateQuery=g;function w(T){return lk(T)}e.deleteQueryById=w;function D(T){return ck(T)}e.pinQuery=D;function S(T){return uk(T)}e.unpinQuery=S})(vw||(vw={}));const va=vw;var bs={};Object.defineProperty(bs,"__esModule",{value:!0});class Hc extends Error{}class mk extends Hc{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class pk extends Hc{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class gk extends Hc{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Yh extends Hc{}class kI extends Hc{constructor(t){super(`Invalid unit ${t}`)}}class io extends Hc{}class ll extends Hc{constructor(){super("Zone is an abstract class")}}const Ze="numeric",Ro="short",Ya="long",rv={year:Ze,month:Ze,day:Ze},AI={year:Ze,month:Ro,day:Ze},vk={year:Ze,month:Ro,day:Ze,weekday:Ro},OI={year:Ze,month:Ya,day:Ze},FI={year:Ze,month:Ya,day:Ze,weekday:Ya},PI={hour:Ze,minute:Ze},jI={hour:Ze,minute:Ze,second:Ze},LI={hour:Ze,minute:Ze,second:Ze,timeZoneName:Ro},RI={hour:Ze,minute:Ze,second:Ze,timeZoneName:Ya},_I={hour:Ze,minute:Ze,hourCycle:"h23"},HI={hour:Ze,minute:Ze,second:Ze,hourCycle:"h23"},BI={hour:Ze,minute:Ze,second:Ze,hourCycle:"h23",timeZoneName:Ro},YI={hour:Ze,minute:Ze,second:Ze,hourCycle:"h23",timeZoneName:Ya},zI={year:Ze,month:Ze,day:Ze,hour:Ze,minute:Ze},UI={year:Ze,month:Ze,day:Ze,hour:Ze,minute:Ze,second:Ze},VI={year:Ze,month:Ro,day:Ze,hour:Ze,minute:Ze},ZI={year:Ze,month:Ro,day:Ze,hour:Ze,minute:Ze,second:Ze},yk={year:Ze,month:Ro,day:Ze,weekday:Ro,hour:Ze,minute:Ze},WI={year:Ze,month:Ya,day:Ze,hour:Ze,minute:Ze,timeZoneName:Ro},$I={year:Ze,month:Ya,day:Ze,hour:Ze,minute:Ze,second:Ze,timeZoneName:Ro},GI={year:Ze,month:Ya,day:Ze,weekday:Ya,hour:Ze,minute:Ze,timeZoneName:Ya},qI={year:Ze,month:Ya,day:Ze,weekday:Ya,hour:Ze,minute:Ze,second:Ze,timeZoneName:Ya};class Dm{get type(){throw new ll}get name(){throw new ll}get ianaName(){return this.name}get isUniversal(){throw new ll}offsetName(t,n){throw new ll}formatOffset(t,n){throw new ll}offset(t){throw new ll}equals(t){throw new ll}get isValid(){throw new ll}}let b0=null;class Ov extends Dm{static get instance(){return b0===null&&(b0=new Ov),b0}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return KI(t,n,r)}formatOffset(t,n){return $h(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Ug={};function wk(e){return Ug[e]||(Ug[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"})),Ug[e]}const bk={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Dk(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,o,s,u,d,m,p]=r;return[s,a,o,u,d,m,p]}function Sk(e,t){const n=e.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const{type:o,value:s}=n[a],u=bk[o];o==="era"?r[u]=s:Rt(u)||(r[u]=parseInt(s,10))}return r}let Dg={};class fs extends Dm{static create(t){return Dg[t]||(Dg[t]=new fs(t)),Dg[t]}static resetCache(){Dg={},Ug={}}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=fs.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return KI(t,n,r,this.name)}formatOffset(t,n){return $h(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=wk(this.name);let[a,o,s,u,d,m,p]=r.formatToParts?Sk(r,n):Dk(r,n);u==="BC"&&(a=-Math.abs(a)+1);const w=a1({year:a,month:o,day:s,hour:d===24?0:d,minute:m,second:p,millisecond:0});let D=+n;const S=D%1e3;return D-=S>=0?S:1e3+S,(w-D)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Vb={};function Ik(e,t={}){const n=JSON.stringify([e,t]);let r=Vb[n];return r||(r=new Intl.ListFormat(e,t),Vb[n]=r),r}let yw={};function ww(e,t={}){const n=JSON.stringify([e,t]);let r=yw[n];return r||(r=new Intl.DateTimeFormat(e,t),yw[n]=r),r}let bw={};function Tk(e,t={}){const n=JSON.stringify([e,t]);let r=bw[n];return r||(r=new Intl.NumberFormat(e,t),bw[n]=r),r}let Dw={};function Ek(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let o=Dw[a];return o||(o=new Intl.RelativeTimeFormat(e,t),Dw[a]=o),o}let zh=null;function xk(){return zh||(zh=new Intl.DateTimeFormat().resolvedOptions().locale,zh)}function Ck(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,a;try{r=ww(e).resolvedOptions(),a=e}catch{const d=e.substring(0,n);r=ww(d).resolvedOptions(),a=d}const{numberingSystem:o,calendar:s}=r;return[a,o,s]}}function Mk(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Nk(e){const t=[];for(let n=1;n<=12;n++){const r=st.utc(2016,n,1);t.push(e(r))}return t}function kk(e){const t=[];for(let n=1;n<=7;n++){const r=st.utc(2016,11,13+n);t.push(e(r))}return t}function Sg(e,t,n,r,a){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):a(t)}function Ak(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 Ok{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:a,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const u={useGrouping:!1,...r};r.padTo>0&&(u.minimumIntegerDigits=r.padTo),this.inf=Tk(t,u)}}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):r1(t,3);return Wn(n,this.padTo)}}}class Fk{constructor(t,n,r){this.opts=r;let a;if(t.zone.isUniversal){const s=-1*(t.offset/60),u=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&fs.create(u).valid?(a=u,this.dt=t):(a="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:st.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,a=t.zone.name);const o={...this.opts};o.timeZone=o.timeZone||a,this.dtf=ww(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Pk{constructor(t,n,r){this.opts={style:"long",...r},!n&&JI()&&(this.rtf=Ek(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Kk(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class hn{static fromOpts(t){return hn.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,a=!1){const o=t||Zn.defaultLocale,s=o||(a?"en-US":xk()),u=n||Zn.defaultNumberingSystem,d=r||Zn.defaultOutputCalendar;return new hn(s,u,d,o)}static resetCache(){zh=null,yw={},bw={},Dw={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return hn.create(t,n,r)}constructor(t,n,r,a){const[o,s,u]=Ck(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||u||null,this.intl=Mk(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ak(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:hn.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 Sg(this,t,r,eT,()=>{const a=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=Nk(s=>this.extract(s,a,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return Sg(this,t,r,rT,()=>{const a=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=kk(s=>this.extract(s,a,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Sg(this,void 0,t,()=>aT,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[st.utc(2016,11,13,9),st.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return Sg(this,t,n,oT,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[st.utc(-40,1,1),st.utc(2017,1,1)].map(a=>this.extract(a,r,"era"))),this.eraCache[t]})}extract(t,n,r){const a=this.dtFormatter(t,n),o=a.formatToParts(),s=o.find(u=>u.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new Ok(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new Fk(t,this.intl,n)}relFormatter(t={}){return new Pk(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Ik(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 Xr extends Dm{static get utcInstance(){return D0===null&&(D0=new Xr(0)),D0}static instance(t){return t===0?Xr.utcInstance:new Xr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Xr(Pv(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${$h(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${$h(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return $h(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 jk extends Dm{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 gl(e,t){if(Rt(e)||e===null)return t;if(e instanceof Dm)return e;if(Lk(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Ov.instance:n==="utc"||n==="gmt"?Xr.utcInstance:Xr.parseSpecifier(n)||fs.create(e)}else return Cc(e)?Xr.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new jk(e)}let Zb=()=>Date.now(),Wb="system",$b=null,Gb=null,qb=null,Jb=60,Kb;class Zn{static get now(){return Zb}static set now(t){Zb=t}static set defaultZone(t){Wb=t}static get defaultZone(){return gl(Wb,Ov.instance)}static get defaultLocale(){return $b}static set defaultLocale(t){$b=t}static get defaultNumberingSystem(){return Gb}static set defaultNumberingSystem(t){Gb=t}static get defaultOutputCalendar(){return qb}static set defaultOutputCalendar(t){qb=t}static get twoDigitCutoffYear(){return Jb}static set twoDigitCutoffYear(t){Jb=t%100}static get throwOnInvalid(){return Kb}static set throwOnInvalid(t){Kb=t}static resetCaches(){hn.resetCache(),fs.resetCache()}}function Rt(e){return typeof e>"u"}function Cc(e){return typeof e=="number"}function Fv(e){return typeof e=="number"&&e%1===0}function Lk(e){return typeof e=="string"}function Rk(e){return Object.prototype.toString.call(e)==="[object Date]"}function JI(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function _k(e){return Array.isArray(e)?e:[e]}function Qb(e,t,n){if(e.length!==0)return e.reduce((r,a)=>{const o=[t(a),a];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function Hk(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Nd(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ds(e,t,n){return Fv(e)&&e>=t&&e<=n}function Bk(e,t){return e-t*Math.floor(e/t)}function Wn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function pl(e){if(!(Rt(e)||e===null||e===""))return parseInt(e,10)}function bc(e){if(!(Rt(e)||e===null||e===""))return parseFloat(e)}function n1(e){if(!(Rt(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function r1(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Sm(e){return e%4===0&&(e%100!==0||e%400===0)}function Wh(e){return Sm(e)?366:365}function av(e,t){const n=Bk(t-1,12)+1,r=e+(t-n)/12;return n===2?Sm(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function a1(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 ov(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 Sw(e){return e>99?e:e>Zn.twoDigitCutoffYear?1900+e:2e3+e}function KI(e,t,n,r=null){const a=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},u=new Intl.DateTimeFormat(n,s).formatToParts(a).find(d=>d.type.toLowerCase()==="timezonename");return u?u.value:null}function Pv(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,a=n<0||Object.is(n,-0)?-r:r;return n*60+a}function QI(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new io(`Invalid unit value ${e}`);return t}function iv(e,t){const n={};for(const r in e)if(Nd(e,r)){const a=e[r];if(a==null)continue;n[t(r)]=QI(a)}return n}function $h(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${Wn(n,2)}:${Wn(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${Wn(n,2)}${Wn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function jv(e){return Hk(e,["hour","minute","second","millisecond"])}const Yk=["January","February","March","April","May","June","July","August","September","October","November","December"],XI=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],zk=["J","F","M","A","M","J","J","A","S","O","N","D"];function eT(e){switch(e){case"narrow":return[...zk];case"short":return[...XI];case"long":return[...Yk];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 tT=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],nT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Uk=["M","T","W","T","F","S","S"];function rT(e){switch(e){case"narrow":return[...Uk];case"short":return[...nT];case"long":return[...tT];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const aT=["AM","PM"],Vk=["Before Christ","Anno Domini"],Zk=["BC","AD"],Wk=["B","A"];function oT(e){switch(e){case"narrow":return[...Wk];case"short":return[...Zk];case"long":return[...Vk];default:return null}}function $k(e){return aT[e.hour<12?0:1]}function Gk(e,t){return rT(t)[e.weekday-1]}function qk(e,t){return eT(t)[e.month-1]}function Jk(e,t){return oT(t)[e.year<0?0:1]}function Kk(e,t,n="always",r=!1){const a={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."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const g=e==="days";switch(t){case 1:return g?"tomorrow":`next ${a[e][0]}`;case-1:return g?"yesterday":`last ${a[e][0]}`;case 0:return g?"today":`this ${a[e][0]}`}}const s=Object.is(t,-0)||t<0,u=Math.abs(t),d=u===1,m=a[e],p=r?d?m[1]:m[2]||m[1]:d?a[e][0]:e;return s?`${u} ${p} ago`:`in ${u} ${p}`}function Xb(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Qk={D:rv,DD:AI,DDD:OI,DDDD:FI,t:PI,tt:jI,ttt:LI,tttt:RI,T:_I,TT:HI,TTT:BI,TTTT:YI,f:zI,ff:VI,fff:WI,ffff:GI,F:UI,FF:ZI,FFF:$I,FFFF:qI};class Yr{static create(t,n={}){return new Yr(t,n)}static parseFormat(t){let n=null,r="",a=!1;const o=[];for(let s=0;s<t.length;s++){const u=t.charAt(s);u==="'"?(r.length>0&&o.push({literal:a,val:r}),n=null,r="",a=!a):a||u===n?r+=u:(r.length>0&&o.push({literal:!1,val:r}),r=u,n=u)}return r.length>0&&o.push({literal:a,val:r}),o}static macroTokenToFormatOpts(t){return Qk[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 Wn(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",a=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(D,S)=>this.loc.extract(t,D,S),s=D=>t.isOffsetFixed&&t.offset===0&&D.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,D.format):"",u=()=>r?$k(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),d=(D,S)=>r?qk(t,D):o(S?{month:D}:{month:D,day:"numeric"},"month"),m=(D,S)=>r?Gk(t,D):o(S?{weekday:D}:{weekday:D,month:"long",day:"numeric"},"weekday"),p=D=>{const S=Yr.macroTokenToFormatOpts(D);return S?this.formatWithSystemDefault(t,S):D},g=D=>r?Jk(t,D):o({era:D},"era"),w=D=>{switch(D){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 u();case"d":return a?o({day:"numeric"},"day"):this.num(t.day);case"dd":return a?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return m("short",!0);case"cccc":return m("long",!0);case"ccccc":return m("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return m("short",!1);case"EEEE":return m("long",!1);case"EEEEE":return m("narrow",!1);case"L":return a?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return a?o({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 a?o({month:"numeric"},"month"):this.num(t.month);case"MM":return a?o({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 a?o({year:"numeric"},"year"):this.num(t.year);case"yy":return a?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return a?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return a?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return g("short");case"GG":return g("long");case"GGGGG":return g("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 p(D)}};return Xb(Yr.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}},a=d=>m=>{const p=r(m);return p?this.num(d.get(p),m.length):m},o=Yr.parseFormat(n),s=o.reduce((d,{literal:m,val:p})=>m?d:d.concat(p),[]),u=t.shiftTo(...s.map(r).filter(d=>d));return Xb(o,a(u))}}class jo{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const iT=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Yd(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function zd(...e){return t=>e.reduce(([n,r,a],o)=>{const[s,u,d]=o(t,a);return[{...n,...s},u||r,d]},[{},null,1]).slice(0,2)}function Ud(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const a=n.exec(e);if(a)return r(a)}return[null,null]}function sT(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=pl(t[n+a]);return[r,null,n+a]}}const lT=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Xk=`(?:${lT.source}?(?:\\[(${iT.source})\\])?)?`,o1=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,cT=RegExp(`${o1.source}${Xk}`),i1=RegExp(`(?:T${cT.source})?`),e6=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,t6=/(\d{4})-?W(\d\d)(?:-?(\d))?/,n6=/(\d{4})-?(\d{3})/,r6=sT("weekYear","weekNumber","weekDay"),a6=sT("year","ordinal"),o6=/(\d{4})-(\d\d)-(\d\d)/,uT=RegExp(`${o1.source} ?(?:${lT.source}|(${iT.source}))?`),i6=RegExp(`(?: ${uT.source})?`);function Ed(e,t,n){const r=e[t];return Rt(r)?n:pl(r)}function s6(e,t){return[{year:Ed(e,t),month:Ed(e,t+1,1),day:Ed(e,t+2,1)},null,t+3]}function Vd(e,t){return[{hours:Ed(e,t,0),minutes:Ed(e,t+1,0),seconds:Ed(e,t+2,0),milliseconds:n1(e[t+3])},null,t+4]}function Im(e,t){const n=!e[t]&&!e[t+1],r=Pv(e[t+1],e[t+2]),a=n?null:Xr.instance(r);return[{},a,t+3]}function Tm(e,t){const n=e[t]?fs.create(e[t]):null;return[{},n,t+1]}const l6=RegExp(`^T?${o1.source}$`),c6=/^-?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 u6(e){const[t,n,r,a,o,s,u,d,m]=e,p=t[0]==="-",g=d&&d[0]==="-",w=(D,S=!1)=>D!==void 0&&(S||D&&p)?-D:D;return[{years:w(bc(n)),months:w(bc(r)),weeks:w(bc(a)),days:w(bc(o)),hours:w(bc(s)),minutes:w(bc(u)),seconds:w(bc(d),d==="-0"),milliseconds:w(n1(m),g)}]}const d6={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 s1(e,t,n,r,a,o,s){const u={year:t.length===2?Sw(pl(t)):pl(t),month:XI.indexOf(n)+1,day:pl(r),hour:pl(a),minute:pl(o)};return s&&(u.second=pl(s)),e&&(u.weekday=e.length>3?tT.indexOf(e)+1:nT.indexOf(e)+1),u}const f6=/^(?:(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 h6(e){const[,t,n,r,a,o,s,u,d,m,p,g]=e,w=s1(t,a,r,n,o,s,u);let D;return d?D=d6[d]:m?D=0:D=Pv(p,g),[w,new Xr(D)]}function m6(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const p6=/^(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$/,g6=/^(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$/,v6=/^(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 eD(e){const[,t,n,r,a,o,s,u]=e;return[s1(t,a,r,n,o,s,u),Xr.utcInstance]}function y6(e){const[,t,n,r,a,o,s,u]=e;return[s1(t,u,n,r,a,o,s),Xr.utcInstance]}const w6=Yd(e6,i1),b6=Yd(t6,i1),D6=Yd(n6,i1),S6=Yd(cT),dT=zd(s6,Vd,Im,Tm),I6=zd(r6,Vd,Im,Tm),T6=zd(a6,Vd,Im,Tm),E6=zd(Vd,Im,Tm);function x6(e){return Ud(e,[w6,dT],[b6,I6],[D6,T6],[S6,E6])}function C6(e){return Ud(m6(e),[f6,h6])}function M6(e){return Ud(e,[p6,eD],[g6,eD],[v6,y6])}function N6(e){return Ud(e,[c6,u6])}const k6=zd(Vd);function A6(e){return Ud(e,[l6,k6])}const O6=Yd(o6,i6),F6=Yd(uT),P6=zd(Vd,Im,Tm);function j6(e){return Ud(e,[O6,dT],[F6,P6])}const L6="Invalid Duration",fT={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}},R6={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},...fT},oo=146097/400,pd=146097/4800,_6={years:{quarters:4,months:12,weeks:oo/7,days:oo,hours:oo*24,minutes:oo*24*60,seconds:oo*24*60*60,milliseconds:oo*24*60*60*1e3},quarters:{months:3,weeks:oo/28,days:oo/4,hours:oo*24/4,minutes:oo*24*60/4,seconds:oo*24*60*60/4,milliseconds:oo*24*60*60*1e3/4},months:{weeks:pd/7,days:pd,hours:pd*24,minutes:pd*24*60,seconds:pd*24*60*60,milliseconds:pd*24*60*60*1e3},...fT},Dc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],H6=Dc.slice(0).reverse();function cl(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 et(r)}function B6(e){return e<0?Math.floor(e):Math.ceil(e)}function hT(e,t,n,r,a){const o=e[a][n],s=t[n]/o,u=Math.sign(s)===Math.sign(r[a]),d=!u&&r[a]!==0&&Math.abs(s)<=1?B6(s):Math.trunc(s);r[a]+=d,t[n]-=d*o}function Y6(e,t){H6.reduce((n,r)=>Rt(t[r])?n:(n&&hT(e,t,n,t,r),r),null)}function z6(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class et{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?_6:R6;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||hn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return et.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new io(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new et({values:iv(t,et.normalizeUnit),loc:hn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Cc(t))return et.fromMillis(t);if(et.isDuration(t))return t;if(typeof t=="object")return et.fromObject(t);throw new io(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=N6(t);return r?et.fromObject(r,n):et.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=A6(t);return r?et.fromObject(r,n):et.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new io("need to specify a reason the Duration is invalid");const r=t instanceof jo?t:new jo(t,n);if(Zn.throwOnInvalid)throw new gk(r);return new et({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 kI(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?Yr.create(this.loc,r).formatDurationFromString(this,t):L6}toHuman(t={}){const n=Dc.map(r=>{const a=this.values[r];return Rt(a)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(a)}).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+=r1(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 a=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(a+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(a+=".SSS"));let o=r.toFormat(a);return t.includePrefix&&(o="T"+o),o}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=et.fromDurationLike(t),r={};for(const a of Dc)(Nd(n.values,a)||Nd(this.values,a))&&(r[a]=n.get(a)+this.get(a));return cl(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=et.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]=QI(t(this.values[r],r));return cl(this,{values:n},!0)}get(t){return this[et.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...iv(t,et.normalizeUnit)};return cl(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:a}={}){const s={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:a,conversionAccuracy:r};return cl(this,s)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Y6(this.matrix,t),cl(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=z6(this.normalize().shiftToAll().toObject());return cl(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>et.normalizeUnit(s));const n={},r={},a=this.toObject();let o;for(const s of Dc)if(t.indexOf(s)>=0){o=s;let u=0;for(const m in r)u+=this.matrix[m][s]*r[m],r[m]=0;Cc(a[s])&&(u+=a[s]);const d=Math.trunc(u);n[s]=d,r[s]=(u*1e3-d*1e3)/1e3;for(const m in a)Dc.indexOf(m)>Dc.indexOf(s)&&hT(this.matrix,a,m,n,s)}else Cc(a[s])&&(r[s]=a[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return cl(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 cl(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,a){return r===void 0||r===0?a===void 0||a===0:r===a}for(const r of Dc)if(!n(this.values[r],t.values[r]))return!1;return!0}}const gd="Invalid Interval";function U6(e,t){return!e||!e.isValid?Nn.invalid("missing or invalid start"):!t||!t.isValid?Nn.invalid("missing or invalid end"):t<e?Nn.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 Nn{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 io("need to specify a reason the Interval is invalid");const r=t instanceof jo?t:new jo(t,n);if(Zn.throwOnInvalid)throw new pk(r);return new Nn({invalid:r})}static fromDateTimes(t,n){const r=Oh(t),a=Oh(n),o=U6(r,a);return o??new Nn({start:r,end:a})}static after(t,n){const r=et.fromDurationLike(n),a=Oh(t);return Nn.fromDateTimes(a,a.plus(r))}static before(t,n){const r=et.fromDurationLike(n),a=Oh(t);return Nn.fromDateTimes(a.minus(r),a)}static fromISO(t,n){const[r,a]=(t||"").split("/",2);if(r&&a){let o,s;try{o=st.fromISO(r,n),s=o.isValid}catch{s=!1}let u,d;try{u=st.fromISO(a,n),d=u.isValid}catch{d=!1}if(s&&d)return Nn.fromDateTimes(o,u);if(s){const m=et.fromISO(a,n);if(m.isValid)return Nn.after(o,m)}else if(d){const m=et.fromISO(r,n);if(m.isValid)return Nn.before(u,m)}}return Nn.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?Nn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Oh).filter(s=>this.contains(s)).sort(),r=[];let{s:a}=this,o=0;for(;a<this.e;){const s=n[o]||this.e,u=+s>+this.e?this.e:s;r.push(Nn.fromDateTimes(a,u)),a=u,o+=1}return r}splitBy(t){const n=et.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,a=1,o;const s=[];for(;r<this.e;){const u=this.start.plus(n.mapUnits(d=>d*a));o=+u>+this.e?this.e:u,s.push(Nn.fromDateTimes(r,o)),r=o,a+=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:Nn.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 Nn.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((a,o)=>a.s-o.s).reduce(([a,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[a,o.union(s)]:[a.concat([o]),s]:[a,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const a=[],o=t.map(d=>[{time:d.s,type:"s"},{time:d.e,type:"e"}]),s=Array.prototype.concat(...o),u=s.sort((d,m)=>d.time-m.time);for(const d of u)r+=d.type==="s"?1:-1,r===1?n=d.time:(n&&+n!=+d.time&&a.push(Nn.fromDateTimes(n,d.time)),n=null);return Nn.merge(a)}difference(...t){return Nn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} ${this.e.toISO()})`:gd}toLocaleString(t=rv,n={}){return this.isValid?Yr.create(this.s.loc.clone(n),t).formatInterval(this):gd}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:gd}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:gd}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:gd}toFormat(t,{separator:n=" "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:gd}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):et.invalid(this.invalidReason)}mapEndpoints(t){return Nn.fromDateTimes(t(this.s),t(this.e))}}class Ig{static hasDST(t=Zn.defaultZone){const n=st.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return fs.isValidZone(t)}static normalizeZone(t){return gl(t,Zn.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||hn.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||hn.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||hn.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||hn.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return hn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return hn.create(n,null,"gregory").eras(t)}static features(){return{relative:JI()}}}function tD(e,t){const n=a=>a.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(et.fromMillis(r).as("days"))}function V6(e,t,n){const r=[["years",(d,m)=>m.year-d.year],["quarters",(d,m)=>m.quarter-d.quarter+(m.year-d.year)*4],["months",(d,m)=>m.month-d.month+(m.year-d.year)*12],["weeks",(d,m)=>{const p=tD(d,m);return(p-p%7)/7}],["days",tD]],a={},o=e;let s,u;for(const[d,m]of r)n.indexOf(d)>=0&&(s=d,a[d]=m(e,t),u=o.plus(a),u>t?(a[d]--,e=o.plus(a)):e=u);return[e,a,u,s]}function Z6(e,t,n,r){let[a,o,s,u]=V6(e,t,n);const d=t-a,m=n.filter(g=>["hours","minutes","seconds","milliseconds"].indexOf(g)>=0);m.length===0&&(s<t&&(s=a.plus({[u]:1})),s!==a&&(o[u]=(o[u]||0)+d/(s-a)));const p=et.fromObject(o,r);return m.length>0?et.fromMillis(d,r).shiftTo(...m).plus(p):p}const l1={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",gujr:"[-૯]",hanidec:"[|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[-೯]",laoo:"[-໙]",limb:"[᥆-᥏]",mlym:"[-൯]",mong:"[᠐-᠙]",mymr:"[-၉]",orya:"[-୯]",tamldec:"[-௯]",telu:"[-౯]",thai:"[-๙]",tibt:"[༠-༩]",latn:"\\d"},nD={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]},W6=l1.hanidec.replace(/[\[|\]]/g,"").split("");function $6(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(l1.hanidec)!==-1)t+=W6.indexOf(e[n]);else for(const a in nD){const[o,s]=nD[a];r>=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}function ko({numberingSystem:e},t=""){return new RegExp(`${l1[e||"latn"]}${t}`)}const G6="missing Intl.DateTimeFormat.formatToParts support";function Ut(e,t=n=>n){return{regex:e,deser:([n])=>t($6(n))}}const q6=" ",mT=`[ ${q6}]`,pT=new RegExp(mT,"g");function J6(e){return e.replace(/\./g,"\\.?").replace(pT,mT)}function rD(e){return e.replace(/\./g,"").replace(pT," ").toLowerCase()}function Ao(e,t){return e===null?null:{regex:RegExp(e.map(J6).join("|")),deser:([n])=>e.findIndex(r=>rD(n)===rD(r))+t}}function aD(e,t){return{regex:e,deser:([,n,r])=>Pv(n,r),groups:t}}function S0(e){return{regex:e,deser:([t])=>t}}function K6(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Q6(e,t){const n=ko(t),r=ko(t,"{2}"),a=ko(t,"{3}"),o=ko(t,"{4}"),s=ko(t,"{6}"),u=ko(t,"{1,2}"),d=ko(t,"{1,3}"),m=ko(t,"{1,6}"),p=ko(t,"{1,9}"),g=ko(t,"{2,4}"),w=ko(t,"{4,6}"),D=E=>({regex:RegExp(K6(E.val)),deser:([A])=>A,literal:!0}),T=(E=>{if(e.literal)return D(E);switch(E.val){case"G":return Ao(t.eras("short",!1),0);case"GG":return Ao(t.eras("long",!1),0);case"y":return Ut(m);case"yy":return Ut(g,Sw);case"yyyy":return Ut(o);case"yyyyy":return Ut(w);case"yyyyyy":return Ut(s);case"M":return Ut(u);case"MM":return Ut(r);case"MMM":return Ao(t.months("short",!0,!1),1);case"MMMM":return Ao(t.months("long",!0,!1),1);case"L":return Ut(u);case"LL":return Ut(r);case"LLL":return Ao(t.months("short",!1,!1),1);case"LLLL":return Ao(t.months("long",!1,!1),1);case"d":return Ut(u);case"dd":return Ut(r);case"o":return Ut(d);case"ooo":return Ut(a);case"HH":return Ut(r);case"H":return Ut(u);case"hh":return Ut(r);case"h":return Ut(u);case"mm":return Ut(r);case"m":return Ut(u);case"q":return Ut(u);case"qq":return Ut(r);case"s":return Ut(u);case"ss":return Ut(r);case"S":return Ut(d);case"SSS":return Ut(a);case"u":return S0(p);case"uu":return S0(u);case"uuu":return Ut(n);case"a":return Ao(t.meridiems(),0);case"kkkk":return Ut(o);case"kk":return Ut(g,Sw);case"W":return Ut(u);case"WW":return Ut(r);case"E":case"c":return Ut(n);case"EEE":return Ao(t.weekdays("short",!1,!1),1);case"EEEE":return Ao(t.weekdays("long",!1,!1),1);case"ccc":return Ao(t.weekdays("short",!0,!1),1);case"cccc":return Ao(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return aD(new RegExp(`([+-]${u.source})(?::(${r.source}))?`),2);case"ZZZ":return aD(new RegExp(`([+-]${u.source})(${r.source})?`),2);case"z":return S0(/[a-z_+-/]{1,256}?/i);default:return D(E)}})(e)||{invalidReason:G6};return T.token=e,T}const X6={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 eA(e,t){const{type:n,value:r}=e;if(n==="literal")return{literal:!0,val:r};const a=t[n];let o=X6[n];if(typeof o=="object"&&(o=o[a]),o)return{literal:!1,val:o}}function tA(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function nA(e,t,n){const r=e.match(t);if(r){const a={};let o=1;for(const s in n)if(Nd(n,s)){const u=n[s],d=u.groups?u.groups+1:1;!u.literal&&u.token&&(a[u.token.val[0]]=u.deser(r.slice(o,o+d))),o+=d}return[r,a]}else return[r,{}]}function rA(e){const t=o=>{switch(o){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 Rt(e.z)||(n=fs.create(e.z)),Rt(e.Z)||(n||(n=new Xr(e.Z)),r=e.Z),Rt(e.q)||(e.M=(e.q-1)*3+1),Rt(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),Rt(e.u)||(e.S=n1(e.u)),[Object.keys(e).reduce((o,s)=>{const u=t(s);return u&&(o[u]=e[s]),o},{}),n,r]}let I0=null;function aA(){return I0||(I0=st.fromMillis(1555555555555)),I0}function oA(e,t){if(e.literal)return e;const n=Yr.macroTokenToFormatOpts(e.val),r=yT(n,t);return r==null||r.includes(void 0)?e:r}function gT(e,t){return Array.prototype.concat(...e.map(n=>oA(n,t)))}function vT(e,t,n){const r=gT(Yr.parseFormat(n),e),a=r.map(s=>Q6(s,e)),o=a.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,u]=tA(a),d=RegExp(s,"i"),[m,p]=nA(t,d,u),[g,w,D]=p?rA(p):[null,null,void 0];if(Nd(p,"a")&&Nd(p,"H"))throw new Yh("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:d,rawMatches:m,matches:p,result:g,zone:w,specificOffset:D}}}function iA(e,t,n){const{result:r,zone:a,specificOffset:o,invalidReason:s}=vT(e,t,n);return[r,a,o,s]}function yT(e,t){return e?Yr.create(t,e).formatDateTimeParts(aA()).map(a=>eA(a,e)):null}const wT=[0,31,59,90,120,151,181,212,243,273,304,334],bT=[0,31,60,91,121,152,182,213,244,274,305,335];function so(e,t){return new jo("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function DT(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const a=r.getUTCDay();return a===0?7:a}function ST(e,t,n){return n+(Sm(e)?bT:wT)[t-1]}function IT(e,t){const n=Sm(e)?bT:wT,r=n.findIndex(o=>o<t),a=t-n[r];return{month:r+1,day:a}}function Iw(e){const{year:t,month:n,day:r}=e,a=ST(t,n,r),o=DT(t,n,r);let s=Math.floor((a-o+10)/7),u;return s<1?(u=t-1,s=ov(u)):s>ov(t)?(u=t+1,s=1):u=t,{weekYear:u,weekNumber:s,weekday:o,...jv(e)}}function oD(e){const{weekYear:t,weekNumber:n,weekday:r}=e,a=DT(t,1,4),o=Wh(t);let s=n*7+r-a-3,u;s<1?(u=t-1,s+=Wh(u)):s>o?(u=t+1,s-=Wh(t)):u=t;const{month:d,day:m}=IT(u,s);return{year:u,month:d,day:m,...jv(e)}}function T0(e){const{year:t,month:n,day:r}=e,a=ST(t,n,r);return{year:t,ordinal:a,...jv(e)}}function iD(e){const{year:t,ordinal:n}=e,{month:r,day:a}=IT(t,n);return{year:t,month:r,day:a,...jv(e)}}function sA(e){const t=Fv(e.weekYear),n=ds(e.weekNumber,1,ov(e.weekYear)),r=ds(e.weekday,1,7);return t?n?r?!1:so("weekday",e.weekday):so("week",e.week):so("weekYear",e.weekYear)}function lA(e){const t=Fv(e.year),n=ds(e.ordinal,1,Wh(e.year));return t?n?!1:so("ordinal",e.ordinal):so("year",e.year)}function TT(e){const t=Fv(e.year),n=ds(e.month,1,12),r=ds(e.day,1,av(e.year,e.month));return t?n?r?!1:so("day",e.day):so("month",e.month):so("year",e.year)}function ET(e){const{hour:t,minute:n,second:r,millisecond:a}=e,o=ds(t,0,23)||t===24&&n===0&&r===0&&a===0,s=ds(n,0,59),u=ds(r,0,59),d=ds(a,0,999);return o?s?u?d?!1:so("millisecond",a):so("second",r):so("minute",n):so("hour",t)}const E0="Invalid DateTime",sD=864e13;function Tg(e){return new jo("unsupported zone",`the zone "${e.name}" is not supported`)}function x0(e){return e.weekData===null&&(e.weekData=Iw(e.c)),e.weekData}function kh(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new st({...n,...t,old:n})}function xT(e,t,n){let r=e-t*60*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=(a-t)*60*1e3;const o=n.offset(r);return a===o?[r,a]:[e-Math.min(a,o)*60*1e3,Math.max(a,o)]}function lD(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 Vg(e,t,n){return xT(a1(e),t,n)}function cD(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),a=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:a,day:Math.min(e.c.day,av(r,a))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=et.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"),u=a1(o);let[d,m]=xT(u,n,e.zone);return s!==0&&(d+=s,m=e.zone.offset(d)),{ts:d,o:m}}function Ah(e,t,n,r,a,o){const{setZone:s,zone:u}=n;if(e&&Object.keys(e).length!==0){const d=t||u,m=st.fromObject(e,{...n,zone:d,specificOffset:o});return s?m:m.setZone(u)}else return st.invalid(new jo("unparsable",`the input "${a}" can't be parsed as ${r}`))}function Eg(e,t,n=!0){return e.isValid?Yr.create(hn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function C0(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Wn(e.c.year,n?6:4),t?(r+="-",r+=Wn(e.c.month),r+="-",r+=Wn(e.c.day)):(r+=Wn(e.c.month),r+=Wn(e.c.day)),r}function uD(e,t,n,r,a,o){let s=Wn(e.c.hour);return t?(s+=":",s+=Wn(e.c.minute),(e.c.second!==0||!n)&&(s+=":")):s+=Wn(e.c.minute),(e.c.second!==0||!n)&&(s+=Wn(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=Wn(e.c.millisecond,3))),a&&(e.isOffsetFixed&&e.offset===0&&!o?s+="Z":e.o<0?(s+="-",s+=Wn(Math.trunc(-e.o/60)),s+=":",s+=Wn(Math.trunc(-e.o%60))):(s+="+",s+=Wn(Math.trunc(e.o/60)),s+=":",s+=Wn(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}const CT={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},cA={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},uA={ordinal:1,hour:0,minute:0,second:0,millisecond:0},MT=["year","month","day","hour","minute","second","millisecond"],dA=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],fA=["year","ordinal","hour","minute","second","millisecond"];function dD(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 kI(e);return t}function fD(e,t){const n=gl(t.zone,Zn.defaultZone),r=hn.fromObject(t),a=Zn.now();let o,s;if(Rt(e.year))o=a;else{for(const m of MT)Rt(e[m])&&(e[m]=CT[m]);const u=TT(e)||ET(e);if(u)return st.invalid(u);const d=n.offset(a);[o,s]=Vg(e,d,n)}return new st({ts:o,zone:n,loc:r,o:s})}function hD(e,t,n){const r=Rt(n.round)?!0:n.round,a=(s,u)=>(s=r1(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,u)),o=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 a(o(n.unit),n.unit);for(const s of n.units){const u=o(s);if(Math.abs(u)>=1)return a(u,s)}return a(e>t?-0:0,n.units[n.units.length-1])}function mD(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 st{constructor(t){const n=t.zone||Zn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new jo("invalid input"):null)||(n.isValid?null:Tg(n));this.ts=Rt(t.ts)?Zn.now():t.ts;let a=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[a,o]=[t.old.c,t.old.o];else{const u=n.offset(this.ts);a=lD(this.ts,u),r=Number.isNaN(a.year)?new jo("invalid input"):null,a=r?null:a,o=r?null:u}this._zone=n,this.loc=t.loc||hn.create(),this.invalid=r,this.weekData=null,this.c=a,this.o=o,this.isLuxonDateTime=!0}static now(){return new st({})}static local(){const[t,n]=mD(arguments),[r,a,o,s,u,d,m]=n;return fD({year:r,month:a,day:o,hour:s,minute:u,second:d,millisecond:m},t)}static utc(){const[t,n]=mD(arguments),[r,a,o,s,u,d,m]=n;return t.zone=Xr.utcInstance,fD({year:r,month:a,day:o,hour:s,minute:u,second:d,millisecond:m},t)}static fromJSDate(t,n={}){const r=Rk(t)?t.valueOf():NaN;if(Number.isNaN(r))return st.invalid("invalid input");const a=gl(n.zone,Zn.defaultZone);return a.isValid?new st({ts:r,zone:a,loc:hn.fromObject(n)}):st.invalid(Tg(a))}static fromMillis(t,n={}){if(Cc(t))return t<-sD||t>sD?st.invalid("Timestamp out of range"):new st({ts:t,zone:gl(n.zone,Zn.defaultZone),loc:hn.fromObject(n)});throw new io(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Cc(t))return new st({ts:t*1e3,zone:gl(n.zone,Zn.defaultZone),loc:hn.fromObject(n)});throw new io("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=gl(n.zone,Zn.defaultZone);if(!r.isValid)return st.invalid(Tg(r));const a=Zn.now(),o=Rt(n.specificOffset)?r.offset(a):n.specificOffset,s=iv(t,dD),u=!Rt(s.ordinal),d=!Rt(s.year),m=!Rt(s.month)||!Rt(s.day),p=d||m,g=s.weekYear||s.weekNumber,w=hn.fromObject(n);if((p||u)&&g)throw new Yh("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(m&&u)throw new Yh("Can't mix ordinal dates with month/day");const D=g||s.weekday&&!p;let S,T,E=lD(a,o);D?(S=dA,T=cA,E=Iw(E)):u?(S=fA,T=uA,E=T0(E)):(S=MT,T=CT);let A=!1;for(const z of S){const U=s[z];Rt(U)?A?s[z]=T[z]:s[z]=E[z]:A=!0}const N=D?sA(s):u?lA(s):TT(s),R=N||ET(s);if(R)return st.invalid(R);const F=D?oD(s):u?iD(s):s,[H,P]=Vg(F,o,r),L=new st({ts:H,zone:r,o:P,loc:w});return s.weekday&&p&&t.weekday!==L.weekday?st.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${L.toISO()}`):L}static fromISO(t,n={}){const[r,a]=x6(t);return Ah(r,a,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,a]=C6(t);return Ah(r,a,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,a]=M6(t);return Ah(r,a,n,"HTTP",n)}static fromFormat(t,n,r={}){if(Rt(t)||Rt(n))throw new io("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:o=null}=r,s=hn.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0}),[u,d,m,p]=iA(s,t,n);return p?st.invalid(p):Ah(u,d,r,`format ${n}`,t,m)}static fromString(t,n,r={}){return st.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,a]=j6(t);return Ah(r,a,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new io("need to specify a reason the DateTime is invalid");const r=t instanceof jo?t:new jo(t,n);if(Zn.throwOnInvalid)throw new mk(r);return new st({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=yT(t,hn.fromObject(n));return r?r.map(a=>a?a.val:null).join(""):null}static expandFormat(t,n={}){return gT(Yr.parseFormat(t),hn.fromObject(n)).map(a=>a.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?x0(this).weekYear:NaN}get weekNumber(){return this.isValid?x0(this).weekNumber:NaN}get weekday(){return this.isValid?x0(this).weekday:NaN}get ordinal(){return this.isValid?T0(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ig.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ig.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ig.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ig.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 Sm(this.year)}get daysInMonth(){return av(this.year,this.month)}get daysInYear(){return this.isValid?Wh(this.year):NaN}get weeksInWeekYear(){return this.isValid?ov(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:a}=Yr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:a}}toUTC(t=0,n={}){return this.setZone(Xr.instance(t),n)}toLocal(){return this.setZone(Zn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=gl(t,Zn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let a=this.ts;if(n||r){const o=t.offset(this.ts),s=this.toObject();[a]=Vg(s,o,t)}return kh(this,{ts:a,zone:t})}else return st.invalid(Tg(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const a=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return kh(this,{loc:a})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=iv(t,dD),r=!Rt(n.weekYear)||!Rt(n.weekNumber)||!Rt(n.weekday),a=!Rt(n.ordinal),o=!Rt(n.year),s=!Rt(n.month)||!Rt(n.day),u=o||s,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new Yh("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&a)throw new Yh("Can't mix ordinal dates with month/day");let m;r?m=oD({...Iw(this.c),...n}):Rt(n.ordinal)?(m={...this.toObject(),...n},Rt(n.day)&&(m.day=Math.min(av(m.year,m.month),m.day))):m=iD({...T0(this.c),...n});const[p,g]=Vg(m,this.o,this.zone);return kh(this,{ts:p,o:g})}plus(t){if(!this.isValid)return this;const n=et.fromDurationLike(t);return kh(this,cD(this,n))}minus(t){if(!this.isValid)return this;const n=et.fromDurationLike(t).negate();return kh(this,cD(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=et.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 a=Math.ceil(this.month/3);n.month=(a-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?Yr.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):E0}toLocaleString(t=rv,n={}){return this.isValid?Yr.create(this.loc.clone(n),t).formatDateTime(this):E0}toLocaleParts(t={}){return this.isValid?Yr.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:a=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s=t==="extended";let u=C0(this,s);return u+="T",u+=uD(this,s,n,r,a,o),u}toISODate({format:t="extended"}={}){return this.isValid?C0(this,t==="extended"):null}toISOWeekDate(){return Eg(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:a=!1,extendedZone:o=!1,format:s="extended"}={}){return this.isValid?(a?"T":"")+uD(this,s==="extended",n,t,r,o):null}toRFC2822(){return Eg(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Eg(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?C0(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let a="HH:mm:ss.SSS";return(n||t)&&(r&&(a+=" "),n?a+="z":t&&(a+="ZZ")),Eg(this,a,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():E0}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 et.invalid("created by diffing an invalid DateTime");const a={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=_k(n).map(et.normalizeUnit),s=t.valueOf()>this.valueOf(),u=s?this:t,d=s?t:this,m=Z6(u,d,o,a);return s?m.negate():m}diffNow(t="milliseconds",n={}){return this.diff(st.now(),t,n)}until(t){return this.isValid?Nn.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),a=this.setZone(t.zone,{keepLocalTime:!0});return a.startOf(n)<=r&&r<=a.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||st.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let a=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(a=t.unit,o=void 0),hD(n,this.plus(r),{...t,numeric:"always",units:a,unit:o})}toRelativeCalendar(t={}){return this.isValid?hD(t.base||st.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(st.isDateTime))throw new io("min requires all arguments be DateTimes");return Qb(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(st.isDateTime))throw new io("max requires all arguments be DateTimes");return Qb(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:a=null,numberingSystem:o=null}=r,s=hn.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0});return vT(s,t,n)}static fromStringExplain(t,n,r={}){return st.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return rv}static get DATE_MED(){return AI}static get DATE_MED_WITH_WEEKDAY(){return vk}static get DATE_FULL(){return OI}static get DATE_HUGE(){return FI}static get TIME_SIMPLE(){return PI}static get TIME_WITH_SECONDS(){return jI}static get TIME_WITH_SHORT_OFFSET(){return LI}static get TIME_WITH_LONG_OFFSET(){return RI}static get TIME_24_SIMPLE(){return _I}static get TIME_24_WITH_SECONDS(){return HI}static get TIME_24_WITH_SHORT_OFFSET(){return BI}static get TIME_24_WITH_LONG_OFFSET(){return YI}static get DATETIME_SHORT(){return zI}static get DATETIME_SHORT_WITH_SECONDS(){return UI}static get DATETIME_MED(){return VI}static get DATETIME_MED_WITH_SECONDS(){return ZI}static get DATETIME_MED_WITH_WEEKDAY(){return yk}static get DATETIME_FULL(){return WI}static get DATETIME_FULL_WITH_SECONDS(){return $I}static get DATETIME_HUGE(){return GI}static get DATETIME_HUGE_WITH_SECONDS(){return qI}}function Oh(e){if(st.isDateTime(e))return e;if(e&&e.valueOf&&Cc(e.valueOf()))return st.fromJSDate(e);if(e&&typeof e=="object")return st.fromObject(e);throw new io(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const c1={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},hA={allowHtml:!0};({...c1,...hA});class u1{constructor(t){this.value=t,this.successful=!0}map(t){return new u1(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 d1{constructor(t){this.error=t,this.successful=!1}map(t){return this}flatMap(t){return this}mapErr(t){return new d1(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 sv;(function(e){function t(o){return new u1(o)}e.success=t;function n(o){return new d1(o)}e.failure=n;function r(o,s,u){return o.successful?s.successful?u(o.value,s.value):n(s.error):n(o.error)}e.flatMap2=r;function a(o,s,u){return r(o,s,(d,m)=>t(u(d,m)))}e.map2=a})(sv||(sv={}));var mA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Jn<"u"?Jn:typeof self<"u"?self:{},Q={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:mA,function(){return function(n){var r={};function a(o){if(r[o])return r[o].exports;var s=r[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=n,a.c=r,a.d=function(o,s,u){a.o(o,s)||Object.defineProperty(o,s,{configurable:!1,enumerable:!0,get:u})},a.r=function(o){Object.defineProperty(o,"__esModule",{value:!0})},a.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(s,"a",s),s},a.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},a.p="",a(a.s=0)}([function(n,r,a){function o(V){if(!(this instanceof o))return new o(V);this._=V}var s=o.prototype;function u(V,ne){for(var me=0;me<V;me++)ne(me)}function d(V,ne,me){return function(Ce,je){u(je.length,function(Ye){Ce(je[Ye],Ye,je)})}(function(Ce,je,Ye){ne=V(ne,Ce,je,Ye)},me),ne}function m(V,ne){return d(function(me,Ce,je,Ye){return me.concat([V(Ce,je,Ye)])},[],ne)}function p(V,ne){var me={v:0,buf:ne};return u(V,function(){var Ce;me={v:me.v<<1|(Ce=me.buf,Ce[0]>>7),buf:function(je){var Ye=d(function(ze,pt,Yt,On){return ze.concat(Yt===On.length-1?Buffer.from([pt,0]).readUInt16BE(0):On.readUInt16BE(Yt))},[],je);return Buffer.from(m(function(ze){return(ze<<1&65535)>>8},Ye))}(me.buf)}}),me}function g(){return typeof Buffer<"u"}function w(){if(!g())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function D(V){w();var ne=d(function(Ye,ze){return Ye+ze},0,V);if(ne%8!=0)throw new Error("The bits ["+V.join(", ")+"] add up to "+ne+" which is not an even number of bytes; the total should be divisible by 8");var me,Ce=ne/8,je=(me=function(Ye){return Ye>48},d(function(Ye,ze){return Ye||(me(ze)?ze:Ye)},null,V));if(je)throw new Error(je+" bit range requested exceeds 48 bit (6 byte) Number max.");return new o(function(Ye,ze){var pt=Ce+ze;return pt>Ye.length?z(ze,Ce.toString()+" bytes"):L(pt,d(function(Yt,On){var yn=p(On,Yt.buf);return{coll:Yt.coll.concat(yn.v),buf:yn.buf}},{coll:[],buf:Ye.slice(ze,pt)},V).coll)})}function S(V,ne){return new o(function(me,Ce){return w(),Ce+ne>me.length?z(Ce,ne+" bytes for "+V):L(Ce+ne,me.slice(Ce,Ce+ne))})}function T(V,ne){if(typeof(me=ne)!="number"||Math.floor(me)!==me||ne<0||ne>6)throw new Error(V+" requires integer length in range [0, 6].");var me}function E(V){return T("uintBE",V),S("uintBE("+V+")",V).map(function(ne){return ne.readUIntBE(0,V)})}function A(V){return T("uintLE",V),S("uintLE("+V+")",V).map(function(ne){return ne.readUIntLE(0,V)})}function N(V){return T("intBE",V),S("intBE("+V+")",V).map(function(ne){return ne.readIntBE(0,V)})}function R(V){return T("intLE",V),S("intLE("+V+")",V).map(function(ne){return ne.readIntLE(0,V)})}function F(V){return V instanceof o}function H(V){return{}.toString.call(V)==="[object Array]"}function P(V){return g()&&Buffer.isBuffer(V)}function L(V,ne){return{status:!0,index:V,value:ne,furthest:-1,expected:[]}}function z(V,ne){return H(ne)||(ne=[ne]),{status:!1,index:-1,value:null,furthest:V,expected:ne}}function U(V,ne){if(!ne||V.furthest>ne.furthest)return V;var me=V.furthest===ne.furthest?function(Ce,je){if(function(){if(o._supportsSet!==void 0)return o._supportsSet;var yr=typeof Set<"u";return o._supportsSet=yr,yr}()&&Array.from){for(var Ye=new Set(Ce),ze=0;ze<je.length;ze++)Ye.add(je[ze]);var pt=Array.from(Ye);return pt.sort(),pt}for(var Yt={},On=0;On<Ce.length;On++)Yt[Ce[On]]=!0;for(var yn=0;yn<je.length;yn++)Yt[je[yn]]=!0;var na=[];for(var Fn in Yt)({}).hasOwnProperty.call(Yt,Fn)&&na.push(Fn);return na.sort(),na}(V.expected,ne.expected):ne.expected;return{status:V.status,index:V.index,value:V.value,furthest:ne.furthest,expected:me}}var W={};function K(V,ne){if(P(V))return{offset:ne,line:-1,column:-1};V in W||(W[V]={});for(var me=W[V],Ce=0,je=0,Ye=0,ze=ne;ze>=0;){if(ze in me){Ce=me[ze].line,Ye===0&&(Ye=me[ze].lineStart);break}(V.charAt(ze)===`
`||V.charAt(ze)==="\r"&&V.charAt(ze+1)!==`
`)&&(je++,Ye===0&&(Ye=ze+1)),ze--}var pt=Ce+je,Yt=ne-Ye;return me[ne]={line:pt,lineStart:Ye},{offset:ne,line:pt+1,column:Yt+1}}function ae(V){if(!F(V))throw new Error("not a parser: "+V)}function ce(V,ne){return typeof V=="string"?V.charAt(ne):V[ne]}function fe(V){if(typeof V!="number")throw new Error("not a number: "+V)}function ie(V){if(typeof V!="function")throw new Error("not a function: "+V)}function ge(V){if(typeof V!="string")throw new Error("not a string: "+V)}var Te=2,se=3,we=8,Z=5*we,$=4*we,X=" ";function ve(V,ne){return new Array(ne+1).join(V)}function De(V,ne,me){var Ce=ne-V.length;return Ce<=0?V:ve(me,Ce)+V}function be(V,ne,me,Ce){return{from:V-ne>0?V-ne:0,to:V+me>Ce?Ce:V+me}}function ke(V,ne){var me,Ce,je,Ye,ze,pt=ne.index,Yt=pt.offset,On=1;if(Yt===V.length)return"Got the end of the input";if(P(V)){var yn=Yt-Yt%we,na=Yt-yn,Fn=be(yn,Z,$+we,V.length),yr=m(function(Jt){return m(function(Ia){return De(Ia.toString(16),2,"0")},Jt)},function(Jt,Ia){var Ta=Jt.length,Ea=[],zo=0;if(Ta<=Ia)return[Jt.slice()];for(var Uo=0;Uo<Ta;Uo++)Ea[zo]||Ea.push([]),Ea[zo].push(Jt[Uo]),(Uo+1)%Ia==0&&zo++;return Ea}(V.slice(Fn.from,Fn.to).toJSON().data,we));Ye=function(Jt){return Jt.from===0&&Jt.to===1?{from:Jt.from,to:Jt.to}:{from:Jt.from/we,to:Math.floor(Jt.to/we)}}(Fn),Ce=yn/we,me=3*na,na>=4&&(me+=1),On=2,je=m(function(Jt){return Jt.length<=4?Jt.join(" "):Jt.slice(0,4).join(" ")+" "+Jt.slice(4).join(" ")},yr),(ze=(8*(Ye.to>0?Ye.to-1:Ye.to)).toString(16).length)<2&&(ze=2)}else{var ra=V.split(/\r\n|[\n\r\u2028\u2029]/);me=pt.column-1,Ce=pt.line-1,Ye=be(Ce,Te,se,ra.length),je=ra.slice(Ye.from,Ye.to),ze=Ye.to.toString().length}var kl=Ce-Ye.from;return P(V)&&(ze=(8*(Ye.to>0?Ye.to-1:Ye.to)).toString(16).length)<2&&(ze=2),d(function(Jt,Ia,Ta){var Ea,zo=Ta===kl,Uo=zo?"> ":X;return Ea=P(V)?De((8*(Ye.from+Ta)).toString(16),ze,"0"):De((Ye.from+Ta+1).toString(),ze," "),[].concat(Jt,[Uo+Ea+" | "+Ia],zo?[X+ve(" ",ze)+" | "+De("",me," ")+ve("^",On)]:[])},[],je).join(`
`)}function Be(V,ne){return[`
`,"-- PARSING FAILED "+ve("-",50),`
`,ke(V,ne),`
`,(me=ne.expected,me.length===1?`Expected:
`+me[0]:`Expected one of the following:
`+me.join(", ")),`
`].join("");var me}function _e(V){return V.flags!==void 0?V.flags:[V.global?"g":"",V.ignoreCase?"i":"",V.multiline?"m":"",V.unicode?"u":"",V.sticky?"y":""].join("")}function it(){for(var V=[].slice.call(arguments),ne=V.length,me=0;me<ne;me+=1)ae(V[me]);return o(function(Ce,je){for(var Ye,ze=new Array(ne),pt=0;pt<ne;pt+=1){if(!(Ye=U(V[pt]._(Ce,je),Ye)).status)return Ye;ze[pt]=Ye.value,je=Ye.index}return U(L(je,ze),Ye)})}function Vt(){var V=[].slice.call(arguments);if(V.length===0)throw new Error("seqMap needs at least one argument");var ne=V.pop();return ie(ne),it.apply(null,V).map(function(me){return ne.apply(null,me)})}function Se(){var V=[].slice.call(arguments),ne=V.length;if(ne===0)return Dt("zero alternates");for(var me=0;me<ne;me+=1)ae(V[me]);return o(function(Ce,je){for(var Ye,ze=0;ze<V.length;ze+=1)if((Ye=U(V[ze]._(Ce,je),Ye)).status)return Ye;return Ye})}function Ue(V,ne){return Je(V,ne).or(ft([]))}function Je(V,ne){return ae(V),ae(ne),Vt(V,ne.then(V).many(),function(me,Ce){return[me].concat(Ce)})}function $e(V){ge(V);var ne="'"+V+"'";return o(function(me,Ce){var je=Ce+V.length,Ye=me.slice(Ce,je);return Ye===V?L(je,Ye):z(Ce,ne)})}function lt(V,ne){(function(je){if(!(je instanceof RegExp))throw new Error("not a regexp: "+je);for(var Ye=_e(je),ze=0;ze<Ye.length;ze++){var pt=Ye.charAt(ze);if(pt!=="i"&&pt!=="m"&&pt!=="u"&&pt!=="s")throw new Error('unsupported regexp flag "'+pt+'": '+je)}})(V),arguments.length>=2?fe(ne):ne=0;var me=function(je){return RegExp("^(?:"+je.source+")",_e(je))}(V),Ce=""+V;return o(function(je,Ye){var ze=me.exec(je.slice(Ye));if(ze){if(0<=ne&&ne<=ze.length){var pt=ze[0],Yt=ze[ne];return L(Ye+pt.length,Yt)}return z(Ye,"valid match group (0 to "+ze.length+") in "+Ce)}return z(Ye,Ce)})}function ft(V){return o(function(ne,me){return L(me,V)})}function Dt(V){return o(function(ne,me){return z(me,V)})}function Et(V){if(F(V))return o(function(ne,me){var Ce=V._(ne,me);return Ce.index=me,Ce.value="",Ce});if(typeof V=="string")return Et($e(V));if(V instanceof RegExp)return Et(lt(V));throw new Error("not a string, regexp, or parser: "+V)}function $t(V){return ae(V),o(function(ne,me){var Ce=V._(ne,me),je=ne.slice(me,Ce.index);return Ce.status?z(me,'not "'+je+'"'):L(me,null)})}function rn(V){return ie(V),o(function(ne,me){var Ce=ce(ne,me);return me<ne.length&&V(Ce)?L(me+1,Ce):z(me,"a character/byte matching "+V)})}function At(V,ne){arguments.length<2&&(ne=V,V=void 0);var me=o(function(Ce,je){return me._=ne()._,me._(Ce,je)});return V?me.desc(V):me}function an(){return Dt("fantasy-land/empty")}s.parse=function(V){if(typeof V!="string"&&!P(V))throw new Error(".parse must be called with a string or Buffer as its argument");var ne,me=this.skip(Sa)._(V,0);return ne=me.status?{status:!0,value:me.value}:{status:!1,index:K(V,me.furthest),expected:me.expected},delete W[V],ne},s.tryParse=function(V){var ne=this.parse(V);if(ne.status)return ne.value;var me=Be(V,ne),Ce=new Error(me);throw Ce.type="ParsimmonError",Ce.result=ne,Ce},s.assert=function(V,ne){return this.chain(function(me){return V(me)?ft(me):Dt(ne)})},s.or=function(V){return Se(this,V)},s.trim=function(V){return this.wrap(V,V)},s.wrap=function(V,ne){return Vt(V,this,ne,function(me,Ce){return Ce})},s.thru=function(V){return V(this)},s.then=function(V){return ae(V),it(this,V).map(function(ne){return ne[1]})},s.many=function(){var V=this;return o(function(ne,me){for(var Ce=[],je=void 0;;){if(!(je=U(V._(ne,me),je)).status)return U(L(me,Ce),je);if(me===je.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");me=je.index,Ce.push(je.value)}})},s.tieWith=function(V){return ge(V),this.map(function(ne){if(function(je){if(!H(je))throw new Error("not an array: "+je)}(ne),ne.length){ge(ne[0]);for(var me=ne[0],Ce=1;Ce<ne.length;Ce++)ge(ne[Ce]),me+=V+ne[Ce];return me}return""})},s.tie=function(){return this.tieWith("")},s.times=function(V,ne){var me=this;return arguments.length<2&&(ne=V),fe(V),fe(ne),o(function(Ce,je){for(var Ye=[],ze=void 0,pt=void 0,Yt=0;Yt<V;Yt+=1){if(pt=U(ze=me._(Ce,je),pt),!ze.status)return pt;je=ze.index,Ye.push(ze.value)}for(;Yt<ne&&(pt=U(ze=me._(Ce,je),pt),ze.status);Yt+=1)je=ze.index,Ye.push(ze.value);return U(L(je,Ye),pt)})},s.result=function(V){return this.map(function(){return V})},s.atMost=function(V){return this.times(0,V)},s.atLeast=function(V){return Vt(this.times(V),this.many(),function(ne,me){return ne.concat(me)})},s.map=function(V){ie(V);var ne=this;return o(function(me,Ce){var je=ne._(me,Ce);return je.status?U(L(je.index,V(je.value)),je):je})},s.contramap=function(V){ie(V);var ne=this;return o(function(me,Ce){var je=ne.parse(V(me.slice(Ce)));return je.status?L(Ce+me.length,je.value):je})},s.promap=function(V,ne){return ie(V),ie(ne),this.contramap(V).map(ne)},s.skip=function(V){return it(this,V).map(function(ne){return ne[0]})},s.mark=function(){return Vt(Sn,this,Sn,function(V,ne,me){return{start:V,value:ne,end:me}})},s.node=function(V){return Vt(Sn,this,Sn,function(ne,me,Ce){return{name:V,value:me,start:ne,end:Ce}})},s.sepBy=function(V){return Ue(this,V)},s.sepBy1=function(V){return Je(this,V)},s.lookahead=function(V){return this.skip(Et(V))},s.notFollowedBy=function(V){return this.skip($t(V))},s.desc=function(V){H(V)||(V=[V]);var ne=this;return o(function(me,Ce){var je=ne._(me,Ce);return je.status||(je.expected=V),je})},s.fallback=function(V){return this.or(ft(V))},s.ap=function(V){return Vt(V,this,function(ne,me){return ne(me)})},s.chain=function(V){var ne=this;return o(function(me,Ce){var je=ne._(me,Ce);return je.status?U(V(je.value)._(me,je.index),je):je})},s.concat=s.or,s.empty=an,s.of=ft,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 Sn=o(function(V,ne){return L(ne,K(V,ne))}),In=o(function(V,ne){return ne>=V.length?z(ne,"any character/byte"):L(ne+1,ce(V,ne))}),vr=o(function(V,ne){return L(V.length,V.slice(ne))}),Sa=o(function(V,ne){return ne<V.length?z(ne,"EOF"):L(ne,null)}),Mr=lt(/[0-9]/).desc("a digit"),Nr=lt(/[0-9]*/).desc("optional digits"),Ss=lt(/[a-z]/i).desc("a letter"),mo=lt(/[a-z]*/i).desc("optional letters"),po=lt(/\s*/).desc("optional whitespace"),Nl=lt(/\s+/).desc("whitespace"),Fi=$e("\r"),Pi=$e(`
`),Is=$e(`\r
`),Yo=Se(Is,Pi,Fi).desc("newline"),ji=Se(Yo,Sa);o.all=vr,o.alt=Se,o.any=In,o.cr=Fi,o.createLanguage=function(V){var ne={};for(var me in V)({}).hasOwnProperty.call(V,me)&&function(Ce){ne[Ce]=At(function(){return V[Ce](ne)})}(me);return ne},o.crlf=Is,o.custom=function(V){return o(V(L,z))},o.digit=Mr,o.digits=Nr,o.empty=an,o.end=ji,o.eof=Sa,o.fail=Dt,o.formatError=Be,o.index=Sn,o.isParser=F,o.lazy=At,o.letter=Ss,o.letters=mo,o.lf=Pi,o.lookahead=Et,o.makeFailure=z,o.makeSuccess=L,o.newline=Yo,o.noneOf=function(V){return rn(function(ne){return V.indexOf(ne)<0}).desc("none of '"+V+"'")},o.notFollowedBy=$t,o.of=ft,o.oneOf=function(V){for(var ne=V.split(""),me=0;me<ne.length;me++)ne[me]="'"+ne[me]+"'";return rn(function(Ce){return V.indexOf(Ce)>=0}).desc(ne)},o.optWhitespace=po,o.Parser=o,o.range=function(V,ne){return rn(function(me){return V<=me&&me<=ne}).desc(V+"-"+ne)},o.regex=lt,o.regexp=lt,o.sepBy=Ue,o.sepBy1=Je,o.seq=it,o.seqMap=Vt,o.seqObj=function(){for(var V,ne={},me=0,Ce=(V=arguments,Array.prototype.slice.call(V)),je=Ce.length,Ye=0;Ye<je;Ye+=1){var ze=Ce[Ye];if(!F(ze)){if(H(ze)&&ze.length===2&&typeof ze[0]=="string"&&F(ze[1])){var pt=ze[0];if(Object.prototype.hasOwnProperty.call(ne,pt))throw new Error("seqObj: duplicate key "+pt);ne[pt]=!0,me++;continue}throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.")}}if(me===0)throw new Error("seqObj expects at least one named parser, found zero");return o(function(Yt,On){for(var yn,na={},Fn=0;Fn<je;Fn+=1){var yr,ra;if(H(Ce[Fn])?(yr=Ce[Fn][0],ra=Ce[Fn][1]):(yr=null,ra=Ce[Fn]),!(yn=U(ra._(Yt,On),yn)).status)return yn;yr&&(na[yr]=yn.value),On=yn.index}return U(L(On,na),yn)})},o.string=$e,o.succeed=ft,o.takeWhile=function(V){return ie(V),o(function(ne,me){for(var Ce=me;Ce<ne.length&&V(ce(ne,Ce));)Ce++;return L(Ce,ne.slice(me,Ce))})},o.test=rn,o.whitespace=Nl,o["fantasy-land/empty"]=an,o["fantasy-land/of"]=ft,o.Binary={bitSeq:D,bitSeqObj:function(V){w();var ne={},me=0,Ce=m(function(Ye){if(H(Ye)){var ze=Ye;if(ze.length!==2)throw new Error("["+ze.join(", ")+"] should be length 2, got length "+ze.length);if(ge(ze[0]),fe(ze[1]),Object.prototype.hasOwnProperty.call(ne,ze[0]))throw new Error("duplicate key in bitSeqObj: "+ze[0]);return ne[ze[0]]=!0,me++,ze}return fe(Ye),[null,Ye]},V);if(me<1)throw new Error("bitSeqObj expects at least one named pair, got ["+V.join(", ")+"]");var je=m(function(Ye){return Ye[0]},Ce);return D(m(function(Ye){return Ye[1]},Ce)).map(function(Ye){return d(function(ze,pt){return pt[0]!==null&&(ze[pt[0]]=pt[1]),ze},{},m(function(ze,pt){return[ze,Ye[pt]]},je))})},byte:function(V){if(w(),fe(V),V>255)throw new Error("Value specified to byte constructor ("+V+"=0x"+V.toString(16)+") is larger in value than a single byte.");var ne=(V>15?"0x":"0x0")+V.toString(16);return o(function(me,Ce){var je=ce(me,Ce);return je===V?L(Ce+1,je):z(Ce,ne)})},buffer:function(V){return S("buffer",V).map(function(ne){return Buffer.from(ne)})},encodedString:function(V,ne){return S("string",ne).map(function(me){return me.toString(V)})},uintBE:E,uint8BE:E(1),uint16BE:E(2),uint32BE:E(4),uintLE:A,uint8LE:A(1),uint16LE:A(2),uint32LE:A(4),intBE:N,int8BE:N(1),int16BE:N(2),int32BE:N(4),intLE:R,int8LE:R(1),int16LE:R(2),int32LE:R(4),floatBE:S("floatBE",4).map(function(V){return V.readFloatBE(0)}),floatLE:S("floatLE",4).map(function(V){return V.readFloatLE(0)}),doubleBE:S("doubleBE",8).map(function(V){return V.readDoubleBE(0)}),doubleLE:S("doubleLE",8).map(function(V){return V.readDoubleLE(0)})},n.exports=o}])})})(Q);var f1=()=>/(?:[#*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 NT(e){return e==null?e:e.shiftToAll().normalize()}function pD(e){return e.includes("/")&&(e=e.substring(e.lastIndexOf("/")+1)),e.endsWith(".md")&&(e=e.substring(0,e.length-3)),e}Q.exports.alt(Q.exports.regex(new RegExp(f1(),"")),Q.exports.regex(/[0-9\p{Letter}_-]+/u).map(e=>e.toLocaleLowerCase()),Q.exports.whitespace.map(e=>"-"),Q.exports.any.map(e=>"")).many().map(e=>e.join(""));const pA=Q.exports.alt(Q.exports.regex(new RegExp(f1(),"")),Q.exports.regex(/[0-9\p{Letter}_-]+/u),Q.exports.whitespace.map(e=>" "),Q.exports.any.map(e=>" ")).many().map(e=>e.join("").split(/\s+/).join(" ").trim());function gA(e){return pA.tryParse(e)}function vA(e){return e=NT(e),e=et.fromObject(Object.fromEntries(Object.entries(e.toObject()).filter(([,t])=>t>0))),e.toHuman()}var Xh;(function(e){function t(F,H=c1,P=!1){let L=n(F);if(!L)return H.renderNullAs;switch(L.type){case"null":return H.renderNullAs;case"string":return L.value;case"number":case"boolean":return""+L.value;case"html":return L.value.outerHTML;case"widget":return L.value.markdown();case"link":return L.value.markdown();case"function":return"<function>";case"array":let z="";return P&&(z+="["),z+=L.value.map(U=>t(U,H,!0)).join(", "),P&&(z+="]"),z;case"object":return"{ "+Object.entries(L.value).map(U=>U[0]+": "+t(U[1],H,!0)).join(", ")+" }";case"date":return L.value.second==0&&L.value.hour==0&&L.value.minute==0?L.value.toFormat(H.defaultDateFormat):L.value.toFormat(H.defaultDateTimeFormat);case"duration":return vA(L.value)}}e.toString=t;function n(F){return w(F)?{type:"null",value:F}:m(F)?{type:"number",value:F}:d(F)?{type:"string",value:F}:S(F)?{type:"boolean",value:F}:g(F)?{type:"duration",value:F}:p(F)?{type:"date",value:F}:E(F)?{type:"widget",value:F}:D(F)?{type:"array",value:F}:T(F)?{type:"link",value:F}:R(F)?{type:"function",value:F}:A(F)?{type:"html",value:F}:N(F)?{type:"object",value:F}:void 0}e.wrapValue=n;function r(F,H){if(N(F)){let P={};for(let[L,z]of Object.entries(F))P[L]=r(z,H);return P}else if(D(F)){let P=[];for(let L of F)P.push(r(L,H));return P}else return H(F)}e.mapLeaves=r;function a(F,H,P){var L,z;if(F===void 0&&(F=null),H===void 0&&(H=null),F===null&&H===null)return 0;if(F===null)return-1;if(H===null)return 1;let U=n(F),W=n(H);if(U===void 0&&W===void 0)return 0;if(U===void 0)return-1;if(W===void 0)return 1;if(U.type!=W.type)return U.type.localeCompare(W.type);if(U.value===W.value)return 0;switch(U.type){case"string":return U.value.localeCompare(W.value);case"number":return U.value<W.value?-1:U.value==W.value?0:1;case"null":return 0;case"boolean":return U.value==W.value?0:U.value?1:-1;case"link":let K=U.value,ae=W.value,ce=P??(ve=>ve),fe=ce(K.path).localeCompare(ce(ae.path));if(fe!=0)return fe;let ie=K.type.localeCompare(ae.type);return ie!=0?ie:K.subpath&&!ae.subpath?1:!K.subpath&&ae.subpath?-1:!K.subpath&&!ae.subpath?0:((L=K.subpath)!==null&&L!==void 0?L:"").localeCompare((z=ae.subpath)!==null&&z!==void 0?z:"");case"date":return U.value<W.value?-1:U.value.equals(W.value)?0:1;case"duration":return U.value<W.value?-1:U.value.equals(W.value)?0:1;case"array":let ge=U.value,Te=W.value;for(let ve=0;ve<Math.min(ge.length,Te.length);ve++){let De=a(ge[ve],Te[ve]);if(De!=0)return De}return ge.length-Te.length;case"object":let se=U.value,we=W.value,Z=Array.from(Object.keys(se)),$=Array.from(Object.keys(we));Z.sort(),$.sort();let X=a(Z,$);if(X!=0)return X;for(let ve of Z){let De=a(se[ve],we[ve]);if(De!=0)return De}return 0;case"widget":case"html":case"function":return 0}}e.compareValue=a;function o(F){var H;return(H=n(F))===null||H===void 0?void 0:H.type}e.typeOf=o;function s(F){let H=n(F);if(!H)return!1;switch(H.type){case"number":return H.value!=0;case"string":return H.value.length>0;case"boolean":return H.value;case"link":return!!H.value.path;case"date":return H.value.toMillis()!=0;case"duration":return H.value.as("seconds")!=0;case"object":return Object.keys(H.value).length>0;case"array":return H.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}e.isTruthy=s;function u(F){if(F==null)return F;if(e.isArray(F))return[].concat(F.map(H=>u(H)));if(e.isObject(F)){let H={};for(let[P,L]of Object.entries(F))H[P]=u(L);return H}else return F}e.deepCopy=u;function d(F){return typeof F=="string"}e.isString=d;function m(F){return typeof F=="number"}e.isNumber=m;function p(F){return F instanceof st}e.isDate=p;function g(F){return F instanceof et}e.isDuration=g;function w(F){return F==null}e.isNull=w;function D(F){return Array.isArray(F)}e.isArray=D;function S(F){return typeof F=="boolean"}e.isBoolean=S;function T(F){return F instanceof _r}e.isLink=T;function E(F){return F instanceof h1}e.isWidget=E;function A(F){return typeof HTMLElement<"u"?F instanceof HTMLElement:!1}e.isHtml=A;function N(F){return typeof F=="object"&&!A(F)&&!E(F)&&!D(F)&&!g(F)&&!p(F)&&!T(F)&&F!==void 0&&!w(F)}e.isObject=N;function R(F){return typeof F=="function"}e.isFunction=R})(Xh||(Xh={}));var gD;(function(e){function t(a){return Xh.isObject(a)&&Object.keys(a).length==2&&"key"in a&&"rows"in a}e.isElementGroup=t;function n(a){for(let o of a)if(!t(o))return!1;return!0}e.isGrouping=n;function r(a){if(n(a)){let o=0;for(let s of a)o+=r(s.rows);return o}else return a.length}e.count=r})(gD||(gD={}));class _r{constructor(t){Object.assign(this,t)}static file(t,n=!1,r){return new _r({path:t,embed:n,display:r,subpath:void 0,type:"file"})}static infer(t,n=!1,r){if(t.includes("#^")){let a=t.split("#^");return _r.block(a[0],a[1],n,r)}else if(t.includes("#")){let a=t.split("#");return _r.header(a[0],a[1],n,r)}else return _r.file(t,n,r)}static header(t,n,r,a){return new _r({path:t,embed:r,display:a,subpath:gA(n),type:"header"})}static block(t,n,r,a){return new _r({path:t,embed:r,display:a,subpath:n,type:"block"})}static fromObject(t){return new _r(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 _r(Object.assign({},this,{path:t}))}withDisplay(t){return new _r(Object.assign({},this,{display:t}))}withHeader(t){return _r.header(this.path,t,this.embed,this.display)}toFile(){return _r.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let t=new _r(this);return t.embed=!0,t}}fromEmbed(){if(this.embed){let t=new _r(this);return t.embed=!1,t}else return this}markdown(){let t=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?t+="|"+this.display:(t+="|"+pD(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 pD(this.path).replace(".md","")}}class h1{constructor(t){this.$widget=t}}class yA extends h1{constructor(t,n){super("dataview:list-pair"),this.key=t,this.value=n}markdown(){return`${Xh.toString(this.key)}: ${Xh.toString(this.value)}`}}class wA extends h1{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 vD;(function(e){function t(s,u){return new yA(s,u)}e.listPair=t;function n(s,u){return new wA(s,u)}e.externalLink=n;function r(s){return s.$widget==="dataview:list-pair"}e.isListPair=r;function a(s){return s.$widget==="dataview:external-link"}e.isExternalLink=a;function o(s){return r(s)||a(s)}e.isBuiltin=o})(vD||(vD={}));var Mn;(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,D,S){return{type:"binaryop",left:w,op:D,right:S}}e.binaryOp=r;function a(w,D){return{type:"index",object:w,index:D}}e.index=a;function o(w){let D=w.split("."),S=e.variable(D[0]);for(let T=1;T<D.length;T++)S=e.index(S,e.literal(D[T]));return S}e.indexVariable=o;function s(w,D){return{type:"lambda",arguments:w,value:D}}e.lambda=s;function u(w,D){return{type:"function",func:w,arguments:D}}e.func=u;function d(w){return{type:"list",values:w}}e.list=d;function m(w){return{type:"object",values:w}}e.object=m;function p(w){return{type:"negated",child:w}}e.negate=p;function g(w){return w=="<="||w=="<"||w==">"||w==">="||w=="!="||w=="="}e.isCompareOp=g,e.NULL=e.literal(null)})(Mn||(Mn={}));var Ei;(function(e){function t(p){return{type:"tag",tag:p}}e.tag=t;function n(p){return{type:"csv",path:p}}e.csv=n;function r(p){return{type:"folder",folder:p}}e.folder=r;function a(p,g){return{type:"link",file:p,direction:g?"incoming":"outgoing"}}e.link=a;function o(p,g,w){return{type:"binaryop",left:p,op:g,right:w}}e.binaryOp=o;function s(p,g){return{type:"binaryop",left:p,op:"&",right:g}}e.and=s;function u(p,g){return{type:"binaryop",left:p,op:"|",right:g}}e.or=u;function d(p){return{type:"negate",child:p}}e.negate=d;function m(){return{type:"empty"}}e.empty=m})(Ei||(Ei={}));const yD=new RegExp(f1(),""),Tw={year:et.fromObject({years:1}),years:et.fromObject({years:1}),yr:et.fromObject({years:1}),yrs:et.fromObject({years:1}),month:et.fromObject({months:1}),months:et.fromObject({months:1}),mo:et.fromObject({months:1}),mos:et.fromObject({months:1}),week:et.fromObject({weeks:1}),weeks:et.fromObject({weeks:1}),wk:et.fromObject({weeks:1}),wks:et.fromObject({weeks:1}),w:et.fromObject({weeks:1}),day:et.fromObject({days:1}),days:et.fromObject({days:1}),d:et.fromObject({days:1}),hour:et.fromObject({hours:1}),hours:et.fromObject({hours:1}),hr:et.fromObject({hours:1}),hrs:et.fromObject({hours:1}),h:et.fromObject({hours:1}),minute:et.fromObject({minutes:1}),minutes:et.fromObject({minutes:1}),min:et.fromObject({minutes:1}),mins:et.fromObject({minutes:1}),m:et.fromObject({minutes:1}),second:et.fromObject({seconds:1}),seconds:et.fromObject({seconds:1}),sec:et.fromObject({seconds:1}),secs:et.fromObject({seconds:1}),s:et.fromObject({seconds:1})},Ew={now:()=>st.local(),today:()=>st.local().startOf("day"),yesterday:()=>st.local().startOf("day").minus(et.fromObject({days:1})),tomorrow:()=>st.local().startOf("day").plus(et.fromObject({days:1})),sow:()=>st.local().startOf("week"),"start-of-week":()=>st.local().startOf("week"),eow:()=>st.local().endOf("week"),"end-of-week":()=>st.local().endOf("week"),soy:()=>st.local().startOf("year"),"start-of-year":()=>st.local().startOf("year"),eoy:()=>st.local().endOf("year"),"end-of-year":()=>st.local().endOf("year"),som:()=>st.local().startOf("month"),"start-of-month":()=>st.local().startOf("month"),eom:()=>st.local().endOf("month"),"end-of-month":()=>st.local().endOf("month")},xw=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function bA(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 DA(e){let[t,n]=bA(e);return _r.infer(t,!1,n)}function Fh(e,t,n){return Q.exports.seqMap(e,Q.exports.seq(Q.exports.optWhitespace,t,Q.exports.optWhitespace,e).many(),(r,a)=>{if(a.length==0)return r;let o=n(r,a[0][1],a[0][3]);for(let s=1;s<a.length;s++)o=n(o,a[s][1],a[s][3]);return o})}function SA(e,...t){return Q.exports.custom((n,r)=>(a,o)=>{let s=e._(a,o);if(!s.status)return s;for(let u of t){let d=u(s.value)._(a,s.index);if(!d.status)return s;s=d}return s})}const Fo=Q.exports.createLanguage({number:e=>Q.exports.regexp(/-?[0-9]+(\.[0-9]+)?/).map(t=>Number.parseFloat(t)).desc("number"),string:e=>Q.exports.string('"').then(Q.exports.alt(e.escapeCharacter,Q.exports.noneOf('"\\')).atLeast(0).map(t=>t.join(""))).skip(Q.exports.string('"')).desc("string"),escapeCharacter:e=>Q.exports.string("\\").then(Q.exports.any).map(t=>t==='"'?'"':t==="\\"?"\\":"\\"+t),bool:e=>Q.exports.regexp(/true|false|True|False/).map(t=>t.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:e=>Q.exports.seqMap(Q.exports.string("#"),Q.exports.alt(Q.exports.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(t,n)=>t+n.join("")).desc("tag ('#hello/stuff')"),identifier:e=>Q.exports.seqMap(Q.exports.alt(Q.exports.regexp(new RegExp("\\p{Letter}","u")),Q.exports.regexp(yD).desc("text")),Q.exports.alt(Q.exports.regexp(/[0-9\p{Letter}_-]/u),Q.exports.regexp(yD).desc("text")).many(),(t,n)=>t+n.join("")).desc("variable identifier"),link:e=>Q.exports.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(t=>DA(t)).desc("file link"),embedLink:e=>Q.exports.seqMap(Q.exports.string("!").atMost(1),e.link,(t,n)=>(t.length>0&&(n.embed=!0),n)).desc("file link"),binaryPlusMinus:e=>Q.exports.regexp(/\+|-/).map(t=>t).desc("'+' or '-'"),binaryMulDiv:e=>Q.exports.regexp(/\*|\/|%/).map(t=>t).desc("'*' or '/' or '%'"),binaryCompareOp:e=>Q.exports.regexp(/>=|<=|!=|>|<|=/).map(t=>t).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:e=>Q.exports.regexp(/and|or|&|\|/i).map(t=>t.toLowerCase()=="and"?"&":t.toLowerCase()=="or"?"|":t).desc("'and' or 'or'"),rootDate:e=>Q.exports.seqMap(Q.exports.regexp(/\d{4}/),Q.exports.string("-"),Q.exports.regexp(/\d{2}/),(t,n,r)=>st.fromObject({year:Number.parseInt(t),month:Number.parseInt(r)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:e=>Q.exports.alt(...Object.keys(Ew).sort((t,n)=>n.length-t.length).map(Q.exports.string)),date:e=>SA(e.rootDate,t=>Q.exports.seqMap(Q.exports.string("-"),Q.exports.regexp(/\d{2}/),(n,r)=>t.set({day:Number.parseInt(r)})),t=>Q.exports.seqMap(Q.exports.string("T"),Q.exports.regexp(/\d{2}/),(n,r)=>t.set({hour:Number.parseInt(r)})),t=>Q.exports.seqMap(Q.exports.string(":"),Q.exports.regexp(/\d{2}/),(n,r)=>t.set({minute:Number.parseInt(r)})),t=>Q.exports.seqMap(Q.exports.string(":"),Q.exports.regexp(/\d{2}/),(n,r)=>t.set({second:Number.parseInt(r)})),t=>Q.exports.alt(Q.exports.seqMap(Q.exports.string("."),Q.exports.regexp(/\d{3}/),(n,r)=>t.set({millisecond:Number.parseInt(r)})),Q.exports.succeed(t)),t=>Q.exports.alt(Q.exports.seqMap(Q.exports.string("+").or(Q.exports.string("-")),Q.exports.regexp(/\d{1,2}(:\d{2})?/),(n,r)=>t.setZone("UTC"+n+r,{keepLocalTime:!0})),Q.exports.seqMap(Q.exports.string("Z"),()=>t.setZone("utc",{keepLocalTime:!0})),Q.exports.seqMap(Q.exports.string("["),Q.exports.regexp(/[0-9A-Za-z+-\/]+/u),Q.exports.string("]"),(n,r,a)=>t.setZone(r,{keepLocalTime:!0})))).assert(t=>t.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:e=>Q.exports.alt(e.dateShorthand.map(t=>Ew[t]()),e.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:e=>Q.exports.alt(...Object.keys(Tw).sort((t,n)=>n.length-t.length).map(Q.exports.string)),duration:e=>Q.exports.seqMap(e.number,Q.exports.optWhitespace,e.durationType,(t,n,r)=>Tw[r].mapUnits(a=>a*t)).sepBy1(Q.exports.string(",").trim(Q.exports.optWhitespace).or(Q.exports.optWhitespace)).map(t=>t.reduce((n,r)=>n.plus(r))).desc("duration like 4hr2min"),rawNull:e=>Q.exports.string("null"),tagSource:e=>e.tag.map(t=>Ei.tag(t)),csvSource:e=>Q.exports.seqMap(Q.exports.string("csv(").skip(Q.exports.optWhitespace),e.string,Q.exports.string(")"),(t,n,r)=>Ei.csv(n)),linkIncomingSource:e=>e.link.map(t=>Ei.link(t.path,!0)),linkOutgoingSource:e=>Q.exports.seqMap(Q.exports.string("outgoing(").skip(Q.exports.optWhitespace),e.link,Q.exports.string(")"),(t,n,r)=>Ei.link(n.path,!1)),folderSource:e=>e.string.map(t=>Ei.folder(t)),parensSource:e=>Q.exports.seqMap(Q.exports.string("("),Q.exports.optWhitespace,e.source,Q.exports.optWhitespace,Q.exports.string(")"),(t,n,r,a,o)=>r),negateSource:e=>Q.exports.seqMap(Q.exports.alt(Q.exports.string("-"),Q.exports.string("!")),e.atomSource,(t,n)=>Ei.negate(n)),atomSource:e=>Q.exports.alt(e.parensSource,e.negateSource,e.linkOutgoingSource,e.linkIncomingSource,e.folderSource,e.tagSource,e.csvSource),binaryOpSource:e=>Fh(e.atomSource,e.binaryBooleanOp.map(t=>t),Ei.binaryOp),source:e=>e.binaryOpSource,variableField:e=>e.identifier.chain(t=>xw.includes(t.toUpperCase())?Q.exports.fail("Variable fields cannot be a keyword ("+xw.join(" or ")+")"):Q.exports.succeed(Mn.variable(t))).desc("variable"),numberField:e=>e.number.map(t=>Mn.literal(t)).desc("number"),stringField:e=>e.string.map(t=>Mn.literal(t)).desc("string"),boolField:e=>e.bool.map(t=>Mn.literal(t)).desc("boolean"),dateField:e=>Q.exports.seqMap(Q.exports.string("date("),Q.exports.optWhitespace,e.datePlus,Q.exports.optWhitespace,Q.exports.string(")"),(t,n,r,a,o)=>Mn.literal(r)).desc("date"),durationField:e=>Q.exports.seqMap(Q.exports.string("dur("),Q.exports.optWhitespace,e.duration,Q.exports.optWhitespace,Q.exports.string(")"),(t,n,r,a,o)=>Mn.literal(r)).desc("duration"),nullField:e=>e.rawNull.map(t=>Mn.NULL),linkField:e=>e.link.map(t=>Mn.literal(t)),listField:e=>e.field.sepBy(Q.exports.string(",").trim(Q.exports.optWhitespace)).wrap(Q.exports.string("[").skip(Q.exports.optWhitespace),Q.exports.optWhitespace.then(Q.exports.string("]"))).map(t=>Mn.list(t)).desc("list ('[1, 2, 3]')"),objectField:e=>Q.exports.seqMap(e.identifier.or(e.string),Q.exports.string(":").trim(Q.exports.optWhitespace),e.field,(t,n,r)=>({name:t,value:r})).sepBy(Q.exports.string(",").trim(Q.exports.optWhitespace)).wrap(Q.exports.string("{").skip(Q.exports.optWhitespace),Q.exports.optWhitespace.then(Q.exports.string("}"))).map(t=>{let n={};for(let r of t)n[r.name]=r.value;return Mn.object(n)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:e=>Q.exports.alt(e.date,e.duration.map(t=>NT(t)),e.string,e.tag,e.embedLink,e.bool,e.number,e.rawNull),inlineFieldList:e=>e.atomInlineField.sepBy(Q.exports.string(",").trim(Q.exports.optWhitespace).lookahead(e.atomInlineField)),inlineField:e=>Q.exports.alt(Q.exports.seqMap(e.atomInlineField,Q.exports.string(",").trim(Q.exports.optWhitespace),e.inlineFieldList,(t,n,r)=>[t].concat(r)),e.atomInlineField),atomField:e=>Q.exports.alt(e.embedLink.map(t=>Mn.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=>Q.exports.seqMap(e.atomField,Q.exports.alt(e.dotPostfix,e.indexPostfix,e.functionPostfix).many(),(t,n)=>{let r=t;for(let a of n)switch(a.type){case"dot":r=Mn.index(r,Mn.literal(a.field));break;case"index":r=Mn.index(r,a.field);break;case"function":r=Mn.func(r,a.fields);break}return r}),negatedField:e=>Q.exports.seqMap(Q.exports.string("!"),e.indexField,(t,n)=>Mn.negate(n)).desc("negated field"),parensField:e=>Q.exports.seqMap(Q.exports.string("("),Q.exports.optWhitespace,e.field,Q.exports.optWhitespace,Q.exports.string(")"),(t,n,r,a,o)=>r),lambdaField:e=>Q.exports.seqMap(e.identifier.sepBy(Q.exports.string(",").trim(Q.exports.optWhitespace)).wrap(Q.exports.string("(").trim(Q.exports.optWhitespace),Q.exports.string(")").trim(Q.exports.optWhitespace)),Q.exports.string("=>").trim(Q.exports.optWhitespace),e.field,(t,n,r)=>({type:"lambda",arguments:t,value:r})),dotPostfix:e=>Q.exports.seqMap(Q.exports.string("."),e.identifier,(t,n)=>({type:"dot",field:n})),indexPostfix:e=>Q.exports.seqMap(Q.exports.string("["),Q.exports.optWhitespace,e.field,Q.exports.optWhitespace,Q.exports.string("]"),(t,n,r,a,o)=>({type:"index",field:r})),functionPostfix:e=>Q.exports.seqMap(Q.exports.string("("),Q.exports.optWhitespace,e.field.sepBy(Q.exports.string(",").trim(Q.exports.optWhitespace)),Q.exports.optWhitespace,Q.exports.string(")"),(t,n,r,a,o)=>({type:"function",fields:r})),binaryMulDivField:e=>Fh(e.indexField,e.binaryMulDiv,Mn.binaryOp),binaryPlusMinusField:e=>Fh(e.binaryMulDivField,e.binaryPlusMinus,Mn.binaryOp),binaryCompareField:e=>Fh(e.binaryPlusMinusField,e.binaryCompareOp,Mn.binaryOp),binaryBooleanField:e=>Fh(e.binaryCompareField,e.binaryBooleanOp,Mn.binaryOp),binaryOpField:e=>e.binaryBooleanField,field:e=>e.binaryOpField});function IA(e){try{return sv.success(Fo.field.tryParse(e))}catch(t){return sv.failure(""+t)}}var lv;(function(e){function t(r,a){return{name:r,field:a}}e.named=t;function n(r,a){return{field:r,direction:a}}e.sortBy=n})(lv||(lv={}));function TA(e){return Q.exports.custom((t,n)=>(r,a)=>{let o=e._(r,a);return o.status?Object.assign({},o,{value:[o.value,r.substring(a,o.index)]}):o})}function EA(e){return e.split(/[\r\n]+/).map(t=>t.trim()).join("")}const xA=Q.exports.createLanguage({queryType:e=>Q.exports.alt(Q.exports.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(t=>t.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:e=>Q.exports.seqMap(Fo.field.skip(Q.exports.whitespace),Q.exports.regexp(/AS/i).skip(Q.exports.whitespace),Fo.identifier.or(Fo.string),(t,n,r)=>lv.named(r,t)),namedField:e=>Q.exports.alt(e.explicitNamedField,TA(Fo.field).map(([t,n])=>lv.named(EA(n),t))),sortField:e=>Q.exports.seqMap(Fo.field.skip(Q.exports.optWhitespace),Q.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(Q.exports.whitespace).chain(t=>{switch(t){case"table":return Q.exports.seqMap(Q.exports.regexp(/WITHOUT\s+ID/i).skip(Q.exports.optWhitespace).atMost(1),Q.exports.sepBy(e.namedField,Q.exports.string(",").trim(Q.exports.optWhitespace)),(n,r)=>({type:"table",fields:r,showId:n.length==0}));case"list":return Q.exports.seqMap(Q.exports.regexp(/WITHOUT\s+ID/i).skip(Q.exports.optWhitespace).atMost(1),Fo.field.atMost(1),(n,r)=>({type:"list",format:r.length==1?r[0]:void 0,showId:n.length==0}));case"task":return Q.exports.succeed({type:"task"});case"calendar":return Q.exports.seqMap(e.namedField,n=>({type:"calendar",showId:!0,field:n}));default:return Q.exports.fail(`Unrecognized query type '${t}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:e=>Q.exports.seqMap(Q.exports.regexp(/FROM/i),Q.exports.whitespace,Fo.source,(t,n,r)=>r),whereClause:e=>Q.exports.seqMap(Q.exports.regexp(/WHERE/i),Q.exports.whitespace,Fo.field,(t,n,r)=>({type:"where",clause:r})).desc("WHERE <expression>"),sortByClause:e=>Q.exports.seqMap(Q.exports.regexp(/SORT/i),Q.exports.whitespace,e.sortField.sepBy1(Q.exports.string(",").trim(Q.exports.optWhitespace)),(t,n,r)=>({type:"sort",fields:r})).desc("SORT field [ASC/DESC]"),limitClause:e=>Q.exports.seqMap(Q.exports.regexp(/LIMIT/i),Q.exports.whitespace,Fo.field,(t,n,r)=>({type:"limit",amount:r})).desc("LIMIT <value>"),flattenClause:e=>Q.exports.seqMap(Q.exports.regexp(/FLATTEN/i).skip(Q.exports.whitespace),e.namedField,(t,n)=>({type:"flatten",field:n})).desc("FLATTEN <value> [AS <name>]"),groupByClause:e=>Q.exports.seqMap(Q.exports.regexp(/GROUP BY/i).skip(Q.exports.whitespace),e.namedField,(t,n)=>({type:"group",field:n})).desc("GROUP BY <value> [AS <name>]"),clause:e=>Q.exports.alt(e.fromClause,e.whereClause,e.sortByClause,e.limitClause,e.groupByClause,e.flattenClause),query:e=>Q.exports.seqMap(e.headerClause.trim(Q.exports.optWhitespace),e.fromClause.trim(Q.exports.optWhitespace).atMost(1),e.clause.trim(Q.exports.optWhitespace).many(),(t,n,r)=>({header:t,source:n.length==0?Ei.folder(""):n[0],operations:r,settings:c1}))}),CA=e=>{var t;return e?(t=e.plugins.plugins.dataview)===null||t===void 0?void 0:t.api:window.DataviewAPI},MA=e=>e.plugins.enabledPlugins.has("dataview");bs.DATE_SHORTHANDS=Ew;bs.DURATION_TYPES=Tw;bs.EXPRESSION=Fo;bs.KEYWORDS=xw;bs.QUERY_LANGUAGE=xA;var NA=bs.getAPI=CA;bs.isPluginEnabled=MA;bs.parseField=IA;async function kA(e,t,n,r,a){var E,A;const{vault:o,metadataCache:s}=Ee.getState().dailyNotesState.app===void 0?app:Ee.getState().dailyNotesState.app,u=Ee.getState().dailyNotesState.settings,d=e.replace(/\n/g,"<br>");if(n===void 0)return;const m=s.getFirstLinkpathDest("",n),p=x.moment(),g=p.format("YYYYMMDDHHmmss"),w=r.slice(14),D=" ",S=g+" "+d.trim(),T=D+"- "+g+" "+d.trim();if(m){let N;if(u!=null&&u.CommentOnMemos&&(u!=null&&u.CommentsInOriginalNotes)){const P=NA();if(P!==void 0)try{N=(A=(E=P.page(m.path))==null?void 0:E.file.lists.values)==null?void 0:A.filter(L=>L.line===parseInt(w))}catch(L){console.error(L)}}const R=await o.read(m);let F=0;N[0].children.values.length>0?F=N[0].children.values[N[0].children.values.length-1].line:F=N[0].line;const H=await AA(T,R,F);if(await o.modify(m,H.content),t)return{id:g+(F+1),content:S,deletedAt:"",createdAt:p.format("YYYY/MM/DD HH:mm:ss"),updatedAt:p.format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",path:m.path,hasId:"",linkId:a}}}async function AA(e,t,n){if(n===-1)return{content:`${t}
${e}`,posNum:-1};const r=t.split(`
`),a=r.slice(0,n+1).join(`
`),o=r.slice(n+1).join(`
`);return/^\s*$/g.test(r[n+1])?{content:`${a}
${e}
${o}`,posNum:n}:{content:`${a}
${e}
${o}`,posNum:n}}const m1=async e=>{const t=rt.getState().app,n=t.metadataCache.getFirstLinkpathDest("",e);if(!n){new x.Notice(k("File not found for the given thino path"));return}await t.workspace.getLeaf("split").openFile(n)},p1=async(e,t)=>{const{app:n}=rt.getState(),r=parseInt(e.slice(14)),a=n.metadataCache.getFirstLinkpathDest("",t);if(!x.Platform.isMobile)await n.workspace.getLeaf("split").openFile(a,{eState:{line:r}});else{let o=n.workspace.activeLeaf;o===null&&(o=n.workspace.getLeaf(!1)),await o.openFile(a,{eState:{line:r}})}},g1=async(e,t)=>{var d;const n=rt.getState().app,r=n.metadataCache.getFirstLinkpathDest("",t);if(!r){new x.Notice(k("File not found for the given thino path"));return}let a="";try{a=await n.vault.read(r)}catch(m){console.error(m),a=await n.vault.cachedRead(r)}const s=a.split(/\r?\n/).findIndex(m=>m.contains(e)),u=n.workspace.getLeaf("split");await u.openFile(r,{eState:{line:s}});try{(d=u.view.editor)==null||d.setCursor({line:s,ch:1})}catch(m){console.error(m)}},v1=async(e,t)=>{var u;const n=rt.getState().app,r=(d,m)=>{var g;const p=(g=Array.from(d.nodes.values()))==null?void 0:g.find(w=>w.id===m);return p?(d.selectOnly(p),d.zoomToSelection(),!0):!1},a=n.workspace.getLeavesOfType("canvas");for(const d of a){const m=d.view;if(((u=m==null?void 0:m.file)==null?void 0:u.path)===t&&r(m.canvas,e))return}const o=n.metadataCache.getFirstLinkpathDest("",t);if(!o){new x.Notice(k("File not found for the given thino path"));return}const s=n.workspace.getLeaf("split");await s.openFile(o),setTimeout(()=>{var d;r((d=s.view)==null?void 0:d.canvas,e)},10)},OA="https://api.thino.pkmer.cn/test",Zd=OA,FA="unknown",PA=/!\[(?<content>[^\]]+)\]\((?<link>[^)]+)\)/g;function jA(e){return e.substring(e.lastIndexOf(".")+1)}function LA(e){return{id:e.id,createdAt:Date.now().toString(),filename:e.id,type:`${jA(e.id)}`,size:e.size.toString()}}function RA(e){const t=e==null?void 0:e.matchAll(PA);return t?Array.from(t).map(n=>{var r;return LA({url:(r=n.groups)==null?void 0:r.link,id:FA,size:0,mtime:""})}).filter(n=>n.type!="html"):[]}function Em(e){var t;return{id:e.id,createdAt:x.moment(e.ctime.toString(),"x").format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.moment(e.mtime.toString(),"x").format("YYYY/MM/DD HH:mm:ss"),deletedAt:(t=e.ttime)!=null&&t.toString()?x.moment(e.ttime.toString(),"x").format("YYYY-MM-DD HH:mm:ss"):"",rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,resourceList:RA(e.content),creatorName:"thino",sourceType:(e==null?void 0:e.thinoType)||"FILE",visibility:"PUBLIC",localId:e.originalId,deleted:!!e.dtime}}async function _A(e){const n={url:`${Zd}/thino/getThinos${e?`?since=${e}&includeDeleted=true`:""}`,method:"GET",headers:{Authorization:`Bearer ${Wd()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to fetch memos: ${r.status}`);try{return r.json.payload.map(o=>Em(o))}catch(a){console.error(`Error processing memo response: ${a}`)}}).catch(r=>(console.error(r),[]))}function Wd(){const e=Ee.getState().dailyNotesState.app||app;return(e==null?void 0:e.loadLocalStorage("tokenForSync"))||""}async function kT(e){const t=`${Zd}/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 ${Wd()}`}};return x.requestUrl(r).then(a=>{a.status>=400&&console.error(`Failed to create memo: ${a.status}`);try{const o=a.json;return Em(o.payload)}catch(o){console.error(`Error processing memo creation response: ${o}`)}}).catch(a=>(console.error(a),null))}function HA(e){return{id:e.id,ctime:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").valueOf(),mtime:x.moment(e.updatedAt,"YYYY/MM/DD HH:mm:ss").valueOf(),ttime:e.deletedAt?x.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 BA(e){const t=`${Zd}/thino/createThinosByData`,n=e.map(a=>HA(a)),r={url:t,method:"POST",contentType:"application/json",body:JSON.stringify(n),headers:{Authorization:`Bearer ${Wd()}`}};return x.requestUrl(r).then(a=>{a.status>=400&&console.error(`Failed to create thinos: ${a.status}`);try{return a.json.payload.map(u=>Em(u))}catch(o){console.error(`Error processing thinos creation response: ${o}`)}}).catch(a=>(console.error(a),[]))}async function M0(e){const n={url:`${Zd}/thino/updateThinoById/${e.id}`,method:"POST",contentType:"application/json",body:JSON.stringify(e),headers:{Authorization:`Bearer ${Wd()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to update memo: ${r.status}`);try{const a=r.json;return Em(a.payload)}catch(a){console.error(`Error processing memo update response: ${a}`)}}).catch(r=>(console.error(r),null))}async function AT(e){const n={url:`${Zd}/thino/recoverThinoFromTrash/${e}`,method:"POST",headers:{Authorization:`Bearer ${Wd()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to recover memo: ${r.status}`);try{const a=r.json;return Em(a.payload)}catch(a){console.error(`Error processing memo recovery response: ${a}`)}}).catch(r=>(console.error(r),null))}async function YA(e){const n={url:`${Zd}/thino/deleteThinoById/${e}`,method:"DELETE",headers:{Authorization:`Bearer ${Wd()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to delete memo: ${r.status}`)}).catch(r=>(console.error(r),null))}class zA{constructor(){he(this,"initialized",!1)}getState(){return Ee.getState().memoState}async fetchAllMemos(){const t=rt.getState().settings,n=await va.getMyMemos(t.EnabledLocationList.map(o=>o.value)),r=[...n.memos],a=[...n.commentMemos];return Ee.dispatch({type:"SET_MEMOS",payload:{memos:r}}),Ee.dispatch({type:"SET_COMMENT_MEMOS",payload:{commentMemos:a}}),this.initialized||(this.initialized=!0,Qe.setLoaded(!0)),r}async updateTypeMemos(t){const n=await va.updateSpecificTypeMemo(t),r=this.getState().memos.filter(a=>a.sourceType!==t);Ee.dispatch({type:"SET_MEMOS",payload:{memos:[...r,...n.memos]}})}async removeTypeMemos(t){const n=this.getState().memos.filter(r=>r.sourceType!==t);Ee.dispatch({type:"SET_MEMOS",payload:{memos:[...n]}})}async fetchDeletedMemos(){const t=await va.getMyDeletedMemos();return t.sort((n,r)=>Re.getTimeStampByDate(r.deletedAt)-Re.getTimeStampByDate(n.deletedAt)),t}pushMemo(t){Ee.dispatch({type:"INSERT_MEMO",payload:{memo:{...t}}})}pushCommentMemo(t){Ee.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 a=this.getMemoByWebId(t);if(!a)return;let o=null;const s=r?{}:{content:n.content,rowStatus:n.rowStatus,pinned:n.pinned,deleted:!!n.deletedAt,thinoType:n.thinoType??""};switch(a.sourceType){case"DAILY":o=await Ti(a,{id:a.id,webId:n.id,...s});break;case"CANVAS":o=await Ii(a,{id:a.id,webId:n.id,...s});break;case"MULTI":o=await Po(a,{id:a.id,webId:n.id,...s});break;case"FILE":o=await Si(a,{id:a.id,webId:n.id,...s});break}if(!o)return a;Ee.dispatch({type:"EDIT_MEMO",payload:o})}async archiveThinoBulk(t){const n=[];for(const r of t){let a;switch(r.sourceType){case"DAILY":a=await Ti(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"CANVAS":a=await Ii(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"MULTI":a=await Po(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"FILE":a=await Si(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break}}return n.length>0?(Ee.dispatch({type:"ARCHIVE_MEMO_BY_ID_BULK",payload:n}),n):t}async archiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await Ti(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"CANVAS":n=await Ii(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"MULTI":n=await Po(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"FILE":n=await Si(t,{id:t.id,rowStatus:"ARCHIVED"});break}return n?(Ee.dispatch({type:"ARCHIVE_MEMO_BY_ID",payload:n}),n):t}async unarchiveThinoBulk(t){const n=[];for(const r of t){let a;switch(r.sourceType){case"DAILY":a=await Ti(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"CANVAS":a=await Ii(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"MULTI":a=await Po(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"FILE":a=await Si(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break}}return n.length>0?(Ee.dispatch({type:"ARCHIVE_MEMO_BY_ID_BULK",payload:n}),n):t}async unarchiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await Ti(t,{id:t.id,rowStatus:"NORMAL"});break;case"CANVAS":n=await Ii(t,{id:t.id,rowStatus:"NORMAL"});break;case"MULTI":n=await Po(t,{id:t.id,rowStatus:"NORMAL"});break;case"FILE":n=await Si(t,{id:t.id,rowStatus:"NORMAL"});break}return Ee.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 Ti(n,{id:n.id,deleted:!0});break;case"CANVAS":r=await Ii(n,{id:n.id,deleted:!0});break;case"MULTI":r=await Po(n,{id:n.id,deleted:!0});break;case"FILE":r=await Si(n,{id:n.id,deleted:!0});break}if(!r)return n;if(r)return r}async restoreMemoById(t){return await va.restoreMemo(t)}async deleteMemoById(t,n){const r=this.getMemoById(t);try{switch(r.sourceType){case"DAILY":await va.deleteMemoInDailyNote(r);break;case"CANVAS":await va.deleteMemoInCanvas(r);break;case"MULTI":await va.deleteMemoInMultiFiles(r);break;case"FILE":await va.deleteMemoInSingleFile(r);break}Ee.dispatch({type:"DELETE_MEMO_BY_ID",payload:{id:t}})}catch(u){console.error(u),new x.Notice(k("Failed to delete memo"))}if(n&&n==="local")return;const a=rt.getState().settings,o=rt.getState().app;!(o!=null&&o.loadLocalStorage("tokenForSync"))||!a.startSync||r.webId&&await YA(r.webId)}async removeMemosInFile(t,n){var a,o;const r=[];try{if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n)await pw(t,r);else if(t.path.contains("thino.canvas"))await gw(t,r);else if((a=t==null?void 0:t.parent)!=null&&a.path.contains(n)||!(t!=null&&t.parent)&&!((o=t==null?void 0:t.parent)!=null&&o.path)){const u=this.getState().memos.filter(d=>d.path.trim()===t.path.trim());u.length>0&&r.push(...u)}else t.path.endsWith(".md")&&t.path.contains(".thino")&&await mw(t,r);const s=r.map(u=>u.id);Ee.dispatch({type:"DELETE_MEMO_BY_ID_BATCH",payload:{ids:s}})}catch(s){console.error(s)}}async updateMemosInFile(t,n){const r=[],a=async()=>{if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n){await pw(t,r);return}else if(t.path.contains("thino.canvas")){await gw(t,r);return}else if(t!=null&&t.parent.path.contains(n)){await CI(t,r);return}else if(t.path.endsWith(".md")&&t.path.contains(".thino")){await mw(t,r);return}};try{await a(),Ee.dispatch({type:"UPDATE_MEMO_BATCH",payload:{memos:r,path:t.path}})}catch(o){console.error(o)}}async updateMemoProperty(t){const n=Re.randomId(16),r=await Po(t,{id:n});Ee.dispatch({type:"EDIT_MEMO_PATH",payload:r})}editMemo(t){const n=t.webId;Ee.dispatch({type:"EDIT_MEMO",payload:t});const r=rt.getState().settings,a=rt.getState().app;if(!(!(a!=null&&a.loadLocalStorage("tokenForSync"))||!r.startSync))try{t&&n&&M0({id:n,content:t.content,rowStatus:t.rowStatus,pinned:t.pinned,ttime:t.deletedAt?x.moment(t.deletedAt,"YYYY/MM/DD HH:mm:ss").valueOf():0,thinoType:t.sourceType==="DAILY"?"DAILY":"FILE"})}catch(s){console.error(s)}}editMemoBulk(t){for(const n of t)this.editMemo(n);this.updateTagsState()}editCommentMemo(t){Ee.dispatch({type:"EDIT_COMMENT_MEMO",payload:t})}getThinoViaKeyword(t){const{memos:n}=this.getState();return n.filter(a=>a.content.toLowerCase().includes(t==null?void 0:t.toLowerCase()))}updateTagsState(){const{memos:t}=this.getState(),n=new Set,r={};for(const a of t){const o=a.content.replace(/<[^>]*>/g,"").replace(/\`\`\`[a-z]*\n[\s\S]*?\n\`\`\`/g,"").replace(/\`([^\`].*?)\`/g,"");if(a.deletedAt!==""&&a.deletedAt)continue;[...Array.from(o.match(An)||[]),...Array.from(o.match($n)||[]),...Array.from(o.match(hr)||[])].forEach(u=>{const d=u.replace(An,"$1").replace($n,"$1").replace(hr,"$2").trim();/^\d+$/.test(d)||(n.add(d),r[d]=(r[d]||0)+1)})}Ee.dispatch({type:"SET_TAGS",payload:{tags:Array.from(n),tagsNum:r}})}clearMemos(){Ee.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 qN({content:t,isList:n})}async createMemoSingleFile({content:t,isList:n}){return await JN({content:t,isList:n})}async createOrPatchThinoFromWeb(t){const n=this.getState().memos;if(t.localId&&(n!=null&&n.some(o=>o.id===t.localId)))return await this.updateMemoById(t.localId,t,!0),null;if(n!=null&&n.some(o=>o.id===t.id)||n!=null&&n.some(o=>o.webId===t.id))return await this.updateMemoById(t.id,t,!1),null;let r=t.sourceType;const a=rt.getState().settings;switch(a&&(a!=null&&a.saveThinoType)&&(r=a.saveThinoType!=="FILE"?a.saveThinoType:t.sourceType),r){case"FILE":case"MULTI":case"CANVAS":return await Yb(t);case"DAILY":return await QN(t);default:return await Yb(t)}}async initSync(){const n=this.getState().memos.filter(a=>!a.webId),r=await BA(n);for(const a of r)await this.createOrPatchThinoFromWeb(a)}async createMemoCanvas({text:t,isList:n}){return await KN({content:t,isList:n})}async createMemoDaily(t,n){return await zb(t,n)}async pinMemoById(t){const n=this.getMemoById(t),r=await fk(n);Ee.dispatch({type:"PIN_MEMO",payload:r});try{const a=rt.getState().settings,o=rt.getState().app;if((o==null?void 0:o.loadLocalStorage("tokenForSync"))&&a.startSync){const u=await M0({id:r.webId,pinned:!0});this.editMemo(u)}}catch(a){console.error(a)}}async unpinMemoById(t){const n=this.getMemoById(t),r=await hk(n);Ee.dispatch({type:"PIN_MEMO",payload:r});try{const a=rt.getState().settings,o=rt.getState().app;if((o==null?void 0:o.loadLocalStorage("tokenForSync"))&&a.startSync){const u=await M0({id:r.webId,pinned:!1});this.editMemo(u)}}catch(a){console.error(a)}}async createCommentMemo(t,n,r,a,o){return await kA(t,n,r,a,o)}async importMemos(t,n,r){return await zb(t,n,r)}async createThino({content:t,isList:n,type:r}){let a=null;switch(r.toLowerCase()){case"canvas":a=await Ie.createMemoCanvas({text:t,isList:n});break;case"multi":a=await Ie.createMemoMultiFile({content:t,isList:n});break;case"daily":a=await Ie.createMemoDaily(t,n);break;case"file":a=await Ie.createMemoSingleFile({content:t,isList:n});break;default:a=await Ie.createMemoDaily(t,n);break}const o=rt.getState().settings,s=rt.getState().app,u=s==null?void 0:s.loadLocalStorage("tokenForSync");if(a&&u&&o.startSync){const d=await kT({content:t,thinoType:r==="DAILY"?"DAILY":"FILE"});await this.updateMemoById(a.id,d,!0)}return a}async openThinoByID(t){const n=this.getMemoById(t);if(n)switch(n.sourceType){case"DAILY":await p1(n.id,n.path);break;case"CANVAS":await v1(n.id,n.path);break;case"MULTI":await m1(n.path);break;case"FILE":await g1(n.id,n.path);break}}async updateMemo(t,n,r){const a=this.getMemoById(t);if(a){let o=null;switch(a.sourceType){case"DAILY":o=await Ti(a,{id:a.id,content:n,thinoType:r||""});break;case"CANVAS":o=await Ii(a,{id:a.id,content:n,thinoType:r||""});break;case"MULTI":o=await Po(a,{id:a.id,content:n,thinoType:r||""});break;case"FILE":o=await Si(a,{id:a.id,content:n,thinoType:r||""})}if(o)return o}return a}}const Ie=new zA;class UA{getState(){return Ee.getState().queryState}async getMyAllQueries(){const t=We.getState().query.filter,n=this.getQueryById(t),r=await va.getMyQueries();return Ee.dispatch({type:"SET_QUERIES",payload:{queries:[...r,...n?[n]:[]]}}),r}getQueryById(t){return this.getState().queries.find(n=>n.id===t)}pushQuery(t){Ee.dispatch({type:"INSERT_QUERY",payload:{query:{...t}}})}editQuery(t){Ee.dispatch({type:"UPDATE_QUERY",payload:t})}async deleteQuery(t){await va.deleteQueryById(t),Ee.dispatch({type:"DELETE_QUERY_BY_ID",payload:{id:t}})}async createQuery(t,n){return await va.createQuery(t,n)}createTempQuery(t,n){return EN(t,n)}async updateQuery(t,n,r){return await va.updateQuery(t,n,r)}async pinQuery(t){await va.pinQuery(t)}async unpinQuery(t){await va.unpinQuery(t)}}const tn=new UA;class VA{async upload(t){const{vault:n,fileManager:r}=Ee.getState().dailyNotesState.app,a=await t.arrayBuffer(),o=ZA(t.type),s=ws(),u=x.moment(),d=kv(u,s);let m;if(d)d instanceof x.TFile&&(m=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,o,d),a));else{const p=await yI(u);m=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,o,p),a)}return r.generateMarkdownLink(m,m.path,"","")}async parseHtml(t){const n=await t.text(),r=document.createElement("html");r.innerHTML=n;const a=Array.from(r.getElementsByClassName("memo"));for(const o of a){const s=o.getElementsByClassName("content")[0],u=x.htmlToMarkdown(s.innerHTML),d=await Ie.importMemos(u,!0,x.moment(o.getElementsByClassName("time")[0].innerHTML));Ie.pushMemo(d)}}}const ZA=e=>{var t;return(t=/^image\/(.+)$/.exec(e))==null?void 0:t[1]},y1=new VA;var hs={},OT={exports:{}},ga={},N0={exports:{}},k0={},wD;function WA(){return wD||(wD=1,function(e){function t(se,we){var Z=se.length;se.push(we);e:for(;0<Z;){var $=Z-1>>>1,X=se[$];if(0<a(X,we))se[$]=we,se[Z]=X,Z=$;else break e}}function n(se){return se.length===0?null:se[0]}function r(se){if(se.length===0)return null;var we=se[0],Z=se.pop();if(Z!==we){se[0]=Z;e:for(var $=0,X=se.length,ve=X>>>1;$<ve;){var De=2*($+1)-1,be=se[De],ke=De+1,Be=se[ke];if(0>a(be,Z))ke<X&&0>a(Be,be)?(se[$]=Be,se[ke]=Z,$=ke):(se[$]=be,se[De]=Z,$=De);else if(ke<X&&0>a(Be,Z))se[$]=Be,se[ke]=Z,$=ke;else break e}}return we}function a(se,we){var Z=se.sortIndex-we.sortIndex;return Z!==0?Z:se.id-we.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var d=[],m=[],p=1,g=null,w=3,D=!1,S=!1,T=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(se){for(var we=n(m);we!==null;){if(we.callback===null)r(m);else if(we.startTime<=se)r(m),we.sortIndex=we.expirationTime,t(d,we);else break;we=n(m)}}function F(se){if(T=!1,R(se),!S)if(n(d)!==null)S=!0,ge(H);else{var we=n(m);we!==null&&Te(F,we.startTime-se)}}function H(se,we){S=!1,T&&(T=!1,A(z),z=-1),D=!0;var Z=w;try{for(R(we),g=n(d);g!==null&&(!(g.expirationTime>we)||se&&!K());){var $=g.callback;if(typeof $=="function"){g.callback=null,w=g.priorityLevel;var X=$(g.expirationTime<=we);we=e.unstable_now(),typeof X=="function"?g.callback=X:g===n(d)&&r(d),R(we)}else r(d);g=n(d)}if(g!==null)var ve=!0;else{var De=n(m);De!==null&&Te(F,De.startTime-we),ve=!1}return ve}finally{g=null,w=Z,D=!1}}var P=!1,L=null,z=-1,U=5,W=-1;function K(){return!(e.unstable_now()-W<U)}function ae(){if(L!==null){var se=e.unstable_now();W=se;var we=!0;try{we=L(!0,se)}finally{we?ce():(P=!1,L=null)}}else P=!1}var ce;if(typeof N=="function")ce=function(){N(ae)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ie=fe.port2;fe.port1.onmessage=ae,ce=function(){ie.postMessage(null)}}else ce=function(){E(ae,0)};function ge(se){L=se,P||(P=!0,ce())}function Te(se,we){z=E(function(){se(e.unstable_now())},we)}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(se){se.callback=null},e.unstable_continueExecution=function(){S||D||(S=!0,ge(H))},e.unstable_forceFrameRate=function(se){0>se||125<se?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<se?Math.floor(1e3/se):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(se){switch(w){case 1:case 2:case 3:var we=3;break;default:we=w}var Z=w;w=we;try{return se()}finally{w=Z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(se,we){switch(se){case 1:case 2:case 3:case 4:case 5:break;default:se=3}var Z=w;w=se;try{return we()}finally{w=Z}},e.unstable_scheduleCallback=function(se,we,Z){var $=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?$+Z:$):Z=$,se){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=Z+X,se={id:p++,callback:we,priorityLevel:se,startTime:Z,expirationTime:X,sortIndex:-1},Z>$?(se.sortIndex=Z,t(m,se),n(d)===null&&se===n(m)&&(T?(A(z),z=-1):T=!0,Te(F,Z-$))):(se.sortIndex=X,t(d,se),S||D||(S=!0,ge(H))),se},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(se){var we=w;return function(){var Z=w;w=we;try{return se.apply(this,arguments)}finally{w=Z}}}}(k0)),k0}var bD;function $A(){return bD||(bD=1,N0.exports=WA()),N0.exports}var DD;function GA(){if(DD)return ga;DD=1;var e=O,t=$A();function n(i){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+i,h=1;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function o(i,l){s(i,l),s(i+"Capture",l)}function s(i,l){for(a[i]=l,i=0;i<l.length;i++)r.add(l[i])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,m=/^[: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]*$/,p={},g={};function w(i){return d.call(g,i)?!0:d.call(p,i)?!1:m.test(i)?g[i]=!0:(p[i]=!0,!1)}function D(i,l,h,v){if(h!==null&&h.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return v?!1:h!==null?!h.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function S(i,l,h,v){if(l===null||typeof l>"u"||D(i,l,h,v))return!0;if(v)return!1;if(h!==null)switch(h.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 T(i,l,h,v,I,C,_){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=v,this.attributeNamespace=I,this.mustUseProperty=h,this.propertyName=i,this.type=l,this.sanitizeURL=C,this.removeEmptyString=_}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){E[i]=new T(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var l=i[0];E[l]=new T(l,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){E[i]=new T(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){E[i]=new T(i,2,!1,i,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(i){E[i]=new T(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){E[i]=new T(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){E[i]=new T(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){E[i]=new T(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){E[i]=new T(i,5,!1,i.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function N(i){return i[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(i){var l=i.replace(A,N);E[l]=new T(l,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var l=i.replace(A,N);E[l]=new T(l,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var l=i.replace(A,N);E[l]=new T(l,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){E[i]=new T(i,1,!1,i.toLowerCase(),null,!1,!1)}),E.xlinkHref=new T("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){E[i]=new T(i,1,!1,i.toLowerCase(),null,!0,!0)});function R(i,l,h,v){var I=E.hasOwnProperty(l)?E[l]:null;(I!==null?I.type!==0:v||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(S(l,h,I,v)&&(h=null),v||I===null?w(l)&&(h===null?i.removeAttribute(l):i.setAttribute(l,""+h)):I.mustUseProperty?i[I.propertyName]=h===null?I.type===3?!1:"":h:(l=I.attributeName,v=I.attributeNamespace,h===null?i.removeAttribute(l):(I=I.type,h=I===3||I===4&&h===!0?"":""+h,v?i.setAttributeNS(v,l,h):i.setAttribute(l,h))))}var F=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,H=Symbol.for("react.element"),P=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),K=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),ce=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),ge=Symbol.for("react.lazy"),Te=Symbol.for("react.offscreen"),se=Symbol.iterator;function we(i){return i===null||typeof i!="object"?null:(i=se&&i[se]||i["@@iterator"],typeof i=="function"?i:null)}var Z=Object.assign,$;function X(i){if($===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);$=l&&l[1]||""}return`
`+$+i}var ve=!1;function De(i,l){if(!i||ve)return"";ve=!0;var h=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(ye){var v=ye}Reflect.construct(i,[],l)}else{try{l.call()}catch(ye){v=ye}i.call(l.prototype)}else{try{throw Error()}catch(ye){v=ye}i()}}catch(ye){if(ye&&v&&typeof ye.stack=="string"){for(var I=ye.stack.split(`
`),C=v.stack.split(`
`),_=I.length-1,G=C.length-1;1<=_&&0<=G&&I[_]!==C[G];)G--;for(;1<=_&&0<=G;_--,G--)if(I[_]!==C[G]){if(_!==1||G!==1)do if(_--,G--,0>G||I[_]!==C[G]){var ee=`
`+I[_].replace(" at new "," at ");return i.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",i.displayName)),ee}while(1<=_&&0<=G);break}}}finally{ve=!1,Error.prepareStackTrace=h}return(i=i?i.displayName||i.name:"")?X(i):""}function be(i){switch(i.tag){case 5:return X(i.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 2:case 15:return i=De(i.type,!1),i;case 11:return i=De(i.type.render,!1),i;case 1:return i=De(i.type,!0),i;default:return""}}function ke(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case L:return"Fragment";case P:return"Portal";case U:return"Profiler";case z:return"StrictMode";case ce:return"Suspense";case fe:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case K:return(i.displayName||"Context")+".Consumer";case W:return(i._context.displayName||"Context")+".Provider";case ae:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ie:return l=i.displayName||null,l!==null?l:ke(i.type)||"Memo";case ge:l=i._payload,i=i._init;try{return ke(i(l))}catch{}}return null}function Be(i){var l=i.type;switch(i.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 i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ke(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 _e(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function it(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Vt(i){var l=it(i)?"checked":"value",h=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),v=""+i[l];if(!i.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var I=h.get,C=h.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return I.call(this)},set:function(_){v=""+_,C.call(this,_)}}),Object.defineProperty(i,l,{enumerable:h.enumerable}),{getValue:function(){return v},setValue:function(_){v=""+_},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Se(i){i._valueTracker||(i._valueTracker=Vt(i))}function Ue(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var h=l.getValue(),v="";return i&&(v=it(i)?i.checked?"true":"false":i.value),i=v,i!==h?(l.setValue(i),!0):!1}function Je(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function $e(i,l){var h=l.checked;return Z({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??i._wrapperState.initialChecked})}function lt(i,l){var h=l.defaultValue==null?"":l.defaultValue,v=l.checked!=null?l.checked:l.defaultChecked;h=_e(l.value!=null?l.value:h),i._wrapperState={initialChecked:v,initialValue:h,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ft(i,l){l=l.checked,l!=null&&R(i,"checked",l,!1)}function Dt(i,l){ft(i,l);var h=_e(l.value),v=l.type;if(h!=null)v==="number"?(h===0&&i.value===""||i.value!=h)&&(i.value=""+h):i.value!==""+h&&(i.value=""+h);else if(v==="submit"||v==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?$t(i,l.type,h):l.hasOwnProperty("defaultValue")&&$t(i,l.type,_e(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function Et(i,l,h){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=""+i._wrapperState.initialValue,h||l===i.value||(i.value=l),i.defaultValue=l}h=i.name,h!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,h!==""&&(i.name=h)}function $t(i,l,h){(l!=="number"||Je(i.ownerDocument)!==i)&&(h==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+h&&(i.defaultValue=""+h))}var rn=Array.isArray;function At(i,l,h,v){if(i=i.options,l){l={};for(var I=0;I<h.length;I++)l["$"+h[I]]=!0;for(h=0;h<i.length;h++)I=l.hasOwnProperty("$"+i[h].value),i[h].selected!==I&&(i[h].selected=I),I&&v&&(i[h].defaultSelected=!0)}else{for(h=""+_e(h),l=null,I=0;I<i.length;I++){if(i[I].value===h){i[I].selected=!0,v&&(i[I].defaultSelected=!0);return}l!==null||i[I].disabled||(l=i[I])}l!==null&&(l.selected=!0)}}function an(i,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return Z({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Sn(i,l){var h=l.value;if(h==null){if(h=l.children,l=l.defaultValue,h!=null){if(l!=null)throw Error(n(92));if(rn(h)){if(1<h.length)throw Error(n(93));h=h[0]}l=h}l==null&&(l=""),h=l}i._wrapperState={initialValue:_e(h)}}function In(i,l){var h=_e(l.value),v=_e(l.defaultValue);h!=null&&(h=""+h,h!==i.value&&(i.value=h),l.defaultValue==null&&i.defaultValue!==h&&(i.defaultValue=h)),v!=null&&(i.defaultValue=""+v)}function vr(i){var l=i.textContent;l===i._wrapperState.initialValue&&l!==""&&l!==null&&(i.value=l)}function Sa(i){switch(i){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 Mr(i,l){return i==null||i==="http://www.w3.org/1999/xhtml"?Sa(l):i==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Nr,Ss=function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,h,v,I){MSApp.execUnsafeLocalFunction(function(){return i(l,h,v,I)})}:i}(function(i,l){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=l;else{for(Nr=Nr||document.createElement("div"),Nr.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Nr.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function mo(i,l){if(l){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=l;return}}i.textContent=l}var po={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},Nl=["Webkit","ms","Moz","O"];Object.keys(po).forEach(function(i){Nl.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),po[l]=po[i]})});function Fi(i,l,h){return l==null||typeof l=="boolean"||l===""?"":h||typeof l!="number"||l===0||po.hasOwnProperty(i)&&po[i]?(""+l).trim():l+"px"}function Pi(i,l){i=i.style;for(var h in l)if(l.hasOwnProperty(h)){var v=h.indexOf("--")===0,I=Fi(h,l[h],v);h==="float"&&(h="cssFloat"),v?i.setProperty(h,I):i[h]=I}}var Is=Z({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 Yo(i,l){if(l){if(Is[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,i));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 ji(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){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 V=null;function ne(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var me=null,Ce=null,je=null;function Ye(i){if(i=nr(i)){if(typeof me!="function")throw Error(n(280));var l=i.stateNode;l&&(l=gu(l),me(i.stateNode,i.type,l))}}function ze(i){Ce?je?je.push(i):je=[i]:Ce=i}function pt(){if(Ce){var i=Ce,l=je;if(je=Ce=null,Ye(i),l)for(i=0;i<l.length;i++)Ye(l[i])}}function Yt(i,l){return i(l)}function On(){}var yn=!1;function na(i,l,h){if(yn)return i(l,h);yn=!0;try{return Yt(i,l,h)}finally{yn=!1,(Ce!==null||je!==null)&&(On(),pt())}}function Fn(i,l){var h=i.stateNode;if(h===null)return null;var v=gu(h);if(v===null)return null;h=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)||(i=i.type,v=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!v;break e;default:i=!1}if(i)return null;if(h&&typeof h!="function")throw Error(n(231,l,typeof h));return h}var yr=!1;if(u)try{var ra={};Object.defineProperty(ra,"passive",{get:function(){yr=!0}}),window.addEventListener("test",ra,ra),window.removeEventListener("test",ra,ra)}catch{yr=!1}function kl(i,l,h,v,I,C,_,G,ee){var ye=Array.prototype.slice.call(arguments,3);try{l.apply(h,ye)}catch(Fe){this.onError(Fe)}}var Jt=!1,Ia=null,Ta=!1,Ea=null,zo={onError:function(i){Jt=!0,Ia=i}};function Uo(i,l,h,v,I,C,_,G,ee){Jt=!1,Ia=null,kl.apply(zo,arguments)}function vy(i,l,h,v,I,C,_,G,ee){if(Uo.apply(this,arguments),Jt){if(Jt){var ye=Ia;Jt=!1,Ia=null}else throw Error(n(198));Ta||(Ta=!0,Ea=ye)}}function Li(i){var l=i,h=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,l.flags&4098&&(h=l.return),i=l.return;while(i)}return l.tag===3?h:null}function of(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function Um(i){if(Li(i)!==i)throw Error(n(188))}function yy(i){var l=i.alternate;if(!l){if(l=Li(i),l===null)throw Error(n(188));return l!==i?null:i}for(var h=i,v=l;;){var I=h.return;if(I===null)break;var C=I.alternate;if(C===null){if(v=I.return,v!==null){h=v;continue}break}if(I.child===C.child){for(C=I.child;C;){if(C===h)return Um(I),i;if(C===v)return Um(I),l;C=C.sibling}throw Error(n(188))}if(h.return!==v.return)h=I,v=C;else{for(var _=!1,G=I.child;G;){if(G===h){_=!0,h=I,v=C;break}if(G===v){_=!0,v=I,h=C;break}G=G.sibling}if(!_){for(G=C.child;G;){if(G===h){_=!0,h=C,v=I;break}if(G===v){_=!0,v=C,h=I;break}G=G.sibling}if(!_)throw Error(n(189))}}if(h.alternate!==v)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?i:l}function Vm(i){return i=yy(i),i!==null?Zm(i):null}function Zm(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=Zm(i);if(l!==null)return l;i=i.sibling}return null}var Wm=t.unstable_scheduleCallback,$m=t.unstable_cancelCallback,zc=t.unstable_shouldYield,wy=t.unstable_requestPaint,on=t.unstable_now,by=t.unstable_getCurrentPriorityLevel,sf=t.unstable_ImmediatePriority,Gm=t.unstable_UserBlockingPriority,Al=t.unstable_NormalPriority,qm=t.unstable_LowPriority,lf=t.unstable_IdlePriority,Uc=null,Za=null;function Dy(i){if(Za&&typeof Za.onCommitFiberRoot=="function")try{Za.onCommitFiberRoot(Uc,i,void 0,(i.current.flags&128)===128)}catch{}}var xa=Math.clz32?Math.clz32:Qm,Jm=Math.log,Km=Math.LN2;function Qm(i){return i>>>=0,i===0?32:31-(Jm(i)/Km|0)|0}var Ts=64,Vc=4194304;function Es(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Ri(i,l){var h=i.pendingLanes;if(h===0)return 0;var v=0,I=i.suspendedLanes,C=i.pingedLanes,_=h&268435455;if(_!==0){var G=_&~I;G!==0?v=Es(G):(C&=_,C!==0&&(v=Es(C)))}else _=h&~I,_!==0?v=Es(_):C!==0&&(v=Es(C));if(v===0)return 0;if(l!==0&&l!==v&&!(l&I)&&(I=v&-v,C=l&-l,I>=C||I===16&&(C&4194240)!==0))return l;if(v&4&&(v|=h&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=v;0<l;)h=31-xa(l),I=1<<h,v|=i[h],l&=~I;return v}function Xm(i,l){switch(i){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 Sy(i,l){for(var h=i.suspendedLanes,v=i.pingedLanes,I=i.expirationTimes,C=i.pendingLanes;0<C;){var _=31-xa(C),G=1<<_,ee=I[_];ee===-1?(!(G&h)||G&v)&&(I[_]=Xm(G,l)):ee<=l&&(i.expiredLanes|=G),C&=~G}}function Zc(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function cf(){var i=Ts;return Ts<<=1,!(Ts&4194240)&&(Ts=64),i}function Ol(i){for(var l=[],h=0;31>h;h++)l.push(i);return l}function Fl(i,l,h){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-xa(l),i[l]=h}function ep(i,l){var h=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var v=i.eventTimes;for(i=i.expirationTimes;0<h;){var I=31-xa(h),C=1<<I;l[I]=0,v[I]=-1,i[I]=-1,h&=~C}}function Pl(i,l){var h=i.entangledLanes|=l;for(i=i.entanglements;h;){var v=31-xa(h),I=1<<v;I&l|i[v]&l&&(i[v]|=l),h&=~I}}var _t=0;function _i(i){return i&=-i,1<i?4<i?i&268435455?16:536870912:4:1}var uf,Wc,tp,df,ff,$c=!1,jl=[],Vo=null,Zo=null,Wo=null,xs=new Map,Ll=new Map,$o=[],Iy="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 np(i,l){switch(i){case"focusin":case"focusout":Vo=null;break;case"dragenter":case"dragleave":Zo=null;break;case"mouseover":case"mouseout":Wo=null;break;case"pointerover":case"pointerout":xs.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ll.delete(l.pointerId)}}function Hi(i,l,h,v,I,C){return i===null||i.nativeEvent!==C?(i={blockedOn:l,domEventName:h,eventSystemFlags:v,nativeEvent:C,targetContainers:[I]},l!==null&&(l=nr(l),l!==null&&Wc(l)),i):(i.eventSystemFlags|=v,l=i.targetContainers,I!==null&&l.indexOf(I)===-1&&l.push(I),i)}function Ty(i,l,h,v,I){switch(l){case"focusin":return Vo=Hi(Vo,i,l,h,v,I),!0;case"dragenter":return Zo=Hi(Zo,i,l,h,v,I),!0;case"mouseover":return Wo=Hi(Wo,i,l,h,v,I),!0;case"pointerover":var C=I.pointerId;return xs.set(C,Hi(xs.get(C)||null,i,l,h,v,I)),!0;case"gotpointercapture":return C=I.pointerId,Ll.set(C,Hi(Ll.get(C)||null,i,l,h,v,I)),!0}return!1}function rp(i){var l=qa(i.target);if(l!==null){var h=Li(l);if(h!==null){if(l=h.tag,l===13){if(l=of(h),l!==null){i.blockedOn=l,ff(i.priority,function(){tp(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){i.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Gc(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var h=Kc(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(h===null){h=i.nativeEvent;var v=new h.constructor(h.type,h);V=v,h.target.dispatchEvent(v),V=null}else return l=nr(h),l!==null&&Wc(l),i.blockedOn=h,!1;l.shift()}return!0}function ap(i,l,h){Gc(i)&&h.delete(l)}function Ey(){$c=!1,Vo!==null&&Gc(Vo)&&(Vo=null),Zo!==null&&Gc(Zo)&&(Zo=null),Wo!==null&&Gc(Wo)&&(Wo=null),xs.forEach(ap),Ll.forEach(ap)}function zt(i,l){i.blockedOn===l&&(i.blockedOn=null,$c||($c=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ey)))}function Ht(i){function l(I){return zt(I,i)}if(0<jl.length){zt(jl[0],i);for(var h=1;h<jl.length;h++){var v=jl[h];v.blockedOn===i&&(v.blockedOn=null)}}for(Vo!==null&&zt(Vo,i),Zo!==null&&zt(Zo,i),Wo!==null&&zt(Wo,i),xs.forEach(l),Ll.forEach(l),h=0;h<$o.length;h++)v=$o[h],v.blockedOn===i&&(v.blockedOn=null);for(;0<$o.length&&(h=$o[0],h.blockedOn===null);)rp(h),h.blockedOn===null&&$o.shift()}var Cs=F.ReactCurrentBatchConfig,qc=!0;function xy(i,l,h,v){var I=_t,C=Cs.transition;Cs.transition=null;try{_t=1,hf(i,l,h,v)}finally{_t=I,Cs.transition=C}}function Cy(i,l,h,v){var I=_t,C=Cs.transition;Cs.transition=null;try{_t=4,hf(i,l,h,v)}finally{_t=I,Cs.transition=C}}function hf(i,l,h,v){if(qc){var I=Kc(i,l,h,v);if(I===null)kf(i,l,v,Jc,h),np(i,v);else if(Ty(I,i,l,h,v))v.stopPropagation();else if(np(i,v),l&4&&-1<Iy.indexOf(i)){for(;I!==null;){var C=nr(I);if(C!==null&&uf(C),C=Kc(i,l,h,v),C===null&&kf(i,l,v,Jc,h),C===I)break;I=C}I!==null&&v.stopPropagation()}else kf(i,l,v,null,h)}}var Jc=null;function Kc(i,l,h,v){if(Jc=null,i=ne(v),i=qa(i),i!==null)if(l=Li(i),l===null)i=null;else if(h=l.tag,h===13){if(i=of(l),i!==null)return i;i=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null);return Jc=i,null}function op(i){switch(i){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(by()){case sf:return 1;case Gm:return 4;case Al:case qm:return 16;case lf:return 536870912;default:return 16}default:return 16}}var sn=null,Rl=null,Wa=null;function mf(){if(Wa)return Wa;var i,l=Rl,h=l.length,v,I="value"in sn?sn.value:sn.textContent,C=I.length;for(i=0;i<h&&l[i]===I[i];i++);var _=h-i;for(v=1;v<=_&&l[h-v]===I[C-v];v++);return Wa=I.slice(i,1<v?1-v:void 0)}function Ms(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function wr(){return!0}function pf(){return!1}function kr(i){function l(h,v,I,C,_){this._reactName=h,this._targetInst=I,this.type=v,this.nativeEvent=C,this.target=_,this.currentTarget=null;for(var G in i)i.hasOwnProperty(G)&&(h=i[G],this[G]=h?h(C):C[G]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?wr:pf,this.isPropagationStopped=pf,this}return Z(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=wr)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=wr)},persist:function(){},isPersistent:wr}),l}var Bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qc=kr(Bi),Ns=Z({},Bi,{view:0,detail:0}),ip=kr(Ns),br,gf,er,Xc=Z({},Ns,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Df,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==er&&(er&&i.type==="mousemove"?(br=i.screenX-er.screenX,gf=i.screenY-er.screenY):gf=br=0,er=i),br)},movementY:function(i){return"movementY"in i?i.movementY:gf}}),vf=kr(Xc),Go=Z({},Xc,{dataTransfer:0}),eu=kr(Go),yf=Z({},Ns,{relatedTarget:0}),Gt=kr(yf),qo=Z({},Bi,{animationName:0,elapsedTime:0,pseudoElement:0}),wf=kr(qo),My=Z({},Bi,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),bf=kr(My),Ny=Z({},Bi,{data:0}),sp=kr(Ny),ky={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lp={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"},tu={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ks(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=tu[i])?!!l[i]:!1}function Df(){return ks}var cp=Z({},Ns,{key:function(i){if(i.key){var l=ky[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Ms(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?lp[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Df,charCode:function(i){return i.type==="keypress"?Ms(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ms(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),up=kr(cp),Sf=Z({},Xc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nu=kr(Sf),dp=Z({},Ns,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Df}),Ay=kr(dp),If=Z({},Bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tf=kr(If),Oy=Z({},Xc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),fp=kr(Oy),zr=[9,13,27,32],_l=u&&"CompositionEvent"in window,go=null;u&&"documentMode"in document&&(go=document.documentMode);var hp=u&&"TextEvent"in window&&!go,Ef=u&&(!_l||go&&8<go&&11>=go),mp=" ",pp=!1;function gp(i,l){switch(i){case"keyup":return zr.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vp(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var As=!1;function Os(i,l){switch(i){case"compositionend":return vp(l);case"keypress":return l.which!==32?null:(pp=!0,mp);case"textInput":return i=l.data,i===mp&&pp?null:i;default:return null}}function Fy(i,l){if(As)return i==="compositionend"||!_l&&gp(i,l)?(i=mf(),Wa=Rl=sn=null,As=!1,i):null;switch(i){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 Ef&&l.locale!=="ko"?null:l.data;default:return null}}var Py={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 ru(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!Py[i.type]:l==="textarea"}function xf(i,l,h,v){ze(v),l=fu(l,"onChange"),0<l.length&&(h=new Qc("onChange","change",null,h,v),i.push({event:h,listeners:l}))}var aa=null,Jo=null;function jy(i){Tp(i,0)}function au(i){var l=St(i);if(Ue(l))return i}function Ly(i,l){if(i==="change")return l}var Yi=!1;if(u){var Ur;if(u){var ou="oninput"in document;if(!ou){var yp=document.createElement("div");yp.setAttribute("oninput","return;"),ou=typeof yp.oninput=="function"}Ur=ou}else Ur=!1;Yi=Ur&&(!document.documentMode||9<document.documentMode)}function wp(){aa&&(aa.detachEvent("onpropertychange",bp),Jo=aa=null)}function bp(i){if(i.propertyName==="value"&&au(Jo)){var l=[];xf(l,Jo,i,ne(i)),na(jy,l)}}function Ry(i,l,h){i==="focusin"?(wp(),aa=l,Jo=h,aa.attachEvent("onpropertychange",bp)):i==="focusout"&&wp()}function _y(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return au(Jo)}function Fs(i,l){if(i==="click")return au(l)}function oe(i,l){if(i==="input"||i==="change")return au(l)}function xe(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var pe=typeof Object.is=="function"?Object.is:xe;function Ge(i,l){if(pe(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var h=Object.keys(i),v=Object.keys(l);if(h.length!==v.length)return!1;for(v=0;v<h.length;v++){var I=h[v];if(!d.call(l,I)||!pe(i[I],l[I]))return!1}return!0}function bt(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Pt(i,l){var h=bt(i);i=0;for(var v;h;){if(h.nodeType===3){if(v=i+h.textContent.length,i<=l&&v>=l)return{node:h,offset:l-i};i=v}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=bt(h)}}function Tn(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?Tn(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function Zt(){for(var i=window,l=Je();l instanceof i.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)i=l.contentWindow;else break;l=Je(i.document)}return l}function Hl(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function Hy(i){var l=Zt(),h=i.focusedElem,v=i.selectionRange;if(l!==h&&h&&h.ownerDocument&&Tn(h.ownerDocument.documentElement,h)){if(v!==null&&Hl(h)){if(l=v.start,i=v.end,i===void 0&&(i=l),"selectionStart"in h)h.selectionStart=l,h.selectionEnd=Math.min(i,h.value.length);else if(i=(l=h.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var I=h.textContent.length,C=Math.min(v.start,I);v=v.end===void 0?C:Math.min(v.end,I),!i.extend&&C>v&&(I=v,v=C,C=I),I=Pt(h,C);var _=Pt(h,v);I&&_&&(i.rangeCount!==1||i.anchorNode!==I.node||i.anchorOffset!==I.offset||i.focusNode!==_.node||i.focusOffset!==_.offset)&&(l=l.createRange(),l.setStart(I.node,I.offset),i.removeAllRanges(),C>v?(i.addRange(l),i.extend(_.node,_.offset)):(l.setEnd(_.node,_.offset),i.addRange(l)))}}for(l=[],i=h;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<l.length;h++)i=l[h],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var oa=u&&"documentMode"in document&&11>=document.documentMode,vo=null,Cf=null,$a=null,Ps=!1;function Bl(i,l,h){var v=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Ps||vo==null||vo!==Je(v)||(v=vo,"selectionStart"in v&&Hl(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}),$a&&Ge($a,v)||($a=v,v=fu(Cf,"onSelect"),0<v.length&&(l=new Qc("onSelect","select",null,l,h),i.push({event:l,listeners:v}),l.target=vo)))}function jt(i,l){var h={};return h[i.toLowerCase()]=l.toLowerCase(),h["Webkit"+i]="webkit"+l,h["Moz"+i]="moz"+l,h}var js={animationend:jt("Animation","AnimationEnd"),animationiteration:jt("Animation","AnimationIteration"),animationstart:jt("Animation","AnimationStart"),transitionend:jt("Transition","TransitionEnd")},iu={},Yl={};u&&(Yl=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function su(i){if(iu[i])return iu[i];if(!js[i])return i;var l=js[i],h;for(h in l)if(l.hasOwnProperty(h)&&h in Yl)return iu[i]=l[h];return i}var Dp=su("animationend"),Sp=su("animationiteration"),zl=su("animationstart"),yo=su("transitionend"),Ul=new Map,Mf="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 Ca(i,l){Ul.set(i,l),o(l,[i])}for(var lu=0;lu<Mf.length;lu++){var cu=Mf[lu],uu=cu.toLowerCase(),Ip=cu[0].toUpperCase()+cu.slice(1);Ca(uu,"on"+Ip)}Ca(Dp,"onAnimationEnd"),Ca(Sp,"onAnimationIteration"),Ca(zl,"onAnimationStart"),Ca("dblclick","onDoubleClick"),Ca("focusin","onFocus"),Ca("focusout","onBlur"),Ca(yo,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wo="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(" "),zi=new Set("cancel close invalid load scroll toggle".split(" ").concat(wo));function Vl(i,l,h){var v=i.type||"unknown-event";i.currentTarget=h,vy(v,l,void 0,i),i.currentTarget=null}function Tp(i,l){l=(l&4)!==0;for(var h=0;h<i.length;h++){var v=i[h],I=v.event;v=v.listeners;e:{var C=void 0;if(l)for(var _=v.length-1;0<=_;_--){var G=v[_],ee=G.instance,ye=G.currentTarget;if(G=G.listener,ee!==C&&I.isPropagationStopped())break e;Vl(I,G,ye),C=ee}else for(_=0;_<v.length;_++){if(G=v[_],ee=G.instance,ye=G.currentTarget,G=G.listener,ee!==C&&I.isPropagationStopped())break e;Vl(I,G,ye),C=ee}}}if(Ta)throw i=Ea,Ta=!1,Ea=null,i}function Kt(i,l){var h=l[pu];h===void 0&&(h=l[pu]=new Set);var v=i+"__bubble";h.has(v)||(du(l,i,2,!1),h.add(v))}function Nf(i,l,h){var v=0;l&&(v|=4),du(h,i,v,l)}var Ui="_reactListening"+Math.random().toString(36).slice(2);function Ko(i){if(!i[Ui]){i[Ui]=!0,r.forEach(function(h){h!=="selectionchange"&&(zi.has(h)||Nf(h,!1,i),Nf(h,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Ui]||(l[Ui]=!0,Nf("selectionchange",!1,l))}}function du(i,l,h,v){switch(op(l)){case 1:var I=xy;break;case 4:I=Cy;break;default:I=hf}h=I.bind(null,l,h,i),I=void 0,!yr||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(I=!0),v?I!==void 0?i.addEventListener(l,h,{capture:!0,passive:I}):i.addEventListener(l,h,!0):I!==void 0?i.addEventListener(l,h,{passive:I}):i.addEventListener(l,h,!1)}function kf(i,l,h,v,I){var C=v;if(!(l&1)&&!(l&2)&&v!==null)e:for(;;){if(v===null)return;var _=v.tag;if(_===3||_===4){var G=v.stateNode.containerInfo;if(G===I||G.nodeType===8&&G.parentNode===I)break;if(_===4)for(_=v.return;_!==null;){var ee=_.tag;if((ee===3||ee===4)&&(ee=_.stateNode.containerInfo,ee===I||ee.nodeType===8&&ee.parentNode===I))return;_=_.return}for(;G!==null;){if(_=qa(G),_===null)return;if(ee=_.tag,ee===5||ee===6){v=C=_;continue e}G=G.parentNode}}v=v.return}na(function(){var ye=C,Fe=ne(h),Le=[];e:{var Oe=Ul.get(i);if(Oe!==void 0){var qe=Qc,tt=i;switch(i){case"keypress":if(Ms(h)===0)break e;case"keydown":case"keyup":qe=up;break;case"focusin":tt="focus",qe=Gt;break;case"focusout":tt="blur",qe=Gt;break;case"beforeblur":case"afterblur":qe=Gt;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":qe=vf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":qe=eu;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":qe=Ay;break;case Dp:case Sp:case zl:qe=wf;break;case yo:qe=Tf;break;case"scroll":qe=ip;break;case"wheel":qe=fp;break;case"copy":case"cut":case"paste":qe=bf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":qe=nu}var nt=(l&4)!==0,wn=!nt&&i==="scroll",ue=nt?Oe!==null?Oe+"Capture":null:Oe;nt=[];for(var re=ye,de;re!==null;){de=re;var He=de.stateNode;if(de.tag===5&&He!==null&&(de=He,ue!==null&&(He=Fn(re,ue),He!=null&&nt.push(Ls(re,He,de)))),wn)break;re=re.return}0<nt.length&&(Oe=new qe(Oe,tt,null,h,Fe),Le.push({event:Oe,listeners:nt}))}}if(!(l&7)){e:{if(Oe=i==="mouseover"||i==="pointerover",qe=i==="mouseout"||i==="pointerout",Oe&&h!==V&&(tt=h.relatedTarget||h.fromElement)&&(qa(tt)||tt[Vr]))break e;if((qe||Oe)&&(Oe=Fe.window===Fe?Fe:(Oe=Fe.ownerDocument)?Oe.defaultView||Oe.parentWindow:window,qe?(tt=h.relatedTarget||h.toElement,qe=ye,tt=tt?qa(tt):null,tt!==null&&(wn=Li(tt),tt!==wn||tt.tag!==5&&tt.tag!==6)&&(tt=null)):(qe=null,tt=ye),qe!==tt)){if(nt=vf,He="onMouseLeave",ue="onMouseEnter",re="mouse",(i==="pointerout"||i==="pointerover")&&(nt=nu,He="onPointerLeave",ue="onPointerEnter",re="pointer"),wn=qe==null?Oe:St(qe),de=tt==null?Oe:St(tt),Oe=new nt(He,re+"leave",qe,h,Fe),Oe.target=wn,Oe.relatedTarget=de,He=null,qa(Fe)===ye&&(nt=new nt(ue,re+"enter",tt,h,Fe),nt.target=de,nt.relatedTarget=wn,He=nt),wn=He,qe&&tt)t:{for(nt=qe,ue=tt,re=0,de=nt;de;de=Rs(de))re++;for(de=0,He=ue;He;He=Rs(He))de++;for(;0<re-de;)nt=Rs(nt),re--;for(;0<de-re;)ue=Rs(ue),de--;for(;re--;){if(nt===ue||ue!==null&&nt===ue.alternate)break t;nt=Rs(nt),ue=Rs(ue)}nt=null}else nt=null;qe!==null&&En(Le,Oe,qe,nt,!1),tt!==null&&wn!==null&&En(Le,wn,tt,nt,!0)}}e:{if(Oe=ye?St(ye):window,qe=Oe.nodeName&&Oe.nodeName.toLowerCase(),qe==="select"||qe==="input"&&Oe.type==="file")var at=Ly;else if(ru(Oe))if(Yi)at=oe;else{at=_y;var ut=Ry}else(qe=Oe.nodeName)&&qe.toLowerCase()==="input"&&(Oe.type==="checkbox"||Oe.type==="radio")&&(at=Fs);if(at&&(at=at(i,ye))){xf(Le,at,h,Fe);break e}ut&&ut(i,Oe,ye),i==="focusout"&&(ut=Oe._wrapperState)&&ut.controlled&&Oe.type==="number"&&$t(Oe,"number",Oe.value)}switch(ut=ye?St(ye):window,i){case"focusin":(ru(ut)||ut.contentEditable==="true")&&(vo=ut,Cf=ye,$a=null);break;case"focusout":$a=Cf=vo=null;break;case"mousedown":Ps=!0;break;case"contextmenu":case"mouseup":case"dragend":Ps=!1,Bl(Le,h,Fe);break;case"selectionchange":if(oa)break;case"keydown":case"keyup":Bl(Le,h,Fe)}var dt;if(_l)e:{switch(i){case"compositionstart":var yt="onCompositionStart";break e;case"compositionend":yt="onCompositionEnd";break e;case"compositionupdate":yt="onCompositionUpdate";break e}yt=void 0}else As?gp(i,h)&&(yt="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&(yt="onCompositionStart");yt&&(Ef&&h.locale!=="ko"&&(As||yt!=="onCompositionStart"?yt==="onCompositionEnd"&&As&&(dt=mf()):(sn=Fe,Rl="value"in sn?sn.value:sn.textContent,As=!0)),ut=fu(ye,yt),0<ut.length&&(yt=new sp(yt,i,null,h,Fe),Le.push({event:yt,listeners:ut}),dt?yt.data=dt:(dt=vp(h),dt!==null&&(yt.data=dt)))),(dt=hp?Os(i,h):Fy(i,h))&&(ye=fu(ye,"onBeforeInput"),0<ye.length&&(Fe=new sp("onBeforeInput","beforeinput",null,h,Fe),Le.push({event:Fe,listeners:ye}),Fe.data=dt))}Tp(Le,l)})}function Ls(i,l,h){return{instance:i,listener:l,currentTarget:h}}function fu(i,l){for(var h=l+"Capture",v=[];i!==null;){var I=i,C=I.stateNode;I.tag===5&&C!==null&&(I=C,C=Fn(i,h),C!=null&&v.unshift(Ls(i,C,I)),C=Fn(i,l),C!=null&&v.push(Ls(i,C,I))),i=i.return}return v}function Rs(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function En(i,l,h,v,I){for(var C=l._reactName,_=[];h!==null&&h!==v;){var G=h,ee=G.alternate,ye=G.stateNode;if(ee!==null&&ee===v)break;G.tag===5&&ye!==null&&(G=ye,I?(ee=Fn(h,C),ee!=null&&_.unshift(Ls(h,ee,G))):I||(ee=Fn(h,C),ee!=null&&_.push(Ls(h,ee,G)))),h=h.return}_.length!==0&&i.push({event:l,listeners:_})}var tr=/\r\n?/g,By=/\u0000|\uFFFD/g;function Ep(i){return(typeof i=="string"?i:""+i).replace(tr,`
`).replace(By,"")}function Zl(i,l,h){if(l=Ep(l),Ep(i)!==l&&h)throw Error(n(425))}function hu(){}var Wl=null,Vi=null;function $l(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Qo=typeof setTimeout=="function"?setTimeout:void 0,Gl=typeof clearTimeout=="function"?clearTimeout:void 0,_s=typeof Promise=="function"?Promise:void 0,mu=typeof queueMicrotask=="function"?queueMicrotask:typeof _s<"u"?function(i){return _s.resolve(null).then(i).catch(Hs)}:Qo;function Hs(i){setTimeout(function(){throw i})}function Af(i,l){var h=l,v=0;do{var I=h.nextSibling;if(i.removeChild(h),I&&I.nodeType===8)if(h=I.data,h==="/$"){if(v===0){i.removeChild(I),Ht(l);return}v--}else h!=="$"&&h!=="$?"&&h!=="$!"||v++;h=I}while(h);Ht(l)}function Xo(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return i}function xp(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var h=i.data;if(h==="$"||h==="$!"||h==="$?"){if(l===0)return i;l--}else h==="/$"&&l++}i=i.previousSibling}return null}var Bs=Math.random().toString(36).slice(2),Ga="__reactFiber$"+Bs,ei="__reactProps$"+Bs,Vr="__reactContainer$"+Bs,pu="__reactEvents$"+Bs,B="__reactListeners$"+Bs,Ys="__reactHandles$"+Bs;function qa(i){var l=i[Ga];if(l)return l;for(var h=i.parentNode;h;){if(l=h[Vr]||h[Ga]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(i=xp(i);i!==null;){if(h=i[Ga])return h;i=xp(i)}return l}i=h,h=i.parentNode}return null}function nr(i){return i=i[Ga]||i[Vr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function St(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function gu(i){return i[ei]||null}var Of=[],zs=-1;function Ar(i){return{current:i}}function Qt(i){0>zs||(i.current=Of[zs],Of[zs]=null,zs--)}function qt(i,l){zs++,Of[zs]=i.current,i.current=l}var ti={},rr=Ar(ti),Or=Ar(!1),Dr=ti;function Us(i,l){var h=i.type.contextTypes;if(!h)return ti;var v=i.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===l)return v.__reactInternalMemoizedMaskedChildContext;var I={},C;for(C in h)I[C]=l[C];return v&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=I),I}function Fr(i){return i=i.childContextTypes,i!=null}function vu(){Qt(Or),Qt(rr)}function Cp(i,l,h){if(rr.current!==ti)throw Error(n(168));qt(rr,l),qt(Or,h)}function Mp(i,l,h){var v=i.stateNode;if(l=l.childContextTypes,typeof v.getChildContext!="function")return h;v=v.getChildContext();for(var I in v)if(!(I in l))throw Error(n(108,Be(i)||"Unknown",I));return Z({},h,v)}function ia(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||ti,Dr=rr.current,qt(rr,i),qt(Or,Or.current),!0}function Np(i,l,h){var v=i.stateNode;if(!v)throw Error(n(169));h?(i=Mp(i,l,Dr),v.__reactInternalMemoizedMergedChildContext=i,Qt(Or),Qt(rr),qt(rr,i)):Qt(Or),qt(Or,h)}var bo=null,yu=!1,Ff=!1;function kp(i){bo===null?bo=[i]:bo.push(i)}function Zi(i){yu=!0,kp(i)}function ni(){if(!Ff&&bo!==null){Ff=!0;var i=0,l=_t;try{var h=bo;for(_t=1;i<h.length;i++){var v=h[i];do v=v(!0);while(v!==null)}bo=null,yu=!1}catch(I){throw bo!==null&&(bo=bo.slice(i+1)),Wm(sf,ni),I}finally{_t=l,Ff=!1}}return null}var Vs=[],ar=0,wu=null,bu=0,sa=[],la=0,Wi=null,Ja=1,Ka="";function $i(i,l){Vs[ar++]=bu,Vs[ar++]=wu,wu=i,bu=l}function Ap(i,l,h){sa[la++]=Ja,sa[la++]=Ka,sa[la++]=Wi,Wi=i;var v=Ja;i=Ka;var I=32-xa(v)-1;v&=~(1<<I),h+=1;var C=32-xa(l)+I;if(30<C){var _=I-I%5;C=(v&(1<<_)-1).toString(32),v>>=_,I-=_,Ja=1<<32-xa(l)+I|h<<I|v,Ka=C+i}else Ja=1<<C|h<<I|v,Ka=i}function ql(i){i.return!==null&&($i(i,1),Ap(i,1,0))}function Gi(i){for(;i===wu;)wu=Vs[--ar],Vs[ar]=null,bu=Vs[--ar],Vs[ar]=null;for(;i===Wi;)Wi=sa[--la],sa[la]=null,Ka=sa[--la],sa[la]=null,Ja=sa[--la],sa[la]=null}var or=null,Zr=null,Xt=!1,Ma=null;function Qa(i,l){var h=Jr(5,null,null,0);h.elementType="DELETED",h.stateNode=l,h.return=i,l=i.deletions,l===null?(i.deletions=[h],i.flags|=16):l.push(h)}function Du(i,l){switch(i.tag){case 5:var h=i.type;return l=l.nodeType!==1||h.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(i.stateNode=l,or=i,Zr=Xo(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,or=i,Zr=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(h=Wi!==null?{id:Ja,overflow:Ka}:null,i.memoizedState={dehydrated:l,treeContext:h,retryLane:1073741824},h=Jr(18,null,null,0),h.stateNode=l,h.return=i,i.child=h,or=i,Zr=null,!0):!1;default:return!1}}function Do(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Pr(i){if(Xt){var l=Zr;if(l){var h=l;if(!Du(i,l)){if(Do(i))throw Error(n(418));l=Xo(h.nextSibling);var v=or;l&&Du(i,l)?Qa(v,h):(i.flags=i.flags&-4097|2,Xt=!1,or=i)}}else{if(Do(i))throw Error(n(418));i.flags=i.flags&-4097|2,Xt=!1,or=i}}}function Op(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;or=i}function Jl(i){if(i!==or)return!1;if(!Xt)return Op(i),Xt=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!$l(i.type,i.memoizedProps)),l&&(l=Zr)){if(Do(i))throw Pf(),Error(n(418));for(;l;)Qa(i,l),l=Xo(l.nextSibling)}if(Op(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8){var h=i.data;if(h==="/$"){if(l===0){Zr=Xo(i.nextSibling);break e}l--}else h!=="$"&&h!=="$!"&&h!=="$?"||l++}i=i.nextSibling}Zr=null}}else Zr=or?Xo(i.stateNode.nextSibling):null;return!0}function Pf(){for(var i=Zr;i;)i=Xo(i.nextSibling)}function Xa(){Zr=or=null,Xt=!1}function eo(i){Ma===null?Ma=[i]:Ma.push(i)}var Fp=F.ReactCurrentBatchConfig;function Na(i,l){if(i&&i.defaultProps){l=Z({},l),i=i.defaultProps;for(var h in i)l[h]===void 0&&(l[h]=i[h]);return l}return l}var qi=Ar(null),Su=null,Ji=null,Pn=null;function Kl(){Pn=Ji=Su=null}function Iu(i){var l=qi.current;Qt(qi),i._currentValue=l}function ca(i,l,h){for(;i!==null;){var v=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,v!==null&&(v.childLanes|=l)):v!==null&&(v.childLanes&l)!==l&&(v.childLanes|=l),i===h)break;i=i.return}}function ri(i,l){Su=i,Pn=Ji=null,i=i.dependencies,i!==null&&i.firstContext!==null&&(i.lanes&l&&(lr=!0),i.firstContext=null)}function Sr(i){var l=i._currentValue;if(Pn!==i)if(i={context:i,memoizedValue:l,next:null},Ji===null){if(Su===null)throw Error(n(308));Ji=i,Su.dependencies={lanes:0,firstContext:i}}else Ji=Ji.next=i;return l}var Wr=null;function Tu(i){Wr===null?Wr=[i]:Wr.push(i)}function ir(i,l,h,v){var I=l.interleaved;return I===null?(h.next=h,Tu(l)):(h.next=I.next,I.next=h),l.interleaved=h,ka(i,v)}function ka(i,l){i.lanes|=l;var h=i.alternate;for(h!==null&&(h.lanes|=l),h=i,i=i.return;i!==null;)i.childLanes|=l,h=i.alternate,h!==null&&(h.childLanes|=l),h=i,i=i.return;return h.tag===3?h.stateNode:null}var ai=!1;function jf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Pp(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Aa(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function oi(i,l,h){var v=i.updateQueue;if(v===null)return null;if(v=v.shared,Ot&2){var I=v.pending;return I===null?l.next=l:(l.next=I.next,I.next=l),v.pending=l,ka(i,h)}return I=v.interleaved,I===null?(l.next=l,Tu(v)):(l.next=I.next,I.next=l),v.interleaved=l,ka(i,h)}function ii(i,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194240)!==0)){var v=l.lanes;v&=i.pendingLanes,h|=v,l.lanes=h,Pl(i,h)}}function Lf(i,l){var h=i.updateQueue,v=i.alternate;if(v!==null&&(v=v.updateQueue,h===v)){var I=null,C=null;if(h=h.firstBaseUpdate,h!==null){do{var _={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};C===null?I=C=_:C=C.next=_,h=h.next}while(h!==null);C===null?I=C=l:C=C.next=l}else I=C=l;h={baseState:v.baseState,firstBaseUpdate:I,lastBaseUpdate:C,shared:v.shared,effects:v.effects},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=l:i.next=l,h.lastBaseUpdate=l}function Eu(i,l,h,v){var I=i.updateQueue;ai=!1;var C=I.firstBaseUpdate,_=I.lastBaseUpdate,G=I.shared.pending;if(G!==null){I.shared.pending=null;var ee=G,ye=ee.next;ee.next=null,_===null?C=ye:_.next=ye,_=ee;var Fe=i.alternate;Fe!==null&&(Fe=Fe.updateQueue,G=Fe.lastBaseUpdate,G!==_&&(G===null?Fe.firstBaseUpdate=ye:G.next=ye,Fe.lastBaseUpdate=ee))}if(C!==null){var Le=I.baseState;_=0,Fe=ye=ee=null,G=C;do{var Oe=G.lane,qe=G.eventTime;if((v&Oe)===Oe){Fe!==null&&(Fe=Fe.next={eventTime:qe,lane:0,tag:G.tag,payload:G.payload,callback:G.callback,next:null});e:{var tt=i,nt=G;switch(Oe=l,qe=h,nt.tag){case 1:if(tt=nt.payload,typeof tt=="function"){Le=tt.call(qe,Le,Oe);break e}Le=tt;break e;case 3:tt.flags=tt.flags&-65537|128;case 0:if(tt=nt.payload,Oe=typeof tt=="function"?tt.call(qe,Le,Oe):tt,Oe==null)break e;Le=Z({},Le,Oe);break e;case 2:ai=!0}}G.callback!==null&&G.lane!==0&&(i.flags|=64,Oe=I.effects,Oe===null?I.effects=[G]:Oe.push(G))}else qe={eventTime:qe,lane:Oe,tag:G.tag,payload:G.payload,callback:G.callback,next:null},Fe===null?(ye=Fe=qe,ee=Le):Fe=Fe.next=qe,_|=Oe;if(G=G.next,G===null){if(G=I.shared.pending,G===null)break;Oe=G,G=Oe.next,Oe.next=null,I.lastBaseUpdate=Oe,I.shared.pending=null}}while(!0);if(Fe===null&&(ee=Le),I.baseState=ee,I.firstBaseUpdate=ye,I.lastBaseUpdate=Fe,l=I.shared.interleaved,l!==null){I=l;do _|=I.lane,I=I.next;while(I!==l)}else C===null&&(I.shared.lanes=0);hi|=_,i.lanes=_,i.memoizedState=Le}}function jp(i,l,h){if(i=l.effects,l.effects=null,i!==null)for(l=0;l<i.length;l++){var v=i[l],I=v.callback;if(I!==null){if(v.callback=null,v=h,typeof I!="function")throw Error(n(191,I));I.call(v)}}}var Zs=new e.Component().refs;function Rf(i,l,h,v){l=i.memoizedState,h=h(v,l),h=h==null?l:Z({},l,h),i.memoizedState=h,i.lanes===0&&(i.updateQueue.baseState=h)}var xu={isMounted:function(i){return(i=i._reactInternals)?Li(i)===i:!1},enqueueSetState:function(i,l,h){i=i._reactInternals;var v=Er(),I=pi(i),C=Aa(v,I);C.payload=l,h!=null&&(C.callback=h),l=oi(i,C,I),l!==null&&(ja(l,i,I,v),ii(l,i,I))},enqueueReplaceState:function(i,l,h){i=i._reactInternals;var v=Er(),I=pi(i),C=Aa(v,I);C.tag=1,C.payload=l,h!=null&&(C.callback=h),l=oi(i,C,I),l!==null&&(ja(l,i,I,v),ii(l,i,I))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var h=Er(),v=pi(i),I=Aa(h,v);I.tag=2,l!=null&&(I.callback=l),l=oi(i,I,v),l!==null&&(ja(l,i,v,h),ii(l,i,v))}};function Cu(i,l,h,v,I,C,_){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(v,C,_):l.prototype&&l.prototype.isPureReactComponent?!Ge(h,v)||!Ge(I,C):!0}function _f(i,l,h){var v=!1,I=ti,C=l.contextType;return typeof C=="object"&&C!==null?C=Sr(C):(I=Fr(l)?Dr:rr.current,v=l.contextTypes,C=(v=v!=null)?Us(i,I):ti),l=new l(h,C),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=xu,i.stateNode=l,l._reactInternals=i,v&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=I,i.__reactInternalMemoizedMaskedChildContext=C),l}function Lp(i,l,h,v){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,v),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,v),l.state!==i&&xu.enqueueReplaceState(l,l.state,null)}function Hf(i,l,h,v){var I=i.stateNode;I.props=h,I.state=i.memoizedState,I.refs=Zs,jf(i);var C=l.contextType;typeof C=="object"&&C!==null?I.context=Sr(C):(C=Fr(l)?Dr:rr.current,I.context=Us(i,C)),I.state=i.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(Rf(i,l,C,h),I.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof I.getSnapshotBeforeUpdate=="function"||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(l=I.state,typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount(),l!==I.state&&xu.enqueueReplaceState(I,I.state,null),Eu(i,h,I,v),I.state=i.memoizedState),typeof I.componentDidMount=="function"&&(i.flags|=4194308)}function Ql(i,l,h){if(i=h.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var v=h.stateNode}if(!v)throw Error(n(147,i));var I=v,C=""+i;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===C?l.ref:(l=function(_){var G=I.refs;G===Zs&&(G=I.refs={}),_===null?delete G[C]:G[C]=_},l._stringRef=C,l)}if(typeof i!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,i))}return i}function Xl(i,l){throw i=Object.prototype.toString.call(l),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function Mu(i){var l=i._init;return l(i._payload)}function Rp(i){function l(ue,re){if(i){var de=ue.deletions;de===null?(ue.deletions=[re],ue.flags|=16):de.push(re)}}function h(ue,re){if(!i)return null;for(;re!==null;)l(ue,re),re=re.sibling;return null}function v(ue,re){for(ue=new Map;re!==null;)re.key!==null?ue.set(re.key,re):ue.set(re.index,re),re=re.sibling;return ue}function I(ue,re){return ue=yi(ue,re),ue.index=0,ue.sibling=null,ue}function C(ue,re,de){return ue.index=de,i?(de=ue.alternate,de!==null?(de=de.index,de<re?(ue.flags|=2,re):de):(ue.flags|=2,re)):(ue.flags|=1048576,re)}function _(ue){return i&&ue.alternate===null&&(ue.flags|=2),ue}function G(ue,re,de,He){return re===null||re.tag!==6?(re=Sh(de,ue.mode,He),re.return=ue,re):(re=I(re,de),re.return=ue,re)}function ee(ue,re,de,He){var at=de.type;return at===L?Fe(ue,re,de.props.children,He,de.key):re!==null&&(re.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===ge&&Mu(at)===re.type)?(He=I(re,de.props),He.ref=Ql(ue,re,de),He.return=ue,He):(He=rd(de.type,de.key,de.props,null,ue.mode,He),He.ref=Ql(ue,re,de),He.return=ue,He)}function ye(ue,re,de,He){return re===null||re.tag!==4||re.stateNode.containerInfo!==de.containerInfo||re.stateNode.implementation!==de.implementation?(re=Ih(de,ue.mode,He),re.return=ue,re):(re=I(re,de.children||[]),re.return=ue,re)}function Fe(ue,re,de,He,at){return re===null||re.tag!==7?(re=rs(de,ue.mode,He,at),re.return=ue,re):(re=I(re,de),re.return=ue,re)}function Le(ue,re,de){if(typeof re=="string"&&re!==""||typeof re=="number")return re=Sh(""+re,ue.mode,de),re.return=ue,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case H:return de=rd(re.type,re.key,re.props,null,ue.mode,de),de.ref=Ql(ue,null,re),de.return=ue,de;case P:return re=Ih(re,ue.mode,de),re.return=ue,re;case ge:var He=re._init;return Le(ue,He(re._payload),de)}if(rn(re)||we(re))return re=rs(re,ue.mode,de,null),re.return=ue,re;Xl(ue,re)}return null}function Oe(ue,re,de,He){var at=re!==null?re.key:null;if(typeof de=="string"&&de!==""||typeof de=="number")return at!==null?null:G(ue,re,""+de,He);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case H:return de.key===at?ee(ue,re,de,He):null;case P:return de.key===at?ye(ue,re,de,He):null;case ge:return at=de._init,Oe(ue,re,at(de._payload),He)}if(rn(de)||we(de))return at!==null?null:Fe(ue,re,de,He,null);Xl(ue,de)}return null}function qe(ue,re,de,He,at){if(typeof He=="string"&&He!==""||typeof He=="number")return ue=ue.get(de)||null,G(re,ue,""+He,at);if(typeof He=="object"&&He!==null){switch(He.$$typeof){case H:return ue=ue.get(He.key===null?de:He.key)||null,ee(re,ue,He,at);case P:return ue=ue.get(He.key===null?de:He.key)||null,ye(re,ue,He,at);case ge:var ut=He._init;return qe(ue,re,de,ut(He._payload),at)}if(rn(He)||we(He))return ue=ue.get(de)||null,Fe(re,ue,He,at,null);Xl(re,He)}return null}function tt(ue,re,de,He){for(var at=null,ut=null,dt=re,yt=re=0,Vn=null;dt!==null&&yt<de.length;yt++){dt.index>yt?(Vn=dt,dt=null):Vn=dt.sibling;var Lt=Oe(ue,dt,de[yt],He);if(Lt===null){dt===null&&(dt=Vn);break}i&&dt&&Lt.alternate===null&&l(ue,dt),re=C(Lt,re,yt),ut===null?at=Lt:ut.sibling=Lt,ut=Lt,dt=Vn}if(yt===de.length)return h(ue,dt),Xt&&$i(ue,yt),at;if(dt===null){for(;yt<de.length;yt++)dt=Le(ue,de[yt],He),dt!==null&&(re=C(dt,re,yt),ut===null?at=dt:ut.sibling=dt,ut=dt);return Xt&&$i(ue,yt),at}for(dt=v(ue,dt);yt<de.length;yt++)Vn=qe(dt,ue,yt,de[yt],He),Vn!==null&&(i&&Vn.alternate!==null&&dt.delete(Vn.key===null?yt:Vn.key),re=C(Vn,re,yt),ut===null?at=Vn:ut.sibling=Vn,ut=Vn);return i&&dt.forEach(function(wi){return l(ue,wi)}),Xt&&$i(ue,yt),at}function nt(ue,re,de,He){var at=we(de);if(typeof at!="function")throw Error(n(150));if(de=at.call(de),de==null)throw Error(n(151));for(var ut=at=null,dt=re,yt=re=0,Vn=null,Lt=de.next();dt!==null&&!Lt.done;yt++,Lt=de.next()){dt.index>yt?(Vn=dt,dt=null):Vn=dt.sibling;var wi=Oe(ue,dt,Lt.value,He);if(wi===null){dt===null&&(dt=Vn);break}i&&dt&&wi.alternate===null&&l(ue,dt),re=C(wi,re,yt),ut===null?at=wi:ut.sibling=wi,ut=wi,dt=Vn}if(Lt.done)return h(ue,dt),Xt&&$i(ue,yt),at;if(dt===null){for(;!Lt.done;yt++,Lt=de.next())Lt=Le(ue,Lt.value,He),Lt!==null&&(re=C(Lt,re,yt),ut===null?at=Lt:ut.sibling=Lt,ut=Lt);return Xt&&$i(ue,yt),at}for(dt=v(ue,dt);!Lt.done;yt++,Lt=de.next())Lt=qe(dt,ue,yt,Lt.value,He),Lt!==null&&(i&&Lt.alternate!==null&&dt.delete(Lt.key===null?yt:Lt.key),re=C(Lt,re,yt),ut===null?at=Lt:ut.sibling=Lt,ut=Lt);return i&&dt.forEach(function(i0){return l(ue,i0)}),Xt&&$i(ue,yt),at}function wn(ue,re,de,He){if(typeof de=="object"&&de!==null&&de.type===L&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case H:e:{for(var at=de.key,ut=re;ut!==null;){if(ut.key===at){if(at=de.type,at===L){if(ut.tag===7){h(ue,ut.sibling),re=I(ut,de.props.children),re.return=ue,ue=re;break e}}else if(ut.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===ge&&Mu(at)===ut.type){h(ue,ut.sibling),re=I(ut,de.props),re.ref=Ql(ue,ut,de),re.return=ue,ue=re;break e}h(ue,ut);break}else l(ue,ut);ut=ut.sibling}de.type===L?(re=rs(de.props.children,ue.mode,He,de.key),re.return=ue,ue=re):(He=rd(de.type,de.key,de.props,null,ue.mode,He),He.ref=Ql(ue,re,de),He.return=ue,ue=He)}return _(ue);case P:e:{for(ut=de.key;re!==null;){if(re.key===ut)if(re.tag===4&&re.stateNode.containerInfo===de.containerInfo&&re.stateNode.implementation===de.implementation){h(ue,re.sibling),re=I(re,de.children||[]),re.return=ue,ue=re;break e}else{h(ue,re);break}else l(ue,re);re=re.sibling}re=Ih(de,ue.mode,He),re.return=ue,ue=re}return _(ue);case ge:return ut=de._init,wn(ue,re,ut(de._payload),He)}if(rn(de))return tt(ue,re,de,He);if(we(de))return nt(ue,re,de,He);Xl(ue,de)}return typeof de=="string"&&de!==""||typeof de=="number"?(de=""+de,re!==null&&re.tag===6?(h(ue,re.sibling),re=I(re,de),re.return=ue,ue=re):(h(ue,re),re=Sh(de,ue.mode,He),re.return=ue,ue=re),_(ue)):h(ue,re)}return wn}var si=Rp(!0),Bf=Rp(!1),Ws={},Oa=Ar(Ws),li=Ar(Ws),ec=Ar(Ws);function ci(i){if(i===Ws)throw Error(n(174));return i}function Nu(i,l){switch(qt(ec,l),qt(li,i),qt(Oa,Ws),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Mr(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=Mr(l,i)}Qt(Oa),qt(Oa,l)}function $s(){Qt(Oa),Qt(li),Qt(ec)}function Yf(i){ci(ec.current);var l=ci(Oa.current),h=Mr(l,i.type);l!==h&&(qt(li,i),qt(Oa,h))}function zf(i){li.current===i&&(Qt(Oa),Qt(li))}var en=Ar(0);function tc(i){for(var l=i;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.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===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var nc=[];function Uf(){for(var i=0;i<nc.length;i++)nc[i]._workInProgressVersionPrimary=null;nc.length=0}var Gs=F.ReactCurrentDispatcher,It=F.ReactCurrentBatchConfig,Ki=0,cn=null,un=null,jn=null,ku=!1,rc=!1,sr=0,Yy=0;function Ln(){throw Error(n(321))}function ac(i,l){if(l===null)return!1;for(var h=0;h<l.length&&h<i.length;h++)if(!pe(i[h],l[h]))return!1;return!0}function Au(i,l,h,v,I,C){if(Ki=C,cn=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Gs.current=i===null||i.memoizedState===null?ic:Uy,i=h(v,I),rc){C=0;do{if(rc=!1,sr=0,25<=C)throw Error(n(301));C+=1,jn=un=null,l.updateQueue=null,Gs.current=Vp,i=h(v,I)}while(rc)}if(Gs.current=To,l=un!==null&&un.next!==null,Ki=0,jn=un=cn=null,ku=!1,l)throw Error(n(300));return i}function Ou(){var i=sr!==0;return sr=0,i}function mn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?cn.memoizedState=jn=i:jn=jn.next=i,jn}function Rn(){if(un===null){var i=cn.alternate;i=i!==null?i.memoizedState:null}else i=un.next;var l=jn===null?cn.memoizedState:jn.next;if(l!==null)jn=l,un=i;else{if(i===null)throw Error(n(310));un=i,i={memoizedState:un.memoizedState,baseState:un.baseState,baseQueue:un.baseQueue,queue:un.queue,next:null},jn===null?cn.memoizedState=jn=i:jn=jn.next=i}return jn}function Qi(i,l){return typeof l=="function"?l(i):l}function Fu(i){var l=Rn(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=i;var v=un,I=v.baseQueue,C=h.pending;if(C!==null){if(I!==null){var _=I.next;I.next=C.next,C.next=_}v.baseQueue=I=C,h.pending=null}if(I!==null){C=I.next,v=v.baseState;var G=_=null,ee=null,ye=C;do{var Fe=ye.lane;if((Ki&Fe)===Fe)ee!==null&&(ee=ee.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),v=ye.hasEagerState?ye.eagerState:i(v,ye.action);else{var Le={lane:Fe,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};ee===null?(G=ee=Le,_=v):ee=ee.next=Le,cn.lanes|=Fe,hi|=Fe}ye=ye.next}while(ye!==null&&ye!==C);ee===null?_=v:ee.next=G,pe(v,l.memoizedState)||(lr=!0),l.memoizedState=v,l.baseState=_,l.baseQueue=ee,h.lastRenderedState=v}if(i=h.interleaved,i!==null){I=i;do C=I.lane,cn.lanes|=C,hi|=C,I=I.next;while(I!==i)}else I===null&&(h.lanes=0);return[l.memoizedState,h.dispatch]}function qs(i){var l=Rn(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=i;var v=h.dispatch,I=h.pending,C=l.memoizedState;if(I!==null){h.pending=null;var _=I=I.next;do C=i(C,_.action),_=_.next;while(_!==I);pe(C,l.memoizedState)||(lr=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),h.lastRenderedState=C}return[C,v]}function Vf(){}function Pu(i,l){var h=cn,v=Rn(),I=l(),C=!pe(v.memoizedState,I);if(C&&(v.memoizedState=I,lr=!0),v=v.queue,$f(Lu.bind(null,h,v,i),[i]),v.getSnapshot!==l||C||jn!==null&&jn.memoizedState.tag&1){if(h.flags|=2048,Js(9,ju.bind(null,h,v,I,l),void 0,null),Un===null)throw Error(n(349));Ki&30||Zf(h,l,I)}return I}function Zf(i,l,h){i.flags|=16384,i={getSnapshot:l,value:h},l=cn.updateQueue,l===null?(l={lastEffect:null,stores:null},cn.updateQueue=l,l.stores=[i]):(h=l.stores,h===null?l.stores=[i]:h.push(i))}function ju(i,l,h,v){l.value=h,l.getSnapshot=v,So(l)&&_p(i)}function Lu(i,l,h){return h(function(){So(l)&&_p(i)})}function So(i){var l=i.getSnapshot;i=i.value;try{var h=l();return!pe(i,h)}catch{return!0}}function _p(i){var l=ka(i,1);l!==null&&ja(l,i,1,-1)}function Io(i){var l=mn();return typeof i=="function"&&(i=i()),l.memoizedState=l.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:i},l.queue=i,i=i.dispatch=zp.bind(null,cn,i),[l.memoizedState,i]}function Js(i,l,h,v){return i={tag:i,create:l,destroy:h,deps:v,next:null},l=cn.updateQueue,l===null?(l={lastEffect:null,stores:null},cn.updateQueue=l,l.lastEffect=i.next=i):(h=l.lastEffect,h===null?l.lastEffect=i.next=i:(v=h.next,h.next=i,i.next=v,l.lastEffect=i)),i}function Wf(){return Rn().memoizedState}function Ks(i,l,h,v){var I=mn();cn.flags|=i,I.memoizedState=Js(1|l,h,void 0,v===void 0?null:v)}function Ru(i,l,h,v){var I=Rn();v=v===void 0?null:v;var C=void 0;if(un!==null){var _=un.memoizedState;if(C=_.destroy,v!==null&&ac(v,_.deps)){I.memoizedState=Js(l,h,C,v);return}}cn.flags|=i,I.memoizedState=Js(1|l,h,C,v)}function Hp(i,l){return Ks(8390656,8,i,l)}function $f(i,l){return Ru(2048,8,i,l)}function Gf(i,l){return Ru(4,2,i,l)}function qf(i,l){return Ru(4,4,i,l)}function Bp(i,l){if(typeof l=="function")return i=i(),l(i),function(){l(null)};if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function Jf(i,l,h){return h=h!=null?h.concat([i]):null,Ru(4,4,Bp.bind(null,l,i),h)}function _u(){}function Ir(i,l){var h=Rn();l=l===void 0?null:l;var v=h.memoizedState;return v!==null&&l!==null&&ac(l,v[1])?v[0]:(h.memoizedState=[i,l],i)}function Fa(i,l){var h=Rn();l=l===void 0?null:l;var v=h.memoizedState;return v!==null&&l!==null&&ac(l,v[1])?v[0]:(i=i(),h.memoizedState=[i,l],i)}function Yp(i,l,h){return Ki&21?(pe(h,l)||(h=cf(),cn.lanes|=h,hi|=h,i.baseState=!0),l):(i.baseState&&(i.baseState=!1,lr=!0),i.memoizedState=h)}function zy(i,l){var h=_t;_t=h!==0&&4>h?h:4,i(!0);var v=It.transition;It.transition={};try{i(!1),l()}finally{_t=h,It.transition=v}}function oc(){return Rn().memoizedState}function Qs(i,l,h){var v=pi(i);if(h={lane:v,action:h,hasEagerState:!1,eagerState:null,next:null},Kf(i))Up(l,h);else if(h=ir(i,l,h,v),h!==null){var I=Er();ja(h,i,v,I),Qf(h,l,v)}}function zp(i,l,h){var v=pi(i),I={lane:v,action:h,hasEagerState:!1,eagerState:null,next:null};if(Kf(i))Up(l,I);else{var C=i.alternate;if(i.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var _=l.lastRenderedState,G=C(_,h);if(I.hasEagerState=!0,I.eagerState=G,pe(G,_)){var ee=l.interleaved;ee===null?(I.next=I,Tu(l)):(I.next=ee.next,ee.next=I),l.interleaved=I;return}}catch{}h=ir(i,l,I,v),h!==null&&(I=Er(),ja(h,i,v,I),Qf(h,l,v))}}function Kf(i){var l=i.alternate;return i===cn||l!==null&&l===cn}function Up(i,l){rc=ku=!0;var h=i.pending;h===null?l.next=l:(l.next=h.next,h.next=l),i.pending=l}function Qf(i,l,h){if(h&4194240){var v=l.lanes;v&=i.pendingLanes,h|=v,l.lanes=h,Pl(i,h)}}var To={readContext:Sr,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useInsertionEffect:Ln,useLayoutEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useMutableSource:Ln,useSyncExternalStore:Ln,useId:Ln,unstable_isNewReconciler:!1},ic={readContext:Sr,useCallback:function(i,l){return mn().memoizedState=[i,l===void 0?null:l],i},useContext:Sr,useEffect:Hp,useImperativeHandle:function(i,l,h){return h=h!=null?h.concat([i]):null,Ks(4194308,4,Bp.bind(null,l,i),h)},useLayoutEffect:function(i,l){return Ks(4194308,4,i,l)},useInsertionEffect:function(i,l){return Ks(4,2,i,l)},useMemo:function(i,l){var h=mn();return l=l===void 0?null:l,i=i(),h.memoizedState=[i,l],i},useReducer:function(i,l,h){var v=mn();return l=h!==void 0?h(l):l,v.memoizedState=v.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},v.queue=i,i=i.dispatch=Qs.bind(null,cn,i),[v.memoizedState,i]},useRef:function(i){var l=mn();return i={current:i},l.memoizedState=i},useState:Io,useDebugValue:_u,useDeferredValue:function(i){return mn().memoizedState=i},useTransition:function(){var i=Io(!1),l=i[0];return i=zy.bind(null,i[1]),mn().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,h){var v=cn,I=mn();if(Xt){if(h===void 0)throw Error(n(407));h=h()}else{if(h=l(),Un===null)throw Error(n(349));Ki&30||Zf(v,l,h)}I.memoizedState=h;var C={value:h,getSnapshot:l};return I.queue=C,Hp(Lu.bind(null,v,C,i),[i]),v.flags|=2048,Js(9,ju.bind(null,v,C,h,l),void 0,null),h},useId:function(){var i=mn(),l=Un.identifierPrefix;if(Xt){var h=Ka,v=Ja;h=(v&~(1<<32-xa(v)-1)).toString(32)+h,l=":"+l+"R"+h,h=sr++,0<h&&(l+="H"+h.toString(32)),l+=":"}else h=Yy++,l=":"+l+"r"+h.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},Uy={readContext:Sr,useCallback:Ir,useContext:Sr,useEffect:$f,useImperativeHandle:Jf,useInsertionEffect:Gf,useLayoutEffect:qf,useMemo:Fa,useReducer:Fu,useRef:Wf,useState:function(){return Fu(Qi)},useDebugValue:_u,useDeferredValue:function(i){var l=Rn();return Yp(l,un.memoizedState,i)},useTransition:function(){var i=Fu(Qi)[0],l=Rn().memoizedState;return[i,l]},useMutableSource:Vf,useSyncExternalStore:Pu,useId:oc,unstable_isNewReconciler:!1},Vp={readContext:Sr,useCallback:Ir,useContext:Sr,useEffect:$f,useImperativeHandle:Jf,useInsertionEffect:Gf,useLayoutEffect:qf,useMemo:Fa,useReducer:qs,useRef:Wf,useState:function(){return qs(Qi)},useDebugValue:_u,useDeferredValue:function(i){var l=Rn();return un===null?l.memoizedState=i:Yp(l,un.memoizedState,i)},useTransition:function(){var i=qs(Qi)[0],l=Rn().memoizedState;return[i,l]},useMutableSource:Vf,useSyncExternalStore:Pu,useId:oc,unstable_isNewReconciler:!1};function Xi(i,l){try{var h="",v=l;do h+=be(v),v=v.return;while(v);var I=h}catch(C){I=`
Error generating stack: `+C.message+`
`+C.stack}return{value:i,source:l,stack:I,digest:null}}function Xs(i,l,h){return{value:i,source:null,stack:h??null,digest:l??null}}function Hu(i,l){try{console.error(l.value)}catch(h){setTimeout(function(){throw h})}}var Bu=typeof WeakMap=="function"?WeakMap:Map;function Yu(i,l,h){h=Aa(-1,h),h.tag=3,h.payload={element:null};var v=l.value;return h.callback=function(){Ku||(Ku=!0,hh=v),Hu(i,l)},h}function sc(i,l,h){h=Aa(-1,h),h.tag=3;var v=i.type.getDerivedStateFromError;if(typeof v=="function"){var I=l.value;h.payload=function(){return v(I)},h.callback=function(){Hu(i,l)}}var C=i.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(h.callback=function(){Hu(i,l),typeof v!="function"&&(mi===null?mi=new Set([this]):mi.add(this));var _=l.stack;this.componentDidCatch(l.value,{componentStack:_!==null?_:""})}),h}function Zp(i,l,h){var v=i.pingCache;if(v===null){v=i.pingCache=new Bu;var I=new Set;v.set(l,I)}else I=v.get(l),I===void 0&&(I=new Set,v.set(l,I));I.has(h)||(I.add(h),i=Ky.bind(null,i,l,h),l.then(i,i))}function Xf(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function lc(i,l,h,v,I){return i.mode&1?(i.flags|=65536,i.lanes=I,i):(i===l?i.flags|=65536:(i.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(l=Aa(-1,1),l.tag=2,oi(h,l,1))),h.lanes|=1),i)}var Wp=F.ReactCurrentOwner,lr=!1;function Tr(i,l,h,v){l.child=i===null?Bf(l,null,h,v):si(l,i.child,h,v)}function eh(i,l,h,v,I){h=h.render;var C=l.ref;return ri(l,I),v=Au(i,l,h,v,C,I),h=Ou(),i!==null&&!lr?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~I,ro(i,l,I)):(Xt&&h&&ql(l),l.flags|=1,Tr(i,l,v,I),l.child)}function to(i,l,h,v,I){if(i===null){var C=h.type;return typeof C=="function"&&!Dh(C)&&C.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(l.tag=15,l.type=C,th(i,l,C,v,I)):(i=rd(h.type,null,v,l,l.mode,I),i.ref=l.ref,i.return=l,l.child=i)}if(C=i.child,!(i.lanes&I)){var _=C.memoizedProps;if(h=h.compare,h=h!==null?h:Ge,h(_,v)&&i.ref===l.ref)return ro(i,l,I)}return l.flags|=1,i=yi(C,v),i.ref=l.ref,i.return=l,l.child=i}function th(i,l,h,v,I){if(i!==null){var C=i.memoizedProps;if(Ge(C,v)&&i.ref===l.ref)if(lr=!1,l.pendingProps=v=C,(i.lanes&I)!==0)i.flags&131072&&(lr=!0);else return l.lanes=i.lanes,ro(i,l,I)}return zu(i,l,h,v,I)}function nh(i,l,h){var v=l.pendingProps,I=v.children,C=i!==null?i.memoizedState:null;if(v.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null,transitions:null},qt(al,qr),qr|=h;else{if(!(h&1073741824))return i=C!==null?C.baseLanes|h:h,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,qt(al,qr),qr|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},v=C!==null?C.baseLanes:h,qt(al,qr),qr|=v}else C!==null?(v=C.baseLanes|h,l.memoizedState=null):v=h,qt(al,qr),qr|=v;return Tr(i,l,I,h),l.child}function $p(i,l){var h=l.ref;(i===null&&h!==null||i!==null&&i.ref!==h)&&(l.flags|=512,l.flags|=2097152)}function zu(i,l,h,v,I){var C=Fr(h)?Dr:rr.current;return C=Us(l,C),ri(l,I),h=Au(i,l,h,v,C,I),v=Ou(),i!==null&&!lr?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~I,ro(i,l,I)):(Xt&&v&&ql(l),l.flags|=1,Tr(i,l,h,I),l.child)}function Gp(i,l,h,v,I){if(Fr(h)){var C=!0;ia(l)}else C=!1;if(ri(l,I),l.stateNode===null)el(i,l),_f(l,h,v),Hf(l,h,v,I),v=!0;else if(i===null){var _=l.stateNode,G=l.memoizedProps;_.props=G;var ee=_.context,ye=h.contextType;typeof ye=="object"&&ye!==null?ye=Sr(ye):(ye=Fr(h)?Dr:rr.current,ye=Us(l,ye));var Fe=h.getDerivedStateFromProps,Le=typeof Fe=="function"||typeof _.getSnapshotBeforeUpdate=="function";Le||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(G!==v||ee!==ye)&&Lp(l,_,v,ye),ai=!1;var Oe=l.memoizedState;_.state=Oe,Eu(l,v,_,I),ee=l.memoizedState,G!==v||Oe!==ee||Or.current||ai?(typeof Fe=="function"&&(Rf(l,h,Fe,v),ee=l.memoizedState),(G=ai||Cu(l,h,G,v,Oe,ee,ye))?(Le||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(l.flags|=4194308)):(typeof _.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=v,l.memoizedState=ee),_.props=v,_.state=ee,_.context=ye,v=G):(typeof _.componentDidMount=="function"&&(l.flags|=4194308),v=!1)}else{_=l.stateNode,Pp(i,l),G=l.memoizedProps,ye=l.type===l.elementType?G:Na(l.type,G),_.props=ye,Le=l.pendingProps,Oe=_.context,ee=h.contextType,typeof ee=="object"&&ee!==null?ee=Sr(ee):(ee=Fr(h)?Dr:rr.current,ee=Us(l,ee));var qe=h.getDerivedStateFromProps;(Fe=typeof qe=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(G!==Le||Oe!==ee)&&Lp(l,_,v,ee),ai=!1,Oe=l.memoizedState,_.state=Oe,Eu(l,v,_,I);var tt=l.memoizedState;G!==Le||Oe!==tt||Or.current||ai?(typeof qe=="function"&&(Rf(l,h,qe,v),tt=l.memoizedState),(ye=ai||Cu(l,h,ye,v,Oe,tt,ee)||!1)?(Fe||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(v,tt,ee),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(v,tt,ee)),typeof _.componentDidUpdate=="function"&&(l.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof _.componentDidUpdate!="function"||G===i.memoizedProps&&Oe===i.memoizedState||(l.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||G===i.memoizedProps&&Oe===i.memoizedState||(l.flags|=1024),l.memoizedProps=v,l.memoizedState=tt),_.props=v,_.state=tt,_.context=ee,v=ye):(typeof _.componentDidUpdate!="function"||G===i.memoizedProps&&Oe===i.memoizedState||(l.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||G===i.memoizedProps&&Oe===i.memoizedState||(l.flags|=1024),v=!1)}return rh(i,l,h,v,C,I)}function rh(i,l,h,v,I,C){$p(i,l);var _=(l.flags&128)!==0;if(!v&&!_)return I&&Np(l,h,!1),ro(i,l,C);v=l.stateNode,Wp.current=l;var G=_&&typeof h.getDerivedStateFromError!="function"?null:v.render();return l.flags|=1,i!==null&&_?(l.child=si(l,i.child,null,C),l.child=si(l,null,G,C)):Tr(i,l,G,C),l.memoizedState=v.state,I&&Np(l,h,!0),l.child}function no(i){var l=i.stateNode;l.pendingContext?Cp(i,l.pendingContext,l.pendingContext!==l.context):l.context&&Cp(i,l.context,!1),Nu(i,l.containerInfo)}function Uu(i,l,h,v,I){return Xa(),eo(I),l.flags|=256,Tr(i,l,h,v),l.child}var cc={dehydrated:null,treeContext:null,retryLane:0};function uc(i){return{baseLanes:i,cachePool:null,transitions:null}}function dc(i,l,h){var v=l.pendingProps,I=en.current,C=!1,_=(l.flags&128)!==0,G;if((G=_)||(G=i!==null&&i.memoizedState===null?!1:(I&2)!==0),G?(C=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(I|=1),qt(en,I&1),i===null)return Pr(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?(l.mode&1?i.data==="$!"?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(_=v.children,i=v.fallback,C?(v=l.mode,C=l.child,_={mode:"hidden",children:_},!(v&1)&&C!==null?(C.childLanes=0,C.pendingProps=_):C=ad(_,v,0,null),i=rs(i,v,h,null),C.return=l,i.return=l,C.sibling=i,l.child=C,l.child.memoizedState=uc(h),l.memoizedState=cc,i):ui(l,_));if(I=i.memoizedState,I!==null&&(G=I.dehydrated,G!==null))return Vu(i,l,_,v,G,I,h);if(C){C=v.fallback,_=l.mode,I=i.child,G=I.sibling;var ee={mode:"hidden",children:v.children};return!(_&1)&&l.child!==I?(v=l.child,v.childLanes=0,v.pendingProps=ee,l.deletions=null):(v=yi(I,ee),v.subtreeFlags=I.subtreeFlags&14680064),G!==null?C=yi(G,C):(C=rs(C,_,h,null),C.flags|=2),C.return=l,v.return=l,v.sibling=C,l.child=v,v=C,C=l.child,_=i.child.memoizedState,_=_===null?uc(h):{baseLanes:_.baseLanes|h,cachePool:null,transitions:_.transitions},C.memoizedState=_,C.childLanes=i.childLanes&~h,l.memoizedState=cc,v}return C=i.child,i=C.sibling,v=yi(C,{mode:"visible",children:v.children}),!(l.mode&1)&&(v.lanes=h),v.return=l,v.sibling=null,i!==null&&(h=l.deletions,h===null?(l.deletions=[i],l.flags|=16):h.push(i)),l.child=v,l.memoizedState=null,v}function ui(i,l){return l=ad({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function ct(i,l,h,v){return v!==null&&eo(v),si(l,i.child,null,h),i=ui(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function Vu(i,l,h,v,I,C,_){if(h)return l.flags&256?(l.flags&=-257,v=Xs(Error(n(422))),ct(i,l,_,v)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(C=v.fallback,I=l.mode,v=ad({mode:"visible",children:v.children},I,0,null),C=rs(C,I,_,null),C.flags|=2,v.return=l,C.return=l,v.sibling=C,l.child=v,l.mode&1&&si(l,i.child,null,_),l.child.memoizedState=uc(_),l.memoizedState=cc,C);if(!(l.mode&1))return ct(i,l,_,null);if(I.data==="$!"){if(v=I.nextSibling&&I.nextSibling.dataset,v)var G=v.dgst;return v=G,C=Error(n(419)),v=Xs(C,v,void 0),ct(i,l,_,v)}if(G=(_&i.childLanes)!==0,lr||G){if(v=Un,v!==null){switch(_&-_){case 4:I=2;break;case 16:I=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:I=32;break;case 536870912:I=268435456;break;default:I=0}I=I&(v.suspendedLanes|_)?0:I,I!==0&&I!==C.retryLane&&(C.retryLane=I,ka(i,I),ja(v,i,I,-1))}return wh(),v=Xs(Error(n(421))),ct(i,l,_,v)}return I.data==="$?"?(l.flags|=128,l.child=i.child,l=Qy.bind(null,i),I._reactRetry=l,null):(i=C.treeContext,Zr=Xo(I.nextSibling),or=l,Xt=!0,Ma=null,i!==null&&(sa[la++]=Ja,sa[la++]=Ka,sa[la++]=Wi,Ja=i.id,Ka=i.overflow,Wi=l),l=ui(l,v.children),l.flags|=4096,l)}function Zu(i,l,h){i.lanes|=l;var v=i.alternate;v!==null&&(v.lanes|=l),ca(i.return,l,h)}function Eo(i,l,h,v,I){var C=i.memoizedState;C===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:v,tail:h,tailMode:I}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=v,C.tail=h,C.tailMode=I)}function qp(i,l,h){var v=l.pendingProps,I=v.revealOrder,C=v.tail;if(Tr(i,l,v.children,h),v=en.current,v&2)v=v&1|2,l.flags|=128;else{if(i!==null&&i.flags&128)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Zu(i,h,l);else if(i.tag===19)Zu(i,h,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}v&=1}if(qt(en,v),!(l.mode&1))l.memoizedState=null;else switch(I){case"forwards":for(h=l.child,I=null;h!==null;)i=h.alternate,i!==null&&tc(i)===null&&(I=h),h=h.sibling;h=I,h===null?(I=l.child,l.child=null):(I=h.sibling,h.sibling=null),Eo(l,!1,I,h,C);break;case"backwards":for(h=null,I=l.child,l.child=null;I!==null;){if(i=I.alternate,i!==null&&tc(i)===null){l.child=I;break}i=I.sibling,I.sibling=h,h=I,I=i}Eo(l,!0,h,null,C);break;case"together":Eo(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function el(i,l){!(l.mode&1)&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function ro(i,l,h){if(i!==null&&(l.dependencies=i.dependencies),hi|=l.lanes,!(h&l.childLanes))return null;if(i!==null&&l.child!==i.child)throw Error(n(153));if(l.child!==null){for(i=l.child,h=yi(i,i.pendingProps),l.child=h,h.return=l;i.sibling!==null;)i=i.sibling,h=h.sibling=yi(i,i.pendingProps),h.return=l;h.sibling=null}return l.child}function cr(i,l,h){switch(l.tag){case 3:no(l),Xa();break;case 5:Yf(l);break;case 1:Fr(l.type)&&ia(l);break;case 4:Nu(l,l.stateNode.containerInfo);break;case 10:var v=l.type._context,I=l.memoizedProps.value;qt(qi,v._currentValue),v._currentValue=I;break;case 13:if(v=l.memoizedState,v!==null)return v.dehydrated!==null?(qt(en,en.current&1),l.flags|=128,null):h&l.child.childLanes?dc(i,l,h):(qt(en,en.current&1),i=ro(i,l,h),i!==null?i.sibling:null);qt(en,en.current&1);break;case 19:if(v=(h&l.childLanes)!==0,i.flags&128){if(v)return qp(i,l,h);l.flags|=128}if(I=l.memoizedState,I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),qt(en,en.current),v)break;return null;case 22:case 23:return l.lanes=0,nh(i,l,h)}return ro(i,l,h)}var Jp,ah,oh,Kp;Jp=function(i,l){for(var h=l.child;h!==null;){if(h.tag===5||h.tag===6)i.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},ah=function(){},oh=function(i,l,h,v){var I=i.memoizedProps;if(I!==v){i=l.stateNode,ci(Oa.current);var C=null;switch(h){case"input":I=$e(i,I),v=$e(i,v),C=[];break;case"select":I=Z({},I,{value:void 0}),v=Z({},v,{value:void 0}),C=[];break;case"textarea":I=an(i,I),v=an(i,v),C=[];break;default:typeof I.onClick!="function"&&typeof v.onClick=="function"&&(i.onclick=hu)}Yo(h,v);var _;h=null;for(ye in I)if(!v.hasOwnProperty(ye)&&I.hasOwnProperty(ye)&&I[ye]!=null)if(ye==="style"){var G=I[ye];for(_ in G)G.hasOwnProperty(_)&&(h||(h={}),h[_]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(a.hasOwnProperty(ye)?C||(C=[]):(C=C||[]).push(ye,null));for(ye in v){var ee=v[ye];if(G=I!=null?I[ye]:void 0,v.hasOwnProperty(ye)&&ee!==G&&(ee!=null||G!=null))if(ye==="style")if(G){for(_ in G)!G.hasOwnProperty(_)||ee&&ee.hasOwnProperty(_)||(h||(h={}),h[_]="");for(_ in ee)ee.hasOwnProperty(_)&&G[_]!==ee[_]&&(h||(h={}),h[_]=ee[_])}else h||(C||(C=[]),C.push(ye,h)),h=ee;else ye==="dangerouslySetInnerHTML"?(ee=ee?ee.__html:void 0,G=G?G.__html:void 0,ee!=null&&G!==ee&&(C=C||[]).push(ye,ee)):ye==="children"?typeof ee!="string"&&typeof ee!="number"||(C=C||[]).push(ye,""+ee):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(a.hasOwnProperty(ye)?(ee!=null&&ye==="onScroll"&&Kt("scroll",i),C||G===ee||(C=[])):(C=C||[]).push(ye,ee))}h&&(C=C||[]).push("style",h);var ye=C;(l.updateQueue=ye)&&(l.flags|=4)}},Kp=function(i,l,h,v){h!==v&&(l.flags|=4)};function tl(i,l){if(!Xt)switch(i.tailMode){case"hidden":l=i.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?i.tail=null:h.sibling=null;break;case"collapsed":h=i.tail;for(var v=null;h!==null;)h.alternate!==null&&(v=h),h=h.sibling;v===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:v.sibling=null}}function ur(i){var l=i.alternate!==null&&i.alternate.child===i.child,h=0,v=0;if(l)for(var I=i.child;I!==null;)h|=I.lanes|I.childLanes,v|=I.subtreeFlags&14680064,v|=I.flags&14680064,I.return=i,I=I.sibling;else for(I=i.child;I!==null;)h|=I.lanes|I.childLanes,v|=I.subtreeFlags,v|=I.flags,I.return=i,I=I.sibling;return i.subtreeFlags|=v,i.childLanes=h,l}function Vy(i,l,h){var v=l.pendingProps;switch(Gi(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ur(l),null;case 1:return Fr(l.type)&&vu(),ur(l),null;case 3:return v=l.stateNode,$s(),Qt(Or),Qt(rr),Uf(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(i===null||i.child===null)&&(Jl(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,Ma!==null&&(gh(Ma),Ma=null))),ah(i,l),ur(l),null;case 5:zf(l);var I=ci(ec.current);if(h=l.type,i!==null&&l.stateNode!=null)oh(i,l,h,v,I),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!v){if(l.stateNode===null)throw Error(n(166));return ur(l),null}if(i=ci(Oa.current),Jl(l)){v=l.stateNode,h=l.type;var C=l.memoizedProps;switch(v[Ga]=l,v[ei]=C,i=(l.mode&1)!==0,h){case"dialog":Kt("cancel",v),Kt("close",v);break;case"iframe":case"object":case"embed":Kt("load",v);break;case"video":case"audio":for(I=0;I<wo.length;I++)Kt(wo[I],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":lt(v,C),Kt("invalid",v);break;case"select":v._wrapperState={wasMultiple:!!C.multiple},Kt("invalid",v);break;case"textarea":Sn(v,C),Kt("invalid",v)}Yo(h,C),I=null;for(var _ in C)if(C.hasOwnProperty(_)){var G=C[_];_==="children"?typeof G=="string"?v.textContent!==G&&(C.suppressHydrationWarning!==!0&&Zl(v.textContent,G,i),I=["children",G]):typeof G=="number"&&v.textContent!==""+G&&(C.suppressHydrationWarning!==!0&&Zl(v.textContent,G,i),I=["children",""+G]):a.hasOwnProperty(_)&&G!=null&&_==="onScroll"&&Kt("scroll",v)}switch(h){case"input":Se(v),Et(v,C,!0);break;case"textarea":Se(v),vr(v);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(v.onclick=hu)}v=I,l.updateQueue=v,v!==null&&(l.flags|=4)}else{_=I.nodeType===9?I:I.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Sa(h)),i==="http://www.w3.org/1999/xhtml"?h==="script"?(i=_.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof v.is=="string"?i=_.createElement(h,{is:v.is}):(i=_.createElement(h),h==="select"&&(_=i,v.multiple?_.multiple=!0:v.size&&(_.size=v.size))):i=_.createElementNS(i,h),i[Ga]=l,i[ei]=v,Jp(i,l,!1,!1),l.stateNode=i;e:{switch(_=ji(h,v),h){case"dialog":Kt("cancel",i),Kt("close",i),I=v;break;case"iframe":case"object":case"embed":Kt("load",i),I=v;break;case"video":case"audio":for(I=0;I<wo.length;I++)Kt(wo[I],i);I=v;break;case"source":Kt("error",i),I=v;break;case"img":case"image":case"link":Kt("error",i),Kt("load",i),I=v;break;case"details":Kt("toggle",i),I=v;break;case"input":lt(i,v),I=$e(i,v),Kt("invalid",i);break;case"option":I=v;break;case"select":i._wrapperState={wasMultiple:!!v.multiple},I=Z({},v,{value:void 0}),Kt("invalid",i);break;case"textarea":Sn(i,v),I=an(i,v),Kt("invalid",i);break;default:I=v}Yo(h,I),G=I;for(C in G)if(G.hasOwnProperty(C)){var ee=G[C];C==="style"?Pi(i,ee):C==="dangerouslySetInnerHTML"?(ee=ee?ee.__html:void 0,ee!=null&&Ss(i,ee)):C==="children"?typeof ee=="string"?(h!=="textarea"||ee!=="")&&mo(i,ee):typeof ee=="number"&&mo(i,""+ee):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(a.hasOwnProperty(C)?ee!=null&&C==="onScroll"&&Kt("scroll",i):ee!=null&&R(i,C,ee,_))}switch(h){case"input":Se(i),Et(i,v,!1);break;case"textarea":Se(i),vr(i);break;case"option":v.value!=null&&i.setAttribute("value",""+_e(v.value));break;case"select":i.multiple=!!v.multiple,C=v.value,C!=null?At(i,!!v.multiple,C,!1):v.defaultValue!=null&&At(i,!!v.multiple,v.defaultValue,!0);break;default:typeof I.onClick=="function"&&(i.onclick=hu)}switch(h){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 ur(l),null;case 6:if(i&&l.stateNode!=null)Kp(i,l,i.memoizedProps,v);else{if(typeof v!="string"&&l.stateNode===null)throw Error(n(166));if(h=ci(ec.current),ci(Oa.current),Jl(l)){if(v=l.stateNode,h=l.memoizedProps,v[Ga]=l,(C=v.nodeValue!==h)&&(i=or,i!==null))switch(i.tag){case 3:Zl(v.nodeValue,h,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Zl(v.nodeValue,h,(i.mode&1)!==0)}C&&(l.flags|=4)}else v=(h.nodeType===9?h:h.ownerDocument).createTextNode(v),v[Ga]=l,l.stateNode=v}return ur(l),null;case 13:if(Qt(en),v=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Xt&&Zr!==null&&l.mode&1&&!(l.flags&128))Pf(),Xa(),l.flags|=98560,C=!1;else if(C=Jl(l),v!==null&&v.dehydrated!==null){if(i===null){if(!C)throw Error(n(318));if(C=l.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[Ga]=l}else Xa(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;ur(l),C=!1}else Ma!==null&&(gh(Ma),Ma=null),C=!0;if(!C)return l.flags&65536?l:null}return l.flags&128?(l.lanes=h,l):(v=v!==null,v!==(i!==null&&i.memoizedState!==null)&&v&&(l.child.flags|=8192,l.mode&1&&(i===null||en.current&1?_n===0&&(_n=3):wh())),l.updateQueue!==null&&(l.flags|=4),ur(l),null);case 4:return $s(),ah(i,l),i===null&&Ko(l.stateNode.containerInfo),ur(l),null;case 10:return Iu(l.type._context),ur(l),null;case 17:return Fr(l.type)&&vu(),ur(l),null;case 19:if(Qt(en),C=l.memoizedState,C===null)return ur(l),null;if(v=(l.flags&128)!==0,_=C.rendering,_===null)if(v)tl(C,!1);else{if(_n!==0||i!==null&&i.flags&128)for(i=l.child;i!==null;){if(_=tc(i),_!==null){for(l.flags|=128,tl(C,!1),v=_.updateQueue,v!==null&&(l.updateQueue=v,l.flags|=4),l.subtreeFlags=0,v=h,h=l.child;h!==null;)C=h,i=v,C.flags&=14680066,_=C.alternate,_===null?(C.childLanes=0,C.lanes=i,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=_.childLanes,C.lanes=_.lanes,C.child=_.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=_.memoizedProps,C.memoizedState=_.memoizedState,C.updateQueue=_.updateQueue,C.type=_.type,i=_.dependencies,C.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),h=h.sibling;return qt(en,en.current&1|2),l.child}i=i.sibling}C.tail!==null&&on()>il&&(l.flags|=128,v=!0,tl(C,!1),l.lanes=4194304)}else{if(!v)if(i=tc(_),i!==null){if(l.flags|=128,v=!0,h=i.updateQueue,h!==null&&(l.updateQueue=h,l.flags|=4),tl(C,!0),C.tail===null&&C.tailMode==="hidden"&&!_.alternate&&!Xt)return ur(l),null}else 2*on()-C.renderingStartTime>il&&h!==1073741824&&(l.flags|=128,v=!0,tl(C,!1),l.lanes=4194304);C.isBackwards?(_.sibling=l.child,l.child=_):(h=C.last,h!==null?h.sibling=_:l.child=_,C.last=_)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=on(),l.sibling=null,h=en.current,qt(en,v?h&1|2:h&1),l):(ur(l),null);case 22:case 23:return yh(),v=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==v&&(l.flags|=8192),v&&l.mode&1?qr&1073741824&&(ur(l),l.subtreeFlags&6&&(l.flags|=8192)):ur(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function Zy(i,l){switch(Gi(l),l.tag){case 1:return Fr(l.type)&&vu(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return $s(),Qt(Or),Qt(rr),Uf(),i=l.flags,i&65536&&!(i&128)?(l.flags=i&-65537|128,l):null;case 5:return zf(l),null;case 13:if(Qt(en),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Xa()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return Qt(en),null;case 4:return $s(),null;case 10:return Iu(l.type._context),null;case 22:case 23:return yh(),null;case 24:return null;default:return null}}var ua=!1,Bt=!1,ih=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function di(i,l){var h=i.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(v){pn(i,l,v)}else h.current=null}function sh(i,l,h){try{h()}catch(v){pn(i,l,v)}}var Qp=!1;function fc(i,l){if(Wl=qc,i=Zt(),Hl(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var v=h.getSelection&&h.getSelection();if(v&&v.rangeCount!==0){h=v.anchorNode;var I=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{h.nodeType,C.nodeType}catch{h=null;break e}var _=0,G=-1,ee=-1,ye=0,Fe=0,Le=i,Oe=null;t:for(;;){for(var qe;Le!==h||I!==0&&Le.nodeType!==3||(G=_+I),Le!==C||v!==0&&Le.nodeType!==3||(ee=_+v),Le.nodeType===3&&(_+=Le.nodeValue.length),(qe=Le.firstChild)!==null;)Oe=Le,Le=qe;for(;;){if(Le===i)break t;if(Oe===h&&++ye===I&&(G=_),Oe===C&&++Fe===v&&(ee=_),(qe=Le.nextSibling)!==null)break;Le=Oe,Oe=Le.parentNode}Le=qe}h=G===-1||ee===-1?null:{start:G,end:ee}}else h=null}h=h||{start:0,end:0}}else h=null;for(Vi={focusedElem:i,selectionRange:h},qc=!1,Xe=l;Xe!==null;)if(l=Xe,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,Xe=i;else for(;Xe!==null;){l=Xe;try{var tt=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(tt!==null){var nt=tt.memoizedProps,wn=tt.memoizedState,ue=l.stateNode,re=ue.getSnapshotBeforeUpdate(l.elementType===l.type?nt:Na(l.type,nt),wn);ue.__reactInternalSnapshotBeforeUpdate=re}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(He){pn(l,l.return,He)}if(i=l.sibling,i!==null){i.return=l.return,Xe=i;break}Xe=l.return}return tt=Qp,Qp=!1,tt}function nl(i,l,h){var v=l.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var I=v=v.next;do{if((I.tag&i)===i){var C=I.destroy;I.destroy=void 0,C!==void 0&&sh(l,h,C)}I=I.next}while(I!==v)}}function hc(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&i)===i){var v=h.create;h.destroy=v()}h=h.next}while(h!==l)}}function lh(i){var l=i.ref;if(l!==null){var h=i.stateNode;switch(i.tag){case 5:i=h;break;default:i=h}typeof l=="function"?l(i):l.current=i}}function Xp(i){var l=i.alternate;l!==null&&(i.alternate=null,Xp(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[Ga],delete l[ei],delete l[pu],delete l[B],delete l[Ys])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function eg(i){return i.tag===5||i.tag===3||i.tag===4}function tg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||eg(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Wu(i,l,h){var v=i.tag;if(v===5||v===6)i=i.stateNode,l?h.nodeType===8?h.parentNode.insertBefore(i,l):h.insertBefore(i,l):(h.nodeType===8?(l=h.parentNode,l.insertBefore(i,h)):(l=h,l.appendChild(i)),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=hu));else if(v!==4&&(i=i.child,i!==null))for(Wu(i,l,h),i=i.sibling;i!==null;)Wu(i,l,h),i=i.sibling}function $u(i,l,h){var v=i.tag;if(v===5||v===6)i=i.stateNode,l?h.insertBefore(i,l):h.appendChild(i);else if(v!==4&&(i=i.child,i!==null))for($u(i,l,h),i=i.sibling;i!==null;)$u(i,l,h),i=i.sibling}var Gn=null,$r=!1;function xo(i,l,h){for(h=h.child;h!==null;)rl(i,l,h),h=h.sibling}function rl(i,l,h){if(Za&&typeof Za.onCommitFiberUnmount=="function")try{Za.onCommitFiberUnmount(Uc,h)}catch{}switch(h.tag){case 5:Bt||di(h,l);case 6:var v=Gn,I=$r;Gn=null,xo(i,l,h),Gn=v,$r=I,Gn!==null&&($r?(i=Gn,h=h.stateNode,i.nodeType===8?i.parentNode.removeChild(h):i.removeChild(h)):Gn.removeChild(h.stateNode));break;case 18:Gn!==null&&($r?(i=Gn,h=h.stateNode,i.nodeType===8?Af(i.parentNode,h):i.nodeType===1&&Af(i,h),Ht(i)):Af(Gn,h.stateNode));break;case 4:v=Gn,I=$r,Gn=h.stateNode.containerInfo,$r=!0,xo(i,l,h),Gn=v,$r=I;break;case 0:case 11:case 14:case 15:if(!Bt&&(v=h.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){I=v=v.next;do{var C=I,_=C.destroy;C=C.tag,_!==void 0&&(C&2||C&4)&&sh(h,l,_),I=I.next}while(I!==v)}xo(i,l,h);break;case 1:if(!Bt&&(di(h,l),v=h.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=h.memoizedProps,v.state=h.memoizedState,v.componentWillUnmount()}catch(G){pn(h,l,G)}xo(i,l,h);break;case 21:xo(i,l,h);break;case 22:h.mode&1?(Bt=(v=Bt)||h.memoizedState!==null,xo(i,l,h),Bt=v):xo(i,l,h);break;default:xo(i,l,h)}}function Gu(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var h=i.stateNode;h===null&&(h=i.stateNode=new ih),l.forEach(function(v){var I=Xy.bind(null,i,v);h.has(v)||(h.add(v),v.then(I,I))})}}function da(i,l){var h=l.deletions;if(h!==null)for(var v=0;v<h.length;v++){var I=h[v];try{var C=i,_=l,G=_;e:for(;G!==null;){switch(G.tag){case 5:Gn=G.stateNode,$r=!1;break e;case 3:Gn=G.stateNode.containerInfo,$r=!0;break e;case 4:Gn=G.stateNode.containerInfo,$r=!0;break e}G=G.return}if(Gn===null)throw Error(n(160));rl(C,_,I),Gn=null,$r=!1;var ee=I.alternate;ee!==null&&(ee.return=null),I.return=null}catch(ye){pn(I,l,ye)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)ch(l,i),l=l.sibling}function ch(i,l){var h=i.alternate,v=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(da(l,i),Gr(i),v&4){try{nl(3,i,i.return),hc(3,i)}catch(nt){pn(i,i.return,nt)}try{nl(5,i,i.return)}catch(nt){pn(i,i.return,nt)}}break;case 1:da(l,i),Gr(i),v&512&&h!==null&&di(h,h.return);break;case 5:if(da(l,i),Gr(i),v&512&&h!==null&&di(h,h.return),i.flags&32){var I=i.stateNode;try{mo(I,"")}catch(nt){pn(i,i.return,nt)}}if(v&4&&(I=i.stateNode,I!=null)){var C=i.memoizedProps,_=h!==null?h.memoizedProps:C,G=i.type,ee=i.updateQueue;if(i.updateQueue=null,ee!==null)try{G==="input"&&C.type==="radio"&&C.name!=null&&ft(I,C),ji(G,_);var ye=ji(G,C);for(_=0;_<ee.length;_+=2){var Fe=ee[_],Le=ee[_+1];Fe==="style"?Pi(I,Le):Fe==="dangerouslySetInnerHTML"?Ss(I,Le):Fe==="children"?mo(I,Le):R(I,Fe,Le,ye)}switch(G){case"input":Dt(I,C);break;case"textarea":In(I,C);break;case"select":var Oe=I._wrapperState.wasMultiple;I._wrapperState.wasMultiple=!!C.multiple;var qe=C.value;qe!=null?At(I,!!C.multiple,qe,!1):Oe!==!!C.multiple&&(C.defaultValue!=null?At(I,!!C.multiple,C.defaultValue,!0):At(I,!!C.multiple,C.multiple?[]:"",!1))}I[ei]=C}catch(nt){pn(i,i.return,nt)}}break;case 6:if(da(l,i),Gr(i),v&4){if(i.stateNode===null)throw Error(n(162));I=i.stateNode,C=i.memoizedProps;try{I.nodeValue=C}catch(nt){pn(i,i.return,nt)}}break;case 3:if(da(l,i),Gr(i),v&4&&h!==null&&h.memoizedState.isDehydrated)try{Ht(l.containerInfo)}catch(nt){pn(i,i.return,nt)}break;case 4:da(l,i),Gr(i);break;case 13:da(l,i),Gr(i),I=i.child,I.flags&8192&&(C=I.memoizedState!==null,I.stateNode.isHidden=C,!C||I.alternate!==null&&I.alternate.memoizedState!==null||(Ju=on())),v&4&&Gu(i);break;case 22:if(Fe=h!==null&&h.memoizedState!==null,i.mode&1?(Bt=(ye=Bt)||Fe,da(l,i),Bt=ye):da(l,i),Gr(i),v&8192){if(ye=i.memoizedState!==null,(i.stateNode.isHidden=ye)&&!Fe&&i.mode&1)for(Xe=i,Fe=i.child;Fe!==null;){for(Le=Xe=Fe;Xe!==null;){switch(Oe=Xe,qe=Oe.child,Oe.tag){case 0:case 11:case 14:case 15:nl(4,Oe,Oe.return);break;case 1:di(Oe,Oe.return);var tt=Oe.stateNode;if(typeof tt.componentWillUnmount=="function"){v=Oe,h=Oe.return;try{l=v,tt.props=l.memoizedProps,tt.state=l.memoizedState,tt.componentWillUnmount()}catch(nt){pn(v,h,nt)}}break;case 5:di(Oe,Oe.return);break;case 22:if(Oe.memoizedState!==null){rg(Le);continue}}qe!==null?(qe.return=Oe,Xe=qe):rg(Le)}Fe=Fe.sibling}e:for(Fe=null,Le=i;;){if(Le.tag===5){if(Fe===null){Fe=Le;try{I=Le.stateNode,ye?(C=I.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(G=Le.stateNode,ee=Le.memoizedProps.style,_=ee!=null&&ee.hasOwnProperty("display")?ee.display:null,G.style.display=Fi("display",_))}catch(nt){pn(i,i.return,nt)}}}else if(Le.tag===6){if(Fe===null)try{Le.stateNode.nodeValue=ye?"":Le.memoizedProps}catch(nt){pn(i,i.return,nt)}}else if((Le.tag!==22&&Le.tag!==23||Le.memoizedState===null||Le===i)&&Le.child!==null){Le.child.return=Le,Le=Le.child;continue}if(Le===i)break e;for(;Le.sibling===null;){if(Le.return===null||Le.return===i)break e;Fe===Le&&(Fe=null),Le=Le.return}Fe===Le&&(Fe=null),Le.sibling.return=Le.return,Le=Le.sibling}}break;case 19:da(l,i),Gr(i),v&4&&Gu(i);break;case 21:break;default:da(l,i),Gr(i)}}function Gr(i){var l=i.flags;if(l&2){try{e:{for(var h=i.return;h!==null;){if(eg(h)){var v=h;break e}h=h.return}throw Error(n(160))}switch(v.tag){case 5:var I=v.stateNode;v.flags&32&&(mo(I,""),v.flags&=-33);var C=tg(i);$u(i,C,I);break;case 3:case 4:var _=v.stateNode.containerInfo,G=tg(i);Wu(i,G,_);break;default:throw Error(n(161))}}catch(ee){pn(i,i.return,ee)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function ng(i,l,h){Xe=i,Pa(i)}function Pa(i,l,h){for(var v=(i.mode&1)!==0;Xe!==null;){var I=Xe,C=I.child;if(I.tag===22&&v){var _=I.memoizedState!==null||ua;if(!_){var G=I.alternate,ee=G!==null&&G.memoizedState!==null||Bt;G=ua;var ye=Bt;if(ua=_,(Bt=ee)&&!ye)for(Xe=I;Xe!==null;)_=Xe,ee=_.child,_.tag===22&&_.memoizedState!==null?uh(I):ee!==null?(ee.return=_,Xe=ee):uh(I);for(;C!==null;)Xe=C,Pa(C),C=C.sibling;Xe=I,ua=G,Bt=ye}fi(i)}else I.subtreeFlags&8772&&C!==null?(C.return=I,Xe=C):fi(i)}}function fi(i){for(;Xe!==null;){var l=Xe;if(l.flags&8772){var h=l.alternate;try{if(l.flags&8772)switch(l.tag){case 0:case 11:case 15:Bt||hc(5,l);break;case 1:var v=l.stateNode;if(l.flags&4&&!Bt)if(h===null)v.componentDidMount();else{var I=l.elementType===l.type?h.memoizedProps:Na(l.type,h.memoizedProps);v.componentDidUpdate(I,h.memoizedState,v.__reactInternalSnapshotBeforeUpdate)}var C=l.updateQueue;C!==null&&jp(l,C,v);break;case 3:var _=l.updateQueue;if(_!==null){if(h=null,l.child!==null)switch(l.child.tag){case 5:h=l.child.stateNode;break;case 1:h=l.child.stateNode}jp(l,_,h)}break;case 5:var G=l.stateNode;if(h===null&&l.flags&4){h=G;var ee=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":ee.autoFocus&&h.focus();break;case"img":ee.src&&(h.src=ee.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ye=l.alternate;if(ye!==null){var Fe=ye.memoizedState;if(Fe!==null){var Le=Fe.dehydrated;Le!==null&&Ht(Le)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Bt||l.flags&512&&lh(l)}catch(Oe){pn(l,l.return,Oe)}}if(l===i){Xe=null;break}if(h=l.sibling,h!==null){h.return=l.return,Xe=h;break}Xe=l.return}}function rg(i){for(;Xe!==null;){var l=Xe;if(l===i){Xe=null;break}var h=l.sibling;if(h!==null){h.return=l.return,Xe=h;break}Xe=l.return}}function uh(i){for(;Xe!==null;){var l=Xe;try{switch(l.tag){case 0:case 11:case 15:var h=l.return;try{hc(4,l)}catch(ee){pn(l,h,ee)}break;case 1:var v=l.stateNode;if(typeof v.componentDidMount=="function"){var I=l.return;try{v.componentDidMount()}catch(ee){pn(l,I,ee)}}var C=l.return;try{lh(l)}catch(ee){pn(l,C,ee)}break;case 5:var _=l.return;try{lh(l)}catch(ee){pn(l,_,ee)}}}catch(ee){pn(l,l.return,ee)}if(l===i){Xe=null;break}var G=l.sibling;if(G!==null){G.return=l.return,Xe=G;break}Xe=l.return}}var Wy=Math.ceil,qu=F.ReactCurrentDispatcher,dh=F.ReactCurrentOwner,fa=F.ReactCurrentBatchConfig,Ot=0,Un=null,xn=null,qn=0,qr=0,al=Ar(0),_n=0,ol=null,hi=0,mc=0,fh=0,pc=null,jr=null,Ju=0,il=1/0,Co=null,Ku=!1,hh=null,mi=null,Qu=!1,Hn=null,Xu=0,gc=0,mh=null,vc=-1,ed=0;function Er(){return Ot&6?on():vc!==-1?vc:vc=on()}function pi(i){return i.mode&1?Ot&2&&qn!==0?qn&-qn:Fp.transition!==null?(ed===0&&(ed=cf()),ed):(i=_t,i!==0||(i=window.event,i=i===void 0?16:op(i.type)),i):1}function ja(i,l,h,v){if(50<gc)throw gc=0,mh=null,Error(n(185));Fl(i,h,v),(!(Ot&2)||i!==Un)&&(i===Un&&(!(Ot&2)&&(mc|=h),_n===4&&gi(i,qn)),dr(i,v),h===1&&Ot===0&&!(l.mode&1)&&(il=on()+500,yu&&ni()))}function dr(i,l){var h=i.callbackNode;Sy(i,l);var v=Ri(i,i===Un?qn:0);if(v===0)h!==null&&$m(h),i.callbackNode=null,i.callbackPriority=0;else if(l=v&-v,i.callbackPriority!==l){if(h!=null&&$m(h),l===1)i.tag===0?Zi(og.bind(null,i)):kp(og.bind(null,i)),mu(function(){!(Ot&6)&&ni()}),h=null;else{switch(_i(v)){case 1:h=sf;break;case 4:h=Gm;break;case 16:h=Al;break;case 536870912:h=lf;break;default:h=Al}h=fg(h,ag.bind(null,i))}i.callbackPriority=l,i.callbackNode=h}}function ag(i,l){if(vc=-1,ed=0,Ot&6)throw Error(n(327));var h=i.callbackNode;if(vi()&&i.callbackNode!==h)return null;var v=Ri(i,i===Un?qn:0);if(v===0)return null;if(v&30||v&i.expiredLanes||l)l=td(i,v);else{l=v;var I=Ot;Ot|=2;var C=sg();(Un!==i||qn!==l)&&(Co=null,il=on()+500,ts(i,l));do try{qy();break}catch(G){ig(i,G)}while(!0);Kl(),qu.current=C,Ot=I,xn!==null?l=0:(Un=null,qn=0,l=_n)}if(l!==0){if(l===2&&(I=Zc(i),I!==0&&(v=I,l=ph(i,I))),l===1)throw h=ol,ts(i,0),gi(i,v),dr(i,on()),h;if(l===6)gi(i,v);else{if(I=i.current.alternate,!(v&30)&&!$y(I)&&(l=td(i,v),l===2&&(C=Zc(i),C!==0&&(v=C,l=ph(i,C))),l===1))throw h=ol,ts(i,0),gi(i,v),dr(i,on()),h;switch(i.finishedWork=I,i.finishedLanes=v,l){case 0:case 1:throw Error(n(345));case 2:ns(i,jr,Co);break;case 3:if(gi(i,v),(v&130023424)===v&&(l=Ju+500-on(),10<l)){if(Ri(i,0)!==0)break;if(I=i.suspendedLanes,(I&v)!==v){Er(),i.pingedLanes|=i.suspendedLanes&I;break}i.timeoutHandle=Qo(ns.bind(null,i,jr,Co),l);break}ns(i,jr,Co);break;case 4:if(gi(i,v),(v&4194240)===v)break;for(l=i.eventTimes,I=-1;0<v;){var _=31-xa(v);C=1<<_,_=l[_],_>I&&(I=_),v&=~C}if(v=I,v=on()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*Wy(v/1960))-v,10<v){i.timeoutHandle=Qo(ns.bind(null,i,jr,Co),v);break}ns(i,jr,Co);break;case 5:ns(i,jr,Co);break;default:throw Error(n(329))}}}return dr(i,on()),i.callbackNode===h?ag.bind(null,i):null}function ph(i,l){var h=pc;return i.current.memoizedState.isDehydrated&&(ts(i,l).flags|=256),i=td(i,l),i!==2&&(l=jr,jr=h,l!==null&&gh(l)),i}function gh(i){jr===null?jr=i:jr.push.apply(jr,i)}function $y(i){for(var l=i;;){if(l.flags&16384){var h=l.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var v=0;v<h.length;v++){var I=h[v],C=I.getSnapshot;I=I.value;try{if(!pe(C(),I))return!1}catch{return!1}}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function gi(i,l){for(l&=~fh,l&=~mc,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var h=31-xa(l),v=1<<h;i[h]=-1,l&=~v}}function og(i){if(Ot&6)throw Error(n(327));vi();var l=Ri(i,0);if(!(l&1))return dr(i,on()),null;var h=td(i,l);if(i.tag!==0&&h===2){var v=Zc(i);v!==0&&(l=v,h=ph(i,v))}if(h===1)throw h=ol,ts(i,0),gi(i,l),dr(i,on()),h;if(h===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,ns(i,jr,Co),dr(i,on()),null}function vh(i,l){var h=Ot;Ot|=1;try{return i(l)}finally{Ot=h,Ot===0&&(il=on()+500,yu&&ni())}}function es(i){Hn!==null&&Hn.tag===0&&!(Ot&6)&&vi();var l=Ot;Ot|=1;var h=fa.transition,v=_t;try{if(fa.transition=null,_t=1,i)return i()}finally{_t=v,fa.transition=h,Ot=l,!(Ot&6)&&ni()}}function yh(){qr=al.current,Qt(al)}function ts(i,l){i.finishedWork=null,i.finishedLanes=0;var h=i.timeoutHandle;if(h!==-1&&(i.timeoutHandle=-1,Gl(h)),xn!==null)for(h=xn.return;h!==null;){var v=h;switch(Gi(v),v.tag){case 1:v=v.type.childContextTypes,v!=null&&vu();break;case 3:$s(),Qt(Or),Qt(rr),Uf();break;case 5:zf(v);break;case 4:$s();break;case 13:Qt(en);break;case 19:Qt(en);break;case 10:Iu(v.type._context);break;case 22:case 23:yh()}h=h.return}if(Un=i,xn=i=yi(i.current,null),qn=qr=l,_n=0,ol=null,fh=mc=hi=0,jr=pc=null,Wr!==null){for(l=0;l<Wr.length;l++)if(h=Wr[l],v=h.interleaved,v!==null){h.interleaved=null;var I=v.next,C=h.pending;if(C!==null){var _=C.next;C.next=I,v.next=_}h.pending=v}Wr=null}return i}function ig(i,l){do{var h=xn;try{if(Kl(),Gs.current=To,ku){for(var v=cn.memoizedState;v!==null;){var I=v.queue;I!==null&&(I.pending=null),v=v.next}ku=!1}if(Ki=0,jn=un=cn=null,rc=!1,sr=0,dh.current=null,h===null||h.return===null){_n=1,ol=l,xn=null;break}e:{var C=i,_=h.return,G=h,ee=l;if(l=qn,G.flags|=32768,ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var ye=ee,Fe=G,Le=Fe.tag;if(!(Fe.mode&1)&&(Le===0||Le===11||Le===15)){var Oe=Fe.alternate;Oe?(Fe.updateQueue=Oe.updateQueue,Fe.memoizedState=Oe.memoizedState,Fe.lanes=Oe.lanes):(Fe.updateQueue=null,Fe.memoizedState=null)}var qe=Xf(_);if(qe!==null){qe.flags&=-257,lc(qe,_,G,C,l),qe.mode&1&&Zp(C,ye,l),l=qe,ee=ye;var tt=l.updateQueue;if(tt===null){var nt=new Set;nt.add(ee),l.updateQueue=nt}else tt.add(ee);break e}else{if(!(l&1)){Zp(C,ye,l),wh();break e}ee=Error(n(426))}}else if(Xt&&G.mode&1){var wn=Xf(_);if(wn!==null){!(wn.flags&65536)&&(wn.flags|=256),lc(wn,_,G,C,l),eo(Xi(ee,G));break e}}C=ee=Xi(ee,G),_n!==4&&(_n=2),pc===null?pc=[C]:pc.push(C),C=_;do{switch(C.tag){case 3:C.flags|=65536,l&=-l,C.lanes|=l;var ue=Yu(C,ee,l);Lf(C,ue);break e;case 1:G=ee;var re=C.type,de=C.stateNode;if(!(C.flags&128)&&(typeof re.getDerivedStateFromError=="function"||de!==null&&typeof de.componentDidCatch=="function"&&(mi===null||!mi.has(de)))){C.flags|=65536,l&=-l,C.lanes|=l;var He=sc(C,G,l);Lf(C,He);break e}}C=C.return}while(C!==null)}cg(h)}catch(at){l=at,xn===h&&h!==null&&(xn=h=h.return);continue}break}while(!0)}function sg(){var i=qu.current;return qu.current=To,i===null?To:i}function wh(){(_n===0||_n===3||_n===2)&&(_n=4),Un===null||!(hi&268435455)&&!(mc&268435455)||gi(Un,qn)}function td(i,l){var h=Ot;Ot|=2;var v=sg();(Un!==i||qn!==l)&&(Co=null,ts(i,l));do try{Gy();break}catch(I){ig(i,I)}while(!0);if(Kl(),Ot=h,qu.current=v,xn!==null)throw Error(n(261));return Un=null,qn=0,_n}function Gy(){for(;xn!==null;)lg(xn)}function qy(){for(;xn!==null&&!zc();)lg(xn)}function lg(i){var l=dg(i.alternate,i,qr);i.memoizedProps=i.pendingProps,l===null?cg(i):xn=l,dh.current=null}function cg(i){var l=i;do{var h=l.alternate;if(i=l.return,l.flags&32768){if(h=Zy(h,l),h!==null){h.flags&=32767,xn=h;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{_n=6,xn=null;return}}else if(h=Vy(h,l,qr),h!==null){xn=h;return}if(l=l.sibling,l!==null){xn=l;return}xn=l=i}while(l!==null);_n===0&&(_n=5)}function ns(i,l,h){var v=_t,I=fa.transition;try{fa.transition=null,_t=1,Jy(i,l,h,v)}finally{fa.transition=I,_t=v}return null}function Jy(i,l,h,v){do vi();while(Hn!==null);if(Ot&6)throw Error(n(327));h=i.finishedWork;var I=i.finishedLanes;if(h===null)return null;if(i.finishedWork=null,i.finishedLanes=0,h===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var C=h.lanes|h.childLanes;if(ep(i,C),i===Un&&(xn=Un=null,qn=0),!(h.subtreeFlags&2064)&&!(h.flags&2064)||Qu||(Qu=!0,fg(Al,function(){return vi(),null})),C=(h.flags&15990)!==0,h.subtreeFlags&15990||C){C=fa.transition,fa.transition=null;var _=_t;_t=1;var G=Ot;Ot|=4,dh.current=null,fc(i,h),ch(h,i),Hy(Vi),qc=!!Wl,Vi=Wl=null,i.current=h,ng(h),wy(),Ot=G,_t=_,fa.transition=C}else i.current=h;if(Qu&&(Qu=!1,Hn=i,Xu=I),C=i.pendingLanes,C===0&&(mi=null),Dy(h.stateNode),dr(i,on()),l!==null)for(v=i.onRecoverableError,h=0;h<l.length;h++)I=l[h],v(I.value,{componentStack:I.stack,digest:I.digest});if(Ku)throw Ku=!1,i=hh,hh=null,i;return Xu&1&&i.tag!==0&&vi(),C=i.pendingLanes,C&1?i===mh?gc++:(gc=0,mh=i):gc=0,ni(),null}function vi(){if(Hn!==null){var i=_i(Xu),l=fa.transition,h=_t;try{if(fa.transition=null,_t=16>i?16:i,Hn===null)var v=!1;else{if(i=Hn,Hn=null,Xu=0,Ot&6)throw Error(n(331));var I=Ot;for(Ot|=4,Xe=i.current;Xe!==null;){var C=Xe,_=C.child;if(Xe.flags&16){var G=C.deletions;if(G!==null){for(var ee=0;ee<G.length;ee++){var ye=G[ee];for(Xe=ye;Xe!==null;){var Fe=Xe;switch(Fe.tag){case 0:case 11:case 15:nl(8,Fe,C)}var Le=Fe.child;if(Le!==null)Le.return=Fe,Xe=Le;else for(;Xe!==null;){Fe=Xe;var Oe=Fe.sibling,qe=Fe.return;if(Xp(Fe),Fe===ye){Xe=null;break}if(Oe!==null){Oe.return=qe,Xe=Oe;break}Xe=qe}}}var tt=C.alternate;if(tt!==null){var nt=tt.child;if(nt!==null){tt.child=null;do{var wn=nt.sibling;nt.sibling=null,nt=wn}while(nt!==null)}}Xe=C}}if(C.subtreeFlags&2064&&_!==null)_.return=C,Xe=_;else e:for(;Xe!==null;){if(C=Xe,C.flags&2048)switch(C.tag){case 0:case 11:case 15:nl(9,C,C.return)}var ue=C.sibling;if(ue!==null){ue.return=C.return,Xe=ue;break e}Xe=C.return}}var re=i.current;for(Xe=re;Xe!==null;){_=Xe;var de=_.child;if(_.subtreeFlags&2064&&de!==null)de.return=_,Xe=de;else e:for(_=re;Xe!==null;){if(G=Xe,G.flags&2048)try{switch(G.tag){case 0:case 11:case 15:hc(9,G)}}catch(at){pn(G,G.return,at)}if(G===_){Xe=null;break e}var He=G.sibling;if(He!==null){He.return=G.return,Xe=He;break e}Xe=G.return}}if(Ot=I,ni(),Za&&typeof Za.onPostCommitFiberRoot=="function")try{Za.onPostCommitFiberRoot(Uc,i)}catch{}v=!0}return v}finally{_t=h,fa.transition=l}}return!1}function bh(i,l,h){l=Xi(h,l),l=Yu(i,l,1),i=oi(i,l,1),l=Er(),i!==null&&(Fl(i,1,l),dr(i,l))}function pn(i,l,h){if(i.tag===3)bh(i,i,h);else for(;l!==null;){if(l.tag===3){bh(l,i,h);break}else if(l.tag===1){var v=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(mi===null||!mi.has(v))){i=Xi(h,i),i=sc(l,i,1),l=oi(l,i,1),i=Er(),l!==null&&(Fl(l,1,i),dr(l,i));break}}l=l.return}}function Ky(i,l,h){var v=i.pingCache;v!==null&&v.delete(l),l=Er(),i.pingedLanes|=i.suspendedLanes&h,Un===i&&(qn&h)===h&&(_n===4||_n===3&&(qn&130023424)===qn&&500>on()-Ju?ts(i,0):fh|=h),dr(i,l)}function ug(i,l){l===0&&(i.mode&1?(l=Vc,Vc<<=1,!(Vc&130023424)&&(Vc=4194304)):l=1);var h=Er();i=ka(i,l),i!==null&&(Fl(i,l,h),dr(i,h))}function Qy(i){var l=i.memoizedState,h=0;l!==null&&(h=l.retryLane),ug(i,h)}function Xy(i,l){var h=0;switch(i.tag){case 13:var v=i.stateNode,I=i.memoizedState;I!==null&&(h=I.retryLane);break;case 19:v=i.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(l),ug(i,h)}var dg;dg=function(i,l,h){if(i!==null)if(i.memoizedProps!==l.pendingProps||Or.current)lr=!0;else{if(!(i.lanes&h)&&!(l.flags&128))return lr=!1,cr(i,l,h);lr=!!(i.flags&131072)}else lr=!1,Xt&&l.flags&1048576&&Ap(l,bu,l.index);switch(l.lanes=0,l.tag){case 2:var v=l.type;el(i,l),i=l.pendingProps;var I=Us(l,rr.current);ri(l,h),I=Au(null,l,v,i,I,h);var C=Ou();return l.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Fr(v)?(C=!0,ia(l)):C=!1,l.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,jf(l),I.updater=xu,l.stateNode=I,I._reactInternals=l,Hf(l,v,i,h),l=rh(null,l,v,!0,C,h)):(l.tag=0,Xt&&C&&ql(l),Tr(null,l,I,h),l=l.child),l;case 16:v=l.elementType;e:{switch(el(i,l),i=l.pendingProps,I=v._init,v=I(v._payload),l.type=v,I=l.tag=nd(v),i=Na(v,i),I){case 0:l=zu(null,l,v,i,h);break e;case 1:l=Gp(null,l,v,i,h);break e;case 11:l=eh(null,l,v,i,h);break e;case 14:l=to(null,l,v,Na(v.type,i),h);break e}throw Error(n(306,v,""))}return l;case 0:return v=l.type,I=l.pendingProps,I=l.elementType===v?I:Na(v,I),zu(i,l,v,I,h);case 1:return v=l.type,I=l.pendingProps,I=l.elementType===v?I:Na(v,I),Gp(i,l,v,I,h);case 3:e:{if(no(l),i===null)throw Error(n(387));v=l.pendingProps,C=l.memoizedState,I=C.element,Pp(i,l),Eu(l,v,null,h);var _=l.memoizedState;if(v=_.element,C.isDehydrated)if(C={element:v,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){I=Xi(Error(n(423)),l),l=Uu(i,l,v,h,I);break e}else if(v!==I){I=Xi(Error(n(424)),l),l=Uu(i,l,v,h,I);break e}else for(Zr=Xo(l.stateNode.containerInfo.firstChild),or=l,Xt=!0,Ma=null,h=Bf(l,null,v,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Xa(),v===I){l=ro(i,l,h);break e}Tr(i,l,v,h)}l=l.child}return l;case 5:return Yf(l),i===null&&Pr(l),v=l.type,I=l.pendingProps,C=i!==null?i.memoizedProps:null,_=I.children,$l(v,I)?_=null:C!==null&&$l(v,C)&&(l.flags|=32),$p(i,l),Tr(i,l,_,h),l.child;case 6:return i===null&&Pr(l),null;case 13:return dc(i,l,h);case 4:return Nu(l,l.stateNode.containerInfo),v=l.pendingProps,i===null?l.child=si(l,null,v,h):Tr(i,l,v,h),l.child;case 11:return v=l.type,I=l.pendingProps,I=l.elementType===v?I:Na(v,I),eh(i,l,v,I,h);case 7:return Tr(i,l,l.pendingProps,h),l.child;case 8:return Tr(i,l,l.pendingProps.children,h),l.child;case 12:return Tr(i,l,l.pendingProps.children,h),l.child;case 10:e:{if(v=l.type._context,I=l.pendingProps,C=l.memoizedProps,_=I.value,qt(qi,v._currentValue),v._currentValue=_,C!==null)if(pe(C.value,_)){if(C.children===I.children&&!Or.current){l=ro(i,l,h);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var G=C.dependencies;if(G!==null){_=C.child;for(var ee=G.firstContext;ee!==null;){if(ee.context===v){if(C.tag===1){ee=Aa(-1,h&-h),ee.tag=2;var ye=C.updateQueue;if(ye!==null){ye=ye.shared;var Fe=ye.pending;Fe===null?ee.next=ee:(ee.next=Fe.next,Fe.next=ee),ye.pending=ee}}C.lanes|=h,ee=C.alternate,ee!==null&&(ee.lanes|=h),ca(C.return,h,l),G.lanes|=h;break}ee=ee.next}}else if(C.tag===10)_=C.type===l.type?null:C.child;else if(C.tag===18){if(_=C.return,_===null)throw Error(n(341));_.lanes|=h,G=_.alternate,G!==null&&(G.lanes|=h),ca(_,h,l),_=C.sibling}else _=C.child;if(_!==null)_.return=C;else for(_=C;_!==null;){if(_===l){_=null;break}if(C=_.sibling,C!==null){C.return=_.return,_=C;break}_=_.return}C=_}Tr(i,l,I.children,h),l=l.child}return l;case 9:return I=l.type,v=l.pendingProps.children,ri(l,h),I=Sr(I),v=v(I),l.flags|=1,Tr(i,l,v,h),l.child;case 14:return v=l.type,I=Na(v,l.pendingProps),I=Na(v.type,I),to(i,l,v,I,h);case 15:return th(i,l,l.type,l.pendingProps,h);case 17:return v=l.type,I=l.pendingProps,I=l.elementType===v?I:Na(v,I),el(i,l),l.tag=1,Fr(v)?(i=!0,ia(l)):i=!1,ri(l,h),_f(l,v,I),Hf(l,v,I,h),rh(null,l,v,!0,i,h);case 19:return qp(i,l,h);case 22:return nh(i,l,h)}throw Error(n(156,l.tag))};function fg(i,l){return Wm(i,l)}function e0(i,l,h,v){this.tag=i,this.key=h,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 Jr(i,l,h,v){return new e0(i,l,h,v)}function Dh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function nd(i){if(typeof i=="function")return Dh(i)?1:0;if(i!=null){if(i=i.$$typeof,i===ae)return 11;if(i===ie)return 14}return 2}function yi(i,l){var h=i.alternate;return h===null?(h=Jr(i.tag,l,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=l,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&14680064,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,l=i.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h}function rd(i,l,h,v,I,C){var _=2;if(v=i,typeof i=="function")Dh(i)&&(_=1);else if(typeof i=="string")_=5;else e:switch(i){case L:return rs(h.children,I,C,l);case z:_=8,I|=8;break;case U:return i=Jr(12,h,l,I|2),i.elementType=U,i.lanes=C,i;case ce:return i=Jr(13,h,l,I),i.elementType=ce,i.lanes=C,i;case fe:return i=Jr(19,h,l,I),i.elementType=fe,i.lanes=C,i;case Te:return ad(h,I,C,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case W:_=10;break e;case K:_=9;break e;case ae:_=11;break e;case ie:_=14;break e;case ge:_=16,v=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return l=Jr(_,h,l,I),l.elementType=i,l.type=v,l.lanes=C,l}function rs(i,l,h,v){return i=Jr(7,i,v,l),i.lanes=h,i}function ad(i,l,h,v){return i=Jr(22,i,v,l),i.elementType=Te,i.lanes=h,i.stateNode={isHidden:!1},i}function Sh(i,l,h){return i=Jr(6,i,null,l),i.lanes=h,i}function Ih(i,l,h){return l=Jr(4,i.children!==null?i.children:[],i.key,l),l.lanes=h,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function t0(i,l,h,v,I){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ol(0),this.expirationTimes=Ol(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ol(0),this.identifierPrefix=v,this.onRecoverableError=I,this.mutableSourceEagerHydrationData=null}function Th(i,l,h,v,I,C,_,G,ee){return i=new t0(i,l,h,G,ee),l===1?(l=1,C===!0&&(l|=8)):l=0,C=Jr(3,null,null,l),i.current=C,C.stateNode=i,C.memoizedState={element:v,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},jf(C),i}function n0(i,l,h){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:v==null?null:""+v,children:i,containerInfo:l,implementation:h}}function hg(i){if(!i)return ti;i=i._reactInternals;e:{if(Li(i)!==i||i.tag!==1)throw Error(n(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Fr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(i.tag===1){var h=i.type;if(Fr(h))return Mp(i,h,l)}return l}function mg(i,l,h,v,I,C,_,G,ee){return i=Th(h,v,!0,i,I,C,_,G,ee),i.context=hg(null),h=i.current,v=Er(),I=pi(h),C=Aa(v,I),C.callback=l??null,oi(h,C,I),i.current.lanes=I,Fl(i,I,v),dr(i,v),i}function od(i,l,h,v){var I=l.current,C=Er(),_=pi(I);return h=hg(h),l.context===null?l.context=h:l.pendingContext=h,l=Aa(C,_),l.payload={element:i},v=v===void 0?null:v,v!==null&&(l.callback=v),i=oi(I,l,_),i!==null&&(ja(i,I,_,C),ii(i,I,_)),_}function id(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function pg(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<l?h:l}}function Eh(i,l){pg(i,l),(i=i.alternate)&&pg(i,l)}function r0(){return null}var xh=typeof reportError=="function"?reportError:function(i){console.error(i)};function sd(i){this._internalRoot=i}ld.prototype.render=sd.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(n(409));od(i,l,null,null)},ld.prototype.unmount=sd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;es(function(){od(null,i,null,null)}),l[Vr]=null}};function ld(i){this._internalRoot=i}ld.prototype.unstable_scheduleHydration=function(i){if(i){var l=df();i={blockedOn:null,target:i,priority:l};for(var h=0;h<$o.length&&l!==0&&l<$o[h].priority;h++);$o.splice(h,0,i),h===0&&rp(i)}};function Ch(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function cd(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function gg(){}function ud(i,l,h,v,I){if(I){if(typeof v=="function"){var C=v;v=function(){var ye=id(_);C.call(ye)}}var _=mg(l,v,i,0,null,!1,!1,"",gg);return i._reactRootContainer=_,i[Vr]=_.current,Ko(i.nodeType===8?i.parentNode:i),es(),_}for(;I=i.lastChild;)i.removeChild(I);if(typeof v=="function"){var G=v;v=function(){var ye=id(ee);G.call(ye)}}var ee=Th(i,0,!1,null,null,!1,!1,"",gg);return i._reactRootContainer=ee,i[Vr]=ee.current,Ko(i.nodeType===8?i.parentNode:i),es(function(){od(l,ee,h,v)}),ee}function dd(i,l,h,v,I){var C=h._reactRootContainer;if(C){var _=C;if(typeof I=="function"){var G=I;I=function(){var ee=id(_);G.call(ee)}}od(l,_,i,I)}else _=ud(h,l,i,I,v);return id(_)}uf=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var h=Es(l.pendingLanes);h!==0&&(Pl(l,h|1),dr(l,on()),!(Ot&6)&&(il=on()+500,ni()))}break;case 13:es(function(){var v=ka(i,1);if(v!==null){var I=Er();ja(v,i,1,I)}}),Eh(i,1)}},Wc=function(i){if(i.tag===13){var l=ka(i,134217728);if(l!==null){var h=Er();ja(l,i,134217728,h)}Eh(i,134217728)}},tp=function(i){if(i.tag===13){var l=pi(i),h=ka(i,l);if(h!==null){var v=Er();ja(h,i,l,v)}Eh(i,l)}},df=function(){return _t},ff=function(i,l){var h=_t;try{return _t=i,l()}finally{_t=h}},me=function(i,l,h){switch(l){case"input":if(Dt(i,h),l=h.name,h.type==="radio"&&l!=null){for(h=i;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<h.length;l++){var v=h[l];if(v!==i&&v.form===i.form){var I=gu(v);if(!I)throw Error(n(90));Ue(v),Dt(v,I)}}}break;case"textarea":In(i,h);break;case"select":l=h.value,l!=null&&At(i,!!h.multiple,l,!1)}},Yt=vh,On=es;var a0={usingClientEntryPoint:!1,Events:[nr,St,gu,ze,pt,vh]},yc={findFiberByHostInstance:qa,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},o0={bundleType:yc.bundleType,version:yc.version,rendererPackageName:yc.rendererPackageName,rendererConfig:yc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:F.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=Vm(i),i===null?null:i.stateNode},findFiberByHostInstance:yc.findFiberByHostInstance||r0,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 fd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fd.isDisabled&&fd.supportsFiber)try{Uc=fd.inject(o0),Za=fd}catch{}}return ga.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a0,ga.createPortal=function(i,l){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ch(l))throw Error(n(200));return n0(i,l,null,h)},ga.createRoot=function(i,l){if(!Ch(i))throw Error(n(299));var h=!1,v="",I=xh;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(v=l.identifierPrefix),l.onRecoverableError!==void 0&&(I=l.onRecoverableError)),l=Th(i,1,!1,null,null,h,!1,v,I),i[Vr]=l.current,Ko(i.nodeType===8?i.parentNode:i),new sd(l)},ga.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=Vm(l),i=i===null?null:i.stateNode,i},ga.flushSync=function(i){return es(i)},ga.hydrate=function(i,l,h){if(!cd(l))throw Error(n(200));return dd(null,i,l,!0,h)},ga.hydrateRoot=function(i,l,h){if(!Ch(i))throw Error(n(405));var v=h!=null&&h.hydratedSources||null,I=!1,C="",_=xh;if(h!=null&&(h.unstable_strictMode===!0&&(I=!0),h.identifierPrefix!==void 0&&(C=h.identifierPrefix),h.onRecoverableError!==void 0&&(_=h.onRecoverableError)),l=mg(l,null,i,1,h??null,I,!1,C,_),i[Vr]=l.current,Ko(i),v)for(i=0;i<v.length;i++)h=v[i],I=h._getVersion,I=I(h._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[h,I]:l.mutableSourceEagerHydrationData.push(h,I);return new ld(l)},ga.render=function(i,l,h){if(!cd(l))throw Error(n(200));return dd(null,i,l,!1,h)},ga.unmountComponentAtNode=function(i){if(!cd(i))throw Error(n(40));return i._reactRootContainer?(es(function(){dd(null,null,i,!1,function(){i._reactRootContainer=null,i[Vr]=null})}),!0):!1},ga.unstable_batchedUpdates=vh,ga.unstable_renderSubtreeIntoContainer=function(i,l,h,v){if(!cd(h))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return dd(i,l,h,!1,v)},ga.version="18.2.0-next-9e3b772b8-20220608",ga}function FT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(FT)}catch(e){console.error(e)}}FT();OT.exports=GA();var w1=OT.exports;const b1=Xn(w1);var Lv,PT=w1;Lv=hs.createRoot=PT.createRoot;hs.hydrateRoot=PT.hydrateRoot;const qA=e=>{const{children:t,className:n,clickSpaceDestroy:r,destroy:a}=e,o=()=>{r&&a()},s=u=>{(u.key==="Escape"||(u.ctrlKey||u.metaKey)&&u.key.toLowerCase()==="w")&&a()};return y.jsx("div",{className:`dialog-wrapper ${n}`,onClick:o,onKeyDown:u=>s(u),children:y.jsx("div",{className:"dialog-container",onClick:u=>u.stopPropagation(),children:t})})};function xm(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 a={destroy:()=>{var d,m;(d=r.firstElementChild)==null||d.classList.remove("showup"),(m=r.firstElementChild)==null||m.classList.add("showoff"),setTimeout(()=>{r.detach(),u.unmount()},bI)}},o={...n,destroy:a.destroy};let s=y.jsx(qA,{destroy:a.destroy,clickSpaceDestroy:!0,...e,children:y.jsx(t,{...o})});s=y.jsx(Sl,{store:Ee,context:wt,children:s});const u=hs.createRoot(r);return u.render(s),a}const JA=e=>{const{shownStatus:t,setShownStatus:n}=e,{dailyNotesState:{app:r,settings:a},globalState:{manifest:o}}=O.useContext(wt),s=O.useRef(null);O.useEffect(()=>{if(t){const w=D=>{var S;(S=s.current)!=null&&S.contains(D.target)||D.stopPropagation(),n(!1)};window.addEventListener("click",w,{capture:!0,once:!0})}},[t]);const u=O.useCallback(async w=>{const{type:D}=w;if(D.startsWith("text"))try{return`${await y1.parseHtml(w)}`}catch(S){new x.Notice(S)}},[]),d=O.useCallback(()=>{const w=document.createElement("input");document.body.appendChild(w),w.type="file",w.multiple=!1,w.accept="text/html",w.onchange=async()=>{if(!w.files||w.files.length===0)return;const D=w.files[0];await u(D),document.body.removeChild(w)},w.click()},[]),m=()=>{r.setting.open(),r.setting.openTabById(o.id||"obsidian-memos")},p=()=>{if(a!=null&&a.needVerify){Qe.setLocked(!0);return}else new x.Notice(k("You have not set a password or enable this feature yet")),r.setting.open(),r.setting.openTabById(o.id||"obsidian-memos")},g=()=>{new pb(r,o.version).open()};return y.jsxs("div",{className:`menu-btns-popup ${t?"":"hidden"}`,ref:s,children:[y.jsxs("div",{className:"btn action-btn",onClick:m,children:[y.jsx("span",{ref:w=>{w&&x.setIcon(w,"user")},className:"icon"}),k("Settings")]}),(a==null?void 0:a.needVerify)&&y.jsxs("div",{className:"btn action-btn",onClick:p,children:[y.jsx("span",{ref:w=>{w&&x.setIcon(w,"lock")},className:"icon"}),k("Lock")]}),y.jsxs("div",{className:"btn action-btn",onClick:d,children:[y.jsx("span",{ref:w=>{w&&x.setIcon(w,"import")},className:"icon"}),k("Import")]}),y.jsxs("div",{className:"btn action-btn",onClick:g,children:[y.jsx("span",{ref:w=>{w&&x.setIcon(w,"file-text")},className:"icon"}),k("ChangeLog")]})]})};function jT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=jT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mr(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=jT(e))&&(r&&(r+=" "),r+=t);return r}const KA=e=>{const t={};return e.forEach(n=>{const r=Re.getDateString(n.createdAt);t[r]?t[r]++:t[r]=1}),Object.keys(t).sort((n,r)=>t[r]-t[n])[0]},QA=e=>{const t={};return e.forEach(n=>{const r=Re.getTimeString(n.createdAt).split(":")[0];t[r]?t[r]++:t[r]=1}),Object.keys(t).sort((n,r)=>t[r]-t[n])[0]},LT=({statusType:e})=>{const{memoState:{memos:t,tags:n},locationState:{pathname:r},dailyNotesState:{settings:a,app:o}}=O.useContext(wt),[s,u]=O.useState(0),[d,m]=O.useState(0),[p,g]=O.useState(0),[w,D]=O.useState(null),[S,T]=O.useState(!1),E=q.useRef(null),[A,N]=O.useState(0),[R,F]=O.useState(0),[H,P]=O.useState(0),[L,z]=O.useState(""),[U,W]=O.useState("");return O.useEffect(()=>{const K=t.filter(ae=>!ae.deletedAt&&ae.rowStatus!=="ARCHIVED");P(K.filter(ae=>ae.thinoType.startsWith("TASK")).length),z(KA(t)),W(QA(t))},[t]),O.useLayoutEffect(()=>{if(!o)return;const{tags:K,memos:ae,days:ce}=XA(o);g(K),u(ae),m(ce)},[o]),O.useEffect(()=>{let K=0;const ae=s-A,ce=1e3,fe=ie=>{K||(K=ie);const ge=ie-K;if(ge<ce){const Te=ge/ce;N(A+ae*Te),requestAnimationFrame(fe)}else N(s)};requestAnimationFrame(fe)},[s]),O.useEffect(()=>{let K=0;const ae=d-R,ce=1e3,fe=ie=>{K||(K=ie);const ge=ie-K;if(ge<ce){const Te=ge/ce;F(R+ae*Te),requestAnimationFrame(fe)}else F(d)};requestAnimationFrame(fe)},[d]),O.useEffect(()=>{!a||!o||(T(s>9999||p>999||d>999),e8({tags:p,memos:s,days:d},o))},[s,p,d]),O.useEffect(()=>{Ie.initialized&&t&&r==="/"&&(g(n.length),u(t.filter(K=>!(K.deletedAt!==""&&K.deletedAt)).length),D(t.length>0?t[t.length-1]:null))},[n,t,r]),O.useEffect(()=>{if(!Ie.initialized)return;if(!w){m(0);return}if(!E.current||!(w!=null&&w.createdAt))return;x.requireApiVersion("1.4.4")&&x.setTooltip(E.current,k("Started from")+" "+Re.getDateTimeString((w==null?void 0:w.createdAt)??""));const K=Math.ceil((Date.now()-Re.getTimeStampByDate(w==null?void 0:w.createdAt))/1e3/3600/24);m(t?K:0)},[w]),y.jsx("div",{className:mr("status-text-container",S?"text-overflow":"",e),children:e==="banner"?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"status-text memos-text",children:[y.jsx("span",{className:"amount-text",children:Math.round(A)}),y.jsx("span",{className:"type-text",children:"THINO"})]}),y.jsxs("div",{className:"status-text tags-text",children:[y.jsx("span",{className:"amount-text",children:p}),y.jsx("span",{className:"type-text",children:k("TAG")})]}),y.jsxs("div",{ref:E,className:"status-text duration-text",onClick:()=>{Qe.setShowSiderbarInMobileView(!1),We.setPathname("/daily")},children:[y.jsx("span",{className:"amount-text",children:Math.round(R)??0}),y.jsx("span",{className:"type-text",children:k("DAY")})]})]}):y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"status-sidebar-header title-text",children:y.jsx("span",{className:"normal-text",children:k("Thino status")})}),y.jsxs("div",{className:"status-sidebar-wrapper",children:[y.jsxs("div",{className:"status-text memos-text",children:[y.jsx("span",{className:"type-text",children:k("Thino amount")}),y.jsx("span",{className:"amount-text",children:Math.round(A)})]}),y.jsxs("div",{className:"status-text memos-text",children:[y.jsx("span",{className:"type-text",children:k("Task amount")}),y.jsx("span",{className:"amount-text",children:Math.round(H)??0})]}),y.jsxs("div",{className:"status-text tags-text",children:[y.jsx("span",{className:"type-text",children:k("Used tags")}),y.jsx("span",{className:"amount-text",children:p})]}),y.jsxs("div",{ref:E,className:"status-text duration-text",onClick:()=>{Qe.setShowSiderbarInMobileView(!1),We.setPathname("/daily")},children:[y.jsx("span",{className:"type-text",children:k("Used days")}),y.jsx("span",{className:"amount-text",children:Math.round(R)??0})]}),y.jsxs("div",{className:"status-text most-active-day-text",onClick:()=>{const K=x.moment(L,"YYYY/MM/DD").startOf("day").valueOf(),ae=x.moment(L,"YYYY/MM/DD").endOf("day").valueOf();We.setFromAndToQuery(K,ae)},children:[y.jsx("span",{className:"type-text",children:k("Most active day")}),y.jsx("span",{className:"amount-text",children:L})]}),y.jsxs("div",{className:"status-text most-active-hour-text",children:[y.jsx("span",{className:"type-text",children:k("Most active hour")}),y.jsx("span",{className:"amount-text",children:U})]})]})]})})};function RT(e){return`userBannerCache:${e}`}function XA(e){try{const t=RT(e==null?void 0:e.appId),n=Kn.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 e8({tags:e,memos:t,days:n},r){try{const a={tags:e,memos:t,days:n},o=RT(r==null?void 0:r.appId);Kn.set({[o]:JSON.stringify(a)})}catch(a){console.error(a)}}const t8=[{text:k("AND"),value:"AND"},{text:k("OR"),value:"OR"}],hl={TAG:{value:"TAG",text:k("TAG"),operators:[{text:k("INCLUDE"),value:"CONTAIN"},{text:k("EXCLUDE"),value:"NOT_CONTAIN"}]},TYPE:{value:"TYPE",text:k("TYPE"),operators:[{value:"IS",text:k("IS")},{value:"IS_NOT",text:k("ISNOT")}],values:[{value:"CONNECTED",text:k("LINKED")},{value:"NOT_TAGGED",text:k("NO TAGS")},{value:"LINKED",text:k("HAS LINKS")},{value:"IMAGED",text:k("HAS IMAGES")}]},TEXT:{value:"TEXT",text:k("TEXT"),operators:[{value:"CONTAIN",text:k("INCLUDE")},{value:"NOT_CONTAIN",text:k("EXCLUDE")}]},DATE:{value:"DATE",text:k("DATE"),operators:[{value:"NOT_CONTAIN",text:k("BEFORE")},{value:"CONTAIN",text:k("AFTER")}]},LIST:{value:"LIST",text:k("LIST"),operators:[{value:"IS",text:k("IS")},{value:"IS_NOT",text:k("ISNOT")}],values:[{value:"TODO",text:k("TODO")},{value:"DONE",text:k("DONE")},{value:"LIST",text:k("JOURNAL")},{value:"OTHER",text:k("OTHER")}]},SOURCE:{value:"SOURCE",text:k("SOURCE"),operators:[{value:"IS",text:k("IS")},{value:"IS_NOT",text:k("ISNOT")}],values:[{value:"DAILY",text:k("DAILY")},{value:"MULTI",text:k("MULTI")},{value:"FILE",text:k("FILE")},{value:"CANVAS",text:k("CANVAS")}]}},Cw=hl.TYPE.values,n8=e=>{for(const t of Cw)if(t.value===e)return t.text;return""},SD=()=>({type:"TAG",value:{operator:"CONTAIN",value:""},relation:"AND"}),$d=(e,t)=>{let n=!0;for(const r of t){const{relation:a}=r,o=r8(e,r);a==="OR"?n=n||o:n=n&&o}return n},r8=(e,t)=>{const{type:n,value:{operator:r,value:a}}=t;if(a==="")return!0;let o=!0;if(n==="TAG"){let s=!0;const u=new Set;for(const d of Array.from(e.content.match(An)||[])){const p=d.replace(An,"$1").trim().split("/");let g="";for(const w of p)g+=w,u.add(g),g+="/"}for(const d of Array.from(e.content.match($n)||[])){const p=d.replace($n,"$1").trim().split("/");let g="";for(const w of p)g+=w,u.add(g),g+="/"}u.has(a)||(s=!1),r==="NOT_CONTAIN"&&(s=!s),o=s}else if(n==="TYPE"){let s=!1;(a==="NOT_TAGGED"&&e.content.match(An)===null&&e.content.match(hr)===null||a==="LINKED"&&e.content.match(Rc)!==null||a==="IMAGED"&&e.content.match(_c)!==null||a==="CONNECTED"&&e.content.match(Il)!==null)&&(s=!0),r==="IS_NOT"&&(s=!s),o=s}else if(n==="TEXT"){let s=e.content.toLowerCase().includes(a.toLowerCase());r==="NOT_CONTAIN"&&(s=!s),o=s}else if(n==="LIST"){let u=(e.thinoType==="JOURNAL"?"LIST":e.thinoType==="TASK-TODO"?"TODO":e.thinoType==="TASK-DONE"?"DONE":"OTHER").contains(a);r==="IS_NOT"&&(u=!u),o=u}else if(n==="SOURCE"){let s=e.sourceType===a;r==="IS_NOT"&&(s=!s),o=s}else if(n==="DATE"){const s=x.moment(a,"YYYY-MM-DD").isValid();let u,d;if(s)u=x.moment(a,"YYYY-MM-DD"),d=u.isBefore(x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),"day");else{const p=(app.plugins.enabledPlugins.has("nldates-obsidian")&&app.plugins.getPlugin("nldates-obsidian")).parseDate(a);p.date!==null&&(d=p.moment.isBefore(x.moment(e.createdAt),"day"))}r==="NOT_CONTAIN"&&(d=!d),o=d}return o=e.linkId===""?o:!1,o};function _o(e){const[t,n]=O.useState(()=>!!e),r=O.useCallback(a=>{n(typeof a=="boolean"?a:o=>!o)},[]);return[t,r]}const Rv=()=>{const{dailyNotesState:{app:e,view:t},locationState:{query:{type:n}}}=O.useContext(wt),r=q.useRef(null),a=q.useRef(null),[o,s]=_o(!1);O.useEffect(()=>{!r||!t||!e||(t.registerEvent(e.workspace.on("blur-on-memos",()=>{var g;(g=r.current)==null||g.blur()})),t.registerEvent(e.workspace.on("focus-on-searchBar",()=>{var g;(g=r.current)==null||g.focus()})))},[r,e,t]),O.useEffect(()=>{a&&x.setIcon(a.current,"search")},[a]);const u=g=>{const{type:w}=We.getState().query;g===w&&(g=""),We.setMemoTypeQuery(g)},d=g=>{const w=g.currentTarget.value;if(!w.contains(" -time: ")){We.setTextQuery(w);return}const D=w.split(" -time: ")[1],S=D.length>10?D.match(/\d{4}-\d{2}-\d{2}/g):null;if(S==null){We.setTextQuery(w.split(" -time: ")[0]);return}if(S.length===1){const T=x.moment(S[0]);We.setTimeQuery({from:T.startOf("day").valueOf(),to:T.endOf("day").valueOf()})}else if(S.length===2){const T=x.moment(S[0]),E=x.moment(S[1]);We.setTimeQuery({from:T.startOf("day").valueOf(),to:E.endOf("day").valueOf()})}We.setTextQuery(w.split(" -time: ")[0])},m=()=>{s(!0)},p=()=>{s(!1)};return y.jsxs("div",{className:"search-bar-container",children:[y.jsxs("div",{className:"search-bar-inputer",children:[y.jsx("span",{ref:a,className:"btn icon-img"}),y.jsx("input",{ref:r,className:"text-input",type:"text",onMouseOver:m,onMouseOut:p,placeholder:o?k("Type here"):"",onChange:d})]}),y.jsx("div",{className:"quickly-action-wrapper",children:y.jsxs("div",{className:"quickly-action-container",children:[y.jsx("span",{className:"title-text",children:k("Quick filter")}),y.jsxs("div",{className:"section-container types-container",children:[y.jsxs("span",{className:"section-text",children:[k("TYPE"),":"]}),y.jsx("div",{className:"values-container",children:Cw.map((g,w)=>y.jsxs("div",{children:[y.jsx("span",{className:`type-item ${n===g.value?"selected":""}`,onClick:()=>{u(g.value)},children:g.text}),w+1<Cw.length?y.jsx("span",{className:"split-text",children:"/"}):null]},g.value))})]})]})})]})},a8=e=>{const{children:t,when:n}=e;return n?y.jsx(y.Fragment,{children:t}):null},lo=a8;function fn(){const e=document.createDocumentFragment();e.createEl("div",{cls:"thino-info"}).createEl("div",{text:k("This is a pro feature, please upgrade to pro version to use it.")});const r=e.createEl("div",{cls:"thino-link"}).createEl("div",{text:k("You can get pro version from: ")}),a=localStorage.getItem("language");let o="https://pkmer.cn/products/UserProfile/";a&&a==="zh"?o="https://pkmer.cn/products/thino/":o="https://thino.pkmer.net/en/",r.createEl("a",{text:"PKMer",attr:{href:o}}),new x.Notice(e,5e3)}const{exec:o8,execSync:tX}=x.Platform.isDesktop&&require("child_process"),{createHash:i8}=x.Platform.isDesktop&&require("crypto"),s8={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},l8=x.Platform.isDesktop&&{darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:`${s8[c8()]}\\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 c8(){return process.platform!=="win32"?"":process.arch==="ia32"&&Object.hasOwnProperty.call(process.env,"PROCESSOR_ARCHITEW6432")?"mixed":"native"}function u8(e){return i8("sha256").update(e).digest("hex")}function d8(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 zn(e=!1){return new Promise((t,n)=>{o8(l8[process.platform],{},(r,a)=>{if(r)return n(new Error(`Error while obtaining machine id: ${r.stack}`));const o=d8(a.toString());return t(e?o:u8(o))})})}const ID={list:"align-left",waterfall:"layout-grid",calendar:"calendar",minimal:"list",table:"table",chat:"message-square",moments:"chrome"},f8=e=>{const{dailyNotesState:{app:t,view:n,verifyState:r,settings:a},globalState:{manifest:o,isMobileView:s}}=O.useContext(wt),u=O.useRef(null),d=O.useRef(null),[m,p]=O.useState((window.app||t).loadLocalStorage("thinoListView")||"list"),[g,w]=O.useState(null);O.useEffect(()=>{if(!o||!t)return;const S=t==null?void 0:t.plugins.getPlugin(o.id);w(S),p(S==null?void 0:S.settings.MemoListView),Qe.setMemoListView(S==null?void 0:S.settings.MemoListView)},[o,t]),O.useEffect(()=>{if(!t||!n||!g||!g.settings)return;const S=()=>{var E;if(n.leaf.height===0)return;const T=(E=g==null?void 0:g.settings)==null?void 0:E.MemoListView;T==="chat"||T==="moments"||(n.leaf.width>950?(p(T||"list"),Qe.setMemoListView(T||"list")):n.leaf.width<=950&&(Qe.setMemoListView("list"),p("list")))};S(),d.current||(d.current=t.workspace.on("resize",S),n.registerEvent(d.current))},[t,n,g]),O.useEffect(()=>{u&&(x.setIcon(u.current,ID[m]),Qe.setMemoListView(m),x.requireApiVersion("1.4.4")&&x.setTooltip(u.current,k("Switch view")))},[m]);const D=async S=>{var F;const T=!x.Platform.isDesktop&&await((F=window.Capacitor)==null?void 0:F.Plugins.Device.getId()),E=x.Platform.isDesktop?await zn():T.identifier||T.uuid;if(!r||(r==null?void 0:r.appId)!==E){fn();return}const A=async H=>{Qe.setMemoListView(H),g&&(g.settings.MemoListView=H,await g.saveSettings()),p(H)},N=[{view:"list",title:k("List")},{view:"chat",title:k("Chat")},{view:"moments",title:k("Moments")}];s||N.push({view:"waterfall",title:k("Waterfall")},{view:"calendar",title:k("Calendar")},{view:"table",title:k("Table")});const R=new x.Menu;N.forEach(({view:H,title:P})=>{R.addItem(L=>{L.setChecked(m===H).setIcon(ID[H]).setTitle(P).onClick(()=>{m!==H&&A(H)})})}),R.showAtMouseEvent(S.nativeEvent)};return y.jsx("div",{className:`memos-view-switcher-wrapper ${e.className?e.className:""} pro`,ref:u,onClick:D})},h8=()=>{const e=O.useRef(null);return O.useEffect(()=>{e&&(x.setIcon(e.current,"calendar-check"),x.setTooltip&&x.setTooltip(e.current,k("Daily Memos")))},[e]),y.jsx("div",{className:"memos-review-entry-wrapper",ref:e,onClick:()=>{We.setPathname("/daily")}})},A0=()=>({type:"initialText",value:"",timestamp:Date.now(),selectionStart:0,selectionEnd:0}),TD={initialValue:"",interval:300};class m8{constructor(t,n=TD){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,a)=>{this.actions=[...r],this.currentIndex=a<this.actions.length?a:this.actions.length-1,this.dispatchChange()},this.resetState=()=>{this.actions=[A0()],this.currentIndex=0,this.dispatchChange()},this.destroy=()=>{this.rmEventListeners()},this.subscribe=r=>{this.listeners.push(r)},this.handleElementKeydown=r=>{const a=r;a.key==="z"&&!a.shiftKey&&(a.metaKey||a.ctrlKey)?(r.preventDefault(),this.runUndo()):(a.key==="z"&&a.shiftKey&&(a.metaKey||a.ctrlKey)||a.key==="y"&&(a.metaKey||a.ctrlKey))&&(r.preventDefault(),this.runRedo())},this.handleElementInput=r=>{const a=r,o=this.actions[this.currentIndex];this.pushNewAction({type:a.inputType,value:this.element.value,timestamp:Date.now(),selectionStart:this.element.selectionEnd-(this.element.value.length-o.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 a=this.actions[this.currentIndex];a&&a.type===r.type&&r.timestamp-a.timestamp<this.config.interval?this.actions[this.currentIndex]=Object.assign(Object.assign({},a),{value:r.value,selectionEnd:r.selectionEnd,timestamp:r.timestamp}):(this.config.maxSize&&this.currentIndex>=this.config.maxSize?(this.actions.shift(),this.actions[0]=A0()):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({},TD),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=[A0()],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 p8(){const[,e]=O.useState(!1);return O.useCallback(()=>{e(n=>!n)},[])}var _T={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 a(o,s,u){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var d=u&&u.debug||!1;if(d){var m=document.querySelector("#input-textarea-caret-position-mirror-div");m&&m.parentNode.removeChild(m)}var p=document.createElement("div");p.id="input-textarea-caret-position-mirror-div",document.body.appendChild(p);var g=p.style,w=window.getComputedStyle?getComputedStyle(o):o.currentStyle;g.whiteSpace="pre-wrap",o.nodeName!=="INPUT"&&(g.wordWrap="break-word"),g.position="absolute",d||(g.visibility="hidden"),t.forEach(function(T){g[T]=w[T]}),r?o.scrollHeight>parseInt(w.height)&&(g.overflowY="scroll"):g.overflow="hidden",p.textContent=o.value.substring(0,s),o.nodeName==="INPUT"&&(p.textContent=p.textContent.replace(/\s/g," "));var D=document.createElement("span");D.textContent=o.value.substring(s)||".",p.appendChild(D);var S={top:D.offsetTop+parseInt(w.borderTopWidth),left:D.offsetLeft+parseInt(w.borderLeftWidth)};return d?D.style.backgroundColor="#aaa":document.body.removeChild(p),S}e.exports=a})()})(_T);var g8=_T.exports;const v8=Xn(g8);var HT=Jn.CustomEvent;function y8(){try{var e=new HT("cat",{detail:{foo:"bar"}});return e.type==="cat"&&e.detail.foo==="bar"}catch{}return!1}var w8=y8()?HT: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 b8=Xn(w8);function D8(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S8(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(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){D8(e,a,n[a])})}return e}function Cm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ED(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 _v(e,t,n){return t&&ED(e.prototype,t),n&&ED(e,n),e}function xd(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xd=function(n){return typeof n}:xd=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},xd(e)}function Zg(e){return typeof Symbol=="function"&&xd(Symbol.iterator)==="symbol"?Zg=function(n){return xd(n)}:Zg=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":xd(n)},Zg(e)}function I8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hv(e,t){return t&&(Zg(t)==="object"||typeof t=="function")?t:I8(e)}function kd(e){return kd=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},kd(e)}function Mw(e,t){return Mw=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r},Mw(e,t)}function Bv(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&&Mw(e,t)}function T8(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 E8(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function x8(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function C8(e){return T8(e)||E8(e)||x8()}var Ha={ESC:27,UP:38,DOWN:40,LEFT:37,RIGHT:39,ENTER:13,TAB:9},M8=function e(){var t=this;Cm(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 a=n;return typeof a!="object"&&(a=[a]),t.listeners[t.index]={keyCode:a,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(a){var o=a.keyCode,s=a.fn;o.includes(r)&&(n.stopPropagation(),n.preventDefault(),s(n))})}}},Ec=new M8,N8=function(e){Bv(t,e);function t(){var n,r;Cm(this,t);for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return r=Hv(this,(n=kd(t)).call.apply(n,[this].concat(o))),r.selectItem=function(){var u=r.props,d=u.item,m=u.onSelectHandler;m(d)},r}return _v(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,a=this.props,o=a.component,s=a.style,u=a.onClickHandler,d=a.item,m=a.selected,p=a.className,g=a.innerRef;return q.createElement("li",{className:"rta__item ".concat(m===!0?"rta__item--selected":""," ").concat(p||""),style:s},q.createElement("div",{className:"rta__entity ".concat(m===!0?"rta__entity--selected":""),role:"button",tabIndex:0,onClick:u,onFocus:this.selectItem,onMouseEnter:this.selectItem,onTouchStart:function(){r.clicked=!0,r.selectItem()},onTouchEnd:function(D){D.preventDefault(),r.clicked&&u(D)},onTouchMove:function(){r.clicked=!1},onTouchCancel:function(){r.clicked=!1},ref:g},q.createElement(o,{selected:m,entity:d})))}}]),t}(q.Component),k8=function(e){Bv(t,e);function t(){var n,r;Cm(this,t);for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return r=Hv(this,(n=kd(t)).call.apply(n,[this].concat(o))),r.state={selectedItem:null},r.cachedIdOfItems=new Map,r.onPressEnter=function(u){typeof u<"u"&&u.preventDefault();var d=r.props.values;r.modifyText(d[r.getPositionInList()])},r.getPositionInList=function(){var u=r.props.values,d=r.state.selectedItem;return d?u.findIndex(function(m){return r.getId(m)===r.getId(d)}):0},r.getId=function(u){if(r.cachedIdOfItems.has(u))return r.cachedIdOfItems.get(u);var d=r.props.getTextToReplace(u),m=function(){if(d){if(d.key)return d.key;if(typeof u=="string"||!u.key)return d.text}if(!u.key)throw new Error("Item ".concat(JSON.stringify(u),' has to have defined "key" property'));return u.key},p=m();return r.cachedIdOfItems.set(u,p),p},r.listeners=[],r.itemsRef={},r.modifyText=function(u){if(u){var d=r.props.onSelect;d(u)}},r.selectItem=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m=r.props.onItemHighlighted;r.state.selectedItem!==u&&r.setState({selectedItem:u},function(){m(u),d&&r.props.dropdownScroll(r.itemsRef[r.getId(u)])})},r.scroll=function(u){u.preventDefault();var d=r.props.values,m=u.keyCode||u.which,p=r.getPositionInList(),g;switch(m){case Ha.DOWN:g=p+1;break;case Ha.UP:g=p-1;break;default:g=p;break}g=(g%d.length+d.length)%d.length,r.selectItem(d[g],[Ha.DOWN,Ha.UP].includes(m))},r.isSelected=function(u){var d=r.state.selectedItem;return d?r.getId(d)===r.getId(u):!1},r}return _v(t,[{key:"componentDidMount",value:function(){this.listeners.push(Ec.add([Ha.DOWN,Ha.UP],this.scroll),Ec.add([Ha.ENTER,Ha.TAB],this.onPressEnter));var r=this.props.values;r&&r[0]&&this.selectItem(r[0])}},{key:"componentDidUpdate",value:function(r){var a=this,o=r.values,s=this.props.values,u=o.map(function(m){return a.getId(m)}).join(""),d=s.map(function(m){return a.getId(m)}).join("");u!==d&&s&&s[0]&&this.selectItem(s[0])}},{key:"componentWillUnmount",value:function(){for(var r;this.listeners.length;)r=this.listeners.pop(),Ec.remove(r)}},{key:"render",value:function(){var r=this,a=this.props,o=a.values,s=a.component,u=a.style,d=a.itemClassName,m=a.className,p=a.itemStyle;return q.createElement("ul",{className:"rta__list ".concat(m||""),style:u},o.map(function(g){return q.createElement(N8,{key:r.getId(g),innerRef:function(D){r.itemsRef[r.getId(g)]=D},selected:r.isSelected(g),item:g,className:d,style:p,onClickHandler:r.onPressEnter,onSelectHandler:r.selectItem,component:s})}))}}]),t}(q.Component);function A8(e,t){var n=parseInt(getComputedStyle(t).getPropertyValue("height"),10),r=parseInt(getComputedStyle(e).getPropertyValue("height"),10)-n,a=t.offsetTop,o=e.scrollTop;a<o+r&&o<a||(e.scrollTop=a)}var xD="next",ul={X:{LEFT:"rta__autocomplete--left",RIGHT:"rta__autocomplete--right"},Y:{TOP:"rta__autocomplete--top",BOTTOM:"rta__autocomplete--bottom"}},CD=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`))},O8=[".","^","$","*","+","-","?","(",")","[","]","{","}","\\","|"],xg=function(t){return C8(t).map(function(n){return O8.includes(n)?"\\".concat(n):n}).join("")},F8=function(e){Bv(t,e);function t(){return Cm(this,t),Hv(this,kd(t).apply(this,arguments))}return _v(t,[{key:"componentDidMount",value:function(){var r=this.props.boundariesElement;if(typeof r=="string"){var a=document.querySelector(r);if(!a)throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");this.containerElem=a}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,a,o=this.props.top||0,s=this.props.left||0,u=[],d=[],m=0,p=0,g=this.containerElem.getBoundingClientRect(),w=this.ref.getBoundingClientRect(),D=this.props.textareaRef.getBoundingClientRect(),S=window.getComputedStyle(this.ref),T=parseInt(S.getPropertyValue("margin-top"),10),E=parseInt(S.getPropertyValue("margin-bottom"),10),A=parseInt(S.getPropertyValue("margin-left"),10),N=parseInt(S.getPropertyValue("margin-right"),10),R=T+E+D.top+o+w.height,F=A+N+D.left+s+w.width;F>g.right&&D.left+s>w.width?(p=s-w.width,u.push(ul.X.LEFT),d.push(ul.X.RIGHT)):(p=s,u.push(ul.X.RIGHT),d.push(ul.X.LEFT)),R>g.bottom&&D.top+o>w.height?(m=o-w.height,u.push(ul.Y.TOP),d.push(ul.Y.BOTTOM)):(m=o,u.push(ul.Y.BOTTOM),d.push(ul.Y.TOP)),this.props.renderToBody&&(m+=D.top,p+=D.left),this.ref.style.top="".concat(m,"px"),this.ref.style.left="".concat(p,"px"),(r=this.ref.classList).remove.apply(r,d),(a=this.ref.classList).add.apply(a,u)}},{key:"render",value:function(){var r=this,a=this.props,o=a.style,s=a.className,u=a.innerRef,d=a.children,m=a.renderToBody,p=document.body,g=q.createElement("div",{ref:function(D){r.ref=D,u(D)},className:"rta__autocomplete ".concat(s||""),style:o},d);return m&&p!==null?b1.createPortal(g,p):g}}]),t}(q.Component),BT=function(e){Bv(t,e);function t(n){var r;Cm(this,t),r=Hv(this,kd(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=Ec.add(Ha.ESC,r._closeAutocomplete))},r.escListenerDestroy=function(){r.escListener&&(Ec.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,m=d.selectionStart,p=d.selectionEnd;return m===p?null:r.state.value.substr(m,p-m)},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 m=function(){var w=r.getCaretPosition()-1;r.lastTrigger=r.lastTrigger?w:0};if(d.type==="keydown"){var p=d.keyCode||d.which;switch(p){case Ha.UP:case Ha.DOWN:r._isAutocompleteOpen()||m();break;case Ha.LEFT:case Ha.RIGHT:m();break}return}m()},r._onSelect=function(d){var m=r.state,p=m.selectionEnd,g=m.currentTrigger,w=m.value,D=r.props.onItemSelected;if(g){var S=r._getTextToReplace(g);if(!S){r._closeAutocomplete();return}var T=S(d);if(!T){r._closeAutocomplete();return}D&&D({currentTrigger:g,item:d});var E=function(W,K,ae){switch(W){case"start":return ae;case"next":case"end":return ae+K.length;default:if(!Number.isInteger(W))throw new Error('RTA: caretPosition should be "start", "next", "end" or number.');return W}},A=w.slice(0,p),N=xg(g),R=A.length-A.lastIndexOf(g),F=A.search(new RegExp("(?!".concat(N,")$")))-R,H=T.caretPosition==="next"?"".concat(T.text," "):T.text,P=E(T.caretPosition,H,F),L=A.substring(0,F)+H,z=w.replace(A,L);r.setState({value:z,dataLoading:!1},function(){var U=r.tokenRegExpEnding.exec(H),W=U?U[0].length:1;r.lastTrigger=P&&P-W,r.textareaRef.value=z,r.textareaRef.selectionEnd=P,r._changeHandler();var K=r.textareaRef.scrollTop;r.setCaretPosition(P),window.chrome&&(r.textareaRef.scrollTop=K)})}},r._getTextToReplace=function(d){var m=r.props.trigger[d];if(!d||!m)return null;var p=m.output;return function(g){if(typeof g=="object"&&(!p||typeof p!="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(p){var w=p(g,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:xD};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 g!="string")throw new Error(`Output item should be string
`);return{text:"".concat(d).concat(g).concat(d),caretPosition:xD}}},r._getCurrentTriggerSettings=function(){var d=r.state.currentTrigger;return d?r.props.trigger[d]:null},r._getValuesFromProvider=function(){var d=r.state,m=d.currentTrigger,p=d.actualToken,g=r._getCurrentTriggerSettings();if(!(!m||!g)){var w=g.dataProvider,D=g.component;if(typeof w!="function")throw new Error("Trigger provider has to be a function!");r.setState({dataLoading:!0});var S=w(p);S instanceof Promise||(S=Promise.resolve(S)),S.then(function(T){if(!Array.isArray(T))throw new Error("Trigger provider has to provide an array!");if(typeof D!="function")throw new Error("Component should be defined!");if(m===r.state.currentTrigger){if(!T.length){r._closeAutocomplete();return}r.setState({dataLoading:!1,data:T,component:D})}}).catch(function(T){return CD(T.message)})}},r._getSuggestions=function(){var d=r.state,m=d.currentTrigger,p=d.data;return!m||!p||p&&!p.length?null:p},r._createRegExp=function(){var d=r.props.trigger;r.tokenRegExp=new RegExp("(".concat(Object.keys(d).sort(function(m,p){return m<p?1:m>p?-1:0}).map(function(m){return xg(m)}).join("|"),")((?:(?!\\1)[^\\s])*$)")),r.tokenRegExpEnding=new RegExp("(".concat(Object.keys(d).sort(function(m,p){return m<p?1:m>p?-1:0}).map(function(m){return xg(m)}).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=S8({},r.props),m=["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 p in d)m.includes(p)&&delete d[p];return d},r._changeHandler=function(d){var m=r.props,p=m.trigger,g=m.onChange,w=m.minChar,D=m.onCaretPositionChange,S=m.movePopupAsYouType,T=r.state,E=T.top,A=T.left,N=d;N||(N=new b8("change",{bubbles:!0}),r.textareaRef.dispatchEvent(N));var R=N.target||r.textareaRef,F=R.selectionEnd,H=R.value;if(r.lastValueBubbledEvent=H,g&&N&&(N.persist&&N.persist(),g(new Proxy(N,{get:function(Z,$,X){return $==="target"?R:Reflect.get(Z,$,X)}}))),D){var P=r.getCaretPosition();D(P)}r.setState({value:H});var L=function(){var Z=v8(R,F),$=Z.top,X=Z.left;r.setState({top:$-r.textareaRef.scrollTop||0,left:X})},z=function(Z){r.lastTrigger=F-Z,r._closeAutocomplete(),L()};if(F<=r.lastTrigger){var U=H.slice(0,F),W=r.tokenRegExp.exec(U);z(W?W[0].length:0)}var K=H.slice(r.lastTrigger,F),ae=r.tokenRegExp.exec(K),ce=ae&&ae[0],fe=ae&&ae[1]||null,ie=fe?fe.length-1:0,ge=r.tokenRegExpEnding.exec(K);if(ge?z(ge[0].length):r._isAutocompleteOpen()||r._closeAutocomplete(),(!ce||ce.length<=w+ie)&&(r.state.currentTrigger&&!p[r.state.currentTrigger].allowWhitespace||!r.state.currentTrigger)){r._closeAutocomplete();return}if(fe&&p[fe].afterWhitespace&&!/\s/.test(H[F-ce.length-1])&&H[F-ce.length-1]!==void 0){r._closeAutocomplete();return}if(r.state.currentTrigger&&p[r.state.currentTrigger].allowWhitespace){if(ae=new RegExp("".concat(xg(r.state.currentTrigger),".*$")).exec(H.slice(0,F)),ce=ae&&ae[0],!ce){r._closeAutocomplete();return}fe=Object.keys(p).find(function(we){return we.slice(0,ie+1)===ce.slice(0,ie+1)})||null}var Te=ce.slice(1);if(fe){(S||E===null&&A===null||r.state.currentTrigger!==fe)&&L(),r.escListenerInit();var se=r._getTextToReplace(fe);r.setState({selectionEnd:F,currentTrigger:fe,textToReplace:se,actualToken:Te},function(){try{r._getValuesFromProvider()}catch(we){CD(we.message)}})}},r._selectHandler=function(d){var m=r.props,p=m.onCaretPositionChange,g=m.onSelect;if(p){var w=r.getCaretPosition();p(w)}g&&(d.persist(),g(d))},r._shouldStayOpen=function(d){var m=d.relatedTarget;return m===null&&(m=document.activeElement),!!(r.dropdownRef&&m instanceof Node&&r.dropdownRef.contains(m))},r._onClick=function(d){var m=r.props.onClick;m&&(d.persist(),m(d)),!r._shouldStayOpen(d)&&r._closeAutocomplete()},r._onBlur=function(d){var m=r.props.onBlur;m&&(d.persist(),m(d)),!r._shouldStayOpen(d)&&r._closeAutocomplete()},r._onScrollHandler=function(){r._closeAutocomplete()},r._onItemHighlightedHandler=function(d){var m=r.props.onItemHighlighted,p=r.state.currentTrigger;if(m)if(typeof m=="function")m({currentTrigger:p,item:d});else throw new Error("`onItemHighlighted` has to be a function")},r._dropdownScroll=function(d){var m=r.props.scrollToItem;if(m){if(m===!0){A8(r.dropdownRef,d);return}if(typeof m!="function"||m.length!==2)throw new Error("`scrollToItem` has to be boolean (true for default implementation) or function with two parameters: container, item.");m(r.dropdownRef,d)}},r._isAutocompleteOpen=function(){var d=r.state,m=d.dataLoading,p=d.currentTrigger,g=r._getSuggestions();return!!((m||g)&&p)},r._textareaRef=function(d){r.props.innerRef&&r.props.innerRef(d),r.textareaRef=d},r.lastTrigger=0,r.escListener=null;var a=r.props,o=a.loadingComponent,s=a.trigger,u=a.value;if(u&&(r.state.value=u),r._createRegExp(),!o)throw new Error("RTA: loadingComponent is not defined");if(!s)throw new Error("RTA: trigger is not defined");return r}return _v(t,[{key:"componentDidMount",value:function(){Ec.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 a=r.trigger,o=r.value,s=this.props,u=s.trigger,d=s.value;Object.keys(u).join("")!==Object.keys(a).join("")&&this._createRegExp(),o!==d&&this.lastValueBubbledEvent!==d&&(this.lastTrigger=0,this._changeHandler())}},{key:"componentWillUnmount",value:function(){this.escListenerDestroy(),Ec.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,a=this.props,o=a.loadingComponent,s=a.style,u=a.className,d=a.listStyle,m=a.itemStyle,p=a.boundariesElement,g=a.movePopupAsYouType,w=a.listClassName,D=a.itemClassName,S=a.dropdownClassName,T=a.dropdownStyle,E=a.containerStyle,A=a.containerClassName,N=a.loaderStyle,R=a.loaderClassName,F=a.textAreaComponent,H=a.renderToBody,P=this.state,L=P.left,z=P.top,U=P.dataLoading,W=P.component,K=P.value,ae=P.textToReplace,ce=this._isAutocompleteOpen(),fe=this._getSuggestions(),ie={},ge;return F.component?(ge=F.component,ie[F.ref]=this._textareaRef):(ge=F,ie.ref=this._textareaRef),q.createElement("div",{className:"rta ".concat(U===!0?"rta--loading":""," ").concat(A||""),style:E},q.createElement(ge,Object.assign({},this._cleanUpProps(),{className:"rta__textarea ".concat(u||""),onChange:this._changeHandler,onSelect:this._selectHandler,onScroll:this._onScrollHandler,onClick:this._onClick,onBlur:this._onBlur,value:K,style:s},ie)),ce&&q.createElement(F8,{innerRef:function(se){r.dropdownRef=se},top:z,left:L,style:T,className:S,movePopupAsYouType:g,boundariesElement:p,textareaRef:this.textareaRef,renderToBody:H},fe&&W&&ae&&q.createElement(k8,{values:fe,component:W,style:d,className:w,itemClassName:D,itemStyle:m,getTextToReplace:ae,onItemHighlighted:this._onItemHighlightedHandler,onSelect:this._onSelect,dropdownScroll:this._dropdownScroll}),U&&q.createElement("div",{className:"rta__loader ".concat(fe!==null?"rta__loader--suggestion-data":"rta__loader--empty-suggestion-data"," ").concat(R||""),style:N},q.createElement(o,{data:fe}))))}}],[{key:"getDerivedStateFromProps",value:function(r){var a=r.value;return a==null?null:{value:a}}}]),t}(q.Component);BT.defaultProps={movePopupAsYouType:!1,value:null,minChar:1,boundariesElement:"body",scrollToItem:!0,textAreaComponent:"textarea",renderToBody:!1};const P8=()=>{const{app:e}=rt.getState(),t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())},j8=e=>{let t=[];const n=rt.getState().settings;if(n&&(n!=null&&n.UseVaultTags))t=P8();else{const{tags:o}=Ie.getState();t=o}const r=e.toLowerCase(),a=[];return t.forEach(o=>{o&&o.toLowerCase().contains(r)&&a.push({name:o,char:o})}),a},L8=e=>{const{app:t}=rt.getState(),n=t.vault.getAllLoadedFiles(),r=[];let a;return n.forEach(o=>{e==="["?a="":e.contains("[")&&(a=e.slice(1));const s=a.toLowerCase();o instanceof x.TFile&&["md","png","jpg","canvas","jpeg","gif"].contains(o.extension)&&o.path.toLowerCase().contains(s)&&r.push({name:o.basename,char:o.name,file:o})}),r};var O0=O,R8=function(e){return typeof e=="function"},_8=function(e){var t=O0.useState(e),n=t[0],r=t[1],a=O0.useRef(n),o=O0.useCallback(function(s){a.current=R8(s)?s(a.current):s,r(a.current)},[]);return[n,o,a]},H8=_8;const Br=Xn(H8);function cv(e,t){const n=Object.keys(t).map(r=>B8(e,r,t[r]));return n.length===1?n[0]:function(){n.forEach(r=>r())}}function B8(e,t,n){const r=e[t],a=e.hasOwnProperty(t);let o=n(r);return r&&Object.setPrototypeOf(o,r),Object.setPrototypeOf(s,o),e[t]=s,u;function s(...d){return o===r&&e[t]===s&&u(),o.apply(this,d)}function u(){e[t]===s&&(a?e[t]=r:delete e[t]),o!==r&&(o=r,Object.setPrototypeOf(s,r||Function))}}function Y8(e){return e.containerEl.matches(".memos-list-view")}const z8=e=>{const{dailyNotesState:{app:t,plugin:n,editor:r,view:a,dailyNotes:o}}=O.useContext(wt),[s,u]=O.useState(null),[d,m]=O.useState(!1),[p,g]=O.useState(""),[w,D]=O.useState(null),S=O.useRef(x.debounce((L,z)=>{V8(L,z)},100));O.useEffect(()=>{if(!w){for(const L in o)if(o[L]instanceof x.TFile){D(o[L]);break}}},[o]),O.useEffect(()=>{if(!(!e||!r)&&!d)return N(e),()=>{m(!1),s==null||s.destroy()}},[r,e]),O.useEffect(()=>{if(!s||!t)return;const L=U8(t);g(L),(s==null?void 0:s.editor).replaceSelection(L)},[s,t]),O.useEffect(()=>{!s||!t||S.current(p,t)},[p,t]);const T=()=>{s&&s.toggleSource()},E=x.debounce((L,z)=>A(L,z),500,!0),A=(L,z)=>{L&&g(z)},N=L=>{if(r&&a){a.register(cv(r.constructor.prototype,{onUpdate:U=>function(...W){if(U.call(this,W),this.owner.getViewType()==="thino_view"||this.owner instanceof yl){const K=this.get();E(this.owner,K)}},getMode:()=>function(){return"source"}})),a.register(cv(x.Workspace.prototype,{getActiveViewOfType:U=>function(W){const K=U.call(this,W);if(!K&&(W==null?void 0:W.VIEW_TYPE)==="markdown"){const ae=this.activeLeaf;if(ae.view instanceof yl)return ae.view}return K},setActiveLeaf:U=>function(W,K){if(Y8(W)&&(U.call(this,W,K),W.activeTime=17e11),U.call(this,W,K),W.view instanceof yl){const ae=Qe.getState().instanceList.get(W.id);if(!ae)return;self.app.workspace.activeEditor=ae.owner,W.view.editor=ae.editor}},getActiveFile:U=>function(){var K;const W=U.call(this);return((K=this.activeLeaf)==null?void 0:K.view)instanceof yl&&w||W}}));const z=new r.constructor(a.app,L,a);z.owner.editor=z.editor,z.set&&z.set("",!0),z.owner.onMarkdownScroll=()=>{},t.workspace.trigger("thino-editor-created",L,z.editor),m(!0),u(z),Qe.setInstance(`${a.leaf.id}`,z)}};return{instance:s,value:p,set:L=>{try{s&&((s==null?void 0:s.editor).replaceSelection(L),g(L))}catch(z){console.error(z)}},get:()=>s?s.get():"",append:(L,z)=>{if(!s||z&&z!==s.owner.leaf.id)return;const W=(s.get()||"")+L;(s==null?void 0:s.editor).replaceSelection(L),g(W)},clear:()=>{s&&(s.clear(),g(""))},toggleSource:T}};function YT(e){return`thinoEditorContentCache:${e}`}function U8(e){try{const t=YT(e==null?void 0:e.appId);return Kn.get([t])[t]||""}catch(t){return console.error(t),""}}function V8(e,t){try{const n=YT(t==null?void 0:t.appId);Kn.set({[n]:e})}catch(n){console.error(n)}}const MD=({entity:{name:e,char:t,file:n}})=>y.jsx("div",{children:`${t}`}),Z8=({data:e})=>y.jsx("div",{children:"Loading"});let bi;const W8=O.forwardRef((e,t)=>{var De;const{globalState:{useTinyUndoHistoryCache:n,globalEditorShown:r,memoListView:a},dailyNotesState:{settings:o,app:s}}=O.useContext(wt),{SaveMemoButtonLabel:u,SaveMemoButtonIcon:d}=o,{className:m,inputerType:p,initialContent:g,placeholder:w,showConfirmBtn:D,showCancelBtn:S,onConfirmBtnClick:T,onCancelBtnClick:E,onContentChange:A}=e,N=O.useRef(null),R=O.useRef(null),F=O.useRef(null),H=p8(),{instance:P,value:L,set:z,get:U,append:W,clear:K,toggleSource:ae}=z8(R.current),[,ce,fe]=Br(0),[ie,ge]=Br(!1);O.useEffect(()=>{var be,ke;if(o&&o.FocusOnEditor)switch(p){case"minimal":case"memos":(be=N.current)==null||be.focus();break;case"obsidian":P&&((ke=P.editor)==null||ke.focus())}},[o,P]),O.useEffect(()=>{if(!s)return;const be=s.workspace.getLeavesOfType(Hr);let ke,Be;be.length>0?(Be=be[0].view.containerEl,ke=Be.offsetHeight):(Be=document,ke=window.outerHeight),ce(ke)},[s]),O.useEffect(()=>{!N.current||p==="obsidian"||g&&(N.current.value=g,H())},[]),O.useEffect(()=>{var be;if(p!=="obsidian")if(n){if(!N.current)return;const{tinyUndoActionsCache:ke,tinyUndoIndexCache:Be}=Kn.get(["tinyUndoActionsCache","tinyUndoIndexCache"]);return F.current=new m8(N.current,{interval:5e3,initialActions:ke,initialIndex:Be}),F.current.subscribe((_e,it)=>{Kn.set({tinyUndoActionsCache:_e,tinyUndoIndexCache:it})}),()=>{var _e;(_e=F.current)==null||_e.destroy()}}else(be=F.current)==null||be.destroy(),F.current=null,Kn.remove(["tinyUndoActionsCache","tinyUndoIndexCache"])},[n]),O.useEffect(()=>{N.current&&(N.current.style.height="auto",N.current.style.height=(N.current.scrollHeight??0)+"px")},[(De=N.current)==null?void 0:De.value]),O.useImperativeHandle(t,()=>({element:N.current,blur:()=>{var be,ke;switch(p){case"minimal":case"memos":(be=N.current)==null||be.blur();break;case"obsidian":P&&((ke=P.editor)==null||ke.blur())}},focus:be=>{var ke,Be,_e,it,Vt;switch(p){case"minimal":case"memos":o!=null&&o.FocusOnEditor&&((ke=N.current)==null||ke.focus());break;case"obsidian":if(o!=null&&o.FocusOnEditor&&P){if(be&&be!==((it=(_e=(Be=P==null?void 0:P.owner)==null?void 0:Be.view)==null?void 0:_e.leaf)==null?void 0:it.id))return;(Vt=P.editor)==null||Vt.focus()}}},insertText:(be,ke)=>{switch(p){case"minimal":case"memos":{if(!N.current)return;const Be=N.current.value;N.current.value=Be.slice(0,N.current.selectionStart)+be+Be.slice(N.current.selectionStart),A(N.current.value),H()}break;case"obsidian":P&&W(be,ke);break}},setContent:be=>{switch(p){case"minimal":case"memos":N.current&&(N.current.value=be,A(N.current.value),H());break;case"obsidian":P&&z(be);break}},getContent:()=>{switch(p){case"minimal":case"memos":return N.current?N.current.value:"";case"obsidian":return U()}},toggleSource:()=>{switch(p){case"minimal":case"memos":break;case"obsidian":ae();break}},clear:()=>{switch(p){case"minimal":case"memos":N.current&&(N.current.value="",A(N.current.value),H());break;case"obsidian":K();break}}}),[P,p]);const Te=be=>{if(!N.current)return;const{fileManager:ke}=Ee.getState().dailyNotesState.app;if(be.currentTrigger==="#"){const Be=N.current.value;let _e;bi!=null?_e=bi.length:_e=0;let it=N.current.selectionStart;for(let Vt=0;Vt<Be.length;Vt++)/\s/g.test(Be[it])||it++;N.current.value=Be.slice(0,N.current.selectionStart-_e)+be.item.char+Be.slice(it),A(N.current.value),H()}else if(be.currentTrigger==="[["){const Be=ke.generateMarkdownLink(be.item.file,be.item.file.path,"",""),_e=N.current.value;let it;bi!=null?Be.contains("[[")||be.item.file.extension!=="md"?it=bi.length+1:it=bi.length+2:it=2;let Vt=N.current.selectionStart;for(let Se=0;Se<_e.length;Se++)/\s/g.test(_e[Vt])||Vt++;N.current.value=_e.slice(0,N.current.selectionStart-it)+Be+_e.slice(Vt),A(N.current.value),H()}},se=O.useCallback(()=>{var be;A(((be=N.current)==null?void 0:be.value)||""),H()},[]),we=()=>{var be;switch(p){case"minimal":case"memos":if(!N.current)return;N.current.value=$(),T(N.current.value),N.current.value="",H(),(be=F.current)==null||be.resetState();break;case"obsidian":T(U()),K(),H();break}},Z=O.useCallback(()=>{switch(p){case"minimal":case"memos":N.current&&(N.current.value="",A(N.current.value),H());break;case"obsidian":K();break}E()},[p,P,N]),$=()=>Kn.get(["thinoEditorContentCache"]).thinoEditorContentCache||"",X=()=>{if(N.current)return N.current.value=$(),N.current.value},ve=be=>{switch(be){case"memos":return y.jsx(BT,{className:`common-editor-inputer scroll ${ie?" editing":""}`,loadingComponent:Z8,placeholder:w,movePopupAsYouType:!0,value:X(),innerRef:ke=>{N.current=ke},onFocus:()=>{ge(!0)},onBlur:()=>{ge(!1)},onInput:se,style:{maxHeight:`${fe.current>400?fe.current-400:100}px`},dropdownStyle:{minWidth:180,maxHeight:250,overflowY:"auto"},minChar:0,onItemSelected:Te,scrollToItem:!0,trigger:{"#":{dataProvider:ke=>(bi=ke,j8(ke).map(({name:Be,char:_e})=>({name:Be,char:_e}))),component:MD,afterWhitespace:!0,output:ke=>ke.char},"[[":{dataProvider:ke=>(bi=ke,L8(ke).slice(0,10).map(({name:Be,char:_e,file:it})=>({name:Be,char:_e,file:it}))),component:MD,afterWhitespace:!0,output:ke=>ke.char}}});case"minimal":return y.jsx("textarea",{style:{minHeight:48},className:"common-editor-inputer scroll",rows:1,placeholder:w,ref:N,onInput:se});case"obsidian":return y.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",ref:R});default:return y.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",ref:R})}};return y.jsxs("div",{className:"common-editor-wrapper "+m,children:[ve(p),y.jsxs("div",{className:"common-tools-wrapper",children:[y.jsx("div",{className:"common-tools-container",children:y.jsx(lo,{when:e.tools!==void 0,children:e.tools})}),y.jsxs("div",{className:"btns-container",children:[y.jsx(lo,{when:S,children:y.jsx("button",{className:"action-btn cancel-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&Z()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&Z()},children:We.getState().pathname==="/"&&a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?"":k("CANCEL EDIT")})}),y.jsx(lo,{when:D,children:y.jsxs("button",{title:"Ctrl/Cmd + Enter to save thino",className:"action-btn confirm-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&we()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&we()},children:[a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?"":u,y.jsx("span",{className:"icon-text",children:a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?null:d})]})})]})]})]})}),$8=typeof window<"u"?O.useLayoutEffect:O.useEffect;function G8(e,t,n,r){const a=O.useRef(t);$8(()=>{a.current=t},[t]),O.useEffect(()=>{const o=(n==null?void 0:n.current)||window;if(!(o&&o.addEventListener))return;const s=u=>{a.current(u)};return o.addEventListener(e,s,r),()=>{o.removeEventListener(e,s,r)}},[e,n,r])}function Mm(e,t,n="mousedown"){G8(n,r=>{const a=r.target;if(!a||!a.isConnected||a.closest(".suggestion-container")||a.closest(".menu"))return;(Array.isArray(e)?e.every(s=>s.current&&!s.current.contains(a)):e.current&&!e.current.contains(a))&&t(r)})}const zT=e=>{const{year:t,handleYearChange:n}=e,[r,a]=O.useState([]),[o,s]=O.useState(t),u=O.useRef(null),d=O.useRef(null),[m,p]=q.useState(!1),g=q.useRef(null);Mm(g,()=>{p(!1)}),O.useEffect(()=>{u.current&&x.setIcon(u.current,"chevron-left"),d.current&&x.setIcon(d.current,"chevron-right")},[u,d,m]),O.useEffect(()=>{D(o)},[t]);const D=S=>{const T=parseInt(S),E=T-T%10,A=[];for(let N=0;N<10;N++)A.push(`${E+N}`);a(A)};return y.jsxs(y.Fragment,{children:[y.jsxs("span",{className:"btn year-btn",onClick:()=>{p(!m)},children:[y.jsx("span",{children:t}),y.jsx("span",{children:k("year")})]}),m&&y.jsxs("div",{ref:g,className:"year-picker-wrapper",children:[y.jsxs("div",{className:"year-picker-header",children:[y.jsxs("div",{className:"year-picker-header-title",children:[o," "+(k("year")||"")]}),y.jsxs("div",{className:"year-picker-header-btns",children:[y.jsx("span",{className:"btn",ref:u,onClick:()=>{const S=parseInt(o)-10;s(S.toString()),D(S.toString())}}),y.jsx("span",{className:"btn",ref:d,onClick:()=>{const S=parseInt(o)+10;s(S.toString()),D(S.toString())}})]})]}),y.jsx("div",{className:"year-picker-body",children:y.jsx("div",{className:"year-picker-body-list",children:r.map(S=>y.jsx("div",{className:`year-picker-body-item ${S===o?"selected":""}`,onClick:()=>{s(S),n(S),p(!1)},children:S},S))})})]})]})},UT=e=>{const{month:t,handleMonthChange:n}=e,[r,a]=O.useState([]),[o,s]=O.useState((parseInt(t)+1).toString()),[u,d]=q.useState(!1),m=q.useRef(null);Mm(m,()=>{d(!1)}),O.useEffect(()=>{g()},[t]);const g=()=>{const w=[];for(let D=1;D<=12;D++)w.push(`${D}`);a(w)};return y.jsxs(y.Fragment,{children:[y.jsxs("span",{className:"btn month-btn",onClick:()=>{d(!u)},children:[y.jsxs("span",{children:[k("monthsShort")[parseInt(t)]||parseInt(t)+1," "]}),y.jsx("span",{children:k("month")||""})]}),u&&y.jsxs("div",{ref:m,className:"month-picker-wrapper",children:[y.jsxs("div",{className:"month-picker-header",children:[y.jsxs("div",{className:"month-picker-header-title",children:[o," "+(k("month")||"")]}),y.jsx("div",{className:"month-picker-header-btns"})]}),y.jsx("div",{className:"month-picker-body",children:y.jsx("div",{className:"month-picker-body-list",children:r.map(w=>y.jsx("div",{className:`month-picker-body-item ${w===o?"selected":""}`,onClick:()=>{s(w),n(w),d(!1)},children:w},w))})})]})]})},Nm=e=>{const{className:t,datestamp:n,handleDateStampChange:r}=e,[a,o]=O.useState(Ph(n)),[s,u]=O.useState(n);O.useEffect(()=>{o(Ph(n))},[n]);const d=new Date(a),m=d.getDay(),p=[];for(let S=0;S<m;S++)p.push({date:0,datestamp:d.getTime()-Ba*(7-S)});const g=q8(a);for(let S=1;S<=g;S++)p.push({date:S,datestamp:d.getTime()+Ba*(S-1)});const w=(S,T)=>{r(T,S.nativeEvent),u(T)},D=S=>{const T=d.getFullYear(),E=d.getMonth()+1;let A=0;E===1&&S===-1?A=new Date(`${T-1}/12/1`).getTime():E===12&&S===1?A=new Date(`${T+1}/1/1`).getTime():A=new Date(`${T}/${E+S}/1`).getTime(),o(Ph(A))};return y.jsxs("div",{className:`date-picker-wrapper ${t}`,children:[y.jsxs("div",{className:"date-picker-header",children:[y.jsx("span",{ref:S=>{S&&x.setIcon(S,"chevron-left")},className:"btn btn-text",onClick:()=>D(-1)}),y.jsxs("span",{className:"normal-text",children:[y.jsx(zT,{year:d.getFullYear().toString(),handleYearChange:S=>{o(Ph(new Date(`${S}/${d.getMonth()+1}/1`).getTime()))}}),y.jsx(UT,{month:d.getMonth().toString(),handleMonthChange:S=>{o(Ph(new Date(`${d.getFullYear()}/${parseInt(S)}/1`).getTime()))}})]}),y.jsx("span",{ref:S=>{S&&x.setIcon(S,"chevron-right")},className:"btn btn-text",onClick:()=>D(1)})]}),y.jsxs("div",{className:"date-picker-day-container",children:[y.jsx("div",{className:"date-picker-day-header",children:k("weekDaysShort").map(S=>y.jsx("span",{className:"day-item",children:S},S))}),y.jsx("div",{className:"date-picker-day-content",children:p.map(S=>S.date===0?y.jsx("span",{className:"day-item null",children:""},S.datestamp):y.jsx("span",{className:`day-item ${S.datestamp===n?"current":""} ${S.datestamp===s?"selected":""}`,onClick:T=>w(T,S.datestamp),children:y.jsx("span",{className:"day-item-text",children:S.date})},S.datestamp))})]})]})};function q8(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())/Ba}function Ph(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}var ND=function(t){return t.reduce(function(n,r){var a=r[0],o=r[1];return n[a]=o,n},{})},kD=typeof window<"u"&&window.document&&window.document.createElement?O.useLayoutEffect:O.useEffect,wa="top",uo="bottom",fo="right",ba="left",D1="auto",km=[wa,uo,fo,ba],Ad="start",em="end",J8="clippingParents",VT="viewport",jh="popper",K8="reference",AD=km.reduce(function(e,t){return e.concat([t+"-"+Ad,t+"-"+em])},[]),S1=[].concat(km,[D1]).reduce(function(e,t){return e.concat([t,t+"-"+Ad,t+"-"+em])},[]),Q8="beforeRead",X8="read",e9="afterRead",t9="beforeMain",n9="main",r9="afterMain",a9="beforeWrite",o9="write",i9="afterWrite",s9=[Q8,X8,e9,t9,n9,r9,a9,o9,i9];function ki(e){return e?(e.nodeName||"").toLowerCase():null}function za(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function kc(e){var t=za(e).Element;return e instanceof t||e instanceof Element}function co(e){var t=za(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function I1(e){if(typeof ShadowRoot>"u")return!1;var t=za(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function l9(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},a=t.attributes[n]||{},o=t.elements[n];!co(o)||!ki(o)||(Object.assign(o.style,r),Object.keys(a).forEach(function(s){var u=a[s];u===!1?o.removeAttribute(s):o.setAttribute(s,u===!0?"":u)}))})}function c9(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 a=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=s.reduce(function(d,m){return d[m]="",d},{});!co(a)||!ki(a)||(Object.assign(a.style,u),Object.keys(o).forEach(function(d){a.removeAttribute(d)}))})}}const u9={name:"applyStyles",enabled:!0,phase:"write",fn:l9,effect:c9,requires:["computeStyles"]};function Ni(e){return e.split("-")[0]}var Mc=Math.max,uv=Math.min,Od=Math.round;function Nw(){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 ZT(){return!/^((?!chrome|android).)*safari/i.test(Nw())}function Fd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),a=1,o=1;t&&co(e)&&(a=e.offsetWidth>0&&Od(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Od(r.height)/e.offsetHeight||1);var s=kc(e)?za(e):window,u=s.visualViewport,d=!ZT()&&n,m=(r.left+(d&&u?u.offsetLeft:0))/a,p=(r.top+(d&&u?u.offsetTop:0))/o,g=r.width/a,w=r.height/o;return{width:g,height:w,top:p,right:m+g,bottom:p+w,left:m,x:m,y:p}}function T1(e){var t=Fd(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 WT(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&I1(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ms(e){return za(e).getComputedStyle(e)}function d9(e){return["table","td","th"].indexOf(ki(e))>=0}function Tl(e){return((kc(e)?e.ownerDocument:e.document)||window.document).documentElement}function Yv(e){return ki(e)==="html"?e:e.assignedSlot||e.parentNode||(I1(e)?e.host:null)||Tl(e)}function OD(e){return!co(e)||ms(e).position==="fixed"?null:e.offsetParent}function f9(e){var t=/firefox/i.test(Nw()),n=/Trident/i.test(Nw());if(n&&co(e)){var r=ms(e);if(r.position==="fixed")return null}var a=Yv(e);for(I1(a)&&(a=a.host);co(a)&&["html","body"].indexOf(ki(a))<0;){var o=ms(a);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return a;a=a.parentNode}return null}function Am(e){for(var t=za(e),n=OD(e);n&&d9(n)&&ms(n).position==="static";)n=OD(n);return n&&(ki(n)==="html"||ki(n)==="body"&&ms(n).position==="static")?t:n||f9(e)||t}function E1(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Gh(e,t,n){return Mc(e,uv(t,n))}function h9(e,t,n){var r=Gh(e,t,n);return r>n?n:r}function $T(){return{top:0,right:0,bottom:0,left:0}}function GT(e){return Object.assign({},$T(),e)}function qT(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var m9=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,GT(typeof t!="number"?t:qT(t,km))};function p9(e){var t,n=e.state,r=e.name,a=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,u=Ni(n.placement),d=E1(u),m=[ba,fo].indexOf(u)>=0,p=m?"height":"width";if(!(!o||!s)){var g=m9(a.padding,n),w=T1(o),D=d==="y"?wa:ba,S=d==="y"?uo:fo,T=n.rects.reference[p]+n.rects.reference[d]-s[d]-n.rects.popper[p],E=s[d]-n.rects.reference[d],A=Am(o),N=A?d==="y"?A.clientHeight||0:A.clientWidth||0:0,R=T/2-E/2,F=g[D],H=N-w[p]-g[S],P=N/2-w[p]/2+R,L=Gh(F,P,H),z=d;n.modifiersData[r]=(t={},t[z]=L,t.centerOffset=L-P,t)}}function g9(e){var t=e.state,n=e.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=t.elements.popper.querySelector(a),!a)||WT(t.elements.popper,a)&&(t.elements.arrow=a))}const JT={name:"arrow",enabled:!0,phase:"main",fn:p9,effect:g9,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Pd(e){return e.split("-")[1]}var v9={top:"auto",right:"auto",bottom:"auto",left:"auto"};function y9(e,t){var n=e.x,r=e.y,a=t.devicePixelRatio||1;return{x:Od(n*a)/a||0,y:Od(r*a)/a||0}}function FD(e){var t,n=e.popper,r=e.popperRect,a=e.placement,o=e.variation,s=e.offsets,u=e.position,d=e.gpuAcceleration,m=e.adaptive,p=e.roundOffsets,g=e.isFixed,w=s.x,D=w===void 0?0:w,S=s.y,T=S===void 0?0:S,E=typeof p=="function"?p({x:D,y:T}):{x:D,y:T};D=E.x,T=E.y;var A=s.hasOwnProperty("x"),N=s.hasOwnProperty("y"),R=ba,F=wa,H=window;if(m){var P=Am(n),L="clientHeight",z="clientWidth";if(P===za(n)&&(P=Tl(n),ms(P).position!=="static"&&u==="absolute"&&(L="scrollHeight",z="scrollWidth")),a===wa||(a===ba||a===fo)&&o===em){F=uo;var U=g&&P===H&&H.visualViewport?H.visualViewport.height:P[L];T-=U-r.height,T*=d?1:-1}if(a===ba||(a===wa||a===uo)&&o===em){R=fo;var W=g&&P===H&&H.visualViewport?H.visualViewport.width:P[z];D-=W-r.width,D*=d?1:-1}}var K=Object.assign({position:u},m&&v9),ae=p===!0?y9({x:D,y:T},za(n)):{x:D,y:T};if(D=ae.x,T=ae.y,d){var ce;return Object.assign({},K,(ce={},ce[F]=N?"0":"",ce[R]=A?"0":"",ce.transform=(H.devicePixelRatio||1)<=1?"translate("+D+"px, "+T+"px)":"translate3d("+D+"px, "+T+"px, 0)",ce))}return Object.assign({},K,(t={},t[F]=N?T+"px":"",t[R]=A?D+"px":"",t.transform="",t))}function w9(e){var t=e.state,n=e.options,r=n.gpuAcceleration,a=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,u=n.roundOffsets,d=u===void 0?!0:u,m={placement:Ni(t.placement),variation:Pd(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,FD(Object.assign({},m,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:d})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,FD(Object.assign({},m,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const KT={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:w9,data:{}};var Cg={passive:!0};function b9(e){var t=e.state,n=e.instance,r=e.options,a=r.scroll,o=a===void 0?!0:a,s=r.resize,u=s===void 0?!0:s,d=za(t.elements.popper),m=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&m.forEach(function(p){p.addEventListener("scroll",n.update,Cg)}),u&&d.addEventListener("resize",n.update,Cg),function(){o&&m.forEach(function(p){p.removeEventListener("scroll",n.update,Cg)}),u&&d.removeEventListener("resize",n.update,Cg)}}const QT={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:b9,data:{}};var D9={left:"right",right:"left",bottom:"top",top:"bottom"};function Wg(e){return e.replace(/left|right|bottom|top/g,function(t){return D9[t]})}var S9={start:"end",end:"start"};function PD(e){return e.replace(/start|end/g,function(t){return S9[t]})}function x1(e){var t=za(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function C1(e){return Fd(Tl(e)).left+x1(e).scrollLeft}function I9(e,t){var n=za(e),r=Tl(e),a=n.visualViewport,o=r.clientWidth,s=r.clientHeight,u=0,d=0;if(a){o=a.width,s=a.height;var m=ZT();(m||!m&&t==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}return{width:o,height:s,x:u+C1(e),y:d}}function T9(e){var t,n=Tl(e),r=x1(e),a=(t=e.ownerDocument)==null?void 0:t.body,o=Mc(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Mc(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),u=-r.scrollLeft+C1(e),d=-r.scrollTop;return ms(a||n).direction==="rtl"&&(u+=Mc(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:s,x:u,y:d}}function M1(e){var t=ms(e),n=t.overflow,r=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function XT(e){return["html","body","#document"].indexOf(ki(e))>=0?e.ownerDocument.body:co(e)&&M1(e)?e:XT(Yv(e))}function qh(e,t){var n;t===void 0&&(t=[]);var r=XT(e),a=r===((n=e.ownerDocument)==null?void 0:n.body),o=za(r),s=a?[o].concat(o.visualViewport||[],M1(r)?r:[]):r,u=t.concat(s);return a?u:u.concat(qh(Yv(s)))}function kw(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function E9(e,t){var n=Fd(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 jD(e,t,n){return t===VT?kw(I9(e,n)):kc(t)?E9(t,n):kw(T9(Tl(e)))}function x9(e){var t=qh(Yv(e)),n=["absolute","fixed"].indexOf(ms(e).position)>=0,r=n&&co(e)?Am(e):e;return kc(r)?t.filter(function(a){return kc(a)&&WT(a,r)&&ki(a)!=="body"}):[]}function C9(e,t,n,r){var a=t==="clippingParents"?x9(e):[].concat(t),o=[].concat(a,[n]),s=o[0],u=o.reduce(function(d,m){var p=jD(e,m,r);return d.top=Mc(p.top,d.top),d.right=uv(p.right,d.right),d.bottom=uv(p.bottom,d.bottom),d.left=Mc(p.left,d.left),d},jD(e,s,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function eE(e){var t=e.reference,n=e.element,r=e.placement,a=r?Ni(r):null,o=r?Pd(r):null,s=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,d;switch(a){case wa:d={x:s,y:t.y-n.height};break;case uo:d={x:s,y:t.y+t.height};break;case fo:d={x:t.x+t.width,y:u};break;case ba:d={x:t.x-n.width,y:u};break;default:d={x:t.x,y:t.y}}var m=a?E1(a):null;if(m!=null){var p=m==="y"?"height":"width";switch(o){case Ad:d[m]=d[m]-(t[p]/2-n[p]/2);break;case em:d[m]=d[m]+(t[p]/2-n[p]/2);break}}return d}function tm(e,t){t===void 0&&(t={});var n=t,r=n.placement,a=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,u=n.boundary,d=u===void 0?J8:u,m=n.rootBoundary,p=m===void 0?VT:m,g=n.elementContext,w=g===void 0?jh:g,D=n.altBoundary,S=D===void 0?!1:D,T=n.padding,E=T===void 0?0:T,A=GT(typeof E!="number"?E:qT(E,km)),N=w===jh?K8:jh,R=e.rects.popper,F=e.elements[S?N:w],H=C9(kc(F)?F:F.contextElement||Tl(e.elements.popper),d,p,s),P=Fd(e.elements.reference),L=eE({reference:P,element:R,strategy:"absolute",placement:a}),z=kw(Object.assign({},R,L)),U=w===jh?z:P,W={top:H.top-U.top+A.top,bottom:U.bottom-H.bottom+A.bottom,left:H.left-U.left+A.left,right:U.right-H.right+A.right},K=e.modifiersData.offset;if(w===jh&&K){var ae=K[a];Object.keys(W).forEach(function(ce){var fe=[fo,uo].indexOf(ce)>=0?1:-1,ie=[wa,uo].indexOf(ce)>=0?"y":"x";W[ce]+=ae[ie]*fe})}return W}function M9(e,t){t===void 0&&(t={});var n=t,r=n.placement,a=n.boundary,o=n.rootBoundary,s=n.padding,u=n.flipVariations,d=n.allowedAutoPlacements,m=d===void 0?S1:d,p=Pd(r),g=p?u?AD:AD.filter(function(S){return Pd(S)===p}):km,w=g.filter(function(S){return m.indexOf(S)>=0});w.length===0&&(w=g);var D=w.reduce(function(S,T){return S[T]=tm(e,{placement:T,boundary:a,rootBoundary:o,padding:s})[Ni(T)],S},{});return Object.keys(D).sort(function(S,T){return D[S]-D[T]})}function N9(e){if(Ni(e)===D1)return[];var t=Wg(e);return[PD(e),t,PD(t)]}function k9(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var a=n.mainAxis,o=a===void 0?!0:a,s=n.altAxis,u=s===void 0?!0:s,d=n.fallbackPlacements,m=n.padding,p=n.boundary,g=n.rootBoundary,w=n.altBoundary,D=n.flipVariations,S=D===void 0?!0:D,T=n.allowedAutoPlacements,E=t.options.placement,A=Ni(E),N=A===E,R=d||(N||!S?[Wg(E)]:N9(E)),F=[E].concat(R).reduce(function(De,be){return De.concat(Ni(be)===D1?M9(t,{placement:be,boundary:p,rootBoundary:g,padding:m,flipVariations:S,allowedAutoPlacements:T}):be)},[]),H=t.rects.reference,P=t.rects.popper,L=new Map,z=!0,U=F[0],W=0;W<F.length;W++){var K=F[W],ae=Ni(K),ce=Pd(K)===Ad,fe=[wa,uo].indexOf(ae)>=0,ie=fe?"width":"height",ge=tm(t,{placement:K,boundary:p,rootBoundary:g,altBoundary:w,padding:m}),Te=fe?ce?fo:ba:ce?uo:wa;H[ie]>P[ie]&&(Te=Wg(Te));var se=Wg(Te),we=[];if(o&&we.push(ge[ae]<=0),u&&we.push(ge[Te]<=0,ge[se]<=0),we.every(function(De){return De})){U=K,z=!1;break}L.set(K,we)}if(z)for(var Z=S?3:1,$=function(be){var ke=F.find(function(Be){var _e=L.get(Be);if(_e)return _e.slice(0,be).every(function(it){return it})});if(ke)return U=ke,"break"},X=Z;X>0;X--){var ve=$(X);if(ve==="break")break}t.placement!==U&&(t.modifiersData[r]._skip=!0,t.placement=U,t.reset=!0)}}const tE={name:"flip",enabled:!0,phase:"main",fn:k9,requiresIfExists:["offset"],data:{_skip:!1}};function LD(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 RD(e){return[wa,fo,uo,ba].some(function(t){return e[t]>=0})}function A9(e){var t=e.state,n=e.name,r=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,s=tm(t,{elementContext:"reference"}),u=tm(t,{altBoundary:!0}),d=LD(s,r),m=LD(u,a,o),p=RD(d),g=RD(m);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:m,isReferenceHidden:p,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":g})}const nE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:A9};function O9(e,t,n){var r=Ni(e),a=[ba,wa].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],u=o[1];return s=s||0,u=(u||0)*a,[ba,fo].indexOf(r)>=0?{x:u,y:s}:{x:s,y:u}}function F9(e){var t=e.state,n=e.options,r=e.name,a=n.offset,o=a===void 0?[0,0]:a,s=S1.reduce(function(p,g){return p[g]=O9(g,t.rects,o),p},{}),u=s[t.placement],d=u.x,m=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=m),t.modifiersData[r]=s}const rE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:F9};function P9(e){var t=e.state,n=e.name;t.modifiersData[n]=eE({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const aE={name:"popperOffsets",enabled:!0,phase:"read",fn:P9,data:{}};function j9(e){return e==="x"?"y":"x"}function L9(e){var t=e.state,n=e.options,r=e.name,a=n.mainAxis,o=a===void 0?!0:a,s=n.altAxis,u=s===void 0?!1:s,d=n.boundary,m=n.rootBoundary,p=n.altBoundary,g=n.padding,w=n.tether,D=w===void 0?!0:w,S=n.tetherOffset,T=S===void 0?0:S,E=tm(t,{boundary:d,rootBoundary:m,padding:g,altBoundary:p}),A=Ni(t.placement),N=Pd(t.placement),R=!N,F=E1(A),H=j9(F),P=t.modifiersData.popperOffsets,L=t.rects.reference,z=t.rects.popper,U=typeof T=="function"?T(Object.assign({},t.rects,{placement:t.placement})):T,W=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,ae={x:0,y:0};if(P){if(o){var ce,fe=F==="y"?wa:ba,ie=F==="y"?uo:fo,ge=F==="y"?"height":"width",Te=P[F],se=Te+E[fe],we=Te-E[ie],Z=D?-z[ge]/2:0,$=N===Ad?L[ge]:z[ge],X=N===Ad?-z[ge]:-L[ge],ve=t.elements.arrow,De=D&&ve?T1(ve):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:$T(),ke=be[fe],Be=be[ie],_e=Gh(0,L[ge],De[ge]),it=R?L[ge]/2-Z-_e-ke-W.mainAxis:$-_e-ke-W.mainAxis,Vt=R?-L[ge]/2+Z+_e+Be+W.mainAxis:X+_e+Be+W.mainAxis,Se=t.elements.arrow&&Am(t.elements.arrow),Ue=Se?F==="y"?Se.clientTop||0:Se.clientLeft||0:0,Je=(ce=K==null?void 0:K[F])!=null?ce:0,$e=Te+it-Je-Ue,lt=Te+Vt-Je,ft=Gh(D?uv(se,$e):se,Te,D?Mc(we,lt):we);P[F]=ft,ae[F]=ft-Te}if(u){var Dt,Et=F==="x"?wa:ba,$t=F==="x"?uo:fo,rn=P[H],At=H==="y"?"height":"width",an=rn+E[Et],Sn=rn-E[$t],In=[wa,ba].indexOf(A)!==-1,vr=(Dt=K==null?void 0:K[H])!=null?Dt:0,Sa=In?an:rn-L[At]-z[At]-vr+W.altAxis,Mr=In?rn+L[At]+z[At]-vr-W.altAxis:Sn,Nr=D&&In?h9(Sa,rn,Mr):Gh(D?Sa:an,rn,D?Mr:Sn);P[H]=Nr,ae[H]=Nr-rn}t.modifiersData[r]=ae}}const oE={name:"preventOverflow",enabled:!0,phase:"main",fn:L9,requiresIfExists:["offset"]};function R9(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function _9(e){return e===za(e)||!co(e)?x1(e):R9(e)}function H9(e){var t=e.getBoundingClientRect(),n=Od(t.width)/e.offsetWidth||1,r=Od(t.height)/e.offsetHeight||1;return n!==1||r!==1}function B9(e,t,n){n===void 0&&(n=!1);var r=co(t),a=co(t)&&H9(t),o=Tl(t),s=Fd(e,a,n),u={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!n)&&((ki(t)!=="body"||M1(o))&&(u=_9(t)),co(t)?(d=Fd(t,!0),d.x+=t.clientLeft,d.y+=t.clientTop):o&&(d.x=C1(o))),{x:s.left+u.scrollLeft-d.x,y:s.top+u.scrollTop-d.y,width:s.width,height:s.height}}function Y9(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function a(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(u){if(!n.has(u)){var d=t.get(u);d&&a(d)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||a(o)}),r}function z9(e){var t=Y9(e);return s9.reduce(function(n,r){return n.concat(t.filter(function(a){return a.phase===r}))},[])}function U9(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function V9(e){var t=e.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var _D={placement:"bottom",modifiers:[],strategy:"absolute"};function HD(){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 iE(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,a=t.defaultOptions,o=a===void 0?_D:a;return function(u,d,m){m===void 0&&(m=o);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},_D,o),modifiersData:{},elements:{reference:u,popper:d},attributes:{},styles:{}},g=[],w=!1,D={state:p,setOptions:function(A){var N=typeof A=="function"?A(p.options):A;T(),p.options=Object.assign({},o,p.options,N),p.scrollParents={reference:kc(u)?qh(u):u.contextElement?qh(u.contextElement):[],popper:qh(d)};var R=z9(V9([].concat(r,p.options.modifiers)));return p.orderedModifiers=R.filter(function(F){return F.enabled}),S(),D.update()},forceUpdate:function(){if(!w){var A=p.elements,N=A.reference,R=A.popper;if(HD(N,R)){p.rects={reference:B9(N,Am(R),p.options.strategy==="fixed"),popper:T1(R)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(W){return p.modifiersData[W.name]=Object.assign({},W.data)});for(var F=0;F<p.orderedModifiers.length;F++){if(p.reset===!0){p.reset=!1,F=-1;continue}var H=p.orderedModifiers[F],P=H.fn,L=H.options,z=L===void 0?{}:L,U=H.name;typeof P=="function"&&(p=P({state:p,options:z,name:U,instance:D})||p)}}}},update:U9(function(){return new Promise(function(E){D.forceUpdate(),E(p)})}),destroy:function(){T(),w=!0}};if(!HD(u,d))return D;D.setOptions(m).then(function(E){!w&&m.onFirstUpdate&&m.onFirstUpdate(E)});function S(){p.orderedModifiers.forEach(function(E){var A=E.name,N=E.options,R=N===void 0?{}:N,F=E.effect;if(typeof F=="function"){var H=F({state:p,name:A,instance:D,options:R}),P=function(){};g.push(H||P)}})}function T(){g.forEach(function(E){return E()}),g=[]}return D}}var Z9=[QT,aE,KT,u9,rE,tE,oE,JT,nE],sE=iE({defaultModifiers:Z9}),W9=typeof Element<"u",$9=typeof Map=="function",G9=typeof Set=="function",q9=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function $g(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,a;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!$g(e[r],t[r]))return!1;return!0}var o;if($9&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!$g(r.value[1],t.get(r.value[0])))return!1;return!0}if(G9&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(q9&&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(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;if(W9&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((a[r]==="_owner"||a[r]==="__v"||a[r]==="__o")&&e.$$typeof)&&!$g(e[a[r]],t[a[r]]))return!1;return!0}return e!==e&&t!==t}var J9=function(t,n){try{return $g(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 K9=Xn(J9);var Q9=[],zv=function(t,n,r){r===void 0&&(r={});var a=O.useRef(null),o={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||Q9},s=O.useState({styles:{popper:{position:o.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),u=s[0],d=s[1],m=O.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(D){var S=D.state,T=Object.keys(S.elements);w1.flushSync(function(){d({styles:ND(T.map(function(E){return[E,S.styles[E]||{}]})),attributes:ND(T.map(function(E){return[E,S.attributes[E]]}))})})},requires:["computeStyles"]}},[]),p=O.useMemo(function(){var w={onFirstUpdate:o.onFirstUpdate,placement:o.placement,strategy:o.strategy,modifiers:[].concat(o.modifiers,[m,{name:"applyStyles",enabled:!1}])};return K9(a.current,w)?a.current||w:(a.current=w,w)},[o.onFirstUpdate,o.placement,o.strategy,o.modifiers,m]),g=O.useRef();return kD(function(){g.current&&g.current.setOptions(p)},[p]),kD(function(){if(!(t==null||n==null)){var w=r.createPopper||sE,D=w(t,n,p);return g.current=D,function(){D.destroy(),g.current=null}}},[t,n,r.createPopper]),{state:g.current?g.current.state:null,styles:u.styles,attributes:u.attributes,update:g.current?g.current.update:null,forceUpdate:g.current?g.current.forceUpdate:null}},X9=function(){},e5=X9;const t5=Xn(e5),n5=(e,t)=>({placement:e,modifiers:[{name:"flip",options:{allowedAutoPlacements:t,rootBoundary:"document"}},{name:"preventOverflow",options:{rootBoundary:"document"}}]}),r5=e=>{const n=O.useRef(null),[r,a]=O.useState(null),[o,s]=O.useState(0);let u,d;const m=()=>{if(x.Platform.isMobile){u="right-end",d=["bottom"];return}const g=window.innerWidth-o>280*1.2,w=window.innerWidth-o<280,D=window.innerWidth>280*1.5;if(e.DefaultEditorLocation!=="Bottom"){g?(u="right-end",d=["left-end"]):w&&D?(u="left-end",d=["right-end"]):(u="bottom",d=["bottom"]);return}g?(u="top-end",d=["top-start"]):w&&o>280?(u="top-start",d=["top-end"]):(u="top",d=["top"])};O.useEffect(()=>{e&&m()},[o,e==null?void 0:e.DefaultEditorLocation]);const p=zv(n.current,r,n5(u,d));return{setPosX:s,popperRef:n,setPopperElement:a,popper:p}},a5=()=>{const e=new Set,t=We.getState().query.filter,n=We.getState().query.tag,r=tn.getQueryById(t||"");if(r&&r.querystring){const a=JSON.parse(r.querystring);if(Array.isArray(a))for(const o of a)o.type==="TAG"&&o.value&&o.value.operator==="CONTAIN"&&e.add(o.value.value)}return n&&e.add(n),Array.from(e)},o5=e=>{const{offsetLeft:t,offsetTop:n,offsetHeight:r,offsetWidth:a,selectionEnd:o}=e,s=document.createElement("div"),u=window.getComputedStyle(e);for(const T of u)s.style.setProperty(T,u.getPropertyValue(T));s.style.position="fixed",s.style.visibility="hidden",s.style.whiteSpace="pre-wrap";const m=e.tagName==="INPUT"?e.value.replace(/ /g,"."):e.value;s.textContent=m.substring(0,o||0),e.tagName==="TEXTAREA"&&(s.style.height="auto");const p=document.createElement("span");p.textContent=m.substring(o||0)||".",s.appendChild(p),document.body.appendChild(s);const{offsetLeft:g,offsetTop:w,offsetHeight:D,offsetWidth:S}=p;return document.body.removeChild(s),{x:t+g,y:n+w,h:r+D,w:a+S}},Cd=({className:e,editorType:t,destroy:n})=>{const{globalState:r,dailyNotesState:{app:a,settings:o,view:s,verifyState:u}}=O.useContext(wt),[d,m]=_o(!0),p=O.useRef(d),[g,w]=Br(!0),D=O.useRef(null),S=O.useRef(null),T=O.useRef(r),[E,A]=Br(!1),[N,R]=Br(!1),{setPosX:F,popperRef:H,setPopperElement:P,popper:L}=r5(o),[z]=Br(parseInt(x.moment().format("x"))),U=O.useRef(null),[W,K]=Br((o==null?void 0:o.EnabledLocationList.length)===1?o==null?void 0:o.EnabledLocationList[0].value:(o==null?void 0:o.MemoSaveLocation)||"DAILY"),ae=O.useRef(o.MemoSaveLocation||"DAILY");O.useEffect(()=>{p.current=d},[d]),O.useEffect(()=>{!S.current||!a||!s||(s.registerEvent(a.workspace.on("focus-on-textarea",Se=>{var Ue;(Ue=S.current)==null||Ue.focus(Se==null?void 0:Se.id)})),s.registerEvent(a.workspace.on("blur-on-memos",()=>{var Se;(Se=S.current)==null||Se.blur()})),s.registerEvent(a.workspace.on("send-to-thino",async(Se,Ue)=>{var Je,$e;if(typeof Se=="string")(Je=S.current)==null||Je.insertText(Se+`
`,Ue.id);else{const lt=Se.toPNG(),ft=new Blob([lt],{type:"image/png"}),Dt=new File([ft],"image.png",{type:"image/png",lastModified:Date.now()});if(!Dt)return;const Et=await se(Dt);Et&&(($e=S.current)==null||$e.insertText(Et+`
`,Ue.id))}})))},[S,s,a]),O.useEffect(()=>{o&&m(o.DefaultPrefix==="List")},[o==null?void 0:o.DefaultPrefix]),O.useEffect(()=>{if(o){if(o.EnabledLocationList.length===1){K(o.EnabledLocationList[0].value);return}K(o.MemoSaveLocation||"DAILY")}},[o==null?void 0:o.MemoSaveLocation,o==null?void 0:o.EnabledLocationList]),O.useEffect(()=>{var Je;if(!o||!U.current)return;const Se=(Je=Md.find($e=>$e.title===W))==null?void 0:Je.icon;x.setIcon(U.current,Se),x.requireApiVersion("1.4.4")&&x.setTooltip(U.current,k("Thino Save To: ")+W),ae.current=W;const Ue=r.manifest;if(Ue){const $e=a==null?void 0:a.plugins.getPlugin(Ue.id);if($e){if($e.settings.MemoSaveLocation===W)return;$e.settings.MemoSaveLocation=W,$e.saveSettings()}}},[W,g]),O.useEffect(()=>{S.current&&o.MemoSaveLocation&&K(o.MemoSaveLocation)},[U,o]),O.useEffect(()=>{if(!S.current||!o||x.Platform.isDesktop||r.globalEditorShown)return;const Se=x.Platform.isMobile===!0,Ue=o.UseButtonToShowEditor&&o.DefaultEditorLocation==="Bottom";if(x.Platform.isDesktop){w(!0);return}if(w(Se&&!Ue),t&&t==="inline")return;const Je=document.body.find(".memolist-wrapper");Je&&(Je.onscroll=()=>{if(r.globalEditorShown)return;const $e=S.current.getContent();Se&&Ue&&!$e&&w(!1)})},[r.globalEditorShown,S,o==null?void 0:o.UseButtonToShowEditor,o==null?void 0:o.DefaultEditorLocation]);const ce=()=>{R(!1)};O.useEffect(()=>{var Se,Ue,Je,$e,lt,ft,Dt,Et;if(r.markMemoId){const $t=`${k("MARK")}: [@THINO](${r.markMemoId})`;(Se=S.current)==null||Se.insertText($t),(Ue=S.current)==null||Ue.focus(),Qe.setMarkMemoId("");return}if((Je=r.editMemoId)!=null&&Je.trim()&&r.editMemoId!==T.current.editMemoId){const $t=Ie.getMemoById(r.editMemoId);if($t)switch(o.EditorType){case"memos":($e=S.current)==null||$e.setContent($t.content.replace(/ \^\S{6}$/,"")||""),(lt=S.current)==null||lt.focus();break;case"obsidian":(ft=S.current)==null||ft.clear(),(Dt=S.current)==null||Dt.setContent($t.content.replace(/ \^\S{6}$/,"")||""),(Et=S.current)==null||Et.focus();break}}T.current=r},[r.markMemoId,r.editMemoId]),O.useEffect(()=>{var Se,Ue,Je;!S.current||E||o.EditorType==="memos"&&((Se=S.current)==null||Se.element.addEventListener("paste",fe),(Ue=S.current)==null||Ue.element.addEventListener("drop",ie),(Je=S.current)==null||Je.element.addEventListener("click",ge),A(!0))},[S.current]);const fe=async Se=>{var Ue;if(Se.clipboardData&&Se.clipboardData.files.length>0){Se.preventDefault();const Je=Se.clipboardData.files;for(const $e of Je){const lt=await se($e);lt&&((Ue=S.current)==null||Ue.insertText(lt))}}},ie=async Se=>{var Ue;if(Se.dataTransfer&&Se.dataTransfer.files.length>0){Se.preventDefault();const Je=Se.dataTransfer.files;for(const $e of Je){const lt=await se($e);lt&&((Ue=S.current)==null||Ue.insertText(lt))}}},ge=()=>{var Se;$(((Se=S.current)==null?void 0:Se.element.value)||"")},Te=async(Se,Ue)=>{var lt,ft,Dt;const Je=Se.ctrlKey||Se.metaKey,$e=Se.altKey;if(Se.key==="Escape"&&r.globalEditorShown&&(Qe.setGlobalEditorShown(!1),Se.preventDefault()),Je&&Se.key==="Enter"){Se.preventDefault(),Se.stopPropagation(),Ue?(await we((ft=S.current)==null?void 0:ft.getContent()),(Dt=S.current)==null||Dt.clear()):await we((lt=S.current)==null?void 0:lt.element.value);return}if($e)for(let Et=0;Et<o.EnabledLocationList.length;Et++)Se.key===(Et+1).toString()&&K(o.EnabledLocationList[Et].value);setTimeout(()=>{var Et;Ue||$(((Et=S.current)==null?void 0:Et.element.value)||"")})},se=O.useCallback(async Se=>{const{type:Ue}=Se;if(Ue.startsWith("image"))try{return`${await y1.upload(Se)}`}catch(Je){new x.Notice(Je)}},[]),we=async Se=>{if(!Se||Se.trim()===""){new x.Notice(k("Content cannot be empty"));return}const Ue=rt.getState().settings,Je=Ue==null?void 0:Ue.addTagAutomatically,$e=Ue==null?void 0:Ue.addTagWithNewline,lt=Ue==null?void 0:Ue.addTagPosition,Dt=(a5()||[]).filter(At=>!Se.includes(`#${At}`)),Et=async(At,an)=>{an=an.replaceAll("&nbsp;"," "),Mg("");try{if(!At){let In;switch(ae.current){case"CANVAS":In=await Ie.createMemoCanvas({text:an,isList:p.current});break;case"MULTI":In=await Ie.createMemoMultiFile({content:an,isList:p.current});break;case"DAILY":In=await Ie.createMemoDaily(an,p.current);break;case"FILE":In=await Ie.createMemoSingleFile({content:an,isList:p.current});break}if(!In)return;Ie.pushMemo(In),(!Je||Dt.length===0)&&We.clearQuery();const vr=a||rt.getState().app,Sa=vr==null?void 0:vr.loadLocalStorage("tokenForSync");In&&Sa&&o.startSync&&setTimeout(async()=>{const Mr=await kT({content:an,thinoType:ae.current==="DAILY"?"DAILY":"FILE"});await Ie.updateMemoById(In.id,Mr,!0)},200);return}const Sn=Ie.getMemoById(At);if(Sn&&Sn.content!==an){const In=await Ie.updateMemo(Sn.id,an,p.current?"JOURNAL":"TASK-TODO");In.updatedAt=Re.getDateTimeString(Date.now()),Ie.editMemo(In)}Qe.setEditMemoId("")}catch(Sn){new x.Notice(Sn.message)}},{editMemoId:$t}=Qe.getState(),rn=Dt&&Dt.length>0&&Je?lt==="Beginning"?`${Dt.map(At=>`#${At}`).join(" ")} ${$e?`
`:""}${Se}`:`${Se} ${$e?`
`:""}${Dt.map(At=>`#${At}`).join(" ")}`:Se;await Et($t,rn),n&&n(),Mg("")},Z=O.useCallback(()=>{var Se;Qe.setEditMemoId(""),(Se=S.current)==null||Se.setContent(""),Mg("")},[]),$=O.useCallback(Se=>{if(Mg(Se??""),!S.current)return;const Ue=S.current.getContent(),Je=S.current.element.selectionStart,$e=Ue.slice(0,Je),lt=Ue.slice(Je);($e.endsWith("@")||$e.endsWith("📆"))&&lt.startsWith(" ")||($e.endsWith("@")||$e.endsWith("📆"))&&lt===""?(Be(),R(!0)):R(!1),setTimeout(()=>{var ft;(ft=S.current)==null||ft.focus()})},[o.EditorType]),X=Se=>{if(!S.current||!o)return;Se&&(ce(),m(!1));const Ue=S.current.getContent(),Je=S.current.element.selectionStart,$e=Ue.slice(0,Je),lt=Ue.slice(Je),ft=x.moment(Se);if($e.endsWith("@"))switch(o.InsertDateFormat){case"Dataview":S.current.element.value=Ue.slice(0,S.current.element.selectionStart-1)+"[due::"+ft.format("YYYY-MM-DD")+"]"+lt,S.current.element.setSelectionRange(Je+17,Je+17),S.current.focus(),$(S.current.element.value);break;case"Tasks":S.current.element.value=Ue.slice(0,S.current.element.selectionStart-1)+"📆"+ft.format("YYYY-MM-DD")+lt,S.current.element.setSelectionRange(Je+11,Je+11),S.current.focus(),$(S.current.element.value)}else{S.current.element.value=$e+ft.format("YYYY-MM-DD")+lt,S.current.element.setSelectionRange(Je+10,Je+10),S.current.focus(),$(S.current.element.value);return}},ve=()=>{S.current&&m()},De=async()=>{var Je;const Se=!x.Platform.isDesktop&&await((Je=window.Capacitor)==null?void 0:Je.Plugins.Device.getId()),Ue=x.Platform.isDesktop?await zn():Se.identifier||Se.uuid;return!u||(u==null?void 0:u.appId)!==Ue?(fn(),!1):!0},be=async Se=>{if(!await De())return;const Ue=new x.Menu;o.EnabledLocationList.forEach(ft=>{Ue.addItem(Dt=>{var Et;Dt.setTitle(ft.value).setIcon(((Et=Md.find($t=>$t.title===ft.value))==null?void 0:Et.icon)??"file").setChecked(W===ft.value).onClick(()=>{K(ft.value)})})});let Je=Se.target,$e=null;for(;!Je.hasClass("location-wrapper")&&($e=Je.parentElement,$e);)Je=$e;const lt=Je.getBoundingClientRect();setTimeout(()=>{Ue.showAtPosition({x:lt.x,y:lt.bottom,width:lt.width,left:!1,overlap:!0})},200)},ke=O.useCallback(()=>{var Se,Ue;if(!(!S.current&&o.EditorType==="memos"))switch(o.EditorType){case"obsidian":(Se=S.current)==null||Se.focus(),(Ue=a==null?void 0:a.commands)==null||Ue.executeCommandById("editor:insert-tag");break;case"memos":{const Je=S.current.getContent(),$e=S.current.element.selectionStart,lt=Je.slice(0,$e),ft=Je.slice($e);let Dt=lt+"# "+ft,Et=lt.length+1;lt.endsWith("#")&&ft.startsWith(" ")&&(Dt=lt.slice(0,lt.length-1)+ft.slice(1),Et=lt.length-1),S.current.element.value=Dt,S.current.element.setSelectionRange(Et,Et),S.current.focus();const $t=new Event("input",{bubbles:!0,cancelable:!0});S.current.element.dispatchEvent($t),$(S.current.element.value)}}},[a]),Be=O.useCallback(()=>{if(!S.current||!H.current||!o||!a)return;const Je=a.workspace.getLeavesOfType(Hr)[0].view.containerEl,$e=280,lt=Je.clientWidth,{x:ft,y:Dt}=o5(S.current.element);let Et,$t;x.Platform.isMobile?(window.innerWidth-ft>$e?Et=(ft+$e+16>lt,ft+18):window.innerWidth-ft<$e?Et=(ft+$e+16>lt,ft+34):Et=S.current.element.clientWidth/2,o.DefaultEditorLocation==="Bottom"&&window.innerWidth>875?$t=Dt+4:o.DefaultEditorLocation==="Bottom"&&window.innerWidth<=875?$t=Dt+19:o.DefaultEditorLocation==="Top"&&window.innerWidth<=875&&($t=Dt+36)):(Et=(ft+$e+16>lt,ft+18),$t=Dt+34),F(ft),H.current.style.left=`${Et}px`,H.current.style.top=`${$t}px`},[o,a]),_e=O.useCallback(()=>{const Se=document.createElement("input");document.body.appendChild(Se),Se.type="file",Se.multiple=!1,Se.accept="image/png, image/gif, image/jpeg",Se.onchange=async()=>{var $e;if(!Se.files||Se.files.length===0)return;const Ue=Se.files[0],Je=await se(Ue);Je&&(($e=S.current)==null||$e.insertText(Je)),document.body.removeChild(Se)},Se.click()},[]),it=!!r.editMemoId,Vt=O.useMemo(()=>({className:"memo-editor",inputerType:o.EditorType||"obsidian",initialContent:i5(),placeholder:k("What do you think now..."),showConfirmBtn:!0,showCancelBtn:it,showTools:!0,onConfirmBtnClick:we,onCancelBtnClick:Z,onContentChange:$}),[it,o.EditorType]);return y.jsxs(y.Fragment,{children:[!r.globalEditorShown&&t==="block"&&y.jsx("div",{ref:Se=>{D.current=Se,Se&&x.setIcon&&x.setIcon(Se,"plus-circle")},className:`memo-show-editor-button ${g?"hidden":""}`,onClick:()=>{var Se;(Se=D.current.firstElementChild)==null||Se.toggleClass("rotate-hidden",!0),setTimeout(()=>{w(!0),D.current.firstElementChild.toggleClass("rotate-hidden",!1)},500),setTimeout(()=>{var Ue;(Ue=S.current)==null||Ue.focus()},600)}}),y.jsxs("div",{className:`memo-editor-wrapper ${e||""} ${it?"edit-ing":""} ${r.globalEditorShown?"fullscreen-editor":""} ${g?"":"hidden"}`,onKeyDownCapture:Se=>Te(Se,!0),children:[y.jsx("span",{className:`tip-text ${it?"":"hidden"}`,children:"Modifying..."}),y.jsx(W8,{ref:S,...Vt,tools:y.jsxs(y.Fragment,{children:[y.jsx("span",{ref:Se=>{Se&&x.setIcon(Se,"hash")},className:"btn action-btn add-tag",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&ke()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&ke()}}),y.jsx("span",{ref:Se=>{Se&&x.setIcon(Se,"paperclip")},className:"btn action-btn file-upload",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&_e()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&_e()}}),y.jsx("span",{ref:Se=>{Se&&x.setIcon(Se,d?"layout-list":"check-square")},className:mr("btn action-btn list-or-task",d?"list":"task"),onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&ve()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&ve()}}),y.jsx("div",{ref:Se=>{Se&&(x.setIcon&&x.setIcon(Se,r.globalEditorShown?"shrink":"expand"),x.setTooltip&&x.setTooltip(Se,r.globalEditorShown?k("Exit fullscreen mode"):k("Enter fullscreen mode")))},className:"action-btn show-editor pro",onPointerDown:async()=>{await De()&&(w(!0),Qe.setGlobalEditorShown(!r.globalEditorShown))}}),y.jsx("div",{className:"action-btn split-line pro"}),y.jsx("div",{className:"action-btn location-wrapper pro",onClick:async Se=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&await be(Se)},onPointerDown:async Se=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&await be(Se)},children:y.jsx("div",{ref:U,className:"action-btn file-location-btn"})})]})}),y.jsx("div",{ref:H,className:"date-picker",children:N&&y.jsx("div",{tabIndex:-1,style:L.styles.popper,...L.attributes.popper,ref:P,role:"dialog",children:y.jsx(Nm,{className:`editor-date-picker ${N?"":"hidden"}`,datestamp:z,handleDateStampChange:X})})})]})]})};function i5(){return Kn.get(["thinoEditorContentCache"]).thinoEditorContentCache??""}function Mg(e){Kn.set({thinoEditorContentCache:e})}const s5=e=>{const t=[];return e.map(n=>{t.length==0?t.push({date:x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]}):t.some(a=>{if(a.date==x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"))return a.have.push(n),!0})||t.push({date:x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]})}),t},l5=e=>Ie.getState().commentMemos.filter(t=>t.linkId===e.hasId).sort((t,n)=>Re.getTimeStampByDate(t.createdAt)-Re.getTimeStampByDate(n.createdAt)).map(t=>({...t,createdAtStr:Re.getDateTimeString(t.createdAt),dateStr:Re.getDateString(t.createdAt)})),c5=e=>{const t=rt.getState().settings,n=hN(),r=t!=null&&t.ShowDate?" ":"",a="YYYY/MM/DD HH:mm:ss",o=/comment:(.*)$/g,s=/^\d{14}/g,u=(g,w,D)=>{const S=x.moment(g.createdAt,a).format("HH:mm");return D?D.replace(/{TIME}/g,S).replace(/{CONTENT}/g,w):`${S} ${w}`},d=g=>{const w=g.match(/TASK-(.*)?/g);return w?w[1]:""},m=g=>g==="TASK-TODO"?"- [ ] ":g==="TASK-DONE"?"- [x] ":g.match(/TASK-(.*)?/g)?`- [${d(g)}] `:"- ",p=g=>g.reduce((w,D)=>{const S=D.sourceType!=="MULTI"?`${D.content}`:`[[${D.path}]]`,T=t!=null&&t.ShowTime?u(D,S,t==null?void 0:t.DefaultMemoComposition):S,E=`${m(D.thinoType)}${T}`;let A="";return t.CommentOnMemos&&D.hasId!==void 0&&D.hasId!==""&&(A=l5(D).reduce((R,F)=>{const H=m(F.thinoType),P=F.content.replace(o,"").replace(s,""),L=t!=null&&t.ShowDate?`${H}[[${x.moment(F.createdAt).format(n)}]] ${x.moment(F.createdAt).format("HH:mm")} ${P}`:`${H}${P}`;return R+r+" "+L+`
`},"")),w+r+E.replace(/ \^\S{6}/g,"")+`
`+A},"");return e.reduce((g,w)=>{const D=t!=null&&t.ShowDate?`- [[${x.moment(w.date,"YYYY-MM-DD").format(n)}]]
`:"",S=p(w.have),T=t!=null&&t.ShowDate&&(t!=null&&t.AddBlankLineWhenDate)&&!(t!=null&&t.CommentOnMemos)?`
`:"";return g+D+S+T},"").replace(/<br>/g,`
`)},u5=[{label:k("Today"),value:x.moment().format("YYYY-MM-DD")},{label:k("Yesterday"),value:x.moment().subtract(1,"days").format("YYYY-MM-DD")},{label:k("Last 7 days"),value:x.moment().subtract(7,"days").format("YYYY-MM-DD")},{label:k("Last 30 days"),value:x.moment().subtract(30,"days").format("YYYY-MM-DD")},{label:k("Last 90 days"),value:x.moment().subtract(90,"days").format("YYYY-MM-DD")},{label:k("Last 180 days"),value:x.moment().subtract(180,"days").format("YYYY-MM-DD")},{label:k("Last 365 days"),value:x.moment().subtract(365,"days").format("YYYY-MM-DD")}],lE=e=>{const{handleValueChange:t,setShownStatus:n}=e;return y.jsxs(y.Fragment,{children:[e.type==="icon"&&y.jsx("div",{className:"quick-date-btn-group",children:u5.map((r,a)=>y.jsx("div",{className:"btn action-btn quick-date-btn",onClick:()=>{t(r.value),n&&n(!1)},children:r.label},a))}),y.jsx(Nm,{className:"calendar-date-picker",datestamp:(e==null?void 0:e.defaultValue)||x.moment().startOf("day").valueOf(),handleDateStampChange:(r,a)=>{t(e.type==="icon"?x.moment(r).format("YYYY-MM-DD"):r.toString()),n&&n(!1)}})]})},dv=e=>{const{handleValueChange:t}=e,[n,r]=q.useState(!1),a=q.useRef(null),o=q.useRef(null),s=zv(o.current,a.current,{placement:"bottom-start"});return Mm(a,()=>{r(!1)}),y.jsxs(y.Fragment,{children:[y.jsx("span",{ref:d=>{o.current=d,d&&e.type==="icon"&&x.setIcon(d,"calendar")},className:`btn calendar-btn ${e.type==="icon"?"icon-btn":"text-btn"}`,onClick:()=>{!x.Platform.isMobile&&r(!n),!x.Platform.isMobile&&(s!=null&&s.update)&&(s==null||s.update()),x.Platform.isMobile&&new cE(rt.getState().app,e.type,t).open()},children:e.type==="text"&&e.defaultValue?e.defaultText?e.defaultText:x.moment(e.defaultValue,"x").subtract(e.startOrEnd==="end"?1:0,"days").format("YYYY/MM/DD"):""}),y.jsx("div",{className:`menu-btns-popup ${n?"":"hidden"}`,ref:a,style:s.styles.popper,children:y.jsx(lE,{type:e.defaultText?"icon":e.type,handleValueChange:t,setShownStatus:r})})]})};class cE extends x.Modal{constructor(n,r,a){super(n);he(this,"root");he(this,"type");he(this,"handleValueChange");this.type=r,this.handleValueChange=a}onOpen(){const{contentEl:n}=this;this.root=Lv(n),this.root.render(y.jsx(lE,{type:this.type,handleValueChange:this.handleValueChange.bind(this),setShownStatus:r=>{!r&&this.close()}}))}onClose(){var n;(n=this.root)==null||n.unmount()}}const d5=(e,t)=>(e%t+t)%t;class f5{constructor(t,n,r){he(this,"owner");he(this,"values");he(this,"suggestions");he(this,"selectedItem");he(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",a=>{if(!a.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",a=>{if(!a.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",a=>{if(!a.isComposing)return this.useSelectedItem(a),!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 a=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,a),n.push(a)}),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=d5(t,this.suggestions.length),a=this.suggestions[this.selectedItem],o=this.suggestions[r];a==null||a.removeClass("is-selected"),o==null||o.addClass("is-selected"),this.selectedItem=r,n&&o.scrollIntoView(!1)}}class uE{constructor(t,n){he(this,"inputEl");he(this,"popper");he(this,"scope");he(this,"suggestEl");he(this,"suggest");he(this,"cb");this.inputEl=t,this.scope=new x.Scope,this.cb=n,this.suggestEl=createDiv("suggestion-container");const r=this.suggestEl.createDiv("suggestion");this.suggest=new f5(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("click",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",a=>{a.preventDefault()})}clearInput(){this.inputEl.value="",this.inputEl.trigger("blur"),this.inputEl.trigger("focus"),this.inputEl.trigger("input"),this.onInputChanged()}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=sE(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:a})=>{const o=`${r.rects.reference.width}px`;r.styles.popper.width!==o&&(r.styles.popper.width=o,a.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()}updateCb(t){this.cb=t}}const h5=e=>{const t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())};let dE=class extends uE{fuzzySearchItemsOptimized(t,n){const r=x.prepareFuzzySearch(t);return n.map(a=>{const o=r(a);return o?{item:a,match:o,score:o.score}:null}).sort((a,o)=>(o==null?void 0:o.score)-(a==null?void 0:a.score)).filter(Boolean)}getSuggestions(t){const{settings:n,app:r}=rt.getState(),a=t.toLocaleLowerCase(),o=n.UseVaultTags?h5(r):Ie.getState().tags;return this.fuzzySearchItemsOptimized(a,o).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()}};const m5=e=>{const t=new Set;return e.forEach(n=>{const r=new RegExp(An).exec(n.content),a=new RegExp($n).exec(n.content);if(r)for(let o=1;o<r.length;o++)t.add(r[o]);if(a)for(let o=1;o<a.length;o++)t.add(a[o])}),Array.from(t)},p5=({app:e,thinos:t,closeDialog:n})=>{const[r,a]=q.useState([]),[o,s]=q.useState([]),[u,d]=q.useState([]),m=q.useRef(null),p=q.useRef(null),g=q.useRef(null),w=q.useRef("End"),D=q.useRef(!1),S=q.useRef(null);O.useEffect(()=>{t&&t.length&&a(m5(t))},[t]),O.useEffect(()=>{!g.current||!p.current||(new x.Setting(p.current).setName(k("Add tag position")).addDropdown(N=>{N.addOption("End",k("End")),N.addOption("Beginning",k("Beginning")),N.setValue("End").onChange(async R=>{w.current=R})}),new x.Setting(g.current).setName(k("Add tag with new line")).addToggle(N=>{N.setValue(!1).onChange(async R=>{D.current=R})}))},[]);const T=N=>{if(!N)return;const R=new Set(o);R.add(N),s(Array.from(R)),m.current.clearInput()};O.useEffect(()=>{if(S.current){if(m.current){m.current.updateCb(T);return}m.current=new dE(S.current,T)}},[S.current,o]);const E=()=>{n(),A({remove:u,add:o,targetThinos:t})},A=async({remove:N,add:R,targetThinos:F})=>{const H=D.current||!1,P=[];for(const L of F){let z=L.content;for(const U of N)z=z.replace(new RegExp(`#${U}`,"g"),"");if(z=z.trim(),R.length>0&&(z=w.current==="Beginning"?`${R.map(U=>`#${U}`).join(" ")} ${H?`
`:""}${z}`:`${z} ${H?`
`:""}${R.map(U=>`#${U}`).join(" ")}`),L&&L.content!==z){const U=await Ie.updateMemo(L.id,z==null?void 0:z.trim());P.push(U)}}P.length>0&&Ie.editMemoBulk(P),P.length>0&&We.clearQuery()};return y.jsxs("div",{className:"thino-tag-operation",children:[y.jsx("div",{className:"tag-operation-title",children:k("Tag Bulk Edit")}),y.jsxs("div",{className:"tag-operation-content",children:[y.jsxs("div",{className:"tag-operation-content-title exist-tags",children:[y.jsx("div",{className:"name",children:k("Exist Tags")}),y.jsx("div",{className:"desc",children:k("Click to remove exist tag")})]}),y.jsx("div",{className:"tag-operation-content-tags exist-tags",children:r.map(N=>y.jsx("div",{className:mr("tag-operation-content-tag",u.includes(N)&&"tag-operation-content-tag-removed"),onClick:()=>{u.includes(N)||d([...u,N]),u.includes(N)&&d(u.filter(R=>R!==N)),o.includes(N)&&s(o.filter(R=>R!==N))},children:N},N))}),y.jsxs("div",{className:"tag-operation-content-title selected-tags",children:[y.jsx("div",{className:"name",children:k("Selected Tags")}),y.jsx("div",{className:"desc",children:k("Click to remove selected tag")})]}),y.jsx("div",{className:"tag-operation-content-tags selected-tags",children:o.map(N=>y.jsx("div",{className:"tag-operation-content-tag",onClick:()=>{s(o.filter(R=>R!==N))},children:N},N))}),y.jsx("div",{className:"tag-operation-content-inputer",children:y.jsx("input",{placeholder:k("Input to select exist tag"),ref:S})}),y.jsxs("div",{className:"tag-operation-settings",children:[y.jsx("div",{ref:p}),y.jsx("div",{ref:g})]}),y.jsxs("div",{className:"tag-operation-content-btn-group",children:[y.jsx("button",{className:"cancel-btn",onClick:n,children:k("Cancel")}),y.jsx("button",{className:"save-btn",onClick:E,children:k("Save")})]})]})]})},vd=async()=>{var r;const{verifyState:e}=rt.getState(),t=!x.Platform.isDesktop&&await((r=window.Capacitor)==null?void 0:r.Plugins.Device.getId()),n=x.Platform.isDesktop?await zn():t.identifier||t.uuid;return e&&(e==null?void 0:e.appId)===n};class yd extends x.Modal{constructor(t,n,r){super(t),this.title=n,this.cb=r}onOpen(){super.onOpen(),this.containerEl.toggleClass("thino-bulk-action-dialog",!0),this.titleEl.setText(this.title+k("Confirm?")),this.contentEl.createEl("button",{text:k("Confirm?").replace(/\?|/,"")}).onclick=()=>{this.cb("confirm"),this.close()},this.contentEl.createEl("button",{text:k("Cancel")}).onclick=()=>{this.cb("cancel"),this.close()}}onClose(){super.onClose()}}class g5 extends x.Modal{constructor(n,r){super(n);he(this,"root");this.thinos=r}onOpen(){super.onOpen(),this.containerEl.toggleClass(["thino-bulk-action-dialog","tag-actions"],!0),this.root=hs.createRoot(this.contentEl),this.root.render(y.jsx(Sl,{store:Ee,context:wt,children:y.jsx(p5,{app:this.app,closeDialog:this.close.bind(this),thinos:this.thinos})}))}onClose(){var n;super.onClose(),(n=this.root)==null||n.unmount()}}const Om=({thinosCount:e,thinos:t})=>{const{locationState:{query:n,pathname:r},dailyNotesState:{settings:a,app:o}}=O.useContext(wt),{tag:s,duration:u,type:d,text:m,filter:p}=n,g=tn.getQueryById(p),w=!!(s||u&&u.from<u.to||d||m||g),D=O.useRef(null);O.useEffect(()=>{D&&x.setIcon(D.current,"more-horizontal")},[D]);const S=async()=>{if(!((t==null?void 0:t.length)>0))return;const P=s5(t),L=c5(P);await Re.copyTextToClipboard(L),new x.Notice(k("Copied to clipboard Successfully"))},T=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await vd()){fn();return}const P=[...t],L=a.DeleteThinoDirectly;try{for(const z of P)if(L)await Ie.deleteMemoById(z.id);else{const U=await Ie.hideMemoById(z.id);U&&Ie.editMemo(U)}We.clearQuery()}catch(z){console.error("error",z),new x.Notice(z.message)}},E=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await vd()){fn();return}const P=[...t];try{for(const L of P)await Ie.deleteMemoById(L.id);We.clearQuery(),new x.Notice(k("DELETE SUCCEED"))}catch(L){console.error("error",L),new x.Notice(L.message)}},A=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await vd()){fn();return}const P=[...t];try{const L=await Ie.unarchiveThinoBulk(P);for(const z of L)z&&Ie.editMemo(z);new x.Notice(k("RESTORE SUCCEED")),We.clearQuery()}catch(L){console.error("error",L),new x.Notice(L.message)}},N=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await vd()){fn();return}const P=[...t],L=rt.getState().settings.startSync;try{for(const z of P){const U=await Ie.restoreMemoById(z.id),W=rt.getState().app,K=W==null?void 0:W.loadLocalStorage("tokenForSync");U&&U.webId&&K&&L&&await AT(U.webId),U&&Ie.editMemo(U)}We.clearQuery(),new x.Notice(k("RESTORE SUCCEED"))}catch(z){new x.Notice(z.message)}},R=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await vd()){fn();return}const P=[...t];try{const L=await Ie.archiveThinoBulk(P);for(const z of L)z&&Ie.editMemo(z);We.clearQuery()}catch(L){console.error("error",L),new x.Notice(L.message)}},F=async()=>{if((t==null?void 0:t.length)>0){if(!await vd()){fn();return}new g5(o,t).open()}},H=P=>{const L=new x.Menu;switch(L.addItem(z=>{z.setTitle(k("Copy filtered thinos")).setIcon("copy").onClick(async()=>{await S()})}),L.addSeparator(),r){case"/":L.addItem(z=>{z.setTitle(k("Bulk tag operation")).setIcon("hash").onClick(async()=>{await F()})}).addItem(z=>{z.setTitle(k("Bulk archive")).setIcon("archive").onClick(async()=>{new yd(o,k("ARCHIVE"),async U=>{U==="confirm"&&await R()}).open()})}).addItem(z=>{z.setTitle(k("Bulk delete")).setIcon("trash").onClick(async()=>{new yd(o,k("DELETE"),async U=>{U==="confirm"&&await T()}).open()})});break;case"/archive":L.addItem(z=>{z.setTitle(k("Bulk restore")).setIcon("archive").onClick(async()=>{new yd(o,k("RESTORE"),async U=>{U==="confirm"&&await A()}).open()})}).addItem(z=>{z.setTitle(k("Bulk delete")).setIcon("trash").onClick(async()=>{new yd(o,k("DELETE"),async U=>{U==="confirm"&&await T()}).open()})});break;case"/recycle":L.addItem(z=>{z.setTitle(k("Bulk restore")).setIcon("archive-restore").onClick(async()=>{new yd(o,k("RESTORE"),async U=>{U==="confirm"&&await N()}).open()})}).addItem(z=>{z.setTitle(k("Bulk delete")).setIcon("trash").onClick(async()=>{new yd(o,k("DELETE"),async U=>{U==="confirm"&&await E()}).open()})});break}L.showAtMouseEvent(P.nativeEvent)};return y.jsxs("div",{className:`filter-query-container ${w?"":"hidden"}`,children:[y.jsxs("div",{className:"filter-query",children:[y.jsx("span",{className:"tip-text",children:k("FILTER")}),y.jsxs("div",{className:"filter-item-container "+(g?"":"hidden"),onClick:()=>{We.setMemoFilter("")},children:[y.jsx("span",{className:"icon-text",children:"🔖"})," ",g==null?void 0:g.title]}),y.jsxs("div",{className:"filter-item-container "+(s?"":"hidden"),onClick:()=>{We.setTagQuery("")},children:[y.jsx("span",{className:"icon-text",children:"🏷️"})," ",s]}),y.jsxs("div",{className:"filter-item-container "+(d?"":"hidden"),onClick:()=>{We.setMemoTypeQuery("")},children:[y.jsx("span",{className:"icon-text",children:"📦"})," ",n8(d)]}),u&&u.from<u.to&&y.jsxs("div",{className:"filter-item-container",children:[y.jsxs("div",{className:"day-picker-component-group",children:[y.jsx("span",{className:"icon-text",children:"🗓️"})," ",y.jsx(dv,{type:"text",startOrEnd:"start",defaultValue:x.moment(u.from,"x").valueOf(),handleValueChange:P=>{const L=x.moment(u.to,"x"),z=x.moment(P,"x"),U=z.isAfter(L)||z.isSame(L);We.setFromAndToQuery(U?L.startOf("day").valueOf():x.moment(P,"x").startOf("day").valueOf(),u.to)}}),y.jsx("span",{children:k("to")}),y.jsx(dv,{type:"text",startOrEnd:"end",defaultValue:x.moment(u.to,"x").add(1,"days").valueOf(),handleValueChange:P=>{const L=x.moment(u.from,"x"),z=x.moment(P,"x"),U=z.isBefore(L)||z.isSame(L),W=x.moment(P,"x").endOf("day").valueOf();We.setFromAndToQuery(u.from,U?L.endOf("day").valueOf():W)}})]}),y.jsx("div",{ref:P=>P&&x.setIcon(P,"x"),className:"btn close-btn",onClick:()=>{We.setFromAndToQuery(0,0)}})]}),y.jsxs("div",{className:"filter-item-container "+(m?"":"hidden"),onClick:()=>{We.setTextQuery("")},children:[y.jsx("span",{className:"icon-text",children:"🔍"})," ",m]})]}),y.jsxs("div",{className:"thino-filter-items",children:[e&&y.jsx("div",{className:"thinos-count",children:`${e?`${e} Thinos `:""}`}),y.jsx("div",{ref:D,className:"btn memo-action-menu",onClick:H})]})]})},v5=e=>{const{dailyNotesState:{app:t,view:n}}=O.useContext(wt),{memo:r,handleMemoContentClick:a,handleMemoDoubleClick:o}=e,s=q.useRef(null),[u,d]=q.useState("");return O.useEffect(()=>{if(!s.current||s.current.hasChildNodes()&&r.content===u||!n||!t)return;d(r.content),s.current.hasChildNodes()&&s.current.empty(),(async()=>{var g,w;await x.MarkdownRenderer.render(t,r.content+`
`,s.current,r.path,n),(g=s.current)==null||g.toggleClass(["markdown-rendered"],!0);const p=(w=s.current)==null?void 0:w.querySelectorAll(".internal-link");p==null||p.forEach(D=>{const S=D,T=S.getAttribute("data-href");if(!T)return;t.metadataCache.getFirstLinkpathDest(T,r.path)||D.classList.add("is-unresolved"),S.addEventListener("mouseover",A=>{A.stopPropagation(),t.workspace.trigger("hover-link",{event:A,source:"thino",hoverParent:n.containerEl,targetEl:S,linktext:T,sourcePath:S.href})})})})()},[r.content,n,t]),y.jsx("div",{ref:s,className:"memo-content-text",onClick:m=>a(m,r),onDoubleClick:o,onContextMenu:m=>{m.preventDefault()}})},fE=O.memo(v5),y5=e=>{const[t,n]=O.useState({...e.memo,createdAtStr:Re.getDateTimeString(e.memo.createdAt)}),[r,a]=O.useState([]),[o,s]=O.useState([]);O.useEffect(()=>{(async()=>{try{const g=[],w=[...t.content.matchAll(Il)];for(const S of w)if(S&&S.length===3){const T=S[2],E=Ie.getMemoById(T);E&&g.push({...E,createdAtStr:Re.getDateTimeString(E.createdAt),dateStr:Re.getDateString(E.createdAt)})}a([...g]);const D=await Ie.getLinkedMemos(t.id);s(D.sort((S,T)=>Re.getTimeStampByDate(T.createdAt)-Re.getTimeStampByDate(S.createdAt)).map(S=>({...S,createdAtStr:Re.getDateTimeString(S.createdAt),dateStr:Re.getDateString(S.createdAt)})))}catch(g){console.error(g)}})()},[t.id]);const u=O.useCallback(async p=>{var w;const g=p.target;if(g.className==="memo-link-text"){const D=(w=g.dataset)==null?void 0:w.value,S=Ie.getMemoById(D??"");if(S){const T={...S,createdAtStr:Re.getDateTimeString(S.createdAt)};a([]),s([]),n(T)}else new x.Notice(k("Thino not found")),g.classList.remove("memo-link-text")}},[]),d=O.useCallback(p=>{a([]),s([]),n({...p,createdAtStr:Re.getDateTimeString(p.createdAt)})},[t.id]),m=O.useCallback(()=>{e.destroy(),Qe.setEditMemoId(t.id)},[t.id]);return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"memo-card-container",children:[y.jsxs("div",{className:"header-container",children:[y.jsx("span",{className:"time-text",children:t.createdAtStr}),y.jsxs("div",{className:"btns-container",children:[y.jsx("button",{ref:p=>{p&&x.setIcon(p,"edit")},className:"btn edit-btn",onClick:m}),y.jsx("button",{ref:p=>{p&&x.setIcon(p,"x")},className:"btn close-btn",onClick:e.destroy})]})]}),y.jsx("div",{className:"memo-container",children:y.jsx("div",{className:"memo-content-text",children:y.jsx(fE,{memo:t,handleMemoContentClick:u,handleMemoDoubleClick:()=>{}})})}),y.jsx("div",{className:"layer-container"})]}),r.length>0?y.jsxs("div",{className:"linked-memos-wrapper",children:[y.jsxs("span",{className:"normal-text",children:[k("LINKED")," ",r.length," THINO"," "]}),r.map(p=>{const g=_b(hw(p.content)).replaceAll(`
`," ");return y.jsxs("div",{className:"linked-memo-container",onClick:()=>d(p),children:[y.jsxs("span",{className:"time-text",children:[p.dateStr," "]}),g]},p.id)})]}):null,o.length>0?y.jsxs("div",{className:"linked-memos-wrapper",children:[y.jsxs("span",{className:"normal-text",children:[o.length," THINO ",k("LINK TO THE")," THINO"]}),o.map(p=>{const g=_b(hw(p.content)).replaceAll(`
`," ");return y.jsxs("div",{className:"linked-memo-container",onClick:()=>d(p),children:[y.jsxs("span",{className:"time-text",children:[p.dateStr," "]}),g]},p.id)})]}):null]})};function Gd(e){xm({className:"memo-card-dialog"},y5,{memo:e})}const Aw=new Map,Gg=async(e,t=!0)=>{const{vault:n,metadataCache:r}=rt.getState().app;if(t&&Aw.has(e))return Promise.resolve(Aw.get(e));let a;const o=await n.adapter.exists(e);let s="";try{if(!o&&!/(http|https)/g.test(e)){const u=r.getFirstLinkpathDest(e,"");if(!u){new x.Notice(k("File not exist"));return}s=u.path}else s=e}catch(u){console.error(u)}if(s){if(/(http|https)/g.test(s))try{const u=await x.requestUrl(e),d=new Uint8Array(u.arrayBuffer);a=new Blob([d],{type:"image/png"})}catch{}else if(s){const u=await n.adapter.readBinary(s),d=new Uint8Array(u);a=new Blob([d],{type:"image/png"})}return a?w5(a,e):""}},w5=(e,t)=>new Promise(n=>{const r=new FileReader;r.onloadend=()=>{const a=r.result;Aw.set(t,a),n(a)},r.readAsDataURL(e)}),b5=async e=>{const t=document.createElement(e.tagName);t.innerHTML=e.innerHTML;const n=async(r,a)=>{if(!r||!a)return;const o=window.getComputedStyle(r);if(r.tagName==="IMG")try{let s="";const u=r.getAttribute("src");u!=null&&u.startsWith("http")&&!u.startsWith("http://localhost")?s=await Gg(r==null?void 0:r.getAttribute("src")):s=await Gg(r.getAttribute("path")||x.normalizePath(r==null?void 0:r.parentElement.getAttribute("src"))),a.src=s}catch(s){console.error(s)}else if(r.className==="property-image")try{const s=r.style.backgroundImage,u=await Gg(s);a.style.backgroundImage=u}catch(s){console.error(s)}for(const s of o)a.style.setProperty(s,o.getPropertyValue(s),o.getPropertyPriority(s));for(let s=0;s<a.childElementCount;s++)await n(r.children[s],a.children[s])};return await n(e,t),t},D5=async e=>{const t=e.ownerDocument.styleSheets,n=[];for(const a of t)for(const o of a.cssRules)o.constructor.name==="CSSFontFaceRule"&&n.push(o.style);return document.createElement("style")},hE=e=>{const{width:t,height:n}=window.getComputedStyle(e);return{width:parseInt(t.replace("px","")),height:parseInt(n.replace("px",""))}},S5=e=>{const t=new XMLSerializer().serializeToString(e);return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`},I5=(e,t,n)=>{const r="http://www.w3.org/2000/svg",a=document.createElementNS(r,"svg");a.setAttribute("width",`${e}`),a.setAttribute("height",`${t}`),a.setAttribute("viewBox",`0 0 ${e} ${t}`);const o=document.createElementNS(r,"foreignObject");return o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),o.appendChild(n),a.appendChild(o),a},T5=async(e,t)=>{const{width:n,height:r}=hE(e),a=await b5(e);t!=null&&t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor);const o=I5(n,r,a);return o.prepend(await D5(e)),S5(o)},E5=async(e,t)=>{const n=await T5(e,t),r=new Image;r.src=n;const a=(t==null?void 0:t.pixelRatio)||1,{width:o,height:s}=hE(e),u=document.createElement("canvas"),d=u.getContext("2d");return d?(u.width=o*a,u.height=s*a,u.style.width=`${o}`,u.style.height=`${s}`,(t!=null&&t.backgroundColor||document.body.className.contains("theme-dark"))&&(d.fillStyle=t.backgroundColor||"#1f1f1f",d.fillRect(0,0,u.width,u.height)),new Promise(m=>{r.onload=()=>{d.drawImage(r,0,0,u.width,u.height),m(u)}})):Promise.reject("Canvas error")},Uv=async(e,t)=>(await E5(e,t)).toDataURL(),x5='<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>',C5='<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>',M5=(e,t)=>{const n=window.atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let o=0;o<n.length;o++)a[o]=n.charCodeAt(o);return new Blob([r],{type:t})},N5=async e=>{const{vault:t}=rt.getState().app,n=await t.adapter.readBinary(e),r=new Uint8Array(n),a=new Blob([r],{type:"image/png"});return new Promise(o=>{const s=new FileReader;s.onloadend=()=>{const u=s.result;o(u)},s.readAsDataURL(a)})},k5=async()=>{const{app:e,settings:t}=rt.getState();let n,r;const a=document.body.hasClass("theme-light"),o=a?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=o,n=await N5(r)):n="data:image/svg+xml;base64,"+btoa(a?x5:C5);const u=document.querySelector(".dialog-wrapper .memo-background .property-image");u.style.backgroundImage="url('"+n+"')",document.body.className.contains("theme-dark")&&(u.style.backgroundColor="#1f1f1f")},A5=e=>{const{memo:t,destroy:n}=e,{memos:r}=Ee.getState().memoState,{view:a,app:o,settings:s}=Ee.getState().dailyNotesState,u={...t,createdAtStr:Re.getDateTimeString(t.createdAt)},[d,m]=O.useState(!1),[p,g]=O.useState(u.content),[w,D]=O.useState(!1),S=O.useRef(null),T=O.useRef(null),[E,A]=O.useState(""),N=O.useRef(null),R=O.useRef(null);let F,H;r.length&&(F=r.length>0?r[r.length-1]:null,F?H=r?Math.ceil((Date.now()-Re.getTimeStampByDate(F==null?void 0:F.createdAt))/1e3/3600/24)+1:0:H=0);const P=s==null?void 0:s.ShareFooterEnd.replace("{UserName}",s==null?void 0:s.UserName),L=s==null?void 0:s.ShareFooterStart.replace("{ThinoNum}",r.length.toString()).replace("{UsedDay}",H.toString());O.useEffect(()=>{!S.current||!T.current||(x.setIcon(S.current,"copy"),x.setIcon(T.current,"x"))},[S,T]),O.useEffect(()=>{x.setIcon(S.current,w?"loader":"copy"),S.current.disabled=w,S.current.toggleClass("copying",w)},[w]),O.useEffect(()=>{if(!R.current||!a||d)return;g(t.content),R.current.hasChildNodes()&&R.current.empty();async function K(){await x.MarkdownRenderer.render(o,t.content+`
`,R.current,t.path,a)}K(),setTimeout(()=>{if(k5(),!N.current)return;let ae;document.body.hasClass("theme-dark")?ae="#727171":ae="#eaeaea",Uv(N.current,{backgroundColor:ae,pixelRatio:window.devicePixelRatio*2}).then(ce=>{A(ce),m(!0)}).catch(()=>{})},bI)},[N,R,u]);const z=()=>{n()},U=O.useCallback(K=>{D(K)},[w]),W=async()=>{U(!0);const{vault:K}=Ee.getState().dailyNotesState.app,ae=N.current.querySelector(".memo-shortcut-img");if(!ae)return;const ce=ae==null?void 0:ae.getAttribute("src").split("base64,")[1],fe=M5(ce,"image/png");let ie;if(s!=null&&s.AutoSaveWhenOnMobile&&x.Platform.isMobile&&fe.arrayBuffer().then(async Te=>{const se="png",we=ws();for(const Z in we)if(we[Z]instanceof x.TFile){ie=we[Z];break}ie!==void 0&&await K.createBinary(await K.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,se,ie),Te)}),!fe){new x.Notice("Copy to clipboard failed");return}const ge=new ClipboardItem({"image/png":fe});window.navigator.clipboard.write([ge]).then(()=>{setTimeout(()=>{U(!1)},500)}),new x.Notice("Copy to clipboard successfully")};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"dialog-header-container",children:[y.jsxs("p",{className:"title-text",children:[y.jsx("span",{className:"icon-text",children:"🥰"}),k("Share Memo Image")]}),y.jsxs("div",{className:"btn-group",children:[y.jsx("button",{ref:S,className:"btn copy-btn",onClick:W}),y.jsx("button",{ref:T,className:"btn close-btn",onClick:z})]})]}),y.jsxs("div",{className:"dialog-content-container",children:[y.jsx("div",{className:`tip-words-container ${E?"finish":"loading"}`,children:y.jsx("p",{className:"tip-text",children:k(E?"↗Click the button to save":"Image is generating...")})}),y.jsxs("div",{className:"memo-container",ref:N,children:[y.jsx(lo,{when:E!=="",children:y.jsx("img",{className:"memo-shortcut-img",onClick:W,src:E})}),y.jsxs("div",{className:"memo-background",children:[y.jsx("div",{className:"property-image",style:{backgroundSize:"cover",backgroundRepeat:"no-repeat"}}),y.jsx("span",{className:"background-container"}),y.jsx("div",{ref:R,className:"memo-content-text"}),y.jsxs("div",{className:"watermark-container",children:[y.jsxs("span",{className:"normal-text footer-start",children:[y.jsx("div",{className:"property-social-icons"}),y.jsx("span",{className:"name-text",children:L})]}),y.jsx("span",{className:"normal-text footer-end",children:y.jsx("span",{className:"name-text",children:P})})]})]})]})]})]})};function O5(e){xm({className:"share-memo-image-dialog"},A5,{memo:e})}const BD=async e=>{e.startsWith("http")&&(e=await Gg(e));const t=e.split("base64,")[1],n=Av(t,"image/png");await mE(n),new x.Notice(k("Send to clipboard successfully"))},F5=async(e,t)=>{const n=await e.vault.adapter.exists(t);let r="";if(n)r=t;else{const u=e.metadataCache.getFirstLinkpathDest(t,"");if(!u){new x.Notice(k("File not exist"));return}r=u.path}const a=await e.vault.adapter.readBinary(r),o=new Uint8Array(a),s=new Blob([o],{type:"image/png"});await mE(s)},mE=async e=>{const t=new ClipboardItem({"image/png":e});await window.navigator.clipboard.write([t])},YD=1.1,zD=300,UD=20,P5=({destroy:e,imgUrl:t,filepath:n,otherIMGEls:r,currentIndex:a})=>{const o=O.useRef(null),[s,u]=O.useState(-1),d=Ee.getState().dailyNotesState.app,[m,p]=O.useState(a),[g,w]=O.useState(t),D={close:O.useRef(null),previous:O.useRef(null),next:O.useRef(null),decrease:O.useRef(null),increase:O.useRef(null),zoom:O.useRef(null),copy:O.useRef(null)};O.useEffect(()=>{!n&&!t||(x.setIcon(D.close.current,"x"),D.previous.current&&x.setIcon(D.previous.current,"arrow-left"),D.next.current&&x.setIcon(D.next.current,"arrow-right"),x.setIcon(D.decrease.current,"zoom-out"),x.setIcon(D.increase.current,"zoom-in"),x.setIcon(D.zoom.current,"circle"),x.setIcon(D.copy.current,"clipboard"))},[D]),O.useEffect(()=>{Re.getImageSize(g).then(({width:P})=>{u(P!==0?40:0)})},[g]);const S=()=>{let P=m-1;P<0&&(P=r.length-1),p(P),w(r[P].src)},T=()=>{let P=m+1;P>=r.length&&(P=0),p(P),w(r[P].src)},E=()=>{e()},A=()=>{s>30&&u(s-10)},N=()=>{u(s+10)},R=P=>{P.target!==o.current&&P.target===o.current.parentElement&&E()},F=P=>{if(P.ctrlKey){P.preventDefault();const L=o.current,z=P.nativeEvent.offsetX,U=P.nativeEvent.offsetY,W=z/L.clientWidth,K=U/L.clientHeight;let ae;P.deltaY>0?ae=s/YD:ae=s*YD,ae>zD?ae=zD:ae<UD&&(ae=UD);const ce=s;u(ae);const fe=P.currentTarget;fe.scrollLeft+=(ae-ce)*W,fe.scrollTop+=(ae-ce)*K}else P.deltaX!==0&&(P.currentTarget.scrollLeft+=P.deltaX)},H=async()=>{if(g&&!n)await BD(t);else if(n){const L=r[m].parentElement.getAttribute("src");if(!L){await BD(g);return}await F5(d,L)}};return y.jsxs(y.Fragment,{children:[y.jsx("button",{ref:D.close,className:"btn close-btn",onClick:E}),y.jsxs("div",{className:"img-container internal-embed image-embed is-loaded",onClick:R,onWheel:F,children:[y.jsx("img",{className:s<=0?"hidden":"",ref:o,height:s+"%",src:g}),y.jsx("span",{className:"loading-text "+(s===-1?"":"hidden"),children:k("Image is loading...")}),y.jsx("span",{className:"loading-text "+(s===0?"":"hidden"),children:k("😟 Cannot load image, image link maybe broken")})]}),y.jsxs("div",{className:"action-btns-container",children:[r&&(r==null?void 0:r.length)>1&&y.jsxs(y.Fragment,{children:[y.jsx("button",{ref:D.previous,className:"btn",onClick:S}),y.jsx("button",{ref:D.next,className:"btn",onClick:T})]}),y.jsx("button",{ref:D.decrease,className:"btn",onClick:A}),y.jsx("button",{ref:D.increase,className:"btn",onClick:N}),y.jsx("button",{ref:D.zoom,className:"btn",onClick:()=>u(80)}),y.jsx("button",{ref:D.copy,className:"btn",onClick:H})]})]})};function Vv({imgUrl:e,filepath:t,otherIMGEls:n,currentIndex:r}){xm({className:"preview-image-dialog"},P5,{...{imgUrl:e,otherIMGEls:n,currentIndex:r},filepath:t})}const j5=O.forwardRef((e,t)=>{const{memo:n,handlePinMemoClick:r,handleFixMemoClick:a,handleSourceMemoClick:o,handleShowMemoStoryDialog:s,handleCopyMemoClick:u,handleEditMemoClick:d,handleGenMemoImageBtnClick:m,handleMarkMemoClick:p,handleArchiveMemo:g,handleDeleteMemoClick:w}=e,D=O.useRef(null),S=Ee.getState().dailyNotesState.settings,[T,E]=_o(!1),A=O.useRef(null),N={pinRef:O.useRef(null),fixRef:O.useRef(null),typeRef:O.useRef(null),moreRef:O.useRef(null)},R={copy:O.useRef(null),read:O.useRef(null),mark:O.useRef(null),share:O.useRef(null),edit:O.useRef(null),source:O.useRef(null),archive:O.useRef(null),delete:O.useRef(null)};return O.useEffect(()=>{A.current&&(x.setIcon(R.copy.current,"copy"),x.setIcon(R.read.current,"book-open"),x.setIcon(R.mark.current,"bookmark"),x.setIcon(R.share.current,"share-2"),x.setIcon(R.edit.current,"pencil"),x.setIcon(R.source.current,"home"),x.setIcon(R.archive.current,"archive"),x.setIcon(R.delete.current,"trash"))},[A]),O.useEffect(()=>{if(!N.typeRef)return;const F=Md.find(H=>H.title===n.sourceType);x.setIcon(N.typeRef.current,F.icon),x.requireApiVersion("1.4.4")&&x.setTooltip(N.typeRef.current,n.path),N.fixRef&&(x.setIcon(N.fixRef.current,"shield-alert"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.fixRef.current,"Update Thino property"))},[N.typeRef]),O.useEffect(()=>{N.pinRef&&(n.pinned?(x.setIcon(N.pinRef.current,"pin-off"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.pinRef.current,k("UNPIN"))):(x.setIcon(N.pinRef.current,"pin"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.pinRef.current,k("PIN"))))},[N.pinRef,n.pinned]),O.useImperativeHandle(t,()=>({toggleConfirm:F=>E(F),confirmStatus:T})),y.jsx("div",{ref:A,className:"memo-top-right-wrapper",children:y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:N.fixRef,className:`btn ${n.sourceType!=="MULTI"||n.id!==""?"hidden":""} fix-memo-btn`,onClick:()=>a(n)}),y.jsx("span",{ref:N.typeRef,className:`btn ${n.sourceType==="DAILY"?"hidden":""} source-type-btn`,onClick:()=>o(n)}),y.jsx("span",{ref:N.pinRef,className:`btn ${e.memo.pinned?"pinned-btn":"unpinned-btn"} pro`,onClick:r}),y.jsx("span",{ref:F=>{N.moreRef.current=F,F&&x.setIcon(F,"more-horizontal")},className:"btn more-action-btn"}),y.jsx("div",{ref:D,className:"more-action-btns-wrapper",children:y.jsxs("div",{className:"more-action-btns-container",children:[y.jsxs("div",{className:"more-action-btn-group more-action-menu-item",children:[y.jsx("span",{ref:R.copy,className:"more-action-item-icon",onClick:u}),y.jsx("span",{ref:R.edit,className:"more-action-item-icon",onClick:d}),y.jsx("span",{ref:R.share,className:"more-action-item-icon",onClick:m})]}),y.jsx("hr",{className:"menu-hr"}),y.jsxs("div",{className:"more-action-menu-item",onClick:s,children:[y.jsx("span",{ref:R.read,className:"more-action-item-icon"}),y.jsx("span",{className:"btn",children:k("READ")})]}),y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:R.mark,className:"more-action-item-icon"}),y.jsx("span",{className:"btn",onClick:p,children:k("MARK")})]}),y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:R.source,className:"more-action-item-icon"}),y.jsx("span",{className:"btn",onClick:()=>o(n),children:k("SOURCE")})]}),y.jsx("hr",{className:"menu-hr"}),y.jsxs("div",{className:"more-action-menu-item archive-menu-item",children:[y.jsx("span",{ref:R.archive,className:"more-action-item-icon"}),y.jsx("span",{className:"btn delete-btn",onClick:()=>g(n),children:k("ARCHIVE").toUpperCase()})]}),y.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[y.jsx("span",{ref:R.delete,className:"more-action-item-icon"}),y.jsx("span",{className:`btn delete-btn ${T?"final-confirm":""}`,onClick:async F=>{F.stopPropagation(),F.preventDefault(),await w(F)},children:T?k("CONFIRM"):S.DeleteThinoDirectly?k("DELETE"):k("Recycle bin").toUpperCase()})]}),y.jsx("hr",{className:"menu-hr"}),y.jsx("div",{className:"text-count-item more-action-menu-item",children:y.jsx("span",{className:"btn text-count-btn",children:Re.countWords(n.content)+` ${k("words")}`})})]})})]})})}),L5=e=>{const{memo:t,handleMemoTypeToggle:n,handleShowMemoStoryDialog:r,settings:a}=e;return y.jsxs("div",{className:"memo-top-left-wrapper",children:[e.children,y.jsx("span",{title:t.createdAt,className:"time-text",onClick:r,children:t.createdAt}),y.jsx("div",{className:`btn memo-type-img ${a!=null&&a.ShowTaskLabel?"":"hidden"}`,onClick:n,children:t.thinoType!=="JOURNAL"&&y.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)})})]})},R5=async(e,t,n)=>{const r=n.getAttribute("href"),a=n.className;if(a.contains("tag"))_5(n.innerText.slice(1));else if(a.contains("internal-link")){const o=n.getAttribute("data-href"),s=Ie.getMemoById(o??"");s?Gd(s):await e.workspace.openLinkText(o,o,!x.Platform.isMobile&&t.navigation!==!0)}else r&&window.open(r,"_blank")},_5=e=>{const t=We.getState().query.tag;We.setTagQuery(t===e?"":e)},H5=(e,t)=>{const n=t==null?void 0:t.getAttribute("src"),r=t==null?void 0:t.parentElement.getAttribute("src"),a=[...(e==null?void 0:e.querySelectorAll("img"))||[]],o=a.indexOf(t);Vv({imgUrl:n,filepath:n.startsWith("app")?r:void 0,otherIMGEls:a,currentIndex:o})},B5=e=>{var r;const t=(r=e.dataset)==null?void 0:r.value,n=Ie.getMemoById(t??"");n?Gd(n):(new x.Notice("Thino Not Found"),e.classList.remove("memo-link-text"))},Y5=async(e,t,n)=>{var o;const r=((o=n.parentElement.dataset)==null?void 0:o.task)==="x"?"DONE":"TODO",a=[...(t==null?void 0:t.querySelectorAll("li.task-list-item"))||[]];for(const s of a)if(s===n||s===n.closest("li.task-list-item")){const u=a.indexOf(s),d=e.content.split(/\n/),m=[];for(let S=0;S<d.length;S++)(d[S].trim().startsWith("- [ ]")||d[S].trim().startsWith("- [x]"))&&m.push(S);const p=m[u],w=d[p].replace(/- \[ \] |- \[x\] /g,r==="TODO"?"- [x] ":"- [ ] ");d[p]=w;const D=d.join(`
`).trim();if(e&&e.content!==D){const S=await Ie.updateMemo(e.id,D);Ie.editMemo(S)}}},z5=e=>{const{globalState:{editMemoId:t},dailyNotesState:{app:n,view:r,settings:a,verifyState:o},locationState:{pathname:s}}=O.useContext(wt),{memo:u,type:d="inline"}=e,m=O.useRef(null),p=O.useRef(null),[g,w]=O.useState(!1);O.useEffect(()=>{g&&setTimeout(()=>{Qe.setEditMemoId(u.id)},100)},[g]),O.useEffect(()=>{(s==="/review"||s==="/daily")&&t!==u.id&&g&&w(!1)},[t]);const D=()=>{Gd(u)},S=()=>{if(a!=null&&a.UseButtonToShowEditor&&(a==null?void 0:a.DefaultEditorLocation)==="Bottom"){const ie=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.hidden)");ie&&ie.trigger("click")}Qe.setMarkMemoId(u.id)},T=async()=>{var Te;const ie=!x.Platform.isDesktop&&await((Te=window.Capacitor)==null?void 0:Te.Plugins.Device.getId()),ge=x.Platform.isDesktop?await zn():ie.identifier||ie.uuid;if(!o||(o==null?void 0:o.appId)!==ge){fn();return}u.pinned?await Ie.unpinMemoById(u.id):await Ie.pinMemoById(u.id)},E=()=>{if(a!=null&&a.UseButtonToShowEditor&&(a==null?void 0:a.DefaultEditorLocation)==="Bottom"&&x.Platform.isMobile){const ie=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.hidden)");ie&&ie.trigger("click")}(s==="/review"||s==="/daily")&&w(!0),s!=="/review"&&s!=="/daily"&&Qe.setEditMemoId(u.id)},A=async ie=>{ie.sourceType==="MULTI"&&ie.id.trim()===""&&await Ie.updateMemoProperty(ie)},N=async ie=>{await Ie.openThinoByID(ie.id)},R=async ie=>{try{const ge=await Ie.archiveMemo(ie);ge&&Ie.editMemo(ge)}catch(ge){console.error(ge),new x.Notice(ge.message)}},F=async(ie,ge)=>{if(!ge&&p.current&&!p.current.confirmStatus){p.current&&p.current.toggleConfirm();return}try{if(a.DeleteThinoDirectly)await Ie.deleteMemoById(u.id);else{const Te=await Ie.hideMemoById(u.id);Te&&Ie.editMemo(Te)}}catch(Te){new x.Notice(Te.message)}Qe.getState().editMemoId===u.id&&Qe.setEditMemoId("")},H=()=>{if(p.current&&!p.current.confirmStatus){p.current&&p.current.toggleConfirm(!1);return}},P=()=>{O5(u)},L=async()=>{const ie=await Ie.updateMemo(u.id,u.content,u.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");ie&&Ie.editMemo(ie)},z=async ie=>{ie.stopPropagation(),navigator.clipboard.writeText(u.content).then(()=>{new x.Notice(k("COPY SUCCEED"))}).catch(()=>{new x.Notice(k("COPY FAILED"))})},U=ie=>{ie&&E()},W=async(ie,ge)=>{ie.preventDefault();const Te=ie.target;if(ie.ctrlKey||ie.metaKey){await N(ge);return}if(Te.tagName==="A"){await R5(n,r,Te);return}if(Te.tagName==="IMG"){H5(m.current,Te);return}if(Te.tagName==="A"&&Te.getAttribute("href")){const se=Te.getAttribute("href");window.open(se,"_blank");return}if(Te.className==="memo-link-text"){B5(Te);return}if(Te.tagName==="INPUT"&&Te.hasClass("task-list-item-checkbox")){await Y5(ge,m.current,Te);return}},K=ie=>{const ge=new x.Menu;ge.dom.toggleClass("memo-context-menu",!0);const Te=window.getSelection();(Te==null?void 0:Te.toString().length)>0&&ge.addItem(se=>{se.setIcon("copy").setTitle(k("COPY")).onClick(()=>{navigator.clipboard.writeText(Te.toString()).then(()=>{new x.Notice(k("COPY SUCCEED"))}).catch(()=>{new x.Notice(k("COPY FAILED"))})})}).addSeparator(),ge.addItem(se=>{se.setIcon("book-open").setTitle(k("READ")).onClick(D)}).addItem(se=>{se.setIcon(u.pinned?"pin-off":"pin").setTitle(u.pinned?k("UNPIN"):k("PIN")).onClick(T)}).addItem(se=>{se.setIcon("bookmark").setTitle(k("MARK")).onClick(S)}).addItem(se=>{se.setIcon("share-2").setTitle(k("SHARE")).onClick(P)}).addItem(se=>{se.setIcon("pencil").setTitle(k("EDIT")).onClick(E)}).addItem(se=>{se.setIcon("home").setTitle(k("SOURCE")).onClick(()=>N(u))}).addSeparator().addItem(se=>{se.setIcon("archive").setTitle(k("ARCHIVE")).onClick(()=>R(u))}).addItem(se=>{se.setIcon("trash").setTitle(k("DELETE")).onClick(async we=>{await F(we,!0)})}),ge.showAtMouseEvent(ie.nativeEvent)},ae=O.useMemo(()=>({memo:u,handlePinMemoClick:T,handleFixMemoClick:A,handleSourceMemoClick:N,handleArchiveMemo:R,handleDeleteMemoClick:F,handleGenMemoImageBtnClick:P,handleMarkMemoClick:S,handleEditMemoClick:E,handleCopyMemoClick:z,handleShowMemoStoryDialog:D}),[u]),ce=O.useMemo(()=>({memo:u,handleMemoTypeToggle:L,handleShowMemoStoryDialog:D,settings:a}),[u,a]),fe=O.useMemo(()=>y.jsxs("div",{ref:m,className:`memo-wrapper ${u.pinned?"pinned":""}`,"data-source-type":u.sourceType,"data-thino-type":u.thinoType,"data-thino-id":u.id,onMouseLeave:H,onContextMenu:K,children:[g&&y.jsx(Cd,{editorType:"inline"}),!g&&y.jsxs(y.Fragment,{children:[d==="inline"&&y.jsxs("div",{className:"memo-top-wrapper",draggable:!0,onDragStart:ie=>{ie.target.classList.add("dragging"),ie.dataTransfer.setDragImage(m.current,0,0),ie.dataTransfer.setData("text/plain",u.content)},onDragEnd:ie=>{ie.target.classList.remove("dragging")},children:[y.jsx(L5,{...ce}),y.jsx(j5,{ref:p,...ae})]}),y.jsx(fE,{memo:u,handleMemoContentClick:W,handleMemoDoubleClick:U})]})]}),[u,g]);return y.jsx(y.Fragment,{children:fe})},Ua=O.memo(z5);function U5(e,t){if(e==null)return{};var n=V5(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function V5(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function fv(){return fv=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},fv.apply(this,arguments)}function VD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Lh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VD(Object(n),!0).forEach(function(r){Z5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const W5={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0},F0=2;class hv 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)||F0,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)||F0});let r=1/0,a=n.default||F0;for(let o in n){const s=parseInt(o);s>0&&t<=s&&s<r&&(r=s,a=n[o])}a=Math.max(1,parseInt(a)||1),this.state.columnCount!==a&&this.setState({columnCount:a})}itemsInColumns(){const t=this.state.columnCount,n=new Array(t),r=q.Children.toArray(this.props.children);for(let a=0;a<r.length;a++){const o=a%t;n[o]||(n[o]=[]),n[o].push(r[a])}return n}renderColumns(){const{column:t,columnAttrs:n={},columnClassName:r}=this.props,a=this.itemsInColumns(),o=`${100/a.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 u=Lh(Lh(Lh({},t),n),{},{style:Lh(Lh({},n.style),{},{width:o}),className:s});return a.map((d,m)=>q.createElement("div",fv({},u,{key:m}),d))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:n,breakpointCols:r,columnClassName:a,columnAttrs:o,column:s,className:u}=t,d=U5(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let m=u;return typeof u!="string"&&(this.logDeprecated('The property "className" requires a string'),typeof u>"u"&&(m="my-masonry-grid")),q.createElement("div",fv({},d,{className:m}),this.renderColumns())}}hv.defaultProps=W5;const ZD=e=>{const{thinos:t,dayMark:n,dayMarkRange:r="day"}=e,[a,o]=q.useState(!0),s=q.useRef(null);O.useEffect(()=>{s&&x.setTooltip&&x.setTooltip(s.current,k("Click to expand or fold, Cmd+Click to show all thinos of the day"))},[s]);const u=m=>{if(x.Keymap.isModifier(m.nativeEvent,"Mod")){const p={day:"YYYY-MM-DD",week:"YYYY-[W]WW",month:"YYYY-MM",quarter:"YYYY-[Q]Q",year:"YYYY"},g=x.moment(n,p[r]);We.setFromAndToQuery(g.startOf(r).valueOf(),g.endOf(r).valueOf());return}o(!a)},d=O.useMemo(()=>y.jsx(y.Fragment,{children:e.type==="list"?y.jsxs(y.Fragment,{children:[y.jsx("div",{ref:s,className:`day-mark ${a?"":"folded"} PINNED`,onClick:u,children:y.jsxs("span",{className:"day-mark-text",children:[a?"▼ ":"▶ ",n==="PINNED"?n+" 📌":n]})},n),a&&t.map((m,p)=>y.jsx(Ua,{memo:m},`${m.id}-${x.moment(m.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${p}`))]}):y.jsxs(y.Fragment,{children:[y.jsx("div",{ref:s,className:`day-mark ${a?"":"folded"}`,onClick:u,children:y.jsxs("span",{className:"day-mark-text",children:[a?"▼ ":"▶ ",n==="PINNED"?n+" 📌":n]})},n),y.jsx(hv,{breakpointCols:e.type==="waterfall"?3:1,className:`${e.type}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:a&&t.map((m,p)=>y.jsx(Ua,{memo:m},`${m.id}-${x.moment(m.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${p}`))})]})}),[t,a]);return y.jsx(y.Fragment,{children:d})};function ps(e){"@babel/helpers - typeof";return ps=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},ps(e)}function $5(e,t){if(ps(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ps(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pE(e){var t=$5(e,"string");return ps(t)=="symbol"?t:String(t)}function Ic(e,t,n){return t=pE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function nn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WD(Object(n),!0).forEach(function(r){Ic(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zv(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Ai(e,t){if(e==null)return{};var n=Zv(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $D(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,pE(r.key),r)}}function gr(e,t,n){return t&&$D(e.prototype,t),n&&$D(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mv(e){return mv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mv(e)}function gE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gE=function(){return!!e})()}function vE(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G5(e,t){if(t&&(ps(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vE(e)}function ea(e,t,n){return t=mv(t),G5(e,gE()?Reflect.construct(t,n||[],mv(e).constructor):t.apply(e,n))}function pv(e,t){return pv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},pv(e,t)}function ta(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&&pv(e,t)}function yE(e){if(Array.isArray(e))return e}function q5(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,s,u=[],d=!0,m=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);d=!0);}catch(p){m=!0,a=p}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(m)throw a}}return u}}function Ow(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 N1(e,t){if(e){if(typeof e=="string")return Ow(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 Ow(e,t)}}function wE(){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 us(e,t){return yE(e)||q5(e,t)||N1(e,t)||wE()}function kn(){return kn=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},kn.apply(this,arguments)}var J5=function(e,t,n,r,a,o,s,u){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 m=[n,r,a,o,s,u],p=0;d=new Error(t.replace(/%s/g,function(){return m[p++]})),d.name="Invariant Violation"}throw d.framesToPop=1,d}},K5=J5;const nm=Xn(K5);var Q5=function(){};function X5(e,t){var n={};return Object.keys(e).forEach(function(r){n[qg(r)]=Q5}),n}function GD(e,t){return e[t]!==void 0}function qg(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}function eO(e){return!!e&&(typeof e!="function"||e.prototype&&e.prototype.isReactComponent)}function tO(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,pv(e,t)}function bE(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function DE(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r??null}this.setState(t.bind(this))}function SE(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}}bE.__suppressDeprecationWarning=!0;DE.__suppressDeprecationWarning=!0;SE.__suppressDeprecationWarning=!0;function nO(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,a=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"?a="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(a="UNSAFE_componentWillUpdate"),n!==null||r!==null||a!==null){var o=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.
`+o+" uses "+s+" but also contains the following legacy lifecycles:"+(n!==null?`
`+n:"")+(r!==null?`
`+r:"")+(a!==null?`
`+a:"")+`
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=bE,t.componentWillReceiveProps=DE),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=SE;var u=t.componentDidUpdate;t.componentDidUpdate=function(m,p,g){var w=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:g;u.call(this,m,p,w)}}return e}var rO="/Users/jquense/src/uncontrollable/src/uncontrollable.js";function IE(e,t,n){n===void 0&&(n=[]);var r=e.displayName||e.name||"Component",a=eO(e),o=Object.keys(t),s=o.map(qg);a||!n.length||nm(!1);var u=function(m){tO(p,m);function p(){for(var w,D=arguments.length,S=new Array(D),T=0;T<D;T++)S[T]=arguments[T];w=m.call.apply(m,[this].concat(S))||this,w.handlers=Object.create(null),o.forEach(function(A){var N=t[A],R=function(H){if(w.props[N]){var P;w._notifying=!0;for(var L=arguments.length,z=new Array(L>1?L-1:0),U=1;U<L;U++)z[U-1]=arguments[U];(P=w.props)[N].apply(P,[H].concat(z)),w._notifying=!1}w.unmounted||w.setState(function(W){var K,ae=W.values;return{values:kn(Object.create(null),ae,(K={},K[A]=H,K))}})};w.handlers[N]=R}),n.length&&(w.attachRef=function(A){w.inner=A});var E=Object.create(null);return o.forEach(function(A){E[A]=w.props[qg(A)]}),w.state={values:E,prevProps:{}},w}var g=p.prototype;return g.shouldComponentUpdate=function(){return!this._notifying},p.getDerivedStateFromProps=function(D,S){var T=S.values,E=S.prevProps,A={values:kn(Object.create(null),T),prevProps:{}};return o.forEach(function(N){A.prevProps[N]=D[N],!GD(D,N)&&GD(E,N)&&(A.values[N]=D[qg(N)])}),A},g.componentWillUnmount=function(){this.unmounted=!0},g.render=function(){var D=this,S=this.props,T=S.innerRef,E=Zv(S,["innerRef"]);s.forEach(function(N){delete E[N]});var A={};return o.forEach(function(N){var R=D.props[N];A[N]=R!==void 0?R:D.state.values[N]}),q.createElement(e,kn({},E,A,this.handlers,{ref:T||this.attachRef}))},p}(q.Component);nO(u),u.displayName="Uncontrolled("+r+")",u.propTypes=kn({innerRef:function(){}},X5(t)),n.forEach(function(m){u.prototype[m]=function(){var g;return(g=this.inner)[m].apply(g,arguments)}});var d=u;return q.forwardRef&&(d=q.forwardRef(function(m,p){return q.createElement(u,kn({},m,{innerRef:p,__source:{fileName:rO,lineNumber:128},__self:this}))}),d.propTypes=u.propTypes),d.ControlledComponent=e,d.deferControlTo=function(m,p,g){return p===void 0&&(p={}),IE(m,kn({},t,p),g)},d}function TE(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=TE(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Qn(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=TE(e))&&(r&&(r+=" "),r+=t);return r}var EE={exports:{}},P0,qD;function aO(){if(qD)return P0;qD=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return P0=e,P0}var j0,JD;function oO(){if(JD)return j0;JD=1;var e=aO();function t(){}function n(){}return n.resetWarningCache=t,j0=function(){function r(s,u,d,m,p,g){if(g!==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 a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},j0}EE.exports=oO()();var iO=EE.exports;const Ae=Xn(iO);var gv="milliseconds",rm="seconds",am="minutes",om="hours",Ac="day",jd="week",im="month",Oc="year",Fc="decade",Pc="century",xE={milliseconds:1,seconds:1e3,minutes:60*1e3,hours:60*60*1e3,day:24*60*60*1e3,week:7*24*60*60*1e3},sO={month:1,year:12,decade:10*12,century:100*12};function lO(e){return[31,cO(e),31,30,31,30,31,31,30,31,30,31]}function cO(e){return e%4===0&&e%100!==0||e%400===0?29:28}function Ho(e,t,n){switch(e=new Date(e),n){case gv:case rm:case am:case om:case Ac:case jd:return uO(e,t*xE[n]);case im:case Oc:case Fc:case Pc:return dO(e,t*sO[n])}throw new TypeError('Invalid units: "'+n+'"')}function uO(e,t){var n=new Date(+e+t);return fO(e,n)}function dO(e,t){var n=e.getFullYear(),r=e.getMonth(),a=e.getDate(),o=n*12+r+t,s=Math.trunc(o/12),u=o%12,d=Math.min(a,lO(s)[u]),m=new Date(e);return m.setFullYear(s),m.setDate(1),m.setMonth(u),m.setDate(d),m}function fO(e,t){var n=e.getTimezoneOffset(),r=t.getTimezoneOffset(),a=r-n;return new Date(+t+a*xE.minutes)}function sm(e,t,n){return Ho(e,-t,n)}function Cr(e,t,n){switch(e=new Date(e),t){case Pc:case Fc:case Oc:e=yv(e,0);case im:e=AE(e,1);case jd:case Ac:e=um(e,0);case om:e=Ld(e,0);case am:e=cm(e,0);case rm:e=lm(e,0)}return t===Fc&&(e=sm(e,jc(e)%10,"year")),t===Pc&&(e=sm(e,jc(e)%100,"year")),t===jd&&(e=OE(e,0,n)),e}function vv(e,t,n){switch(e=new Date(e),e=Cr(e,t,n),t){case Pc:case Fc:case Oc:case im:case jd:e=Ho(e,1,t),e=sm(e,1,Ac),e.setHours(23,59,59,999);break;case Ac:e.setHours(23,59,59,999);break;case om:case am:case rm:e=Ho(e,1,t),e=sm(e,1,gv)}return e}var Fm=Jd(function(e,t){return e===t}),k1=Jd(function(e,t){return e!==t}),Wv=Jd(function(e,t){return e>t}),Pm=Jd(function(e,t){return e>=t}),A1=Jd(function(e,t){return e<t}),qd=Jd(function(e,t){return e<=t});function CE(){return new Date(Math.min.apply(Math,arguments))}function ME(){return new Date(Math.max.apply(Math,arguments))}function NE(e,t,n,r){return r=r||"day",(!t||Pm(e,t,r))&&(!n||qd(e,n,r))}var lm=El("Milliseconds"),cm=El("Seconds"),Ld=El("Minutes"),um=El("Hours"),kE=El("Day"),AE=El("Date"),yv=El("Month"),jc=El("FullYear");function hO(e,t){return t===void 0?jc(Cr(e,Fc)):Ho(e,t+10,Oc)}function mO(e,t){return t===void 0?jc(Cr(e,Pc)):Ho(e,t+100,Oc)}function OE(e,t,n){var r=(kE(e)+7-(n||0))%7;return t===void 0?r:Ho(e,t-r,Ac)}function pO(e,t,n,r){var a,o,s;switch(n){case gv:case rm:case am:case om:case Ac:case jd:a=t.getTime()-e.getTime();break;case im:case Oc:case Fc:case Pc:a=(jc(t)-jc(e))*12+yv(t)-yv(e);break;default:throw new TypeError('Invalid units: "'+n+'"')}switch(n){case gv:o=1;break;case rm:o=1e3;break;case am:o=1e3*60;break;case om:o=1e3*60*60;break;case Ac:o=1e3*60*60*24;break;case jd:o=1e3*60*60*24*7;break;case im:o=1;break;case Oc:o=12;break;case Fc:o=120;break;case Pc:o=1200;break;default:throw new TypeError('Invalid units: "'+n+'"')}return s=a/o,r?s:Math.round(s)}function El(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 a=new Date(n);return a["set"+e](r),t&&a["get"+e]()!=r&&(e==="Hours"||r>=t&&a.getHours()-n.getHours()<Math.floor(r/t))&&a["set"+e](r+t),a}}function Jd(e){return function(t,n,r){return e(+Cr(t,r),+Cr(n,r))}}const KD=Object.freeze(Object.defineProperty({__proto__:null,add:Ho,century:mO,date:AE,day:kE,decade:hO,diff:pO,endOf:vv,eq:Fm,gt:Wv,gte:Pm,hours:um,inRange:NE,lt:A1,lte:qd,max:ME,milliseconds:lm,min:CE,minutes:Ld,month:yv,neq:k1,seconds:cm,startOf:Cr,subtract:sm,weekday:OE,year:jc},Symbol.toStringTag,{value:"Module"}));function gO(e){if(Array.isArray(e))return Ow(e)}function FE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vO(){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 Jg(e){return gO(e)||FE(e)||N1(e)||vO()}function yO(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(a);++r<a;)o[r]=e[r+t];return o}var PE=yO;function wO(e,t){return e===t||e!==e&&t!==t}var jm=wO,bO=typeof Jn=="object"&&Jn&&Jn.Object===Object&&Jn,jE=bO,DO=jE,SO=typeof self=="object"&&self&&self.Object===Object&&self,IO=DO||SO||Function("return this")(),Oi=IO,TO=Oi,EO=TO.Symbol,Kd=EO,QD=Kd,LE=Object.prototype,xO=LE.hasOwnProperty,CO=LE.toString,Rh=QD?QD.toStringTag:void 0;function MO(e){var t=xO.call(e,Rh),n=e[Rh];try{e[Rh]=void 0;var r=!0}catch{}var a=CO.call(e);return r&&(t?e[Rh]=n:delete e[Rh]),a}var NO=MO,kO=Object.prototype,AO=kO.toString;function OO(e){return AO.call(e)}var FO=OO,XD=Kd,PO=NO,jO=FO,LO="[object Null]",RO="[object Undefined]",eS=XD?XD.toStringTag:void 0;function _O(e){return e==null?e===void 0?RO:LO:eS&&eS in Object(e)?PO(e):jO(e)}var Qd=_O;function HO(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ds=HO,BO=Qd,YO=Ds,zO="[object AsyncFunction]",UO="[object Function]",VO="[object GeneratorFunction]",ZO="[object Proxy]";function WO(e){if(!YO(e))return!1;var t=BO(e);return t==UO||t==VO||t==zO||t==ZO}var O1=WO,$O=9007199254740991;function GO(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$O}var F1=GO,qO=O1,JO=F1;function KO(e){return e!=null&&JO(e.length)&&!qO(e)}var Lm=KO,QO=9007199254740991,XO=/^(?:0|[1-9]\d*)$/;function eF(e,t){var n=typeof e;return t=t??QO,!!t&&(n=="number"||n!="symbol"&&XO.test(e))&&e>-1&&e%1==0&&e<t}var P1=eF,tF=jm,nF=Lm,rF=P1,aF=Ds;function oF(e,t,n){if(!aF(n))return!1;var r=typeof t;return(r=="number"?nF(n)&&rF(t,n.length):r=="string"&&t in n)?tF(n[t],e):!1}var $v=oF,iF=/\s/;function sF(e){for(var t=e.length;t--&&iF.test(e.charAt(t)););return t}var lF=sF,cF=lF,uF=/^\s+/;function dF(e){return e&&e.slice(0,cF(e)+1).replace(uF,"")}var fF=dF;function hF(e){return e!=null&&typeof e=="object"}var xl=hF,mF=Qd,pF=xl,gF="[object Symbol]";function vF(e){return typeof e=="symbol"||pF(e)&&mF(e)==gF}var Rm=vF,yF=fF,tS=Ds,wF=Rm,nS=NaN,bF=/^[-+]0x[0-9a-f]+$/i,DF=/^0b[01]+$/i,SF=/^0o[0-7]+$/i,IF=parseInt;function TF(e){if(typeof e=="number")return e;if(wF(e))return nS;if(tS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=tS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=yF(e);var n=DF.test(e);return n||SF.test(e)?IF(e.slice(2),n?2:8):bF.test(e)?nS:+e}var EF=TF,xF=EF,rS=1/0,CF=17976931348623157e292;function MF(e){if(!e)return e===0?e:0;if(e=xF(e),e===rS||e===-rS){var t=e<0?-1:1;return t*CF}return e===e?e:0}var RE=MF,NF=RE;function kF(e){var t=NF(e),n=t%1;return t===t?n?t-n:t:0}var _E=kF,AF=PE,OF=$v,FF=_E,PF=Math.ceil,jF=Math.max;function LF(e,t,n){(n?OF(e,t,n):t===void 0)?t=1:t=jF(FF(t),0);var r=e==null?0:e.length;if(!r||t<1)return[];for(var a=0,o=0,s=Array(PF(r/t));a<r;)s[o++]=AF(e,a,a+=t);return s}var RF=LF;const _F=Xn(RF);function _m(e){return e&&e.ownerDocument||document}function HF(e){var t=_m(e);return t&&t.defaultView||window}function BF(e,t){return HF(e).getComputedStyle(e,t)}var YF=/([A-Z])/g;function zF(e){return e.replace(YF,"-$1").toLowerCase()}var UF=/^ms-/;function Ng(e){return zF(e).replace(UF,"-ms-")}var VF=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function ZF(e){return!!(e&&VF.test(e))}function Sd(e,t){var n="",r="";if(typeof t=="string")return e.style.getPropertyValue(Ng(t))||BF(e).getPropertyValue(Ng(t));Object.keys(t).forEach(function(a){var o=t[a];!o&&o!==0?e.style.removeProperty(Ng(a)):ZF(a)?r+=a+"("+o+") ":n+=Ng(a)+": "+o+";"}),r&&(n+="transform: "+r+";"),e.style.cssText+=";"+n}function dm(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}function WF(e){return"nodeType"in e&&e.nodeType===document.DOCUMENT_NODE}function j1(e){return"window"in e&&e.window===e?e:WF(e)&&e.defaultView||!1}function HE(e){var t=e==="pageXOffset"?"scrollLeft":"scrollTop";function n(r,a){var o=j1(r);if(a===void 0)return o?o[e]:r[t];o?o.scrollTo(o[e],a):r[t]=a}return n}const BE=HE("pageXOffset"),YE=HE("pageYOffset");function Nc(e){var t=_m(e),n={top:0,left:0,height:0,width:0},r=t&&t.documentElement;return!r||!dm(r,e)||(e.getBoundingClientRect!==void 0&&(n=e.getBoundingClientRect()),n={top:n.top+YE(r)-(r.clientTop||0),left:n.left+BE(r)-(r.clientLeft||0),width:n.width,height:n.height}),n}var $F=function(t){return!!t&&"offsetParent"in t};function GF(e){for(var t=_m(e),n=e&&e.offsetParent;$F(n)&&n.nodeName!=="HTML"&&Sd(n,"position")==="static";)n=n.offsetParent;return n||t.documentElement}var qF=function(t){return t.nodeName&&t.nodeName.toLowerCase()};function zE(e,t){var n={top:0,left:0},r;if(Sd(e,"position")==="fixed")r=e.getBoundingClientRect();else{var a=t||GF(e);r=Nc(e),qF(a)!=="html"&&(n=Nc(a));var o=String(Sd(a,"borderTopWidth")||0);n.top+=parseInt(o,10)-YE(a)||0;var s=String(Sd(a,"borderLeftWidth")||0);n.left+=parseInt(s,10)-BE(a)||0}var u=String(Sd(e,"marginTop")||0),d=String(Sd(e,"marginLeft")||0);return kn({},r,{top:r.top-n.top-(parseInt(u,10)||0),left:r.left-n.left-(parseInt(d,10)||0)})}const L1=!!(typeof window<"u"&&window.document&&window.document.createElement);var aS=new Date().getTime();function JF(e){var t=new Date().getTime(),n=Math.max(0,16-(t-aS)),r=setTimeout(e,n);return aS=t,r}var KF=["","webkit","moz","o","ms"],Fw="clearTimeout",Pw=JF,oS=function(t,n){return t+(t?n[0].toUpperCase()+n.substr(1):n)+"AnimationFrame"};L1&&KF.some(function(e){var t=oS(e,"request");return t in window&&(Fw=oS(e,"cancel"),Pw=function(r){return window[t](r)}),!!Pw});var iS=function(t){typeof window[Fw]=="function"&&window[Fw](t)},UE=Pw,L0;function QF(e,t){if(!L0){var n=document.body,r=n.matches||n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;L0=function(o,s){return r.call(o,s)}}return L0(e,t)}var XF=Function.prototype.bind.call(Function.prototype.call,[].slice);function e7(e,t){return XF(e.querySelectorAll(t))}var jw=!1,Lw=!1;try{var R0={get passive(){return jw=!0},get once(){return Lw=jw=!0}};L1&&(window.addEventListener("test",R0,R0),window.removeEventListener("test",R0,!0))}catch{}function t7(e,t,n,r){if(r&&typeof r!="boolean"&&!Lw){var a=r.once,o=r.capture,s=n;!Lw&&a&&(s=n.__once||function u(d){this.removeEventListener(t,u,o),n.call(this,d)},n.__once=s),e.addEventListener(t,s,jw?r:o)}e.addEventListener(t,n,r)}function n7(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e},[e]),t}function sS(e){const t=n7(e);return O.useCallback(function(...n){return t.current&&t.current(...n)},[t])}function lS(){return O.useState(null)}function r7(){const e=O.useRef(!0),t=O.useRef(()=>e.current);return O.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function a7(e){const t=r7();return[e[0],O.useCallback(n=>{if(t())return e[1](n)},[t,e[1]])]}var o7=iE({defaultModifiers:[nE,aE,KT,QT,rE,tE,oE,JT]}),cS=function(t){return{position:t,top:"0",left:"0",opacity:"0",pointerEvents:"none"}},i7={name:"applyStyles",enabled:!1},s7={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:function(t){var n=t.state;return function(){var r=n.elements,a=r.reference,o=r.popper;if("removeAttribute"in a){var s=(a.getAttribute("aria-describedby")||"").split(",").filter(function(u){return u.trim()!==o.id});s.length?a.setAttribute("aria-describedby",s.join(",")):a.removeAttribute("aria-describedby")}}},fn:function(t){var n,r=t.state,a=r.elements,o=a.popper,s=a.reference,u=(n=o.getAttribute("role"))==null?void 0:n.toLowerCase();if(o.id&&u==="tooltip"&&"setAttribute"in s){var d=s.getAttribute("aria-describedby");if(d&&d.split(",").indexOf(o.id)!==-1)return;s.setAttribute("aria-describedby",d?d+","+o.id:o.id)}}},l7=[];function c7(e,t,n){var r=n===void 0?{}:n,a=r.enabled,o=a===void 0?!0:a,s=r.placement,u=s===void 0?"bottom":s,d=r.strategy,m=d===void 0?"absolute":d,p=r.modifiers,g=p===void 0?l7:p,w=Zv(r,["enabled","placement","strategy","modifiers"]),D=O.useRef(),S=O.useCallback(function(){var F;(F=D.current)==null||F.update()},[]),T=O.useCallback(function(){var F;(F=D.current)==null||F.forceUpdate()},[]),E=a7(O.useState({placement:u,update:S,forceUpdate:T,attributes:{},styles:{popper:cS(m),arrow:{}}})),A=E[0],N=E[1],R=O.useMemo(function(){return{name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(H){var P=H.state,L={},z={};Object.keys(P.elements).forEach(function(U){L[U]=P.styles[U],z[U]=P.attributes[U]}),N({state:P,styles:L,attributes:z,update:S,forceUpdate:T,placement:P.placement})}}},[S,T,N]);return O.useEffect(function(){!D.current||!o||D.current.setOptions({placement:u,strategy:m,modifiers:[].concat(g,[R,i7])})},[m,u,R,o]),O.useEffect(function(){if(!(!o||e==null||t==null))return D.current=o7(e,t,kn({},w,{placement:u,strategy:m,modifiers:[].concat(g,[s7,R])})),function(){D.current!=null&&(D.current.destroy(),D.current=void 0,N(function(F){return kn({},F,{attributes:{},styles:{popper:cS(m)}})}))}},[o,e,t]),A}function u7(e,t,n,r){var a=r&&typeof r!="boolean"?r.capture:r;e.removeEventListener(t,n,a),n.__once&&e.removeEventListener(t,n.__once,a)}function Uh(e,t,n,r){return t7(e,t,n,r),function(){u7(e,t,n,r)}}function d7(e){return e&&"setState"in e?b1.findDOMNode(e):e??null}const f7=function(e){return _m(d7(e))};var h7=27,uS=function(){};function m7(e){return e.button===0}function p7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var dS=function(t){return t&&("current"in t?t.current:t)};function g7(e,t,n){var r=n===void 0?{}:n,a=r.disabled,o=r.clickTrigger,s=o===void 0?"click":o,u=O.useRef(!1),d=t||uS,m=O.useCallback(function(w){var D,S=dS(e);t5(!!S,"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"),u.current=!S||p7(w)||!m7(w)||!!dm(S,(D=w.composedPath==null?void 0:w.composedPath()[0])!=null?D:w.target)},[e]),p=sS(function(w){u.current||d(w)}),g=sS(function(w){w.keyCode===h7&&d(w)});O.useEffect(function(){if(!(a||e==null)){var w=window.event,D=f7(dS(e)),S=Uh(D,s,m,!0),T=Uh(D,s,function(N){if(N===w){w=void 0;return}p(N)}),E=Uh(D,"keyup",function(N){if(N===w){w=void 0;return}g(N)}),A=[];return"ontouchstart"in D.documentElement&&(A=[].slice.call(D.body.children).map(function(N){return Uh(N,"mousemove",uS)})),function(){S(),T(),E(),A.forEach(function(N){return N()})}}},[e,a,s,m,p,g])}function v7(e){var t={};return Array.isArray(e)?(e==null||e.forEach(function(n){t[n.name]=n}),t):e||t}function y7(e){return e===void 0&&(e={}),Array.isArray(e)?e:Object.keys(e).map(function(t){return e[t].name=t,e[t]})}function w7(e){var t,n,r,a,o=e.enabled,s=e.enableEvents,u=e.placement,d=e.flip,m=e.offset,p=e.fixed,g=e.containerPadding,w=e.arrowElement,D=e.popperConfig,S=D===void 0?{}:D,T=v7(S.modifiers);return kn({},S,{placement:u,enabled:o,strategy:p?"fixed":S.strategy,modifiers:y7(kn({},T,{eventListeners:{enabled:s},preventOverflow:kn({},T.preventOverflow,{options:g?kn({padding:g},(t=T.preventOverflow)==null?void 0:t.options):(n=T.preventOverflow)==null?void 0:n.options}),offset:{options:kn({offset:m},(r=T.offset)==null?void 0:r.options)},arrow:kn({},T.arrow,{enabled:!!w,options:kn({},(a=T.arrow)==null?void 0:a.options,{element:w})}),flip:kn({enabled:!!d},T.flip)}))})}function b7(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function D7(e,t){e.classList?e.classList.add(t):b7(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function fS(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function S7(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=fS(e.className,t):e.setAttribute("class",fS(e.className&&e.className.baseVal||"",t))}var kg;function VE(e){if((!kg&&kg!==0||e)&&L1){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),kg=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return kg}var _0=function(t){var n;return typeof document>"u"?null:t==null?_m().body:(typeof t=="function"&&(t=t()),t&&"current"in t&&(t=t.current),(n=t)!=null&&n.nodeType&&t||null)};function hS(e,t){var n=O.useState(function(){return _0(e)}),r=n[0],a=n[1];if(!r){var o=_0(e);o&&a(o)}return O.useEffect(function(){t&&r&&t(r)},[t,r]),O.useEffect(function(){var s=_0(e);s!==r&&a(s)},[e,r]),r}const mS=e=>!e||typeof e=="function"?e:t=>{e.current=t};function I7(e,t){const n=mS(e),r=mS(t);return a=>{n&&n(a),r&&r(a)}}function T7(e,t){return O.useMemo(()=>I7(e,t),[e,t])}var R1=q.forwardRef(function(e,t){var n=e.flip,r=e.offset,a=e.placement,o=e.containerPadding,s=o===void 0?5:o,u=e.popperConfig,d=u===void 0?{}:u,m=e.transition,p=lS(),g=p[0],w=p[1],D=lS(),S=D[0],T=D[1],E=T7(w,t),A=hS(e.container),N=hS(e.target),R=O.useState(!e.show),F=R[0],H=R[1],P=c7(N,g,w7({placement:a,enableEvents:!!e.show,containerPadding:s||5,flip:n,offset:r,arrowElement:S,popperConfig:d})),L=P.styles,z=P.attributes,U=Zv(P,["styles","attributes"]);e.show?F&&H(!1):!e.transition&&!F&&H(!0);var W=function(){H(!0),e.onExited&&e.onExited.apply(e,arguments)},K=e.show||m&&!F;if(g7(g,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!K)return null;var ae=e.children(kn({},U,{show:!!e.show,props:kn({},z.popper,{style:L.popper,ref:E}),arrowProps:kn({},z.arrow,{style:L.arrow,ref:T})}));if(m){var ce=e.onExit,fe=e.onExiting,ie=e.onEnter,ge=e.onEntering,Te=e.onEntered;ae=q.createElement(m,{in:e.show,appear:!0,onExit:ce,onExiting:fe,onExited:W,onEnter:ie,onEntering:ge,onEntered:Te},ae)}return A?b1.createPortal(ae,A):null});R1.displayName="Overlay";R1.propTypes={show:Ae.bool,placement:Ae.oneOf(S1),target:Ae.any,container:Ae.any,flip:Ae.bool,children:Ae.func.isRequired,containerPadding:Ae.number,popperConfig:Ae.object,rootClose:Ae.bool,rootCloseEvent:Ae.oneOf(["click","mousedown"]),rootCloseDisabled:Ae.bool,onHide:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];if(t.rootClose){var o;return(o=Ae.func).isRequired.apply(o,[t].concat(r))}return Ae.func.apply(Ae,[t].concat(r))},transition:Ae.elementType,onEnter:Ae.func,onEntering:Ae.func,onEntered:Ae.func,onExit:Ae.func,onExiting:Ae.func,onExited:Ae.func};const E7=R1;function x7(){this.__data__=[],this.size=0}var C7=x7,M7=jm;function N7(e,t){for(var n=e.length;n--;)if(M7(e[n][0],t))return n;return-1}var Gv=N7,k7=Gv,A7=Array.prototype,O7=A7.splice;function F7(e){var t=this.__data__,n=k7(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():O7.call(t,n,1),--this.size,!0}var P7=F7,j7=Gv;function L7(e){var t=this.__data__,n=j7(t,e);return n<0?void 0:t[n][1]}var R7=L7,_7=Gv;function H7(e){return _7(this.__data__,e)>-1}var B7=H7,Y7=Gv;function z7(e,t){var n=this.__data__,r=Y7(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var U7=z7,V7=C7,Z7=P7,W7=R7,$7=B7,G7=U7;function Xd(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])}}Xd.prototype.clear=V7;Xd.prototype.delete=Z7;Xd.prototype.get=W7;Xd.prototype.has=$7;Xd.prototype.set=G7;var qv=Xd,q7=qv;function J7(){this.__data__=new q7,this.size=0}var K7=J7;function Q7(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var X7=Q7;function eP(e){return this.__data__.get(e)}var tP=eP;function nP(e){return this.__data__.has(e)}var rP=nP,aP=Oi,oP=aP["__core-js_shared__"],iP=oP,H0=iP,pS=function(){var e=/[^.]+$/.exec(H0&&H0.keys&&H0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function sP(e){return!!pS&&pS in e}var lP=sP,cP=Function.prototype,uP=cP.toString;function dP(e){if(e!=null){try{return uP.call(e)}catch{}try{return e+""}catch{}}return""}var ZE=dP,fP=O1,hP=lP,mP=Ds,pP=ZE,gP=/[\\^$.*+?()[\]{}|]/g,vP=/^\[object .+?Constructor\]$/,yP=Function.prototype,wP=Object.prototype,bP=yP.toString,DP=wP.hasOwnProperty,SP=RegExp("^"+bP.call(DP).replace(gP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function IP(e){if(!mP(e)||hP(e))return!1;var t=fP(e)?SP:vP;return t.test(pP(e))}var TP=IP;function EP(e,t){return e==null?void 0:e[t]}var xP=EP,CP=TP,MP=xP;function NP(e,t){var n=MP(e,t);return CP(n)?n:void 0}var Bc=NP,kP=Bc,AP=Oi,OP=kP(AP,"Map"),_1=OP,FP=Bc,PP=FP(Object,"create"),Jv=PP,gS=Jv;function jP(){this.__data__=gS?gS(null):{},this.size=0}var LP=jP;function RP(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _P=RP,HP=Jv,BP="__lodash_hash_undefined__",YP=Object.prototype,zP=YP.hasOwnProperty;function UP(e){var t=this.__data__;if(HP){var n=t[e];return n===BP?void 0:n}return zP.call(t,e)?t[e]:void 0}var VP=UP,ZP=Jv,WP=Object.prototype,$P=WP.hasOwnProperty;function GP(e){var t=this.__data__;return ZP?t[e]!==void 0:$P.call(t,e)}var qP=GP,JP=Jv,KP="__lodash_hash_undefined__";function QP(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=JP&&t===void 0?KP:t,this}var XP=QP,ej=LP,tj=_P,nj=VP,rj=qP,aj=XP;function ef(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])}}ef.prototype.clear=ej;ef.prototype.delete=tj;ef.prototype.get=nj;ef.prototype.has=rj;ef.prototype.set=aj;var oj=ef,vS=oj,ij=qv,sj=_1;function lj(){this.size=0,this.__data__={hash:new vS,map:new(sj||ij),string:new vS}}var cj=lj;function uj(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var dj=uj,fj=dj;function hj(e,t){var n=e.__data__;return fj(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Kv=hj,mj=Kv;function pj(e){var t=mj(this,e).delete(e);return this.size-=t?1:0,t}var gj=pj,vj=Kv;function yj(e){return vj(this,e).get(e)}var wj=yj,bj=Kv;function Dj(e){return bj(this,e).has(e)}var Sj=Dj,Ij=Kv;function Tj(e,t){var n=Ij(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var Ej=Tj,xj=cj,Cj=gj,Mj=wj,Nj=Sj,kj=Ej;function tf(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])}}tf.prototype.clear=xj;tf.prototype.delete=Cj;tf.prototype.get=Mj;tf.prototype.has=Nj;tf.prototype.set=kj;var H1=tf,Aj=qv,Oj=_1,Fj=H1,Pj=200;function jj(e,t){var n=this.__data__;if(n instanceof Aj){var r=n.__data__;if(!Oj||r.length<Pj-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Fj(r)}return n.set(e,t),this.size=n.size,this}var Lj=jj,Rj=qv,_j=K7,Hj=X7,Bj=tP,Yj=rP,zj=Lj;function nf(e){var t=this.__data__=new Rj(e);this.size=t.size}nf.prototype.clear=_j;nf.prototype.delete=Hj;nf.prototype.get=Bj;nf.prototype.has=Yj;nf.prototype.set=zj;var B1=nf,Uj="__lodash_hash_undefined__";function Vj(e){return this.__data__.set(e,Uj),this}var Zj=Vj;function Wj(e){return this.__data__.has(e)}var $j=Wj,Gj=H1,qj=Zj,Jj=$j;function wv(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Gj;++t<n;)this.add(e[t])}wv.prototype.add=wv.prototype.push=qj;wv.prototype.has=Jj;var Kj=wv;function Qj(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 Xj=Qj;function eL(e,t){return e.has(t)}var tL=eL,nL=Kj,rL=Xj,aL=tL,oL=1,iL=2;function sL(e,t,n,r,a,o){var s=n&oL,u=e.length,d=t.length;if(u!=d&&!(s&&d>u))return!1;var m=o.get(e),p=o.get(t);if(m&&p)return m==t&&p==e;var g=-1,w=!0,D=n&iL?new nL:void 0;for(o.set(e,t),o.set(t,e);++g<u;){var S=e[g],T=t[g];if(r)var E=s?r(T,S,g,t,e,o):r(S,T,g,e,t,o);if(E!==void 0){if(E)continue;w=!1;break}if(D){if(!rL(t,function(A,N){if(!aL(D,N)&&(S===A||a(S,A,n,r,o)))return D.push(N)})){w=!1;break}}else if(!(S===T||a(S,T,n,r,o))){w=!1;break}}return o.delete(e),o.delete(t),w}var WE=sL,lL=Oi,cL=lL.Uint8Array,$E=cL;function uL(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}var dL=uL;function fL(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var hL=fL,yS=Kd,wS=$E,mL=jm,pL=WE,gL=dL,vL=hL,yL=1,wL=2,bL="[object Boolean]",DL="[object Date]",SL="[object Error]",IL="[object Map]",TL="[object Number]",EL="[object RegExp]",xL="[object Set]",CL="[object String]",ML="[object Symbol]",NL="[object ArrayBuffer]",kL="[object DataView]",bS=yS?yS.prototype:void 0,B0=bS?bS.valueOf:void 0;function AL(e,t,n,r,a,o,s){switch(n){case kL:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case NL:return!(e.byteLength!=t.byteLength||!o(new wS(e),new wS(t)));case bL:case DL:case TL:return mL(+e,+t);case SL:return e.name==t.name&&e.message==t.message;case EL:case CL:return e==t+"";case IL:var u=gL;case xL:var d=r&yL;if(u||(u=vL),e.size!=t.size&&!d)return!1;var m=s.get(e);if(m)return m==t;r|=wL,s.set(e,t);var p=pL(u(e),u(t),r,a,o,s);return s.delete(e),p;case ML:if(B0)return B0.call(e)==B0.call(t)}return!1}var OL=AL;function FL(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var Y1=FL,PL=Array.isArray,ho=PL,jL=Y1,LL=ho;function RL(e,t,n){var r=t(e);return LL(e)?r:jL(r,n(e))}var GE=RL;function _L(e,t){for(var n=-1,r=e==null?0:e.length,a=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[a++]=s)}return o}var HL=_L;function BL(){return[]}var qE=BL,YL=HL,zL=qE,UL=Object.prototype,VL=UL.propertyIsEnumerable,DS=Object.getOwnPropertySymbols,ZL=DS?function(e){return e==null?[]:(e=Object(e),YL(DS(e),function(t){return VL.call(e,t)}))}:zL,z1=ZL;function WL(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var $L=WL,GL=Qd,qL=xl,JL="[object Arguments]";function KL(e){return qL(e)&&GL(e)==JL}var QL=KL,SS=QL,XL=xl,JE=Object.prototype,eR=JE.hasOwnProperty,tR=JE.propertyIsEnumerable,nR=SS(function(){return arguments}())?SS:function(e){return XL(e)&&eR.call(e,"callee")&&!tR.call(e,"callee")},U1=nR,bv={exports:{}};function rR(){return!1}var aR=rR;bv.exports;(function(e,t){var n=Oi,r=aR,a=t&&!t.nodeType&&t,o=a&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===a,u=s?n.Buffer:void 0,d=u?u.isBuffer:void 0,m=d||r;e.exports=m})(bv,bv.exports);var Qv=bv.exports,oR=Qd,iR=F1,sR=xl,lR="[object Arguments]",cR="[object Array]",uR="[object Boolean]",dR="[object Date]",fR="[object Error]",hR="[object Function]",mR="[object Map]",pR="[object Number]",gR="[object Object]",vR="[object RegExp]",yR="[object Set]",wR="[object String]",bR="[object WeakMap]",DR="[object ArrayBuffer]",SR="[object DataView]",IR="[object Float32Array]",TR="[object Float64Array]",ER="[object Int8Array]",xR="[object Int16Array]",CR="[object Int32Array]",MR="[object Uint8Array]",NR="[object Uint8ClampedArray]",kR="[object Uint16Array]",AR="[object Uint32Array]",dn={};dn[IR]=dn[TR]=dn[ER]=dn[xR]=dn[CR]=dn[MR]=dn[NR]=dn[kR]=dn[AR]=!0;dn[lR]=dn[cR]=dn[DR]=dn[uR]=dn[SR]=dn[dR]=dn[fR]=dn[hR]=dn[mR]=dn[pR]=dn[gR]=dn[vR]=dn[yR]=dn[wR]=dn[bR]=!1;function OR(e){return sR(e)&&iR(e.length)&&!!dn[oR(e)]}var FR=OR;function PR(e){return function(t){return e(t)}}var Xv=PR,Dv={exports:{}};Dv.exports;(function(e,t){var n=jE,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===r,s=o&&n.process,u=function(){try{var d=a&&a.require&&a.require("util").types;return d||s&&s.binding&&s.binding("util")}catch{}}();e.exports=u})(Dv,Dv.exports);var V1=Dv.exports,jR=FR,LR=Xv,IS=V1,TS=IS&&IS.isTypedArray,RR=TS?LR(TS):jR,Z1=RR,_R=$L,HR=U1,BR=ho,YR=Qv,zR=P1,UR=Z1,VR=Object.prototype,ZR=VR.hasOwnProperty;function WR(e,t){var n=BR(e),r=!n&&HR(e),a=!n&&!r&&YR(e),o=!n&&!r&&!a&&UR(e),s=n||r||a||o,u=s?_R(e.length,String):[],d=u.length;for(var m in e)(t||ZR.call(e,m))&&!(s&&(m=="length"||a&&(m=="offset"||m=="parent")||o&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||zR(m,d)))&&u.push(m);return u}var KE=WR,$R=Object.prototype;function GR(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||$R;return e===n}var W1=GR;function qR(e,t){return function(n){return e(t(n))}}var QE=qR,JR=QE,KR=JR(Object.keys,Object),QR=KR,XR=W1,e_=QR,t_=Object.prototype,n_=t_.hasOwnProperty;function r_(e){if(!XR(e))return e_(e);var t=[];for(var n in Object(e))n_.call(e,n)&&n!="constructor"&&t.push(n);return t}var a_=r_,o_=KE,i_=a_,s_=Lm;function l_(e){return s_(e)?o_(e):i_(e)}var Hm=l_,c_=GE,u_=z1,d_=Hm;function f_(e){return c_(e,d_,u_)}var XE=f_,ES=XE,h_=1,m_=Object.prototype,p_=m_.hasOwnProperty;function g_(e,t,n,r,a,o){var s=n&h_,u=ES(e),d=u.length,m=ES(t),p=m.length;if(d!=p&&!s)return!1;for(var g=d;g--;){var w=u[g];if(!(s?w in t:p_.call(t,w)))return!1}var D=o.get(e),S=o.get(t);if(D&&S)return D==t&&S==e;var T=!0;o.set(e,t),o.set(t,e);for(var E=s;++g<d;){w=u[g];var A=e[w],N=t[w];if(r)var R=s?r(N,A,w,t,e,o):r(A,N,w,e,t,o);if(!(R===void 0?A===N||a(A,N,n,r,o):R)){T=!1;break}E||(E=w=="constructor")}if(T&&!E){var F=e.constructor,H=t.constructor;F!=H&&"constructor"in e&&"constructor"in t&&!(typeof F=="function"&&F instanceof F&&typeof H=="function"&&H instanceof H)&&(T=!1)}return o.delete(e),o.delete(t),T}var v_=g_,y_=Bc,w_=Oi,b_=y_(w_,"DataView"),D_=b_,S_=Bc,I_=Oi,T_=S_(I_,"Promise"),E_=T_,x_=Bc,C_=Oi,M_=x_(C_,"Set"),N_=M_,k_=Bc,A_=Oi,O_=k_(A_,"WeakMap"),F_=O_,Rw=D_,_w=_1,Hw=E_,Bw=N_,Yw=F_,ex=Qd,rf=ZE,xS="[object Map]",P_="[object Object]",CS="[object Promise]",MS="[object Set]",NS="[object WeakMap]",kS="[object DataView]",j_=rf(Rw),L_=rf(_w),R_=rf(Hw),__=rf(Bw),H_=rf(Yw),Sc=ex;(Rw&&Sc(new Rw(new ArrayBuffer(1)))!=kS||_w&&Sc(new _w)!=xS||Hw&&Sc(Hw.resolve())!=CS||Bw&&Sc(new Bw)!=MS||Yw&&Sc(new Yw)!=NS)&&(Sc=function(e){var t=ex(e),n=t==P_?e.constructor:void 0,r=n?rf(n):"";if(r)switch(r){case j_:return kS;case L_:return xS;case R_:return CS;case __:return MS;case H_:return NS}return t});var ey=Sc,Y0=B1,B_=WE,Y_=OL,z_=v_,AS=ey,OS=ho,FS=Qv,U_=Z1,V_=1,PS="[object Arguments]",jS="[object Array]",Ag="[object Object]",Z_=Object.prototype,LS=Z_.hasOwnProperty;function W_(e,t,n,r,a,o){var s=OS(e),u=OS(t),d=s?jS:AS(e),m=u?jS:AS(t);d=d==PS?Ag:d,m=m==PS?Ag:m;var p=d==Ag,g=m==Ag,w=d==m;if(w&&FS(e)){if(!FS(t))return!1;s=!0,p=!1}if(w&&!p)return o||(o=new Y0),s||U_(e)?B_(e,t,n,r,a,o):Y_(e,t,d,n,r,a,o);if(!(n&V_)){var D=p&&LS.call(e,"__wrapped__"),S=g&&LS.call(t,"__wrapped__");if(D||S){var T=D?e.value():e,E=S?t.value():t;return o||(o=new Y0),a(T,E,n,r,o)}}return w?(o||(o=new Y0),z_(e,t,n,r,a,o)):!1}var $_=W_,G_=$_,RS=xl;function tx(e,t,n,r,a){return e===t?!0:e==null||t==null||!RS(e)&&!RS(t)?e!==e&&t!==t:G_(e,t,n,r,tx,a)}var $1=tx,q_=$1;function J_(e,t){return q_(e,t)}var K_=J_;const Q_=Xn(K_);function z0(e,t){var n=j1(e);return n?n.innerHeight:t?e.clientHeight:Nc(e).height}function nx(e,t,n){e.closest&&!n&&e.closest(t);var r=e;do{if(QF(r,t))return r;r=r.parentElement}while(r&&r!==n&&r.nodeType===document.ELEMENT_NODE);return null}function X_(e,t,n,r){for(var a=e.length,o=n+(r?1:-1);r?o--:++o<a;)if(t(e[o],o,e))return o;return-1}var eH=X_,tH=B1,nH=$1,rH=1,aH=2;function oH(e,t,n,r){var a=n.length,o=a,s=!r;if(e==null)return!o;for(e=Object(e);a--;){var u=n[a];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<o;){u=n[a];var d=u[0],m=e[d],p=u[1];if(s&&u[2]){if(m===void 0&&!(d in e))return!1}else{var g=new tH;if(r)var w=r(m,p,d,e,t,g);if(!(w===void 0?nH(p,m,rH|aH,r,g):w))return!1}}return!0}var iH=oH,sH=Ds;function lH(e){return e===e&&!sH(e)}var rx=lH,cH=rx,uH=Hm;function dH(e){for(var t=uH(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,cH(a)]}return t}var fH=dH;function hH(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var ax=hH,mH=iH,pH=fH,gH=ax;function vH(e){var t=pH(e);return t.length==1&&t[0][2]?gH(t[0][0],t[0][1]):function(n){return n===e||mH(n,e,t)}}var yH=vH,wH=ho,bH=Rm,DH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,SH=/^\w*$/;function IH(e,t){if(wH(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||bH(e)?!0:SH.test(e)||!DH.test(e)||t!=null&&e in Object(t)}var G1=IH,ox=H1,TH="Expected a function";function q1(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(TH);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var s=e.apply(this,r);return n.cache=o.set(a,s)||o,s};return n.cache=new(q1.Cache||ox),n}q1.Cache=ox;var EH=q1,xH=EH,CH=500;function MH(e){var t=xH(e,function(r){return n.size===CH&&n.clear(),r}),n=t.cache;return t}var NH=MH,kH=NH,AH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,OH=/\\(\\)?/g,FH=kH(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(AH,function(n,r,a,o){t.push(a?o.replace(OH,"$1"):r||n)}),t}),PH=FH;function jH(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}var J1=jH,_S=Kd,LH=J1,RH=ho,_H=Rm,HH=1/0,HS=_S?_S.prototype:void 0,BS=HS?HS.toString:void 0;function ix(e){if(typeof e=="string")return e;if(RH(e))return LH(e,ix)+"";if(_H(e))return BS?BS.call(e):"";var t=e+"";return t=="0"&&1/e==-HH?"-0":t}var BH=ix,YH=BH;function zH(e){return e==null?"":YH(e)}var UH=zH,VH=ho,ZH=G1,WH=PH,$H=UH;function GH(e,t){return VH(e)?e:ZH(e,t)?[e]:WH($H(e))}var ty=GH,qH=Rm,JH=1/0;function KH(e){if(typeof e=="string"||qH(e))return e;var t=e+"";return t=="0"&&1/e==-JH?"-0":t}var Bm=KH,QH=ty,XH=Bm;function eB(e,t){t=QH(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[XH(t[n++])];return n&&n==r?e:void 0}var ny=eB,tB=ny;function nB(e,t,n){var r=e==null?void 0:tB(e,t);return r===void 0?n:r}var rB=nB;function aB(e,t){return e!=null&&t in Object(e)}var oB=aB,iB=ty,sB=U1,lB=ho,cB=P1,uB=F1,dB=Bm;function fB(e,t,n){t=iB(t,e);for(var r=-1,a=t.length,o=!1;++r<a;){var s=dB(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=a?o:(a=e==null?0:e.length,!!a&&uB(a)&&cB(s,a)&&(lB(e)||sB(e)))}var hB=fB,mB=oB,pB=hB;function gB(e,t){return e!=null&&pB(e,t,mB)}var vB=gB,yB=$1,wB=rB,bB=vB,DB=G1,SB=rx,IB=ax,TB=Bm,EB=1,xB=2;function CB(e,t){return DB(e)&&SB(t)?IB(TB(e),t):function(n){var r=wB(n,e);return r===void 0&&r===t?bB(n,e):yB(t,r,EB|xB)}}var MB=CB;function NB(e){return e}var ry=NB;function kB(e){return function(t){return t==null?void 0:t[e]}}var AB=kB,OB=ny;function FB(e){return function(t){return OB(t,e)}}var PB=FB,jB=AB,LB=PB,RB=G1,_B=Bm;function HB(e){return RB(e)?jB(_B(e)):LB(e)}var BB=HB,YB=yH,zB=MB,UB=ry,VB=ho,ZB=BB;function WB(e){return typeof e=="function"?e:e==null?UB:typeof e=="object"?VB(e)?zB(e[0],e[1]):YB(e):ZB(e)}var ay=WB,$B=eH,GB=ay,qB=_E,JB=Math.max;function KB(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:qB(n);return a<0&&(a=JB(r+a,0)),$B(e,GB(t),a)}var QB=KB;const XB=Xn(QB);var eY=Math.ceil,tY=Math.max;function nY(e,t,n,r){for(var a=-1,o=tY(eY((t-e)/(n||1)),0),s=Array(o);o--;)s[r?o:++a]=e,e+=n;return s}var rY=nY,aY=rY,oY=$v,U0=RE;function iY(e){return function(t,n,r){return r&&typeof r!="number"&&oY(t,n,r)&&(n=r=void 0),t=U0(t),n===void 0?(n=t,t=0):n=U0(n),r=r===void 0?t<n?1:-1:U0(r),aY(t,n,r,e)}}var sY=iY,lY=sY,cY=lY(),uY=cY;const dY=Xn(uY);var YS=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function fY(e,t){return!!(e===t||YS(e)&&YS(t))}function hY(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!fY(e[n],t[n]))return!1;return!0}function sx(e,t){t===void 0&&(t=hY);var n=null;function r(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];if(n&&n.lastThis===this&&t(a,n.lastArgs))return n.lastResult;var s=e.apply(this,a);return n={lastResult:s,lastArgs:a,lastThis:this},s}return r.clear=function(){n=null},r}var zS=Kd,mY=U1,pY=ho,US=zS?zS.isConcatSpreadable:void 0;function gY(e){return pY(e)||mY(e)||!!(US&&e&&e[US])}var vY=gY,yY=Y1,wY=vY;function lx(e,t,n,r,a){var o=-1,s=e.length;for(n||(n=wY),a||(a=[]);++o<s;){var u=e[o];t>0&&n(u)?t>1?lx(u,t-1,n,r,a):yY(a,u):r||(a[a.length]=u)}return a}var cx=lx;function bY(e){return function(t,n,r){for(var a=-1,o=Object(t),s=r(t),u=s.length;u--;){var d=s[e?u:++a];if(n(o[d],d,o)===!1)break}return t}}var DY=bY,SY=DY,IY=SY(),TY=IY,EY=TY,xY=Hm;function CY(e,t){return e&&EY(e,t,xY)}var K1=CY,MY=Lm;function NY(e,t){return function(n,r){if(n==null)return n;if(!MY(n))return e(n,r);for(var a=n.length,o=t?a:-1,s=Object(n);(t?o--:++o<a)&&r(s[o],o,s)!==!1;);return n}}var kY=NY,AY=K1,OY=kY,FY=OY(AY),PY=FY,jY=PY,LY=Lm;function RY(e,t){var n=-1,r=LY(e)?Array(e.length):[];return jY(e,function(a,o,s){r[++n]=t(a,o,s)}),r}var _Y=RY;function HY(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var BY=HY,VS=Rm;function YY(e,t){if(e!==t){var n=e!==void 0,r=e===null,a=e===e,o=VS(e),s=t!==void 0,u=t===null,d=t===t,m=VS(t);if(!u&&!m&&!o&&e>t||o&&s&&d&&!u&&!m||r&&s&&d||!n&&d||!a)return 1;if(!r&&!o&&!m&&e<t||m&&n&&a&&!r&&!o||u&&n&&a||!s&&a||!d)return-1}return 0}var zY=YY,UY=zY;function VY(e,t,n){for(var r=-1,a=e.criteria,o=t.criteria,s=a.length,u=n.length;++r<s;){var d=UY(a[r],o[r]);if(d){if(r>=u)return d;var m=n[r];return d*(m=="desc"?-1:1)}}return e.index-t.index}var ZY=VY,V0=J1,WY=ny,$Y=ay,GY=_Y,qY=BY,JY=Xv,KY=ZY,QY=ry,XY=ho;function ez(e,t,n){t.length?t=V0(t,function(o){return XY(o)?function(s){return WY(s,o.length===1?o[0]:o)}:o}):t=[QY];var r=-1;t=V0(t,JY($Y));var a=GY(e,function(o,s,u){var d=V0(t,function(m){return m(o)});return{criteria:d,index:++r,value:o}});return qY(a,function(o,s){return KY(o,s,n)})}var tz=ez;function nz(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 rz=nz,az=rz,ZS=Math.max;function oz(e,t,n){return t=ZS(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=ZS(r.length-t,0),s=Array(o);++a<o;)s[a]=r[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=r[a];return u[t]=n(s),az(e,this,u)}}var ux=oz;function iz(e){return function(){return e}}var sz=iz,lz=Bc,cz=function(){try{var e=lz(Object,"defineProperty");return e({},"",{}),e}catch{}}(),dx=cz,uz=sz,WS=dx,dz=ry,fz=WS?function(e,t){return WS(e,"toString",{configurable:!0,enumerable:!1,value:uz(t),writable:!0})}:dz,hz=fz,mz=800,pz=16,gz=Date.now;function vz(e){var t=0,n=0;return function(){var r=gz(),a=pz-(r-n);if(n=r,a>0){if(++t>=mz)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var yz=vz,wz=hz,bz=yz,Dz=bz(wz),fx=Dz,Sz=ry,Iz=ux,Tz=fx;function Ez(e,t){return Tz(Iz(e,t,Sz),e+"")}var hx=Ez,xz=cx,Cz=tz,Mz=hx,$S=$v,Nz=Mz(function(e,t){if(e==null)return[];var n=t.length;return n>1&&$S(e,t[0],t[1])?t=[]:n>2&&$S(t[0],t[1],t[2])&&(t=[t[0]]),Cz(e,xz(t,1),[])}),kz=Nz;const Az=Xn(kz);function zw(e,t){var n=j1(e);return n?n.innerWidth:t?e.clientWidth:Nc(e).width}function mx(e){return yE(e)||FE(e)||N1(e)||wE()}function Oz(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var px=Oz,GS=dx;function Fz(e,t,n){t=="__proto__"&&GS?GS(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Q1=Fz,Pz=Q1,jz=jm,Lz=Object.prototype,Rz=Lz.hasOwnProperty;function _z(e,t,n){var r=e[t];(!(Rz.call(e,t)&&jz(r,n))||n===void 0&&!(t in e))&&Pz(e,t,n)}var gx=_z,Hz=gx,Bz=Q1;function Yz(e,t,n,r){var a=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var u=t[o],d=r?r(n[u],e[u],u,n,e):void 0;d===void 0&&(d=e[u]),a?Bz(n,u,d):Hz(n,u,d)}return n}var Ym=Yz,zz=Ym,Uz=Hm;function Vz(e,t){return e&&zz(t,Uz(t),e)}var Zz=Vz;function Wz(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var $z=Wz,Gz=Ds,qz=W1,Jz=$z,Kz=Object.prototype,Qz=Kz.hasOwnProperty;function Xz(e){if(!Gz(e))return Jz(e);var t=qz(e),n=[];for(var r in e)r=="constructor"&&(t||!Qz.call(e,r))||n.push(r);return n}var eU=Xz,tU=KE,nU=eU,rU=Lm;function aU(e){return rU(e)?tU(e,!0):nU(e)}var oy=aU,oU=Ym,iU=oy;function sU(e,t){return e&&oU(t,iU(t),e)}var lU=sU,Sv={exports:{}};Sv.exports;(function(e,t){var n=Oi,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===r,s=o?n.Buffer:void 0,u=s?s.allocUnsafe:void 0;function d(m,p){if(p)return m.slice();var g=m.length,w=u?u(g):new m.constructor(g);return m.copy(w),w}e.exports=d})(Sv,Sv.exports);var cU=Sv.exports;function uU(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var dU=uU,fU=Ym,hU=z1;function mU(e,t){return fU(e,hU(e),t)}var pU=mU,gU=QE,vU=gU(Object.getPrototypeOf,Object),iy=vU,yU=Y1,wU=iy,bU=z1,DU=qE,SU=Object.getOwnPropertySymbols,IU=SU?function(e){for(var t=[];e;)yU(t,bU(e)),e=wU(e);return t}:DU,vx=IU,TU=Ym,EU=vx;function xU(e,t){return TU(e,EU(e),t)}var CU=xU,MU=GE,NU=vx,kU=oy;function AU(e){return MU(e,kU,NU)}var yx=AU,OU=Object.prototype,FU=OU.hasOwnProperty;function PU(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&FU.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var jU=PU,qS=$E;function LU(e){var t=new e.constructor(e.byteLength);return new qS(t).set(new qS(e)),t}var X1=LU,RU=X1;function _U(e,t){var n=t?RU(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var HU=_U,BU=/\w*$/;function YU(e){var t=new e.constructor(e.source,BU.exec(e));return t.lastIndex=e.lastIndex,t}var zU=YU,JS=Kd,KS=JS?JS.prototype:void 0,QS=KS?KS.valueOf:void 0;function UU(e){return QS?Object(QS.call(e)):{}}var VU=UU,ZU=X1;function WU(e,t){var n=t?ZU(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var $U=WU,GU=X1,qU=HU,JU=zU,KU=VU,QU=$U,XU="[object Boolean]",eV="[object Date]",tV="[object Map]",nV="[object Number]",rV="[object RegExp]",aV="[object Set]",oV="[object String]",iV="[object Symbol]",sV="[object ArrayBuffer]",lV="[object DataView]",cV="[object Float32Array]",uV="[object Float64Array]",dV="[object Int8Array]",fV="[object Int16Array]",hV="[object Int32Array]",mV="[object Uint8Array]",pV="[object Uint8ClampedArray]",gV="[object Uint16Array]",vV="[object Uint32Array]";function yV(e,t,n){var r=e.constructor;switch(t){case sV:return GU(e);case XU:case eV:return new r(+e);case lV:return qU(e,n);case cV:case uV:case dV:case fV:case hV:case mV:case pV:case gV:case vV:return QU(e,n);case tV:return new r;case nV:case oV:return new r(e);case rV:return JU(e);case aV:return new r;case iV:return KU(e)}}var wV=yV,bV=Ds,XS=Object.create,DV=function(){function e(){}return function(t){if(!bV(t))return{};if(XS)return XS(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),wx=DV,SV=wx,IV=iy,TV=W1;function EV(e){return typeof e.constructor=="function"&&!TV(e)?SV(IV(e)):{}}var xV=EV,CV=ey,MV=xl,NV="[object Map]";function kV(e){return MV(e)&&CV(e)==NV}var AV=kV,OV=AV,FV=Xv,e2=V1,t2=e2&&e2.isMap,PV=t2?FV(t2):OV,jV=PV,LV=ey,RV=xl,_V="[object Set]";function HV(e){return RV(e)&&LV(e)==_V}var BV=HV,YV=BV,zV=Xv,n2=V1,r2=n2&&n2.isSet,UV=r2?zV(r2):YV,VV=UV,ZV=B1,WV=px,$V=gx,GV=Zz,qV=lU,JV=cU,KV=dU,QV=pU,XV=CU,eZ=XE,tZ=yx,nZ=ey,rZ=jU,aZ=wV,oZ=xV,iZ=ho,sZ=Qv,lZ=jV,cZ=Ds,uZ=VV,dZ=Hm,fZ=oy,hZ=1,mZ=2,pZ=4,bx="[object Arguments]",gZ="[object Array]",vZ="[object Boolean]",yZ="[object Date]",wZ="[object Error]",Dx="[object Function]",bZ="[object GeneratorFunction]",DZ="[object Map]",SZ="[object Number]",Sx="[object Object]",IZ="[object RegExp]",TZ="[object Set]",EZ="[object String]",xZ="[object Symbol]",CZ="[object WeakMap]",MZ="[object ArrayBuffer]",NZ="[object DataView]",kZ="[object Float32Array]",AZ="[object Float64Array]",OZ="[object Int8Array]",FZ="[object Int16Array]",PZ="[object Int32Array]",jZ="[object Uint8Array]",LZ="[object Uint8ClampedArray]",RZ="[object Uint16Array]",_Z="[object Uint32Array]",ln={};ln[bx]=ln[gZ]=ln[MZ]=ln[NZ]=ln[vZ]=ln[yZ]=ln[kZ]=ln[AZ]=ln[OZ]=ln[FZ]=ln[PZ]=ln[DZ]=ln[SZ]=ln[Sx]=ln[IZ]=ln[TZ]=ln[EZ]=ln[xZ]=ln[jZ]=ln[LZ]=ln[RZ]=ln[_Z]=!0;ln[wZ]=ln[Dx]=ln[CZ]=!1;function Kg(e,t,n,r,a,o){var s,u=t&hZ,d=t&mZ,m=t&pZ;if(n&&(s=a?n(e,r,a,o):n(e)),s!==void 0)return s;if(!cZ(e))return e;var p=iZ(e);if(p){if(s=rZ(e),!u)return KV(e,s)}else{var g=nZ(e),w=g==Dx||g==bZ;if(sZ(e))return JV(e,u);if(g==Sx||g==bx||w&&!a){if(s=d||w?{}:oZ(e),!u)return d?XV(e,qV(s,e)):QV(e,GV(s,e))}else{if(!ln[g])return a?e:{};s=aZ(e,g,u)}}o||(o=new ZV);var D=o.get(e);if(D)return D;o.set(e,s),uZ(e)?e.forEach(function(E){s.add(Kg(E,t,n,E,e,o))}):lZ(e)&&e.forEach(function(E,A){s.set(A,Kg(E,t,n,A,e,o))});var S=m?d?tZ:eZ:d?fZ:dZ,T=p?void 0:S(e);return WV(T||e,function(E,A){T&&(A=E,E=e[A]),$V(s,A,Kg(E,t,n,A,e,o))}),s}var HZ=Kg;function BZ(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var YZ=BZ,zZ=ny,UZ=PE;function VZ(e,t){return t.length<2?e:zZ(e,UZ(t,0,-1))}var ZZ=VZ,WZ=ty,$Z=YZ,GZ=ZZ,qZ=Bm;function JZ(e,t){return t=WZ(t,e),e=GZ(e,t),e==null||delete e[qZ($Z(t))]}var KZ=JZ,QZ=Qd,XZ=iy,eW=xl,tW="[object Object]",nW=Function.prototype,rW=Object.prototype,Ix=nW.toString,aW=rW.hasOwnProperty,oW=Ix.call(Object);function iW(e){if(!eW(e)||QZ(e)!=tW)return!1;var t=XZ(e);if(t===null)return!0;var n=aW.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ix.call(n)==oW}var sW=iW,lW=sW;function cW(e){return lW(e)?void 0:e}var uW=cW,dW=cx;function fW(e){var t=e==null?0:e.length;return t?dW(e,1):[]}var hW=fW,mW=hW,pW=ux,gW=fx;function vW(e){return gW(pW(e,void 0,mW),e+"")}var yW=vW,wW=J1,bW=HZ,DW=KZ,SW=ty,IW=Ym,TW=uW,EW=yW,xW=yx,CW=1,MW=2,NW=4,kW=EW(function(e,t){var n={};if(e==null)return n;var r=!1;t=wW(t,function(o){return o=SW(o,e),r||(r=o.length>1),o}),IW(e,xW(e),n),r&&(n=bW(n,CW|MW|NW,TW));for(var a=t.length;a--;)DW(n,t[a]);return n}),AW=kW;const OW=Xn(AW);var FW=hx,PW=jm,jW=$v,LW=oy,Tx=Object.prototype,RW=Tx.hasOwnProperty,_W=FW(function(e,t){e=Object(e);var n=-1,r=t.length,a=r>2?t[2]:void 0;for(a&&jW(t[0],t[1],a)&&(r=1);++n<r;)for(var o=t[n],s=LW(o),u=-1,d=s.length;++u<d;){var m=s[u],p=e[m];(p===void 0||PW(p,Tx[m])&&!RW.call(e,m))&&(e[m]=o[m])}return e}),HW=_W;const BW=Xn(HW);var YW=px,zW=wx,UW=K1,VW=ay,ZW=iy,WW=ho,$W=Qv,GW=O1,qW=Ds,JW=Z1;function KW(e,t,n){var r=WW(e),a=r||$W(e)||JW(e);if(t=VW(t),n==null){var o=e&&e.constructor;a?n=r?new o:[]:qW(e)?n=GW(o)?zW(ZW(e)):{}:n={}}return(a?YW:UW)(e,function(s,u,d){return t(n,s,u,d)}),n}var QW=KW;const XW=Xn(QW);var e$=Q1,t$=K1,n$=ay;function r$(e,t){var n={};return t=n$(t),t$(e,function(r,a,o){e$(n,a,t(r,a,o))}),n}var a$=r$;const o$=Xn(a$);var i$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){return function(n,r,a){r.prototype.isBetween=function(o,s,u,d){var m=a(o),p=a(s),g=(d=d||"()")[0]==="(",w=d[1]===")";return(g?this.isAfter(m,u):!this.isBefore(m,u))&&(w?this.isBefore(p,u):!this.isAfter(p,u))||(g?this.isBefore(m,u):!this.isAfter(m,u))&&(w?this.isAfter(p,u):!this.isBefore(p,u))}}})})(i$);var s$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){return function(n,r){r.prototype.isSameOrAfter=function(a,o){return this.isSame(a,o)||this.isAfter(a,o)}}})})(s$);var l$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){return function(n,r){r.prototype.isSameOrBefore=function(a,o){return this.isSame(a,o)||this.isBefore(a,o)}}})})(l$);var c$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){return function(n,r,a){var o=r.prototype,s=function(g){return g&&(g.indexOf?g:g.s)},u=function(g,w,D,S,T){var E=g.name?g:g.$locale(),A=s(E[w]),N=s(E[D]),R=A||N.map(function(H){return H.slice(0,S)});if(!T)return R;var F=E.weekStart;return R.map(function(H,P){return R[(P+(F||0))%7]})},d=function(){return a.Ls[a.locale()]},m=function(g,w){return g.formats[w]||function(D){return D.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(S,T,E){return T||E.slice(1)})}(g.formats[w.toUpperCase()])},p=function(){var g=this;return{months:function(w){return w?w.format("MMMM"):u(g,"months")},monthsShort:function(w){return w?w.format("MMM"):u(g,"monthsShort","months",3)},firstDayOfWeek:function(){return g.$locale().weekStart||0},weekdays:function(w){return w?w.format("dddd"):u(g,"weekdays")},weekdaysMin:function(w){return w?w.format("dd"):u(g,"weekdaysMin","weekdays",2)},weekdaysShort:function(w){return w?w.format("ddd"):u(g,"weekdaysShort","weekdays",3)},longDateFormat:function(w){return m(g.$locale(),w)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return p.bind(this)()},a.localeData=function(){var g=d();return{firstDayOfWeek:function(){return g.weekStart||0},weekdays:function(){return a.weekdays()},weekdaysShort:function(){return a.weekdaysShort()},weekdaysMin:function(){return a.weekdaysMin()},months:function(){return a.months()},monthsShort:function(){return a.monthsShort()},longDateFormat:function(w){return m(g,w)},meridiem:g.meridiem,ordinal:g.ordinal}},a.months=function(){return u(d(),"months")},a.monthsShort=function(){return u(d(),"monthsShort","months",3)},a.weekdays=function(g){return u(d(),"weekdays",null,null,g)},a.weekdaysShort=function(g){return u(d(),"weekdaysShort","weekdays",3,g)},a.weekdaysMin=function(g){return u(d(),"weekdaysMin","weekdays",2,g)}}})})(c$);var u$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,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,a,o){var s=a.prototype,u=s.format;o.en.formats=n,s.format=function(d){d===void 0&&(d="YYYY-MM-DDTHH:mm:ssZ");var m=this.$locale().formats,p=function(g,w){return g.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(D,S,T){var E=T&&T.toUpperCase();return S||w[T]||n[T]||w[E].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(A,N,R){return N||R.slice(1)})})}(d,m===void 0?{}:m);return u.call(this,p)}}})})(u$);var d$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){return function(n,r,a){var o=function(s,u){if(!u||!u.length||u.length===1&&!u[0]||u.length===1&&Array.isArray(u[0])&&!u[0].length)return null;var d;u.length===1&&u[0].length>0&&(u=u[0]),d=(u=u.filter(function(p){return p}))[0];for(var m=1;m<u.length;m+=1)u[m].isValid()&&!u[m][s](d)||(d=u[m]);return d};a.max=function(){var s=[].slice.call(arguments,0);return o("isAfter",s)},a.min=function(){var s=[].slice.call(arguments,0);return o("isBefore",s)}}})})(d$);var f$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(o,s,u){var d=s.prototype;u.utc=function(T){var E={date:T,utc:!0,args:arguments};return new s(E)},d.utc=function(T){var E=u(this.toDate(),{locale:this.$L,utc:!0});return T?E.add(this.utcOffset(),n):E},d.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var m=d.parse;d.parse=function(T){T.utc&&(this.$u=!0),this.$utils().u(T.$offset)||(this.$offset=T.$offset),m.call(this,T)};var p=d.init;d.init=function(){if(this.$u){var T=this.$d;this.$y=T.getUTCFullYear(),this.$M=T.getUTCMonth(),this.$D=T.getUTCDate(),this.$W=T.getUTCDay(),this.$H=T.getUTCHours(),this.$m=T.getUTCMinutes(),this.$s=T.getUTCSeconds(),this.$ms=T.getUTCMilliseconds()}else p.call(this)};var g=d.utcOffset;d.utcOffset=function(T,E){var A=this.$utils().u;if(A(T))return this.$u?0:A(this.$offset)?g.call(this):this.$offset;if(typeof T=="string"&&(T=function(H){H===void 0&&(H="");var P=H.match(r);if(!P)return null;var L=(""+P[0]).match(a)||["-",0,0],z=L[0],U=60*+L[1]+ +L[2];return U===0?0:z==="+"?U:-U}(T),T===null))return this;var N=Math.abs(T)<=16?60*T:T,R=this;if(E)return R.$offset=N,R.$u=T===0,R;if(T!==0){var F=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(R=this.local().add(N+F,n)).$offset=N,R.$x.$localOffset=F}else R=this.utc();return R};var w=d.format;d.format=function(T){var E=T||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return w.call(this,E)},d.valueOf=function(){var T=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*T},d.isUTC=function(){return!!this.$u},d.toISOString=function(){return this.toDate().toISOString()},d.toString=function(){return this.toDate().toUTCString()};var D=d.toDate;d.toDate=function(T){return T==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():D.call(this)};var S=d.diff;d.diff=function(T,E,A){if(T&&this.$u===T.$u)return S.call(this,T,E,A);var N=this.local(),R=u(T).local();return S.call(N,R,E,A)}}})})(f$);function cs(e){return e.children}var Da={PREVIOUS:"PREV",NEXT:"NEXT",TODAY:"TODAY",DATE:"DATE"},Qr={MONTH:"month",WEEK:"week",WORK_WEEK:"work_week",DAY:"day",AGENDA:"agenda"},a2=Object.keys(Qr).map(function(e){return Qr[e]});Ae.oneOfType([Ae.string,Ae.func]);Ae.any;Ae.func;Ae.oneOfType([Ae.arrayOf(Ae.oneOf(a2)),Ae.objectOf(function(e,t){var n=a2.indexOf(t)!==-1&&typeof e[t]=="boolean";if(n)return null;for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];return Ae.elementType.apply(Ae,[e,t].concat(a))})]);Ae.oneOfType([Ae.oneOf(["overlap","no-overlap"]),Ae.func]);function vn(e,t){e&&e.apply(null,[].concat(t))}var o2={seconds:1e3,minutes:1e3*60,hours:1e3*60*60,day:1e3*60*60*24};function Ex(e,t){var n=Cr(e,"month");return Cr(n,"week",t.startOfWeek())}function xx(e,t){var n=vv(e,"month");return vv(n,"week",t.startOfWeek())}function h$(e,t){for(var n=Ex(e,t),r=xx(e,t),a=[];qd(n,r,"day");)a.push(n),n=Ho(n,1,"day");return a}function m$(e,t){var n=Cr(e,t);return Fm(n,e)?n:Ho(n,1,t)}function p$(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",r=e,a=[];qd(r,t,n);)a.push(r),r=Ho(r,1,n);return a}function g$(e,t){return t==null&&e==null?null:(t==null&&(t=new Date),e==null&&(e=new Date),e=Cr(e,"day"),e=um(e,um(t)),e=Ld(e,Ld(t)),e=cm(e,cm(t)),lm(e,lm(t)))}function i2(e){return um(e)===0&&Ld(e)===0&&cm(e)===0&&lm(e)===0}function v$(e,t,n,r){return n==="day"&&(n="date"),Math.abs(KD[n](e,void 0,r)-KD[n](t,void 0,r))}function eb(e,t,n){return!n||n==="milliseconds"?Math.abs(+e-+t):Math.round(Math.abs(+Cr(e,n)/o2[n]-+Cr(t,n)/o2[n]))}var y$=Ae.oneOfType([Ae.string,Ae.func]);function w$(e,t,n,r,a){var o=typeof r=="function"?r(n,a,e):t.call(e,n,r,a);return nm(o==null||typeof o=="string","`localizer format(..)` must return a string, null, or undefined"),o}function b$(e,t,n){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,t+n,0,0)}function tb(e,t){return e.getTimezoneOffset()-t.getTimezoneOffset()}function D$(e,t){return eb(e,t,"minutes")+tb(e,t)}function S$(e){var t=Cr(e,"day");return eb(t,e,"minutes")+tb(t,e)}function I$(e,t){return A1(e,t,"day")}function T$(e,t,n){var r=Fm(e,t,"minutes");return r?Pm(t,n,"minutes"):Wv(t,n,"minutes")}function Uw(e,t){return v$(e,t,"day")}function E$(e){var t=e.evtA,n=t.start,r=t.end,a=t.allDay,o=e.evtB,s=o.start,u=o.end,d=o.allDay,m=+Cr(n,"day")-+Cr(s,"day"),p=Uw(n,r),g=Uw(s,u);return m||g-p||!!d-!!a||+n-+s||+r-+u}function x$(e){var t=e.event,n=t.start,r=t.end,a=e.range,o=a.start,s=a.end,u=Cr(n,"day"),d=qd(u,s,"day"),m=k1(u,r,"minutes"),p=m?Wv(r,o,"minutes"):Pm(r,o,"minutes");return d&&p}function C$(e,t){return Fm(e,t,"day")}function M$(e,t){return i2(e)&&i2(t)}var N$=gr(function e(t){var n=this;pr(this,e),nm(typeof t.format=="function","date localizer `format(..)` must be a function"),nm(typeof t.firstOfWeek=="function","date localizer `firstOfWeek(..)` must be a function"),this.propType=t.propType||y$,this.formats=t.formats,this.format=function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return w$.apply(void 0,[n,t.format].concat(a))},this.startOfWeek=t.firstOfWeek,this.merge=t.merge||g$,this.inRange=t.inRange||NE,this.lt=t.lt||A1,this.lte=t.lte||qd,this.gt=t.gt||Wv,this.gte=t.gte||Pm,this.eq=t.eq||Fm,this.neq=t.neq||k1,this.startOf=t.startOf||Cr,this.endOf=t.endOf||vv,this.add=t.add||Ho,this.range=t.range||p$,this.diff=t.diff||eb,this.ceil=t.ceil||m$,this.min=t.min||CE,this.max=t.max||ME,this.minutes=t.minutes||Ld,this.daySpan=t.daySpan||Uw,this.firstVisibleDay=t.firstVisibleDay||Ex,this.lastVisibleDay=t.lastVisibleDay||xx,this.visibleDays=t.visibleDays||h$,this.getSlotDate=t.getSlotDate||b$,this.getTimezoneOffset=t.getTimezoneOffset||function(r){return r.getTimezoneOffset()},this.getDstOffset=t.getDstOffset||tb,this.getTotalMin=t.getTotalMin||D$,this.getMinutesFromMidnight=t.getMinutesFromMidnight||S$,this.continuesPrior=t.continuesPrior||I$,this.continuesAfter=t.continuesAfter||T$,this.sortEvents=t.sortEvents||E$,this.inEventRange=t.inEventRange||x$,this.isSameDate=t.isSameDate||C$,this.startAndEndAreDateOnly=t.startAndEndAreDateOnly||M$,this.segmentOffset=t.browserTZOffset?t.browserTZOffset():0});function k$(e,t,n,r){var a=nn(nn({},e.formats),n);return nn(nn({},e),{},{messages:r,startOfWeek:function(){return e.startOfWeek(t)},format:function(s,u){return e.format(s,a[u]||u,t)}})}var A$={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 O$(e){return nn(nn({},A$),e)}function F$(e){var t=e.ref,n=e.callback;O.useEffect(function(){var r=function(o){t.current&&!t.current.contains(o.target)&&n()};return document.addEventListener("mousedown",r),function(){document.removeEventListener("mousedown",r)}},[t,n])}var P$=["style","className","event","selected","isAllDay","onSelect","onDoubleClick","onKeyPress","localizer","continuesPrior","continuesAfter","accessors","getters","children","components","slotStart","slotEnd"],Cx=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){var r=this.props,a=r.style,o=r.className,s=r.event,u=r.selected,d=r.isAllDay,m=r.onSelect,p=r.onDoubleClick,g=r.onKeyPress,w=r.localizer,D=r.continuesPrior,S=r.continuesAfter,T=r.accessors,E=r.getters,A=r.children,N=r.components,R=N.event,F=N.eventWrapper,H=r.slotStart,P=r.slotEnd,L=Ai(r,P$);delete L.resizable;var z=T.title(s),U=T.tooltip(s),W=T.end(s),K=T.start(s),ae=T.allDay(s),ce=d||ae||w.diff(K,w.ceil(W,"day"),"day")>1,fe=E.eventProp(s,K,W,u),ie=q.createElement("div",{className:"rbc-event-content",title:U||void 0},R?q.createElement(R,{event:s,continuesPrior:D,continuesAfter:S,title:z,isAllDay:ae,localizer:w,slotStart:H,slotEnd:P}):z);return q.createElement(F,Object.assign({},this.props,{type:"date"}),q.createElement("div",Object.assign({},L,{style:nn(nn({},fe.style),a),className:Qn("rbc-event",o,fe.className,{"rbc-selected":u,"rbc-event-allday":ce,"rbc-event-continues-prior":D,"rbc-event-continues-after":S}),onClick:function(Te){return m&&m(s,Te)},onDoubleClick:function(Te){return p&&p(s,Te)},onKeyDown:function(Te){return g&&g(s,Te)}}),typeof A=="function"?A(ie):ie))}}]),t}(q.Component);function sy(e,t){return!e||t==null?!1:Q_(e,t)}function Mx(e,t){var n=e.right-e.left,r=n/t;return r}function Nx(e,t,n,r){var a=Mx(e,r);return n?r-1-Math.floor((t-e.left)/a):Math.floor((t-e.left)/a)}function j$(e,t){var n=t.x,r=t.y;return r>=e.top&&r<=e.bottom&&n>=e.left&&n<=e.right}function L$(e,t,n,r,a){var o=-1,s=-1,u=r-1,d=Mx(t,r),m=Nx(t,n.x,a,r),p=t.top<n.y&&t.bottom>n.y,g=t.top<e.y&&t.bottom>e.y,w=e.y>t.bottom,D=t.top>e.y,S=n.top<t.top&&n.bottom>t.bottom;return S&&(o=0,s=u),p&&(D?(o=0,s=m):w&&(o=m,s=u)),g&&(o=s=a?u-Math.floor((e.x-t.left)/d):Math.floor((e.x-t.left)/d),p?m<o?o=m:s=m:e.y<n.y?s=u:o=0),{startIdx:o,endIdx:s}}function R$(e){var t=e.target,n=e.offset,r=e.container,a=e.box,o=Nc(t),s=o.top,u=o.left,d=o.width,m=o.height,p=Nc(r),g=p.top,w=p.left,D=p.width,S=p.height,T=Nc(a),E=T.width,A=T.height,N=g+S,R=w+D,F=s+A,H=u+E,P=n.x,L=n.y,z=F>N?s-A-L:s+L+m,U=H>R?u+P-E+d:u+P;return{topOffset:z,leftOffset:U}}function _$(e){var t=e.containerRef,n=e.accessors,r=e.getters,a=e.selected,o=e.components,s=e.localizer,u=e.position,d=e.show,m=e.events,p=e.slotStart,g=e.slotEnd,w=e.onSelect,D=e.onDoubleClick,S=e.onKeyPress,T=e.handleDragStart,E=e.popperRef,A=e.target,N=e.offset;F$({ref:E,callback:d}),O.useLayoutEffect(function(){var H=R$({target:A,offset:N,container:t.current,box:E.current}),P=H.topOffset,L=H.leftOffset;E.current.style.top="".concat(P,"px"),E.current.style.left="".concat(L,"px")},[N.x,N.y,A]);var R=u.width,F={minWidth:R+R/2};return q.createElement("div",{style:F,className:"rbc-overlay",ref:E},q.createElement("div",{className:"rbc-overlay-header"},s.format(p,"dayHeaderFormat")),m.map(function(H,P){return q.createElement(Cx,{key:P,type:"popup",localizer:s,event:H,getters:r,onSelect:w,accessors:n,components:o,onDoubleClick:D,onKeyPress:S,continuesPrior:s.lt(n.end(H),p,"day"),continuesAfter:s.gte(n.start(H),g,"day"),slotStart:p,slotEnd:g,selected:sy(H,a),draggable:!0,onDragStart:function(){return T(H)},onDragEnd:function(){return d()}})}))}var kx=q.forwardRef(function(e,t){return q.createElement(_$,Object.assign({},e,{popperRef:t}))});kx.propTypes={accessors:Ae.object.isRequired,getters:Ae.object.isRequired,selected:Ae.object,components:Ae.object.isRequired,localizer:Ae.object.isRequired,position:Ae.object.isRequired,show:Ae.func.isRequired,events:Ae.array.isRequired,slotStart:Ae.instanceOf(Date).isRequired,slotEnd:Ae.instanceOf(Date),onSelect:Ae.func,onDoubleClick:Ae.func,onKeyPress:Ae.func,handleDragStart:Ae.func,style:Ae.object,offset:Ae.shape({x:Ae.number,y:Ae.number})};function H$(e){var t=e.containerRef,n=e.popupOffset,r=n===void 0?5:n,a=e.overlay,o=e.accessors,s=e.localizer,u=e.components,d=e.getters,m=e.selected,p=e.handleSelectEvent,g=e.handleDoubleClickEvent,w=e.handleKeyPressEvent,D=e.handleDragStart,S=e.onHide,T=e.overlayDisplay,E=O.useRef(null);if(!a.position)return null;var A=r;isNaN(r)||(A={x:r,y:r});var N=a.position,R=a.events,F=a.date,H=a.end;return q.createElement(E7,{rootClose:!0,flip:!0,show:!0,placement:"bottom",onHide:S,target:a.target},function(P){var L=P.props;return q.createElement(kx,Object.assign({},L,{containerRef:t,ref:E,target:a.target,offset:A,accessors:o,getters:d,selected:m,components:u,localizer:s,position:N,show:T,events:R,slotStart:F,slotEnd:H,onSelect:p,onDoubleClick:g,onKeyPress:w,handleDragStart:D}))})}var nb=q.forwardRef(function(e,t){return q.createElement(H$,Object.assign({},e,{containerRef:t}))});nb.propTypes={popupOffset:Ae.oneOfType([Ae.number,Ae.shape({x:Ae.number,y:Ae.number})]),overlay:Ae.shape({position:Ae.object,events:Ae.array,date:Ae.instanceOf(Date),end:Ae.instanceOf(Date)}),accessors:Ae.object.isRequired,localizer:Ae.object.isRequired,components:Ae.object.isRequired,getters:Ae.object.isRequired,selected:Ae.object,handleSelectEvent:Ae.func,handleDoubleClickEvent:Ae.func,handleKeyPressEvent:Ae.func,handleDragStart:Ae.func,onHide:Ae.func,overlayDisplay:Ae.func};function Lr(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document;return Uh(n,e,t,{passive:!1})}function B$(e,t,n){return!e||dm(e,document.elementFromPoint(t,n))}function Y$(e,t){var n=t.clientX,r=t.clientY,a=document.elementFromPoint(n,r);return nx(a,".rbc-event",e)}function z$(e,t){var n=t.clientX,r=t.clientY,a=document.elementFromPoint(n,r);return nx(a,".rbc-show-more",e)}function Iv(e,t){return!!Y$(e,t)}function U$(e,t){return!!z$(e,t)}function wd(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 s2=5,V$=250,Ax=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.global,a=r===void 0?!1:r,o=n.longPressThreshold,s=o===void 0?250:o,u=n.validContainers,d=u===void 0?[]:u;pr(this,e),this.isDetached=!1,this.container=t,this.globalMouse=!t||a,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=Lr("touchmove",function(){},window),this._removeKeyDownListener=Lr("keydown",this._keyListener),this._removeKeyUpListener=Lr("keyup",this._keyListener),this._removeDropFromOutsideListener=Lr("drop",this._dropFromOutsideListener),this._removeDragOverFromOutsideListener=Lr("dragover",this._dragOverFromOutsideListener),this._addInitialEventListener()}return gr(e,[{key:"on",value:function(n,r){var a=this._listeners[n]||(this._listeners[n]=[]);return a.push(r),{remove:function(){var s=a.indexOf(r);s!==-1&&a.splice(s,1)}}}},{key:"emit",value:function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];var s,u=this._listeners[n]||[];return u.forEach(function(d){s===void 0&&(s=d.apply(void 0,a))}),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:l2(r,Lc(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 a=this,o=null,s=null,u=null,d=function(w){o=setTimeout(function(){p(),n(w)},a.longPressThreshold),s=Lr("touchmove",function(){return p()}),u=Lr("touchend",function(){return p()})},m=Lr("touchstart",d),p=function(){o&&clearTimeout(o),s&&s(),u&&u(),o=null,s=null,u=null};return r&&d(r),function(){p(),m()}}},{key:"_addInitialEventListener",value:function(){var n=this,r=Lr("mousedown",function(o){n._removeInitialEventListener(),n._handleInitialEvent(o),n._removeInitialEventListener=Lr("mousedown",n._handleInitialEvent)}),a=Lr("touchstart",function(o){n._removeInitialEventListener(),n._removeInitialEventListener=n._addLongPressListener(n._handleInitialEvent,o)});this._removeInitialEventListener=function(){r(),a()}}},{key:"_dropFromOutsideListener",value:function(n){var r=wd(n),a=r.pageX,o=r.pageY,s=r.clientX,u=r.clientY;this.emit("dropFromOutside",{x:a,y:o,clientX:s,clientY:u}),n.preventDefault()}},{key:"_dragOverFromOutsideListener",value:function(n){var r=wd(n),a=r.pageX,o=r.pageY,s=r.clientX,u=r.clientY;this.emit("dragOverFromOutside",{x:a,y:o,clientX:s,clientY:u}),n.preventDefault()}},{key:"_handleInitialEvent",value:function(n){if(!this.isDetached){var r=wd(n),a=r.clientX,o=r.clientY,s=r.pageX,u=r.pageY,d=this.container(),m,p;if(!(n.which===3||n.button===2||!B$(d,a,o))){if(!this.globalMouse&&d&&!dm(d,n.target)){var g=Z$(0),w=g.top,D=g.left,S=g.bottom,T=g.right;if(p=Lc(d),m=l2({top:p.top-w,left:p.left-D,bottom:p.bottom+S,right:p.right+T},{top:u,left:s}),!m)return}var E=this.emit("beforeSelect",this._initialEventData={isTouch:/^touch/.test(n.type),x:s,y:u,clientX:a,clientY:o});if(E!==!1)switch(n.type){case"mousedown":this._removeEndListener=Lr("mouseup",this._handleTerminatingEvent),this._onEscListener=Lr("keydown",this._handleTerminatingEvent),this._removeMoveListener=Lr("mousemove",this._handleMoveEvent);break;case"touchstart":this._handleMoveEvent(n),this._removeEndListener=Lr("touchend",this._handleTerminatingEvent),this._removeMoveListener=Lr("touchmove",this._handleMoveEvent);break}}}}},{key:"_isWithinValidContainer",value:function(n){var r=n.target,a=this.validContainers;return!a||!a.length||!r?!0:a.some(function(o){return!!r.closest(o)})}},{key:"_handleTerminatingEvent",value:function(n){var r=wd(n),a=r.pageX,o=r.pageY;if(this.selecting=!1,this._removeEndListener&&this._removeEndListener(),this._removeMoveListener&&this._removeMoveListener(),!!this._initialEventData){var s=!this.container||dm(this.container(),n.target),u=this._isWithinValidContainer(n),d=this._selectRect,m=this.isClick(a,o);return this._initialEventData=null,n.key==="Escape"||!u?this.emit("reset"):m&&s?this._handleClickEvent(n):m?this.emit("reset"):this.emit("select",d)}}},{key:"_handleClickEvent",value:function(n){var r=wd(n),a=r.pageX,o=r.pageY,s=r.clientX,u=r.clientY,d=new Date().getTime();return this._lastClickData&&d-this._lastClickData.timestamp<V$?(this._lastClickData=null,this.emit("doubleClick",{x:a,y:o,clientX:s,clientY:u})):(this._lastClickData={timestamp:d},this.emit("click",{x:a,y:o,clientX:s,clientY:u}))}},{key:"_handleMoveEvent",value:function(n){if(!(this._initialEventData===null||this.isDetached)){var r=this._initialEventData,a=r.x,o=r.y,s=wd(n),u=s.pageX,d=s.pageY,m=Math.abs(a-u),p=Math.abs(o-d),g=Math.min(u,a),w=Math.min(d,o),D=this.selecting;this.isClick(u,d)&&!D&&!(m||p)||(this.selecting=!0,this._selectRect={top:w,left:g,x:u,y:d,right:g+m,bottom:w+p},D||this.emit("selectStart",this._initialEventData),this.isClick(u,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 a=this._initialEventData,o=a.x,s=a.y,u=a.isTouch;return!u&&Math.abs(n-o)<=s2&&Math.abs(r-s)<=s2}}]),e}();function Z$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return ps(e)!=="object"&&(e={top:e,left:e,right:e,bottom:e}),e}function l2(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=Lc(e),a=r.top,o=r.left,s=r.right,u=s===void 0?o:s,d=r.bottom,m=d===void 0?a:d,p=Lc(t),g=p.top,w=p.left,D=p.right,S=D===void 0?w:D,T=p.bottom,E=T===void 0?g:T;return!(m-n<g||a+n>E||u-n<w||o+n>S)}function Lc(e){if(!e.getBoundingClientRect)return e;var t=e.getBoundingClientRect(),n=t.left+c2("left"),r=t.top+c2("top");return{top:r,left:n,right:(e.offsetWidth||0)+n,bottom:(e.offsetHeight||0)+r}}function c2(e){if(e==="left")return window.pageXOffset||document.body.scrollLeft||0;if(e==="top")return window.pageYOffset||document.body.scrollTop||0}var W$=function(e){ta(t,e);function t(n,r){var a;return pr(this,t),a=ea(this,t,[n,r]),a.state={selecting:!1},a.containerRef=O.createRef(),a}return gr(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,a=r.range,o=r.getNow,s=r.getters,u=r.date,d=r.components.dateCellWrapper,m=r.localizer,p=this.state,g=p.selecting,w=p.startIdx,D=p.endIdx,S=o();return q.createElement("div",{className:"rbc-row-bg",ref:this.containerRef},a.map(function(T,E){var A=g&&E>=w&&E<=D,N=s.dayProp(T),R=N.className,F=N.style;return q.createElement(d,{key:E,value:T,range:a},q.createElement("div",{style:F,className:Qn("rbc-day-bg",R,A&&"rbc-selected-cell",m.isSameDate(T,S)&&"rbc-today",u&&m.neq(u,T,"month")&&"rbc-off-range-bg")}))}))}},{key:"_selectable",value:function(){var r=this,a=this.containerRef.current,o=this._selector=new Ax(this.props.container,{longPressThreshold:this.props.longPressThreshold}),s=function(d,m){if(!Iv(a,d)&&!U$(a,d)){var p=Lc(a),g=r.props,w=g.range,D=g.rtl;if(j$(p,d)){var S=Nx(p,d.x,D,w.length);r._selectSlot({startIdx:S,endIdx:S,action:m,box:d})}}r._initial={},r.setState({selecting:!1})};o.on("selecting",function(u){var d=r.props,m=d.range,p=d.rtl,g=-1,w=-1;if(r.state.selecting||(vn(r.props.onSelectStart,[u]),r._initial={x:u.x,y:u.y}),o.isSelected(a)){var D=Lc(a),S=L$(r._initial,D,u,m.length,p);g=S.startIdx,w=S.endIdx}r.setState({selecting:!0,startIdx:g,endIdx:w})}),o.on("beforeSelect",function(u){if(r.props.selectable==="ignoreEvents")return!Iv(r.containerRef.current,u)}),o.on("click",function(u){return s(u,"click")}),o.on("doubleClick",function(u){return s(u,"doubleClick")}),o.on("select",function(u){r._selectSlot(nn(nn({},r.state),{},{action:"select",bounds:u})),r._initial={},r.setState({selecting:!1}),vn(r.props.onSelectEnd,[r.state])})}},{key:"_teardownSelectable",value:function(){this._selector&&(this._selector.teardown(),this._selector=null)}},{key:"_selectSlot",value:function(r){var a=r.endIdx,o=r.startIdx,s=r.action,u=r.bounds,d=r.box;a!==-1&&o!==-1&&this.props.onSelectSlot&&this.props.onSelectSlot({start:o,end:a,action:s,bounds:u,box:d,resourceId:this.props.resourceId})}}]),t}(q.Component),Mi={propTypes:{slotMetrics:Ae.object.isRequired,selected:Ae.object,isAllDay:Ae.bool,accessors:Ae.object.isRequired,localizer:Ae.object.isRequired,components:Ae.object.isRequired,getters:Ae.object.isRequired,onSelect:Ae.func,onDoubleClick:Ae.func,onKeyPress:Ae.func},defaultProps:{segments:[],selected:{}},renderEvent:function(t,n){var r=t.selected;t.isAllDay;var a=t.accessors,o=t.getters,s=t.onSelect,u=t.onDoubleClick,d=t.onKeyPress,m=t.localizer,p=t.slotMetrics,g=t.components,w=t.resizable,D=p.continuesPrior(n),S=p.continuesAfter(n);return q.createElement(Cx,{event:n,getters:o,localizer:m,accessors:a,components:g,onSelect:s,onDoubleClick:u,onKeyPress:d,continuesPrior:D,continuesAfter:S,slotStart:p.first,slotEnd:p.last,selected:sy(n,r),resizable:w})},renderSpan:function(t,n,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:" ",o=Math.abs(n)/t*100+"%";return q.createElement("div",{key:r,className:"rbc-row-segment",style:{WebkitFlexBasis:o,flexBasis:o,maxWidth:o}},a)}},Ox=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){var r=this,a=this.props,o=a.segments,s=a.slotMetrics.slots,u=a.className,d=1;return q.createElement("div",{className:Qn(u,"rbc-row")},o.reduce(function(m,p,g){var w=p.event,D=p.left,S=p.right,T=p.span,E="_lvl_"+g,A=D-d,N=Mi.renderEvent(r.props,w);return A&&m.push(Mi.renderSpan(s,A,"".concat(E,"_gap"))),m.push(Mi.renderSpan(s,T,E,N)),d=S+1,m},[]))}}]),t}(q.Component);Ox.defaultProps=nn({},Mi.defaultProps);function Fx(e){var t=e.dateRange,n=e.unit,r=n===void 0?"day":n,a=e.localizer;return{first:t[0],last:a.add(t[t.length-1],1,r)}}function $$(e,t,n,r){var a=Fx({dateRange:t,localizer:r}),o=a.first,s=a.last,u=r.diff(o,s,"day"),d=r.max(r.startOf(n.start(e),"day"),o),m=r.min(r.ceil(n.end(e),"day"),s),p=XB(t,function(w){return r.isSameDate(w,d)}),g=r.diff(d,m,"day");return g=Math.min(g,u),g=Math.max(g-r.segmentOffset,1),{event:e,span:g,left:p+1,right:Math.max(p+g,1)}}function Px(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0,n,r,a,o=[],s=[];for(n=0;n<e.length;n++){for(a=e[n],r=0;r<o.length&&G$(a,o[r]);r++);r>=t?s.push(a):(o[r]||(o[r]=[])).push(a)}for(n=0;n<o.length;n++)o[n].sort(function(u,d){return u.left-d.left});return{levels:o,extra:s}}function fm(e,t,n,r,a){var o={start:r.start(e),end:r.end(e)},s={start:t,end:n};return a.inEventRange({event:o,range:s})}function G$(e,t){return t.some(function(n){return n.left<=e.right&&n.right>=e.left})}function q$(e,t,n){var r=Jg(e),a=[],o=[];r.forEach(function(d){var m=t.start(d),p=t.end(d);n.daySpan(m,p)>1?a.push(d):o.push(d)});var s=a.sort(function(d,m){return Vw(d,m,t,n)}),u=o.sort(function(d,m){return Vw(d,m,t,n)});return[].concat(Jg(s),Jg(u))}function Vw(e,t,n,r){var a={start:n.start(e),end:n.end(e),allDay:n.allDay(e)},o={start:n.start(t),end:n.end(t),allDay:n.allDay(t)};return r.sortEvents({evtA:a,evtB:o})}var jx=function(t,n){return t.left<=n&&t.right>=n},u2=function(t,n){return t.filter(function(r){return jx(r,n)}).map(function(r){return r.event})},Lx=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){for(var r=this.props,a=r.segments,o=r.slotMetrics.slots,s=Px(a).levels[0],u=1,d=1,m=[];u<=o;){var p="_lvl_"+u,g=s.filter(function(N){return jx(N,u)})[0]||{},w=g.event,D=g.left,S=g.right,T=g.span;if(!w){u++;continue}var E=Math.max(0,D-d);if(this.canRenderSlotEvent(D,T)){var A=Mi.renderEvent(this.props,w);E&&m.push(Mi.renderSpan(o,E,p+"_gap")),m.push(Mi.renderSpan(o,T,p,A)),d=u=S+1}else E&&m.push(Mi.renderSpan(o,E,p+"_gap")),m.push(Mi.renderSpan(o,1,p,this.renderShowMore(a,u))),d=u+=1}return q.createElement("div",{className:"rbc-row"},m)}},{key:"canRenderSlotEvent",value:function(r,a){var o=this.props.segments;return dY(r,r+a).every(function(s){var u=u2(o,s).length;return u===1})}},{key:"renderShowMore",value:function(r,a){var o=this,s=this.props,u=s.localizer,d=s.slotMetrics,m=d.getEventsForSlot(a),p=u2(r,a),g=p.length;return g?q.createElement("button",{type:"button",key:"sm_"+a,className:Qn("rbc-button-link","rbc-show-more"),onClick:function(D){return o.showMore(a,D)}},u.messages.showMore(g,p,m)):!1}},{key:"showMore",value:function(r,a){a.preventDefault(),a.stopPropagation(),this.props.onShowMore(r,a.target)}}]),t}(q.Component);Lx.defaultProps=nn({},Mi.defaultProps);var J$=function(t){var n=t.children;return q.createElement("div",{className:"rbc-row-content-scroll-container"},n)},K$=function(t,n){return t.left<=n&&t.right>=n},Q$=function(t,n){return t[0].range===n[0].range&&t[0].events===n[0].events};function Rx(){return sx(function(e){for(var t=e.range,n=e.events,r=e.maxRows,a=e.minRows,o=e.accessors,s=e.localizer,u=Fx({dateRange:t,localizer:s}),d=u.first,m=u.last,p=n.map(function(T){return $$(T,t,o,s)}),g=Px(p,Math.max(r-1,1)),w=g.levels,D=g.extra,S=D.length>0?a-1:a;w.length<S;)w.push([]);return{first:d,last:m,levels:w,extra:D,range:t,slots:t.length,clone:function(E){var A=Rx();return A(nn(nn({},e),E))},getDateForSlot:function(E){return t[E]},getSlotForDate:function(E){return t.find(function(A){return s.isSameDate(A,E)})},getEventsForSlot:function(E){return p.filter(function(A){return K$(A,E)}).map(function(A){return A.event})},continuesPrior:function(E){return s.continuesPrior(o.start(E),d)},continuesAfter:function(E){var A=o.start(E),N=o.end(E);return s.continuesAfter(A,N,m)}}},Q$)}var Tv=function(e){ta(t,e);function t(){var n;pr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.handleSelectSlot=function(s){var u=n.props,d=u.range,m=u.onSelectSlot;m(d.slice(s.start,s.end+1),s)},n.handleShowMore=function(s,u){var d=n.props,m=d.range,p=d.onShowMore,g=n.slotMetrics(n.props),w=e7(n.containerRef.current,".rbc-row-bg")[0],D;w&&(D=w.children[s-1]);var S=g.getEventsForSlot(s);p(S,m[s-1],D,s,u)},n.getContainer=function(){var s=n.props.container;return s?s():n.containerRef.current},n.renderHeadingCell=function(s,u){var d=n.props,m=d.renderHeader,p=d.getNow,g=d.localizer;return m({date:s,key:"header_".concat(u),className:Qn("rbc-date-cell",g.isSameDate(s,p())&&"rbc-now")})},n.renderDummy=function(){var s=n.props,u=s.className,d=s.range,m=s.renderHeader,p=s.showAllEvents;return q.createElement("div",{className:u,ref:n.containerRef},q.createElement("div",{className:Qn("rbc-row-content",p&&"rbc-row-content-scrollable")},m&&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=O.createRef(),n.headingRowRef=O.createRef(),n.eventRowRef=O.createRef(),n.slotMetrics=Rx(),n}return gr(t,[{key:"getRowLimit",value:function(){var r,a=z0(this.eventRowRef.current),o=(r=this.headingRowRef)!==null&&r!==void 0&&r.current?z0(this.headingRowRef.current):0,s=z0(this.containerRef.current)-o;return Math.max(Math.floor(s/a),1)}},{key:"render",value:function(){var r=this.props,a=r.date,o=r.rtl,s=r.range,u=r.className,d=r.selected,m=r.selectable,p=r.renderForMeasure,g=r.accessors,w=r.getters,D=r.components,S=r.getNow,T=r.renderHeader,E=r.onSelect,A=r.localizer,N=r.onSelectStart,R=r.onSelectEnd,F=r.onDoubleClick,H=r.onKeyPress,P=r.resourceId,L=r.longPressThreshold,z=r.isAllDay,U=r.resizable,W=r.showAllEvents;if(p)return this.renderDummy();var K=this.slotMetrics(this.props),ae=K.levels,ce=K.extra,fe=W?J$:cs,ie=D.weekWrapper,ge={selected:d,accessors:g,getters:w,localizer:A,components:D,onSelect:E,onDoubleClick:F,onKeyPress:H,resourceId:P,slotMetrics:K,resizable:U};return q.createElement("div",{className:u,role:"rowgroup",ref:this.containerRef},q.createElement(W$,{localizer:A,date:a,getNow:S,rtl:o,range:s,selectable:m,container:this.getContainer,getters:w,onSelectStart:N,onSelectEnd:R,onSelectSlot:this.handleSelectSlot,components:D,longPressThreshold:L,resourceId:P}),q.createElement("div",{className:Qn("rbc-row-content",W&&"rbc-row-content-scrollable"),role:"row"},T&&q.createElement("div",{className:"rbc-row ",ref:this.headingRowRef},s.map(this.renderHeadingCell)),q.createElement(fe,null,q.createElement(ie,Object.assign({isAllDay:z},ge,{rtl:this.props.rtl}),ae.map(function(Te,se){return q.createElement(Ox,Object.assign({key:se,segments:Te},ge))}),!!ce.length&&q.createElement(Lx,Object.assign({segments:ce,onShowMore:this.handleShowMore},ge))))))}}]),t}(q.Component);Tv.defaultProps={minRows:0,maxRows:1/0};var _x=function(t){var n=t.label;return q.createElement("span",{role:"columnheader","aria-sort":"none"},n)},X$=function(t){var n=t.label,r=t.drilldownView,a=t.onDrillDown;return r?q.createElement("button",{type:"button",className:"rbc-button-link",onClick:a,role:"cell"},n):q.createElement("span",null,n)},eG=["date","className"],tG=function(t,n,r,a,o){return t.filter(function(s){return fm(s,n,r,a,o)})},ly=function(e){ta(t,e);function t(){var n;pr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.getContainer=function(){return n.containerRef.current},n.renderWeek=function(s,u){var d=n.props,m=d.events,p=d.components,g=d.selectable,w=d.getNow,D=d.selected,S=d.date,T=d.localizer,E=d.longPressThreshold,A=d.accessors,N=d.getters,R=d.showAllEvents,F=n.state,H=F.needLimitMeasure,P=F.rowLimit,L=tG(Jg(m),s[0],s[s.length-1],A,T),z=q$(L,A,T);return q.createElement(Tv,{key:u,ref:u===0?n.slotRowRef:void 0,container:n.getContainer,className:"rbc-month-row",getNow:w,date:S,range:s,events:z,maxRows:R?1/0:P,selected:D,selectable:g,components:p,accessors:A,getters:N,localizer:T,renderHeader:n.readerDateHeading,renderForMeasure:H,onShowMore:n.handleShowMore,onSelect:n.handleSelectEvent,onDoubleClick:n.handleDoubleClickEvent,onKeyPress:n.handleKeyPressEvent,onSelectSlot:n.handleSelectSlot,longPressThreshold:E,rtl:n.props.rtl,resizable:n.props.resizable,showAllEvents:R})},n.readerDateHeading=function(s){var u=s.date,d=s.className,m=Ai(s,eG),p=n.props,g=p.date,w=p.getDrilldownView,D=p.localizer,S=D.neq(u,g,"month"),T=D.isSameDate(u,g),E=w(u),A=D.format(u,"dateFormat"),N=n.props.components.dateHeader||X$;return q.createElement("div",Object.assign({},m,{className:Qn(d,S&&"rbc-off-range",T&&"rbc-current"),role:"cell"}),q.createElement(N,{label:A,date:u,drilldownView:E,isOffRange:S,onDrillDown:function(F){return n.handleHeadingClick(u,E,F)}}))},n.handleSelectSlot=function(s,u){n._pendingSelection=n._pendingSelection.concat(s),clearTimeout(n._selectTimer),n._selectTimer=setTimeout(function(){return n.selectDates(u)})},n.handleHeadingClick=function(s,u,d){d.preventDefault(),n.clearSelection(),vn(n.props.onDrillDown,[s,u])},n.handleSelectEvent=function(){n.clearSelection();for(var s=arguments.length,u=new Array(s),d=0;d<s;d++)u[d]=arguments[d];vn(n.props.onSelectEvent,u)},n.handleDoubleClickEvent=function(){n.clearSelection();for(var s=arguments.length,u=new Array(s),d=0;d<s;d++)u[d]=arguments[d];vn(n.props.onDoubleClickEvent,u)},n.handleKeyPressEvent=function(){n.clearSelection();for(var s=arguments.length,u=new Array(s),d=0;d<s;d++)u[d]=arguments[d];vn(n.props.onKeyPressEvent,u)},n.handleShowMore=function(s,u,d,m,p){var g=n.props,w=g.popup,D=g.onDrillDown,S=g.onShowMore,T=g.getDrilldownView,E=g.doShowMoreDrillDown;if(n.clearSelection(),w){var A=zE(d,n.containerRef.current);n.setState({overlay:{date:u,events:s,position:A,target:p}})}else E&&vn(D,[u,T(u)||Qr.DAY]);vn(S,[s,u,m])},n.overlayDisplay=function(){n.setState({overlay:null})},n.state={rowLimit:5,needLimitMeasure:!0,date:null},n.containerRef=O.createRef(),n.slotRowRef=O.createRef(),n._bgRows=[],n._pendingSelection=[],n}return gr(t,[{key:"componentDidMount",value:function(){var r=this,a;this.state.needLimitMeasure&&this.measureRowLimit(this.props),window.addEventListener("resize",this._resizeListener=function(){a||UE(function(){a=!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,a=r.date,o=r.localizer,s=r.className,u=o.visibleDays(a,o),d=_F(u,7);return this._weekCount=d.length,q.createElement("div",{className:Qn("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 a=this.props,o=a.localizer,s=a.components,u=r[0],d=r[r.length-1],m=s.header||_x;return o.range(u,d,"day").map(function(p,g){return q.createElement("div",{key:"header_"+g,className:"rbc-header"},q.createElement(m,{date:p,localizer:o,label:o.format(p,"weekdayFormat")}))})}},{key:"renderOverlay",value:function(){var r,a,o=this,s=(r=(a=this.state)===null||a===void 0?void 0:a.overlay)!==null&&r!==void 0?r:{},u=this.props,d=u.accessors,m=u.localizer,p=u.components,g=u.getters,w=u.selected,D=u.popupOffset,S=u.handleDragStart,T=function(){return o.setState({overlay:null})};return q.createElement(nb,{overlay:s,accessors:d,localizer:m,components:p,getters:g,selected:w,popupOffset:D,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:S,show:!!s.position,overlayDisplay:this.overlayDisplay,onHide:T})}},{key:"measureRowLimit",value:function(){this.setState({needLimitMeasure:!1,rowLimit:this.slotRowRef.current.getRowLimit()})}},{key:"selectDates",value:function(r){var a=this._pendingSelection.slice();this._pendingSelection=[],a.sort(function(u,d){return+u-+d});var o=new Date(a[0]),s=new Date(a[a.length-1]);s.setDate(a[a.length-1].getDate()+1),vn(this.props.onSelectSlot,{slots:a,start:o,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,a){var o=r.date,s=r.localizer;return{date:o,needLimitMeasure:s.neq(o,a.date,"month")}}}]),t}(q.Component);ly.range=function(e,t){var n=t.localizer,r=n.firstVisibleDay(e,n),a=n.lastVisibleDay(e,n);return{start:r,end:a}};ly.navigate=function(e,t,n){var r=n.localizer;switch(t){case Da.PREVIOUS:return r.add(e,-1,"month");case Da.NEXT:return r.add(e,1,"month");default:return e}};ly.title=function(e,t){var n=t.localizer;return n.format(e,"monthHeaderFormat")};var d2=function(t){var n=t.min,r=t.max,a=t.step,o=t.slots,s=t.localizer;return"".concat(+s.startOf(n,"minutes"))+"".concat(+s.startOf(r,"minutes"))+"".concat(a,"-").concat(o)};function rb(e){for(var t=e.min,n=e.max,r=e.step,a=e.timeslots,o=e.localizer,s=d2({start:t,end:n,step:r,timeslots:a,localizer:o}),u=1+o.getTotalMin(t,n),d=o.getMinutesFromMidnight(t),m=Math.ceil((u-1)/(r*a)),p=m*a,g=new Array(m),w=new Array(p),D=0;D<m;D++){g[D]=new Array(a);for(var S=0;S<a;S++){var T=D*a+S,E=T*r;w[T]=g[D][S]=o.getSlotDate(t,d,E)}}var A=w.length*r;w.push(o.getSlotDate(t,d,A));function N(R){var F=o.diff(t,R,"minutes")+o.getDstOffset(t,R);return Math.min(F,u)}return{groups:g,update:function(F){return d2(F)!==s?rb(F):this},dateIsInGroup:function(F,H){var P=g[H+1];return o.inRange(F,g[H][0],P?P[0]:n,"minutes")},nextSlot:function(F){var H=w[Math.min(w.indexOf(F)+1,w.length-1)];return H===F&&(H=o.add(F,r,"minutes")),H},closestSlotToPosition:function(F){var H=Math.min(w.length-1,Math.max(0,Math.floor(F*p)));return w[H]},closestSlotFromPoint:function(F,H){var P=Math.abs(H.top-H.bottom);return this.closestSlotToPosition((F.y-H.top)/P)},closestSlotFromDate:function(F){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(o.lt(F,t,"minutes"))return w[0];if(o.gt(F,n,"minutes"))return w[w.length-1];var P=o.diff(t,F,"minutes");return w[(P-P%r)/r+H]},startsBeforeDay:function(F){return o.lt(F,t,"day")},startsAfterDay:function(F){return o.gt(F,n,"day")},startsBefore:function(F){return o.lt(o.merge(t,F),t,"minutes")},startsAfter:function(F){return o.gt(o.merge(n,F),n,"minutes")},getRange:function(F,H,P,L){P||(F=o.min(n,o.max(t,F))),L||(H=o.min(n,o.max(t,H)));var z=N(F),U=N(H),W=U>r*p&&!o.eq(n,H)?(z-r)/(r*p)*100:z/(r*p)*100;return{top:W,height:U/(r*p)*100-W,start:N(F),startDate:F,end:N(H),endDate:H}},getCurrentTimePosition:function(F){var H=N(F),P=H/(r*p)*100;return P}}}var nG=function(){function e(t,n){var r=n.accessors,a=n.slotMetrics;pr(this,e);var o=a.getRange(r.start(t),r.end(t)),s=o.start,u=o.startDate,d=o.end,m=o.endDate,p=o.top,g=o.height;this.start=s,this.end=d,this.startMs=+u,this.endMs=+m,this.top=p,this.height=g,this.data=t}return gr(e,[{key:"_width",get:function(){if(this.rows){var n=this.rows.reduce(function(a,o){return Math.max(a,o.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 a=this.row.leaves,o=a.indexOf(this);return o===a.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,a=n.xOffset,o=n._width,s=r.indexOf(this)+1;return a+s*o}}]),e}();function rG(e,t,n){return Math.abs(t.start-e.start)<n||t.start>e.start&&t.start<e.end}function aG(e){for(var t=Az(e,["startMs",function(u){return-u.endMs}]),n=[];t.length>0;){var r=t.shift();n.push(r);for(var a=0;a<t.length;a++){var o=t[a];if(!(r.endMs>o.startMs)){if(a>0){var s=t.splice(a,1)[0];n.push(s)}break}}}return n}function Hx(e){for(var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,a=e.accessors,o=t.map(function(p){return new nG(p,{slotMetrics:r,accessors:a})}),s=aG(o),u=[],d=function(){var g=s[m],w=u.find(function(T){return T.end>g.start||Math.abs(g.start-T.start)<n});if(!w)return g.rows=[],u.push(g),1;g.container=w;for(var D=null,S=w.rows.length-1;!D&&S>=0;S--)rG(w.rows[S],g,n)&&(D=w.rows[S]);D?(D.leaves.push(g),g.row=D):(g.leaves=[],w.rows.push(g))},m=0;m<s.length;m++)d();return s.map(function(p){return{event:p.data,style:{top:p.top,height:p.height,width:p.width,xOffset:Math.max(0,p.xOffset)}}})}function Bx(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 a=Bx(e.friends[r],t,n);t=t>a?t:a}return t}function oG(e){var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,a=e.accessors,o=Hx({events:t,minimumStartDifference:n,slotMetrics:r,accessors:a});o.sort(function(ie,ge){return ie=ie.style,ge=ge.style,ie.top!==ge.top?ie.top>ge.top?1:-1:ie.height!==ge.height?ie.top+ie.height<ge.top+ge.height?1:-1:0});for(var s=0;s<o.length;++s)o[s].friends=[],delete o[s].style.left,delete o[s].style.left,delete o[s].idx,delete o[s].size;for(var u=0;u<o.length-1;++u)for(var d=o[u],m=d.style.top,p=d.style.top+d.style.height,g=u+1;g<o.length;++g){var w=o[g],D=w.style.top,S=w.style.top+w.style.height;(D>=m&&S<=p||S>m&&S<=p||D>=m&&D<p)&&(d.friends.push(w),w.friends.push(d))}for(var T=0;T<o.length;++T){for(var E=o[T],A=[],N=0;N<100;++N)A.push(1);for(var R=0;R<E.friends.length;++R)E.friends[R].idx!==void 0&&(A[E.friends[R].idx]=0);E.idx=A.indexOf(1)}for(var F=0;F<o.length;++F){var H=0;if(!o[F].size){var P=[],L=Bx(o[F],0,P);H=100/(L+1),o[F].size=H;for(var z=0;z<P.length;++z)P[z].size=H}}for(var U=0;U<o.length;++U){var W=o[U];W.style.left=W.idx*W.size;for(var K=0,ae=0;ae<W.friends.length;++ae){var ce=W.friends[ae].idx;K=K>ce?K:ce}K<=W.idx&&(W.size=100-W.idx*W.size);var fe=W.idx===0?0:3;W.style.width="calc(".concat(W.size,"% - ").concat(fe,"px)"),W.style.height="calc(".concat(W.style.height,"% - 2px)"),W.style.xOffset="calc(".concat(W.style.left,"% + ").concat(fe,"px)")}return o}var f2={overlap:Hx,"no-overlap":oG};function iG(e){return!!(e&&e.constructor&&e.call&&e.apply)}function sG(e){e.events,e.minimumStartDifference,e.slotMetrics,e.accessors;var t=e.dayLayoutAlgorithm,n=t;return t in f2&&(n=f2[t]),iG(n)?n.apply(this,arguments):[]}var Yx=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){var r=this.props,a=r.renderSlot,o=r.resource,s=r.group,u=r.getters,d=r.components,m=d===void 0?{}:d,p=m.timeSlotWrapper,g=p===void 0?cs:p,w=u?u.slotGroupProp(s):{};return q.createElement("div",Object.assign({className:"rbc-timeslot-group"},w),s.map(function(D,S){var T=u?u.slotProp(D,o):{};return q.createElement(g,{key:S,value:D,resource:o},q.createElement("div",Object.assign({},T,{className:Qn("rbc-time-slot",T.className)}),a&&a(D,S)))}))}}]),t}(O.Component);function Og(e){return typeof e=="string"?e:e+"%"}function lG(e){var t=e.style,n=e.className,r=e.event,a=e.accessors,o=e.rtl,s=e.selected,u=e.label,d=e.continuesPrior,m=e.continuesAfter,p=e.getters,g=e.onClick,w=e.onDoubleClick,D=e.isBackgroundEvent,S=e.onKeyPress,T=e.components,E=T.event,A=T.eventWrapper,N=a.title(r),R=a.tooltip(r),F=a.end(r),H=a.start(r),P=p.eventProp(r,H,F,s),L=[q.createElement("div",{key:"1",className:"rbc-event-label"},u),q.createElement("div",{key:"2",className:"rbc-event-content"},E?q.createElement(E,{event:r,title:N}):N)],z=t.height,U=t.top,W=t.width,K=t.xOffset,ae=nn(nn({},P.style),{},Ic({top:Og(U),height:Og(z),width:Og(W)},o?"right":"left",Og(K)));return q.createElement(A,Object.assign({type:"time"},e),q.createElement("div",{role:"button",tabIndex:0,onClick:g,onDoubleClick:w,style:ae,onKeyDown:S,title:R?(typeof u=="string"?u+": ":"")+R:void 0,className:Qn(D?"rbc-background-event":"rbc-event",n,P.className,{"rbc-selected":s,"rbc-event-continues-earlier":d,"rbc-event-continues-later":m})},L))}var cG=function(t){var n=t.children,r=t.className,a=t.style,o=t.innerRef;return q.createElement("div",{className:r,style:a,ref:o},n)},uG=q.forwardRef(function(e,t){return q.createElement(cG,Object.assign({},e,{innerRef:t}))}),dG=["dayProp"],fG=["eventContainerWrapper"],zx=function(e){ta(t,e);function t(){var n;pr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.state={selecting:!1,timeIndicatorPosition:null},n.intervalTriggered=!1,n.renderEvents=function(s){var u=s.events,d=s.isBackgroundEvent,m=n.props,p=m.rtl,g=m.selected,w=m.accessors,D=m.localizer,S=m.getters,T=m.components,E=m.step,A=m.timeslots,N=m.dayLayoutAlgorithm,R=m.resizable,F=vE(n),H=F.slotMetrics,P=D.messages,L=sG({events:u,accessors:w,slotMetrics:H,minimumStartDifference:Math.ceil(E*A/2),dayLayoutAlgorithm:N});return L.map(function(z,U){var W=z.event,K=z.style,ae=w.end(W),ce=w.start(W),fe="eventTimeRangeFormat",ie,ge=H.startsBeforeDay(ce),Te=H.startsAfterDay(ae);ge?fe="eventTimeRangeEndFormat":Te&&(fe="eventTimeRangeStartFormat"),ge&&Te?ie=P.allDay:ie=D.format({start:ce,end:ae},fe);var se=ge||H.startsBefore(ce),we=Te||H.startsAfter(ae);return q.createElement(lG,{style:K,event:W,label:ie,key:"evt_"+U,getters:S,rtl:p,components:T,continuesPrior:se,continuesAfter:we,accessors:w,resource:n.props.resource,selected:sy(W,g),onClick:function($){return n._select(nn(nn(nn({},W),n.props.resource&&{sourceResource:n.props.resource}),d&&{isBackgroundEvent:!0}),$)},onDoubleClick:function($){return n._doubleClick(W,$)},isBackgroundEvent:d,onKeyPress:function($){return n._keyPress(W,$)},resizable:R})})},n._selectable=function(){var s=n.containerRef.current,u=n.props,d=u.longPressThreshold,m=u.localizer,p=n._selector=new Ax(function(){return s},{longPressThreshold:d}),g=function(T){var E=n.props.onSelecting,A=n.state||{},N=w(T),R=N.startDate,F=N.endDate;E&&(m.eq(A.startDate,R,"minutes")&&m.eq(A.endDate,F,"minutes")||E({start:R,end:F,resourceId:n.props.resource})===!1)||(n.state.start!==N.start||n.state.end!==N.end||n.state.selecting!==N.selecting)&&n.setState(N)},w=function(T){var E=n.slotMetrics.closestSlotFromPoint(T,Lc(s));n.state.selecting||(n._initialSlot=E);var A=n._initialSlot;m.lte(A,E)?E=n.slotMetrics.nextSlot(E):m.gt(A,E)&&(A=n.slotMetrics.nextSlot(A));var N=n.slotMetrics.getRange(m.min(A,E),m.max(A,E));return nn(nn({},N),{},{selecting:!0,top:"".concat(N.top,"%"),height:"".concat(N.height,"%")})},D=function(T,E){if(!Iv(n.containerRef.current,T)){var A=w(T),N=A.startDate,R=A.endDate;n._selectSlot({startDate:N,endDate:R,action:E,box:T})}n.setState({selecting:!1})};p.on("selecting",g),p.on("selectStart",g),p.on("beforeSelect",function(S){if(n.props.selectable==="ignoreEvents")return!Iv(n.containerRef.current,S)}),p.on("click",function(S){return D(S,"click")}),p.on("doubleClick",function(S){return D(S,"doubleClick")}),p.on("select",function(S){n.state.selecting&&(n._selectSlot(nn(nn({},n.state),{},{action:"select",bounds:S})),n.setState({selecting:!1}))}),p.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 u=s.startDate,d=s.endDate,m=s.action,p=s.bounds,g=s.box,w=u,D=[];n.props.localizer.lte(w,d);)D.push(w),w=new Date(+w+n.props.step*60*1e3);vn(n.props.onSelectSlot,{slots:D,start:u,end:d,resourceId:n.props.resource,action:m,bounds:p,box:g})},n._select=function(){for(var s=arguments.length,u=new Array(s),d=0;d<s;d++)u[d]=arguments[d];vn(n.props.onSelectEvent,u)},n._doubleClick=function(){for(var s=arguments.length,u=new Array(s),d=0;d<s;d++)u[d]=arguments[d];vn(n.props.onDoubleClickEvent,u)},n._keyPress=function(){for(var s=arguments.length,u=new Array(s),d=0;d<s;d++)u[d]=arguments[d];vn(n.props.onKeyPressEvent,u)},n.slotMetrics=rb(n.props),n.containerRef=O.createRef(),n}return gr(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,a){this.props.selectable&&!r.selectable&&this._selectable(),!this.props.selectable&&r.selectable&&this._teardownSelectable(),this.slotMetrics=this.slotMetrics.update(this.props);var o=this.props,s=o.getNow,u=o.isNow,d=o.localizer,m=o.date,p=o.min,g=o.max,w=d.neq(r.getNow(),s(),"minutes");if(r.isNow!==u||w){if(this.clearTimeIndicatorInterval(),u){var D=!w&&d.eq(r.date,m,"minutes")&&a.timeIndicatorPosition===this.state.timeIndicatorPosition;this.setTimeIndicatorPositionUpdateInterval(D)}}else u&&(d.neq(r.min,p,"minutes")||d.neq(r.max,g,"minutes"))&&this.positionTimeIndicator()}},{key:"setTimeIndicatorPositionUpdateInterval",value:function(){var r=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;!this.intervalTriggered&&!a&&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,a=r.min,o=r.max,s=r.getNow,u=s();if(u>=a&&u<=o){var d=this.slotMetrics.getCurrentTimePosition(u);this.intervalTriggered=!0,this.setState({timeIndicatorPosition:d})}else this.clearTimeIndicatorInterval()}},{key:"render",value:function(){var r=this.props,a=r.date,o=r.max,s=r.rtl,u=r.isNow,d=r.resource,m=r.accessors,p=r.localizer,g=r.getters,w=g.dayProp,D=Ai(g,dG),S=r.components,T=S.eventContainerWrapper,E=Ai(S,fG),A=this.slotMetrics,N=this.state,R=N.selecting,F=N.top,H=N.height,P=N.startDate,L=N.endDate,z={start:P,end:L},U=w(o),W=U.className,K=U.style,ae=E.dayColumnWrapper||uG;return q.createElement(ae,{ref:this.containerRef,date:a,style:K,className:Qn(W,"rbc-day-slot","rbc-time-column",u&&"rbc-now",u&&"rbc-today",R&&"rbc-slot-selecting"),slotMetrics:A},A.groups.map(function(ce,fe){return q.createElement(Yx,{key:fe,group:ce,resource:d,getters:D,components:E})}),q.createElement(T,{localizer:p,resource:d,accessors:m,getters:D,components:E,slotMetrics:A},q.createElement("div",{className:Qn("rbc-events-container",s&&"rtl")},this.renderEvents({events:this.props.backgroundEvents,isBackgroundEvent:!0}),this.renderEvents({events:this.props.events}))),R&&q.createElement("div",{className:"rbc-slot-selection",style:{top:F,height:H}},q.createElement("span",null,p.format(z,"selectRangeFormat"))),u&&this.intervalTriggered&&q.createElement("div",{className:"rbc-current-time-indicator",style:{top:"".concat(this.state.timeIndicatorPosition,"%")}}))}}]),t}(q.Component);zx.defaultProps={dragThroughEvents:!0,timeslots:2};function hG(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 mG=function(t){var n=t.min,r=t.max,a=t.timeslots,o=t.step,s=t.localizer,u=t.getNow,d=t.resource,m=t.components,p=t.getters,g=t.gutterRef,w=m.timeGutterWrapper,D=O.useMemo(function(){return hG({min:n,max:r,localizer:s})},[n==null?void 0:n.toISOString(),r==null?void 0:r.toISOString(),s]),S=D.start,T=D.end,E=O.useState(rb({min:S,max:T,timeslots:a,step:o,localizer:s})),A=us(E,2),N=A[0],R=A[1];O.useEffect(function(){N&&R(N.update({min:S,max:T,timeslots:a,step:o,localizer:s}))},[S==null?void 0:S.toISOString(),T==null?void 0:T.toISOString(),a,o]);var F=O.useCallback(function(H,P){if(P)return null;var L=N.dateIsInGroup(u(),P);return q.createElement("span",{className:Qn("rbc-label",L&&"rbc-now")},s.format(H,"timeGutterFormat"))},[N,s,u]);return q.createElement(w,{slotMetrics:N},q.createElement("div",{className:"rbc-time-gutter rbc-time-column",ref:g},N.groups.map(function(H,P){return q.createElement(Yx,{key:P,group:H,resource:d,components:m,renderSlot:F,getters:p})})))},pG=q.forwardRef(function(e,t){return q.createElement(mG,Object.assign({gutterRef:t},e))}),gG=function(t){var n=t.label;return q.createElement(q.Fragment,null,n)},vG=function(e){ta(t,e);function t(){var n;pr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.handleHeaderClick=function(s,u,d){d.preventDefault(),vn(n.props.onDrillDown,[s,u])},n.renderRow=function(s){var u=n.props,d=u.events,m=u.rtl,p=u.selectable,g=u.getNow,w=u.range,D=u.getters,S=u.localizer,T=u.accessors,E=u.components,A=u.resizable,N=T.resourceId(s),R=s?d.filter(function(F){return T.resource(F)===N}):d;return q.createElement(Tv,{isAllDay:!0,rtl:m,getNow:g,minRows:2,maxRows:n.props.allDayMaxRows+1,range:w,events:R,resourceId:N,className:"rbc-allday-cell",selectable:p,selected:n.props.selected,components:E,accessors:T,getters:D,localizer:S,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:A})},n}return gr(t,[{key:"renderHeaderCells",value:function(r){var a=this,o=this.props,s=o.localizer,u=o.getDrilldownView,d=o.getNow,m=o.getters.dayProp,p=o.components.header,g=p===void 0?_x:p,w=d();return r.map(function(D,S){var T=u(D),E=s.format(D,"dayFormat"),A=m(D),N=A.className,R=A.style,F=q.createElement(g,{date:D,label:E,localizer:s});return q.createElement("div",{key:S,style:R,className:Qn("rbc-header",N,s.isSameDate(D,w)&&"rbc-today")},T?q.createElement("button",{type:"button",className:"rbc-button-link",onClick:function(P){return a.handleHeaderClick(D,T,P)}},F):q.createElement("span",null,F))})}},{key:"render",value:function(){var r=this,a=this.props,o=a.width,s=a.rtl,u=a.resources,d=a.range,m=a.events,p=a.getNow,g=a.accessors,w=a.selectable,D=a.components,S=a.getters,T=a.scrollRef,E=a.localizer,A=a.isOverflowing,N=a.components,R=N.timeGutterHeader,F=N.resourceHeader,H=F===void 0?gG:F,P=a.resizable,L={};A&&(L[s?"marginLeft":"marginRight"]="".concat(VE()-1,"px"));var z=u.groupEvents(m);return q.createElement("div",{style:L,ref:T,className:Qn("rbc-time-header",A&&"rbc-overflowing")},q.createElement("div",{className:"rbc-label rbc-time-header-gutter",style:{width:o,minWidth:o,maxWidth:o}},R&&q.createElement(R,null)),u.map(function(U,W){var K=us(U,2),ae=K[0],ce=K[1];return q.createElement("div",{className:"rbc-time-header-content",key:ae||W},ce&&q.createElement("div",{className:"rbc-row rbc-row-resource",key:"resource_".concat(W)},q.createElement("div",{className:"rbc-header"},q.createElement(H,{index:W,label:g.resourceTitle(ce),resource:ce}))),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(Tv,{isAllDay:!0,rtl:s,getNow:p,minRows:2,maxRows:r.props.allDayMaxRows+1,range:d,events:z.get(ae)||[],resourceId:ce&&ae,className:"rbc-allday-cell",selectable:w,selected:r.props.selected,components:D,accessors:g,getters:S,localizer:E,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:P}))}))}}]),t}(q.Component),Z0={};function yG(e,t){return{map:function(r){return e?e.map(function(a,o){return r([t.resourceId(a),a],o)}):[r([Z0,null],0)]},groupEvents:function(r){var a=new Map;return e?(r.forEach(function(o){var s=t.resource(o)||Z0;if(Array.isArray(s))s.forEach(function(d){var m=a.get(d)||[];m.push(o),a.set(d,m)});else{var u=a.get(s)||[];u.push(o),a.set(s,u)}}),a):(a.set(Z0,r),a)}}}var af=function(e){ta(t,e);function t(n){var r;return pr(this,t),r=ea(this,t,[n]),r.handleScroll=function(a){r.scrollRef.current&&(r.scrollRef.current.scrollLeft=a.target.scrollLeft)},r.handleResize=function(){iS(r.rafHandle),r.rafHandle=UE(r.checkOverflow)},r.handleKeyPressEvent=function(){r.clearSelection();for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];vn(r.props.onKeyPressEvent,o)},r.handleSelectEvent=function(){r.clearSelection();for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];vn(r.props.onSelectEvent,o)},r.handleDoubleClickEvent=function(){r.clearSelection();for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];vn(r.props.onDoubleClickEvent,o)},r.handleShowMore=function(a,o,s,u,d){var m=r.props,p=m.popup,g=m.onDrillDown,w=m.onShowMore,D=m.getDrilldownView,S=m.doShowMoreDrillDown;if(r.clearSelection(),p){var T=zE(s,r.containerRef.current);r.setState({overlay:{date:o,events:a,position:nn(nn({},T),{},{width:"200px"}),target:d}})}else S&&vn(g,[o,D(o)||Qr.DAY]);vn(w,[a,o,u])},r.handleSelectAllDaySlot=function(a,o){var s=r.props.onSelectSlot,u=new Date(a[0]),d=new Date(a[a.length-1]);d.setDate(a[a.length-1].getDate()+1),vn(s,{slots:a,start:u,end:d,action:o.action,resourceId:o.resourceId})},r.overlayDisplay=function(){r.setState({overlay:null})},r.checkOverflow=function(){if(!r._updatingOverflow){var a=r.contentRef.current;if(a!=null&&a.scrollHeight){var o=a.scrollHeight>a.clientHeight;r.state.isOverflowing!==o&&(r._updatingOverflow=!0,r.setState({isOverflowing:o},function(){r._updatingOverflow=!1}))}}},r.memoizedResources=sx(function(a,o){return yG(a,o)}),r.state={gutterWidth:void 0,isOverflowing:null},r.scrollRef=q.createRef(),r.contentRef=q.createRef(),r.containerRef=q.createRef(),r._scrollRatio=null,r.gutterRef=O.createRef(),r}return gr(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),iS(this.rafHandle),this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest)}},{key:"componentDidUpdate",value:function(){this.applyScroll()}},{key:"renderEvents",value:function(r,a,o,s){var u=this,d=this.props,m=d.min,p=d.max,g=d.components,w=d.accessors,D=d.localizer,S=d.dayLayoutAlgorithm,T=this.memoizedResources(this.props.resources,w),E=T.groupEvents(a),A=T.groupEvents(o);return T.map(function(N,R){var F=us(N,2),H=F[0],P=F[1];return r.map(function(L,z){var U=(E.get(H)||[]).filter(function(K){return D.inRange(L,w.start(K),w.end(K),"day")}),W=(A.get(H)||[]).filter(function(K){return D.inRange(L,w.start(K),w.end(K),"day")});return q.createElement(zx,Object.assign({},u.props,{localizer:D,min:D.merge(L,m),max:D.merge(L,p),resource:P&&H,components:g,isNow:D.isSameDate(L,s),key:R+"-"+z,date:L,events:U,backgroundEvents:W,dayLayoutAlgorithm:S}))})})}},{key:"render",value:function(){var r,a=this.props,o=a.events,s=a.backgroundEvents,u=a.range,d=a.width,m=a.rtl,p=a.selected,g=a.getNow,w=a.resources,D=a.components,S=a.accessors,T=a.getters,E=a.localizer,A=a.min,N=a.max,R=a.showMultiDayTimes,F=a.longPressThreshold,H=a.resizable;d=d||this.state.gutterWidth;var P=u[0],L=u[u.length-1];this.slots=u.length;var z=[],U=[],W=[];return o.forEach(function(K){if(fm(K,P,L,S,E)){var ae=S.start(K),ce=S.end(K);S.allDay(K)||E.startAndEndAreDateOnly(ae,ce)||!R&&!E.isSameDate(ae,ce)?z.push(K):U.push(K)}}),s.forEach(function(K){fm(K,P,L,S,E)&&W.push(K)}),z.sort(function(K,ae){return Vw(K,ae,S,E)}),q.createElement("div",{className:Qn("rbc-time-view",w&&"rbc-time-view-resources"),ref:this.containerRef},q.createElement(vG,{range:u,events:z,width:d,rtl:m,getNow:g,localizer:E,selected:p,allDayMaxRows:this.props.showAllEvents?1/0:(r=this.props.allDayMaxRows)!==null&&r!==void 0?r:1/0,resources:this.memoizedResources(w,S),selectable:this.props.selectable,accessors:S,getters:T,components:D,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:H}),this.props.popup&&this.renderOverlay(),q.createElement("div",{ref:this.contentRef,className:"rbc-time-content",onScroll:this.handleScroll},q.createElement(pG,{date:P,ref:this.gutterRef,localizer:E,min:E.merge(P,A),max:E.merge(P,N),step:this.props.step,getNow:this.props.getNow,timeslots:this.props.timeslots,components:D,className:"rbc-time-gutter",getters:T}),this.renderEvents(u,U,W,g())))}},{key:"renderOverlay",value:function(){var r,a,o=this,s=(r=(a=this.state)===null||a===void 0?void 0:a.overlay)!==null&&r!==void 0?r:{},u=this.props,d=u.accessors,m=u.localizer,p=u.components,g=u.getters,w=u.selected,D=u.popupOffset,S=u.handleDragStart,T=function(){return o.setState({overlay:null})};return q.createElement(nb,{overlay:s,accessors:d,localizer:m,components:p,getters:g,selected:w,popupOffset:D,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:S,show:!!s.position,overlayDisplay:this.overlayDisplay,onHide:T})}},{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 a,o=(a=r.gutterRef)!==null&&a!==void 0&&a.current?zw(r.gutterRef.current):void 0;o&&r.state.gutterWidth!==o&&r.setState({gutterWidth:o})})}},{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,a=r.min,o=r.max,s=r.scrollToTime,u=r.localizer,d=u.diff(u.merge(s,a),s,"milliseconds"),m=u.diff(a,o,"milliseconds");this._scrollRatio=d/m}}]),t}(O.Component);af.defaultProps={step:30,timeslots:2};var wG=["date","localizer","min","max","scrollToTime","enableAutoScroll"],cy=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,s=r.min,u=s===void 0?o.startOf(new Date,"day"):s,d=r.max,m=d===void 0?o.endOf(new Date,"day"):d,p=r.scrollToTime,g=p===void 0?o.startOf(new Date,"day"):p,w=r.enableAutoScroll,D=w===void 0?!0:w,S=Ai(r,wG),T=t.range(a,{localizer:o});return q.createElement(af,Object.assign({},S,{range:T,eventOffset:10,localizer:o,min:u,max:m,scrollToTime:g,enableAutoScroll:D}))}}]),t}(q.Component);cy.range=function(e,t){var n=t.localizer;return[n.startOf(e,"day")]};cy.navigate=function(e,t,n){var r=n.localizer;switch(t){case Da.PREVIOUS:return r.add(e,-1,"day");case Da.NEXT:return r.add(e,1,"day");default:return e}};cy.title=function(e,t){var n=t.localizer;return n.format(e,"dayHeaderFormat")};var bG=["date","localizer","min","max","scrollToTime","enableAutoScroll"],wl=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,s=r.min,u=s===void 0?o.startOf(new Date,"day"):s,d=r.max,m=d===void 0?o.endOf(new Date,"day"):d,p=r.scrollToTime,g=p===void 0?o.startOf(new Date,"day"):p,w=r.enableAutoScroll,D=w===void 0?!0:w,S=Ai(r,bG),T=t.range(a,this.props);return q.createElement(af,Object.assign({},S,{range:T,eventOffset:15,localizer:o,min:u,max:m,scrollToTime:g,enableAutoScroll:D}))}}]),t}(q.Component);wl.defaultProps=af.defaultProps;wl.navigate=function(e,t,n){var r=n.localizer;switch(t){case Da.PREVIOUS:return r.add(e,-1,"week");case Da.NEXT:return r.add(e,1,"week");default:return e}};wl.range=function(e,t){var n=t.localizer,r=n.startOfWeek(),a=n.startOf(e,"week",r),o=n.endOf(e,"week",r);return n.range(a,o)};wl.title=function(e,t){var n=t.localizer,r=wl.range(e,{localizer:n}),a=mx(r),o=a[0],s=a.slice(1);return n.format({start:o,end:s.pop()},"dayRangeHeaderFormat")};var DG=["date","localizer","min","max","scrollToTime","enableAutoScroll"];function ab(e,t){return wl.range(e,t).filter(function(n){return[6,0].indexOf(n.getDay())===-1})}var zm=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,s=r.min,u=s===void 0?o.startOf(new Date,"day"):s,d=r.max,m=d===void 0?o.endOf(new Date,"day"):d,p=r.scrollToTime,g=p===void 0?o.startOf(new Date,"day"):p,w=r.enableAutoScroll,D=w===void 0?!0:w,S=Ai(r,DG),T=ab(a,this.props);return q.createElement(af,Object.assign({},S,{range:T,eventOffset:15,localizer:o,min:u,max:m,scrollToTime:g,enableAutoScroll:D}))}}]),t}(q.Component);zm.defaultProps=af.defaultProps;zm.range=ab;zm.navigate=wl.navigate;zm.title=function(e,t){var n=t.localizer,r=ab(e,{localizer:n}),a=mx(r),o=a[0],s=a.slice(1);return n.format({start:o,end:s.pop()},"dayRangeHeaderFormat")};function bl(e){var t=e.accessors,n=e.components,r=e.date,a=e.events,o=e.getters,s=e.length,u=e.localizer,d=e.onDoubleClickEvent,m=e.onSelectEvent,p=e.selected,g=O.useRef(null),w=O.useRef(null),D=O.useRef(null),S=O.useRef(null),T=O.useRef(null);O.useEffect(function(){N()});var E=function(L,z,U){var W=n.event,K=n.date;return z=z.filter(function(ae){return fm(ae,u.startOf(L,"day"),u.endOf(L,"day"),t,u)}),z.map(function(ae,ce){var fe=t.title(ae),ie=t.end(ae),ge=t.start(ae),Te=o.eventProp(ae,ge,ie,sy(ae,p)),se=ce===0&&u.format(L,"agendaDateFormat"),we=ce===0?q.createElement("td",{rowSpan:z.length,className:"rbc-agenda-date-cell"},K?q.createElement(K,{day:L,label:se}):se):!1;return q.createElement("tr",{key:U+"_"+ce,className:Te.className,style:Te.style},we,q.createElement("td",{className:"rbc-agenda-time-cell"},A(L,ae)),q.createElement("td",{className:"rbc-agenda-event-cell",onClick:function($){return m&&m(ae,$)},onDoubleClick:function($){return d&&d(ae,$)}},W?q.createElement(W,{event:ae,title:fe}):fe))},[])},A=function(L,z){var U="",W=n.time,K=u.messages.allDay,ae=t.end(z),ce=t.start(z);return t.allDay(z)||(u.eq(ce,ae)?K=u.format(ce,"agendaTimeFormat"):u.isSameDate(ce,ae)?K=u.format({start:ce,end:ae},"agendaTimeRangeFormat"):u.isSameDate(L,ce)?K=u.format(ce,"agendaTimeFormat"):u.isSameDate(L,ae)&&(K=u.format(ae,"agendaTimeFormat"))),u.gt(L,ce,"day")&&(U="rbc-continues-prior"),u.lt(L,ae,"day")&&(U+=" rbc-continues-after"),q.createElement("span",{className:U.trim()},W?q.createElement(W,{event:z,day:L,label:K}):K)},N=function(){if(T.current){var L=g.current,z=T.current.firstChild;if(z){var U=S.current.scrollHeight>S.current.clientHeight,W=[],K=W;W=[zw(z.children[0]),zw(z.children[1])],(K[0]!==W[0]||K[1]!==W[1])&&(w.current.style.width=W[0]+"px",D.current.style.width=W[1]+"px"),U?(D7(L,"rbc-header-overflowing"),L.style.marginRight=VE()+"px"):S7(L,"rbc-header-overflowing")}}},R=u.messages,F=u.add(r,s,"day"),H=u.range(r,F,"day");return a=a.filter(function(P){return fm(P,u.startOf(r,"day"),u.endOf(F,"day"),t,u)}),a.sort(function(P,L){return+t.start(P)-+t.start(L)}),q.createElement("div",{className:"rbc-agenda-view"},a.length!==0?q.createElement(q.Fragment,null,q.createElement("table",{ref:g,className:"rbc-agenda-table"},q.createElement("thead",null,q.createElement("tr",null,q.createElement("th",{className:"rbc-header",ref:w},R.date),q.createElement("th",{className:"rbc-header",ref:D},R.time),q.createElement("th",{className:"rbc-header"},R.event)))),q.createElement("div",{className:"rbc-agenda-content",ref:S},q.createElement("table",{className:"rbc-agenda-table"},q.createElement("tbody",{ref:T},H.map(function(P,L){return E(P,a,L)}))))):q.createElement("span",{className:"rbc-agenda-empty"},R.noEventsInRange))}bl.defaultProps={length:30};bl.range=function(e,t){var n=t.length,r=n===void 0?bl.defaultProps.length:n,a=t.localizer,o=a.add(e,r,"day");return{start:e,end:o}};bl.navigate=function(e,t,n){var r=n.length,a=r===void 0?bl.defaultProps.length:r,o=n.localizer;switch(t){case Da.PREVIOUS:return o.add(e,-a,"day");case Da.NEXT:return o.add(e,a,"day");default:return e}};bl.title=function(e,t){var n=t.length,r=n===void 0?bl.defaultProps.length:n,a=t.localizer,o=a.add(e,r,"day");return a.format({start:e,end:o},"agendaHeaderFormat")};var Qg=Ic(Ic(Ic(Ic(Ic({},Qr.MONTH,ly),Qr.WEEK,wl),Qr.WORK_WEEK,zm),Qr.DAY,cy),Qr.AGENDA,bl),SG=["action","date","today"];function IG(e,t){var n=t.action,r=t.date,a=t.today,o=Ai(t,SG);switch(e=typeof e=="string"?Qg[e]:e,n){case Da.TODAY:r=a||new Date;break;case Da.DATE:break;default:nm(e&&typeof e.navigate=="function","Calendar View components must implement a static `.navigate(date, action)` method.s"),r=e.navigate(r,n,o)}return r}var TG=function(e){ta(t,e);function t(){var n;pr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.navigate=function(s){n.props.onNavigate(s)},n.view=function(s){n.props.onView(s)},n}return gr(t,[{key:"render",value:function(){var r=this.props,a=r.localizer.messages,o=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,Da.TODAY)},a.today),q.createElement("button",{type:"button",onClick:this.navigate.bind(null,Da.PREVIOUS)},a.previous),q.createElement("button",{type:"button",onClick:this.navigate.bind(null,Da.NEXT)},a.next)),q.createElement("span",{className:"rbc-toolbar-label"},o),q.createElement("span",{className:"rbc-btn-group"},this.viewNamesGroup(a)))}},{key:"viewNamesGroup",value:function(r){var a=this,o=this.props.views,s=this.props.view;if(o.length>1)return o.map(function(u){return q.createElement("button",{type:"button",key:u,className:Qn({"rbc-active":s===u}),onClick:a.view.bind(null,u)},r[u])})}}]),t}(q.Component);function EG(e,t){var n=null;return typeof t=="function"?n=t(e):typeof t=="string"&&ps(e)==="object"&&e!=null&&t in e&&(n=e[t]),n}var dl=function(t){return function(n){return EG(n,t)}},xG=["view","date","getNow","onNavigate"],CG=["view","toolbar","events","backgroundEvents","style","className","elementProps","date","getNow","length","showMultiDayTimes","onShowMore","doShowMoreDrillDown","components","formats","messages","culture"];function Ux(e){if(Array.isArray(e))return e;for(var t=[],n=0,r=Object.entries(e);n<r.length;n++){var a=us(r[n],2),o=a[0],s=a[1];s&&t.push(o)}return t}function MG(e,t){var n=t.views,r=Ux(n);return r.indexOf(e)!==-1}var Vx=function(e){ta(t,e);function t(){var n;pr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.getViews=function(){var s=n.props.views;return Array.isArray(s)?XW(s,function(u,d){return u[d]=Qg[d]},{}):ps(s)==="object"?o$(s,function(u,d){return u===!0?Qg[d]:u}):Qg},n.getView=function(){var s=n.getViews();return s[n.props.view]},n.getDrilldownView=function(s){var u=n.props,d=u.view,m=u.drilldownView,p=u.getDrilldownView;return p?p(s,d,Object.keys(n.getViews())):m},n.handleRangeChange=function(s,u,d){var m=n.props,p=m.onRangeChange,g=m.localizer;p&&u.range&&p(u.range(s,{localizer:g}),d)},n.handleNavigate=function(s,u){var d=n.props,m=d.view,p=d.date,g=d.getNow,w=d.onNavigate,D=Ai(d,xG),S=n.getView(),T=g();p=IG(S,nn(nn({},D),{},{action:s,date:u||p||T,today:T})),w(p,m,s),n.handleRangeChange(p,S)},n.handleViewChange=function(s){s!==n.props.view&&MG(s,n.props)&&n.props.onView(s);var u=n.getViews();n.handleRangeChange(n.props.date||n.props.getNow(),u[s],s)},n.handleSelectEvent=function(){for(var s=arguments.length,u=new Array(s),d=0;d<s;d++)u[d]=arguments[d];vn(n.props.onSelectEvent,u)},n.handleDoubleClickEvent=function(){for(var s=arguments.length,u=new Array(s),d=0;d<s;d++)u[d]=arguments[d];vn(n.props.onDoubleClickEvent,u)},n.handleKeyPressEvent=function(){for(var s=arguments.length,u=new Array(s),d=0;d<s;d++)u[d]=arguments[d];vn(n.props.onKeyPressEvent,u)},n.handleSelectSlot=function(s){vn(n.props.onSelectSlot,s)},n.handleDrillDown=function(s,u){var d=n.props.onDrillDown;if(d){d(s,u,n.drilldownView);return}u&&n.handleViewChange(u),n.handleNavigate(Da.DATE,s)},n.state={context:t.getContext(n.props)},n}return gr(t,[{key:"render",value:function(){var r=this.props,a=r.view,o=r.toolbar,s=r.events,u=r.backgroundEvents,d=r.style,m=r.className,p=r.elementProps,g=r.date,w=r.getNow,D=r.length,S=r.showMultiDayTimes,T=r.onShowMore,E=r.doShowMoreDrillDown;r.components,r.formats,r.messages,r.culture;var A=Ai(r,CG);g=g||w();var N=this.getView(),R=this.state.context,F=R.accessors,H=R.components,P=R.getters,L=R.localizer,z=R.viewNames,U=H.toolbar||TG,W=N.title(g,{localizer:L,length:D});return q.createElement("div",Object.assign({},p,{className:Qn(m,"rbc-calendar",A.rtl&&"rbc-rtl"),style:d}),o&&q.createElement(U,{date:g,view:a,views:z,label:W,onView:this.handleViewChange,onNavigate:this.handleNavigate,localizer:L}),q.createElement(N,Object.assign({},A,{events:s,backgroundEvents:u,date:g,getNow:w,length:D,localizer:L,getters:P,components:H,accessors:F,showMultiDayTimes:S,getDrilldownView:this.getDrilldownView,onNavigate:this.handleNavigate,onDrillDown:this.handleDrillDown,onSelectEvent:this.handleSelectEvent,onDoubleClickEvent:this.handleDoubleClickEvent,onKeyPressEvent:this.handleKeyPressEvent,onSelectSlot:this.handleSelectSlot,onShowMore:T,doShowMoreDrillDown:E})))}}],[{key:"getDerivedStateFromProps",value:function(r){return{context:t.getContext(r)}}},{key:"getContext",value:function(r){var a=r.startAccessor,o=r.endAccessor,s=r.allDayAccessor,u=r.tooltipAccessor,d=r.titleAccessor,m=r.resourceAccessor,p=r.resourceIdAccessor,g=r.resourceTitleAccessor,w=r.eventPropGetter,D=r.backgroundEventPropGetter,S=r.slotPropGetter,T=r.slotGroupPropGetter,E=r.dayPropGetter,A=r.view,N=r.views,R=r.localizer,F=r.culture,H=r.messages,P=H===void 0?{}:H,L=r.components,z=L===void 0?{}:L,U=r.formats,W=U===void 0?{}:U,K=Ux(N),ae=O$(P);return{viewNames:K,localizer:k$(R,F,W,ae),getters:{eventProp:function(){return w&&w.apply(void 0,arguments)||{}},backgroundEventProp:function(){return D&&D.apply(void 0,arguments)||{}},slotProp:function(){return S&&S.apply(void 0,arguments)||{}},slotGroupProp:function(){return T&&T.apply(void 0,arguments)||{}},dayProp:function(){return E&&E.apply(void 0,arguments)||{}}},components:BW(z[A]||{},OW(z,K),{eventWrapper:cs,backgroundEventWrapper:cs,eventContainerWrapper:cs,dateCellWrapper:cs,weekWrapper:cs,timeSlotWrapper:cs,timeGutterWrapper:cs}),accessors:{start:dl(a),end:dl(o),allDay:dl(s),tooltip:dl(u),title:dl(d),resource:dl(m),resourceId:dl(p),resourceTitle:dl(g)}}}}]),t}(q.Component);Vx.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 NG=IE(Vx,{view:"onView",date:"onNavigate",selected:"onSelectEvent"}),kG=function(t,n,r){var a=t.start,o=t.end;return r.format(a,"MMMM DD",n)+" "+r.format(o,r.eq(a,o,"month")?"DD":"MMMM DD",n)},AG=function(t,n,r){var a=t.start,o=t.end;return r.format(a,"L",n)+" "+r.format(o,"L",n)},W0=function(t,n,r){var a=t.start,o=t.end;return r.format(a,"LT",n)+" "+r.format(o,"LT",n)},OG=function(t,n,r){var a=t.start;return r.format(a,"LT",n)+" "},FG=function(t,n,r){var a=t.end;return" "+r.format(a,"LT",n)},PG={dateFormat:"DD",dayFormat:"DD ddd",weekdayFormat:"ddd",selectRangeFormat:W0,eventTimeRangeFormat:W0,eventTimeRangeStartFormat:OG,eventTimeRangeEndFormat:FG,timeGutterFormat:"LT",monthHeaderFormat:"MMMM YYYY",dayHeaderFormat:"dddd MMM DD",dayRangeHeaderFormat:kG,agendaHeaderFormat:AG,agendaDateFormat:"ddd MMM DD",agendaTimeFormat:"LT",agendaTimeRangeFormat:W0};function fl(e){var t=e&&e.toLowerCase();return t==="FullYear"?t="year":t||(t=void 0),t}function jG(e){var t=function(X,ve){return ve?X.locale(ve):X};function n($){return e($).toDate().getTimezoneOffset()}function r($,X){var ve,De,be=e($).local(),ke=e(X).local();if(!e.tz)return be.toDate().getTimezoneOffset()-ke.toDate().getTimezoneOffset();var Be=(ve=be==null||(De=be._z)===null||De===void 0?void 0:De.name)!==null&&ve!==void 0?ve:e.tz.guess(),_e=e.tz.zone(Be).utcOffset(+be),it=e.tz.zone(Be).utcOffset(+ke);return _e-it}function a($){var X=e($).startOf("day");return r(X,$)}function o($,X,ve){var De=fl(ve),be=De?e($).startOf(De):e($),ke=De?e(X).startOf(De):e(X);return[be,ke,De]}function s(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,X=arguments.length>1?arguments[1]:void 0,ve=fl(X);return ve?e($).startOf(ve).toDate():e($).toDate()}function u(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,X=arguments.length>1?arguments[1]:void 0,ve=fl(X);return ve?e($).endOf(ve).toDate():e($).toDate()}function d($,X,ve){var De=o($,X,ve),be=us(De,3),ke=be[0],Be=be[1],_e=be[2];return ke.isSame(Be,_e)}function m($,X,ve){return!d($,X,ve)}function p($,X,ve){var De=o($,X,ve),be=us(De,3),ke=be[0],Be=be[1],_e=be[2];return ke.isAfter(Be,_e)}function g($,X,ve){var De=o($,X,ve),be=us(De,3),ke=be[0],Be=be[1],_e=be[2];return ke.isBefore(Be,_e)}function w($,X,ve){var De=o($,X,ve),be=us(De,3),ke=be[0],Be=be[1],_e=be[2];return ke.isSameOrBefore(Be,_e)}function D($,X,ve){var De=o($,X,ve),be=us(De,3),ke=be[0],Be=be[1],_e=be[2];return ke.isSameOrBefore(Be,_e)}function S($,X,ve){var De=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"day",be=fl(De),ke=e($),Be=e(X),_e=e(ve);return ke.isBetween(Be,_e,be,"[]")}function T($,X){var ve=e($),De=e(X),be=e.min(ve,De);return be.toDate()}function E($,X){var ve=e($),De=e(X),be=e.max(ve,De);return be.toDate()}function A($,X){if(!$&&!X)return null;var ve=e(X).format("HH:mm:ss"),De=e($).startOf("day").format("MM/DD/YYYY");return e("".concat(De," ").concat(ve),"MM/DD/YYYY HH:mm:ss").toDate()}function N($,X,ve){var De=fl(ve);return e($).add(X,De).toDate()}function R($,X){for(var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",De=fl(ve),be=e($).toDate(),ke=[];D(be,X);)ke.push(be),be=N(be,1,De);return ke}function F($,X){var ve=fl(X),De=s($,ve);return d(De,$)?De:N(De,1,ve)}function H($,X){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",De=fl(ve),be=e($),ke=e(X);return ke.diff(be,De)}function P($){var X=e($);return X.minutes()}function L($){var X=$?e.localeData($):e.localeData();return X?X.firstDayOfWeek():0}function z($){return e($).startOf("month").startOf("week").toDate()}function U($){return e($).endOf("month").endOf("week").toDate()}function W($){for(var X=z($),ve=U($),De=[];D(X,ve);)De.push(X),X=N(X,1,"d");return De}function K($,X,ve){return e($).startOf("day").minute(X+ve).toDate()}function ae($,X){return H($,X,"minutes")}function ce($){var X=e($).startOf("day"),ve=e($);return ve.diff(X,"minutes")+a($)}function fe($,X){var ve=e($),De=e(X);return ve.isBefore(De,"day")}function ie($,X,ve){var De=e(X),be=e(ve);return De.isSameOrAfter(be,"minutes")}function ge($,X){var ve=e($),De=e(X),be=e.duration(De.diff(ve));return be.days()}function Te($){var X=$.evtA,ve=X.start,De=X.end,be=X.allDay,ke=$.evtB,Be=ke.start,_e=ke.end,it=ke.allDay,Vt=+s(ve,"day")-+s(Be,"day"),Se=ge(ve,De),Ue=ge(Be,_e);return Vt||Ue-Se||!!it-!!be||+ve-+Be||+De-+_e}function se($){var X=$.event,ve=X.start,De=X.end,be=$.range,ke=be.start,Be=be.end,_e=e(ve).startOf("day"),it=e(De),Vt=e(ke),Se=e(Be),Ue=_e.isSameOrBefore(Se,"day"),Je=!_e.isSame(it,"minutes"),$e=Je?it.isAfter(Vt,"minutes"):it.isSameOrAfter(Vt,"minutes");return Ue&&$e}function we($,X){var ve=e($),De=e(X);return ve.isSame(De,"day")}function Z(){var $=new Date,X=/-/.test($.toString())?"-":"",ve=$.getTimezoneOffset(),De=Number("".concat(X).concat(Math.abs(ve))),be=e().utcOffset();return be>De?1:0}return new N$({formats:PG,firstOfWeek:L,firstVisibleDay:z,lastVisibleDay:U,visibleDays:W,format:function(X,ve,De){return t(e(X),De).format(ve)},lt:g,lte:D,gt:p,gte:w,eq:d,neq:m,merge:A,inRange:S,startOf:s,endOf:u,range:R,add:N,diff:H,ceil:F,min:T,max:E,minutes:P,getSlotDate:K,getTimezoneOffset:n,getDstOffset:r,getTotalMin:ae,getMinutesFromMidnight:ce,continuesPrior:fe,continuesAfter:ie,sortEvents:Te,inEventRange:se,isSameDate:we,daySpan:ge,browserTZOffset:Z})}function h2(e,t,n,r,a){const o={start:r.start(e),end:r.end(e)},s={start:t,end:n};return a.inEventRange({event:o,range:s})}function LG(e,t){return!e||t==null?!1:EI.isEqual(e,t)}const Td={PREVIOUS:"PREV",NEXT:"NEXT",TODAY:"TODAY",DATE:"DATE"};function gs({accessors:e,components:t,date:n,events:r,getters:a,length:o,localizer:s,onDoubleClickEvent:u,onSelectEvent:d,selected:m}){O.useRef(null);const p=O.useRef(null),g=O.useRef(null),w=O.useRef(null),D=O.useRef(null),[S,T]=O.useState(!1),[E,A]=O.useState(!1),N=(W,K,ae)=>{const{event:ce,date:fe}=t;return K=K.filter(ie=>h2(ie,s.startOf(W,"day"),s.endOf(W,"day"),e,s)),K.map((ie,ge)=>{const Te=e.title(ie),se=e.end(ie),we=e.start(ie),Z=a.eventProp(ie,we,se,LG(ie,m)),$=ge===0&&s.format(W,"agendaDateFormat"),X=ge===0?y.jsx("td",{rowSpan:K.length,className:"rbc-agenda-date-cell",children:fe?y.jsx(fe,{day:W,label:$}):$}):!1;return y.jsxs("tr",{className:Z.className,style:Z.style,children:[X,y.jsx("td",{className:"rbc-agenda-time-cell",children:R(W,ie)}),y.jsx("td",{className:"rbc-agenda-event-cell",onClick:ve=>d&&d(ie,ve),onDoubleClick:ve=>u&&u(ie,ve),children:ce?y.jsx(ce,{event:ie,title:Te}):Te})]},ae+"_"+ge)},[])},R=(W,K)=>{const ae=t.time;let ce="",fe=s.messages.allDay;const ie=e.end(K),ge=e.start(K);return e.allDay(K)||(s.eq(ge,ie)?fe=s.format(ge,"agendaTimeFormat"):s.isSameDate(ge,ie)?fe=s.format({start:ge,end:ie},"agendaTimeRangeFormat"):s.isSameDate(W,ge)?fe=s.format(ge,"agendaTimeFormat"):s.isSameDate(W,ie)&&(fe=s.format(ie,"agendaTimeFormat"))),s.gt(W,ge,"day")&&(ce="rbc-continues-prior"),s.lt(W,ie,"day")&&(ce+=" rbc-continues-after"),y.jsx("span",{className:ce.trim(),children:ae?y.jsx(ae,{event:K,day:W,label:fe}):fe})},{messages:F}=s,H=s.add(n,-o/2,"day"),P=s.add(n,o/2,"day"),L=s.range(H,P,"day");S&&L.reverse(),r=r.filter(W=>h2(W,s.startOf(H,"day"),s.endOf(P,"day"),e,s)),r.sort((W,K)=>+e.start(W)-+e.start(K)),E&&r.reverse();const z=O.useCallback(()=>setTimeout(()=>{D.current&&Uv(D.current,{backgroundColor:"#ffffff",pixelRatio:window.devicePixelRatio*2}).then(W=>{new x.Notice(k("Image is generating..."));const K=rt.getState().settings.AutoSaveWhenOnMobile,ae=rt.getState().app.vault;if(K&&x.Platform.isMobile){const ce=W.split("base64,")[1];Av(ce,"image/png").arrayBuffer().then(async ie=>{let ge;const Te="png",se=ws();for(const we in se)if(se[we]instanceof x.TFile){ge=se[we];break}ge!==void 0&&await ae.createBinary(await ae.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,Te,ge),ie)})}Vv({imgUrl:W})}).catch(W=>{console.error(W)})},0),[D.current,L]),U=O.useCallback(W=>{const K=new x.Menu;K.addItem(ae=>{ae.setIcon("share-2").setTitle(k("Share")).onClick(()=>{z()})}),K.showAtMouseEvent(W.nativeEvent)},[D.current,L,z]);return y.jsx("div",{className:"rbc-agenda-view",children:r.length!==0?y.jsx(q.Fragment,{children:y.jsxs("table",{ref:D,className:"rbc-agenda-table",children:[y.jsx("thead",{onContextMenu:U,children:y.jsxs("tr",{children:[y.jsx("th",{className:"rbc-header",ref:p,onClick:()=>{T(!S)},children:F.date+(S?" 🔼":" 🔽")}),y.jsx("th",{className:"rbc-header",ref:g,onClick:()=>{A(!E)},children:F.time+(E?" 🔼":" 🔽")}),y.jsx("th",{className:"rbc-header",children:F.event})]})}),y.jsx("tbody",{ref:w,children:L.map((W,K)=>N(W,r,K))})]})}):y.jsx("span",{className:"rbc-agenda-empty",children:F.noEventsInRange})})}gs.propTypes={accessors:Ae.object.isRequired,components:Ae.object.isRequired,date:Ae.instanceOf(Date),events:Ae.array,getters:Ae.object.isRequired,length:Ae.number.isRequired,localizer:Ae.object.isRequired,onSelectEvent:Ae.func,onDoubleClickEvent:Ae.func,selected:Ae.object};gs.defaultProps={length:30};gs.range=(e,{length:t=gs.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),a=n.add(e,t/2,"day");return{customStart:r,customEnd:a}};gs.navigate=(e,t,{length:n=gs.defaultProps.length,localizer:r})=>{switch(t){case Td.PREVIOUS:return r.add(e,-n,"day");case Td.NEXT:return r.add(e,n,"day");default:return e}};gs.title=(e,{length:t=gs.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),a=n.add(e,t/2,"day");return n.format({start:r,end:a},"agendaHeaderFormat")};function RG(e,t){e.hoverEl.toggleClass("thino-hover-popover",!0);const n=Lv(e.hoverEl);return n.render(y.jsx(Sl,{store:Ee,context:wt,children:y.jsx(Ua,{memo:t})})),n}function _G({event:e}){const t=e.resource,n=t.content.split(`
`)[0].slice(0,20),r=q.useRef(null),a=q.useRef(null),o=q.useRef(null);O.useEffect(()=>{if(a.current)return x.setIcon(a.current,"calendar"),()=>{r.current&&(r.current=null)}},[r]);const s=O.useCallback(d=>{o.current&&(o.current.unmount(),o.current=null),o.current=d},[]),u=O.useCallback(d=>{if(!r.current||!x.Keymap.isModifier(d.nativeEvent,"Mod"))return;const m=new x.HoverPopover(rt.getState().view,r.current,100),p=RG(m,t);s(p)},[r.current]);return y.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:u,children:[y.jsx(HG,{event:e}),y.jsx("strong",{children:n})]})}const HG=({event:e})=>{const t=q.useRef(null),n=e.resource;O.useEffect(()=>{t.current&&x.setIcon(t.current,n.thinoType==="JOURNAL"?"calendar":n.thinoType==="TASK-TODO"?"square":"check-square")},[n==null?void 0:n.thinoType,t]);const r=O.useCallback(async a=>{a.stopPropagation(),a.preventDefault(),await(async()=>{const s=await Ie.updateMemo(n.id,n.content,n.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");s&&Ie.editMemo(s)})()},[n==null?void 0:n.thinoType,n==null?void 0:n.id,n==null?void 0:n.content]);return y.jsx(y.Fragment,{children:y.jsxs("span",{className:"rbc-event-icon-group",children:[y.jsx("span",{className:"rbc-event-icon",ref:t,onClick:r}),y.jsx("span",{className:mr("rbc-event-time","hidden"),children:y.jsx("span",{className:"rbc-event-time-text",children:x.moment(e.start).format("HH:mm")})})]})})};function Zx({views:e,view:t,messages:n,onView:r}){return e.map(a=>y.jsx("button",{type:"button",className:mr({"rbc-active":t===a}),onClick:()=>r(a),children:n[a]},a))}Zx.propTypes={messages:Ae.object,onView:Ae.func,view:Ae.string,views:Ae.array};function Wx({date:e,label:t,localizer:{messages:n},onNavigate:r,onView:a,view:o,views:s}){const u={previous:O.useRef(null),today:O.useRef(null),next:O.useRef(null)};O.useEffect(()=>{u&&(x.setIcon(u.previous.current,"chevron-left"),x.setIcon(u.today.current,"dot"),x.setIcon(u.next.current,"chevron-right"))},[u]);const d=O.useMemo(()=>y.jsxs(y.Fragment,{children:[y.jsx("button",{ref:u.previous,type:"button",onClick:()=>r(Td.PREVIOUS),"aria-label":n.previous,children:"<"}),y.jsx("button",{ref:u.today,type:"button",onClick:()=>r(Td.TODAY),"aria-label":n.today,children:"•"}),y.jsx("button",{ref:u.next,type:"button",onClick:()=>r(Td.NEXT),"aria-label":n.next,children:">"})]}),[n]);return y.jsxs("div",{className:"rbc-toolbar",children:[y.jsx("span",{className:mr("rbc-btn-group","thino-view-custom-toolbar"),children:d}),y.jsx("span",{className:"rbc-toolbar-label",children:y.jsx(dv,{type:"text",handleValueChange:m=>{r(Td.DATE,x.moment(m,"YYYY-MM-DD").format("YYYY-MM-DDTHH:mm:ssZ"))},defaultText:t+(o==="week"?x.moment(e.valueOf(),"x").format(" [W]WW"):""),defaultValue:x.moment(e.valueOf(),"x").valueOf()})}),y.jsx("span",{className:"rbc-btn-group",children:y.jsx(Zx,{view:o,views:s,messages:n,onView:a})})]})}Wx.propTypes={date:Ae.instanceOf(Date),label:Ae.string,localizer:Ae.object,messages:Ae.object,onNavigate:Ae.func,onView:Ae.func,view:Ae.string,views:Ae.array};function BG({event:e,children:t,showPopup:n,callRender:r,...a}){const o=O.useRef(null),s=O.useRef(null),u=O.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")),o.current!==null?(window.clearTimeout(o.current),o.current=null):o.current=window.setTimeout(()=>{n(e,s.current),o.current=null},250))},[e,n]);return y.jsx(y.Fragment,{children:y.jsx("div",{className:"rbc-event-wrapper","aria-describedby":"thino",onClick:u,children:t})})}const YG=jG(x.moment),zG=({event:e})=>{const t=e.resource;return y.jsx(y.Fragment,{children:y.jsx(Ua,{memo:t})})},UG=e=>{var ae;const{thinos:t}=e,[n,r]=q.useState([]),[a,o]=q.useState((app==null?void 0:app.loadLocalStorage("thino-calendar-view"))||"month"),[s,u]=q.useState(null),d=q.useRef(null),m=q.useRef(null),[p,g]=q.useState(!1),w=O.useRef(null),[D,S]=O.useState(new Date);O.useEffect(()=>()=>{d.current&&(d.current=null),m.current&&(m.current=null),w.current&&(w.current=null)},[]),O.useEffect(()=>{const ce=t.map(fe=>{const ie=x.moment(fe.createdAt,"YYYY/MM/DD HH:mm:ss"),ge=ie.clone().add(1,"minute");return{title:fe.content,start:new Date(ie.format("YYYY-MM-DDTHH:mm:ss")),end:new Date(ge.format("YYYY-MM-DDTHH:mm:ss")),resource:fe}});r(ce)},[t]),O.useEffect(()=>{app==null||app.saveLocalStorage("thino-calendar-view",a)},[a]),O.useEffect(()=>{p&&u(t.find(ce=>ce.id===s.id))},[t]),O.useEffect(()=>{s&&w.current.update()},[s]),w.current=zv(d.current,m.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,4]}}]});const T=O.useCallback(()=>{w.current.update(),w.current.update()},[]),E=O.useCallback((ce,fe)=>{u(null),F(),w.current.state.elements.reference=fe,u(ce.resource),H()},[]),A=O.useCallback(()=>{F(),u(null)},[]),N=O.useCallback((ce,fe,ie)=>{var ge;if(R(ce),fe==="week"||fe==="day"){const Te=d.current.find(".rbc-event-wrapper");if(d.current.closest(".memolist-wrapper"),Te){(ge=Te.children[0])==null||ge.click();return}else{setTimeout(()=>{var we,Z;const se=d.current.find(".rbc-event-wrapper");(Z=(we=se==null?void 0:se.children)==null?void 0:we[0])==null||Z.click()},0);return}}},[]),R=O.useCallback(ce=>{S(ce)},[S]);Mm(m,A);const F=O.useCallback(()=>{g(!1)},[g]),H=O.useCallback(()=>{w.current.update(),g(!0)},[g]),P=O.useCallback(ce=>{const fe=ce.resource;Qe.setEditMemoId(fe.id)},[]),L=O.useCallback(ce=>{o(ce)},[o]),{components:z,views:U,messages:W}=O.useMemo(()=>({components:{toolbar:Wx,eventWrapper:ce=>y.jsx(BG,{...ce,callRender:T,showPopup:E}),agenda:{event:zG},event:_G},views:{month:!0,agenda:gs,week:!0,day:!0},messages:{month:k("Month"),day:k("Day"),next:k("Next"),previous:k("Previous"),today:k("Today"),agenda:k("Agenda"),week:k("Week"),yesterday:k("Yesterday"),tomorrow:k("Tomorrow"),noEventsInRange:k("No thinos in range"),date:k("date"),time:k("time"),event:k("event")}}),[]),K=O.useMemo(()=>({timeGutterFormat:(ce,fe,ie)=>ie.format(ce,"HH:mm",fe),agendaTimeRangeFormat:({start:ce,end:fe},ie,ge)=>ge.format(ce,"HH:mm",ie)+" — "+ge.format(fe,"HH:mm",ie),agendaHeaderFormat:({start:ce,end:fe},ie,ge)=>ge.format(ce,"YYYY-MM-DD")+" — "+ge.format(fe,"YYYY-MM-DD")}),[]);return y.jsxs("div",{ref:d,className:"calendar-view",children:[y.jsx(NG,{date:D,messages:W,components:z,localizer:YG,events:n,views:U,onView:L,onDoubleClickEvent:P,onNavigate:N,formats:K,defaultView:a,tooltipAccessor:null,startAccessor:"start",endAccessor:"end"}),y.jsx("div",{ref:m,style:(ae=w.current)==null?void 0:ae.styles.popper,className:mr("thino-popup-container",p?"":"hidden"),children:s&&y.jsx(Ua,{memo:s})})]})};function vl(e,t){return typeof e=="function"?e(t):e}function Va(e,t){return n=>{t.setState(r=>({...r,[e]:vl(n,r[e])}))}}function Ev(e){return e instanceof Function}function VG(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ZG(e,t){const n=[],r=a=>{a.forEach(o=>{n.push(o);const s=t(o);s!=null&&s.length&&r(s)})};return r(e),n}function ht(e,t,n){let r=[],a;return o=>{let s;n.key&&n.debug&&(s=Date.now());const u=e(o);if(!(u.length!==r.length||u.some((p,g)=>r[g]!==p)))return a;r=u;let m;if(n.key&&n.debug&&(m=Date.now()),a=t(...u),n==null||n.onChange==null||n.onChange(a),n.key&&n.debug&&n!=null&&n.debug()){const p=Math.round((Date.now()-s)*100)/100,w=Math.round((Date.now()-m)*100)/100/16,D=(S,T)=>{for(S=String(S);S.length<T;)S=" "+S;return S}}return a}}function mt(e,t,n,r){return{debug:()=>{var a;return(a=e==null?void 0:e.debugAll)!=null?a:e[t]},key:!1,onChange:r}}function WG(e,t,n,r){var a,o;const u={...e._getDefaultColumnDef(),...t},d=u.accessorKey;let m=(a=(o=u.id)!=null?o:d?d.replace(".","_"):void 0)!=null?a:typeof u.header=="string"?u.header:void 0,p;if(u.accessorFn?p=u.accessorFn:d&&(d.includes(".")?p=w=>{let D=w;for(const T of d.split(".")){var S;D=(S=D)==null?void 0:S[T]}return D}:p=w=>w[u.accessorKey]),!m)throw new Error;let g={id:`${String(m)}`,accessorFn:p,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:ht(()=>[!0],()=>{var w;return[g,...(w=g.columns)==null?void 0:w.flatMap(D=>D.getFlatColumns())]},mt(e.options,"debugColumns")),getLeafColumns:ht(()=>[e._getOrderColumnsFn()],w=>{var D;if((D=g.columns)!=null&&D.length){let S=g.columns.flatMap(T=>T.getLeafColumns());return w(S)}return[g]},mt(e.options,"debugColumns"))};for(const w of e._features)w.createColumn==null||w.createColumn(g,e);return g}const Rr="debugHeaders";function m2(e,t,n){var r;let o={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=[],u=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(u),s.push(d)};return u(o),s},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(o,e)}),o}const $G={createTable:e=>{e.getHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>{var o,s;const u=(o=r==null?void 0:r.map(g=>n.find(w=>w.id===g)).filter(Boolean))!=null?o:[],d=(s=a==null?void 0:a.map(g=>n.find(w=>w.id===g)).filter(Boolean))!=null?s:[],m=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(a!=null&&a.includes(g.id)));return Fg(t,[...u,...m,...d],e)},mt(e.options,Rr)),e.getCenterHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(a!=null&&a.includes(o.id))),Fg(t,n,e,"center")),mt(e.options,Rr)),e.getLeftHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var a;const o=(a=r==null?void 0:r.map(s=>n.find(u=>u.id===s)).filter(Boolean))!=null?a:[];return Fg(t,o,e,"left")},mt(e.options,Rr)),e.getRightHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var a;const o=(a=r==null?void 0:r.map(s=>n.find(u=>u.id===s)).filter(Boolean))!=null?a:[];return Fg(t,o,e,"right")},mt(e.options,Rr)),e.getFooterGroups=ht(()=>[e.getHeaderGroups()],t=>[...t].reverse(),mt(e.options,Rr)),e.getLeftFooterGroups=ht(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),mt(e.options,Rr)),e.getCenterFooterGroups=ht(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),mt(e.options,Rr)),e.getRightFooterGroups=ht(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),mt(e.options,Rr)),e.getFlatHeaders=ht(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),mt(e.options,Rr)),e.getLeftFlatHeaders=ht(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),mt(e.options,Rr)),e.getCenterFlatHeaders=ht(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),mt(e.options,Rr)),e.getRightFlatHeaders=ht(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),mt(e.options,Rr)),e.getCenterLeafHeaders=ht(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),mt(e.options,Rr)),e.getLeftLeafHeaders=ht(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),mt(e.options,Rr)),e.getRightLeafHeaders=ht(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),mt(e.options,Rr)),e.getLeafHeaders=ht(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var a,o,s,u,d,m;return[...(a=(o=t[0])==null?void 0:o.headers)!=null?a:[],...(s=(u=n[0])==null?void 0:u.headers)!=null?s:[],...(d=(m=r[0])==null?void 0:m.headers)!=null?d:[]].map(p=>p.getLeafHeaders()).flat()},mt(e.options,Rr))}};function Fg(e,t,n,r){var a,o;let s=0;const u=function(w,D){D===void 0&&(D=1),s=Math.max(s,D),w.filter(S=>S.getIsVisible()).forEach(S=>{var T;(T=S.columns)!=null&&T.length&&u(S.columns,D+1)},0)};u(e);let d=[];const m=(w,D)=>{const S={depth:D,id:[r,`${D}`].filter(Boolean).join("_"),headers:[]},T=[];w.forEach(E=>{const A=[...T].reverse()[0],N=E.column.depth===S.depth;let R,F=!1;if(N&&E.column.parent?R=E.column.parent:(R=E.column,F=!0),A&&(A==null?void 0:A.column)===R)A.subHeaders.push(E);else{const H=m2(n,R,{id:[r,D,R.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:F,placeholderId:F?`${T.filter(P=>P.column===R).length}`:void 0,depth:D,index:T.length});H.subHeaders.push(E),T.push(H)}S.headers.push(E),E.headerGroup=S}),d.push(S),D>0&&m(T,D-1)},p=t.map((w,D)=>m2(n,w,{depth:s,index:D}));m(p,s-1),d.reverse();const g=w=>w.filter(S=>S.column.getIsVisible()).map(S=>{let T=0,E=0,A=[0];S.subHeaders&&S.subHeaders.length?(A=[],g(S.subHeaders).forEach(R=>{let{colSpan:F,rowSpan:H}=R;T+=F,A.push(H)})):T=1;const N=Math.min(...A);return E+=N,S.colSpan=T,S.rowSpan=E,{colSpan:T,rowSpan:E}});return g((a=(o=d[0])==null?void 0:o.headers)!=null?a:[]),d}const Pg={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},$0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),GG={getDefaultColumnDef:()=>Pg,getInitialState:e=>({columnSizing:{},columnSizingInfo:$0(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Va("columnSizing",e),onColumnSizingInfoChange:Va("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,a;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Pg.minSize,(r=o??e.columnDef.size)!=null?r:Pg.size),(a=e.columnDef.maxSize)!=null?a:Pg.maxSize)},e.getStart=ht(n=>[n,Jh(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((a,o)=>a+o.getSize(),0),mt(t.options,"debugColumns")),e.getAfter=ht(n=>[n,Jh(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((a,o)=>a+o.getSize(),0),mt(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...a}=n;return a})},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=a=>{if(a.subHeaders.length)a.subHeaders.forEach(r);else{var o;n+=(o=a.column.getSize())!=null?o: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),a=r==null?void 0:r.getCanResize();return o=>{if(!r||!a||(o.persist==null||o.persist(),G0(o)&&o.touches&&o.touches.length>1))return;const s=e.getSize(),u=e?e.getLeafHeaders().map(A=>[A.column.id,A.column.getSize()]):[[r.id,r.getSize()]],d=G0(o)?Math.round(o.touches[0].clientX):o.clientX,m={},p=(A,N)=>{typeof N=="number"&&(t.setColumnSizingInfo(R=>{var F,H;const P=t.options.columnResizeDirection==="rtl"?-1:1,L=(N-((F=R==null?void 0:R.startOffset)!=null?F:0))*P,z=Math.max(L/((H=R==null?void 0:R.startSize)!=null?H:0),-.999999);return R.columnSizingStart.forEach(U=>{let[W,K]=U;m[W]=Math.round(Math.max(K+K*z,0)*100)/100}),{...R,deltaOffset:L,deltaPercentage:z}}),(t.options.columnResizeMode==="onChange"||A==="end")&&t.setColumnSizing(R=>({...R,...m})))},g=A=>p("move",A),w=A=>{p("end",A),t.setColumnSizingInfo(N=>({...N,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},D=n||typeof document<"u"?document:null,S={moveHandler:A=>g(A.clientX),upHandler:A=>{D==null||D.removeEventListener("mousemove",S.moveHandler),D==null||D.removeEventListener("mouseup",S.upHandler),w(A.clientX)}},T={moveHandler:A=>(A.cancelable&&(A.preventDefault(),A.stopPropagation()),g(A.touches[0].clientX),!1),upHandler:A=>{var N;D==null||D.removeEventListener("touchmove",T.moveHandler),D==null||D.removeEventListener("touchend",T.upHandler),A.cancelable&&(A.preventDefault(),A.stopPropagation()),w((N=A.touches[0])==null?void 0:N.clientX)}},E=qG()?{passive:!1}:!1;G0(o)?(D==null||D.addEventListener("touchmove",T.moveHandler,E),D==null||D.addEventListener("touchend",T.upHandler,E)):(D==null||D.addEventListener("mousemove",S.moveHandler,E),D==null||D.addEventListener("mouseup",S.upHandler,E)),t.setColumnSizingInfo(A=>({...A,startOffset:d,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,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?$0():(n=e.initialState.columnSizingInfo)!=null?n:$0())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0}}};let jg=null;function qG(){if(typeof jg=="boolean")return jg;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 jg=e,jg}function G0(e){return e.type==="touchstart"}const JG={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Va("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a: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 a,o;e.setExpanded(r?{}:(a=(o=e.initialState)==null?void 0:o.expanded)!=null?a:{})},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(a=>!a.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const s=o.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 a;const o=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{s[u]=!0}):s=r,n=(a=n)!=null?a:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){const{[e.id]:u,...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,a;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((a=e.subRows)!=null&&a.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()}}}},$x=(e,t,n)=>{var r;const a=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(a))};$x.autoRemove=e=>Lo(e);const Gx=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Gx.autoRemove=e=>Lo(e);const qx=(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())};qx.autoRemove=e=>Lo(e);const Jx=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Jx.autoRemove=e=>Lo(e)||!(e!=null&&e.length);const Kx=(e,t,n)=>!n.some(r=>{var a;return!((a=e.getValue(t))!=null&&a.includes(r))});Kx.autoRemove=e=>Lo(e)||!(e!=null&&e.length);const Qx=(e,t,n)=>n.some(r=>{var a;return(a=e.getValue(t))==null?void 0:a.includes(r)});Qx.autoRemove=e=>Lo(e)||!(e!=null&&e.length);const Xx=(e,t,n)=>e.getValue(t)===n;Xx.autoRemove=e=>Lo(e);const eC=(e,t,n)=>e.getValue(t)==n;eC.autoRemove=e=>Lo(e);const ob=(e,t,n)=>{let[r,a]=n;const o=e.getValue(t);return o>=r&&o<=a};ob.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,a=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(a)?1/0:a;if(o>s){const u=o;o=s,s=u}return[o,s]};ob.autoRemove=e=>Lo(e)||Lo(e[0])&&Lo(e[1]);const ss={includesString:$x,includesStringSensitive:Gx,equalsString:qx,arrIncludes:Jx,arrIncludesAll:Kx,arrIncludesSome:Qx,equals:Xx,weakEquals:eC,inNumberRange:ob};function Lo(e){return e==null||e===""}const KG={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Va("columnFilters",e),onGlobalFilterChange:Va("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"?ss.includesString:typeof r=="number"?ss.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ss.equals:Array.isArray(r)?ss.arrIncludes:ss.weakEquals},e.getFilterFn=()=>{var n,r;return Ev(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:ss[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,a;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,a,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!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(a=>a.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const a=e.getFilterFn(),o=r==null?void 0:r.find(p=>p.id===e.id),s=vl(n,o?o.value:void 0);if(p2(a,s,e)){var u;return(u=r==null?void 0:r.filter(p=>p.id!==e.id))!=null?u:[]}const d={id:e.id,value:s};if(o){var m;return(m=r==null?void 0:r.map(p=>p.id===e.id?d:p))!=null?m:[]}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=()=>ss.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Ev(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ss[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=a=>{var o;return(o=vl(t,a))==null?void 0:o.filter(s=>{const u=n.find(d=>d.id===s.id);if(u){const d=u.getFilterFn();if(p2(d,s.value,u))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 p2(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,a)=>{const o=a.getValue(e);return r+(typeof o=="number"?o:0)},0),XG=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},eq=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},tq=(e,t,n)=>{let r,a;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r===void 0?s>=s&&(r=a=s):(r>s&&(r=s),a<s&&(a=s)))}),[r,a]},nq=(e,t)=>{let n=0,r=0;if(t.forEach(a=>{let o=a.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},rq=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!VG(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),a=n.sort((o,s)=>o-s);return n.length%2!==0?a[r]:(a[r-1]+a[r])/2},aq=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),oq=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,iq=(e,t)=>t.length,q0={sum:QG,min:XG,max:eq,extent:tq,mean:nq,median:rq,unique:aq,uniqueCount:oq,count:iq},sq={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:Va("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,a,o;return(n=(r=(a=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?a: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 q0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return q0.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Ev(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:q0[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 a;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((a=n.subRows)!=null&&a.length)}}};function lq(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(s=>s.id===o)).filter(Boolean),...r]}const cq={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Va("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ht(n=>[Jh(t,n)],n=>n.findIndex(r=>r.id===e.id),mt(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Jh(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const a=Jh(t,n);return((r=a[a.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=ht(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>a=>{let o=[];if(!(t!=null&&t.length))o=a;else{const s=[...t],u=[...a];for(;u.length&&s.length;){const d=s.shift(),m=u.findIndex(p=>p.id===d);m>-1&&o.push(u.splice(m,1)[0])}o=[...o,...u]}return lq(o,n,r)},mt(e.options,"debugTable"))}},Zw=0,Ww=10,J0=()=>({pageIndex:Zw,pageSize:Ww}),uq={getInitialState:e=>({...e,pagination:{...J0(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Va("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const a=o=>vl(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(a)},e.resetPagination=r=>{var a;e.setPagination(r?J0():(a=e.initialState.pagination)!=null?a:J0())},e.setPageIndex=r=>{e.setPagination(a=>{let o=vl(r,a.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,s)),{...a,pageIndex:o}})},e.resetPageIndex=r=>{var a,o;e.setPageIndex(r?Zw:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?a:Zw)},e.resetPageSize=r=>{var a,o;e.setPageSize(r?Ww:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?a:Ww)},e.setPageSize=r=>{e.setPagination(a=>{const o=Math.max(1,vl(r,a.pageSize)),s=a.pageSize*a.pageIndex,u=Math.floor(s/o);return{...a,pageIndex:u,pageSize:o}})},e.setPageCount=r=>e.setPagination(a=>{var o;let s=vl(r,(o=e.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...a,pageCount:s}}),e.getPageOptions=ht(()=>[e.getPageCount()],r=>{let a=[];return r&&r>0&&(a=[...new Array(r)].fill(null).map((o,s)=>s)),a},mt(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,a=e.getPageCount();return a===-1?!0:a===0?!1:r<a-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}}},K0=()=>({left:[],right:[]}),Q0=()=>({top:[],bottom:[]}),dq={getInitialState:e=>({columnPinning:K0(),rowPinning:Q0(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Va("columnPinning",e),onRowPinningChange:Va("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(a=>a.id).filter(Boolean);t.setColumnPinning(a=>{var o,s;if(n==="right"){var u,d;return{left:((u=a==null?void 0:a.left)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((d=a==null?void 0:a.right)!=null?d:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var m,p;return{left:[...((m=a==null?void 0:a.left)!=null?m:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((p=a==null?void 0:a.right)!=null?p:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((o=a==null?void 0:a.left)!=null?o:[]).filter(g=>!(r!=null&&r.includes(g))),right:((s=a==null?void 0:a.right)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var a,o,s;return((a=r.columnDef.enablePinning)!=null?a:!0)&&((o=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(u=>u.id),{left:r,right:a}=t.getState().columnPinning,o=n.some(u=>r==null?void 0:r.includes(u)),s=n.some(u=>a==null?void 0:a.includes(u));return o?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();return a?(n=(r=t.getState().columnPinning)==null||(r=r[a])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,a)=>{const o=r?e.getLeafRows().map(d=>{let{id:m}=d;return m}):[],s=a?e.getParentRows().map(d=>{let{id:m}=d;return m}):[],u=new Set([...s,e.id,...o]);t.setRowPinning(d=>{var m,p;if(n==="bottom"){var g,w;return{top:((g=d==null?void 0:d.top)!=null?g:[]).filter(T=>!(u!=null&&u.has(T))),bottom:[...((w=d==null?void 0:d.bottom)!=null?w:[]).filter(T=>!(u!=null&&u.has(T))),...Array.from(u)]}}if(n==="top"){var D,S;return{top:[...((D=d==null?void 0:d.top)!=null?D:[]).filter(T=>!(u!=null&&u.has(T))),...Array.from(u)],bottom:((S=d==null?void 0:d.bottom)!=null?S:[]).filter(T=>!(u!=null&&u.has(T)))}}return{top:((m=d==null?void 0:d.top)!=null?m:[]).filter(T=>!(u!=null&&u.has(T))),bottom:((p=d==null?void 0:d.bottom)!=null?p:[]).filter(T=>!(u!=null&&u.has(T)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:a}=t.options;return typeof r=="function"?r(e):(n=r??a)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:a}=t.getState().rowPinning,o=n.some(u=>r==null?void 0:r.includes(u)),s=n.some(u=>a==null?void 0:a.includes(u));return o?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();if(!a)return-1;const o=(n=t._getPinnedRows(a))==null?void 0:n.map(s=>{let{id:u}=s;return u});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=ht(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,a)=>{const o=[...r??[],...a??[]];return n.filter(s=>!o.includes(s.column.id))},mt(t.options,"debugRows")),e.getLeftVisibleCells=ht(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),mt(t.options,"debugRows")),e.getRightVisibleCells=ht(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),mt(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?K0():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:K0())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var a,o;return!!((a=r.left)!=null&&a.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ht(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),mt(e.options,"debugColumns")),e.getRightLeafColumns=ht(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),mt(e.options,"debugColumns")),e.getCenterLeafColumns=ht(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const a=[...n??[],...r??[]];return t.filter(o=>!a.includes(o.id))},mt(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?Q0():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Q0())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var a,o;return!!((a=r.top)!=null&&a.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=ht(t=>[e.getRowModel().rows,e.getState().rowPinning[t],t],(t,n,r)=>{var a;return((a=e.options.keepPinnedRows)==null||a?(n??[]).map(s=>{const u=e.getRow(s,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(s=>t.find(u=>u.id===s))).filter(Boolean).map(s=>({...s,position:r}))},mt(e.options,"debugRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=ht(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const a=new Set([...n??[],...r??[]]);return t.filter(o=>!a.has(o.id))},mt(e.options,"debugRows"))}},fq={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Va("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},a=e.getPreGroupedRowModel().flatRows;return t?a.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):a.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),a={...n};return e.getRowModel().rows.forEach(o=>{$w(a,o.id,r,!0,e)}),a}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ht(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?X0(e,n):{rows:[],flatRows:[],rowsById:{}},mt(e.options,"debugTable")),e.getFilteredSelectedRowModel=ht(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?X0(e,n):{rows:[],flatRows:[],rowsById:{}},mt(e.options,"debugTable")),e.getGroupedSelectedRowModel=ht(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?X0(e,n):{rows:[],flatRows:[],rowsById:{}},mt(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(a=>a.getCanSelect()&&!n[a.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(a=>a.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(a=>!n[a.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 a=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=typeof n<"u"?n:!a,e.getCanSelect()&&a===n)return o;const u={...o};return $w(u,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return ib(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Gw(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Gw(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 a;n&&e.toggleSelected((a=r.target)==null?void 0:a.checked)}}}},$w=(e,t,n,r,a)=>{var o;const s=a.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=s.subRows)!=null&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(u=>$w(e,u.id,n,r,a))};function X0(e,t){const n=e.getState().rowSelection,r=[],a={},o=function(s,u){return s.map(d=>{var m;const p=ib(d,n);if(p&&(r.push(d),a[d.id]=d),(m=d.subRows)!=null&&m.length&&(d={...d,subRows:o(d.subRows)}),p)return d}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:a}}function ib(e,t){var n;return(n=t[e.id])!=null?n:!1}function Gw(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let a=!0,o=!1;return e.subRows.forEach(s=>{if(!(o&&!a)&&(s.getCanSelect()&&(ib(s,t)?o=!0:a=!1),s.subRows&&s.subRows.length)){const u=Gw(s,t);u==="all"?o=!0:(u==="some"&&(o=!0),a=!1)}}),a?"all":o?"some":!1}const qw=/([0-9]+)/gm,hq=(e,t,n)=>tC(Dl(e.getValue(n)).toLowerCase(),Dl(t.getValue(n)).toLowerCase()),mq=(e,t,n)=>tC(Dl(e.getValue(n)),Dl(t.getValue(n))),pq=(e,t,n)=>sb(Dl(e.getValue(n)).toLowerCase(),Dl(t.getValue(n)).toLowerCase()),gq=(e,t,n)=>sb(Dl(e.getValue(n)),Dl(t.getValue(n))),vq=(e,t,n)=>{const r=e.getValue(n),a=t.getValue(n);return r>a?1:r<a?-1:0},yq=(e,t,n)=>sb(e.getValue(n),t.getValue(n));function sb(e,t){return e===t?0:e>t?1:-1}function Dl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function tC(e,t){const n=e.split(qw).filter(Boolean),r=t.split(qw).filter(Boolean);for(;n.length&&r.length;){const a=n.shift(),o=r.shift(),s=parseInt(a,10),u=parseInt(o,10),d=[s,u].sort();if(isNaN(d[0])){if(a>o)return 1;if(o>a)return-1;continue}if(isNaN(d[1]))return isNaN(s)?-1:1;if(s>u)return 1;if(u>s)return-1}return n.length-r.length}const Id={alphanumeric:hq,alphanumericCaseSensitive:mq,text:pq,textCaseSensitive:gq,datetime:vq,basic:yq},wq={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Va("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const a of n){const o=a==null?void 0:a.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Id.datetime;if(typeof o=="string"&&(r=!0,o.split(qw).length>1))return Id.alphanumeric}return r?Id.text:Id.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 Ev(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:Id[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const a=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(s=>{const u=s==null?void 0:s.find(D=>D.id===e.id),d=s==null?void 0:s.findIndex(D=>D.id===e.id);let m=[],p,g=o?n:a==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?u?p="toggle":p="add":s!=null&&s.length&&d!==s.length-1?p="replace":u?p="toggle":p="replace",p==="toggle"&&(o||a||(p="remove")),p==="add"){var w;m=[...s,{id:e.id,desc:g}],m.splice(0,m.length-((w=t.options.maxMultiSortColCount)!=null?w:Number.MAX_SAFE_INTEGER))}else p==="toggle"?m=s.map(D=>D.id===e.id?{...D,desc:g}:D):p==="remove"?m=s.filter(D=>D.id!==e.id):m=[{id:e.id,desc:g}];return m})},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,a;const o=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(a=t.options.enableMultiRemove)!=null)||a)?!1:s==="desc"?"asc":"desc":o},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(a=>a.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(a=>a.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())}},bq={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Va("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 a=e.columns;return(n=a.length?a.some(o=>o.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=ht(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),mt(t.options,"debugRows")),e.getVisibleCells=ht(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,a)=>[...n,...r,...a],mt(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>ht(()=>[r(),r().filter(a=>a.getIsVisible()).map(a=>a.id).join("_")],a=>a.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),mt(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((a,o)=>({...a,[o.id]:n||!(o.getCanHide!=null&&o.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 Jh(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const g2=[$G,bq,cq,dq,KG,wq,sq,JG,uq,fq,GG];function Dq(e){var t;e.debugAll||e.debugTable;let n={_features:g2};const r=n._features.reduce((p,g)=>Object.assign(p,g.getDefaultOptions==null?void 0:g.getDefaultOptions(n)),{}),a=p=>n.options.mergeOptions?n.options.mergeOptions(r,p):{...r,...p};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(p=>{var g;s=(g=p.getInitialState==null?void 0:p.getInitialState(s))!=null?g:s});const u=[];let d=!1;const m={_features:g2,options:{...r,...e},initialState:s,_queue:p=>{u.push(p),d||(d=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();d=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{n.setState(n.initialState)},setOptions:p=>{const g=vl(p,n.options);n.options=a(g)},getState:()=>n.options.state,setState:p=>{n.options.onStateChange==null||n.options.onStateChange(p)},_getRowId:(p,g,w)=>{var D;return(D=n.options.getRowId==null?void 0:n.options.getRowId(p,g,w))!=null?D:`${w?[w.id,g].join("."):g}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(p,g)=>{let w=(g?n.getPrePaginationRowModel():n.getRowModel()).rowsById[p];if(!w&&(w=n.getCoreRowModel().rowsById[p],!w))throw new Error;return w},_getDefaultColumnDef:ht(()=>[n.options.defaultColumn],p=>{var g;return p=(g=p)!=null?g:{},{header:w=>{const D=w.header.column.columnDef;return D.accessorKey?D.accessorKey:D.accessorFn?D.id:null},cell:w=>{var D,S;return(D=(S=w.renderValue())==null||S.toString==null?void 0:S.toString())!=null?D:null},...n._features.reduce((w,D)=>Object.assign(w,D.getDefaultColumnDef==null?void 0:D.getDefaultColumnDef()),{}),...p}},mt(e,"debugColumns")),_getColumnDefs:()=>n.options.columns,getAllColumns:ht(()=>[n._getColumnDefs()],p=>{const g=function(w,D,S){return S===void 0&&(S=0),w.map(T=>{const E=WG(n,T,S,D),A=T;return E.columns=A.columns?g(A.columns,E,S+1):[],E})};return g(p)},mt(e,"debugColumns")),getAllFlatColumns:ht(()=>[n.getAllColumns()],p=>p.flatMap(g=>g.getFlatColumns()),mt(e,"debugColumns")),_getAllFlatColumnsById:ht(()=>[n.getAllFlatColumns()],p=>p.reduce((g,w)=>(g[w.id]=w,g),{}),mt(e,"debugColumns")),getAllLeafColumns:ht(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(p,g)=>{let w=p.flatMap(D=>D.getLeafColumns());return g(w)},mt(e,"debugColumns")),getColumn:p=>n._getAllFlatColumnsById()[p]};Object.assign(n,m);for(let p=0;p<n._features.length;p++){const g=n._features[p];g==null||g.createTable==null||g.createTable(n)}return n}function Sq(e,t,n,r){const a=()=>{var s;return(s=o.getValue())!=null?s:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:a,getContext:ht(()=>[e,n,t,o],(s,u,d,m)=>({table:s,column:u,row:d,cell:m,getValue:m.getValue,renderValue:m.renderValue}),mt(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(o,n,t,e)},{}),o}const lb=(e,t,n,r,a,o,s)=>{let u={id:t,index:r,original:n,depth:a,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(u._valuesCache.hasOwnProperty(d))return u._valuesCache[d];const m=e.getColumn(d);if(m!=null&&m.accessorFn)return u._valuesCache[d]=m.accessorFn(u.original,r),u._valuesCache[d]},getUniqueValues:d=>{if(u._uniqueValuesCache.hasOwnProperty(d))return u._uniqueValuesCache[d];const m=e.getColumn(d);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(u._uniqueValuesCache[d]=m.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[d]):(u._uniqueValuesCache[d]=[u.getValue(d)],u._uniqueValuesCache[d])},renderValue:d=>{var m;return(m=u.getValue(d))!=null?m:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>ZG(u.subRows,d=>d.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let d=[],m=u;for(;;){const p=m.getParentRow();if(!p)break;d.push(p),m=p}return d.reverse()},getAllCells:ht(()=>[e.getAllLeafColumns()],d=>d.map(m=>Sq(e,u,m,m.id)),mt(e.options,"debugRows")),_getAllCellsByColumnId:ht(()=>[u.getAllCells()],d=>d.reduce((m,p)=>(m[p.column.id]=p,m),{}),mt(e.options,"debugRows"))};for(let d=0;d<e._features.length;d++){const m=e._features[d];m==null||m.createRow==null||m.createRow(u,e)}return u};function Iq(){return e=>ht(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(a,o,s){o===void 0&&(o=0);const u=[];for(let m=0;m<a.length;m++){const p=lb(e,e._getRowId(a[m],m,s),a[m],m,o,void 0,s==null?void 0:s.id);if(n.flatRows.push(p),n.rowsById[p.id]=p,u.push(p),e.options.getSubRows){var d;p.originalSubRows=e.options.getSubRows(a[m],m),(d=p.originalSubRows)!=null&&d.length&&(p.subRows=r(p.originalSubRows,o+1,p))}}return u};return n.rows=r(t),n},mt(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function nC(e,t,n){return n.options.filterFromLeafRows?Tq(e,t,n):Eq(e,t,n)}function Tq(e,t,n){var r;const a=[],o={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(d,m){m===void 0&&(m=0);const p=[];for(let w=0;w<d.length;w++){var g;let D=d[w];const S=lb(n,D.id,D.original,D.index,D.depth,void 0,D.parentId);if(S.columnFilters=D.columnFilters,(g=D.subRows)!=null&&g.length&&m<s){if(S.subRows=u(D.subRows,m+1),D=S,t(D)&&!S.subRows.length){p.push(D),o[D.id]=D,a.push(D);continue}if(t(D)||S.subRows.length){p.push(D),o[D.id]=D,a.push(D);continue}}else D=S,t(D)&&(p.push(D),o[D.id]=D,a.push(D))}return p};return{rows:u(e),flatRows:a,rowsById:o}}function Eq(e,t,n){var r;const a=[],o={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(d,m){m===void 0&&(m=0);const p=[];for(let w=0;w<d.length;w++){let D=d[w];if(t(D)){var g;if((g=D.subRows)!=null&&g.length&&m<s){const T=lb(n,D.id,D.original,D.index,D.depth,void 0,D.parentId);T.subRows=u(D.subRows,m+1),D=T}p.push(D),a.push(D),o[D.id]=D}}return p};return{rows:u(e),flatRows:a,rowsById:o}}function xq(){return e=>ht(()=>[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 a=[],o=[];(n??[]).forEach(w=>{var D;const S=e.getColumn(w.id);if(!S)return;const T=S.getFilterFn();T&&a.push({id:w.id,filterFn:T,resolvedValue:(D=T.resolveFilterValue==null?void 0:T.resolveFilterValue(w.value))!=null?D:w.value})});const s=n.map(w=>w.id),u=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(w=>w.getCanGlobalFilter());r&&u&&d.length&&(s.push("__global__"),d.forEach(w=>{var D;o.push({id:w.id,filterFn:u,resolvedValue:(D=u.resolveFilterValue==null?void 0:u.resolveFilterValue(r))!=null?D:r})}));let m,p;for(let w=0;w<t.flatRows.length;w++){const D=t.flatRows[w];if(D.columnFilters={},a.length)for(let S=0;S<a.length;S++){m=a[S];const T=m.id;D.columnFilters[T]=m.filterFn(D,T,m.resolvedValue,E=>{D.columnFiltersMeta[T]=E})}if(o.length){for(let S=0;S<o.length;S++){p=o[S];const T=p.id;if(p.filterFn(D,T,p.resolvedValue,E=>{D.columnFiltersMeta[T]=E})){D.columnFilters.__global__=!0;break}}D.columnFilters.__global__!==!0&&(D.columnFilters.__global__=!1)}}const g=w=>{for(let D=0;D<s.length;D++)if(w.columnFilters[s[D]]===!1)return!1;return!0};return nC(t.rows,g,e)},mt(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Cq(){return(e,t)=>ht(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,a)=>{if(!n.rows.length||!(r!=null&&r.length)&&!a)return n;const o=[...r.map(u=>u.id).filter(u=>u!==t),a?"__global__":void 0].filter(Boolean),s=u=>{for(let d=0;d<o.length;d++)if(u.columnFilters[o[d]]===!1)return!1;return!0};return nC(n.rows,s,e)},mt(e.options,"debugTable"))}function Mq(){return(e,t)=>ht(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let o=0;o<n.flatRows.length;o++){const s=n.flatRows[o].getUniqueValues(t);for(let u=0;u<s.length;u++){const d=s[u];if(r.has(d)){var a;r.set(d,((a=r.get(d))!=null?a:0)+1)}else r.set(d,1)}}return r},mt(e.options,"debugTable"))}function Nq(){return(e,t)=>ht(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{var r;if(!n)return;const a=(r=n.flatRows[0])==null?void 0:r.getUniqueValues(t);if(typeof a>"u")return;let o=[a,a];for(let s=0;s<n.flatRows.length;s++){const u=n.flatRows[s].getUniqueValues(t);for(let d=0;d<u.length;d++){const m=u[d];m<o[0]?o[0]=m:m>o[1]&&(o[1]=m)}}return o},mt(e.options,"debugTable"))}function kq(){return e=>ht(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,a=[],o=r.filter(d=>{var m;return(m=e.getColumn(d.id))==null?void 0:m.getCanSort()}),s={};o.forEach(d=>{const m=e.getColumn(d.id);m&&(s[d.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const u=d=>{const m=d.map(p=>({...p}));return m.sort((p,g)=>{for(let D=0;D<o.length;D+=1){var w;const S=o[D],T=s[S.id],E=(w=S==null?void 0:S.desc)!=null?w:!1;let A=0;if(T.sortUndefined){const N=p.getValue(S.id),R=g.getValue(S.id),F=N===void 0,H=R===void 0;(F||H)&&(A=F&&H?0:F?T.sortUndefined:-T.sortUndefined)}if(A===0&&(A=T.sortingFn(p,g,S.id)),A!==0)return E&&(A*=-1),T.invertSorting&&(A*=-1),A}return p.index-g.index}),m.forEach(p=>{var g;a.push(p),(g=p.subRows)!=null&&g.length&&(p.subRows=u(p.subRows))}),m};return{rows:u(n.rows),flatRows:a,rowsById:n.rowsById}},mt(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Aq(e){const t=[],n=r=>{var a;t.push(r),(a=r.subRows)!=null&&a.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Oq(e){return t=>ht(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:a,pageIndex:o}=n;let{rows:s,flatRows:u,rowsById:d}=r;const m=a*o,p=m+a;s=s.slice(m,p);let g;t.options.paginateExpandedRows?g={rows:s,flatRows:u,rowsById:d}:g=Aq({rows:s,flatRows:u,rowsById:d}),g.flatRows=[];const w=D=>{g.flatRows.push(D),D.subRows.length&&D.subRows.forEach(w)};return g.rows.forEach(w),g},mt(t.options,"debugTable"))}function v2(e,t){return e?Fq(e)?O.createElement(e,t):e:null}function Fq(e){return Pq(e)||typeof e=="function"||jq(e)}function Pq(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function jq(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Lq(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=O.useState(()=>({current:Dq(t)})),[r,a]=O.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:s=>{a(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const rC={À:"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"},Rq=Object.keys(rC).join("|"),_q=new RegExp(Rq,"g");function Hq(e){return e.replace(_q,t=>rC[t])}const ya={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Bq(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:ya.MATCHES,!n.accessors){const s=y2(e,t,n);return{rankedValue:e,rank:s,accessorIndex:-1,accessorThreshold:n.threshold,passed:s>=n.threshold}}const a=Zq(e,n.accessors),o={rankedValue:e,rank:ya.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<a.length;s++){const u=a[s];let d=y2(u.itemValue,t,n);const{minRanking:m,maxRanking:p,threshold:g=n.threshold}=u.attributes;d<m&&d>=ya.MATCHES?d=m:d>p&&(d=p),d=Math.min(d,p),d>=g&&d>o.rank&&(o.rank=d,o.passed=!0,o.accessorIndex=s,o.accessorThreshold=g,o.rankedValue=u.itemValue)}return o}function y2(e,t,n){return e=w2(e,n),t=w2(t,n),t.length>e.length?ya.NO_MATCH:e===t?ya.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?ya.EQUAL:e.startsWith(t)?ya.STARTS_WITH:e.includes(` ${t}`)?ya.WORD_STARTS_WITH:e.includes(t)?ya.CONTAINS:t.length===1?ya.NO_MATCH:Yq(e).includes(t)?ya.ACRONYM:zq(e,t))}function Yq(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(o=>{t+=o.substr(0,1)})}),t}function zq(e,t){let n=0,r=0;function a(d,m,p){for(let g=p,w=m.length;g<w;g++)if(m[g]===d)return n+=1,g+1;return-1}function o(d){const m=1/d,p=n/t.length;return ya.MATCHES+p*m}const s=a(t[0],e,0);if(s<0)return ya.NO_MATCH;r=s;for(let d=1,m=t.length;d<m;d++){const p=t[d];if(r=a(p,e,r),!(r>-1))return ya.NO_MATCH}const u=r-s;return o(u)}function Uq(e,t){return e.rank===t.rank?0:e.rank>t.rank?-1:1}function w2(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=Hq(e)),e}function Vq(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 Zq(e,t){const n=[];for(let r=0,a=t.length;r<a;r++){const o=t[r],s=Wq(o),u=Vq(e,o);for(let d=0,m=u.length;d<m;d++)n.push({itemValue:u[d],attributes:s})}return n}const b2={maxRanking:1/0,minRanking:-1/0};function Wq(e){return typeof e=="function"?b2:{...b2,...e}}const $q=({thino:e})=>{const t=O.useRef(null);O.useEffect(()=>(t.current&&x.setIcon(t.current,"pin"),()=>{t.current&&(t.current=null)}),[t]);const n=O.useCallback(async()=>{e.pinned?await Ie.unpinMemoById(e.id):await Ie.pinMemoById(e.id)},[e]);return y.jsx("span",{ref:t,className:mr("pinned-status",e.pinned?"pinned":"not-pinned"),onClick:n})},Gq=({thino:e})=>{const t=O.useRef(null);O.useEffect(()=>(t.current&&x.setIcon(t.current,e.thinoType==="JOURNAL"?"calendar":"check-square"),()=>{t.current&&(t.current=null)}),[t,e==null?void 0:e.thinoType]);const n=O.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const r=await Ie.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");r&&Ie.editMemo(r)},[e]);return y.jsx(y.Fragment,{children:e.thinoType!=="JOURNAL"?y.jsx("input",{className:mr("thino-type-status","task-list-item-checkbox"),type:"checkbox",checked:e.thinoType!=="TASK-TODO","data-task":e.thinoType==="TASK-TODO"?"":e.thinoType==="TASK-DONE"?"x":e.thinoType.slice(5),onClick:n}):y.jsx("span",{ref:t,className:"thino-type-status"})})},qq=({id:e,path:t})=>{const n=O.useRef(null);O.useEffect(()=>(n.current&&x.setIcon(n.current,"link"),()=>{n.current&&(n.current=null)}),[]);const r=O.useCallback(()=>{!e||!t||Ie.openThinoByID(e)},[e,t]);return y.jsxs("span",{className:"source-thino",onClick:r,children:[y.jsx("span",{children:t}),y.jsx("span",{ref:n,className:"source-thino-icon"})]})},Jq=({id:e,sourceType:t})=>{const n=O.useRef(null);O.useEffect(()=>{var a;return n.current&&x.setIcon(n.current,((a=Md.find(o=>o.title===t))==null?void 0:a.icon)||"list"),()=>{n.current&&(n.current=null)}},[]);const r=O.useCallback(async()=>{e&&await Ie.openThinoByID(e)},[e]);return y.jsx("span",{ref:n,className:"source-type-icon",onClick:r})},D2=(e,t,n,r)=>{const a=Bq(e.getValue(t),n);return r({itemRank:a}),a.passed},S2=(e,t,n)=>{var a,o;let r=0;return e.columnFiltersMeta[n]&&(r=Uq((a=e.columnFiltersMeta[n])==null?void 0:a.itemRank,(o=t.columnFiltersMeta[n])==null?void 0:o.itemRank)),r===0?Id.alphanumeric(e,t,n):r};function Kq({thinos:e}){var p;q.useReducer(()=>({}),{})[1];const[t,n]=q.useState([]),[r,a]=q.useState(""),o=q.useMemo(()=>[{header:k("Basic Info"),footer:g=>g.column.id,columns:[{accessorKey:"createdAt",header:()=>y.jsx("span",{className:"create-at-header-cell",children:k("Created At")}),cell:g=>g.getValue(),footer:g=>g.column.id,enableColumnFilter:!1},{accessorFn:g=>g.content,id:"content",header:()=>y.jsx("span",{className:"thino-header-cell",children:k("Thino")}),cell:g=>y.jsx(Ua,{memo:g.row.original,type:"table"}),footer:g=>g.column.id,filterFn:"fuzzy",sortingFn:S2},{accessorFn:g=>g.thinoType,id:"thinoType",cell:g=>y.jsx(Gq,{thino:g.row.original}),header:()=>y.jsx("span",{children:k("Thino Type")}),footer:g=>g.column.id},{accessorFn:g=>g.sourceType,id:"sourceType",cell:g=>y.jsx(Jq,{id:g.row.original.id,sourceType:g.getValue()}),header:()=>y.jsx("span",{children:k("Source Type")}),footer:g=>g.column.id}]},{header:k("Additional Info"),footer:g=>g.column.id,columns:[{accessorKey:"pinned",header:()=>y.jsx("span",{children:k("Pinned Status")}),cell:g=>y.jsx($q,{thino:g.row.original}),footer:g=>g.column.id,filterFn:"fuzzy",sortingFn:S2},{accessorKey:"rowStatus",header:()=>y.jsx("span",{children:k("Row status")}),cell:g=>y.jsx("span",{children:g.getValue()==="NORMAL"?"":g.getValue()}),footer:g=>g.column.id},{accessorKey:"path",header:()=>k("Path"),cell:g=>y.jsx(qq,{id:g.row.original.id,path:g.getValue()}),footer:g=>g.column.id}]}],[]),[s,u]=q.useState(()=>e),d=()=>u(g=>e);O.useEffect(()=>{d()},[e]);const m=Lq({data:s,columns:o,filterFns:{fuzzy:D2},initialState:{pagination:{pageSize:20}},state:{columnFilters:t,globalFilter:r},onColumnFiltersChange:n,onGlobalFilterChange:a,globalFilterFn:D2,getCoreRowModel:Iq(),getFilteredRowModel:xq(),getSortedRowModel:kq(),getPaginationRowModel:Oq(),getFacetedRowModel:Cq(),getFacetedUniqueValues:Mq(),getFacetedMinMaxValues:Nq(),debugTable:!1,debugHeaders:!1,debugColumns:!1});return q.useEffect(()=>{var g,w;((g=m.getState().columnFilters[0])==null?void 0:g.id)==="createdAt"&&((w=m.getState().sorting[0])==null?void 0:w.id)!=="createdAt"&&m.setSorting([{id:"createdAt",desc:!1}])},[(p=m.getState().columnFilters[0])==null?void 0:p.id]),y.jsxs("div",{className:"table-view",children:[y.jsx("div",{children:y.jsx(Xg,{value:r||"",onChange:g=>a(String(g)),className:"table-search-bar",placeholder:k("Search all columns...")})}),y.jsxs("table",{children:[y.jsx("thead",{children:m.getHeaderGroups().map(g=>y.jsx("tr",{children:g.headers.map(w=>y.jsx("th",{colSpan:w.colSpan,children:w.isPlaceholder?null:y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:mr(w.column.getCanSort()?"filter-header":"","table-header",w.column.id==="content"?"content-header":""),onClick:w.column.getToggleSortingHandler(),children:[v2(w.column.columnDef.header,w.getContext()),{asc:" 🔼",desc:" 🔽"}[w.column.getIsSorted()]??null]}),w.column.getCanFilter()?y.jsx(Xq,{column:w.column,table:m}):null]})},w.id))},g.id))}),y.jsx("tbody",{children:m.getRowModel().rows.map(g=>y.jsx("tr",{className:mr(g.getValue("pinned")?"pinned":""),children:g.getVisibleCells().map(w=>y.jsx("td",{children:v2(w.column.columnDef.cell,w.getContext())},w.id))},g.id))})]}),y.jsxs("div",{className:"table-nav-bar",children:[y.jsx("button",{className:"prev-start-btn",onClick:()=>m.setPageIndex(0),disabled:!m.getCanPreviousPage(),children:"<<"}),y.jsx("button",{className:"prev-btn",onClick:()=>m.previousPage(),disabled:!m.getCanPreviousPage(),children:"<"}),y.jsx("button",{className:"next-btn",onClick:()=>m.nextPage(),disabled:!m.getCanNextPage(),children:">"}),y.jsx("button",{className:"next-end-btn",onClick:()=>m.setPageIndex(m.getPageCount()-1),disabled:!m.getCanNextPage(),children:">>"}),y.jsxs("span",{className:"table-page-info",children:[y.jsx("div",{children:k("Page")}),y.jsxs("strong",{children:[m.getState().pagination.pageIndex+1," of ",m.getPageCount()]})]}),y.jsxs("span",{className:"table-page-jump",children:["| ",k("Go to page"),":",y.jsx("input",{type:"number",defaultValue:m.getState().pagination.pageIndex+1,onChange:g=>{const w=g.target.value?Number(g.target.value)-1:0;m.setPageIndex(w)},className:"jump-inputer"})]}),y.jsx("select",{value:m.getState().pagination.pageSize,onChange:g=>{m.setPageSize(Number(g.target.value))},children:[10,20,30,40,50].map(g=>y.jsxs("option",{value:g,children:[k("Show")," ",g," ",k("rows")]},g))})]})]})}const Qq=e=>e==="sourceType"?["ALL"]:["ALL","ALL-TASK"];function Xq({column:e,table:t}){var o,s,u,d,m,p,g,w,D;const n=(o=t.getPreFilteredRowModel().flatRows[0])==null?void 0:o.getValue(e.id),r=e.getFilterValue(),a=q.useMemo(()=>typeof n=="number"?[]:Array.from(e.getFacetedUniqueValues().keys()).sort(),[e.getFacetedUniqueValues()]);return typeof n=="number"?y.jsx("div",{children:y.jsxs("div",{className:"filter-input-group",children:[y.jsx(Xg,{type:"number",min:Number(((s=e.getFacetedMinMaxValues())==null?void 0:s[0])??""),max:Number(((u=e.getFacetedMinMaxValues())==null?void 0:u[1])??""),value:(r==null?void 0:r[0])??"",onChange:S=>e.setFilterValue(T=>[S,T==null?void 0:T[1]]),placeholder:`Min ${(d=e.getFacetedMinMaxValues())!=null&&d[0]?`(${(m=e.getFacetedMinMaxValues())==null?void 0:m[0]})`:""}`,className:"filter-input-short"}),y.jsx(Xg,{type:"number",min:Number(((p=e.getFacetedMinMaxValues())==null?void 0:p[0])??""),max:Number(((g=e.getFacetedMinMaxValues())==null?void 0:g[1])??""),value:(r==null?void 0:r[1])??"",onChange:S=>e.setFilterValue(T=>[T==null?void 0:T[0],S]),placeholder:`Max ${(w=e.getFacetedMinMaxValues())!=null&&w[1]?`(${(D=e.getFacetedMinMaxValues())==null?void 0:D[1]})`:""}`,className:"filter-input-short"})]})}):y.jsx(y.Fragment,{children:a.length>1?y.jsxs(y.Fragment,{children:[e.id!=="path"&&e.id!=="content"&&e.id!=="thinoType"&&e.id!=="sourceType"&&y.jsx("datalist",{id:e.id+"list",children:a.slice(0,5e3).map(S=>y.jsx("option",{value:S},S))}),e.id==="thinoType"||e.id==="sourceType"?y.jsx("select",{id:e.id,onChange:S=>e.setFilterValue(S.target.value==="ALL"?"":S.target.value==="ALL-TASK"?"TASK":S.target.value),children:[...Qq(e.id),...a].map(S=>y.jsx("option",{value:S,children:k(S)},S))}):"",e.id!=="thinoType"&&e.id!=="sourceType"?y.jsx(Xg,{type:"text",value:r??"",onChange:S=>e.setFilterValue(S),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,className:"filter-input-long",list:e.id+"list"}):""]}):""})}function Xg({value:e,onChange:t,debounce:n=500,...r}){const[a,o]=q.useState(e);return q.useEffect(()=>{o(e)},[e]),q.useEffect(()=>{const s=setTimeout(()=>{t(a)},n);return()=>clearTimeout(s)},[a]),y.jsx("input",{...r,value:a,onChange:s=>o(s.target.value)})}const eJ=e=>{const{locationState:{query:t},globalState:{memoListView:n,manifest:r},dailyNotesState:{app:a,settings:o}}=O.useContext(wt),{thinos:s}=e,[u,d]=q.useState(xv(s,"day")),m=q.useRef(null),p=O.useRef([]),g=O.useRef(0);O.useEffect(()=>{d(xv(s,"day"))},[s]),O.useEffect(()=>{var N,R;const S=s.filter(F=>F.pinned),T=s.filter(F=>!F.pinned),E=p.current.filter(F=>F.pinned)[0],A=p.current.filter(F=>!F.pinned)[0];if(E&&E.id!==((N=S[0])==null?void 0:N.id)||A&&A.id!==((R=T[0])==null?void 0:R.id)){const F=m.current.closest(".memolist-wrapper");F.scrollTop=F.scrollHeight}else{const F=m.current.closest(".memolist-wrapper");F.scrollTop=F.scrollHeight-g.current,p.current=s}},[s]),O.useEffect(()=>{if(!m.current)return;const S=m.current.closest(".memolist-wrapper");S.scrollTop=S.scrollHeight},[t]),O.useEffect(()=>{if(n==="chat"&&m.current){const S=m.current.closest(".memolist-wrapper");S.scrollTop=S.scrollHeight,g.current=S.scrollHeight-S.scrollTop,p.current=s,S.onscrollend=()=>{g.current=S.scrollHeight-S.scrollTop}}},[m.current]);const w=O.useCallback(()=>{a.setting.open(),a.setting.openTabById(r.id||"obsidian-memos")},[a]),D=O.useMemo(()=>y.jsx(y.Fragment,{children:Object.keys(u).map((S,T)=>y.jsx(y.Fragment,{children:y.jsx(tJ,{thinos:u[S],dayMark:S,handleOpenSettings:w},S+T)}))}),[u]);return y.jsx("div",{ref:m,className:mr("chat-view",`${o==null?void 0:o.chatViewStyle}-style`),children:D})},tJ=({thinos:e,dayMark:t,handleOpenSettings:n})=>{const{dailyNotesState:{settings:r}}=O.useContext(wt),[a,o]=q.useState(!0),s=q.useRef(null),u=p=>{if(x.Keymap.isModifier(p.nativeEvent,"Mod")){const g=x.moment(t,"YYYY-MM-DD");We.setFromAndToQuery(g.startOf("day").valueOf(),g.endOf("day").valueOf());return}o(!a),s.current.scrollIntoView(!0)},d=p=>{Gd(p)},m=O.useMemo(()=>e.map((p,g)=>y.jsxs("div",{className:"thino-bubble right",children:[y.jsx(nJ,{icon:r==null?void 0:r.MomentsIcon}),y.jsx("div",{className:"wrap",children:y.jsx(rJ,{thino:p,handleClickTimeStamp:d},`${p.id}-${x.moment(p.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${g}`)})]},p.id+g)),[e,r==null?void 0:r.MomentsIcon]);return y.jsxs(y.Fragment,{children:[a&&m,y.jsx("div",{className:`thino-chat-day-mark day-mark ${a?"":"folded"}`,onClick:u,children:y.jsx("div",{className:"day-mark-bubble",children:(t==="PINNED"?t+" 📌":t)+(a?"":"...")})})]})},nJ=({icon:e})=>{const t=O.useCallback(()=>{app.setting.open(),app.setting.openTabById(manifest.id||"obsidian-memos")},[]);return y.jsx("div",{ref:n=>{if(e){n==null||n.empty();return}e||n&&x.setIcon(n,"Memos")},className:"icon-img",style:{backgroundImage:`url(${e})`},onClick:t})},rJ=({thino:e,handleClickTimeStamp:t})=>{const n=O.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const o=await Ie.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");o&&Ie.editMemo(o)},[e]),r=O.useMemo(()=>y.jsxs("div",{className:"content",children:[y.jsx("div",{className:"time-stamp","data-date":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),"data-time":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss"),onClick:()=>{t(e)},children:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss")}),y.jsx(Ua,{memo:e})]}),[e.content]),a=O.useMemo(()=>y.jsxs("div",{className:"content task",children:[y.jsx("div",{className:"task-inputer",children:y.jsx("input",{className:mr("thino-type-status","task-list-item-checkbox"),type:"checkbox",checked:e.thinoType!=="TASK-TODO","data-task":e.thinoType==="TASK-TODO"?"":e.thinoType==="TASK-DONE"?"x":e.thinoType.slice(5),onClick:n})}),y.jsx("div",{className:"time-stamp","data-date":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),"data-time":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss"),onClick:()=>{t(e)},children:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss")}),y.jsx(Ua,{memo:e})]}),[e.content,e.thinoType]);return e.thinoType==="JOURNAL"?r:a};class aC extends x.Modal{constructor(n){super(n);he(this,"root")}onOpen(){const{contentEl:n,modalEl:r}=this;try{this.root=tK(n,this.close.bind(this)),r.toggleClass("thino-editor-modal",!0),setTimeout(()=>{var a;(a=n.querySelector("textarea"))==null||a.focus(),this.app.workspace.trigger("focus-on-textarea")},10)}catch(a){console.error(a)}}onClose(){this.root.unmount(),this.containerEl&&this.containerEl.empty()}}const aJ=({userIcon:e})=>y.jsx("div",{className:"moments-view-user-icon",ref:t=>{if(e){t==null||t.empty();return}e||t&&x.setIcon(t,"Memos")},style:{backgroundImage:`url(${e})`}}),I2="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuZGV2L3N2Z2pzIiB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDQwIDU2MCI+PGcgbWFzaz0idXJsKCZxdW90OyNTdmdqc01hc2sxMDgwJnF1b3Q7KSIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE0NDAiIGhlaWdodD0iNTYwIiB4PSIwIiB5PSIwIiBmaWxsPSIjMGUyYTQ3Ij48L3JlY3Q+PHVzZSB4bGluazpocmVmPSIjU3ZnanNTeW1ib2wxMDg3IiB4PSIwIiB5PSIwIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1N5bWJvbDEwODciIHg9IjcyMCIgeT0iMCI+PC91c2U+PC9nPjxkZWZzPjxtYXNrIGlkPSJTdmdqc01hc2sxMDgwIj48cmVjdCB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIGZpbGw9IiNmZmZmZmYiPjwvcmVjdD48L21hc2s+PHBhdGggZD0iTS0xIDAgYTEgMSAwIDEgMCAyIDAgYTEgMSAwIDEgMCAtMiAweiIgaWQ9IlN2Z2pzUGF0aDEwODIiPjwvcGF0aD48cGF0aCBkPSJNLTMgMCBhMyAzIDAgMSAwIDYgMCBhMyAzIDAgMSAwIC02IDB6IiBpZD0iU3ZnanNQYXRoMTA4NiI+PC9wYXRoPjxwYXRoIGQ9Ik0tNSAwIGE1IDUgMCAxIDAgMTAgMCBhNSA1IDAgMSAwIC0xMCAweiIgaWQ9IlN2Z2pzUGF0aDEwODMiPjwvcGF0aD48cGF0aCBkPSJNMiAtMiBMLTIgMnoiIGlkPSJTdmdqc1BhdGgxMDg0Ij48L3BhdGg+PHBhdGggZD0iTTYgLTYgTC02IDZ6IiBpZD0iU3ZnanNQYXRoMTA4MSI+PC9wYXRoPjxwYXRoIGQ9Ik0zMCAtMzAgTC0zMCAzMHoiIGlkPSJTdmdqc1BhdGgxMDg1Ij48L3BhdGg+PC9kZWZzPjxzeW1ib2wgaWQ9IlN2Z2pzU3ltYm9sMTA4NyI+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSI5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI5MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iOTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iOTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjkwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjE1MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMTUwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjIxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjIxMCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIyMTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjIxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIyMTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMjEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyMTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyMTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMjcwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMjcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMjcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjI3MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjMzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjMzMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMzMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjM5MCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzOTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzkwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjM5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzOTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjM5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIzOTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzOTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iNDUwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI0NTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjQ1MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iNDUwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjQ1MCIgeT0iNDUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI0NTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1MTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1MTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjUxMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjU3MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI1NzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNTcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjU3MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjU3MCIgeT0iNTEwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjYzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2MzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNjMwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjYzMCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNjMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iNTEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2MzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjY5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjY5MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI2OTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjY5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNjkwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjY5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNjkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2OTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjY5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48L3N5bWJvbD48L3N2Zz4=",ew="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuZGV2L3N2Z2pzIiB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDQwIDU2MCI+PGcgbWFzaz0idXJsKCZxdW90OyNTdmdqc01hc2sxMDgwJnF1b3Q7KSIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE0NDAiIGhlaWdodD0iNTYwIiB4PSIwIiB5PSIwIiBmaWxsPSJyZ2JhKDIzMSwgMjM4LCAyNDUsIDEpIj48L3JlY3Q+PHVzZSB4bGluazpocmVmPSIjU3ZnanNTeW1ib2wxMDg3IiB4PSIwIiB5PSIwIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1N5bWJvbDEwODciIHg9IjcyMCIgeT0iMCI+PC91c2U+PC9nPjxkZWZzPjxtYXNrIGlkPSJTdmdqc01hc2sxMDgwIj48cmVjdCB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIGZpbGw9IiNmZmZmZmYiPjwvcmVjdD48L21hc2s+PHBhdGggZD0iTS0xIDAgYTEgMSAwIDEgMCAyIDAgYTEgMSAwIDEgMCAtMiAweiIgaWQ9IlN2Z2pzUGF0aDEwODUiPjwvcGF0aD48cGF0aCBkPSJNLTMgMCBhMyAzIDAgMSAwIDYgMCBhMyAzIDAgMSAwIC02IDB6IiBpZD0iU3ZnanNQYXRoMTA4MyI+PC9wYXRoPjxwYXRoIGQ9Ik0tNSAwIGE1IDUgMCAxIDAgMTAgMCBhNSA1IDAgMSAwIC0xMCAweiIgaWQ9IlN2Z2pzUGF0aDEwODYiPjwvcGF0aD48cGF0aCBkPSJNMiAtMiBMLTIgMnoiIGlkPSJTdmdqc1BhdGgxMDg0Ij48L3BhdGg+PHBhdGggZD0iTTYgLTYgTC02IDZ6IiBpZD0iU3ZnanNQYXRoMTA4MSI+PC9wYXRoPjxwYXRoIGQ9Ik0zMCAtMzAgTC0zMCAzMHoiIGlkPSJTdmdqc1BhdGgxMDgyIj48L3BhdGg+PC9kZWZzPjxzeW1ib2wgaWQ9IlN2Z2pzU3ltYm9sMTA4NyI+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjMwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIzMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iOTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI5MCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjkwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iOTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iOTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMTUwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIxNTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIxNTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIxNTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIxNTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjE1MCIgeT0iNTEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMjEwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIyMTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjIxMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMjEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMjEwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyMTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyMTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIyMTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyNzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjI3MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMjcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyNzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjMzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzMwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMzMwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMzkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIzOTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjM5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjM5MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjM5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzkwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzkwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNDUwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSI0NTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNDUwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNDUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI1MTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjUxMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTEwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTEwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTEwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTEwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1NzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjU3MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTcwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTcwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI1NzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI1NzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjYzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjY5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2OTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2OTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2OTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2OTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48L3N5bWJvbD48L3N2Zz4=",oJ=e=>{const{globalState:{memoListView:t,markMemoId:n,manifest:r,editMemoId:a},dailyNotesState:{app:o,settings:s}}=O.useContext(wt),{thinos:u}=e,d=q.useRef(null),m=q.useRef(null),[p,g]=q.useState(!1);O.useEffect(()=>{d.current.closest(".workspace-window")&&g(!0)},[d.current]),O.useEffect(()=>{n&&g(!0)},[n]),O.useEffect(()=>{a?(g(!0),setTimeout(()=>{o.workspace.trigger("focus-on-textarea")},200)):g(!1)},[a]),O.useEffect(()=>{m.current&&(!p&&x.setIcon(m.current,"camera"),p&&x.setIcon(m.current,"camera-off"))},[m.current,p]);const w=O.useCallback(()=>{o.setting.open(),o.setting.openTabById(r.id||"obsidian-memos")},[o]);return O.useEffect(()=>{},[p]),y.jsxs("div",{ref:d,className:mr("moments-view",p?"show-editor":""),children:[y.jsxs("div",{className:"moments-view-background-wrapper",children:[y.jsx(iJ,{}),y.jsx("div",{ref:m,className:"moments-show-editor-btn",onClick:()=>{(p||a)&&g(!p),!p&&!a&&new aC(o).open()}}),y.jsxs("div",{className:"moments-view-background-overlay",children:[y.jsxs("div",{className:"moments-view-user-info",children:[y.jsx("div",{className:"moments-view-user-name",children:s==null?void 0:s.UserName}),y.jsx(aJ,{userIcon:s==null?void 0:s.MomentsIcon})]}),y.jsx("div",{className:"moments-view-user-idea",children:s.MomentsQuote||" "})]})]}),u.map((D,S)=>y.jsx(lJ,{thino:D,handleOpenSettings:w},D.createdAt+S))]})},iJ=()=>{const{dailyNotesState:{view:e,settings:t}}=O.useContext(wt),[n,r]=O.useState((t==null?void 0:t.MomentsBackgroundImage)||ew);return O.useEffect(()=>{if(!(t!=null&&t.MomentsBackgroundImage)){r(document.body.hasClass("theme-dark")?I2:ew);return}r(t==null?void 0:t.MomentsBackgroundImage)},[t==null?void 0:t.MomentsBackgroundImage]),O.useEffect(()=>{e&&e.registerEvent(e.app.workspace.on("css-change",()=>{r(document.body.hasClass("theme-dark")&&!(t!=null&&t.MomentsBackgroundImage)?I2:!document.body.hasClass("theme-dark")&&!(t!=null&&t.MomentsBackgroundImage)?ew:t==null?void 0:t.MomentsBackgroundImage)}))},[e]),y.jsx("div",{className:"moments-view-background",style:{backgroundImage:`url(${n})`}})},sJ=e=>{const{icon:t}=e,n=O.useCallback(()=>{app.setting.open(),app.setting.openTabById(manifest.id||"obsidian-memos")},[]);return y.jsx("div",{className:"thino-moment-icon",ref:r=>{if(t){r==null||r.empty();return}t||r&&x.setIcon(r,"Memos")},style:{backgroundImage:`url(${t})`},onClick:n})},lJ=e=>{const{dailyNotesState:{settings:t}}=O.useContext(wt),n=O.useRef(null),r=O.useRef(null),{thino:a}=e;return O.useEffect(()=>{n.current&&x.setIcon(n.current,"more-horizontal")},[n.current]),y.jsxs("div",{className:"thino-moment-wrapper",children:[y.jsx(sJ,{icon:t==null?void 0:t.MomentsIcon}),y.jsxs("div",{ref:r,className:"thino-moment-container",children:[y.jsx("div",{className:"thino-moment-user-name",children:t==null?void 0:t.UserName}),y.jsx("div",{className:"thino-moment-user-content",children:y.jsx(Ua,{memo:a})})]})]})};function cJ(e){const t=e.filter(r=>r.pinned),n=e.filter(r=>!r.pinned);return[...t,...n]}function xv(e,t){const n={},r={day:"YYYY-MM-DD",week:"YYYY-[W]WW",month:"YYYY-MM",quarter:"YYYY-[Q]1",year:"YYYY"};for(const a of e){const o=x.moment(a.createdAt,"YYYY/MM/DD HH:mm:ss").format(r[t]);if(a.pinned){n.PINNED||(n.PINNED=[]),n.PINNED.push(a);continue}n[o]||(n[o]=[]),n[o].push(a)}return n}function Lg(e){const{tag:t,duration:n,type:r,text:a,filter:o}=e,s=tn.getQueryById(o);return!(!!(t||n&&n.from<n.to||r||a||s)||s)}const uJ=({tempMemos:e,query:t,HideDoneTasks:n})=>{const r=e.filter(g=>g.rowStatus!=="ARCHIVED"&&!(g.deletedAt!==""&&g.deletedAt)),{tag:a,duration:o,type:s,text:u,filter:d}=t,m=tn.getQueryById(d);return!!(a||o&&o.from<o.to||s||u||m)||m||n?r.filter(g=>{let w=!0;if(g.thinoType!==void 0&&n&&g.thinoType==="TASK-DONE"&&(w=!1),g.content.contains("comment:")&&(w=!1),m){const D=JSON.parse(m.querystring);Array.isArray(D)&&(w=$d(g,D))}if(a){const D=new Set;for(const S of Array.from(g.content.match(An)||[])){const E=S.replace(An,"$1").trim().split("/");let A="";for(const N of E)A+=N,D.add(A),A+="/"}for(const S of Array.from(g.content.match($n)||[])){const E=S.replace($n,"$1").trim().split("/");let A="";for(const N of E)A+=N,D.add(A),A+="/"}for(const S of Array.from(g.content.match(hr)||[])){const E=S.replace(hr,"$2").trim().split("/");let A="";for(const N of E)A+=N,D.add(A),A+="/"}D.has(a)||(w=!1)}return o&&o.from<o.to&&(Re.getTimeStampByDate(g.createdAt)<o.from||Re.getTimeStampByDate(g.createdAt)>o.to)&&(w=!1),s&&(s==="NOT_TAGGED"&&(g.content.match(An)!==null||g.content.match(hr)!==null||g.content.match($n)!==null)||s==="LINKED"&&g.content.match(Rc)===null||s==="IMAGED"&&g.content.match(_c)===null||s==="CONNECTED"&&g.content.match(Il)===null)&&(w=!1),u&&!g.content.toLowerCase().includes(u.toLowerCase())&&(w=!1),w}):r.filter(g=>!g.content.contains("comment:"))},dJ=({updateThinos:e})=>{var $;const{locationState:{query:t},memoState:{memos:n},globalState:{memoListView:r},dailyNotesState:{app:a,settings:o,verifyState:s,plugin:u}}=O.useContext(wt),[d,m]=O.useState(!1),[p,g]=O.useState(!1),[w,D,S]=Br([]),[T,E]=O.useState([]),[A,N]=O.useState({}),[R,F]=O.useState(($=window.app||a)==null?void 0:$.loadLocalStorage("thinoListView")),[H,P]=O.useState((a==null?void 0:a.loadLocalStorage("showDayMark"))||!1),[L,z]=O.useState((a==null?void 0:a.loadLocalStorage("dayMarkRange"))||"day"),[U,W,K]=Br([]),ae=O.useRef(0),ce=O.useRef(!1),fe=O.useRef(null),ie=O.useRef(null),ge=O.useRef(null),Te=O.useRef(null),se=O.useRef(!1);O.useEffect(()=>{F(r),a&&a.saveLocalStorage("thinoListView",r),D(U.slice(0,w.length>20?Math.min(w.length,40):40))},[r]),O.useEffect(()=>()=>{ie.current&&(ie.current=null),ge.current&&(ge.current=null),Te.current&&(Te.current=null)},[]),O.useLayoutEffect(()=>{if((n.length!==0||!a)&&se.current===!0)return;const X=fJ(a);!X||X.length===0||(W(X),E(X),P((a==null?void 0:a.loadLocalStorage("showDayMark"))||!1),a!=null&&a.loadLocalStorage("showDayMark")&&N(xv(X,(a==null?void 0:a.loadLocalStorage("dayMarkRange"))||"day")))},[a]),O.useEffect(()=>{if(n.length===0&&!Ie.initialized)return;m(!1);const X=cJ(n),ve=uJ({tempMemos:X,query:t,HideDoneTasks:(o==null?void 0:o.HideDoneTasks)||!1});return se.current=!0,e&&e(ve),W(ve),()=>{se.current=!1}},[n,t,o==null?void 0:o.HideDoneTasks]),O.useEffect(()=>{D(U.slice(0,w.length>20?Math.min(w.length,40):40))},[U]),O.useEffect(()=>{var X;w.length<40&&((X=ge.current)==null||X.click())},[U]),O.useEffect(()=>{(Lg(t)&&w.length<U.length||w.length<U.length&&!Lg(t))&&g(!1),(Lg(t)&&w.length===n.length&&n.length>0||!Lg(t)&&w.length===U.length&&U.length>0)&&g(!0),hJ(w||[],a),E(w),a==null||a.saveLocalStorage("showDayMark",o==null?void 0:o.showDayMark),a==null||a.saveLocalStorage("dayMarkRange",o==null?void 0:o.dayMarkRange),P((o==null?void 0:o.showDayMark)||!1),z((o==null?void 0:o.dayMarkRange)||"day"),o!=null&&o.showDayMark&&N(xv(w,o==null?void 0:o.dayMarkRange))},[w,o==null?void 0:o.showDayMark,o==null?void 0:o.dayMarkRange]),O.useEffect(()=>{if(!ie.current)return;const X=async()=>{ce.current||(ae.current++,await we(),ae.current>=1&&(ce.current=!0,setTimeout(()=>{ae.current=0,ce.current=!1},3e3)))};w.length<40&&X();const ve=new IntersectionObserver(([De])=>{if(De.isIntersecting){if(p)return;X()}else ae.current=0,ce.current=!1});return ie!=null&&ie.current&&ve.observe(ie.current),()=>{ie!=null&&ie.current&&ve.unobserve(ie.current)}},[d,p,ie.current]),O.useEffect(()=>{var X;(X=Te.current)==null||X.scrollTo({top:0})},[t]);const we=async()=>{try{if(K.current.length>S.current.length){m(!0);const X=Math.min(S.current.length+40,K.current.length)-S.current.length,ve=K.current.slice(S.current.length,S.current.length+X);D(De=>[...De,...ve]),m(!1),g(ve.length<40)}}catch(X){console.error(X),new x.Notice(X.response.data.message)}},Z=O.useMemo(()=>y.jsx("div",{ref:ie,className:mr("status-text-container",R==="calendar"||R==="table"?"hidden":""),children:y.jsx("p",{className:"status-text",children:d?k("Fetching data..."):p?U.length===0?k("Noooop!"):k("All Data is Loaded 🎉"):y.jsx(y.Fragment,{children:y.jsx("span",{ref:ge,className:"cursor-pointer hover:text-green-600",onClick:we,children:k("fetch more")})})})}),[R,we,U,d,p,ie]);return y.jsxs("div",{className:`memolist-wrapper ${p?"completed":""}`,ref:Te,children:[R==="chat"&&Z,y.jsxs("div",{ref:fe,className:"memolist-container",children:[R==="chat"&&y.jsx(eJ,{thinos:T}),R==="calendar"&&y.jsx(UG,{thinos:U}),R==="table"&&y.jsx(Kq,{thinos:U}),R==="moments"&&y.jsx(oJ,{thinos:T}),R==="list"&&y.jsx(hv,{breakpointCols:1,className:`${R}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:H?y.jsx(y.Fragment,{children:Object.keys(A).map(X=>y.jsx(ZD,{type:"list",thinos:A[X],dayMark:X,dayMarkRange:L},X))}):T.map((X,ve)=>y.jsx(Ua,{memo:X},`${X.id}-${x.moment(X.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${ve}`))}),R==="waterfall"&&y.jsx(y.Fragment,{children:H&&Object.keys(A).length>0?Object.keys(A).map(X=>y.jsx(ZD,{type:"waterfall",thinos:A[X],dayMark:X,dayMarkRange:L},X)):y.jsx(hv,{breakpointCols:3,className:`${R}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:T.map((X,ve)=>y.jsx(Ua,{memo:X},`${X.id}-${x.moment(X.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${ve}`))})})]}),R!=="chat"&&Z]})};function oC(e){return`memosListCache:${e}`}function fJ(e){var t;try{const n=oC(e==null?void 0:e.appId),r=Kn.get([n])[n];return r?((t=JSON.parse(r))==null?void 0:t.memos)||[]:[]}catch(n){return console.error(n),[]}}function hJ(e,t){try{if(!e)return;const n=e==null?void 0:e.slice(0,100),r=oC(t==null?void 0:t.appId);Kn.set({[r]:JSON.stringify({memos:n})})}catch(n){console.error(n)}}const Tc=async e=>{const{app:t,settings:n}=rt.getState();if(!n.startSync||!(t!=null&&t.loadLocalStorage("tokenForSync")))return;const r=await _A(e);if(!r||r.length===0)return;r.sort((s,u)=>x.moment(s.createdAt,"YYYY/MM/DD HH:mm:ss").isAfter(x.moment(u.createdAt,"YYYY/MM/DD HH:mm:ss"))?1:-1);const a=r.filter(s=>!s.deleted),o=r.filter(s=>s.deleted);for(let s=0;s<a.length;s++){const u=a[s],d=await Ie.createOrPatchThinoFromWeb(u);d&&Ie.pushMemo(d)}for(let s=0;s<o.length;s++){const u=o[s],d=Ie.getMemoByWebId(u.id);d&&await Ie.deleteMemoById(d.id,"local")}Ie.updateTagsState(),gJ(t)};function mJ(){const{settings:e,app:t,view:n}=rt.getState(),{globalState:{loaded:r,memoListView:a}}=O.useContext(wt),o=x.Platform.isMobile&&e.DefaultEditorLocation==="Bottom",s=q.useRef(null),[u,d]=q.useState([]);O.useEffect(()=>{if(!t||!r||!n||!(t==null?void 0:t.loadLocalStorage("tokenForSync"))||!e.startSync)return;s.current=window.setInterval(async()=>{const w=Jw(t);await Tc(w)},3e4),n.registerInterval(s.current);const g=Jw(t);return Tc(g),()=>{s.current&&window.clearInterval(s.current)}},[n,t,r,e.startSync]);const m=[y.jsx(Om,{thinosCount:u.length,thinos:u},"filter"),y.jsx(dJ,{updateThinos:p=>{d(p)}},"list")];return y.jsx(y.Fragment,{children:a==="chat"?y.jsx(y.Fragment,{children:[y.jsx(ev,{syncThino:Tc},"header"),...m.reverse(),y.jsx(Cd,{className:"mod-editor-bottom",editorType:"inline"},"editor")]}):y.jsx(y.Fragment,{children:o?[y.jsx(ev,{syncThino:Tc},"header"),...m,y.jsx(Cd,{className:"mod-editor-bottom",editorType:"block"},"editor")]:[y.jsx(ev,{syncThino:Tc},"header"),y.jsx(Cd,{editorType:"block"},"editor"),...m]})})}function pJ(e){try{e!=null&&e.saveLocalStorage&&(e==null||e.saveLocalStorage("thinoLastUpdated",x.moment("2000-01-01 00:01:00","YYYY-MM-DD HH:mm:ss").format("x")))}catch(t){console.error(t)}}function Jw(e){try{const t=(e==null?void 0:e.loadLocalStorage)&&(e==null?void 0:e.loadLocalStorage("thinoLastUpdated"));return t||x.moment("2000-01-01 00:01:00","YYYY-MM-DD HH:mm:ss").format("x")}catch(t){return console.error(t),x.moment().format("x")}}function gJ(e){try{e!=null&&e.saveLocalStorage&&(e==null||e.saveLocalStorage("thinoLastUpdated",x.moment().format("x")))}catch(t){console.error(t)}}function Yc(e=!0){const[t,n]=O.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 vJ={text:k("SELECT"),value:""},yJ=e=>{const{className:t,dataSource:n,handleValueChanged:r,value:a}=e,[o,s]=_o(!1),u=O.useRef(null);let d=vJ;for(const g of n)if(g.value===a){d=g;break}O.useEffect(()=>{if(o){const g=w=>{var D;(D=u.current)!=null&&D.contains(w.target)||s(!1)};window.addEventListener("click",g,{capture:!0,once:!0})}},[o]);const m=g=>{r&&r(g.value),s(!1)},p=g=>{g.stopPropagation(),s()};return y.jsxs("div",{className:`selector-wrapper ${t||""}`,ref:u,children:[y.jsxs("div",{className:`current-value-container ${o?"active":""}`,onClick:p,children:[y.jsx("span",{className:"value-text",children:d.text}),y.jsx("span",{ref:g=>{g&&x.setIcon(g,"chevron-right")},className:"btn arrow-text"})]}),y.jsx("div",{className:`items-wrapper ${o?"":"hidden"}`,children:n.map(g=>y.jsx("div",{className:`item-container ${g.value===a?"selected":""}`,onClick:()=>{m(g)},children:g.text},g.value))})]})},bd=O.memo(yJ),cb=e=>{const{destroy:t,queryId:n,type:r="dialog"}=e,[a,o]=O.useState(""),[s,u]=O.useState(r!=="dialog"?[SD()]:[]),d=Yc(!1),[m,p]=O.useState(!1),[g,w]=_o(!1),D=Ie.getState().memos.filter(P=>!(P.deletedAt!==""&&P.deletedAt)).filter(P=>$d(P,s)).length;O.useEffect(()=>{S()},[n]);const S=()=>{const P=tn.getQueryById(n??"");if(P){o(P.title);const L=JSON.parse(P.querystring);return Array.isArray(L)&&u(L),P}},T=P=>{const L=P.target.value;o(L)},E=async()=>{if(!a)return new x.Notice(k("TITLE CANNOT BE NULL!")),null;if(s.length===0)return new x.Notice(k("FILTER CANNOT BE NULL!")),null;if(s.length===1&&s[s.length-1].value.value==="")return new x.Notice(k("Please finish the last filter setting first")),null;let P;try{n&&!n.startsWith("Filter [Temp] ")?(P=await tn.updateQuery(n,a,JSON.stringify(s)),tn.editQuery(P),await tn.getMyAllQueries()):(P=await tn.createQuery(a,JSON.stringify(s)),tn.pushQuery(P),await tn.getMyAllQueries())}catch(L){new x.Notice(L.message)}return P},A=async()=>{switch(r){case"modal":case"inline":if(s.length===0){new x.Notice(k("FILTER CANNOT BE NULL!"));return}if(s.length===1&&s[s.length-1].value.value===""){new x.Notice(k("Please finish the last filter setting first"));return}try{const P=tn.getQueryById(n??"");if(P&&JSON.stringify(s)===P.querystring){We.setMemoFilter(P.id),t();return}const L=tn.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(s));tn.pushQuery(L),We.setMemoFilter(L.id)}catch(P){new x.Notice(P.message)}t();break;case"dialog":try{if(!await E())return}catch(P){console.error(P),new x.Notice(P.message)}t();break}},N=()=>{if(s.length===0){new x.Notice(k("FILTER CANNOT BE NULL!"));return}if(m){We.setMemoFilter(""),p(!1);return}const P=tn.getQueryById(n??"");if(P&&JSON.stringify(s)===P.querystring){We.setMemoFilter(P.id);return}const L=tn.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(s));tn.pushQuery(L),We.setMemoFilter(L.id),e.setPreview&&e.setPreview(L.id),p(!0)},R=()=>{if(s.length>0&&s[s.length-1].value.value===""){new x.Notice(k("Please finish the last filter setting first"));return}u([...s,SD()])},F=O.useCallback((P,L)=>{u(z=>{const U=[...z];return U[P]=L,U})},[]),H=O.useCallback(P=>{u(L=>L.filter((U,W)=>W!==P))},[]);return y.jsxs(y.Fragment,{children:[r==="dialog"&&y.jsxs("div",{className:"dialog-header-container",children:[y.jsxs("span",{className:"title-text",children:[y.jsx("span",{className:"icon-text",children:"🔖"}),k(n?"EDIT QUERY":"CREATE QUERY")]}),y.jsx("button",{ref:P=>{P&&x.setIcon(P,"x")},className:"btn close-btn",onClick:t})]}),y.jsxs("div",{className:"dialog-content-container",children:[(r==="dialog"||g)&&y.jsxs("div",{className:"form-item-container input-form-container",children:[y.jsx("span",{className:"normal-text",children:k("TITLE")}),y.jsx("input",{className:"title-input",type:"text",value:a,onChange:T})]}),y.jsxs("div",{className:"form-item-container filter-form-container",children:[y.jsx("span",{className:"normal-text",children:k("FILTER")}),y.jsxs("div",{className:"filters-wrapper",children:[s.map((P,L)=>y.jsx(bJ,{index:L,filter:P,handleFilterChange:F,handleFilterRemove:H},L)),y.jsx("div",{className:"create-filter-btn",onClick:R,children:k("ADD FILTER TERMS")})]})]})]}),y.jsx("div",{className:"dialog-footer-container",children:y.jsxs("div",{className:"btns-container",children:[(r==="inline"||r==="modal")&&y.jsx("button",{className:`btn ${g?"mod-cta":"save-btn"}`,onClick:async()=>{if(!g)w();else{const P=await E();w(!1),t(),P&&We.setMemoFilter(P.id)}},children:k(g?"Set and save":"Save")}),y.jsxs("div",{className:"btns-group-container",children:[y.jsxs("span",{className:`tip-text ${s.length===0&&"hidden"}`,children:[k("MATCH")," Thino ",y.jsx("strong",{children:D})," ",k("TIMES")]}),y.jsx(y.Fragment,{children:r==="inline"&&y.jsx("button",{className:"btn mod-cta",onClick:N,children:k("Preview")})}),y.jsx("button",{className:`btn save-btn ${d.isLoading?"requesting":""}`,onClick:A,children:k(r==="inline"||r==="modal"?"Filter":n?"EDIT":"Save")})]})]})})]})},wJ=e=>{const{index:t,filter:n,handleFilterChange:r,handleFilterRemove:a}=e,{type:o}=n,s=O.useRef(null),u=O.useRef(null),d=O.useRef(n),m=O.useRef(o);O.useEffect(()=>{d.current=e.filter},[n]),O.useEffect(()=>{if(s.current)return o==="TAG"&&!u.current&&(m.current=o,u.current=new dE(s.current,D)),()=>{u.current&&(u.current.destroy(),u.current=null)}},[s,o]);const p=O.useCallback(E=>{["AND","OR"].includes(E)&&r(t,{...n,relation:E})},[n]),g=O.useCallback(async E=>{var A;if(n.type!==E){const{verifyState:N}=rt.getState(),R=!x.Platform.isDesktop&&await((A=window.Capacitor)==null?void 0:A.Plugins.Device.getId()),F=x.Platform.isDesktop?await zn():R.identifier||R.uuid,H=N&&(N==null?void 0:N.appId)===F;if(E==="SOURCE"&&!H){fn();return}const P=Object.values(hl[E].operators);r(t,{...n,type:E,value:{operator:P[0].value,value:""}})}},[n]),w=O.useCallback(E=>{r(t,{...n,value:{...n.value,operator:E}})},[n]),D=O.useCallback(E=>{r(t,{...d.current,value:{...d.current.value,value:E}})},[n]),S=()=>{a(t)},T={TYPE:y.jsx(bd,{className:"value-selector",dataSource:hl.TYPE.values,value:n.value.value,handleValueChanged:D}),LIST:y.jsx(bd,{className:"value-selector",dataSource:hl.LIST.values,value:n.value.value,handleValueChanged:D}),SOURCE:y.jsx(bd,{className:"value-selector",dataSource:hl.SOURCE.values,value:n.value.value,handleValueChanged:D}),TAG:y.jsx("input",{type:"text",id:Math.random().toString(36).substring(7),className:"value-inputer",ref:s,value:n.value.value,onChange:E=>{D(E.target.value)}}),TEXT:y.jsx("input",{type:"text",className:"value-inputer",value:n.value.value,onChange:E=>{D(E.target.value)}}),DATE:y.jsxs("div",{className:"date-inputer",children:[y.jsx(dv,{type:"icon",handleValueChange:D}),y.jsx("input",{type:"text",className:"value-inputer",value:n.value.value,onChange:E=>{D(E.target.value)}})]})};return y.jsxs("div",{className:"memo-filter-input-wrapper",children:[t>0&&y.jsx(bd,{className:"relation-selector",dataSource:t8,value:n.relation,handleValueChanged:p}),y.jsx(bd,{className:"type-selector",dataSource:Object.values(hl),value:n.type,handleValueChanged:g}),y.jsxs(y.Fragment,{children:[Object.keys(hl).includes(o)&&y.jsx(bd,{className:"operator-selector",dataSource:Object.values(hl[o].operators),value:n.value.operator,handleValueChanged:w}),T[o]]}),y.jsx("div",{ref:E=>{E&&x.setIcon(E,"x")},className:"btn remove-btn",onClick:S})]})},bJ=O.memo(wJ);function Kw(e){xm({className:"create-query-dialog"},cb,{queryId:e})}const iC=e=>{var D,S;const{dailyNotesState:{app:t,verifyState:n},locationState:{query:r}}=O.useContext(wt),a=q.useRef(null),[o,s]=q.useState(!1),u=q.useRef(null),[d,m]=q.useState(""),p=zv(a.current,u.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,10]}}]});O.useEffect(()=>{o&&p.update&&(p==null||p.update())},[o]),O.useEffect(()=>{a&&x.setIcon(a.current,"filter")},[a]);const g=async()=>{var A;const T=!x.Platform.isDesktop&&await((A=window.Capacitor)==null?void 0:A.Plugins.Device.getId()),E=x.Platform.isDesktop?await zn():T.identifier||T.uuid;return!n||(n==null?void 0:n.appId)!==E?(fn(),!1):!0};return Mm(u,()=>{s(!1),d&&We.getState().query.filter===d&&We.setMemoFilter("")}),y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"thino-inline-filter-wrapper pro",ref:a,onClick:async()=>{await g()&&(x.Platform.isDesktop?(s(!o),await(p==null?void 0:p.update())):new DJ(rt.getState().app,r.filter,E=>{m(E)}).open())}}),y.jsx("div",{ref:u,className:`thino-inline-filter-container ${o?"":"hidden"}`,style:p.styles.popper,children:o&&y.jsx(cb,{type:"inline",queryId:(D=r.filter)!=null&&D.startsWith("Filter [Temp] ")&&!((S=r.filter)!=null&&S.includes("Filter [Temp]"))?"":r.filter,destroy:()=>{s(!1)},setPreview:T=>{m(T)}})})]})};class DJ extends x.Modal{constructor(n,r,a){super(n);he(this,"root");he(this,"setPreview");this.filter=r,this.setPreview=a}onOpen(){var r,a;const{contentEl:n}=this;this.root=Lv(n),this.root.render(y.jsx(Sl,{store:Ee,context:wt,children:y.jsx("div",{className:"thino-inline-filter-container",children:y.jsx(cb,{type:"modal",queryId:(r=this.filter)!=null&&r.startsWith("Filter [Temp] ")&&!((a=this.filter)!=null&&a.includes("Filter [Temp]"))?"":this.filter,destroy:()=>{this.close()},setPreview:o=>{this.setPreview(o)}})})}))}onClose(){var n;(n=this.root)==null||n.unmount()}}const sC=()=>{const{dailyNotesState:{app:e},globalState:{isMobileView:t,showSiderbarInMobileView:n}}=O.useContext(wt),[r]=O.useState(q.createRef());O.useEffect(()=>{if(!r.current)return;const o=r.current;x.setIcon(o,"refresh-cw")},[r.current]);const a=O.useCallback(async()=>{if(!(t&&n)){if(Tc){const o=Jw(e);await Tc(o)}await Ie.fetchAllMemos()}},[]);return y.jsx("span",{className:"refresh-icon",ref:r,onClick:()=>{a(),r&&r.current.firstElementChild.toggleClass("rotate-hidden",!0),setTimeout(()=>{r&&r.current.firstElementChild.toggleClass("rotate-hidden",!1)},1e3)}})},ev=()=>{const{locationState:{query:{filter:e}},globalState:{isMobileView:t},queryState:{queries:n}}=O.useContext(wt),[r,a]=O.useState("THINO");O.useEffect(()=>{const s=tn.getQueryById(e);a(s?s.title:"THINO")},[e,n]);const o=O.useCallback(s=>{s.stopPropagation(),Qe.setShowSiderbarInMobileView(!0)},[]);return y.jsxs("div",{className:"section-header-container memos-header-container",children:[y.jsxs("div",{className:"title-text",children:[y.jsx(lo,{when:t,children:y.jsx("button",{ref:s=>{s&&x.setIcon(s,"menu")},className:"btn action-btn clickable-icon",onClick:o})}),y.jsx("span",{className:"normal-text",children:r}),y.jsx(sC,{})]}),y.jsxs("div",{className:"memos-header-search-section",children:[y.jsx(h8,{}),y.jsx(f8,{}),y.jsx(iC,{}),y.jsx(Rv,{})]})]})},SJ=()=>{const{dailyNotesState:{settings:e,app:t,verifyState:n},globalState:{manifest:r,showSiderbarInMobileView:a,isMobileView:o}}=O.useContext(wt),[s,u]=O.useState("Memos"),[d,m]=O.useState(!1);O.useEffect(()=>{e&&u(e.UserName)},[e]);const p=O.useCallback(()=>{We.pushHistory("/"),We.clearQuery()},[]),g=()=>{const w=document.querySelector(".memos-sidebar-wrapper"),D=document.querySelector(".menu-btns-popup");D.style.top=70-w.scrollTop+"px",m(!0)};return y.jsxs("div",{className:"user-banner-container",children:[y.jsxs("div",{className:"userinfo-header-container",children:[y.jsxs("span",{className:"username-container",children:[y.jsx("span",{className:"username-text",onClick:p,children:s==="MEMO 😉"?"THINO 😉":s||"THINO"}),y.jsx("span",{className:`user-pro-badge ${n?"activated":""}`,onClick:()=>{t.setting.open(),t.setting.openTabById(r.id||"obsidian-memos")},children:"PRO"})]}),y.jsxs("span",{className:"btn-group",children:[(e==null?void 0:e.DefaultThemeForThino)==="modern"&&!o&&y.jsx(sC,{}),y.jsx("span",{ref:w=>{w&&w.hasChildNodes()||w&&x.setIcon(w,"more-horizontal")},className:"btn action-btn menu-popup-btn",onClick:g}),a&&y.jsx("span",{ref:w=>{w&&w.hasChildNodes()||w&&x.setIcon(w,"x")},className:"btn action-btn",onClick:()=>{Qe.setShowSiderbarInMobileView(!1)}})]}),y.jsx(JA,{shownStatus:d,setShownStatus:m})]}),y.jsx(LT,{statusType:"banner"})]})},T2=()=>{const{queryState:{queries:e},dailyNotesState:{app:t},locationState:{query:{filter:n}}}=O.useContext(wt),r=Yc(),[a,o]=O.useState([]);return O.useEffect(()=>{const s=e.filter(u=>{var d,m;return!((d=u.id)!=null&&d.toString().startsWith("Filter [Temp]"))&&!((m=u.id)!=null&&m.toString().includes("Filter [Temp]"))}).sort((u,d)=>{if(d.pinnedAt&&!u.pinnedAt)return 1;if(u.pinnedAt&&!d.pinnedAt)return-1;const m=Re.getTimeStampByDate(u.pinnedAt||u.createdAt);return Re.getTimeStampByDate(d.pinnedAt||d.createdAt)-m});o(s)},[e]),O.useEffect(()=>{tn.getMyAllQueries().catch(()=>{}).finally(()=>{r.setFinish()})},[t]),y.jsxs("div",{className:"queries-wrapper",children:[y.jsxs("span",{className:"title-text",children:[y.jsx("span",{className:"normal-text",children:k("QUERY")}),y.jsx("span",{ref:s=>{s&&x.setIcon(s,"plus")},className:"btn create-query-btn",onClick:()=>Kw()})]}),y.jsx(lo,{when:r.isSucceed&&a.length===0,children:y.jsx("div",{className:"create-query-btn-container",children:y.jsx("span",{className:"btn",onClick:()=>Kw(),children:k("CREATE FILTER")})})}),y.jsx("div",{className:"queries-container",children:a.map(s=>y.jsx(IJ,{query:s,isActive:s.id===n},`${s.id}-${x.moment(s.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}`))})]})},IJ=e=>{const{query:t,isActive:n}=e,[r,a]=_o(!1),[o,s]=_o(!1),u=()=>{We.setMemoFilter(n?"":t.id)},d=T=>{T.stopPropagation(),a()},m=()=>{a(!1)},p=async T=>{if(T.stopPropagation(),o)try{await tn.deleteQuery(t.id)}catch(E){new x.Notice(E.message)}else s()},g=T=>{T.stopPropagation(),Kw(t.id)},w=async T=>{T.stopPropagation();try{t.pinnedAt?await tn.unpinQuery(t.id):await tn.pinQuery(t.id),tn.editQuery({...t,pinnedAt:t.pinnedAt?"":Re.getDateTimeString(Date.now())})}catch(E){console.error(E)}},D=()=>{s(!1)},S=O.useMemo(()=>y.jsxs("div",{className:"action-btns-container",children:[y.jsxs("span",{className:"btn",onClick:w,children:[y.jsx("span",{ref:T=>{T&&x.setIcon(T,t.pinnedAt?"pin-off":"pin")},className:"icon-text"}),y.jsx("span",{className:"normal-text",children:t.pinnedAt?k("UNPIN"):k("PIN")})]}),y.jsxs("span",{className:"btn",onClick:g,children:[y.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&x.setIcon(T,"edit")},className:"icon-text"}),y.jsx("span",{className:"normal-text",children:k("EDIT")})]}),y.jsxs("span",{className:`btn delete-btn ${o?"final-confirm":""}`,onClick:p,onMouseLeave:D,children:[y.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&x.setIcon(T,"trash-2")},className:"icon-text"}),y.jsx("span",{className:"normal-text",children:k(o?"CONFIRM":"DELETE")})]})]}),[t.pinnedAt,o]);return y.jsx(y.Fragment,{children:y.jsxs("div",{className:`query-item-container ${n?"active":""}`,onClick:u,children:[y.jsxs("div",{className:"query-text-container",children:[y.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&x.setIcon(T,"filter")},className:"icon-text"}),y.jsxs("span",{className:"query-text",children:[t.title,t.pinnedAt&&" 📌"]})]}),y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&x.setIcon(T,"more-horizontal")},className:"btn action-btn toggle-btn",onClick:d}),y.jsx("div",{className:`action-btns-wrapper ${r?"":"hidden"}`,onMouseLeave:m,children:S})]})]})})},E2=()=>{var p;const{locationState:{query:{tag:e}},dailyNotesState:{app:t},memoState:{tags:n,tagsNum:r,memos:a}}=O.useContext(wt),[o,s]=O.useState([]),[u,d]=O.useState(((p=t||app)==null?void 0:p.loadLocalStorage("thino-tag-sort-order"))||"alphabetical");O.useEffect(()=>{var w;const g=(w=t||app)==null?void 0:w.loadLocalStorage("thino-temp-tags");s(g||[])},[]),O.useEffect(()=>{Ie.updateTagsState()},[a]),O.useEffect(()=>{const g=Array.from(n).sort(),w={subTags:[]};for(const D of g){const S=D.split("/");let T=w,E="";for(let A=0;A<S.length;A++){const N=S[A];A===0?E+=N:E+="/"+N;let R=null;for(const F of T.subTags)if(F.text===E){R=F;break}R||(R={key:N,text:E,count:r[E],subTags:[]},T.subTags.push(R)),T=R}}s(w.subTags)},[n]),O.useEffect(()=>{var g;Ie.initialized&&((g=t||app)==null||g.saveLocalStorage("thino-temp-tags",o))},[o]);const m=g=>{g.stopPropagation();const w=new x.Menu;for(const D of["alphabetical","alphabeticalReverse","byCount","byCountReverse"])w.addItem(S=>{S.setTitle(k(D)).onClick(()=>{d(D),t==null||t.saveLocalStorage("thino-tag-sort-order",D)}).setChecked(u===D)}),D==="alphabeticalReverse"&&w.addSeparator();w.showAtMouseEvent(g.nativeEvent)};return y.jsxs("div",{className:"tags-wrapper",children:[y.jsxs("div",{className:"tags-header title-text",children:[y.jsx("span",{className:"normal-text",children:k("Frequently Used Tags")}),y.jsx("span",{ref:g=>{g&&x.setIcon(g,"arrow-down-narrow-wide")},className:"tags-sort-btn",onClick:m})]}),y.jsxs("div",{className:"tags-container",children:[o.sort(TJ(u)).map((g,w)=>y.jsx(lC,{tag:g,tagQuery:e},g.text+"-"+w)),y.jsx(lo,{when:o.length<5&&Ie.initialized,children:y.jsxs("span",{className:"tag-tip-container",children:[k("Input")," ",y.jsxs("span",{className:"code-text",children:[k("#Tag")," "]}),k("to create tag"),"..."]})})]})]})},lC=e=>{const{tag:t,tagQuery:n}=e,r=n===t.text,a=t.subTags.length>0,[o,s]=_o(!1),u=()=>{r?We.setTagQuery(""):(Re.copyTextToClipboard(`#${t.text} `),["/","/recycle","/archive","/daily"].includes(We.getState().pathname)||We.setPathname("/"),We.setTagQuery(t.text))},d=m=>{m.stopPropagation(),s()};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:`tag-item-container ${r?"active":""}`,onClick:u,children:[y.jsxs("div",{className:"tag-text-container",children:[y.jsx("span",{ref:m=>{m&&x.setIcon(m,"hash")},className:"btn tag-btn"}),y.jsx("span",{className:"tag-text",children:t.key})]}),y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{className:"tag-count",children:t.count}),a?y.jsx("span",{ref:m=>{m&&x.setIcon(m,"chevron-right")},className:`btn action-btn toggle-btn ${o?"shown":""}`,onClick:d}):null]})]}),a?y.jsx("div",{className:`subtags-container ${o?"":"hidden"}`,children:t.subTags.map((m,p)=>y.jsx(lC,{tag:m,tagQuery:n},m.text+"-"+p))}):null]})},x2=new Intl.Collator(void 0,{usage:"sort",sensitivity:"base",numeric:!0}).compare,tw={alphabetical:(e,t)=>x2(e.text,t.text),alphabeticalReverse:(e,t)=>-x2(e.text,t.text),byCount:(e,t)=>t.count-e.count,byCountReverse:(e,t)=>e.count-t.count},TJ=(e="byCount")=>tw.hasOwnProperty(e)?tw[e]:tw.alphabetical;class Ke extends x.Setting{constructor(n,r){super(n);he(this,"settingTab");he(this,"name","");he(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||"",a=typeof this.desc=="string"?this.desc:this.desc.textContent||"";return this.settingTab.addSettingToMasterSettingsList(n,this.settingEl,r,a),this}}class EJ extends x.Modal{constructor(n,r,a,o,s){super(n);he(this,"plugin");he(this,"settingTab");he(this,"target",5);he(this,"cb");this.app=n,this.settingTab=r,this.plugin=a,this.target=o,this.cb=s}onOpen(){var u;const{contentEl:n}=this;(u=n.parentElement)==null||u.classList.add("memo-save-location-modal"),n.createEl("h3",{text:k("Thino Daily Target")});const r=n.createDiv("modal-setting");new Ke(r,this.settingTab).setName(k("Target Thino Count")).addSlider(d=>{d.setDynamicTooltip().setValue(this.target).setLimits(1,30,1).onChange(async m=>{this.target=m})});const a=n.createDiv("button-group"),o=a.createEl("button",{text:k("Cancel")}),s=a.createEl("button",{text:k("Save")});s.onclick=async()=>{this.plugin.settings.MemoDailyTarget=this.target,this.settingTab.applySettingsUpdate(),this.cb(this.target),this.close()},o.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}const xJ=({allStat:e,todayTimeStamp:t,calendarType:n,handleCalendarTypeChange:r})=>{const{dailyNotesState:{app:a,settings:o},globalState:{manifest:s}}=O.useContext(wt),[u,d]=O.useState(),[m,p]=O.useState(5),[g,w]=O.useState(0),[D,S]=O.useState(0),[T,E]=O.useState(o.HeatmapColorScheme||"default"),A=O.useRef(null),N=O.useRef(null);O.useEffect(()=>{o.HeatmapColorScheme&&E(o.HeatmapColorScheme)},[o.HeatmapColorScheme]),O.useEffect(()=>{let F,H=5;s&&a&&(F=a==null?void 0:a.plugins.getPlugin(s.id),H=F==null?void 0:F.settings.MemoDailyTarget,d(F)),p(H)},[s,a]),O.useEffect(()=>{const F=e.find(L=>L.timestamp===t),H=F?F.count:0;S(H);const P=Math.min(100,H/m*100);w(P)},[e,m]),O.useEffect(()=>{x.requireApiVersion("1.4.4")&&(x.setTooltip(N.current,g.toFixed(2)+"%"),x.setTooltip(A.current,k("Set daily target")+` (${D}/${m})`))},[g,D]),O.useEffect(()=>{A.current&&(A.current.hasChildNodes()||x.setIcon(A.current,"crosshair"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.current,g+"%"))},[A,m]);const R=O.useCallback(()=>{if(!u)return;new EJ(a,u==null?void 0:u.settingTab,u,m,H=>{p(H)}).open()},[u,m]);return y.jsx(y.Fragment,{children:y.jsxs("div",{className:`usage-daily-progress-wrapper heatmap-${T}`,children:[y.jsx("div",{ref:N,className:"daily-progress-bar",children:y.jsx("div",{className:"daily-progress-bar-inner",style:{width:`${g}%`}})}),y.jsx("div",{ref:A,className:"daily-progress-target",onClick:R}),y.jsx("div",{ref:F=>{F&&x.setIcon(F,n==="basic"?"layout-grid":"calendar"),F&&x.setTooltip&&x.setTooltip(F,k("Switch calendar type"))},className:"switch-calendar-type-btn",onClick:()=>r&&r(n==="basic"?"heatmap":"basic")})]})})},CJ=e=>{const{className:t,view:n,datestamp:r,handleDateStampChange:a,handleDateItemClick:o,handleMonthChange:s,dailyStat:u}=e,d=x.moment().startOf("day").valueOf(),[m,p]=O.useState(_h(r)),[g,w]=O.useState(null);O.useEffect(()=>{p(_h(r))},[r]);const D=new Date(m),S=D.getDay(),T=[];for(let N=0;N<S;N++)T.push({date:0,datestamp:D.getTime()-Ba*(7-N)});const E=NJ(m);for(let N=1;N<=E;N++)T.push({date:N,datestamp:D.getTime()+Ba*(N-1)});const A=N=>{const R=D.getFullYear(),F=D.getMonth()+1;let H=0;F===1&&N===-1?H=new Date(`${R-1}/12/1`).getTime():F===12&&N===1?H=new Date(`${R+1}/1/1`).getTime():H=new Date(`${R}/${F+N}/1`).getTime(),p(_h(H)),s&&s(H)};return y.jsxs("div",{className:`heatmap-date-picker-wrapper ${t}`,children:[y.jsxs("div",{className:"date-picker-header",children:[y.jsx("span",{ref:N=>{N&&x.setIcon(N,"chevron-left")},className:"btn btn-text",onClick:()=>A(-1)}),y.jsxs("span",{className:"normal-text",children:[y.jsx(zT,{year:D.getFullYear().toString(),handleYearChange:N=>{p(_h(new Date(`${N}/${D.getMonth()+1}/1`).getTime()))}}),y.jsx(UT,{month:D.getMonth().toString(),handleMonthChange:N=>{p(_h(new Date(`${D.getFullYear()}/${parseInt(N)}/1`).getTime()))}})]}),y.jsx("span",{ref:N=>{N&&x.setIcon(N,"chevron-right")},className:"btn btn-text",onClick:()=>A(1)})]}),y.jsxs("div",{className:"date-picker-day-container",children:[y.jsx("div",{className:"date-picker-day-header",children:k("weekDaysShort").map(N=>y.jsx("span",{className:"day-item",children:N},N))}),y.jsx("div",{className:"date-picker-day-content",children:T.map(N=>{if(N.date===0)return y.jsx("span",{className:"day-item null",children:""},N.datestamp);const R=u.find(P=>P.timestamp===N.datestamp)||{count:0,timestamp:N.datestamp,list:0},F=R.count-R.list,H=R.list;return y.jsxs("span",{className:`day-item ${N.datestamp===d?"current":""} ${N.datestamp===g?"selected":""} ${nw(R.count)}`,onClick:P=>{a(r,P.nativeEvent),w(N.datestamp===g?null:N.datestamp),o&&o(P,R)},onMouseOver:P=>{if(!R||!R.count)return;const L=new x.HoverPopover(n,P.currentTarget,100);MJ(L,{d:N,list:H,task:F})},children:[y.jsx("span",{className:"day-item-text",children:N.date}),y.jsx(y.Fragment,{children:R&&R.count!==0&&y.jsxs("span",{className:"day-item-dots",children:[F>0&&y.jsx("div",{className:`day-item-dot thino-task-dot ${nw(F)}`}),H>0&&y.jsx("div",{className:`day-item-dot thino-list-dot ${nw(H)}`})]})})]},N.datestamp)})})]})]})};function MJ(e,{d:t,list:n,task:r}){e.hoverEl.toggleClass("thino-hover-popover",!0);const a=e.hoverEl.createDiv({cls:"thino-hover-popover-content"});a.createDiv({cls:"thino-date-item",text:`${x.moment(t.datestamp).format("YYYY-MM-DD")}`});const o=a.createDiv({cls:"thino-task-item"});o.createSpan({cls:"thino-task-item-title-text",text:`${k("Task")}: `}),o.createSpan({cls:"thino-task-item-title-count",text:`${r}`});const s=a.createDiv({cls:"thino-list-item"});s.createSpan({cls:"thino-list-item-title-text",text:`${k("List")}: `}),s.createSpan({cls:"thino-list-item-title-count",text:`${n}`})}function NJ(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())/Ba}function _h(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}function nw(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 C2={width:12,height:7},M2=(e,t)=>{const n=[];for(let r=0;r<=e;r++)n.push({timestamp:parseInt(x.moment(t).add(r,"days").format("x")),count:0,list:0});return n},N2=()=>{const e=parseInt(x.moment().endOf("day").format("x")),t=new Date(e).getDay()||7,n=parseInt(x.moment().startOf("day").format("x")),r=new Array(7-(t===7?1:t)).fill(0),a=(C2.width-1)*C2.height+t,o=parseInt(x.moment().startOf("day").subtract(a,"days").format("x")),s=x.moment().startOf("day").subtract(a,"days"),{memoState:{memos:u},dailyNotesState:{view:d,app:m,settings:p,verifyState:g}}=O.useContext(wt),[w,D]=Br(AJ(m||window.app)||"heatmap"),[S,T]=Br(x.moment().startOf("day").valueOf()),[E,A]=Br(p.HeatmapColorScheme||"default"),[N,R]=Br(M2(a,o)),[F,H]=Br(null),[P,L]=Br(null),[z,U,W]=Br(""),K=O.useRef(null),ae=O.useRef(null);O.useEffect(()=>{const se=M2(a,o),we=u.filter(Z=>!Z.deletedAt&&Z.rowStatus!=="ARCHIVED");for(const Z of we){const X=x.moment(Z.createdAt.replaceAll("/","-"),"YYYY-MM-DD HH:mm:ss").startOf("day").diff(s,"days");X>=0&&X<se.length&&(se[X].count+=1,Z.thinoType==="JOURNAL"&&(se[X].list+=1))}R([...se])},[u]),O.useEffect(()=>{p.HeatmapColorScheme&&A(p.HeatmapColorScheme)},[p.HeatmapColorScheme]);const ce=O.useCallback((se,we)=>{var De;if(H(we),!ae.current)return;const{isMobileView:Z}=Qe.getState(),$=se.target,X=document.querySelector(".memos-sidebar-wrapper");ae.current.style.left=$.offsetLeft-(((De=K.current)==null?void 0:De.offsetLeft)??0)+"px";let ve=$.offsetTop;Z||(ve-=X==null?void 0:X.scrollTop),ae.current.style.top=ve+"px"},[]),fe=O.useCallback(()=>{H(null)},[]),ie=()=>{D(w==="heatmap"?"basic":"heatmap"),kJ(m,w==="heatmap"?"basic":"heatmap"),T(x.moment().startOf("day").valueOf())},ge=O.useCallback(async(se,we)=>{if(we.count===0)return;const Z=We.getState().query.duration,$=Z==null?void 0:Z.from,X=Z==null?void 0:Z.to,ve=x.moment($).diff(X,"day")==0;if($===we.timestamp&&ve)We.setFromAndToQuery(0,0),L(null),U(null);else if($!==we.timestamp&&$>0&&se.shiftKey){const De=x.moment(we.timestamp).endOf("day").diff(X,"day");$===0&&se.shiftKey?U("from"):De<0&&ve&&U("to"),x.moment($).isBefore(we.timestamp)?W.current==="to"?De<0?We.setFromAndToQuery(we.timestamp,X):(We.setFromAndToQuery(parseInt(x.moment(X).startOf("day").format("x")),parseInt(x.moment(we.timestamp).endOf("day").format("x"))),U("from")):W.current==="from"&&(De<0,We.setFromAndToQuery($,parseInt(x.moment(we.timestamp).endOf("day").format("x")))):W.current==="to"?We.setFromAndToQuery(we.timestamp,X):W.current==="from"&&(We.setFromAndToQuery(we.timestamp,parseInt(x.moment($).endOf("day").format("x"))),U("to"))}else if($===0&&se.shiftKey)We.setFromAndToQuery(we.timestamp,parseInt(x.moment().endOf("day").format("x")));else if(we.count>0&&(se.ctrlKey||se.metaKey)){const{app:De,dailyNotes:be}=rt.getState(),ke=kv(x.moment(we.timestamp),be);if(!x.Platform.isMobile)await De.workspace.getLeaf("split").openFile(ke);else{let Be=De.workspace.activeLeaf;Be===null&&(Be=De.workspace.getLeaf(!0)),Be.openFile(ke)}}else we.count>0&&!se.shiftKey&&!se.ctrlKey&&!se.metaKey&&(["/","/recycle"].includes(We.getState().pathname)||We.setPathname("/"),We.setFromAndToQuery(we.timestamp,Re.getTimeStampByDate(x.moment(we.timestamp+Ba).subtract(1,"days").endOf("day").format("YYYY-MM-DD HH:mm:ss"))),L(we))},[]),Te=O.useMemo(()=>y.jsx(CJ,{className:`heatmap-${E}`,view:d,datestamp:S,dailyStat:N,handleMonthChange:se=>{T(se)},handleDateStampChange:se=>{},handleDateItemClick:(se,we)=>ge(se,we)}),[JSON.stringify(N),d,S,E]);return y.jsxs(y.Fragment,{children:[w==="basic"&&Te,w==="heatmap"&&y.jsxs("div",{className:`usage-heat-map-wrapper heatmap-${E}`,ref:K,children:[y.jsxs("div",{className:"day-tip-text-container",children:[y.jsx("span",{className:"tip-text",children:k("weekDaysShort")[0]}),y.jsx("span",{className:"tip-text"}),y.jsx("span",{className:"tip-text",children:k("weekDaysShort")[2]}),y.jsx("span",{className:"tip-text"}),y.jsx("span",{className:"tip-text",children:k("weekDaysShort")[4]}),y.jsx("span",{className:"tip-text"}),y.jsx("span",{className:"tip-text",children:k("weekDaysShort")[6]})]}),y.jsxs("div",{ref:ae,className:"usage-detail-container pop-up "+(F?"":"hidden"),children:[F==null?void 0:F.count," thino ",k("on")," ",y.jsx("span",{className:"date-text",children:x.moment(F==null?void 0:F.timestamp,"x").format("YYYY/MM/DD ddd")})]}),y.jsxs("div",{className:"usage-heat-map",children:[N.map((se,we)=>{const Z=se.count,$=Z<=0?"":Z<=1?"stat-day-L1-bg":Z<=2?"stat-day-L2-bg":Z<=4?"stat-day-L3-bg":"stat-day-L4-bg";return y.jsx("span",{className:`stat-container ${$} ${P===se?"current":""} ${n===se.timestamp?"today":""}`,onMouseEnter:X=>ce(X,se),onMouseLeave:fe,onClick:X=>ge(X,se)},we)}),r.map((se,we)=>y.jsx("span",{className:"stat-container null"},we))]})]}),g&&y.jsx(xJ,{allStat:N,todayTimeStamp:n,calendarType:w,handleCalendarTypeChange:ie})]})};function kJ(e,t){try{e==null||e.saveLocalStorage("calendarType",t)}catch(n){console.error(n)}}function AJ(e){try{return(e==null?void 0:e.loadLocalStorage("calendarType"))||"heatmap"}catch(t){return console.error(t),"heatmap"}}const k2=()=>{const{dailyNotesState:{app:e,settings:t,verifyState:n}}=O.useContext(wt),r=[{name:k("Random Review"),path:"/review",iconID:"star"},{name:k("ARCHIVE"),path:"/archive",iconID:"archive"},{name:k("Recycle bin"),path:"/recycle",iconID:"recycle"}],a=O.useRef([]);return O.useEffect(()=>{a.current.forEach((o,s)=>{o&&x.setIcon(o,r[s].iconID)})},[t,a]),y.jsx(y.Fragment,{children:y.jsx("div",{className:"path-entry-wrapper",children:r.map((o,s)=>y.jsx(y.Fragment,{children:y.jsxs("div",{className:`path-entry-container ${We.getState().pathname===o.path?"active":""} ${t.DeleteThinoDirectly&&o.path==="/recycle"?"hidden":""} ${o.path==="/review"&&"pro"}`,onClick:async()=>{var m;const u=!x.Platform.isDesktop&&await((m=window.Capacitor)==null?void 0:m.Plugins.Device.getId()),d=x.Platform.isDesktop?await zn():u.identifier||u.uuid;if(!n&&(n==null?void 0:n.appId)!==d&&o.path==="/review"){fn();return}We.setPathname(o.path),We.clearQuery(),o.path==="/review"&&We.getState().pathname==="/review"&&e.workspace.trigger("refresh-review-memos")},children:[y.jsx("span",{ref:u=>a.current[s]=u,className:"path-entry-icon"}),y.jsx("span",{className:"path-entry-text",children:o.name})]},s)}))})})},A2=e=>{const{dailyNotesState:{settings:t},locationState:n,globalState:{isMobileView:r,showSiderbarInMobileView:a}}=O.useContext(wt),o=O.useRef(null),s=O.useMemo(()=>u=>{var m,p,g;const d=Qe.getState().showSiderbarInMobileView;if(!d){window.removeEventListener("click",s,{capture:!0});return}(m=o.current)!=null&&m.contains(u.target)||(g=(p=o.current)==null?void 0:p.parentNode)!=null&&g.contains(u.target)&&(d&&u.stopPropagation(),Qe.setShowSiderbarInMobileView(!1),window.removeEventListener("click",s,{capture:!0}))},[]);return O.useEffect(()=>{Qe.setShowSiderbarInMobileView(!1)},[n]),O.useEffect(()=>{a?document.body.classList.add(Hb):document.body.classList.remove(Hb)},[a]),O.useEffect(()=>{r&&a&&window.addEventListener("click",s,{capture:!0})},[r,a]),y.jsxs("aside",{className:mr("memos-sidebar-wrapper",e.className),ref:o,children:[e.children,y.jsx(SJ,{}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="right"?y.jsx(N2,{}):null:y.jsx(N2,{}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="left"?y.jsxs(y.Fragment,{children:[y.jsx(k2,{}),y.jsx(T2,{}),y.jsx(LT,{statusType:"sidebar"})]}):null:y.jsxs(y.Fragment,{children:[y.jsx(k2,{}),y.jsx(T2,{})]}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="right"?y.jsx(y.Fragment,{children:y.jsx(E2,{})}):null:y.jsx(y.Fragment,{children:y.jsx(E2,{})})]})},OJ=()=>{const{dailyNotesState:{settings:e}}=O.useContext(wt),[t,n]=q.useState(""),r=a=>{n(a.target.value)};return y.jsx("div",{className:"locked-screen-wrapper",children:y.jsxs("div",{className:"locked-screen-content",children:[y.jsx("div",{className:"locked-screen-header",children:y.jsx("div",{className:"locked-screen-header-title",children:k("Locked")})}),y.jsx("div",{className:"locked-screen-body",children:y.jsxs("div",{className:"locked-screen-body-content",children:[y.jsxs("div",{className:"locked-screen-body-content-text",children:[y.jsx("div",{className:"locked-screen-body-content-text-title",children:k("Thino is locked")}),y.jsx("div",{className:"locked-screen-body-content-text-desc",children:k("Please unlock Thino by input password")})]}),y.jsxs("div",{className:"locked-screen-body-content-inputer",children:[y.jsx("input",{onChange:r,value:t,type:"password",className:"locked-screen-body-content-input"}),y.jsx("button",{className:"locked-screen-body-content-btn",onClick:()=>{(e==null?void 0:e.password)===t?Qe.setLocked(!1):new x.Notice(k("Password is incorrect"))},children:k("Unlock")})]})]})})]})})};function FJ(){const{dailyNotesState:{settings:e,verifyState:t},locationState:{pathname:n},globalState:{isMobileView:r,memoListView:a,globalEditorShown:o,locked:s}}=O.useContext(wt),u=O.useRef(null);return O.useEffect(()=>{if(!e.needVerify){Qe.setLocked(!1);return}Qe.setLocked(!0)},[e==null?void 0:e.needVerify]),O.useEffect(()=>{if(!u.current)return;(async()=>{var g;const m=!x.Platform.isDesktop&&await((g=window.Capacitor)==null?void 0:g.Plugins.Device.getId()),p=x.Platform.isDesktop?await zn():m.identifier||m.uuid;!t||(t==null?void 0:t.appId)!==p?u.current.toggleClass("hide-pro",!0):u.current.toggleClass("hide-pro",!1)})()},[t,u.current]),y.jsxs(y.Fragment,{children:[s&&y.jsx(OJ,{}),!s&&o&&y.jsx(Cd,{editorType:"block"}),!s&&!o&&y.jsx("section",{ref:u,id:"page-wrapper","data-path":n,className:mr(`memos-${n==="/"?a:"list"}-view`,(e==null?void 0:e.DefaultThemeForThino)==="modern"?"modern":"classic"),children:y.jsxs(y.Fragment,{children:[y.jsx(A2,{sidebarPosition:"left",className:"left-sidebar"}),y.jsx("main",{className:"content-wrapper",children:JJ(n)}),(e==null?void 0:e.DefaultThemeForThino)==="modern"&&!r?y.jsx(A2,{sidebarPosition:"right",className:"right-sidebar"}):null]})})]})}const PJ={"*":y.jsx(FJ,{})},jJ=e=>{const{memo:t,handleDeletedMemoAction:n}=e,{dailyNotesState:r}=O.useContext(wt),a={...t,createdAtStr:Re.getDateTimeString(t.createdAt),deletedAtStr:Re.getDateTimeString(t.deletedAt||t.createdAt)},o=q.useRef(null),s=q.useRef(null),[u,d]=q.useState(""),[m,p]=_o(!1),g={restore:O.useRef(null),delete:O.useRef(null),source:O.useRef(null)};O.useEffect(()=>{s&&(x.setIcon(g.restore.current,"archive-restore"),x.setIcon(g.delete.current,"trash"),x.setIcon(g.source.current,"home"))},[s]),O.useEffect(()=>{if(!o.current||!s.current||o.current.hasChildNodes()&&t.content===u||!r.view)return;const E=r.view;d(t.content),o.current.hasChildNodes()&&o.current.empty();async function A(){var R;await x.MarkdownRenderer.render(r.app,t.content+`
`,o.current,t.path,E);const N=(R=o.current)==null?void 0:R.querySelectorAll(".internal-link");N==null||N.forEach(F=>{const H=F,P=H.getAttribute("data-href");if(!P)return;r.app.metadataCache.getFirstLinkpathDest(P,t.path)||F.classList.add("is-unresolved"),H.addEventListener("mouseover",z=>{z.stopPropagation(),r.app.workspace.trigger("hover-link",{event:z,source:"thino",hoverParent:E.containerEl,targetEl:H,linktext:P,sourcePath:H.href})})})}A()},[t.content,s]);const w=async()=>{if(m)try{await Ie.deleteMemoById(a.id),n(a.id)}catch(E){new x.Notice(E.message)}else p()},D=async()=>{switch(a.sourceType){case"DAILY":await p1(a.id,a.path);break;case"CANVAS":await v1(a.id,a.path);break;case"MULTI":await m1(a.path);break;case"FILE":await g1(a.id,a.path);break}},S=async()=>{try{const E=await Ie.restoreMemoById(a.id),A=r.app,N=A==null?void 0:A.loadLocalStorage("tokenForSync");E&&E.webId&&N&&r.settings.startSync&&await AT(E.webId),E&&Ie.editMemo(E),n(a.id),new x.Notice(k("RESTORE SUCCEED"))}catch(E){new x.Notice(E.message)}},T=()=>{m&&p(!1)};return y.jsxs("div",{ref:s,className:`memo-wrapper ${"memos-"+a.id}`,onMouseLeave:T,children:[y.jsxs("div",{className:"memo-top-wrapper",children:[y.jsxs("span",{className:"time-text",children:[k("DELETE AT")," ",a.deletedAtStr]}),y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:E=>{E&&x.setIcon(E,"more-horizontal")},className:"btn more-action-btn"}),y.jsx("div",{className:"more-action-btns-wrapper",children:y.jsxs("div",{className:"more-action-btns-container",children:[y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:g.restore,className:"more-action-item-icon"}),y.jsx("span",{className:"btn restore-btn",onClick:S,children:k("RESTORE")})]}),y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:g.source,className:"more-action-item-icon"}),y.jsx("span",{className:"btn",onClick:D,children:k("SOURCE")})]}),y.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[y.jsx("span",{ref:g.delete,className:"more-action-item-icon"}),y.jsx("span",{className:`btn delete-btn ${m?"final-confirm":""}`,onClick:w,children:k(m?"CONFIRM":"DELETE")})]})]})})]})]}),y.jsx("div",{ref:o,className:"memo-content-text",onContextMenu:E=>{E.preventDefault(),E.stopPropagation()}})]})},LJ=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:s,filter:u}=t,d=tn.getQueryById(u);return!!(r||a&&a.from<a.to||o||s||d)||d||n?e.filter(p=>{let g=!0;if(p.thinoType!==void 0&&n&&p.thinoType==="TASK-DONE"&&(g=!1),p.content.contains("comment:")&&(g=!1),d){const w=JSON.parse(d.querystring);Array.isArray(w)&&(g=$d(p,w))}if(r){const w=new Set;for(const D of Array.from(p.content.match(An)||[])){const T=D.replace(An,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match($n)||[])){const T=D.replace($n,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match(hr)||[])){const T=D.replace(hr,"$2").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}w.has(r)||(g=!1)}return a&&a.from<a.to&&(Re.getTimeStampByDate(p.createdAt)<a.from||Re.getTimeStampByDate(p.createdAt)>a.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(p.content.match(An)!==null||p.content.match(hr)!==null||p.content.match($n)!==null)||o==="LINKED"&&p.content.match(Rc)===null||o==="IMAGED"&&p.content.match(_c)===null||o==="CONNECTED"&&p.content.match(Il)===null)&&(g=!1),s&&!p.content.toLowerCase().includes(s.toLowerCase())&&(g=!1),g}):e.filter(p=>!p.content.contains("comment:"))},RJ=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=O.useContext(wt),r=Yc(),[a,o]=O.useState([]),s=q.useRef(null);O.useEffect(()=>{const m=LJ({memos:n.filter(p=>p.deletedAt!==""&&p.deletedAt),query:e,HideDoneTasks:!1});o(m),r.setFinish()},[n,s.current,e]);const u=O.useCallback(m=>{o(p=>p.filter(g=>g.id!==m))},[]),d=O.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]);return y.jsxs("div",{className:"memo-trash-wrapper",ref:s,children:[y.jsxs("div",{className:"section-header-container",children:[y.jsxs("div",{className:"title-text",children:[y.jsx(lo,{when:t,children:y.jsx("button",{ref:m=>{m&&x.setIcon(m,"menu")},className:"btn action-btn clickable-icon",onClick:d})}),y.jsx("span",{className:"normal-text",children:k("Recycle bin")}),y.jsxs("span",{className:"go-home-btn",onClick:()=>{We.clearQuery(),We.setPathname("/")},children:["🏠 ",k("Return To Home Page")]})]}),y.jsx(Rv,{})]}),y.jsx(Om,{thinosCount:a.length,thinos:a}),r.isLoading?y.jsx("div",{className:"tip-text-container",children:y.jsx("span",{className:"tip-text",children:k("Fetching data...")})}):a.length===0?y.jsx("div",{className:"tip-text-container",children:y.jsx("span",{className:"tip-text",children:k("Here is No Memos.")})}):y.jsx("div",{className:"deleted-memos-container",children:a.map(m=>y.jsx(jJ,{memo:m,handleDeletedMemoAction:u},`${m.id}-${m.updatedAt}`))})]})},Rg="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",_g="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",_J=()=>{const{globalState:e}=O.useContext(wt),{useTinyUndoHistoryCache:t,shouldHideImageUrl:n,shouldSplitMemoWord:r,shouldUseMarkdownParser:a}=e,o=`👋 你好呀欢迎使用memos!
* ✨ **开源项目**
* 😋 精美且细节的视觉样式;
* 📑 体验优良的交互逻辑;`,s=()=>{Qe.setAppSetting({useTinyUndoHistoryCache:!t})},u=()=>{Qe.setAppSetting({shouldSplitMemoWord:!r})},d=()=>{Qe.setAppSetting({shouldHideImageUrl:!n})},m=()=>{Qe.setAppSetting({shouldUseMarkdownParser:!a})},p=async()=>{const g=Ie.getState().memos.map(S=>({...S})),w=JSON.stringify(g),D=document.createElement("a");D.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(w)),D.setAttribute("download","data.json"),D.style.display="none",document.body.appendChild(D),D.click(),document.body.removeChild(D)};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"section-container preferences-section-container",children:[y.jsx("p",{className:"title-text",children:"Memo 显示相关"}),y.jsx("div",{className:"demo-content-container memo-content-text",dangerouslySetInnerHTML:{__html:hw(o)}}),y.jsxs("label",{className:"form-label checkbox-form-label",onClick:u,children:[y.jsx("span",{className:"normal-text",children:"中英文内容自动间隔"}),y.jsx("img",{className:"icon-img",src:r?Rg:_g})]}),y.jsxs("label",{className:"form-label checkbox-form-label",onClick:m,children:[y.jsx("span",{className:"normal-text",children:"部分 markdown 格式解析"}),y.jsx("img",{className:"icon-img",src:a?Rg:_g})]}),y.jsxs("label",{className:"form-label checkbox-form-label",onClick:d,children:[y.jsx("span",{className:"normal-text",children:"隐藏图片链接地址"}),y.jsx("img",{className:"icon-img",src:n?Rg:_g})]})]}),y.jsxs("div",{className:"section-container preferences-section-container",children:[y.jsx("p",{className:"title-text",children:"编辑器"}),y.jsxs("label",{className:"form-label checkbox-form-label",onClick:s,children:[y.jsxs("span",{className:"normal-text",children:["启用"," ",y.jsx("a",{target:"_blank",href:"https://github.com/boojack/tiny-undo",onClick:g=>g.stopPropagation(),rel:"noreferrer",children:"tiny-undo"})]}),y.jsx("img",{className:"icon-img",src:t?Rg:_g})]})]}),y.jsxs("div",{className:"section-container hidden",children:[y.jsx("p",{className:"title-text",children:"其他"}),y.jsx("div",{className:"btn-container",children:y.jsx("button",{className:"btn export-btn",onClick:p,children:"导出数据(JSON)"})})]})]})},HJ=()=>{const{globalState:{isMobileView:e}}=O.useContext(wt);O.useEffect(()=>{Ie.fetchAllMemos()},[]);const t=O.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]);return y.jsxs("div",{className:"preference-wrapper",children:[y.jsx("div",{className:"section-header-container",children:y.jsxs("div",{className:"title-text",children:[y.jsx(lo,{when:e,children:y.jsx("button",{className:"action-btn",onClick:t})}),y.jsx("span",{className:"normal-text",children:"账号与设置"})]})}),y.jsx("div",{className:"sections-wrapper",children:y.jsx(_J,{})})]})},BJ=e=>{const{dailyNotesState:{app:t,settings:n,view:r}}=O.useContext(wt),{memo:a,handleUnarchivedMemoAction:o}=e,s=q.useRef(null),u=q.useRef(null),[d,m]=q.useState(""),p={...a,createdAtStr:Re.getDateTimeString(a.createdAt),deletedAtStr:Re.getDateTimeString(a.deletedAt||a.createdAt)},[g,w]=_o(!1),D={restore:O.useRef(null),delete:O.useRef(null),source:O.useRef(null)};O.useEffect(()=>{u&&(x.setIcon(D.restore.current,"archive-restore"),x.setIcon(D.delete.current,"trash"),x.setIcon(D.source.current,"home"))},[u]),O.useEffect(()=>{if(!s.current||!u.current||s.current.hasChildNodes()&&a.content===d||!r)return;m(a.content),s.current.hasChildNodes()&&s.current.empty();async function N(){var F;await x.MarkdownRenderer.render(t,a.content+`
`,s.current,a.path,r);const R=(F=s.current)==null?void 0:F.querySelectorAll(".internal-link");R==null||R.forEach(H=>{const P=H,L=P.getAttribute("data-href");if(!L)return;t.metadataCache.getFirstLinkpathDest(L,a.path)||H.classList.add("is-unresolved"),P.addEventListener("mouseover",U=>{U.stopPropagation(),t.workspace.trigger("hover-link",{event:U,source:"thino",hoverParent:r.containerEl,targetEl:P,linktext:L,sourcePath:P.href})})})}N()},[a.content,u]);const S=async()=>{switch(p.sourceType){case"DAILY":await p1(p.id,p.path);break;case"CANVAS":await v1(p.id,p.path);break;case"MULTI":await m1(p.path);break;case"FILE":await g1(p.id,p.path);break}},T=async()=>{if(g)try{if(n.DeleteThinoDirectly)await Ie.deleteMemoById(p.id);else{const N=await Ie.hideMemoById(p.id);N&&Ie.editMemo(N)}}catch(N){new x.Notice(N.message)}else w()},E=async()=>{try{const N=await Ie.unarchiveMemo(p);N&&Ie.editMemo(N),o(p.id),new x.Notice(k("RESTORE SUCCEED"))}catch(N){new x.Notice(N.message)}},A=()=>{g&&w(!1)};return y.jsxs("div",{ref:u,className:`memo-wrapper ${"memos-"+p.id}`,onMouseLeave:A,children:[y.jsxs("div",{className:"memo-top-wrapper",children:[y.jsxs("span",{className:"time-text",children:[k("ARCHIVED AT")," ",p.updatedAt]}),y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:N=>{N&&x.setIcon(N,"more-horizontal")},className:"btn more-action-btn"}),y.jsx("div",{className:"more-action-btns-wrapper",children:y.jsxs("div",{className:"more-action-btns-container",children:[y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:D.restore,className:"more-action-item-icon"}),y.jsx("span",{className:"btn restore-btn",onClick:E,children:k("RESTORE")})]}),y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:D.source,className:"more-action-item-icon"}),y.jsx("span",{className:"btn",onClick:S,children:k("SOURCE")})]}),y.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[y.jsx("span",{ref:D.delete,className:"more-action-item-icon"}),y.jsx("span",{className:`btn delete-btn ${g?"final-confirm":""}`,onClick:T,children:k(g?"CONFIRM":"DELETE")})]})]})})]})]}),y.jsx("div",{ref:s,className:"memo-content-text"})]})},YJ=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:s,filter:u}=t,d=tn.getQueryById(u);return!!(r||a&&a.from<a.to||o||s||d)||d||n?e.filter(p=>{let g=!0;if(p.thinoType!==void 0&&n&&p.thinoType==="TASK-DONE"&&(g=!1),p.content.contains("comment:")&&(g=!1),d){const w=JSON.parse(d.querystring);Array.isArray(w)&&(g=$d(p,w))}if(r){const w=new Set;for(const D of Array.from(p.content.match(An)||[])){const T=D.replace(An,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match($n)||[])){const T=D.replace($n,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match(hr)||[])){const T=D.replace(hr,"$2").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}w.has(r)||(g=!1)}return a&&a.from<a.to&&(Re.getTimeStampByDate(p.createdAt)<a.from||Re.getTimeStampByDate(p.createdAt)>a.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(p.content.match(An)!==null||p.content.match(hr)!==null||p.content.match($n)!==null)||o==="LINKED"&&p.content.match(Rc)===null||o==="IMAGED"&&p.content.match(_c)===null||o==="CONNECTED"&&p.content.match(Il)===null)&&(g=!1),s&&!p.content.toLowerCase().includes(s.toLowerCase())&&(g=!1),g}):e.filter(p=>!p.content.contains("comment:"))},zJ=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=O.useContext(wt),r=Yc(),[a,o]=O.useState([]),s=q.useRef(null);O.useEffect(()=>{const p=YJ({memos:n.filter(g=>g.rowStatus==="ARCHIVED"&&g.deletedAt===""),query:e,HideDoneTasks:!1});o(p),r.setFinish()},[n,s.current,e]);const u=O.useCallback(p=>{o(g=>g.filter(w=>w.id!==p))},[]),d=O.useCallback(p=>{o(g=>g.filter(w=>w.id!==p))},[]),m=O.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]);return y.jsxs("div",{className:"memo-trash-wrapper",ref:s,children:[y.jsxs("div",{className:"section-header-container",children:[y.jsxs("div",{className:"title-text",children:[y.jsx(lo,{when:t,children:y.jsx("button",{ref:p=>{p&&x.setIcon(p,"menu")},className:"btn action-btn clickable-icon",onClick:m})}),y.jsx("span",{className:"normal-text",children:k("ARCHIVE")}),y.jsxs("span",{className:"go-home-btn",onClick:()=>{We.clearQuery(),We.setPathname("/")},children:["🏠 ",k("Return To Home Page")]})]}),y.jsx(Rv,{})]}),y.jsx(Om,{thinosCount:a.length,thinos:a}),r.isLoading?y.jsx("div",{className:"tip-text-container",children:y.jsx("p",{className:"tip-text",children:k("Fetching data...")})}):a.length===0?y.jsx("div",{className:"tip-text-container",children:y.jsx("p",{className:"tip-text",children:k("Here is No Memos.")})}):y.jsx("div",{className:"deleted-memos-container",children:a.map(p=>y.jsx(BJ,{memo:p,handleUnarchivedMemoAction:d,handleDeletedMemoAction:u},`${p.id}-${p.updatedAt}`))})]})},UJ=()=>{const{dailyNotesState:{app:e},locationState:{query:t},globalState:{isMobileView:n,changedByMemos:r},memoState:{memos:a}}=O.useContext(wt),o=Yc(),[s,u]=O.useState([]),[d,m]=O.useState([]),p=q.useRef(null),g=q.useRef(null),[w,D]=O.useState(!1),[S,T]=O.useState([]),E=q.useRef([]),A=O.useCallback(({memos:F,query:H,HideDoneTasks:P})=>{const{tag:L,duration:z,type:U,text:W,filter:K}=H,ae=tn.getQueryById(K);return!!(L||z&&z.from<z.to||U||W||ae)||ae||P?F.filter(fe=>{let ie=!0;if(fe.thinoType!==void 0&&P&&fe.thinoType==="TASK-DONE"&&(ie=!1),fe.content.contains("comment:")&&(ie=!1),ae){const ge=JSON.parse(ae.querystring);Array.isArray(ge)&&(ie=$d(fe,ge))}if(L){const ge=new Set;for(const Te of Array.from(fe.content.match(An)||[])){const we=Te.replace(An,"$1").trim().split("/");let Z="";for(const $ of we)Z+=$,ge.add(Z),Z+="/"}for(const Te of Array.from(fe.content.match($n)||[])){const we=Te.replace($n,"$1").trim().split("/");let Z="";for(const $ of we)Z+=$,ge.add(Z),Z+="/"}for(const Te of Array.from(fe.content.match(hr)||[])){const we=Te.replace(hr,"$2").trim().split("/");let Z="";for(const $ of we)Z+=$,ge.add(Z),Z+="/"}ge.has(L)||(ie=!1)}return z&&z.from<z.to&&(Re.getTimeStampByDate(fe.createdAt)<z.from||Re.getTimeStampByDate(fe.createdAt)>z.to)&&(ie=!1),U&&(U==="NOT_TAGGED"&&(fe.content.match(An)!==null||fe.content.match($n)!==null)||U==="LINKED"&&fe.content.match(Rc)===null||U==="IMAGED"&&fe.content.match(_c)===null||U==="CONNECTED"&&fe.content.match(Il)===null)&&(ie=!1),W&&!fe.content.toLowerCase().includes(W.toLowerCase())&&(ie=!1),ie}):F},[]);O.useEffect(()=>{g.current&&(x.setIcon(g.current,"refresh-cw"),e.workspace.on("refresh-review-memos",R))},[g]),O.useEffect(()=>{if(!w)return;const F=[...S].sort(()=>Math.random()-Math.random()).slice(0,10);u(F),D(!1)},[w]),O.useEffect(()=>{if(!(S.length>0))return;const F=[...S].sort(()=>Math.random()-Math.random()).slice(0,10);u(F),D(!1)},[S]),O.useEffect(()=>{p.current&&(T(A({memos:a,query:t,HideDoneTasks:!1}).filter(F=>F.rowStatus!=="ARCHIVED"&&!(F.deletedAt!==""&&F.deletedAt))),o.setFinish(),We.clearQuery())},[a,p.current]),O.useEffect(()=>{if(r&&E.current.length>0){const F=S.filter(P=>E.current.includes(P.id)),H=E.current.map(P=>F.find(L=>L.id===P)).filter(P=>P!==void 0);m(H);return}E.current=s.map(F=>F.id),m(s)},[s]),O.useEffect(()=>{if(s.length===0)return;const F=A({memos:s,query:t,HideDoneTasks:!1});m(F)},[t]);const N=O.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]),R=()=>{D(!0)};return y.jsxs("div",{className:"memo-review-wrapper",ref:p,children:[y.jsx("div",{className:"section-header-container",children:y.jsxs("div",{className:"title-wrapper",children:[y.jsxs("div",{className:"title-btns-left-wrapper",children:[y.jsx(lo,{when:n,children:y.jsx("button",{ref:F=>{F&&x.setIcon(F,"menu")},className:"btn action-btn clickable-icon",onClick:N})}),y.jsx("span",{className:"normal-text",children:k("Random Review")}),y.jsx("span",{ref:g,onClick:R,className:"refresh-icon"})]}),y.jsx("div",{className:"title-btns-right-wrapper",children:y.jsxs("span",{className:"go-home-btn",onClick:()=>{We.setPathname("/")},children:["🏠 ",k("Return To Home Page")]})})]})}),y.jsx(Om,{}),o.isLoading?y.jsx("div",{className:"tip-text-container",children:y.jsx("span",{className:"tip-text",children:k("Fetching data...")})}):a.length===0?y.jsx("div",{className:"tip-text-container",children:y.jsx("span",{className:"tip-text",children:k("Here is No Memos.")})}):y.jsx("div",{className:"review-memos-container",children:d.map(F=>y.jsx(Ua,{memo:F},`${F==null?void 0:F.id}-${F.createdAt}`))})]})},VJ=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:s,filter:u}=t,d=tn.getQueryById(u);return!!(r||a&&a.from<a.to||o||s||d)||d||n?e.filter(p=>{let g=!0;if(p.thinoType!==void 0&&n&&p.thinoType==="TASK-DONE"&&(g=!1),p.content.contains("comment:")&&(g=!1),d){const w=JSON.parse(d.querystring);Array.isArray(w)&&(g=$d(p,w))}if(r){const w=new Set;for(const D of Array.from(p.content.match(An)||[])){const T=D.replace(An,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match($n)||[])){const T=D.replace($n,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match(hr)||[])){const T=D.replace(hr,"$2").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}w.has(r)||(g=!1)}return a&&a.from<a.to&&(Re.getTimeStampByDate(p.createdAt)<a.from||Re.getTimeStampByDate(p.createdAt)>a.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(p.content.match(An)!==null||p.content.match(hr)!==null||p.content.match($n)!==null)||o==="LINKED"&&p.content.match(Rc)===null||o==="IMAGED"&&p.content.match(_c)===null||o==="CONNECTED"&&p.content.match(Il)===null)&&(g=!1),s&&!p.content.toLowerCase().includes(s.toLowerCase())&&(g=!1),g}):e.filter(p=>!p.content.contains("comment:"))},ZJ=O.forwardRef((e,t)=>{const{currentDate:n,setCurrentDateStamp:r}=e,[a,o]=O.useState(!1),s=Re.getDateStampByDate(Re.getDateString(n)),u=O.useRef(null);O.useEffect(()=>{u.current&&(!a&&x.setIcon(u.current,"more-horizontal"),a&&x.setIcon(u.current,"x"))},[u.current,a]);const d=m=>{r(m)};return O.useImperativeHandle(t,()=>({closeDatePicker:()=>{o(!1)}})),y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"date-card-container",children:[y.jsxs("div",{className:"date-container-details",children:[y.jsxs("div",{className:"details-text",children:[x.moment(s,"x").format("dddd")+" ",y.jsx("div",{className:"date-text",children:x.moment(s,"x").format("MMM")+" "+x.moment(s,"x").format("DD")})]}),y.jsx("div",{className:"details-logo-text",children:k("Daily Memos")})]}),y.jsxs("div",{className:"date-container-info",children:[y.jsxs("div",{className:"date-container-info-text",children:["Week ",y.jsx("div",{className:"week-text",children:x.moment(s,"x").format("ww")}),"of ",y.jsx("div",{className:"year-text",children:x.moment(s,"x").format("YYYY")})]}),y.jsx("div",{ref:u,onClick:()=>o(!a)})]})]}),y.jsx(Nm,{className:`date-picker ${a?"":"hidden"}`,datestamp:s,handleDateStampChange:d})]})}),WJ=({thino:e})=>{const t=O.useCallback(()=>{Gd(e)},[]);return y.jsxs("div",{className:"daily-thino-wrapper",children:[y.jsx("div",{className:"time-wrapper",onClick:t,children:y.jsx("span",{className:"normal-text",children:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm")})}),y.jsx("div",{className:"daily-thino-container",children:y.jsx(Ua,{memo:e})})]})},$J=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n},dailyNotesState:{settings:r,app:a}}=O.useContext(wt),o=Yc(),[s,u]=O.useState([]),[d,m]=O.useState(Re.getDateStampByDate(Re.getDateString(x.moment().format("YYYY-MM-DD HH:mm:ss")))),p=O.useRef(),g=O.useRef(null),w=q.useRef(null),D=O.useRef(null),[S,T]=O.useState(!1);O.useEffect(()=>{D.current&&(x.setIcon&&D&&!S&&x.setIcon(D.current,"share"),x.setIcon&&D&&S&&x.setIcon(D.current,"chrome"))},[D.current,S]),O.useEffect(()=>{const R=VJ({memos:n,query:e,HideDoneTasks:!1}).filter(F=>Re.getTimeStampByDate(F.createdAt)>=d&&Re.getTimeStampByDate(F.createdAt)<d+Ba).filter(F=>F.deletedAt==="").sort((F,H)=>Re.getTimeStampByDate(F.createdAt)-Re.getTimeStampByDate(H.createdAt));u(R),o.setFinish()},[n,d,w.current,e]);const E=O.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]),A=async()=>{var N;p.current&&((N=p==null?void 0:p.current)==null||N.closeDatePicker()),T(!0),setTimeout(()=>{if(!g.current){T(!1);return}let R;document.body.hasClass("theme-dark")?R="#232323":R="#eaeaea",Uv(g.current,{backgroundColor:R,pixelRatio:window.devicePixelRatio*2}).then(F=>{if(r!=null&&r.AutoSaveWhenOnMobile&&x.Platform.isMobile){const H=F.split("base64,")[1];Av(H,"image/png").arrayBuffer().then(async L=>{let z;const U="png",W=ws();for(const K in W)if(W[K]instanceof x.TFile){z=W[K];break}z!==void 0&&await a.vault.createBinary(await vault.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,U,z),L)})}Vv({imgUrl:F}),T(!1)}).catch(()=>{T(!1)})},0)};return y.jsxs("div",{className:"daily-thinos-list-wrapper",ref:w,children:[y.jsxs("div",{className:"section-header-container",children:[y.jsxs("div",{className:"title-text",children:[y.jsx(lo,{when:t,children:y.jsx("button",{ref:N=>{N&&x.setIcon(N,"menu")},className:"btn action-btn clickable-icon",onClick:E})}),y.jsxs("span",{className:"go-home-btn",onClick:()=>{We.clearQuery(),We.setPathname("/")},children:["🏠 ",k("Return To Home Page")]})]}),y.jsxs("div",{className:"header-right-section",children:[y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"chevron-left")},className:"btn btn-text",onClick:()=>m(N=>N-Ba)}),y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"chevron-right")},className:"btn btn-text",onClick:()=>m(N=>N+Ba)}),y.jsx("span",{ref:D,className:mr("btn btn-text share-btn",S?"generating":""),onClick:A})]}),y.jsx(iC,{}),y.jsx(Rv,{})]})]}),y.jsx(Om,{thinosCount:s.length,thinos:s}),y.jsx("div",{className:"daily-thinos-view-wrapper",children:y.jsxs("div",{ref:g,className:"daily-thinos-view-container",children:[y.jsx(ZJ,{ref:p,currentDate:new Date(d),setCurrentDateStamp:m}),o.isLoading?y.jsx("div",{className:"tip-text-container",children:y.jsx("p",{className:"tip-text",children:k("Fetching data...")})}):s.length===0?y.jsx("div",{className:"tip-container",children:y.jsx("p",{className:"tip-text",children:k("Noooop!")})}):y.jsx("div",{className:"daily-thinos-list-container",children:s.map(N=>y.jsx(WJ,{thino:N},`${N.id}-${N.updatedAt}`))})]})})]})},GJ={"/recycle":y.jsx(RJ,{}),"/setting":y.jsx(HJ,{}),"/archive":y.jsx(zJ,{}),"/review":y.jsx(UJ,{}),"/daily":y.jsx($J,{}),"*":y.jsx(mJ,{})},cC=e=>t=>{for(const n of Object.keys(e))if(n===t)return e[n];return e["*"]},qJ=cC(PJ),JJ=cC(GJ);function KJ({app:e}){const{locationState:{pathname:t},dailyNotesState:{settings:n}}=O.useContext(wt);return O.useEffect(()=>{Ie.fetchAllMemos()},[]),!vI()&&!e.plugins.getPlugin("periodic-notes")&&(n!=null&&n.EnabledLocationList.find(r=>r.value==="DAILY"))&&new x.Notice(k("Check if you opened Daily Notes Plugin Or Periodic Notes Plugin")),y.jsx(Sl,{store:Ee,context:wt,children:qJ(t)})}const Hr="thino_view";class QJ extends x.EditorSuggest{constructor(n,r){super(n);he(this,"root");he(this,"editor");he(this,"cursor");he(this,"plugin");this.plugin=r,this.suggestEl.toggleClass("thino-date-selector",!0)}checkInMemosView(n){var o;const r=n.containerEl;if(!r)return!1;const a=(o=r.parentElement)==null?void 0:o.parentElement;return(a==null?void 0:a.classList.contains("common-editor-inputer"))||!1}onTrigger(n,r){const o=r.getLine(n.line)[n.ch-1];return this.checkInMemosView(r)&&o==="@"?(this.cursor=n,this.editor=r,x.Platform.isMobile?(new cE(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(x.moment().startOf("day").format("x"))]}renderSuggestion(n,r){r.empty(),this.root=hs.createRoot(r),this.root.render(y.jsx(q.StrictMode,{children:y.jsx(Nm,{className:"editor-date-picker",datestamp:n,handleDateStampChange:this.selectSuggestion.bind(this)})}))}selectSuggestion(n,r){var u,d,m;if(r instanceof KeyboardEvent||r instanceof PointerEvent&&!r.target.closest(".day-item"))return;const a=(u=this.app.workspace.getLeavesOfType("thino_view")[0])==null?void 0:u.view;(d=a==null?void 0:a.contentEl.find(".action-btn.list-or-task.list"))==null||d.click();let o="",s="";switch(this.plugin.settings.InsertDateFormat){case"Dataview":o="[due::",s="]";break;case"Tasks":o="📆";break}this.editor.replaceRange(o+x.moment(n).format("YYYY-MM-DD")+s,{line:this.cursor.line,ch:this.cursor.ch-1},this.cursor),(m=this.root)==null||m.unmount(),this.close()}}class XJ extends x.EditorSuggest{constructor(n,r){super(n);he(this,"root");he(this,"editor");he(this,"cursor");he(this,"plugin");he(this,"memos",[]);this.plugin=r,this.memos=Ie.getState().memos.filter(a=>!a.deletedAt&&a.rowStatus!=="ARCHIVED")}checkInMemosView(n){var o;const r=n.containerEl;if(!r)return!1;const a=(o=r.parentElement)==null?void 0:o.parentElement;return(a==null?void 0:a.classList.contains("common-editor-inputer"))||!1}fuzzySearchItemsOptimized(n,r){const a=x.prepareFuzzySearch(n);return r.map(o=>{const s=a(o.content);return s?{item:o,match:s}:null}).filter(Boolean)}onTrigger(n,r){if(!this.checkInMemosView(r))return null;const o=r.getLine(n.line).slice(0,n.ch);if(o.lastIndexOf("~")===-1)return null;const s=o.slice(o.lastIndexOf("~")+1,n.ch);if(o[o.lastIndexOf("~")-1]!==" "&&o.lastIndexOf("~")!==0)return null;const u=s.trim();return this.memos=Ie.getState().memos.filter(d=>!d.deletedAt&&d.rowStatus!=="ARCHIVED"),{start:{line:n.line,ch:n.ch-u.length},end:n,query:u}}getSuggestions(n){return n.query?this.fuzzySearchItemsOptimized(n.query,this.memos).sort((a,o)=>o.match.score-a.match.score).map(a=>a.item).map(a=>({time:a.createdAt,id:a.id,content:a.content})):this.memos.map(a=>({time:a.createdAt,id:a.id,content:a.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 eK{constructor(){he(this,"path","/fake-file-that-generated-for-thino.png");he(this,"basename","fake-file-that-generated-for-thino");he(this,"extension","png");he(this,"deleted",!1);he(this,"name","fake-file-that-generated-for-thino.png");he(this,"parent",null);he(this,"stat");he(this,"vault",null)}static[Symbol.hasInstance](t){return t instanceof x.TFile}setPath(t){}getNewPathAfterRename(t){}getShortName(){}cache(t){}updateCacheLimit(){}}function tK(e,t){try{const n=hs.createRoot(e);return n.render(y.jsx(q.StrictMode,{children:y.jsx(Sl,{store:Ee,context:wt,children:y.jsx(Cd,{editorType:"inline",destroy:t})})})),n}catch(n){console.error(n)}}class yl extends x.ItemView{constructor(n,r){super(n);he(this,"scope",new x.Scope(this.app.scope));he(this,"root");he(this,"mobileHeaderRoot");he(this,"plugin");he(this,"hoverPopover");he(this,"memosComponent");he(this,"editor",null);he(this,"navigation",!1);he(this,"file",new eK);he(this,"handleUpdateInstance",n=>{this.editor=n.editor});this.plugin=r,this.registerScope()}getDisplayText(){return"Thino"}getIcon(){return"Memos"}getViewType(){return Hr}getMode(){return"source"}registerScope(){const{scope:n}=this;n.register(["Mod"],"Enter",()=>{});for(let r=0;r<Md.length-1;r++)n.register(["Alt"],(r+1).toString(),()=>{});n.register([],"i",r=>{const a=r.target;a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.hasClass("cm-line")||a.hasClass("cm-content")||(r.preventDefault(),this.plugin.app.workspace.trigger("focus-on-textarea"))}),n.register(["Mod"],"f",r=>{const a=r.target;a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.hasClass("cm-line")||a.hasClass("cm-content")||(r.preventDefault(),this.plugin.app.workspace.trigger("focus-on-searchBar"))}),n.register([],"o",r=>{const a=r.target;a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.hasClass("cm-line")||a.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,m,p;const r=Zh(n,"day"),a=n.path.contains(".thino")&&n.path.contains(".canvas"),o=n.path.contains(".thino")&&n.path.contains(".md"),s=((d=this.plugin.settings)==null?void 0:d.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",u=(p=((m=n.parent)==null?void 0:m.path)||n.path)==null?void 0:p.contains(s==null?void 0:s.trim());(r||a&&this.plugin.settings.EnabledLocationList.find(g=>g.value==="CANVAS"))&&(await Ie.removeMemosInFile(n),Ie.updateTagsState()),u&&this.plugin.settings.EnabledLocationList.find(g=>g.value==="MULTI")&&(await Ie.removeMemosInFile(n,s),Ie.updateTagsState()),o&&this.plugin.settings.EnabledLocationList.find(g=>g.value==="FILE")&&(await Ie.removeMemosInFile(n),Ie.updateTagsState())}async onFileModified(n){var d;if(Qe.getState().changedByMemos){Qe.setChangedByMemos(!1);return}const r=Zh(n,"day"),a=n.path.contains(".thino")&&n.path.contains(".canvas"),o=n.path.contains(".thino")&&n.path.contains(".md"),s=((d=this.plugin.settings)==null?void 0:d.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",u=n.parent.path.contains(s==null?void 0:s.trim());if(r||a&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="CANVAS")){await Ie.updateMemosInFile(n),Ie.updateTagsState();return}u&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="MULTI")&&(await Ie.updateMemosInFile(n,s),Ie.updateTagsState()),o&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="FILE")&&(await Ie.updateMemosInFile(n),Ie.updateTagsState())}async onFileCreated(n){var r;if(this.app.workspace.layoutReady&&this.memosComponent){const a=Zh(n,"day"),o=n.path.contains(".thino")&&n.path.contains(".canvas"),s=n.path.contains(".thino")&&n.path.contains(".md"),u=((r=this.plugin.settings)==null?void 0:r.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",d=n.parent.path.contains(u==null?void 0:u.trim());if(a){await rt.updateDailyNotes(n,!1),await Ie.updateMemosInFile(n),Ie.updateTagsState();return}if(o&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="CANVAS")){await Ie.updateMemosInFile(n),Ie.updateTagsState();return}d&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="MULTI")&&(await Ie.updateMemosInFile(n,u),Ie.updateTagsState()),s&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="FILE")&&(await Ie.updateMemosInFile(n),Ie.updateTagsState())}}async onResize(){var r;super.onResize();const n=this.leaf;if(n&&n.height!==0){if(n.view.containerEl.toggleClass("tiny-view",n.width<600),n.view.containerEl.toggleClass("waterfall-small-group",n.width<1300),n.width>950){n.view.containerEl.classList.toggle("mobile-view",!1),Qe.setIsMobileView(n.width<=950);return}if((r=this.plugin.settings)!=null&&r.ShowLeftSideBar&&!x.Platform.isMobile)return;n.view.containerEl.classList.toggle("mobile-view",!0),Qe.setIsMobileView(n.width<=950)}}appendToHeader(){const n=this.leaf.view.titleContainerEl;n&&(this.mobileHeaderRoot=hs.createRoot(n),this.mobileHeaderRoot.render(y.jsx(q.StrictMode,{children:y.jsx(Sl,{store:Ee,context:wt,children:y.jsx(ev,{})})})))}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),x.Platform.isTablet&&document.body.toggleClass("is-tablet",!0),x.Platform.isMobile&&!x.Platform.isTablet&&this.appendToHeader(),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",x.debounce(this.onFileModified,2e3,!0)));try{this.root=hs.createRoot(this.contentEl),rt.setView(this),this.root.render(y.jsx(q.StrictMode,{children:y.jsx(KJ,{app:this.plugin.app})}))}catch(n){console.error(n)}}onunload(){super.onunload(),this.root.unmount()}}const O2={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 nK(){Object.keys(O2).forEach(e=>{x.addIcon(e,O2[e])})}class F2 extends uE{fuzzySearchItemsOptimized(t,n){const r=x.prepareFuzzySearch(t);return n.map(a=>{const o=r(a.path);return o?{item:a,match:o,score:o.score}:null}).sort((a,o)=>(o==null?void 0:o.score)-(a==null?void 0:a.score)).filter(Boolean)}getSuggestions(t){const r=app.vault.getFiles().filter(o=>["png","jpg","jpeg","gif"].includes(o.extension)),a=t.toLowerCase();return this.fuzzySearchItemsOptimized(a,r).map(o=>o.item)}renderSuggestion(t,n){var o;const r=t.basename,a=((o=t.parent)==null?void 0:o.path)||"";n.toggleClass("thino-image-suggest-item",!0),n.createSpan({cls:"suggestion-name",text:r}),n.createSpan({cls:"suggestion-path",text:a})}selectSuggestion(t){this.inputEl.value=t.path,this.inputEl.trigger("input"),this.close()}}const ub=typeof Buffer=="function";typeof TextDecoder=="function"&&new TextDecoder;const P2=typeof TextEncoder=="function"?new TextEncoder:void 0,rK="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Vh=Array.prototype.slice.call(rK);(e=>{let t={};return e.forEach((n,r)=>t[n]=r),t})(Vh);const Di=String.fromCharCode.bind(String);typeof Uint8Array.from=="function"&&Uint8Array.from.bind(Uint8Array);const aK=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),oK=e=>{let t,n,r,a,o="";const s=e.length%3;for(let u=0;u<e.length;){if((n=e.charCodeAt(u++))>255||(r=e.charCodeAt(u++))>255||(a=e.charCodeAt(u++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|a,o+=Vh[t>>18&63]+Vh[t>>12&63]+Vh[t>>6&63]+Vh[t&63]}return s?o.slice(0,s-3)+"===".substring(s):o},uC=typeof btoa=="function"?e=>btoa(e):ub?e=>Buffer.from(e,"binary").toString("base64"):oK,iK=ub?e=>Buffer.from(e).toString("base64"):e=>{let n=[];for(let r=0,a=e.length;r<a;r+=4096)n.push(Di.apply(null,e.subarray(r,r+4096)));return uC(n.join(""))},sK=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?Di(192|t>>>6)+Di(128|t&63):Di(224|t>>>12&15)+Di(128|t>>>6&63)+Di(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Di(240|t>>>18&7)+Di(128|t>>>12&63)+Di(128|t>>>6&63)+Di(128|t&63)}},lK=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,cK=e=>e.replace(lK,sK),j2=ub?e=>Buffer.from(e,"utf8").toString("base64"):P2?e=>iK(P2.encode(e)):e=>uC(cK(e)),uK=(e,t=!1)=>t?aK(j2(e)):j2(e),rw=x.Platform.isDesktop&&require("os"),dC=async()=>{var r,a;let e="";if(x.Platform.isDesktop)e=await zn();else{const o=await((r=window.Capacitor)==null?void 0:r.Plugins.Device.getId());e=o.identifier||o.uuid}let t;if(rw)t=JSON.stringify({hostname:rw.hostname(),platform:rw.platform(),machineid:e});else{const o=await((a=window.Capacitor)==null?void 0:a.Plugins.Device.getInfo()),s=o==null?void 0:o.model,u=o==null?void 0:o.platform;t=JSON.stringify({hostname:s||("mobile"+x.Platform.isMobile?Math.random().toString(36).substring(7):""),platform:u||"mobile",machineid:e})}return uK(t)},dK=async()=>{var t;let e="";if(x.Platform.isDesktop)e=await zn();else{const n=await((t=window.Capacitor)==null?void 0:t.Plugins.Device.getId());e=n.identifier||n.uuid}return e},fK={General:"chef-hat",Thino:"Memos",Theme:"brush",Share:"share-2",Advanced:"cog"},fC=[{value:"DAILY",target:"ProcessEntriesBelow",insert:"InsertAfter"},{value:"CANVAS",target:"MemoDefaultCanvasPath"},{value:"MULTI",target:"MemoDefaultMultiFilePath"},{value:"FILE",target:"MemoDefaultSingleFilePath"}],Oo={StartDate:"Sunday",InsertAfter:"# Journal",UserName:"THINO 😉",ProcessEntriesBelow:"",Language:"en",SaveMemoButtonLabel:"NOTE",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:fC,DeleteThinoDirectly:!1,CaptureKey:{EnableCaptureKey:!1,OpenThinoGlobally:"CommandOrControl+Shift+T",ShowNearMouse:!1},startSync:!1,tokenForVerify:{},saveThinoType:"FILE",showDayMark:!1,dayMarkRange:"day",navigation:!1,password:"",needVerify:!1,addTagAutomatically:!1,addTagPosition:"End",addTagWithNewline:!1,chatViewStyle:"default",MomentsBackgroundImage:"https://images.pexels.com/photos/531767/pexels-photo-531767.jpeg",MomentsIcon:"https://images.pexels.com/photos/256514/pexels-photo-256514.jpeg",MomentsQuote:"Share your thino with the world",DefaultThemeForThino:"classic",LastUpdatedVersion:"0.0.0"};function hK({plugin:e}){const{dailyNotesState:{verifyState:t}}=O.useContext(wt),[n,r]=O.useState(!1),[a,o]=O.useState(!1),[s,u]=O.useState(""),[d,m]=O.useState("");O.useEffect(()=>{dK().then(w=>{m(w)})},[]);const p=async()=>{var T;const w=s,D=!x.Platform.isDesktop&&await((T=window.Capacitor)==null?void 0:T.Plugins.Device.getId()),S=x.Platform.isDesktop?await zn():D.identifier||D.uuid;w&&(e.settingTab.updateSettings("tokenForVerify",{...e.settings.tokenForVerify,[S]:w}),e.verify().then(E=>{E&&(r(!0),Qe.setRefresh(!0),setTimeout(()=>{e.settingTab.display()},200),e.registerToolbarCheck()),new x.Notice(k(E?"Verify successfully":"Failed to verify"))}).catch(E=>{new x.Notice(k("Failed to verify"))}))},g=async w=>{u(w)};return y.jsx("div",{className:"thino-verify-component",children:t?y.jsxs("div",{className:"thino-verify-content verified",children:[y.jsx("div",{className:"thino-verified-text",children:k("You have verified your account. Congrats!")}),y.jsx("div",{className:"thino-description-link",children:y.jsxs("p",{children:[k("If you have any questions, please contact us."),y.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"})]})})]}):y.jsxs("div",{className:"thino-verify-content",children:[y.jsxs("div",{className:"thino-description-link",children:[k("You can buy a license from")+"->",y.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"]})]}),y.jsx("textarea",{className:"thino-verify-textarea",value:s,onChange:w=>g(w.target.value),placeholder:k("Input activation code here")}),y.jsxs("div",{className:"thino-button-container",children:[y.jsxs("div",{className:"thino-button-group",children:[y.jsx("button",{onClick:async()=>{try{const w=await dC();await navigator.clipboard.writeText(w),o(!0)}catch(w){console.error(w),new x.Notice("Failed to copy id");return}new x.Notice(k("Copied to clipboard Successfully"))},children:k("Copy Thino id")}),y.jsx("button",{onClick:()=>{if(!a){new x.Notice(k("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:k("Get activation code")}),s&&y.jsx(y.Fragment,{children:y.jsx("button",{onClick:async()=>{await p()},children:k("Verify")})})]}),n?y.jsx("p",{children:k("After you verify your account, please refresh this page.")}):""]}),y.jsxs("div",{className:"thino-description-link",children:[k("If you have any questions, please contact us."),y.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 mK extends x.PluginSettingTab{constructor(n,r){super(n,r);he(this,"plugin");he(this,"applyDebounceTimer",0);he(this,"tabContent",new Map);he(this,"selectedTab","General");he(this,"search");he(this,"searchSettingInfo",new Map);he(this,"searchZeroState");he(this,"navigateEl");he(this,"passwordMatched",!1);he(this,"root");he(this,"debounceApplySettingsUpdate",x.debounce(async()=>{await this.plugin.saveSettings()},100,!0));he(this,"debounceDisplay",x.debounce(async()=>{await this.display()},300,!0));this.plugin=r}updateSettings(n,r){this.plugin.settings={...this.plugin.settings,[n]:r},this.applySettingsUpdate()}applySettingsUpdate(){this.debounceApplySettingsUpdate(),Ie.updateTagsState()}async hide(){var n;(n=this.root)==null||n.unmount(),this.passwordMatched=!1}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),x.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,(a,o)=>this.generateGeneralSettings(o,a)),this.createTabAndContent("Thino",this.navigateEl,r,(a,o)=>this.generateMemosSettings(o,a)),this.createTabAndContent("Theme",this.navigateEl,r,(a,o)=>this.generateThemeSettings(o,a)),this.createTabAndContent("Share",this.navigateEl,r,(a,o)=>this.generateShareSettings(o,a)),this.createTabAndContent("Advanced",this.navigateEl,r,(a,o)=>this.generateAdvancedSettings(o,a)),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 x.Setting(n);r.settingEl.style.border="none",r.addSearch(a=>{this.search=a}),this.search.setPlaceholder(k("Search all settings")),this.search.inputEl.oninput=()=>{for(const a of this.tabContent){const o=a[1];o.navButton.removeClass("memos-navigation-item-selected"),o.content.show(),o.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(a=>{var o;if(a===""){this.triggerTabChange((o=this.tabContent.get("General"))==null?void 0:o.navButton,"General");return}this.searchSettings(a.toLowerCase())})}triggerTabChange(n,r){if(this.selectedTab==r)return;n.toggleClass("memos-navigation-item-selected",!0);const a=this.tabContent.get(r);if((a==null?void 0:a.content).show(),this.selectedTab!=""){const o=this.tabContent.get(this.selectedTab);o==null||o.navButton.removeClass("memos-navigation-item-selected"),(o==null?void 0:o.content).hide()}else{this.searchZeroState.hide();for(const o of this.searchSettingInfo)for(const s of o[1])s.containerEl.show();for(const o of this.tabContent){const s=o[1];s.heading.hide(),r!==o[0]&&s.content.hide()}}this.selectedTab=r}createTabAndContent(n,r,a,o){const s=this.selectedTab===n,u=r.createDiv("memos-navigation-item");u.toggleClass("memos-desktop",!0),x.setIcon(u.createEl("div",{cls:"memos-navigation-item-icon"}),fK[n]),u.createSpan({text:k(n)}),u.onclick=()=>{this.triggerTabChange(u,n)};const d=a.createDiv("memos-tab-settings"),m=d.createEl("h2",{cls:"memos-setting-heading",text:n+" Settings"});m.hide(),d.id=n.toLowerCase().replace(" ","-"),s?u.addClass("memos-navigation-item-selected"):d.hide(),o&&o(d,n),this.tabContent.set(n,{content:d,heading:m,navButton:u})}searchSettings(n){var o;const r=new Set,a=(s,u)=>{s.show(),r.has(u)||r.add(u)};for(const s of this.searchSettingInfo){const u=s[0],d=s[1];for(const m of d)if(n.trim()===""||(o=m.alias)!=null&&o.includes(n)||m.description.includes(n)||m.name.includes(n))a(m.containerEl,u);else if(m.options&&m.options.length>0)for(const p of m.options){if(p.description.toLowerCase().includes(n)||p.name.toLowerCase().includes(n)){a(m.containerEl,u);break}else if(p.options){for(const g of p.options)if(g.description.toLowerCase().includes(n)||g.value.toLowerCase().includes(n)){a(m.containerEl,u);break}}m.containerEl.hide()}else m.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,a="",o="",s=[],u=""){var m;const d={containerEl:r,name:a.toLowerCase(),description:o.toLowerCase(),options:s,alias:u};this.searchSettingInfo.has(n)?(m=this.searchSettingInfo.get(n))==null||m.push(d):this.searchSettingInfo.set(n,[d])}createSearchZeroState(n){this.searchZeroState=n.createDiv(),this.searchZeroState.hide(),this.searchZeroState.createEl(x.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 a=rt.getState().verifyState,o=!x.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=x.Platform.isDesktop?await zn():o.identifier||o.uuid,u=a&&(a==null?void 0:a.appId)===s;await this.customNameAndTheme(n,r,u)}async generateMemosSettings(n,r){var d;const a=rt.getState().verifyState,o=!x.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=x.Platform.isDesktop?await zn():o.identifier||o.uuid,u=a&&(a==null?void 0:a.appId)===s;this.addMemoSettings(n,r),this.addThinoProSettings(n,r,u)}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 a=rt.getState().verifyState,o=!x.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=x.Platform.isDesktop?await zn():o.identifier||o.uuid,u=a&&(a==null?void 0:a.appId)===s;this.customFileNameSettings(n,r,u),this.setGlobalSettings(n,r,u)}async customNameAndTheme(n,r,a){new Ke(r,this).setName(k("Theme for Thino")).setDesc(k("Set the theme for Thino")).setTab(n).addDropdown(async s=>{s.addOption("modern","Modern"),s.addOption("classic","Classic"),s.setValue(this.plugin.settings.DefaultThemeForThino).onChange(async u=>{this.plugin.settings.DefaultThemeForThino=u,this.applySettingsUpdate()})}),new Ke(r,this).setTab(n).setHeading().setName(k("Theme Details"));let o;new Ke(r,this).setName(k("Heatmap Color Scheme")).setDesc(k("Set different color scheme for heatmap.")).setTab(n).addDropdown(async s=>{o=s,o.addOption("default","default"),o.addOption("gray","gray"),o.addOption("grass","grass"),o.addOption("frame","frame"),o.addOption("olive","olive"),o.addOption("ice","ice"),o.addOption("magenta","magenta"),o.setValue(this.plugin.settings.HeatmapColorScheme).onChange(async u=>{this.plugin.settings.HeatmapColorScheme=u,this.applySettingsUpdate()})}),new Ke(r,this).setName(k("Hide done tasks in Memo list")).setDesc(k("Hide all done tasks in Memo list. Show done tasks by default.")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.HideDoneTasks).onChange(async u=>{this.plugin.settings.HideDoneTasks=u,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Show Tasks Label")).setDesc(k("Show tasks label near the time text. False by default")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.ShowTaskLabel).onChange(async u=>{this.plugin.settings.ShowTaskLabel=u,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Save Memo button label")).setDesc(k("The text shown on the save Memo button in the UI. 'NOTEIT' by default.")).setTab(n).addText(s=>s.setPlaceholder(Oo.SaveMemoButtonLabel).setValue(this.plugin.settings.SaveMemoButtonLabel).onChange(async u=>{this.plugin.settings.SaveMemoButtonLabel=u,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Save Memo button icon")).setDesc(k("The icon shown on the save Memo button in the UI.")).setTab(n).addText(s=>s.setPlaceholder(Oo.SaveMemoButtonIcon).setValue(this.plugin.settings.SaveMemoButtonIcon).onChange(async u=>{this.plugin.settings.SaveMemoButtonIcon=u,this.applySettingsUpdate()})),x.Platform.isDesktop&&new Ke(r,this).setName(k("Always Show Leaf Sidebar on PC")).setDesc(k("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 u=>{this.plugin.settings.ShowLeftSideBar=u,this.applySettingsUpdate()})),await this.getEditorLocation(r,n),new Ke(r,this).setHeading().setTab(n).setName(k("Pro Features")),this.addThinoDailyMarkSettings(n,r,a),new Ke(r,this).setName(k("Chat view style")).setDesc(k("Set the style of chat view")).setTab(n).addDropdown(async s=>{o=s,o.addOption("default","Default"),o.addOption("fluent","Fluent"),o.addOption("inline","Inline"),o.setValue(this.plugin.settings.chatViewStyle).onChange(async u=>{if(!a){fn();return}this.plugin.settings.chatViewStyle=u,this.applySettingsUpdate()})}),this.addThinoMomentsSettings(n,r,a)}addThinoDailyMarkSettings(n,r,a){let o;new Ke(r,this).setName(k("Show day mark on list mode")).setDesc(k("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 u=>{if(!a){fn();return}this.plugin.settings.showDayMark=u,this.applySettingsUpdate(),this.debounceDisplay()})),this.plugin.settings.showDayMark&&new Ke(r,this).setName(k("Day mark range")).setDesc(k("Set the range of day mark. Day by default.")).setTab(n).addDropdown(async s=>{o=s,o.addOption("day","day"),o.addOption("week","week"),o.addOption("month","month"),o.addOption("quarter","quarter"),o.addOption("year","year"),o.setValue(this.plugin.settings.dayMarkRange).onChange(async u=>{this.plugin.settings.dayMarkRange=u,this.applySettingsUpdate()})})}addThinoMomentsSettings(n,r,a){new Ke(r,this).setTab(n).setName(k("Background image for moments view")).setDesc(k("Set the background image for moments view")).addText(o=>o.setPlaceholder("URL").setValue(this.plugin.settings.MomentsBackgroundImage).onChange(async s=>{a&&(this.plugin.settings.MomentsBackgroundImage=s,this.applySettingsUpdate())})),new Ke(r,this).setTab(n).setName(k("Icon for moments/chat view")).setDesc(k("Set the icon for moments/chat view")).addText(o=>o.setPlaceholder("URL").setValue(this.plugin.settings.MomentsIcon).onChange(async s=>{a&&(this.plugin.settings.MomentsIcon=s,this.applySettingsUpdate())})),new Ke(r,this).setTab(n).setName(k("Quote for moments view")).setDesc(k("Set the quote for moments view")).addText(o=>o.setPlaceholder("Input anything here").setValue(this.plugin.settings.MomentsQuote).onChange(async s=>{a&&(this.plugin.settings.MomentsQuote=s,this.applySettingsUpdate())}))}async getEditorLocation(n,r){let a;x.Platform.isMobile&&(new Ke(n,this).setName(k("Default editor position on mobile")).setDesc(k("Set the default editor position on Mobile, 'Top' by default.")).setTab(r).addDropdown(async o=>{a=o,a.addOption("Top",k("Top")),a.addOption("Bottom",k("Bottom")),a.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 Ke(n,this).setName(k("Use button to show editor on mobile")).setDesc(k("Set a float button to call editor on mobile. Only when editor located at the bottom works.")).setTab(r).addToggle(o=>o.setValue(this.plugin.settings.UseButtonToShowEditor).onChange(async s=>{this.plugin.settings.UseButtonToShowEditor=s,this.applySettingsUpdate()})))}customHeading(n,r){var D;new Ke(r,this).setName(k("User name in Memos")).setDesc(k("Set your user name here. 'Memos 😏' By default")).setTab(n).addText(S=>S.setPlaceholder(Oo.UserName).setValue(this.plugin.settings.UserName).onChange(async T=>{this.plugin.settings.UserName=T,this.applySettingsUpdate()}));let a=!1;const o=document.createDocumentFragment();o.createEl("span",{text:k("Connect to PKMer Sync, you can check it in ")});const s=localStorage.getItem("language");let u;s&&s==="zh"?u="https://pkmer.cn/products/UserProfile/#tab-21&activateSync":u="https://thino.pkmer.net/en/",o.createEl("a",{text:k("PKMer Sync"),attr:{href:u}});const d=!!((D=this.plugin.app)!=null&&D.loadLocalStorage("tokenForSync"));d&&new Ke(r,this).setHeading().setName(k("Sync service")).setTab(n),(s==="zh"||s==="zh-TW")&&new Ke(r,this).setName(k("Sync Thino via PKMer")).setDesc(o).setTab(n).addButton(S=>{var E;const T=(E=this.plugin.app)==null?void 0:E.loadLocalStorage("tokenForSync");S.setButtonText(k(T?"Unlink":"Link")).onClick(async()=>{var A;if(!T){const N=localStorage.getItem("language");N&&(N==="zh"||N==="zh-TW")?window.open("https://pkmer.cn/products/UserProfile/#tab-21&activateSync"):window.open("https://thino.pkmer.net/en/");return}if(!a){S.setButtonText(k("Confirm?")),a=!0;return}a=!1,T&&((A=this.plugin.app)==null||A.saveLocalStorage("tokenForSync",""),new x.Notice(k("Remove successfully"))),Qe.setRefresh(!0),setTimeout(()=>{this.display()},20)})}),(s==="zh"||s==="zh-TW")&&this.showSyncStatus(r,n),d&&new Ke(r,this).setHeading().setName(k("Pro verification status")).setTab(n);const m=document.createDocumentFragment(),p=m.createEl("div",{cls:"thino-activation"}),g=new Ke(r,this).setName(k("Activate Pro Version")).setDesc(m).setTab(n);g.settingEl.toggleClass("thino-activation-setting",!0),g.nameEl.toggleClass("thino-activation-title",!0),this.root=hs.createRoot(p),this.root.render(y.jsx(Sl,{store:Ee,context:wt,children:y.jsx(hK,{plugin:this.plugin})}));let w=!1;new Ke(r,this).setName(k("Deactivate")).setTab(n).addButton(S=>{S.setWarning().setButtonText(k("Remove")).onClick(async()=>{var A;if(!w){S.setButtonText(k("Confirm?")),w=!0;return}w=!1;const T=!x.Platform.isDesktop&&await((A=window.Capacitor)==null?void 0:A.Plugins.Device.getId()),E=x.Platform.isDesktop?await zn():T.identifier||T.uuid;this.plugin.settings.tokenForVerify[E]&&(delete this.plugin.settings.tokenForVerify[E],await this.plugin.saveSettings(),new x.Notice(k("Remove successfully"))),await this.plugin.verify(),Qe.setRefresh(!0),setTimeout(()=>{this.display()},20)})})}showSyncStatus(n,r){var o;(o=this.plugin.app)!=null&&o.loadLocalStorage("tokenForSync")&&(new Ke(n,this).setName(k("Save thino type when sync local")).setDesc(k("Set the default save thino type when sync local, FILE by default.")).setTab(r).addDropdown(async s=>{s.addOption("DAILY",k("DAILY")),s.addOption("FILE",k("FILE")),s.setValue(this.plugin.settings.saveThinoType).onChange(async u=>{this.plugin.settings.saveThinoType=u,this.applySettingsUpdate()})}),new Ke(n,this).setName(k("Sync Status")).setDesc(k("Start or stop sync")).setTab(r).addButton(s=>{s.setButtonText(this.plugin.settings.startSync?k("Stop"):k("Start")).onClick(async()=>{this.plugin.settings.startSync=!this.plugin.settings.startSync,await this.plugin.saveSettings(),Qe.setRefresh(!0),new x.Notice(this.plugin.settings.startSync?k("Start sync successfully"):k("Stop sync successfully")),setTimeout(()=>{this.display()},200)})}))}addMemoSettings(n,r){new Ke(r,this).setName(k("Use Tags In Vault")).setDesc(k("Use tags in vault rather than only in Memos. False by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.UseVaultTags).onChange(async s=>{this.plugin.settings.UseVaultTags=s,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Focus on editor when open memos")).setDesc(k("Focus on editor when open memos. Focus by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.FocusOnEditor).onChange(async s=>{this.plugin.settings.FocusOnEditor=s,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Open daily memos with open memos")).setDesc(k("Open daily memos with open memos. Open by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.OpenDailyMemosWithMemos).onChange(async s=>{this.plugin.settings.OpenDailyMemosWithMemos=s,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Open Memos when obsidian opens")).setDesc(k("When enable this, Memos will open when Obsidian opens. False by default.")).setTab(n).addDropdown(o=>{o.addOption("Desktop","Desktop"),o.addOption("Mobile","Mobile"),o.addOption("All","All"),o.setValue(this.plugin.settings.MobileAndDesktop).onChange(async s=>{this.plugin.settings.MobileAndDesktop=s,this.applySettingsUpdate()})}).addToggle(o=>o.setValue(this.plugin.settings.OpenMemosAutomatically).onChange(async s=>{this.plugin.settings.OpenMemosAutomatically=s,this.applySettingsUpdate()}));let a;new Ke(r,this).setName(k("Default prefix")).setDesc(k("Set the default prefix when create memo, 'List' by default.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("List",k("List")),a.addOption("Task",k("Task")),a.setValue(this.plugin.settings.DefaultPrefix).onChange(async s=>{this.plugin.settings.DefaultPrefix=s,this.applySettingsUpdate()})}),new Ke(r,this).setName(k("Default insert date format")).setDesc(k("Set the default date format when insert date by @, 'Tasks' by default.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("Tasks","Tasks"),a.addOption("Dataview","Dataview"),a.setValue(this.plugin.settings.InsertDateFormat).onChange(async s=>{this.plugin.settings.InsertDateFormat=s,this.applySettingsUpdate()})})}addThinoProSettings(n,r,a){new Ke(r,this).setHeading().setTab(n).setName(k("Pro Features")),new Ke(r,this).setName(k("Add tag automatically")).setDesc(k("Add tag to the end or beginning of the thino content when creating a thino and filtering tags")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.addTagAutomatically).onChange(async s=>{if(!a){fn();return}this.plugin.settings.addTagAutomatically=s,this.applySettingsUpdate(),this.debounceDisplay()})),this.plugin.settings.addTagAutomatically&&(new Ke(r,this).setName(k("Add tag position")).setDesc(k("Set the position of the tag when adding tag automatically")).setTab(n).addDropdown(async o=>{o.addOption("End",k("End")),o.addOption("Beginning",k("Beginning")),o.setValue(this.plugin.settings.addTagPosition).onChange(async s=>{this.plugin.settings.addTagPosition=s,this.applySettingsUpdate()})}),new Ke(r,this).setName(k("Add tag with new line")).setDesc(k("Add tag with new line when adding tag automatically")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.addTagWithNewline).onChange(async s=>{this.plugin.settings.addTagWithNewline=s,this.applySettingsUpdate()})))}memosCommentSettings(n,r){new Ke(r,this).setName(k("Allow Comments On Memos")).setDesc(k("You can comment on memos. False by default")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.CommentOnMemos).onChange(async o=>{this.plugin.settings.CommentOnMemos=o,this.applySettingsUpdate(),this.display()})),this.plugin.settings.CommentOnMemos&&(new Ke(r,this).setName(k("Always Show Memo Comments")).setDesc(k("Always show memo comments on memos. False by default")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.ShowCommentOnMemos).onChange(async o=>{this.plugin.settings.ShowCommentOnMemos=o,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Comments In Original DailyNotes/Notes")).setDesc(k("You should install Dataview Plugin ver 0.5.9 or later to use this feature.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.CommentsInOriginalNotes).onChange(async o=>{this.plugin.settings.CommentsInOriginalNotes=o,this.applySettingsUpdate()})))}copyMemosSettings(n,r){new Ke(r,this).setName(k("Show Time When Copy Results")).setDesc(k("Show time when you copy results, like 12:00. Copy time by default.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.ShowTime).onChange(async o=>{this.plugin.settings.ShowTime=o,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Show Date When Copy Results")).setDesc(k("Show date when you copy results, like [[2022-01-01]]. Copy date by default.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.ShowDate).onChange(async o=>{this.plugin.settings.ShowDate=o,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Add Blank Line Between Different Date")).setDesc(k("Add blank line when copy result with date. No blank line by default.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.AddBlankLineWhenDate).onChange(async o=>{this.plugin.settings.AddBlankLineWhenDate=o,this.applySettingsUpdate()}))}shareMemosSettings(n,r){new Ke(r,this).setName(k("Save Shared Image To Folder For Mobile")).setDesc(k("Save image to folder for mobile. False by Default")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.AutoSaveWhenOnMobile).onChange(async o=>{this.plugin.settings.AutoSaveWhenOnMobile=o,this.applySettingsUpdate()})),this.customMemoFooter(n,r),new Ke(r,this).setName(k("Custom Background Image")).setDesc(k("Set custom background image.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.SetCustomBackgroundImage).onChange(async o=>{this.plugin.settings.SetCustomBackgroundImage=o,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.SetCustomBackgroundImage&&(new Ke(r,this).setName(k("Background Image in Light Theme")).setDesc(k('Set background image in light theme. Set something like "Daily/one.png"')).setTab(n).addText(a=>{new F2(a.inputEl),a.setPlaceholder(Oo.DefaultLightBackgroundImage).setValue(this.plugin.settings.DefaultLightBackgroundImage).onChange(async o=>{this.plugin.settings.DefaultLightBackgroundImage=o,this.applySettingsUpdate()})}),new Ke(r,this).setName(k("Background Image in Dark Theme")).setDesc(k('Set background image in dark theme. Set something like "Daily/one.png"')).setTab(n).addText(a=>{new F2(a.inputEl),a.setPlaceholder(Oo.DefaultDarkBackgroundImage).setValue(this.plugin.settings.DefaultDarkBackgroundImage).onChange(async o=>{this.plugin.settings.DefaultDarkBackgroundImage=o,this.applySettingsUpdate()})}))}customMemoFooter(n,r){new Ke(r,this).setName(k("Custom Memo Footer")).setDesc(k("Set custom memo footer.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.SetCustomMemoFooter).onChange(async o=>{this.plugin.settings.SetCustomMemoFooter=o,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.SetCustomMemoFooter&&(new Ke(r,this).setName(k("Share Memos Image Footer Start")).setDesc(k("Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default")).setTab(n).addText(a=>a.setPlaceholder(Oo.ShareFooterStart).setValue(this.plugin.settings.ShareFooterStart).onChange(async o=>{this.plugin.settings.ShareFooterStart=o,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Share Memos Image Footer End")).setDesc(k("Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default")).setTab(n).addText(a=>a.setPlaceholder(Oo.ShareFooterEnd).setValue(this.plugin.settings.ShareFooterEnd).onChange(async o=>{this.plugin.settings.ShareFooterEnd=o,this.applySettingsUpdate()})))}saveDataSettings(n,r){new Ke(r,this).setName(k("Default Memo Composition")).setDesc(k('Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default')).setTab(n).addText(o=>o.setPlaceholder(Oo.DefaultMemoComposition).setValue(this.plugin.settings.DefaultMemoComposition).setDisabled(!0).onChange(async s=>{this.plugin.settings.DefaultMemoComposition=s,this.applySettingsUpdate()}));let a;new Ke(r,this).setName(k("Default Editor Mode")).setDesc(k("Live-Preview Mode OR Source Mode.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("obsidian",k("Live-preview")),a.addOption("memos",k("Source")),a.setValue(this.plugin.settings.EditorType).onChange(async s=>{this.plugin.settings.EditorType=s,this.applySettingsUpdate()})}),new Ke(r,this).setName(k("Delete Thino Directly")).setDesc(k("When delete thino directly, it will not be moved to trash. False by default.")).setTab(n).addToggle(o=>{o.setValue(this.plugin.settings.DeleteThinoDirectly).onChange(async s=>{this.plugin.settings.DeleteThinoDirectly=s,this.applySettingsUpdate()})})}async initHttpServer(n,r){var d;const a=rt.getState().verifyState,o=!x.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=x.Platform.isDesktop?await zn():o.identifier||o.uuid,u=a&&(a==null?void 0:a.appId)===s;new Ke(n,this).setName(k("Enable Local Http Server")).setTab(r).setDisabled(!u).addToggle(m=>m.setValue(this.plugin.settings.EnabledHttpApi).onChange(async p=>{if(!u){fn();return}this.plugin.settings.EnabledHttpApi=p,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.settings.EnabledHttpApi?this.plugin.initServer():this.plugin.stopServer(),this.display()},100)})),this.plugin.settings.EnabledHttpApi&&(new Ke(n,this).setName(k("Memos Http Server Port")).setDesc(k("Set memos http server port to listen. '43999' by default")).setTab(r).addText(m=>m.setPlaceholder(Oo.HttpApiPort).setValue(this.plugin.settings.HttpApiPort).onChange(async p=>{if(!u){fn();return}this.plugin.settings.HttpApiPort=p,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})),new Ke(n,this).setName(k("Auto Download Image")).setDesc(k("Auto download image when save to thino. 'false' by default")).setTab(r).setDisabled(!u).addToggle(m=>{m.setValue(this.plugin.settings.AutoDownloadImage).onChange(async p=>{if(!u){fn();return}this.plugin.settings.AutoDownloadImage=p,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})}),new Ke(n,this).setName(k("Thino Http IP Type")).setDesc(k("Set Thino http server ip to listen. 'localhost' by default")).setTab(r).addDropdown(m=>{m.addOption("localhost","localhost"),m.addOption("127.0.0.1","127.0.0.1"),m.setValue(this.plugin.settings.HttpApiIpType).onChange(async p=>{if(!a||(a==null?void 0:a.appId)!==s){fn();return}this.plugin.settings.HttpApiIpType=p,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})}))}fetchDataSettings(n,r){let a;new Ke(r,this).setName(k("Use which plugin's default configuration")).setDesc(k("Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("Daily",k("Daily")),a.addOption("Periodic","Periodic"),a.setValue(this.plugin.settings.UseDailyOrPeriodic).onChange(async s=>{this.plugin.settings.UseDailyOrPeriodic=s,this.applySettingsUpdate()})})}navigationSettings(n,r){new Ke(r,this).setName(k("Allow navigation from view to Thino or Thino to view")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.navigation).onChange(async o=>{this.plugin.settings.navigation=o,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Need password to unlock Thino")).setTab(n).addToggle(a=>{this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched&&(a.toggleEl.onclick=o=>{this.passwordMatched||(o.preventDefault(),new L2(this.app,this,this.plugin,s=>{a.setDisabled(!s),this.passwordMatched=s,this.debounceDisplay()}).open(),new x.Notice(k("Please input your password to change password settings")))}),a.setDisabled(this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched).setValue(this.plugin.settings.needVerify).onChange(async o=>{this.plugin.settings.needVerify=o,o&&(this.passwordMatched=!1),this.applySettingsUpdate(),this.debounceDisplay()})}),this.plugin.settings.needVerify&&new Ke(r,this).setName(k("Password to lock Thino")).setTab(n).addText(a=>{this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched&&(a.inputEl.onclick=o=>{this.passwordMatched||(o.preventDefault(),new L2(this.app,this,this.plugin,s=>{a.inputEl.readOnly=!s,this.passwordMatched=s,this.debounceDisplay()}).open(),new x.Notice(k("Please input your password to change password settings")))}),a.inputEl.readOnly=this.plugin.settings.password&&this.plugin.settings.needVerify&&!this.passwordMatched,a.inputEl.oncopy=()=>!1,a.inputEl.type="password",a.setValue(this.plugin.settings.password).onChange(async o=>{this.plugin.settings.password=o,this.applySettingsUpdate()})})}setGlobalSettings(n,r,a){new Ke(r,this).setHeading().setTab(n).setName(k("Pro Features")),new Ke(r,this).setName(k("Default save location")).setDesc(k('Set the default save location for thino. "DAILY" by default')).setTab(n).addDropdown(async o=>{for(const s of this.plugin.settings.EnabledLocationList)o.addOption(s.value,k(s.value));o.setValue(this.plugin.settings.MemoSaveLocation||this.plugin.settings.EnabledLocationList[0].value).onChange(async s=>{if(!a){fn();return}this.plugin.settings.MemoSaveLocation=s,this.applySettingsUpdate()})}),this.initHttpServer(r,n),new Ke(r,this).setName(k("Enable opening thino globally")).setDesc(k("Enable opening thino globally. False by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.CaptureKey.EnableCaptureKey).onChange(async s=>{if(!a){fn();return}this.plugin.settings.CaptureKey.EnableCaptureKey=s,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.CaptureKey.EnableCaptureKey&&(new Ke(r,this).setName(k("Key for opening thino globally")).setDesc(k("Set key for opening thino globally. CTRL + SHIFT + T by default.")).setTab(n).addText(o=>o.setPlaceholder(Oo.CaptureKey.OpenThinoGlobally).setValue(this.plugin.settings.CaptureKey.OpenThinoGlobally).onChange(async s=>{if(!a){fn();return}this.plugin.settings.CaptureKey.OpenThinoGlobally=s,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Show thino near mouse")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.CaptureKey.ShowNearMouse).onChange(async s=>{if(!a){fn();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,a){var d;const o=document.createDocumentFragment(),s=o.createEl("div",{cls:"memo-save-location-desc"});for(const m of fC){const p=s.createEl("div",{cls:`memo-save-location-desc-item ${m.value}`}),g=p.createEl("span",{cls:"memo-save-location-desc-item-icon"});x.setIcon(g,((d=Md.find(E=>E.title===m.value))==null?void 0:d.icon)||""),p.createEl("span",{cls:"memo-save-location-desc-item-desc",text:`${k(m.value)}`});const w=p.createEl("span",{cls:"memo-save-location-desc-item-toggle"}),D=p.createEl("span",{cls:"memo-save-location-desc-item-setting"});m.value!=="DAILY"&&p.createEl("span",{cls:["memo-save-location-desc-item-pro","user-pro-badge"],text:"PRO"}),new x.ToggleComponent(w).setValue(this.checkInList(m.value)).onChange(async E=>{if(!a){fn();return}E?(await Ie.updateTypeMemos(m.value),this.plugin.settings.EnabledLocationList=[...this.plugin.settings.EnabledLocationList,m]):(await Ie.removeTypeMemos(m.value),this.plugin.settings.EnabledLocationList=this.plugin.settings.EnabledLocationList.filter(A=>A.value!==m.value)),this.plugin.settings.EnabledLocationList.length===1&&(this.plugin.settings.MemoSaveLocation=m.value),this.applySettingsUpdate(),setTimeout(()=>{this.display()},500)}).setDisabled(this.plugin.settings.EnabledLocationList.length===1&&this.checkInList(m.value)),new x.ExtraButtonComponent(D).setIcon("settings").onClick(()=>{new pK(this.app,this,this.plugin,m,a).open()})}const u=new Ke(r,this).setName(k("Save Location for Memos")).setDesc(o).setTab(n);u.settingEl.toggleClass("memo-save-location-setting",!0),u.nameEl.toggleClass("memo-save-location-title",!0)}}class pK extends x.Modal{constructor(n,r,a,o,s){super(n);he(this,"plugin");he(this,"settingTab");he(this,"LocationList");he(this,"target","");he(this,"insertTarget","");he(this,"verified");he(this,"updateValue",x.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=a,this.LocationList=o,this.target=o.target!=="ProcessEntriesBelow"?a.settings.MemoOtherSaveLocation[o.target]:a.settings[o.target],this.insertTarget=a.settings.InsertAfter}onOpen(){var p;const{contentEl:n}=this;(p=n.parentElement)==null||p.classList.add("memo-save-location-modal"),this.titleEl.toggleClass("modal-title",!0),this.titleEl.setText(k("Save Location for Memos")+` [${k(this.LocationList.value)}]`),(this.LocationList.value==="FILE"||this.LocationList.value==="CANVAS")&&n.createDiv("modal-desc",g=>{g.setText(k('You can set folder name with file name like "folder/file"'))}),this.LocationList.value==="MULTI"&&n.createDiv("modal-desc",g=>{g.setText(k('You can set folder name like "folder1/folder2/folder3" to create sub-folder'))}),this.LocationList.value==="DAILY"&&n.createDiv("modal-desc",g=>{g.setText(k('You can set target heading like "# Heading" to control data location'))});const r=n.createDiv("modal-setting"),a=this.LocationList.value==="DAILY"?k("Process Memos below"):this.LocationList.value==="MULTI"?k("Set the folder name"):k("Set the filename"),o=k("Insert after heading");this.LocationList.value==="DAILY"&&new Ke(r,this.settingTab).setName(o).setDesc(k("If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.")).addText(g=>g.setPlaceholder(k("# Heading")).setValue(this.insertTarget).onChange(async w=>{this.insertTarget=w}));const s=new Ke(r,this.settingTab).setName(a).addText(g=>g.setPlaceholder(this.LocationList.value==="DAILY"?k("# Heading"):k("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 D=this.LocationList.value==="CANVAS"?".thino.canvas":this.LocationList.value==="FILE"?".thino.md":"";this.updateValue(w.replace(/\.thino\.(canvas|md)/g,"")+D)}));this.LocationList.value==="DAILY"&&s.setDesc(k("If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.")),this.LocationList.value!=="DAILY"&&this.LocationList.value!=="MULTI"&&s.controlEl.createEl("span",{text:`${this.LocationList.value==="FILE"?".thino.md":".thino.canvas"}`});const u=n.createDiv("button-group"),d=u.createEl("button",{text:k("Cancel")}),m=u.createEl("button",{text:k("Save")});m.onclick=async()=>{if(!this.verified&&this.LocationList.value!=="DAILY"){this.close(),fn();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(()=>{Ie.updateTypeMemos(this.LocationList.value)},1e3),this.close()},d.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}class L2 extends x.Modal{constructor(n,r,a,o){super(n);he(this,"plugin");he(this,"settingTab");this.cb=o,this.app=n,this.settingTab=r,this.plugin=a}onOpen(){var d;const{contentEl:n}=this;(d=n.parentElement)==null||d.classList.add("memo-save-location-modal"),this.titleEl.toggleClass("modal-title",!0),this.titleEl.setText(k("Password for Thino")),n.createDiv("modal-desc",m=>{m.setText(k("Please input your password to change password settings"))});const r=n.createDiv("modal-setting"),a=new Ke(r,this.settingTab).setName(k("Password")).addText(m=>m.setPlaceholder(k("Please input your password")).inputEl.type="password"),o=n.createDiv("button-group"),s=o.createEl("button",{text:k("Cancel")}),u=o.createEl("button",{text:k("Confirm?").replace(/(\?|)/g,"")});u.onclick=async()=>{var m;a.controlEl.querySelector("input").value===this.plugin.settings.password?((m=this.cb)==null||m.call(this,!0),this.close()):new x.Notice(k("Password is incorrect"))},s.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}const gK=e=>{const{app:t,view:n}=Ee.getState().dailyNotesState,{memo:r}=e,a={...r,createdAtStr:Re.getDateTimeString(r.createdAt),timeStr:Re.getTimeString(r.createdAt)},o=q.useRef(null),s=q.useRef(null);O.useEffect(()=>{if(!s.current||!o.current||(s.current.hasChildNodes()&&s.current.children[0].detach(),!n))return;async function g(){var D;await x.MarkdownRenderer.render(t,r.content+`
`,s.current,r.path,n);const w=(D=s.current)==null?void 0:D.querySelectorAll(".internal-link");w==null||w.forEach(S=>{const T=S,E=T.getAttribute("data-href");if(!E)return;t.metadataCache.getFirstLinkpathDest(E,r.path)||S.classList.add("is-unresolved"),T.addEventListener("mouseover",N=>{N.stopPropagation(),t.workspace.trigger("hover-link",{event:N,source:"thino",hoverParent:n.containerEl,targetEl:T,linktext:E,sourcePath:T.href})})})}g()},[e.memo.content]);const u=()=>{e.onClickThino&&e.onClickThino(a)},d=async(g,w,D)=>{var E;const S=((E=D.parentElement.dataset)==null?void 0:E.task)==="x"?"DONE":"TODO",T=[...(w==null?void 0:w.querySelectorAll("li.task-list-item"))||[]];for(const A of T)if(A===D||A===D.closest("li.task-list-item")){const N=T.indexOf(A),R=g.content.split(/\n/),F=[];for(let U=0;U<R.length;U++)(R[U].trim().startsWith("- [ ]")||R[U].trim().startsWith("- [x]"))&&F.push(U);const H=F[N],L=R[H].replace(/- \[ \] |- \[x\] /g,S==="TODO"?"- [x] ":"- [ ] ");R[H]=L;const z=R.join(`
`).trim();if(g&&g.content!==z){const U=await Ie.updateMemo(g.id,z);Ie.editMemo(U)}}},m=async g=>{g.preventDefault();const w=g.target;if(w.tagName==="INPUT"&&w.hasClass("task-list-item-checkbox")){await d(a,o.current,w);return}};return O.useMemo(()=>y.jsxs("div",{ref:o,className:"daily-memo-wrapper",children:[y.jsx("div",{className:"time-wrapper",onClick:u,children:y.jsx("span",{className:"normal-text",children:a.timeStr})}),y.jsx("div",{className:"memo-content-container",children:y.jsx("div",{ref:s,onClick:m,className:"memo-content-text"})})]}),[r.content])},vK=e=>{const{memoState:{memos:t}}=O.useContext(wt),n=Yc(),[r,a]=O.useState([]),[o,s]=O.useState(Re.getDateStampByDate(Re.getDateString(e.currentDateStamp))),[u,d]=_o(!1),m=O.useRef(null),p=new Date(o),{vault:g}=Ee.getState().dailyNotesState.app,w=Ee.getState().dailyNotesState.settings,[D,S]=O.useState("");O.useEffect(()=>{(()=>{const R=t.filter(F=>Re.getTimeStampByDate(F.createdAt)>=o&&Re.getTimeStampByDate(F.createdAt)<o+Ba).filter(F=>F.deletedAt==="").sort((F,H)=>Re.getTimeStampByDate(F.createdAt)-Re.getTimeStampByDate(H.createdAt));a(R),n.setFinish()})()},[o,t]);const T=async()=>{d(!1),setTimeout(()=>{m.current&&Uv(m.current,{backgroundColor:"#ffffff",pixelRatio:window.devicePixelRatio*2}).then(N=>{if(w!=null&&w.AutoSaveWhenOnMobile&&x.Platform.isMobile){const R=N.split("base64,")[1];Av(R,"image/png").arrayBuffer().then(async H=>{let P;const L="png",z=ws();for(const U in z)if(z[U]instanceof x.TFile){P=z[U];break}P!==void 0&&await g.createBinary(await g.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,L,P),H)})}Vv({imgUrl:N})}).catch(()=>{})},0)},E=N=>{s(N),d(!1)},A=O.useMemo(()=>y.jsxs("div",{className:"header-wrapper",children:[y.jsx("span",{className:"title-text",children:k("Daily Memos")}),y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"chevron-left")},className:"btn btn-text",onClick:()=>s(N=>N-Ba)}),y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"chevron-right")},className:"btn btn-text",onClick:()=>s(N=>N+Ba)}),y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"share")},className:"btn btn-text share-btn",onClick:T}),y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"x")},className:"btn btn-text",onClick:()=>e.destroy()})]})]}),[]);return y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"dialog-header-container",children:A}),y.jsx("div",{className:"dialog-header-container",children:y.jsx("input",{onChange:N=>S(N.target.value),value:D,placeholder:k("Search")})}),y.jsxs("div",{className:"dialog-content-container",ref:m,children:[y.jsxs("div",{className:"date-card-container",onClick:()=>d(),children:[y.jsx("div",{className:"year-text",children:p.getFullYear()}),y.jsxs("div",{className:"date-container",children:[y.jsx("div",{className:"month-text",children:k("months")[p.getMonth()]}),y.jsx("div",{className:"date-text",children:p.getDate()}),y.jsx("div",{className:"day-text",children:k("weekDays")[p.getDay()]})]})]}),y.jsx(Nm,{className:`date-picker ${u?"":"hidden"}`,datestamp:o,handleDateStampChange:E}),n.isLoading?y.jsx("div",{className:"tip-container",children:y.jsx("span",{className:"tip-text",children:k("Loading...")})}):r.length===0?y.jsx("div",{className:"tip-container",children:y.jsx("span",{className:"tip-text",children:k("Noooop!")})}):y.jsx("div",{className:"dailymemos-wrapper",children:r.filter(N=>N.content.toLowerCase().includes(D.toLowerCase())).map(N=>y.jsx(gK,{memo:N,onClickThino:R=>{e.destroy(),Gd(R)}},`${N.id}-${N.updatedAt}`))})]})]})};function aw(e=Date.now()){xm({className:"daily-memo-diary-dialog"},vK,{currentDateStamp:e})}function uy(e){return e.split("-")[0]}function hC(e){return e.split("-")[1]}function db(e){return["top","bottom"].includes(uy(e))?"x":"y"}function mC(e){return e==="y"?"height":"width"}function R2(e){let{reference:t,floating:n,placement:r}=e;const a=t.x+t.width/2-n.width/2,o=t.y+t.height/2-n.height/2;let s;switch(uy(r)){case"top":s={x:a,y:t.y-n.height};break;case"bottom":s={x:a,y:t.y+t.height};break;case"right":s={x:t.x+t.width,y:o};break;case"left":s={x:t.x-n.width,y:o};break;default:s={x:t.x,y:t.y}}const u=db(r),d=mC(u);switch(hC(r)){case"start":s[u]=s[u]-(t[d]/2-n[d]/2);break;case"end":s[u]=s[u]+(t[d]/2-n[d]/2);break}return s}const yK=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:s}=n;let u=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:m}=R2({...u,placement:r}),p=r,g={};for(let w=0;w<o.length;w++){const{name:D,fn:S}=o[w],{x:T,y:E,data:A,reset:N}=await S({x:d,y:m,initialPlacement:r,placement:p,strategy:a,middlewareData:g,rects:u,platform:s,elements:{reference:e,floating:t}});if(d=T??d,m=E??m,g={...g,[D]:A??{}},N){typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(u=N.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):N.rects),{x:d,y:m}=R2({...u,placement:p})),w=-1;continue}}return{x:d,y:m,placement:p,strategy:a,middlewareData:g}};function wK(e){return{top:0,right:0,bottom:0,left:0,...e}}function bK(e){return typeof e!="number"?wK(e):{top:e,right:e,bottom:e,left:e}}function Qw(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Xw(e,t){t===void 0&&(t={});const{x:n,y:r,platform:a,rects:o,elements:s,strategy:u}=e,{boundary:d="clippingParents",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:g=!1,padding:w=0}=t,D=bK(w),T=s[g?p==="floating"?"reference":"floating":p],E=await a.getClippingClientRect({element:await a.isElement(T)?T:T.contextElement||await a.getDocumentElement({element:s.floating}),boundary:d,rootBoundary:m}),A=Qw(await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:p==="floating"?{...o.floating,x:n,y:r}:o.reference,offsetParent:await a.getOffsetParent({element:s.floating}),strategy:u}));return{top:E.top-A.top+D.top,bottom:A.bottom-E.bottom+D.bottom,left:E.left-A.left+D.left,right:A.right-E.right+D.right}}const DK={left:"right",right:"left",bottom:"top",top:"bottom"};function Cv(e){return e.replace(/left|right|bottom|top/g,t=>DK[t])}function SK(e,t){const n=hC(e)==="start",r=db(e),a=mC(r);let o=r==="x"?n?"right":"left":n?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Cv(o)),{main:o,cross:Cv(o)}}const IK={start:"end",end:"start"};function _2(e){return e.replace(/start|end/g,t=>IK[t])}function TK(e){const t=Cv(e);return[_2(e),t,_2(t)]}const EK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:s,initialPlacement:u}=t;if((n=o.flip)!=null&&n.skip)return{};const{mainAxis:d=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",flipAlignment:w=!0,...D}=e,S=uy(a),E=p||(S===u||!w?[Cv(u)]:TK(u)),A=[u,...E],N=await Xw(t,D),R=[];let F=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&R.push(N[S]),m){const{main:z,cross:U}=SK(a,s);R.push(N[z],N[U])}if(F=[...F,{placement:a,overflows:R}],!R.every(z=>z<=0)){var H,P;const z=((H=(P=o.flip)==null?void 0:P.index)!=null?H:0)+1,U=A[z];if(U)return{data:{index:z,overflows:F},reset:{placement:U}};let W="bottom";switch(g){case"bestFit":{var L;const K=(L=F.slice().sort((ae,ce)=>ae.overflows.filter(fe=>fe>0).reduce((fe,ie)=>fe+ie,0)-ce.overflows.filter(fe=>fe>0).reduce((fe,ie)=>fe+ie,0))[0])==null?void 0:L.placement;K&&(W=K);break}case"initialPlacement":W=u;break}return{data:{skip:!0},reset:{placement:W}}}return{}}}};function xK(e){let{placement:t,rects:n,value:r}=e;const a=uy(t),o=["left","top"].includes(a)?-1:1,s=typeof r=="function"?r({...n,placement:t}):r,{mainAxis:u,crossAxis:d}=typeof s=="number"?{mainAxis:s,crossAxis:0}:{mainAxis:0,crossAxis:0,...s};return db(a)==="x"?{x:d,y:u*o}:{x:u*o,y:d}}const CK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(t){const{x:n,y:r,placement:a,rects:o}=t,s=xK({placement:a,rects:o,value:e});return{x:n+s.x,y:r+s.y,data:s}}}};function fb(e){return(e==null?void 0:e.toString())==="[object Window]"}function Cl(e){if(e==null)return window;if(!fb(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function dy(e){return Cl(e).getComputedStyle(e)}function vs(e){return fb(e)?"":e?(e.nodeName||"").toLowerCase():""}function ys(e){return e instanceof Cl(e).HTMLElement}function Mv(e){return e instanceof Cl(e).Element}function MK(e){return e instanceof Cl(e).Node}function pC(e){const t=Cl(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function fy(e){const{overflow:t,overflowX:n,overflowY:r}=dy(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function NK(e){return["table","td","th"].includes(vs(e))}function gC(e){const t=navigator.userAgent.toLowerCase().includes("firefox"),n=dy(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 H2=Math.min,Kh=Math.max,Nv=Math.round;function Rd(e,t){t===void 0&&(t=!1);const n=e.getBoundingClientRect();let r=1,a=1;return t&&ys(e)&&(r=e.offsetWidth>0&&Nv(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Nv(n.height)/e.offsetHeight||1),{width:n.width/r,height:n.height/a,top:n.top/a,right:n.right/r,bottom:n.bottom/a,left:n.left/r,x:n.left/r,y:n.top/a}}function Ml(e){return((MK(e)?e.ownerDocument:e.document)||window.document).documentElement}function hy(e){return fb(e)?{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}:{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function vC(e){return Rd(Ml(e)).left+hy(e).scrollLeft}function kK(e){const t=Rd(e);return Nv(t.width)!==e.offsetWidth||Nv(t.height)!==e.offsetHeight}function AK(e,t,n){const r=ys(t),a=Ml(t),o=Rd(e,r&&kK(t));let s={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((vs(t)!=="body"||fy(a))&&(s=hy(t)),ys(t)){const d=Rd(t,!0);u.x=d.x+t.clientLeft,u.y=d.y+t.clientTop}else a&&(u.x=vC(a));return{x:o.left+s.scrollLeft-u.x,y:o.top+s.scrollTop-u.y,width:o.width,height:o.height}}function my(e){return vs(e)==="html"?e:e.assignedSlot||e.parentNode||(pC(e)?e.host:null)||Ml(e)}function B2(e){return!ys(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function OK(e){let t=my(e);for(;ys(t)&&!["html","body"].includes(vs(t));){if(gC(t))return t;t=t.parentNode}return null}function e1(e){const t=Cl(e);let n=B2(e);for(;n&&NK(n)&&getComputedStyle(n).position==="static";)n=B2(n);return n&&(vs(n)==="html"||vs(n)==="body"&&getComputedStyle(n).position==="static"&&!gC(n))?t:n||OK(e)||t}function Y2(e){return{width:e.offsetWidth,height:e.offsetHeight}}function FK(e){let{rect:t,offsetParent:n,strategy:r}=e;const a=ys(n),o=Ml(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if((a||!a&&r!=="fixed")&&((vs(n)!=="body"||fy(o))&&(s=hy(n)),ys(n))){const d=Rd(n,!0);u.x=d.x+n.clientLeft,u.y=d.y+n.clientTop}return{...t,x:t.x-s.scrollLeft+u.x,y:t.y-s.scrollTop+u.y}}function PK(e){const t=Cl(e),n=Ml(e),r=t.visualViewport;let a=n.clientWidth,o=n.clientHeight,s=0,u=0;return r&&(a=r.width,o=r.height,Math.abs(t.innerWidth/r.scale-r.width)<.01&&(s=r.offsetLeft,u=r.offsetTop)),{width:a,height:o,x:s,y:u}}function jK(e){var t;const n=Ml(e),r=hy(e),a=(t=e.ownerDocument)==null?void 0:t.body,o=Kh(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Kh(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0);let u=-r.scrollLeft+vC(e);const d=-r.scrollTop;return dy(a||n).direction==="rtl"&&(u+=Kh(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:s,x:u,y:d}}function yC(e){return["html","body","#document"].includes(vs(e))?e.ownerDocument.body:ys(e)&&fy(e)?e:yC(my(e))}function wC(e,t){var n;t===void 0&&(t=[]);const r=yC(e),a=r===((n=e.ownerDocument)==null?void 0:n.body),o=Cl(r),s=a?[o].concat(o.visualViewport||[],fy(r)?r:[]):r,u=t.concat(s);return a?u:u.concat(wC(my(s)))}function LK(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&pC(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function RK(e){const t=Rd(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 z2(e,t){return t==="viewport"?Qw(PK(e)):Mv(t)?RK(t):Qw(jK(Ml(e)))}function _K(e){const t=wC(my(e)),r=["absolute","fixed"].includes(dy(e).position)&&ys(e)?e1(e):e;return Mv(r)?t.filter(a=>Mv(a)&&LK(a,r)&&vs(a)!=="body"):[]}function HK(e){let{element:t,boundary:n,rootBoundary:r}=e;const o=[...n==="clippingParents"?_K(t):[].concat(n),r],s=o[0],u=o.reduce((d,m)=>{const p=z2(t,m);return d.top=Kh(p.top,d.top),d.right=H2(p.right,d.right),d.bottom=H2(p.bottom,d.bottom),d.left=Kh(p.left,d.left),d},z2(t,s));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}const BK={getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:AK(t,e1(n),r),floating:{...Y2(n),x:0,y:0}}},convertOffsetParentRelativeRectToViewportRelativeRect:e=>FK(e),getOffsetParent:e=>{let{element:t}=e;return e1(t)},isElement:e=>Mv(e),getDocumentElement:e=>{let{element:t}=e;return Ml(t)},getClippingClientRect:e=>HK(e),getDimensions:e=>{let{element:t}=e;return Y2(t)},getClientRects:e=>{let{element:t}=e;return t.getClientRects()}},YK=(e,t,n)=>yK(e,t,{platform:BK,...n});var zK=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,a,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!e(t[a],n[a]))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(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[a]))return!1;for(a=r;a--!==0;){var s=o[a];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n};const UK=Xn(zK),ow=Qh.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}}}),bC=e=>e.split("-")[0],VK=e=>e==="x"?"y":"x",ZK=e=>["top","bottom"].includes(bC(e))?"x":"y",Hh=(e,t,n)=>Math.max(e,Math.min(t,n)),WK=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r],a)=>[n,t(r,n,a)])),$K=e=>e===void 0?e:typeof e=="number"?-e:WK(e,t=>t!==void 0?-t:t),GK=(e={})=>({name:"shift",fn:async t=>{const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:u=({x:E,y:A})=>({x:E,y:A}),editorMenu:d,...m}=e,p={x:n,y:r},g=await Xw(t,m),w=ZK(bC(a)),D=VK(w);let S=p[w],T=p[D];if(o){const E=w==="y"?"top":"left",A=w==="y"?"bottom":"right",N=S+g[E],R=S-g[A];if(d){const F=await Xw(t,{...m,boundary:d.dom,padding:$K(m.padding)});if((D==="y"?["top","bottom"]:["left","right"]).every(P=>F[P]<=0)){const P=t.rects.floating.width,L=S+F[E]-P,z=S-F[A]+P,U=Math.abs(g[E]-F[E]),W=Math.abs(g[A]-F[A]);U>=P||W<U?S=Hh(N,S,L):S=Hh(z,S,R)}else S=Hh(N,S,R)}else S=Hh(N,S,R)}if(s){const E=D==="y"?"top":"left",A=D==="y"?"bottom":"right",N=T+g[E],R=T-g[A];T=Hh(N,T,R)}return u({...t,[w]:S,[D]:T})}}),qK="thino-mini-toolbar",JK=(e=0,t=0)=>({width:0,height:0,top:t,left:e,bottom:t,right:e,x:e,y:t}),KK=(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),a=Math.max(e.bottom,(t==null?void 0:t.bottom)??e.bottom)-Math.min(e.top,(t==null?void 0:t.top)??e.top),o=Math.min(e.top,(t==null?void 0:t.top)??e.top),s=o+a,u={left:n,right:r,top:o,bottom:s,width:0,height:a,x:o,y:n};return t&&(u.width=Math.abs(r-n)),u},QK=JK();class XK{constructor(t){he(this,"containerEl");he(this,"virtualEl");he(this,"toolbar",null);he(this,"isThinoView");he(this,"tooltipInfo");he(this,"inView",!0);he(this,"defaultPlacement");he(this,"editorMenu");he(this,"cachedRefRect",null);he(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 a=n?this.view.coordsAtPos(n):null;if(r&&a&&r.top!==a.top){const s=this.view.contentDOM.getBoundingClientRect();a={left:s.right,right:s.right,top:r.top,bottom:r.bottom}}const o=KK(r,a);o&&(this.cachedRefRect=o,this.computePosition(o))}});this.view=t,this.containerEl=this.view.dom.parentElement,this.defaultPlacement=this.view.state.facet(ow).defaultPlacement,this.tooltipInfo=t.state.facet(t1),this.virtualEl={rect:QK,getBoundingClientRect(){return this.rect}},this.maybeMeasure(),this.editorMenu={currMenu:null,evtRef:t.state.field(x.editorInfoField)},this.isThinoView=this.checkThinoView()}get workspace(){return this.view.state.field(x.editorInfoField).app.workspace}checkThinoView(){return this.view.state.field(x.editorInfoField)&&this.view.state.field(x.editorInfoField)instanceof yl}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(),!x.Platform.isMacOS&&this.tooltipInfo&&(this.createToolbar(),this.maybeMeasure()))}onEditorMenuClose(t){this.editorMenu.currMenu===t&&(this.editorMenu.currMenu=null),!x.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),a=this.view.state.field(x.editorInfoField);if(!a||!(a!=null&&a.editor))return;const o=a.editor.offsetToPos(n.start),s=n.end?a.editor.offsetToPos(n.end):o;this.workspace.trigger(qK,r,{from:o,to:s},a.editor,a),this.toolbar=r}removeToolbar(){this.toolbar&&(this.toolbar.hide(),this.toolbar=null)}update(t){if(!this.isThinoView)return;const n=t.state.facet(t1),r=n!==this.tooltipInfo&&!UK(n,this.tooltipInfo);r&&(this.tooltipInfo=n,this.shouldRemoveToolbar()?this.removeToolbar():n&&!this.toolbar&&this.createToolbar(n));const a=r||t.geometryChanged,o=t.state.facet(ow);o.defaultPlacement!=this.defaultPlacement&&(o.defaultPlacement=this.defaultPlacement),a&&this.maybeMeasure()}destroy(){this.editorMenu.currMenu=null,this.removeToolbar(),this.toolbar=null,this.view.state.field(x.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(ow),{x:r,y:a}=await YK(this.virtualEl,this.toolbar.dom,{placement:this.defaultPlacement,middleware:[CK({mainAxis:5}),EK({padding:n,boundary:this.view.scrollDOM}),GK({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(a)}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 eQ=Ci.ViewPlugin.fromClass(XK,{eventHandlers:{scroll(){this.maybeMeasure()}}}),t1=Qh.Facet.define({enables:[eQ],combine:e=>e.filter(t=>t!=null).first()??null}),tQ=e=>{const t=iQ(e);t&&window.navigator.clipboard.writeText(t==null?void 0:t.getSelection())},nQ=e=>{e.commands.executeCommandById("editor:toggle-bold",e)},rQ=e=>{e.commands.executeCommandById("editor:toggle-strikethrough",e)},aQ=e=>{e.commands.executeCommandById("editor:toggle-highlight",e)},oQ=e=>{e.commands.executeCommandById("editor:toggle-italics",e)},iQ=e=>{const{editor:t}=e.field(x.editorInfoField);return t},U2=(e,t)=>{const n=e.selection.ranges[0];if(!n)return null;const{anchor:r,head:a,empty:o}=n,[s,u]=[r,a].sort();return{start:s,end:o?void 0:u,create:m=>new uQ(m).addSmallButton(g=>g.setClass("clickable-icon").setIcon("copy").onClick(()=>tQ(e))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("bold").onClick(()=>nQ(t))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("italic").onClick(()=>oQ(t))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("strikethrough").onClick(()=>rQ(t))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("highlighter").onClick(()=>aQ(t)))}},sQ=e=>Qh.StateField.define({create:t=>U2(t,e),update:(t,n)=>!n.docChanged&&!n.selection?t:U2(n.state,e),provide:t=>t1.from(t)}),lQ=e=>[sQ(e)];class cQ extends x.BaseComponent{constructor(n){super();he(this,"button");he(this,"disabled",!1);he(this,"dropdownOptions",[]);he(this,"menu");he(this,"menuOpened",!1);this.button=new x.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"),a=this.button.buttonEl.createDiv("mini-toolbar-icon-with-text");x.setIcon(a,"chevron-down");const o=(d=n.doc.lineAt(n.selection.ranges[0].from))==null?void 0:d.from,s=y0.syntaxTree(n).resolveInner(o+1),u=s.type.prop(y0.tokenClassNodeProp);return r.setText(this.detectFormat(u,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 x.setIcon(n,"highlighter"),x.setIcon(r,"chevron-down"),this}detectFormat(n,r){var a;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 o=n.match(/header-\d{1,}/);if(o)return"Heading "+o[0].slice(-1)}if(n.contains("formatting-list")||n.contains("hmd-list-indent")){if(r!=null&&r.parent){const o=(a=r.parent)==null?void 0:a.type.prop(y0.lineClassNodeProp);if(o!=null&&o.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,u;if(this.menuOpened=!this.menuOpened,!this.menuOpened)return;this.menu=new x.Menu,this.menu.onHide(()=>{this.menuOpened=!1});const r=n.currentTarget,a=(s=n.currentTarget)==null?void 0:s.getBoundingClientRect(),o={x:a.left-6,y:a.bottom+6};for(let d=0;d<((u=this.dropdownOptions)==null?void 0:u.length);d++)this.menu.addItem(m=>{m.setIcon("zap").setTitle(this.dropdownOptions[d]).onClick(()=>{})});this.menu.setParentElement(r).showAtPosition(o)}then(n){return n(this),this}}class uQ extends x.Component{constructor(n){super();he(this,"dom");he(this,"smallBtnContainer");he(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 cQ(this.smallBtnContainer)),this}hide(){return this.unload(),this.unloading?this:(this.unloading=!0,this.dom.detach(),this.unloading=!1,this)}}const dQ=Ci.Decoration.line({attributes:{"data-ph":k("What do you think now...")},class:"thino-editor-placeholder"}),fQ=Qh.StateField.define({create(){return Ci.Decoration.none},update(e,t){const n=t.state.field(x.editorInfoField);if(!(n!=null&&n.view)&&!((n==null?void 0:n.view)instanceof yl))return e;const r=new Qh.RangeSetBuilder,a=t.state.doc.toString(),o=t.state.doc.lineAt(0);return(a==null?void 0:a.length)==0&&r.add(o.from,o.from,dQ),r.finish()},provide:e=>Ci.EditorView.decorations.from(e)});function DC(e){return`userId:${e}`}function hQ(e,t){return`expiryDate:${t}:${e}`}function mQ(e){try{const t=DC(e==null?void 0:e.appId);return Kn.get([t])[t]||""}catch(t){return console.error(t),""}}function pQ(e,t){try{const n=DC(t==null?void 0:t.appId);return Kn.set({[n]:e}),{userId:e,key:n}}catch(n){console.error(n)}}function gQ(e,t){try{const n=hQ(mQ(t),t==null?void 0:t.appId);Kn.set({[n]:e})}catch(n){console.error(n)}}const vQ=Re.grabImageFromUrl,yQ=require("http"),wQ=require("url");function bQ(e){const t=e.indexOf(";base64,"),n=e.substring(5,t),r=e.substr(t+8),a=atob(r),o=new ArrayBuffer(a.length),s=new Uint8Array(o);for(let d=0;d<a.length;d++)s[d]=a.charCodeAt(d);return new Blob([o],{type:n})}const V2=async e=>{const{type:t}=e;if(t.startsWith("image"))try{return`${await y1.upload(e)}`}catch(n){new x.Notice(n)}};function DQ(e){const t=yQ.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 a=wQ.parse(n.url,!0);if(a.pathname==="/create"&&n.method==="POST"){let o="";n.on("data",s=>{o+=s}),n.on("end",async()=>{const s=JSON.parse(o),{text:u,isList:d,type:m,imageList:p}=s;let g=u;if(!g){r.statusCode=200,r.setHeader("Content-Type","application/json"),r.end(JSON.stringify({status:"success",thino:null,link:null}));return}new RegExp(/(<([^>]+)>)/g).test(u)&&(g=x.htmlToMarkdown(u));let D=[];const S=[];if(e.AutoDownloadImage){const E=g.match(_c)||[];if(E.length>0){for(const A of E)try{const N=await vQ(A);if(N.size===0)continue;const R=new File([N],"image.png",{type:"image/png"}),F=await V2(R);S.push({oldUrl:A,newUrl:F})}catch(N){console.error(N)}S.forEach(A=>{g=g.replace(A.oldUrl,A.newUrl)}),p&&p.length>0&&(D=await Promise.all(p.map(async A=>{const N=bQ(A);return new File([N],"image.png",{type:"image/png"})})));for(const A of D){const N=await V2(A);g+=`
${N}`}}}const T=await Ie.createThino({content:g,isList:d,type:m});T&&(Ie.pushMemo(T),We.clearQuery()),r.statusCode=200,r.setHeader("Content-Type","application/json"),r.end(JSON.stringify({status:"success",thino:T,link:`obsidian://thino?openId=${T.id}`}))})}else if(a.pathname==="/search"&&n.method==="GET"){const o=a.query,{keyword:s}=o,u=Ie.getThinoViaKeyword(s);r.statusCode=200,r.setHeader("Content-Type","application/json");const d=JSON.stringify({status:"success",thinos:u});r.end(d)}else r.statusCode=404,r.end()}}catch(a){console.error(a),r.statusCode=500,r.end({status:"error",message:a.message})}});return{listen(n,r){try{t.listen({port:parseInt(r),host:n})}catch(a){console.error(a),new x.Notice(k("Thino - Failed to start HTTP server, please check the port is available."))}new x.Notice(`${k("Thino - Started HTTP server on port")} ${r}`)},close(){t.close(),new x.Notice(k("Thino - Terminated HTTP server"))}}}const{clipboard:gn}=x.Platform.isDesktop?require("electron"):"";class SQ{constructor(){he(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(a=>a===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 Dd=new SQ;let Bh=null,Z2=gn==null?void 0:gn.readText(),W2=gn==null?void 0:gn.readImage();gn&&(gn.on=(e,t)=>(Dd.on(e,t),gn),gn.once=(e,t)=>(Dd.once(e,t),gn),gn.off=(e,t)=>(t?Dd.removeListener(e,t):Dd.removeAllListeners(e),gn),gn.startWatching=()=>(Bh||(Bh=setInterval(()=>{IQ(Z2,Z2=gn==null?void 0:gn.readText())&&Dd.emit("text-changed"),TQ(W2,W2=gn==null?void 0:gn.readImage())&&Dd.emit("image-changed")},500)),gn),gn.stopWatching=()=>(Bh&&clearInterval(Bh),Bh=null,gn));function IQ(e,t){return t&&e!==t}function TQ(e,t){return!t.isEmpty()&&e.toDataURL()!==t.toDataURL()}var Q2;const iw=(Q2=require("electron"))==null?void 0:Q2.remote;var X2,eI;const $2=(eI=(X2=require("electron"))==null?void 0:X2.remote)==null?void 0:eI.screen;class EQ{constructor(t,n){he(this,"isRegisted");he(this,"leaf");he(this,"clipboard");he(this,"isScreenTop",!1);he(this,"currentSplitWindow");he(this,"intervalNum");he(this,"allowsCopy",!1);he(this,"plugin");he(this,"actionEl",null);this.app=t,this.plugin=n,this.isRegisted=!1,this.leaf=null,this.clipboard=gn}async onload(){x.Platform.isDesktop&&(this.initGlobalCopyEvents(),await this.registerAllShortcuts(),this.registerEvents())}registerEvents(){this.plugin.registerEvent(this.app.workspace.on("quit",()=>{iw.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally)}))}initGlobalCopyEvents(){this.plugin.addCommand({id:"init-global-copy-events",name:k("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&&(iw.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(){iw.globalShortcut.register(this.plugin.settings.CaptureKey.OpenThinoGlobally,()=>{this.getCurrentLeaf()?this.showThinoView():this.openThinoView()}),this.isRegisted=!0}showThinoView(){var r,a,o,s;const t=$2.getCursorScreenPoint(),n=(s=(o=(a=(r=this.leaf)==null?void 0:r.parent)==null?void 0:a.parent)==null?void 0:o.win)==null?void 0:s.electronWindow;if(n){if(n.setAlwaysOnTop(!this.isScreenTop,"screen"),this.leaf.setPinned(!this.isScreenTop),this.leaf.view.containerEl.toggleClass("thino-float-window",!0),n.isMinimized()&&n.restore(),n.focus(),this.plugin.settings.CaptureKey.ShowNearMouse){const{width:u,height:d}=n.getBounds();n.setBounds({x:t.x,y:t.y,width:u,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 o,s,u,d,m;this.leaf=this.app.workspace.openPopoutLeaf({size:{width:400,height:400}});const t=this.leaf;this.leaf.view.containerEl.toggleClass("thino-float-window",!0),this.leaf.setViewState({type:"thino_view"}),setTimeout(()=>{t.view.containerEl.classList.toggle("mobile-view",!0)},0),this.currentSplitWindow=(s=(o=this.leaf)==null?void 0:o.parent)==null?void 0:s.parent;const n=(m=(d=(u=this.leaf)==null?void 0:u.parent)==null?void 0:d.parent)==null?void 0:m.win.electronWindow;if(!n)return;n.setAlwaysOnTop(!this.isScreenTop,"screen"),this.leaf.setPinned(!this.isScreenTop),this.isScreenTop=!0;const r=this.app,a=p=>{var D,S,T;const g=$2.getCursorScreenPoint(),w=(T=(S=(D=t==null?void 0:t.parent)==null?void 0:D.parent)==null?void 0:S.win)==null?void 0:T.electronWindow;if(w){if(w.isMinimized()&&w.restore(),!this.isScreenTop&&this.plugin.settings.CaptureKey.ShowNearMouse){const{width:E,height:A}=w.getBounds();w.setBounds({x:g.x,y:g.y-200,width:E,height:A})}w.setAlwaysOnTop(!0,"screen"),r.workspace.trigger("focus-on-textarea"),r.workspace.trigger("send-to-thino",p,t)}};this.clipboard.on("text-changed",()=>{const p=this.clipboard.readText();a(p)}).on("image-changed",()=>{const p=this.clipboard.readImage();a(p)})}}class G2 extends x.EditorSuggest{constructor(n,r){super(n);he(this,"root");he(this,"editor");he(this,"cursor");he(this,"plugin");he(this,"tags");he(this,"type","customTag");he(this,"HASHTAG_REGEX",/(^|\s)#[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]*$/g);this.plugin=r}checkSettings(){return this.plugin.settings.UseVaultTags}checkInMemosView(n){var o;const r=n.containerEl;if(!r)return!1;const a=(o=r.parentElement)==null?void 0:o.parentElement;return(a==null?void 0:a.classList.contains("common-editor-inputer"))||!1}fuzzySearchItemsOptimized(n,r){const a=x.prepareFuzzySearch(n);return r.map(s=>{const u=a(s);return u?{item:s,match:u}:null}).filter(Boolean)}onTrigger(n,r){if(!this.checkInMemosView(r)||this.checkSettings())return null;this.tags=Ie.getState().tags,this.cursor=n,this.editor=r;const a=n.line,o=r.getLine(a),s=o.substr(0,n.ch);if(s.match(this.HASHTAG_REGEX)&&o.substr(n.ch,1)!=="#"){const u=s.lastIndexOf("#"),d=s.substr(u+1);return{start:{line:a,ch:u},end:{line:a,ch:n.ch},query:d}}return null}getSuggestions(n){return this.fuzzySearchItemsOptimized(n.query,this.tags).map(r=>r.item).sort((r,a)=>r.localeCompare(a))||[]}renderSuggestion(n,r){r.setText(n)}selectSuggestion(n){if(this.context){const r=this.context.editor,a=this.context.start,o=this.context.end;r.transaction({changes:[{from:a,to:o,text:"#"+n+" "}]}),setTimeout(function(){return r.focus()})}this.close()}}const hb=crypto,SC=e=>e instanceof CryptoKey,Hg=new TextEncoder,mb=new TextDecoder;function xQ(...e){const t=e.reduce((a,{length:o})=>a+o,0),n=new Uint8Array(t);let r=0;for(const a of e)n.set(a,r),r+=a.length;return n}const CQ=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},sw=e=>{let t=e;t instanceof Uint8Array&&(t=mb.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return CQ(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class py 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 MQ extends py{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class gy extends py{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class xr extends py{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class NQ extends py{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 ls(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Bg(e,t){return e.name===t}function lw(e){return parseInt(e.name.slice(4),10)}function kQ(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function AQ(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 OQ(e,t,...n){switch(t){case"HS256":case"HS384":case"HS512":{if(!Bg(e.algorithm,"HMAC"))throw ls("HMAC");const r=parseInt(t.slice(2),10);if(lw(e.algorithm.hash)!==r)throw ls(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Bg(e.algorithm,"RSASSA-PKCS1-v1_5"))throw ls("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(lw(e.algorithm.hash)!==r)throw ls(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Bg(e.algorithm,"RSA-PSS"))throw ls("RSA-PSS");const r=parseInt(t.slice(2),10);if(lw(e.algorithm.hash)!==r)throw ls(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if(e.algorithm.name!=="Ed25519"&&e.algorithm.name!=="Ed448")throw ls("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!Bg(e.algorithm,"ECDSA"))throw ls("ECDSA");const r=kQ(t);if(e.algorithm.namedCurve!==r)throw ls(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}AQ(e,n)}function IC(e,t,...n){var r;if(n.length>2){const a=n.pop();e+=`one of type ${n.join(", ")}, or ${a}.`}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 q2=(e,...t)=>IC("Key must be ",e,...t);function TC(e,t,...n){return IC(`Key for the ${e} algorithm must be `,t,...n)}const EC=e=>SC(e),xi=["CryptoKey"],FQ=(...e)=>{const t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(const r of t){const a=Object.keys(r);if(!n||n.size===0){n=new Set(a);continue}for(const o of a){if(n.has(o))return!1;n.add(o)}}return!0};function PQ(e){return typeof e=="object"&&e!==null}function J2(e){if(!PQ(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 jQ=(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`)}},ml=(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 a=e.subarray(r,r+t.length);return a.length!==t.length?!1:a.every((o,s)=>o===t[s])||ml(e,t,r+1)},K2=e=>{switch(!0){case ml(e,[42,134,72,206,61,3,1,7]):return"P-256";case ml(e,[43,129,4,0,34]):return"P-384";case ml(e,[43,129,4,0,35]):return"P-521";case ml(e,[43,101,110]):return"X25519";case ml(e,[43,101,111]):return"X448";case ml(e,[43,101,112]):return"Ed25519";case ml(e,[43,101,113]):return"Ed448";default:throw new gy("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},LQ=async(e,t,n,r,a)=>{let o,s;const u=new Uint8Array(atob(n.replace(e,"")).split("").map(m=>m.charCodeAt(0))),d=t==="spki";switch(r){case"PS256":case"PS384":case"PS512":o={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},s=d?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":o={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":o={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},s=d?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":o={name:"ECDSA",namedCurve:"P-256"},s=d?["verify"]:["sign"];break;case"ES384":o={name:"ECDSA",namedCurve:"P-384"},s=d?["verify"]:["sign"];break;case"ES512":o={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 m=K2(u);o=m.startsWith("P-")?{name:"ECDH",namedCurve:m}:{name:m},s=d?[]:["deriveBits"];break}case"EdDSA":o={name:K2(u)},s=d?["verify"]:["sign"];break;default:throw new gy('Invalid or unsupported "alg" (Algorithm) value')}return hb.subtle.importKey(t,u,o,(a==null?void 0:a.extractable)??!1,s)},RQ=(e,t,n)=>LQ(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,n);async function _Q(e,t,n){if(typeof e!="string"||e.indexOf("-----BEGIN PUBLIC KEY-----")!==0)throw new TypeError('"spki" must be SPKI formatted string');return RQ(e,t,n)}const HQ=(e,t)=>{if(!(t instanceof Uint8Array)){if(!EC(t))throw new TypeError(TC(e,t,...xi,"Uint8Array"));if(t.type!=="secret")throw new TypeError(`${xi.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}},BQ=(e,t,n)=>{if(!EC(t))throw new TypeError(TC(e,t,...xi));if(t.type==="secret")throw new TypeError(`${xi.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if(n==="sign"&&t.type==="public")throw new TypeError(`${xi.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if(n==="decrypt"&&t.type==="public")throw new TypeError(`${xi.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n==="verify"&&t.type==="private")throw new TypeError(`${xi.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n==="encrypt"&&t.type==="private")throw new TypeError(`${xi.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)},YQ=(e,t,n)=>{e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?HQ(e,t):BQ(e,t,n)};function zQ(e,t,n,r,a){if(a.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 o;n!==void 0?o=new Map([...Object.entries(n),...t.entries()]):o=t;for(const s of r.crit){if(!o.has(s))throw new gy(`Extension Header Parameter "${s}" is not recognized`);if(a[s]===void 0)throw new e(`Extension Header Parameter "${s}" is missing`);if(o.get(s)&&r[s]===void 0)throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`)}return new Set(r.crit)}const UQ=(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 VQ(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 gy(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function ZQ(e,t,n){if(SC(t))return OQ(t,e,n),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(q2(t,...xi));return hb.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[n])}throw new TypeError(q2(t,...xi,"Uint8Array"))}const WQ=async(e,t,n,r)=>{const a=await ZQ(e,t,"verify");jQ(e,a);const o=VQ(e,a.algorithm);try{return await hb.subtle.verify(o,a,n,r)}catch{return!1}};async function $Q(e,t,n){if(!J2(e))throw new xr("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new xr('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new xr("JWS Protected Header incorrect type");if(e.payload===void 0)throw new xr("JWS Payload missing");if(typeof e.signature!="string")throw new xr("JWS Signature missing or incorrect type");if(e.header!==void 0&&!J2(e.header))throw new xr("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{const T=sw(e.protected);r=JSON.parse(mb.decode(T))}catch{throw new xr("JWS Protected Header is invalid")}if(!FQ(r,e.header))throw new xr("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a={...r,...e.header},o=zQ(xr,new Map([["b64",!0]]),n==null?void 0:n.crit,r,a);let s=!0;if(o.has("b64")&&(s=r.b64,typeof s!="boolean"))throw new xr('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:u}=a;if(typeof u!="string"||!u)throw new xr('JWS "alg" (Algorithm) Header Parameter missing or invalid');const d=n&&UQ("algorithms",n.algorithms);if(d&&!d.has(u))throw new MQ('"alg" (Algorithm) Header Parameter value not allowed');if(s){if(typeof e.payload!="string")throw new xr("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new xr("JWS Payload must be a string or an Uint8Array instance");let m=!1;typeof t=="function"&&(t=await t(r,e),m=!0),YQ(u,t,"verify");const p=xQ(Hg.encode(e.protected??""),Hg.encode("."),typeof e.payload=="string"?Hg.encode(e.payload):e.payload);let g;try{g=sw(e.signature)}catch{throw new xr("Failed to base64url decode the signature")}if(!await WQ(u,t,g,p))throw new NQ;let D;if(s)try{D=sw(e.payload)}catch{throw new xr("Failed to base64url decode the payload")}else typeof e.payload=="string"?D=Hg.encode(e.payload):D=e.payload;const S={payload:D};return e.protected!==void 0&&(S.protectedHeader=r),e.header!==void 0&&(S.unprotectedHeader=e.header),m?{...S,key:t}:S}async function GQ(e,t,n){if(e instanceof Uint8Array&&(e=mb.decode(e)),typeof e!="string")throw new xr("Compact JWS must be a string or Uint8Array");const{0:r,1:a,2:o,length:s}=e.split(".");if(s!==3)throw new xr("Invalid Compact JWS");const u=await $Q({payload:a,protected:r,signature:o},t,n),d={payload:u.payload,protectedHeader:u.protectedHeader};return typeof t=="function"?{...d,key:u.key}:d}const qQ={webId:"globe-2",pinned:"pin",archived:"archive",visibility:"eye",deleted:"trash"};class JQ extends Ci.WidgetType{constructor(n,r,a,o,s){super();he(this,"error",!1);this.view=n,this.plugin=r,this.target=a,this.type=o,this.to=s}eq(n){return this.target===n.target}toDOM(){const n=createSpan();return n.toggleClass("thino-inline-widget",!0),x.setIcon(n,qQ[this.type]||"help-circle"),x.setTooltip&&x.setTooltip(n,this.target),n}}function KQ(e){class t{constructor(a){he(this,"view");he(this,"match",new Ci.MatchDecorator({regexp:/\[(webId|pinned|archived|visibility|deleted)::([^\]]+)\]/g,decorate:(a,o,s,u,d)=>{this.shouldRender(d,o,s)&&a(o,s,Ci.Decoration.replace({widget:new JQ(d,e,u[0],u[1],s)}))}}));he(this,"decorations",Ci.Decoration.none);this.view=a,this.updateDecorations(a)}update(a){this.updateDecorations(a.view,a)}destroy(){this.decorations=Ci.Decoration.none}updateDecorations(a,o){!o||this.decorations.size===0?this.decorations=this.match.createDeco(a):this.decorations=this.match.updateDeco(o,this.decorations)}isLivePreview(a){return a.field(x.editorLivePreviewField)}shouldRender(a,o,s){return!a.state.selection.ranges.some(d=>d.from<=o?d.to>=o:d.from<=s)&&this.isLivePreview(a.state)}}const n={decorations:r=>r.decorations.update({filter:(a,o,s)=>{const u=s.spec.widget;return u&&u.error?!1:a===o||!r.view.state.selection.ranges.filter(d=>{const m=d.from,p=d.to;return m<=a?p>=a:m<=o}).length}})};return Ci.ViewPlugin.fromClass(t,n)}const QQ=e=>e.ctrlKey!==void 0||e.metaKey!==void 0||e.shiftKey!==void 0||e.altKey!==void 0,Yg=()=>{new x.Notice(k("Open Memos Successfully"))},zg=[{id:"open-thino-in-left-sidebar",shortName:k("Left sidebar"),name:k("Open thino in left sidebar"),icon:"arrow-left",location:"left",cb:Yg,modKeys:"shift"},{id:"open-thino-in-right-sidebar",shortName:k("Right sidebar"),name:k("Open thino in right sidebar"),icon:"arrow-right",location:"right",cb:Yg,modKeys:["ctrl","meta"]},{id:"open-thino-in-float",shortName:k("Float window"),name:k("Open thino in float window"),icon:"layout",location:"float",cb:Yg,modKeys:"alt"},{id:"open-thino-in-center",shortName:k("Center window"),name:k("Open thino in center window"),icon:"tv-2",location:"center",cb:Yg,modKeys:void 0}];class XQ extends x.Plugin{constructor(){super(...arguments);he(this,"settings");he(this,"settingTab");he(this,"triggerBySelf",!1);he(this,"updatedID","");he(this,"debounceTimer",0);he(this,"apiHttpServer",null);he(this,"captureService",null);he(this,"loaded",!1)}async onload(){await this.loadSettings(),nK(),this.registerRibbon(),await this.verify(),this.checkVersionAndShowChangeLog(),this.settingTab=new mK(this.app,this),this.addSettingTab(this.settingTab),this.initEditor(),this.initURIHandler(),this.registerMobileEvent(),this.registerCommands(),this.registerCanvasNodeMemos(),this.registerHoverEvent(),this.registerEditorSuggest(new QJ(this.app,this)),this.registerEditorExtension([fQ]),this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this)),this.registerView(Hr,n=>new yl(n,this))}async loadSettings(){this.settings=Object.assign({},Oo,await this.loadData()),rt.setSettings(this.settings)}async saveSettings(){await this.saveData(this.settings),rt.setSettings(this.settings)}onunload(){var r;this.app.workspace.detachLeavesOfType(Hr),Ie.clearMemos(),Ee.dispatch({type:"CLEAR_MEMOS",payload:null}),Ee.dispatch({type:"CLEAR_FILES",payload:null}),Ee.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 x.Notice(k("Close Memos Successfully"))}initEditor(){const n=()=>{const r=this.app.embedRegistry;if(!r)return!1;const a=r.embedByExtension.md,o=createEl("div"),s=a({app:this.app,containerEl:o},null,null);if(s.editable=!0,s.set(""),s.showEditor(),!s.editMode)return!1;const u=Object.getPrototypeOf(Object.getPrototypeOf(s.editMode));return rt.setEditor(u),o.detach(),!0};this.app.workspace.onLayoutReady(()=>{n()||this.app.workspace.onLayoutReady(()=>{setTimeout(()=>{n()},100)})}),this.register(cv(x.MetadataCache.prototype,{getFileCache:r=>function(a){return!(a!=null&&a.path)&&!a?null:r.call(this,a)}}))}initApp(){rt.setApp(this.app)}initURIHandler(){this.registerObsidianProtocolHandler("thino",async n=>{var s,u,d;if(!n)return;if(n.userid)try{const m=n.userid;pQ(m,this.app),gQ(x.moment().add(30,"days").valueOf(),this.app),Qe.setRefresh(!0)}catch(m){console.error(m),new x.Notice(k("Failed to verify"))}if(n.token)try{const m=n.token;(s=this.app)==null||s.saveLocalStorage("tokenForSync",m),setTimeout(()=>{this.app.setting.open(),this.app.setting.openTabById(this.manifest.id||"obsidian-memos"),this.settingTab.display()},200),new x.Notice(k("Saved sync token successfully"))}catch(m){console.error(m),new x.Notice(k("Failed to save"))}if(n.copyToken){this.app.setting.open(),this.app.setting.openTabById(this.manifest.id??"obsidian-memos");const m=await dC();await navigator.clipboard.writeText(m),new x.Notice(k("Copied app id successfully"))}const r=(u=rt.getState())==null?void 0:u.verifyState,a=!x.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),o=x.Platform.isDesktop?await zn():a.identifier||a.uuid;if(!(!r||(r==null?void 0:r.appId)!==o)){if(n.content){const m=n.type,p=decodeURI(n.content)!==n.content?decodeURI(n.content):n.content,g=n.task,w=await Ie.createThino({content:p,type:m,isList:!!g});if(!w)return;Ie.pushMemo(w),We.clearQuery()}n.openId&&await Ie.openThinoByID(n.openId)}})}initGlobalManifest(){Qe.setPluginManifest(this.manifest)}stopServer(){this.apiHttpServer&&(this.apiHttpServer.close(),this.apiHttpServer=null)}async initServer(){var o,s;if(x.Platform.isMobile||!this.settings.EnabledHttpApi)return;const n=(o=rt.getState())==null?void 0:o.verifyState,r=!x.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),a=x.Platform.isDesktop?await zn():r.identifier||r.uuid;!n||(n==null?void 0:n.appId)!==a||(this.apiHttpServer=DQ(this.settings),this.initServerPort())}initServerPort(){this.apiHttpServer&&this.settings.EnabledHttpApi&&this.apiHttpServer.listen(this.settings.HttpApiIpType,this.settings.HttpApiPort)}async initCaptureService(){var o,s;if(x.Platform.isMobile||!this.settings.CaptureKey.EnableCaptureKey)return;const n=(o=rt.getState())==null?void 0:o.verifyState,r=!x.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),a=x.Platform.isDesktop?await zn():r.identifier||r.uuid;!n||(n==null?void 0:n.appId)!==a||(this.captureService=new EQ(this.app,this),await this.captureService.onload())}registerMobileEvent(){x.Platform.isMobile&&(this.registerEvent(this.app.workspace.on("receive-text-menu",(n,r)=>{n.addItem(a=>{a.setIcon("popup-open").setTitle(k("Insert as Memo")).onClick(async()=>{const o=await Ie.createMemoDaily(r,!1);Ie.pushMemo(o)})})})),this.registerEvent(this.app.workspace.on("receive-files-menu",(n,r)=>{n.addItem(a=>{a.setIcon("popup-open").setTitle(k("Insert file as memo content")).onClick(async()=>{const o=r.map(u=>this.app.fileManager.generateMarkdownLink(u,u.path)),s=await Ie.createMemoDaily(o.join(`
`),!1);Ie.pushMemo(s)})})})))}registerCommands(){zg.forEach(n=>{this.addCommand({id:n.id,name:n.name,callback:()=>this.openMemos(n.location,n.cb),hotkeys:[]})}),x.Platform.isDesktop&&this.addCommand({id:"show-thino-editor",name:k("Show thino editor"),checkCallback:n=>{if(Ie.initialized&&rt.initialized)return n||new aC(this.app).open(),!0}}),this.addCommand({id:"lock-thino",name:k("Lock thino"),checkCallback:n=>{if(this.app.workspace.getActiveViewOfType(yl)&&this.settings.needVerify)return n||Qe.setLocked(!0),!0}}),this.addCommand({id:"copy-debug-info",name:k("Copy debug info"),callback:()=>{try{const n={settings:{...this.settings,tokenForVerify:"***"},manifest:this.manifest,obsidianVer:this.app.version,platform:x.Platform.resourcePathPrefix};navigator.clipboard.writeText(JSON.stringify(n,null,2)),new x.Notice(k("Debug info copied to clipboard"))}catch(n){console.error(n)}}}),this.addCommand({id:"toggle-minimal-thino",name:k("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:k("Focus on thino editor"),callback:()=>this.focusOnEditor(),hotkeys:[]}),this.addCommand({id:"reinit-thino-sync",name:k("ReSync web thinos to local"),callback:()=>{pJ(this.app)}}),this.addCommand({id:"init-thino-sync",name:k("Sync local thinos to web"),callback:async()=>{var r;if(!((r=this.app)==null?void 0:r.loadLocalStorage("tokenForSync"))){new x.Notice(k("Please input token first"));return}if(!this.settings.startSync){new x.Notice(k("Please enable sync first"));return}try{await Ie.initSync()}catch(a){console.error(a),new x.Notice(k("Init Failed"))}}}),this.addCommand({id:"show-daily-thino",name:k("Show daily thino dialog"),callback:()=>this.openDailyMemo(),hotkeys:[]}),this.addCommand({id:"focus-on-search-bar",name:k("Focus on search bar"),callback:()=>this.searchIt(),hotkeys:[]}),this.addCommand({id:"show-thino-in-popover",name:k("Show-thino in popover(Hover editor)"),callback:()=>this.showInPopover(),hotkeys:[]})}async onLayoutReady(){this.initApp(),await this.initServer(),this.initGlobalManifest(),await this.initMemos(),this.autoOpenMemos(),this.registerThinoWidget(),await this.registerToolbarCheck(),await this.initCaptureService(),rt.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 G2(this.app,this))):this.app.workspace.editorSuggest.suggests.unshift(new G2(this.app,this))}async initMemos(){try{await this.initDailyNotes()}catch(n){console.error(n)}rt.getState(),Ie.getState(),await Ie.fetchAllMemos()}async initDailyNotes(){this.settings.EnabledLocationList.find(n=>n.value==="DAILY")&&await rt.fechLocalDailyNotes()}registerCanvasNodeMemos(){if(!x.requireApiVersion("1.2.0"))return;const n=o=>{clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{setTimeout(async()=>{const s=o.canvas.getData(),u=s.nodes.find(d=>d.id===o.id);if(u&&(r(u),o.canvas.setData(s),Ie.getMemoById(o.id))){const m=await Ie.updateMemo(o.id,u.text,u.thinoType);Ie.editMemo(m)}o.canvas.requestSave(!0)},0)},800)},r=o=>{o.createdAt||(o.createdAt=x.moment().format("YYYY-MM-DD HH:mm:ss")),o.updatedAt=x.moment().format("YYYY-MM-DD HH:mm:ss"),o.deletedAt=o.deletedAt?o.deletedAt:"",o.pinned=o.pinned?o.pinned:!1,o.visibility=o.visibility?o.visibility:"PUBLIC",o.rowStatus=o.rowStatus?o.rowStatus:"NORMAL",o.thinoType=o.thinoType?o.thinoType:"JOURNAL",o.hasId=o.hasId?o.hasId:"",o.linkId=o.linkId?o.linkId:"",o.resourceList=[]},a=()=>{var w,D;const o=(w=this.app.workspace.getLeavesOfType("canvas").first())==null?void 0:w.view;if(!o||!(o==null?void 0:o.canvas))return!1;const u=((D=this.app.workspace.getLeavesOfType("canvas").first())==null?void 0:D.view).canvas.nodes.values(),m=Array.from(u).filter(S=>S.text!==void 0);if(!m||m.length===0)return!1;const p=m[0].child;if(!p)return!1;const g=cv(p.constructor.prototype,{save:S=>function(...T){S.call(this,...T),this.node.isEditing&&n(this.node)}});return this.register(g),!0};this.app.workspace.onLayoutReady(()=>{if(!a()){const o=this.app.workspace.on("layout-change",()=>{a()&&this.app.workspace.offref(o)});this.registerEvent(o)}})}registerHoverEvent(){this.registerHoverLinkSource("thino",{defaultMod:!0,display:"Thino"})}registerRibbon(){this.addRibbonIcon("Memos",k("ribbonIconTitle"),async n=>{if(n.button===2){n.preventDefault();const r=new x.Menu;zg.forEach(a=>{r.addItem(o=>{o.setTitle(a.shortName).setIcon(a.icon).onClick(async()=>{await this.openMemos(a.location,a.cb)})})}),r.showAtMouseEvent(n);return}for(let r=0;r<zg.length;r++){const a=zg[r];if(!a.modKeys){await this.openMemos(a.location,a.cb);break}if(!QQ(n))continue;const o=s=>n[`${s}Key`];if(typeof a.modKeys=="string"&&o(a.modKeys)||Array.isArray(a.modKeys)&&a.modKeys.some(o)){await this.openMemos(a.location,a.cb);break}}})}registerThinoWidget(){this.registerEditorExtension([KQ(this)])}async registerToolbarCheck(){var o,s;if(this.loaded)return;const n=(o=rt.getState())==null?void 0:o.verifyState,r=!x.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),a=x.Platform.isDesktop?await zn():r.identifier||r.uuid;!n||(n==null?void 0:n.appId)!==a||(this.registerEditorExtension([lQ(this.app)]),this.registerEditorSuggest(new XJ(this.app,this)),this.loaded=!0)}async verify(){var a;let n="";if(x.Platform.isDesktop)n=await zn();else{const o=await((a=window.Capacitor.Plugins.Device)==null?void 0:a.getId());if(!o)return;n=o.identifier||o.uuid}async function r(o){if(!o)return rt.setVerifyState(null),!1;const d=await _Q(`-----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:m}=await GQ(o,d),p=JSON.parse(new TextDecoder().decode(m));return!p||p.iss!=="pkmer"||p.type!=="thino"||p.appId!==n?!1:(rt.setVerifyState(p),!0)}catch(m){console.error(m)}}return await r(this.settings.tokenForVerify[n])}async checkVersionAndShowChangeLog(){const n=this.manifest.version,r=this.settings.LastUpdatedVersion;n!==r&&(this.settings.LastUpdatedVersion=n,await this.saveSettings(),this.showChangeLog())}showChangeLog(){new pb(this.app,this.manifest.version).open()}autoOpenMemos(){this.app.workspace.getLeavesOfType(Hr).length>0||this.settings.MobileAndDesktop==="Mobile"&&x.Platform.isDesktop||this.settings.MobileAndDesktop==="Desktop"&&x.Platform.isMobile||this.settings.OpenMemosAutomatically&&this.openMemos()}async openDailyMemo(){const n=this.app.workspace.getLeavesOfType(Hr);if(!this.settings.OpenDailyMemosWithMemos){aw();return}if(n.length>0){aw();return}await this.openMemos(),aw()}async openMemos(n="center",r){const a=this.app.workspace;if(a.getLeavesOfType(Hr).length>0){const s=a.getLeavesOfType(Hr)[0];a.setActiveLeaf(s),a.revealLeaf(s);return}a.detachLeavesOfType(Hr);let o;switch(n){case"left":o=a.getLeftLeaf(!1);break;case"right":o=a.getRightLeaf(!1);break;case"float":o=a.getLeaf("window");break;default:o=a.getLeaf(!1);break}if(o&&(await o.setViewState({type:Hr}),a.revealLeaf(o)),this.settings.FocusOnEditor){const s=o.view.containerEl.querySelector("textarea");s&&s.focus()}r==null||r()}searchIt(){const n=this.app.workspace,r=n.getLeavesOfType(Hr);if(!(r.length>0)){this.openMemos();return}const a=r[0];n.setActiveLeaf(a),a.view.containerEl.querySelector(".search-bar-inputer .text-input").focus()}async focusOnEditor(){if(!(this.app.workspace.getLeavesOfType(Hr).length>0)){await this.openMemos();return}this.app.workspace.trigger("focus-on-textarea")}changeStatus(){const n=this.app.workspace,r=n.getLeavesOfType(Hr);if(!(r.length>0)){new x.Notice(k("Please Open Memos First"));return}const a=r[0];n.setActiveLeaf(a),a.view.containerEl.querySelector(".list-or-task").click()}async showInPopover(){var o,s,u;const n=this.app.workspace;if(n.detachLeavesOfType(Hr),!this.app.plugins.getPlugin("obsidian-hover-editor")){new x.Notice(k("Please install obsidian-hover-editor plugin first"));return}const a=await((o=this.app.plugins.getPlugin("obsidian-hover-editor"))==null?void 0:o.spawnPopover());a&&(await a.setViewState({type:Hr}),n.revealLeaf(a),a.view.containerEl.classList.add("mobile-view"),(s=this.settings)!=null&&s.FocusOnEditor&&a.view.containerEl.querySelector("textarea")!==void 0&&((u=a.view.containerEl.querySelector("textarea"))==null||u.focus()))}}class pb extends x.Modal{constructor(n,r){super(n);he(this,"component");this.version=r}async onOpen(){const{contentEl:n}=this;n.createEl("h2",{text:k("Thino update info")+` version ${this.version}`});try{n.createEl("h3",{text:k("Latest version")});const r=n.createDiv("current-change-log");n.createEl("hr"),n.createEl("h3",{text:k("Previous version")});const a=n.createDiv("prev-change-log"),s=await x.requestUrl("https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md");this.component=new x.Component;const[u,d]=this.getLatestVersionContent(s.text);await x.MarkdownRenderer.render(this.app,u,r,"",this.component),await x.MarkdownRenderer.render(this.app,d,a,"",this.component)}catch(r){console.error(r),n.createEl("p",{text:k("Failed to load changelog")}),n.createEl("a",{text:k("View online"),attr:{href:"https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md",target:"_blank"}})}}getLatestVersionContent(n){const r=/^# .+/gm,a=[...n.matchAll(r)];if(a.length===0)return[n,""];const o=a[0].index||0;a[0][0].length;let s=n.length;a.length>1&&(s=a[1].index||n.length);const u=n.substring(o,s).trim(),d=n.substring(s).trim();return[u,d]}onClose(){var r;const{contentEl:n}=this;n.empty(),(r=this.component)==null||r.unload()}}exports.ChangeLogModal=pb;exports.default=XQ;