372 lines
2.0 MiB
Plaintext
372 lines
2.0 MiB
Plaintext
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);let f=require(`obsidian`),p=require(`@codemirror/language`),m=require(`@codemirror/state`),h=require(`@codemirror/view`);var g=s((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function ee(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ne={current:null},re={transition:null},ie={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:re,ReactCurrentOwner:C};function ae(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ie,e.act=ae,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=re.transition;re.transition={};try{e()}finally{re.transition=t}},e.unstable_act=ae,e.useCallback=function(e,t){return ne.current.useCallback(e,t)},e.useContext=function(e){return ne.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return ne.current.useDeferredValue(e)},e.useEffect=function(e,t){return ne.current.useEffect(e,t)},e.useId=function(){return ne.current.useId()},e.useImperativeHandle=function(e,t,n){return ne.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return ne.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return ne.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return ne.current.useMemo(e,t)},e.useReducer=function(e,t,n){return ne.current.useReducer(e,t,n)},e.useRef=function(e){return ne.current.useRef(e)},e.useState=function(e){return ne.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return ne.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return ne.current.useTransition()},e.version=`18.3.1`})),_=s(((e,t)=>{t.exports=g()})),v=u(_(),1);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)}),typeof window<`u`&&typeof window.requestIdleCallback!=`function`&&(window.requestIdleCallback=(e,t)=>{let n=Date.now();return window.setTimeout(()=>{e({didTimeout:t?.timeout?Date.now()-n>=t.timeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-n))})},1)},window.cancelIdleCallback=e=>{window.clearTimeout(e)});var y=c({DEFAULT_DAILY_NOTE_FORMAT:()=>me,DEFAULT_MONTHLY_NOTE_FORMAT:()=>ge,DEFAULT_QUARTERLY_NOTE_FORMAT:()=>_e,DEFAULT_WEEKLY_NOTE_FORMAT:()=>he,DEFAULT_YEARLY_NOTE_FORMAT:()=>ve,DailyNotesFolderMissingError:()=>be,PeriodicNotesFolderMissingError:()=>xe,appHasDailyNotesPluginLoaded:()=>k,appHasPeriodicNotesPluginLoaded:()=>A,clearThinoPeriodicSettings:()=>x,createDailyNote:()=>fe,createPeriodicNote:()=>pe,getAllDailyNotes:()=>ce,getAllPeriodicNotes:()=>le,getDailyNote:()=>ue,getDailyNoteSettings:()=>C,getDateFromFile:()=>re,getDateFromFilename:()=>ne,getDateFromPath:()=>ie,getDateUID:()=>j,getMonthlyNoteSettings:()=>T,getPeriodicNote:()=>de,getPeriodicNoteSettings:()=>O,getQuarterlyNoteSettings:()=>E,getWeeklyNoteSettings:()=>w,getYearlyNoteSettings:()=>D,setThinoPeriodicSettings:()=>b});function b(e,t){Se[e]=t}function x(e){e?delete Se[e]:Se={}}function S(e){let t=window.app?.plugins?.getPlugin(`periodic-notes`);return t&&t.settings?.[e]?.enabled}function C(){return O(`day`)}function w(){return O(`week`)}function T(){return O(`month`)}function E(){return O(`quarter`)}function D(){return O(`year`)}function O(e){let t=Se[e];if(t)return{format:t.format||ye[e],folder:t.folder?.trim()||``,template:t.template?.trim()||``};try{let t=window.app,n={day:`daily`,week:`weekly`,month:`monthly`,quarter:`quarterly`,year:`yearly`};if(S(n[e])){let r=t.plugins.getPlugin(`periodic-notes`),i=r?.calendarSetManager?.getActiveConfig(e);if(i)return{format:i.format||ye[e],folder:i.folder?.trim()||``,template:i.template?.trim()||``};let a=r?.settings?.[n[e]];if(a)return{format:a.format||ye[e],folder:a.folder?.trim()||``,template:a.template?.trim()||``}}if(e===`day`){let e=t.internalPlugins?.getPluginById(`daily-notes`)?.instance?.options;if(e)return{format:e.format||`YYYY-MM-DD`,folder:e.folder?.trim()||``,template:e.template?.trim()||``}}}catch(e){console.info(`No custom periodic note settings found!`,e)}return{format:ye[e],folder:``,template:``}}function k(){let e=window.app,t=e.internalPlugins?.plugins?.[`daily-notes`];if(t&&t.enabled)return!0;let n=e.plugins?.getPlugin(`periodic-notes`);return!!(n&&n.settings?.daily?.enabled)}function A(e){let t=window.app;if(e===`day`)return k();let n={day:`daily`,week:`weekly`,month:`monthly`,quarter:`quarterly`,year:`yearly`},r=t.plugins?.getPlugin(`periodic-notes`);return!!(r&&r.settings?.[n[e]]?.enabled)}function j(e,t=`day`){return`${t}-${e.clone().startOf(t).format()}`}function ee(e){return e.replace(/\[[^\]]*\]/g,``)}function te(e,t){if(t===`week`){let t=ee(e);return/w{1,2}/i.test(t)&&(/M{1,4}/.test(t)||/D{1,4}/.test(t))}return!1}function ne(e,t){let n=(O(t).format||ye[t]).split(`/`).pop(),r=window.moment(e,n,!0);if(!r.isValid())return null;if(te(n,t)&&t===`week`){let t=ee(n);if(/w{1,2}/i.test(t))return window.moment(e,n.replace(/M{1,4}/g,``).replace(/D{1,4}/g,``),!1)}return r}function re(e,t){return ne(e.basename,t)}function ie(e,t){return ne(e.split(`/`).pop()?.replace(/\.[^.]+$/,``)||``,t)}async function ae(e){let t=window.app;if(!e?.trim())return[``,null];try{let n=(0,f.normalizePath)(e),r=t.metadataCache.getFirstLinkpathDest(n,``);return r||=t.vault.getAbstractFileByPath(n.endsWith(`.md`)?n:`${n}.md`),r?[await t.vault.cachedRead(r),t.foldManager?.load(r)??null]:(new f.Notice(`Failed to find template file: "${e}"`),[``,null])}catch(t){return console.error(`Failed to read template: "${e}"`,t),new f.Notice(`Failed to read template: "${e}"`),[``,null]}}function oe(e,t,n){let r=window.moment(),i=t.format(n);return e.replace(/{{\s*date\s*}}/gi,i).replace(/{{\s*time\s*}}/gi,r.format(`HH:mm`)).replace(/{{\s*title\s*}}/gi,i).replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(e,i,a,o,s,c)=>{let l=t.clone().set({hour:r.get(`hour`),minute:r.get(`minute`),second:r.get(`second`)});return a&&l.add(parseInt(o,10),s),c?l.format(c.substring(1).trim()):l.format(n)}).replace(/{{\s*yesterday\s*}}/gi,t.clone().subtract(1,`day`).format(n)).replace(/{{\s*tomorrow\s*}}/gi,t.clone().add(1,`day`).format(n))}async function se(e,t){let{vault:n}=window.app,r=(0,f.normalizePath)(e?`${e}/${t}`:t),i=r.substring(0,r.lastIndexOf(`/`));return i&&!(n.getAbstractFileByPath(i)instanceof f.TFolder)&&await n.createFolder(i),`${r}.md`}function ce(){return le(`day`)}function le(e){let{vault:t}=window.app,{folder:n}=O(e),r=t.getAbstractFileByPath((0,f.normalizePath)(n||`/`));if(!r)throw new xe(`Failed to find ${e} notes folder: "${n}"`);let i={},a=t=>{if(t instanceof f.TFile&&t.extension===`md`){let n=re(t,e);if(n){let r=j(n,e);i[r]=t}}else if(t instanceof f.TFolder)for(let e of t.children)a(e)};return a(r),i}function ue(e,t){return t[j(e,`day`)]??null}function de(e,t,n){return t[j(e,n)]??null}async function fe(e){return pe(e,`day`)}async function pe(e,t){let n=window.app,{vault:r}=n,{template:i,format:a,folder:o}=O(t),[s,c]=await ae(i),l=await se(o,e.format(a));try{let t=oe(s,e,a),i=await r.create(l,t);return c&&n.foldManager?.save(i,c),i}catch(e){throw console.error(`Failed to create file: '${l}'`,e),new f.Notice(`Unable to create new file.`),e}}var me,he,ge,_e,ve,ye,be,xe,Se,Ce=o((()=>{me=`YYYY-MM-DD`,he=`gggg-[W]ww`,ge=`YYYY-MM`,_e=`YYYY-[Q]Q`,ve=`YYYY`,ye={day:me,week:he,month:ge,quarter:_e,year:ve},be=class extends Error{},xe=class extends Error{},Se={}})),we,Te,Ee=o((()=>{we=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Te=(e=>e?we(e):we)}));function De(e,t=Oe){let n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(n),n}var Oe,ke,Ae,je=o((()=>{Ee(),Oe=e=>e,ke=e=>{let t=Te(e),n=e=>De(t,e);return Object.assign(n,t),n},Ae=(e=>e?ke(e):ke)})),Me=o((()=>{Ee(),je()}));function Ne(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe=o((()=>{Pe=new Map,Fe=e=>{let t=Pe.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},Ie=(e,t,n)=>{if(e===void 0)return{type:`untracked`,connection:t.connect(n)};let r=Pe.get(n.name);if(r)return{type:`tracked`,store:e,...r};let i={connection:t.connect(n),stores:{}};return Pe.set(n.name,i),{type:`tracked`,store:e,...i}},Le=(e,t)=>{if(t===void 0)return;let n=Pe.get(e);n&&(delete n.stores[t],Object.keys(n.stores).length===0&&Pe.delete(e))},Re=e=>{if(!e)return;let t=e.split(`
|
||
`),n=t.findIndex(e=>e.includes(`api.setState`));if(n<0)return;let r=t[n+1]?.trim()||``;return/.+ (.+) .+/.exec(r)?.[1]},ze=(e,t={})=>(n,r,i)=>{let{enabled:a,anonymousActionType:o,store:s,...c}=t,l;try{l=(a??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return e(n,r,i);let{connection:u,...d}=Ie(s,l,c),f=!0;i.setState=((e,t,a)=>{let l=n(e,t);if(!f)return l;let d=a===void 0?{type:o||Re(Error().stack)||`anonymous`}:typeof a==`string`?{type:a}:a;return s===void 0?(u?.send(d,r()),l):(u?.send({...d,type:`${s}/${d.type}`},{...Fe(c.name),[s]:i.getState()}),l)}),i.devtools={cleanup:()=>{u&&typeof u.unsubscribe==`function`&&u.unsubscribe(),Le(c.name,s)}};let p=(...e)=>{let t=f;f=!1,n(...e),f=t},m=e(i.setState,r,i);if(d.type===`untracked`?u?.init(m):(d.stores[d.store]=i,u?.init(Object.fromEntries(Object.entries(d.stores).map(([e,t])=>[e,e===d.store?m:t.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch==`function`){let e=i.dispatch;i.dispatch=(...t)=>{e(...t)}}return u.subscribe(e=>{switch(e.type){case`ACTION`:if(typeof e.payload!=`string`){console.error(`[zustand devtools middleware] Unsupported action format`);return}return Ve(e.payload,e=>{if(e.type===`__setState`){if(s===void 0){p(e.state);return}Object.keys(e.state).length!==1&&console.error(`
|
||
[zustand devtools middleware] Unsupported __setState action format.
|
||
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
||
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
||
`);let t=e.state[s];if(t==null)return;JSON.stringify(i.getState())!==JSON.stringify(t)&&p(t);return}i.dispatchFromDevtools&&typeof i.dispatch==`function`&&i.dispatch(e)});case`DISPATCH`:switch(e.payload.type){case`RESET`:return p(m),s===void 0?u?.init(i.getState()):u?.init(Fe(c.name));case`COMMIT`:if(s===void 0){u?.init(i.getState());return}return u?.init(Fe(c.name));case`ROLLBACK`:return Ve(e.state,e=>{if(s===void 0){p(e),u?.init(i.getState());return}p(e[s]),u?.init(Fe(c.name))});case`JUMP_TO_STATE`:case`JUMP_TO_ACTION`:return Ve(e.state,e=>{if(s===void 0){p(e);return}JSON.stringify(i.getState())!==JSON.stringify(e[s])&&p(e[s])});case`IMPORT_STATE`:{let{nextLiftedState:t}=e.payload,n=t.computedStates.slice(-1)[0]?.state;if(!n)return;p(s===void 0?n:n[s]),u?.send(null,t);return}case`PAUSE_RECORDING`:return f=!f}return}}),m},Be=ze,Ve=(e,t)=>{let n;try{n=JSON.parse(e)}catch(e){console.error(`[zustand devtools middleware] Could not parse the received json`,e)}n!==void 0&&t(n)},He=e=>(t,n,r)=>{let i=r.subscribe;return r.subscribe=((e,t,n)=>{let a=e;if(t){let i=n?.equalityFn||Object.is,o=e(r.getState());a=n=>{let r=e(n);if(!i(o,r)){let e=o;t(o=r,e)}},n?.fireImmediately&&t(o,o)}return i(a)}),e(t,n,r)},Ue=He,We=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return We(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return We(t)(e)}}}},Ge=(e,t)=>(n,r,i)=>{let a={storage:Ne(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,s=new Set,c=new Set,l=a.storage;if(!l)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let u=()=>{let e=a.partialize({...r()});return l.setItem(a.name,{state:e,version:a.version})},d=i.setState;i.setState=(e,t)=>(d(e,t),u());let f=e((...e)=>(n(...e),u()),r,i);i.getInitialState=()=>f;let p,m=()=>{if(!l)return;o=!1,s.forEach(e=>e(r()??f));let e=a.onRehydrateStorage?.call(a,r()??f)||void 0;return We(l.getItem.bind(l))(a.name).then(e=>{if(e)if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state];return[!1,void 0]}).then(e=>{let[t,i]=e;if(p=a.merge(i,r()??f),n(p,!0),t)return u()}).then(()=>{e?.(p,void 0),p=r(),o=!0,c.forEach(e=>e(p))}).catch(t=>{e?.(void 0,t)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(l=e.storage)},clearStorage:()=>{l?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},a.skipHydration||m(),p||f},Ke=Ge}));function Je(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}function Ye(e){return!!e&&!!e[Nt]}function Xe(e){return e?Ze(e)||Array.isArray(e)||!!e[Mt]||!!e.constructor?.[Mt]||rt(e)||it(e):!1}function Ze(e){if(!e||typeof e!=`object`)return!1;let t=Pt(e);if(t===null)return!0;let n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;return n===Object?!0:typeof n==`function`&&Function.toString.call(n)===Ft}function Qe(e,t){$e(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function $e(e){let t=e[Nt];return t?t.type_:Array.isArray(e)?1:rt(e)?2:it(e)?3:0}function et(e,t){return $e(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function tt(e,t,n){let r=$e(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function nt(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function rt(e){return e instanceof Map}function it(e){return e instanceof Set}function at(e){return e.copy_||e.base_}function ot(e,t){if(rt(e))return new Map(e);if(it(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=Ze(e);if(t===!0||t===`class_only`&&!n){let t=Object.getOwnPropertyDescriptors(e);delete t[Nt];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Pt(e),t)}else{let t=Pt(e);return t!==null&&n?{...e}:Object.assign(Object.create(t),e)}}function st(e,t=!1){return lt(e)||Ye(e)||!Xe(e)?e:($e(e)>1&&Object.defineProperties(e,{set:{value:ct},add:{value:ct},clear:{value:ct},delete:{value:ct}}),Object.freeze(e),t&&Object.values(e).forEach(e=>st(e,!0)),e)}function ct(){Je(2)}function lt(e){return Object.isFrozen(e)}function ut(e){let t=It[e];return t||Je(0,e),t}function dt(){return Lt}function ft(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function pt(e,t){t&&(ut(`Patches`),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function mt(e){ht(e),e.drafts_.forEach(_t),e.drafts_=null}function ht(e){e===Lt&&(Lt=e.parent_)}function gt(e){return Lt=ft(Lt,e)}function _t(e){let t=e[Nt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function vt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[Nt].modified_&&(mt(t),Je(4)),Xe(e)&&(e=yt(t,e),t.parent_||xt(t,e)),t.patches_&&ut(`Patches`).generateReplacementPatches_(n[Nt].base_,e,t.patches_,t.inversePatches_)):e=yt(t,n,[]),mt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===jt?void 0:e}function yt(e,t,n){if(lt(t))return t;let r=t[Nt];if(!r)return Qe(t,(i,a)=>bt(e,r,t,i,a,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return xt(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;let t=r.copy_,i=t,a=!1;r.type_===3&&(i=new Set(t),t.clear(),a=!0),Qe(i,(i,o)=>bt(e,r,t,i,o,n,a)),xt(e,t,!1),n&&e.patches_&&ut(`Patches`).generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function bt(e,t,n,r,i,a,o){if(Ye(i)){let o=yt(e,i,a&&t&&t.type_!==3&&!et(t.assigned_,r)?a.concat(r):void 0);if(tt(n,r,o),Ye(o))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(Xe(i)&&!lt(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;yt(e,i),(!t||!t.scope_.parent_)&&typeof r!=`symbol`&&(rt(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&xt(e,i)}}function xt(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&st(t,n)}function St(e,t){let n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:dt(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,a=Rt;n&&(i=[r],a=zt);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}function Ct(e,t){let n=e[Nt];return(n?at(n):e)[t]}function wt(e,t,n){let r=Tt(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}function Tt(e,t){if(!(t in e))return;let n=Pt(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Pt(n)}}function Et(e){e.modified_||(e.modified_=!0,e.parent_&&Et(e.parent_))}function Dt(e){e.copy_||=ot(e.base_,e.scope_.immer_.useStrictShallowCopy_)}function Ot(e,t){let n=rt(e)?ut(`MapSet`).proxyMap_(e,t):it(e)?ut(`MapSet`).proxySet_(e,t):St(e,t);return(t?t.scope_:dt()).drafts_.push(n),n}function kt(e){return Ye(e)||Je(10,e),At(e)}function At(e){if(!Xe(e)||lt(e))return e;let t=e[Nt],n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ot(e,t.scope_.immer_.useStrictShallowCopy_)}else n=ot(e,!0);return Qe(n,(e,t)=>{tt(n,e,At(t))}),t&&(t.finalized_=!1),n}var jt,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut=o((()=>{jt=Symbol.for(`immer-nothing`),Mt=Symbol.for(`immer-draftable`),Nt=Symbol.for(`immer-state`),Pt=Object.getPrototypeOf,Ft=Object.prototype.constructor.toString(),It={},Rt={get(e,t){if(t===Nt)return e;let n=at(e);if(!et(n,t))return wt(e,n,t);let r=n[t];return e.finalized_||!Xe(r)?r:r===Ct(e.base_,t)?(Dt(e),e.copy_[t]=Ot(r,e)):r},has(e,t){return t in at(e)},ownKeys(e){return Reflect.ownKeys(at(e))},set(e,t,n){let r=Tt(at(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=Ct(at(e),t),i=r?.[Nt];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(nt(n,r)&&(n!==void 0||et(e.base_,t)))return!0;Dt(e),Et(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_[t]=!0,!0)},deleteProperty(e,t){return Ct(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Dt(e),Et(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=at(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty(){Je(11)},getPrototypeOf(e){return Pt(e.base_)},setPrototypeOf(){Je(12)}},zt={},Qe(Rt,(e,t)=>{zt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),zt.deleteProperty=function(e,t){return zt.set.call(this,e,t,void 0)},zt.set=function(e,t,n){return Rt.set.call(this,e[0],t,n,e[0])},Bt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if(typeof e==`function`&&typeof t!=`function`){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}typeof t!=`function`&&Je(6),n!==void 0&&typeof n!=`function`&&Je(7);let r;if(Xe(e)){let i=gt(this),a=Ot(e,void 0),o=!0;try{r=t(a),o=!1}finally{o?mt(i):ht(i)}return pt(i,n),vt(r,i)}else if(!e||typeof e!=`object`){if(r=t(e),r===void 0&&(r=e),r===jt&&(r=void 0),this.autoFreeze_&&st(r,!0),n){let t=[],i=[];ut(`Patches`).generateReplacementPatches_(e,r,t,i),n(t,i)}return r}else Je(1,e)},this.produceWithPatches=(e,t)=>{if(typeof e==`function`)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy==`boolean`&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Xe(e)||Je(8),Ye(e)&&(e=kt(e));let t=gt(this),n=Ot(e,void 0);return n[Nt].isManual_=!0,ht(t),n}finishDraft(e,t){let n=e&&e[Nt];(!n||!n.isManual_)&&Je(9);let{scope_:r}=n;return pt(r,t),vt(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=ut(`Patches`).applyPatches_;return Ye(e)?r(e,t):this.produce(e,e=>r(e,t))}},Vt=new Bt,Ht=Vt.produce})),Wt,Gt,Kt=o((()=>{Ut(),Wt=e=>(t,n,r)=>(r.setState=(e,n,...r)=>t(typeof e==`function`?Ht(e):e,n,...r),e(r.setState,n,r)),Gt=Wt}));function qt(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Jt(e,t){let n,r=()=>{if(n)return n;let r=indexedDB.open(e);return r.onupgradeneeded=()=>r.result.createObjectStore(t),n=qt(r),n.then(e=>{e.onclose=()=>n=void 0},()=>{}),n};return(e,n)=>r().then(r=>n(r.transaction(t,e).objectStore(t)))}function Yt(){return tn||=Jt(`keyval-store`,`keyval`),tn}function Xt(e,t=Yt()){return t(`readonly`,t=>qt(t.get(e)))}function Zt(e,t,n=Yt()){return n(`readwrite`,n=>(n.put(t,e),qt(n.transaction)))}function Qt(e,t=Yt()){return t(`readwrite`,t=>(t.delete(e),qt(t.transaction)))}function $t(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},qt(e.transaction)}function en(e=Yt()){return e(`readonly`,e=>{if(e.getAllKeys)return qt(e.getAllKeys());let t=[];return $t(e,e=>t.push(e.key)).then(()=>t)})}var tn,nn=o((()=>{}));function rn(e){let{name:t,storageType:n,version:r=1,migrate:i}=e;switch(n){case`localStorage`:return an(t,r,i);case`sessionStorage`:return on(t,r,i);case`indexedDB`:return sn(t,r,i);default:throw Error(`Unsupported storage type: ${n}`)}}function an(e,t,n){return{getItem:async e=>{try{let r=localStorage.getItem(e);if(r===null)return null;let i=JSON.parse(r),a=i.version||1;if(n&&a!==t){let r=n(i.state,a),o={state:r,version:t};return localStorage.setItem(e,JSON.stringify(o)),r}return i.state||i}catch(t){return console.error(`Failed to get item from localStorage [${e}]:`,t),null}},setItem:async(e,n)=>{try{let r;if(typeof n==`string`)try{r=JSON.parse(n)}catch{r=n}else r=n;let i={state:r,version:t,updatedAt:Date.now()};localStorage.setItem(e,JSON.stringify(i))}catch(t){console.error(`Failed to set item in localStorage [${e}]:`,t)}},removeItem:async e=>{try{localStorage.removeItem(e)}catch(t){console.error(`Failed to remove item from localStorage [${e}]:`,t)}}}}function on(e,t,n){return{getItem:async e=>{try{let r=sessionStorage.getItem(e);if(r===null)return null;let i=JSON.parse(r),a=i.version||1;if(n&&a!==t){let r=n(i.state,a),o={state:r,version:t};return sessionStorage.setItem(e,JSON.stringify(o)),r}return i.state||i}catch(t){return console.error(`Failed to get item from sessionStorage [${e}]:`,t),null}},setItem:async(e,n)=>{try{let r;if(typeof n==`string`)try{r=JSON.parse(n)}catch{r=n}else r=n;let i={state:r,version:t,updatedAt:Date.now()};sessionStorage.setItem(e,JSON.stringify(i))}catch(t){console.error(`Failed to set item in sessionStorage [${e}]:`,t)}},removeItem:async e=>{try{sessionStorage.removeItem(e)}catch(t){console.error(`Failed to remove item from sessionStorage [${e}]:`,t)}}}}function sn(e,t,n){let r=e.includes(`memo`)?cn:ln;return{getItem:async e=>{try{let i=await Xt(e,r);if(i===void 0)return null;let a=i.version||1;if(n&&a!==t){let o=n(i.state,a);return await Zt(e,{state:o,version:t,updatedAt:Date.now()},r),o}return i.state||i}catch(t){return console.error(`Failed to get item from IndexedDB [${e}]:`,t),null}},setItem:async(e,n)=>{try{let i;if(typeof n==`string`)try{i=JSON.parse(n)}catch{i=n}else i=n;await Zt(e,{state:i,version:t,updatedAt:Date.now()},r)}catch(r){if(console.error(`Failed to set item in IndexedDB [${e}]:`,r),(typeof n==`string`?n:JSON.stringify(n)).length<5e4)try{let r;if(typeof n==`string`)try{r=JSON.parse(n)}catch{r=n}else r=n;localStorage.setItem(e,JSON.stringify({state:r,version:t,fallback:!0}))}catch(t){console.error(`Fallback to localStorage also failed [${e}]:`,t)}}},removeItem:async e=>{try{await Qt(e,r),localStorage.removeItem(e)}catch(t){console.error(`Failed to remove item from IndexedDB [${e}]:`,t)}}}}var cn,ln,un,dn=o((()=>{nn(),cn=Jt(`thino-memo-db`,`memo-data`),ln=Jt(`thino-height-db`,`height-cache`),un={ui:rn({name:`ui-state`,storageType:`localStorage`,version:1}),memos:rn({name:`memo-data`,storageType:`indexedDB`,version:1,migrate:(e,t)=>{if(t<1&&e.memos){let t=Array.isArray(e.memos)?e.memos:[];return{...e,memos:t.filter(e=>e&&e.id)}}return e}}),heightCache:rn({name:`height-cache`,storageType:`sessionStorage`,version:1}),queries:rn({name:`query-data`,storageType:`localStorage`,version:1})}})),fn,pn=o((()=>{Me(),qe(),Kt(),dn(),fn=Ae()(Be(Ke(Gt(e=>({user:null,signIn:t=>e(e=>{e.user=t}),signOut:()=>e(e=>{e.user=null}),updateUser:t=>e(e=>{e.user&&Object.assign(e.user,t)})})),{name:`user-store-cache`,storage:un.ui,partialize:e=>({user:e.user?{id:e.user.id,nickname:e.user.nickname,email:e.user.email,role:e.user.role}:null}),version:1}),{name:`user-store`}))})),mn,hn=o((()=>{mn={}})),gn,_n=o((()=>{gn={}})),vn,yn=o((()=>{vn={welcome:`Velkommen til Thino`,ribbonIconTitle:`Thino`,to:`til`,months:[`Januar`,`Februar`,`Marts`,`April`,`Maj`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`December`],monthsShort:[`Jan.`,`Feb.`,`Mar.`,`Apr.`,`Maj`,`Jun.`,`Jul.`,`Aug.`,`Sep.`,`Okt.`,`Nov.`,`Dec.`],weekDays:[`Søndag`,`Mandag`,`Tirsdag`,`Onsdag`,`Torsdag`,`Fredag`,`Lørdag`],weekDaysShort:[`Søn`,`Man`,`Tir`,`Ons`,`Tor`,`Fre`,`Lør`],year:null,month:null,"Basic Options":`Grundlæggende indstillinger`,"User name":`Brugernavn`,"Set your user name here. 'Memos 😏' By default":`Indstil dit brugernavn her. 'Thino 😏' som standard`,'You can set target heading like "# Heading" to control data location':`Du kan indstille målrubrik som "# Rubrik" for at kontrollere dataplacering`,"Insert after heading":`Indsæt efter rubrik`,"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.":`Du bør indstille samme rubrik nedenfor, hvis du vil indsætte og behandle thino under samme rubrik.`,"Allows admonitions to be created using ":`Tillader at advarselsbokse oprettes ved hjælp af `,"Process Memos below":`Behandl thino nedenfor`,"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.":`Hvis tomt, vil Thino-grænsefladen vise alt thino-indhold; hvis en titel er angivet, vil Thino-grænsefladen kun vise indholdet under den titel, og indhold skrevet andetsteds vil ikke blive vist.`,"Save Memo button label":`Gem thino-knappens etiket`,"The text shown on the save Memo button in the UI. 'NOTEIT' by default.":`Teksten vist på gem thino-knappen i brugergrænsefladen. 'NOTEIT' som standard.`,"Focus on editor when open memos":`Fokuser på editor når thino åbnes`,"Focus on editor when open memos. Focus by default.":`Fokuser på editor når thino åbnes. Fokus som standard.`,"Open daily memos with open memos":`Åbn daglig thino med åben thino`,"Open daily memos with open memos. Open by default.":`Åbn daglig thino med åben thino. Åben som standard.`,"Open Memos when obsidian opens":`Åbn Thino når obsidian åbnes`,"When enable this, Memos will open when Obsidian opens. False by default.":`Når dette er aktiveret, vil Thino åbne når Obsidian åbnes. Deaktiveret som standard.`,"Hide done tasks in Memo list":`Skjul færdige opgaver i Thino-listen`,"Hide all done tasks in Memo list. Show done tasks by default.":`Skjul alle færdige opgaver i Thino-listen. Vis færdige opgaver som standard.`,"Advanced Options":`Avancerede indstillinger`,"UI language for date":`UI-sprog for dato`,"Translates the date UI language. Only 'en' and 'zh' are available.":`Oversætter dato UI-sproget. Kun 'en' og 'zh' er tilgængelige.`,"Default prefix when save thino":`Standard præfiks ved gem thino`,"Set the default prefix when create memo, 'List' by default.":`Indstil standard præfiks ved oprettelse af thino, 'Liste' som standard.`,"Default insert date format":`Standard indsæt datoformat`,"Set the default date format when insert date by @, 'Tasks' by default.":`Indstil standard datoformat ved indsættelse af dato med @, 'Opgaver' som standard.`,"Default editor position on mobile":`Standard editor position på mobil`,"Set the default editor position on Mobile, 'Top' by default.":`Indstil standard editor position på mobil, 'Top' som standard.`,"Use button to show editor on mobile":`Brug knap til at vise editor på mobil`,"Set a float button to call editor on mobile. Only when editor located at the bottom works.":`Indstil en flydende knap til at kalde editor på mobil. Virker kun når editor er placeret i bunden.`,"Show Time When Copy Results":`Vis tid ved kopiering af resultater`,"Show time when you copy results, like 12:00. Copy time by default.":`Vis tid når du kopierer resultater, som 12:00. Kopier tid som standard.`,"Show Date When Copy Results":`Vis dato ved kopiering af resultater`,"Show date when you copy results, like [[2022-01-01]]. Copy date by default.":`Vis dato når du kopierer resultater, som [[2022-01-01]]. Kopier dato som standard.`,"Add Blank Line Between Different Date":`Tilføj tom linje mellem forskellige datoer`,"Add blank line when copy result with date. No blank line by default.":`Tilføj tom linje når du kopierer resultat med dato. Ingen tom linje som standard.`,"Share Options":`Delingsindstillinger`,"Share Memos Image Footer Start":`Del Thino-billede fodtekst start`,"Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":`Indstil hvad du vil her, brug {ThinoNum} for at vise antal thino, {UsedDay} for dage. '{ThinoNum} Thino {UsedDay} Dage' som standard`,"Share Memos Image Footer End":`Del Thino-billede fodtekst slut`,"Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":`Indstil hvad du vil her, brug {UserName} som dit brugernavn. '✍️ Af {UserName}' som standard`,"Save Shared Image To Folder For Mobile":`Gem delt billede til mappe for mobil`,"Save image to folder for mobile. False by Default":`Gem billede til mappe for mobil. Deaktiveret som standard`,"Say Thank You":`Sig tak`,Donate:`Donér`,"If you like this plugin, consider donating to support continued development:":`Hvis du kan lide dette plugin, overvej at donere for at støtte fortsat udvikling:`,"File Name of Recycle Bin":`Filnavn på papirkurv`,"Set the filename for recycle bin. 'delete' By default":`Indstil filnavnet for papirkurven. 'slet' som standard`,"File Name of Query File":`Filnavn på forespørgselsfil`,"Set the filename for query file. 'query' By default":`Indstil filnavnet for forespørgselsfilen. 'forespørgsel' som standard`,"Use Tags In Vault":`Brug tags i boks`,"Use tags in vault rather than only in Memos. False by default.":`Brug tags i boks i stedet for kun i Thino. Deaktiveret som standard.`,"Ready to convert image into background":`Klar til at konvertere billede til baggrund`,List:`Liste`,Task:`Opgave`,Top:`Top`,Bottom:`Bund`,TAG:`TAG`,DAY:`DAG`,QUERY:`FORESPØRGSEL`,EDIT:`REDIGER`,PIN:`FASTGØR`,UNPIN:`FRIGØR`,DELETE:`SLET`,"CONFIRM!":`BEKRÆFT!`,"CREATE FILTER":`OPRET FILTER`,"Comment it...":`Kommenter det...`,Settings:`Indstillinger`,"Recycle bin":`Papirkurv`,"About Me":`Om mig`,"Fetching data...":`Henter data...`,"Here is No Memos.":`Her er ingen Thino.`,"Frequently Used Tags":`Hyppigt brugte tags`,"What do you think now...":`Hvad tænker du nu...`,READ:`LÆS`,MARK:`MARKÉR`,SHARE:`DEL`,SOURCE:`KILDE`,RESTORE:`GENDAN`,ARCHIVE:`Arkiv`,"Daily Review":`Daglig gennemgang`,"DELETE AT":`SLETTET DEN`,"Noooop!":`Neeej!`,"All Data is Loaded 🎉":`Alle data er indlæst 🎉`,"Quick filter":`Hurtig filter`,TYPE:`TYPE`,LINKED:`LINKET`,"NO TAGS":`INGEN TAGS`,"HAS LINKS":`HAR LINKS`,"HAS IMAGES":`HAR BILLEDER`,INCLUDE:`INKLUDER`,EXCLUDE:`EKSKLUDER`,TEXT:`TEKST`,IS:`ER`,AND:`OG`,OR:`ELLER`,LIST:`LISTE`,ISNOT:`ER IKKE`,PATH:`STI`,METADATA:`METADATA`,SELECT:`VÆLG`,"ADD FILTER TERMS":`TILFØJ FILTERBETINGELSER`,FILTER:`FILTER`,Filter:`Filter`,TITLE:`TITEL`,"CREATE QUERY":`OPRET FORESPØRGSEL`,"EDIT QUERY":`REDIGER FORESPØRGSEL`,MATCH:`MATCH`,TIMES:`GANGE`,"Share Memo Image":`Del Thino-billede`,"↗Click the button to save":`↗Klik på knappen for at gemme`,"Image is generating...":`Billede genereres...`,"Image is loading...":`Billede indlæses...`,"Loading...":`Indlæser...`,"😟 Cannot load image, image link maybe broken":`😟 Kan ikke indlæse billede, billedlink er måske brudt`,"Daily Memos":`Daglige Thino`,"CANCEL EDIT":`ANNULLER REDIGERING`,"LINK TO THE":`LINK TIL`,"Mobile Options":`Mobilindstillinger`,"Experimental Options":`Eksperimentelle indstillinger`,"Don't support web image yet, please input image path in vault":`Understøtter ikke webbilleder endnu, indtast venligst billedsti i boksen`,"Background Image in Dark Theme":`Baggrundsbillede i mørkt tema`,"Background Image in Light Theme":`Baggrundsbillede i lyst tema`,'Set background image in dark theme. Set something like "Daily/one.png"':`Indstil baggrundsbillede i mørkt tema. Indstil noget som "Daglig/et.png"`,'Set background image in light theme. Set something like "Daily/one.png"':`Indstil baggrundsbillede i lyst tema. Indstil noget som "Daglig/et.png"`,'Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':`Indstil standard thino-komposition, du bør bruge {TIME} som "TT:mm" og {CONTENT} som indhold. "{TIME} {CONTENT}" som standard`,"Default Memo Composition":`[Forældet] Standard Thino-komposition`,"Show Tasks Label":`Vis opgaveetiket`,"Show tasks label near the time text. False by default":`Vis opgaveetiket nær tidsteksten. Deaktiveret som standard`,"Please Open Memos First":`Åbn venligst Thino først`,DATE:`DATO`,OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:`OBSIDIAN_NLDATES_PLUGIN_IKKE_AKTIVERET`,BEFORE:`FØR`,AFTER:`EFTER`,"Allow Comments On Memos":`Tillad kommentarer på Thino`,"You can comment on memos. False by default":`Du kan kommentere på thino. Deaktiveret som standard`,Import:`Importer`,"TITLE CANNOT BE NULL!":`TITEL KAN IKKE VÆRE TOM!`,"FILTER CANNOT BE NULL!":`FILTER KAN IKKE VÆRE TOMT!`,"Comments In Original DailyNotes/Notes":`Kommentarer i originale daglige noter/noter`,"You should install Dataview Plugin ver 0.5.9 or later to use this feature.":`Du bør installere Dataview Plugin ver 0.5.9 eller senere for at bruge denne funktion.`,"Open Memos Successfully":`Åbn Thino med succes`,"Fetch Memos Error":`😭 Hentningsfejl`,"Copied to clipboard Successfully":`Kopieret til udklipsholder med succes`,"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":`Kontroller om du har åbnet Daily Notes Plugin eller Periodic Notes Plugin`,"Please finish the last filter setting first":`Afslut venligst den sidste filterindstilling først`,"Close Memos Successfully":`Luk Thino med succes`,"Insert as Memo":`Indsæt som Thino`,"Insert file as memo content":`Indsæt fil som thino-indhold`,"Image load failed":`Billedindlæsning mislykkedes`,"Content cannot be empty":`Indhold kan ikke være tomt`,"Unable to create new file.":`Kan ikke oprette ny fil.`,"Failed to fetch deleted memos: ":`Kunne ikke hente slettede thino: `,"RESTORE SUCCEED":`GENDANNELSE LYKKEDES`,"DELETE SUCCEED":`SLETNING LYKKEDES`,"Save Memo button icon":`Gem Thino-knappens ikon`,"The icon shown on the save Memo button in the UI.":`Ikonet vist på gem Thino-knappen i brugergrænsefladen.`,"Fetch Memos From Particular Notes":`Hent Thino fra bestemte noter`,'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':`Du kan indstille enhver Dataview-forespørgsel for thino for at hente det. Alle thino i disse noter vil blive vist på listen. "#memo" som standard`,"Allow Memos to Fetch Memo from Notes":`Tillad Thino at hente Thino fra noter`,"Use Memos to manage all memos in your notes, not only in daily notes. False by default":`Brug Thino til at administrere alle thino i dine noter, ikke kun i daglige noter. Deaktiveret som standard`,"Always Show Memo Comments":`Vis altid Thino-kommentarer`,"Always show memo comments on memos. False by default":`Vis altid thino-kommentarer på thino. Deaktiveret som standard`,"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":`Du har ikke indstillet mappe til daglige noter i hverken periodic-notes eller daily-notes plugins.`,"Please check your daily note plugin OR periodic notes plugin settings":`Kontroller venligst dine indstillinger for daily note plugin ELLER periodic notes plugin`,"Use which plugin's default configuration":`Brug hvilket plugins standardkonfiguration`,"Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":`Thino bruger pluginets standardkonfiguration til at hente thino fra daglig, 'Daglig' som standard.`,Daily:`Daglig`,"Always Show Leaf Sidebar on PC":`Vis altid blad-sidepanel på PC`,"Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":`Vis venstre sidepanel på PC/tablet selv når bladbredden er mindre end 875px. Deaktiveret som standard.`,"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":`Du har ikke indstillet format for daglige noter i hverken periodic-notes eller daily-notes plugins.`,"fetch more":`hent mere`,"Search all settings":`Søg i alle indstillinger`,General:`Generelt`,Theme:`Tema`,Share:`Del`,Advanced:`Avanceret`,Thino:`Thino`,"Random Review":`Tilfældig gennemgang`,"ARCHIVED AT":`ARKIVERET DEN`,"Failed to get memos from daily notes":`Kunne ikke hente thino fra daglige noter`,"Failed to delete memo":`Kunne ikke slette thino`,"CTRL + ENTER to save":`CTRL + ENTER for at gemme`,"Started from":`Startet fra`,"Custom Background Image":`Tilpasset baggrundsbillede`,"Set custom background image.":`Indstil tilpasset baggrundsbillede.`,"Custom Memo Footer":`Tilpasset Thino-fodtekst`,"Set custom memo footer.":`Indstil tilpasset thino-fodtekst.`,"Heatmap Color Scheme":`Varmekort farveskema`,"Set different color scheme for heatmap.":`Indstil forskelligt farveskema for varmekort.`,"Enable Local Http Server":`Aktiver lokal Http-server`,"Memos Http Server Port":`Thino Http-server port`,"Set memos http server port to listen. '43999' by default":`Indstil thino http-server port til at lytte. '43999' som standard`,"Default Editor Mode":`Standard editor-tilstand`,"Live-Preview Mode OR Source Mode.":`Live-forhåndsvisning tilstand/Kildetilstand.`,"Save type for Thino":`Gem type for Thino`,DAILY:`DAGLIG`,MULTI:`MULTI`,CANVAS:`LÆRRED`,ALL:`ALLE`,FILE:`FIL`,TODO:`TODO`,DONE:`FÆRDIG`,JOURNAL:`JOURNAL`,OTHER:`ANDET`,"Failed to create daily note, check if it exists.":`Kunne ikke oprette daglig note, kontroller om den eksisterer.`,"Failed to create daily note. Please check if you created a folder for daily notes.":`Kunne ikke oprette daglig note. Kontroller venligst om du har oprettet en mappe til daglige noter.`,"After you verify your account, please refresh this page.":`Efter du har verificeret din konto, opdater venligst denne side.`,Verify:`Verificer`,"Oops! You forget to verify insider account":`Ups! Du glemte at verificere insider-konto`,"If you have any questions, please contact us.":`Hvis du har spørgsmål, kontakt os venligst.`,"Delete Thino Directly":`Slet Thino direkte`,"When delete thino directly, it will not be moved to trash. False by default.":`Når du sletter thino direkte, vil det ikke blive flyttet til papirkurven. Deaktiveret som standard.`,"Enable opening thino globally":`Aktiver åbning af thino globalt`,"Enable opening thino globally. False by default.":`Aktiver åbning af thino globalt. Deaktiveret som standard.`,"Key for opening thino globally":`Tast for at åbne thino globalt`,"Set key for opening thino globally. CTRL + SHIFT + T by default.":`Indstil tast for at åbne thino globalt. CTRL + SHIFT + T som standard.`,"Key for showing thino globally":`Tast for at vise thino globalt`,"Set key for showing thino globally. CTRL + SHIFT + E by default.":`Indstil tast for at vise thino globalt. CTRL + SHIFT + E som standard.`,"Get activation code":`Få aktiveringskode`,"Input activation code here":`Indtast aktiveringskode her`,"Copy Thino id":`Kopier Thino-id`,"Activate Pro Version":`Aktiver Pro-version`,"Please copy Thino id first":`Kopier venligst Thino-id først`,'You can set folder name with file name like "folder/file"':`Du kan indstille mappenavn med filnavn som "mappe/fil"`,'You can set folder name like "folder1/folder2/folder3" to create sub-folder':`Du kan indstille mappenavn som "mappe1/mappe2/mappe3" for at oprette undermappe`,"Default save type":`Standard gem placering`,'Set the default save type for thino. "DAILY" by default':`Indstil standard gem type for thino. "DAGLIG" som standard`,"Sync Thino via PKMer":`Synkroniser Thino via PKMer`,Unlink:`Fjern link`,Link:`Link`,"Connect to PKMer Sync, you can check it in ":`Forbind til PKMer Sync, du kan tjekke det i `,"PKMer Sync":`PKMer Sync`,"Remove successfully":`Fjernet med succes`,Deactivate:`Deaktiver`,Remove:`Fjern`,"Confirm?":`Bekræft?`,"Sync Status":`Synkroniseringsstatus`,"Start or stop sync":`Start eller stop synkronisering`,"Stop sync successfully":`Stop synkronisering med succes`,"Start sync successfully":`Start synkronisering med succes`,Stop:`Stop`,Start:`Start`,"Show thino near mouse":`Vis thino nær mus`,"Query not found":`Forespørgsel ikke fundet`,"Send to clipboard successfully":`Sendt til udklipsholder med succes`,"Thino - Failed to start HTTP server, please check the port is available.":`Thino - Kunne ikke starte HTTP-server, kontroller venligst om porten er tilgængelig.`,"Thino - Started HTTP server on port":`Thino - Startede HTTP-server på port`,"Thino - Terminated HTTP server":`Thino - Afsluttede HTTP-server`,"File not exist":`Fil eksisterer ikke`,"Thino not found":`Thino ikke fundet`,"File not found for the given thino path, is creating a new file":`Fil ikke fundet for den angivne thino-sti, opretter en ny fil`,"Saved sync token successfully":`Gemte synkroniseringstoken med succes`,"Failed to find daily notes folder":`Kunne ikke finde mappe til daglige noter`,"Please install obsidian-hover-editor plugin first":`Installer venligst obsidian-hover-editor plugin først`,"Copied app id successfully":`Kopierede app-id med succes`,"Please input token first":`Indtast venligst token først`,"Please enable sync first":`Aktiver venligst synkronisering først`,"Init Failed":`Initialisering mislykkedes`,"Verify successfully":`Verificeret med succes`,"Failed to verify":`Kunne ikke verificere`,"Folder not found for the given thino path, is creating a new folder":`Mappe ikke fundet for den angivne thino-sti, opretter en ny mappe`,"File not found for the given thino path":`Fil ikke fundet for den angivne thino-sti`,"Failed to read current daily note, check if it exists.":`Kunne ikke læse aktuel daglig note, kontroller om den eksisterer.`,"Failed to save":`Kunne ikke gemme`,"Failed to login, please login again":`Kunne ikke logge ind, log venligst ind igen`,"COPY FAILED":`KOPIERING MISLYKKEDES`,"COPY SUCCEED":`KOPIERING LYKKEDES`,"Copy selected text":`Kopier valgt tekst`,"Copy thino":`Kopier thino`,COPY:`KOPIER`,"This is a pro feature, please upgrade to pro version to use it.":`Dette er en pro-funktion, opgrader venligst til pro-versionen for at bruge den.`,"You can get pro version from: ":`Du kan få pro-versionen fra: `,Save:`Gem`,Cancel:`Annuller`,"Thino Daily Target":`Thino dagligt mål`,Input:`Input`,"#Tag":`#Tag`,"to create tag":`for at oprette tag`,"You have verified your account. Congrats!":`Du har verificeret din konto. Tillykke!`,"Pro features":`Pro-funktioner`,"Target Thino Count":`Målrettet Thino-antal`,on:`på`,"Switch waterfall view":`Skift vandfald-visning`,"Switch view":`Skift visning`,"Switch list view":`Skift listevisning`,"Set daily target":`Indstil dagligt mål`,"Thino Save To: ":`Thino gem til: `,"Enter fullscreen mode":`Gå til fuldskærmstilstand`,"Exit fullscreen mode":`Afslut fuldskærmstilstand`,words:`ord`,word:`ord`,"Return To Home Page":`Tilbage til hjemmesiden`,"No thinos to review!":`Ingen thinos at gennemgå!`,"Thinos to review":`Thinos til gennemgang`,"Start Review":`Start gennemgang`,Hard:`Svær`,Good:`God`,Easy:`Let`,Again:`Igen`,"Clear all review data":`Ryd alle gennemgangsdata`,"Daily Progress":`Daglig fremgang`,"Show stats":`Vis statistik`,"Hide stats":`Skjul statistik`,Remaining:`Resterende`,"Total Reviews":`Samlede gennemgange`,"Today, you have reviewed all your thinos!":`I dag har du gennemgået alle dine thinos!`,"Daily review limit reached! Come back tomorrow.":`Daglig gennemgangsgrænse nået! Kom tilbage i morgen.`,"Open thino in center window":`Åbn thino i centervindue`,"Open thino in float window":`Åbn thino i flydende vindue`,"Open thino in right sidebar":`Åbn thino i højre sidepanel`,"Open thino in left sidebar":`Åbn thino i venstre sidepanel`,"Show thino editor":`Vis thino-editor`,"Toggle minimal mode":`Skift minimal tilstand`,"Focus on thino editor":`Fokuser på thino-editor`,"ReSync web thinos to local":`Gensynkroniser web-thinos til lokal`,"Sync local thinos to web":`Synkroniser lokale thinos til web`,"Show daily thino":`Vis daglig thino`,"Focus on search bar":`Fokuser på søgefelt`,"Show-thino in popover(Hover editor)":`Vis-thino i popover(Hover editor)`,"Center window":`Centervindue`,"You should set the same heading below if you want to insert and process thino below the same heading.":`Du bør indstille samme rubrik nedenfor, hvis du vil indsætte og behandle thino under samme rubrik.`,"Float window":`Flydende vindue`,"Right sidebar":`Højre sidepanel`,"Left sidebar":`Venstre sidepanel`,"Save thino type when sync local":`Gem thino-type når lokal synkronisering`,"Set the default save thino type when sync local, FILE by default.":`Indstil standard gem type for thino når lokal synkronisering, FILE som standard.`,"Sync service":`Synkroniseringsservice`,"Pro verification status":`Pro-verificering status`,"Live-preview":`Live-preview`,Source:`Kilde`,"Global copy":`Global kopi`,"Set the folder name":`Indstil mappe-navn`,"Set the filename":`Indstil filnavn`,"Set the filename for current location file":`Indstil filnavn for aktuel sti`,"Switch calendar type":`Skift kalender-type`,alphabetical:`alfabetisk`,alphabeticalReverse:`alfabetiskReverse`,byCount:`byCount`,byCountReverse:`byCountReverse`,"Type here":`Type her`,Today:`I dag`,Yesterday:`I går`,"Last 7 days":`Sidste 7 dage`,"Last 30 days":`Sidste 30 dage`,"Last 90 days":`Sidste 90 dage`,"Last 180 days":`Sidste 180 dage`,"Last 365 days":`Sidste 365 dage`,Found:`Fundet`,"Copy filtered thinos":`Kopier filtrerede thinos`,"Bulk delete":`Bulk slet`,"Bulk archive":`Bulk arkiver`,"Bulk tag operation":`Bulk tag operation`,"Bulk restore":`Bulk gendan`,"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.":`Hvis du deaktiverer daglige notesplugin, kan det være, at thino ikke bliver slettet eller repareret korrekt. Aktiver plugin og prøv igen.`,Preview:`Forhåndsvisning`,"Set and save":`Indstil og gem`,"Show day mark in thino list":`Vis dagmarke i thino-liste`,"Show day mark on the top of daily range thino. False by default.":`Vis dagmarke i toppen af daglige thino-rækker. False som standard.`,"Click to expand or fold, Cmd+Click to show all thinos of the day":`Klik for at udvide eller fold, Cmd+Klik for at vise alle thinos af dagen`,"You can buy a license from":`Du kan købe en licens fra`,"No thinos in range":`Ingen thinos i række`,Month:`Måned`,Week:`Uge`,Day:`Dag`,Agenda:`Agenda`,Tomorrow:`I morgen`,Previous:`Forrige`,Next:`Næste`,"Search all columns...":`Søg i alle kolonner...`,"Basic Info":`Grundlæggende info`,"Additional Info":`Yderligere info`,"Created At":`Oprettet den`,Content:`Indhold`,"Thino Type":`Thino-type`,"Source Type":`Kildetype`,"Row status":`Række status`,Path:`Sti`,"Pinned Status":`Fastgjort status`,Table:`Tabel`,Chat:`Chat`,Moments:`Øjeblikke`,Waterfall:`Vandfald`,Calendar:`Kalender`,"Go to page":`Gå til side`,Page:`Side`,Show:`Vis`,rows:`rækker`,"Temp Filter":`Midlertidig filter`,"Open link directly in Thino view":`Åbn link direkte i Thino-visning`,"Day mark range":`Dagmærke-område`,"Set the range of day mark. Day by default.":`Indstil området for dagmærke. Dag som standard.`,"Thino is locked":`Thino er låst`,"Please unlock Thino by input password":`Lås venligst Thino op ved at indtaste adgangskode`,"Auto Download Image":`Auto-download billede`,"Auto download image when save to thino. 'false' by default":`Auto-download billede når der gemmes til thino. 'false' som standard`,"Thino Http IP Type":`Thino Http IP-type`,"Set Thino http server ip to listen. 'localhost' by default":`Indstil Thino http-server IP til at lytte. 'localhost' som standard`,"Password to lock Thino":`Adgangskode til at låse Thino`,Unlock:`Lås op`,Locked:`Låst`,"Password is incorrect":`Adgangskoden er forkert`,Lock:`Lås`,"Need password to unlock Thino":`Adgangskode påkrævet for at låse Thino op`,"You have not set a password or enable this feature yet":`Du har ikke indstillet en adgangskode eller aktiveret denne funktion endnu`,Password:`Adgangskode`,"Password for Thino":`Adgangskode til Thino`,"Please input your password to change password settings":`Indtast venligst din adgangskode for at ændre adgangskodeindstillinger`,"Please input your password":`Indtast venligst din adgangskode`,"Lock thino":`Lås thino`,date:`dato`,time:`tid`,event:`begivenhed`,"Add tag position":`Tilføj tag-position`,"Set the position of the tag when adding tag automatically":`Indstil positionen af tagget når der tilføjes tag automatisk`,"Add tag automatically":`Tilføj tag automatisk`,"Add tag to the end or beginning of the thino content when creating a thino and filtering tags":`Tilføj tag til slutningen eller begyndelsen af thino-indholdet når der oprettes en thino og filtreres tags`,"Add tag with new line":`Tilføj tag med ny linje`,"Add tag with new line when adding tag automatically":`Tilføj tag med ny linje når der tilføjes tag automatisk`,"Input to select more tags":`Indtast for at vælge flere tags`,"Tag Bulk Edit":`Tag masseredigering`,"Tag Bulk Select":`Tag massevalg`,"Exist Tags":`Eksisterende tags`,"Selected Tags":`Valgte tags`,"Click to remove exist tag":`Klik for at fjerne eksisterende tag`,"Click to remove selected tag":`Klik for at fjerne valgt tag`,"Select tags":`Vælg tags`,"Input to select exist tag":`Indtast for at vælge eksisterende tag`,Beginning:`Begyndelse`,End:`Slutning`,"Set the heading for saving thino":`Indstil overskriften for at gemme thino`,"# Heading":`# Overskrift`,"Chat view style":`Chat-visningsstil`,"Set the style of chat view":`Indstil stilen for chat-visning`,"Background image for moments view":`Baggrundsbillede for øjeblikke-visning`,"Set the background image for moments view":`Indstil baggrundsbilledet for øjeblikke-visning`,"Icon for moments/chat view/share image":`Ikon for øjeblikke/chat-visning/delt billede`,"Set the icon for moments/chat view/share image":`Indstil ikonet for øjeblikke/chat-visning/delt billede`,"Quote for moments view/share image":`Citat for øjeblikke-visning/delt billede`,"Set the quote for moments view/share image":`Indstil citatet for øjeblikke-visning/delt billede`,"Theme for Thino":`Tema for Thino`,"Set the theme for Thino":`Indstil temaet for Thino`,"Interface Details":`Grænsefladedetaljer`,"Task amount":`Opgavemængde`,"Thino status":`Thino-status`,"Used tags":`Brugte tags`,"Used days":`Brugte dage`,"Most active day":`Mest aktive dag`,"Most active hour":`Mest aktive time`,"Thino amount":`Thino-mængde`,"No content to generate.":`Intet indhold at generere.`,"Image generated successfully.":`Billede genereret med succes.`,"Failed to generate image.":`Kunne ikke generere billede.`,"Share filtered thinos as image":`Del filtrerede thinos som billede`,"Latest version":`Seneste version`,"Previous version":`Tidligere version`,"Thino update info":`Thino opdateringsinfo`,"Debug info copied to clipboard":`Fejlfindingsinfo kopieret til udklipsholder`,"Copy debug info":`Kopier fejlfindingsinfo`,"Failed to load changelog":`Kunne ikke indlæse ændringslog`,"View online":`Se online`,ChangeLog:`Ændringslog`,"Please open thino first":`Åbn venligst thino først`,"Insert editor":`Indsæt editor`,"Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":`Indstil venligst forskellige gemmeplacering for multi-fil-indstillinger i Thino. Dagbogsmappen overlapper med multi-fil-gemmeplaceringen, eller der er risiko for at den bliver læst gentagne gange.`,"Default time prefix for thino in daily notes":`Standard tidspræfiks for thino i daglige noter`,"Set default time prefix for thino in daily notes.":`Indstil standard tidspræfiks for thino i daglige noter.`,"Save image successfully":`Gem billede med succes`,"User quote":`Brugercitat`,"Set user quote for thino":`Indstil brugercitat for thino`,"User icon":`Brugerikon`,"Set user icon for thino. You can input http/https link or file path in vault.":`Indstil brugerikon for thino. Du kan indtaste http/https-link eller filsti i boks.`,"User info":`Brugerinfo`,"Copy filtered results":`Kopier filtrerede resultater`,"Share image":`Del billede`,Default:`Standard`,Gray:`Grå`,Grass:`Græs`,Flame:`Flamme`,Olive:`Oliven`,Ice:`Is`,Magenta:`Magenta`,"Daily notes":`Daglige noter`,Editor:`Editor`,"Append/prepend text when share to Thino":`Tilføj/foranstil tekst når der deles til Thino`,"Append text when share to Thino":`Tilføj tekst når der deles til Thino`,"Prepend text when share to Thino":`Foranstil tekst når der deles til Thino`,"Add newline when append/prepend text":`Tilføj ny linje når der tilføjes/foranstilles tekst`,"Input anything here":`Indtast hvad som helst her`,Prepend:`Foranstil`,Append:`Tilføj`,Both:`Begge`,None:`Ingen`,"Hide pinned group":`Skjul fastgjort gruppe`,"Hide pinned group in thino list. False by default.":`Skjul fastgjort gruppe i thino-liste. Falsk som standard.`,"Set the heading for the task type of thino, by default 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.":`Indstil overskriften for opgavetypen af thino, som standard vil det registrerede thino-indhold blive indsat i slutningen af dagbogen; hvis en titel er angivet, vil alt registreret thino-indhold blive ensartet kategoriseret under den titel.`,"Different insert target for different type":`Forskelligt indsætningsmål for forskellige typer`,"Toggle this to set different insert target for different type of thino, like task or list type of thino":`Skift dette for at indstille forskellige indsætningsmål for forskellige typer af thino, som opgave- eller listetyper af thino`,"You can set whole diary or only part of it":`Du kan indstille hele dagbogen eller kun en del af den`,"Set process target":`Indstil procesmål`,Custom:`Tilpasset`,"Whole diary":`Hele dagbogen`,"Set thino insert place":`Indstil thino indsætningssted`,"Set where to insert thino content":`Indstil hvor thino-indhold skal indsættes`,"End of the diary":`Slutningen af dagbogen`,"Custom location":`Tilpasset placering`,"Setting guide":`Indstillingsguide`,"Details settings":`Detaljerede indstillinger`,"Start Thino":`Start Thino`,"About Thino Pro":`Om Thino Pro`,Enabled:`Aktiveret`,Enable:`Aktiver`,"Daily notes folder":`Daglige noter-mappe`,"Set daily notes folder":`Indstil daglige noter-mappe`,"Daily note name format":`Daglig note navneformat`,"Set daily note name format":`Indstil daglig note navneformat`,"Daily note plugin":`Daglig note-plugin`,"Enable daily note plugin":`Aktiver daglig note-plugin`,Selected:`Valgt`,Select:`Vælg`,"A classic theme for Thino with a two-column layout":`Et klassisk tema for Thino med et to-kolonne layout`,Classic:`Klassisk`,"A modern theme for Thino with a three-column layout and some unique features.":`Et moderne tema for Thino med et tre-kolonne layout og nogle unikke funktioner.`,Modern:`Moderne`,"Go and enjoy Thino":`Gå og nyd Thino`,"Congrats! All settings done":`Tillykke! Alle indstillinger er færdige`,"Adjust settings that influence your user experience with Thino.":`Juster indstillinger der påvirker din brugeroplevelse med Thino.`,"Set preferences for using Thino":`Indstil præferencer for brug af Thino`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`Hvis du bruger Thino basisversionen, er aktivering af daglig note-plugin påkrævet. Konfigurer dets indstillinger for at arbejde effektivt med det.`,"Go with daily note plugin":`Gå med daglig note-plugin`,"Choose a theme for Thino.":`Vælg et tema til Thino.`,"Set theme for Thino":`Indstil tema for Thino`,"Set up your user info for Thino.":`Opsæt din brugerinfo for Thino.`,"Get started with Thino":`Kom i gang med Thino`,"Skip and start Thino":`Spring over og start Thino`,"Next step":`Næste trin`,"Back to previous step":`Tilbage til forrige trin`,"Click to enable =>":`Klik for at aktivere =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`Dette er Thino's sidepanel. Naviger til forskellige stier eller vælg forespørgselsfilter.`,"Click here and go to settings page.":`Klik her og gå til indstillingssiden.`,"Click here and go to different path.":`Klik her og gå til forskellige stier.`,"Select or create query filter here.":`Vælg eller opret forespørgselsfilter her.`,"See the status of Thinos here.":`Se status for Thinos her.`,"Search your thino quickly here.":`Søg hurtigt efter din thino her.`,"Edit or create your thino here.":`Rediger eller opret din thino her.`,"See your thinos here.":`Se dine thinos her.`,"See your time status of thinos here.":`Se din tidsstatus for thinos her.`,"See your tags here. Tags will be shown when thino contains tags.":`Se dine tags her. Tags vil blive vist når thino indeholder tags.`,Done:`Færdig`,"Thino is ready to use. ":`Thino er klar til brug. `,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`Du kan begynde at bruge Thino nu. Hvis du vil vide mere om Thino Pro, klik på knappen nedenfor.`,"Default time prefix":`Standard tidspræfiks`,"Append Text Action":`Tilføj tekst-handling`,"Prepend Text Action":`Foranstil tekst-handling`,Preset:`Forudindstilling`,"Select Tags":`Vælg Tags`,"It is not available on small view":`Det er ikke tilgængeligt på lille visning`,"Append text":`Tilføj tekst`,"Prepend text":`Foranstil tekst`,"Your daily note folder is not set correctly, please check your settings":`Din daglige note-mappe er ikke indstillet korrekt, tjek venligst dine indstillinger`,"Default sharing style":`Standard delingsstil`,"Set the default style for sharing thino, 'Modern' by default.":`Indstil standardstilen for deling af thino, "Moderne" som standard.`,Clean:`Ren`,Minimal:`Minimal`,Gradient:`Gradient`,"Thino share":`Thino-deling`,"Copy to clipboard failed":`Kopiering til udklipsholder mislykkedes`,"Copy to clipboard successfully":`Kopieret til udklipsholder med succes`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`Dit indhold er blevet kopieret til udklipsholderen og indsat i editoren. Prøv venligst igen`,"Share thino":`Del thino`,"Set file name after create thino":`Indstil filnavn efter oprettelse af thino`,"You can set file name after create thino. A input box will show when you create thino.":`Du kan indstille filnavn efter oprettelse af thino. En inputboks vil blive vist, når du opretter thino.`,SPLIT:`OPDEL`,"Split by Heading 1":`Opdel efter Overskrift 1`,"Split by Heading 2":`Opdel efter Overskrift 2`,"Split by Heading 3":`Opdel efter Overskrift 3`,"Insert task":`Indsæt opgave`,"All settings have been reset to default.":`Alle indstillinger er blevet nulstillet til standard.`,"Reset all Thino settings":`Nulstil alle Thino-indstillinger`,"Reset settings":`Nulstil indstillinger`,"Reset Thino settings to default settings.":`Nulstil Thino-indstillinger til standardindstillinger.`,"Task Management":`Opgavestyring`,"Append completed date when task done in thino":`Tilføj fuldført dato når opgave er udført i thino`,"Append completed date when task done in thino. False by default":`Tilføj fuldført dato når opgave er udført i thino. Falsk som standard`,"Set tag for single file that Thino indexes":`Indstil tag for enkelt fil som Thino indekserer`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"Når du indstiller et tag her, vil Thino indeksere denne fil indeholder dette tag og vise det i listen. Behøver ikke at tilføje `#`.","Set tag for file type file":`Indstil tag for filtype-fil`,"Set tag for multi type file":`Indstil tag for multi-type fil`,"Please input the tag":`Indtast venligst tagget`,"Merge thinos in to thino share image":`Flet thinos ind i thino-delingsbillede`,"Custom height for Thino content":`Tilpasset højde for Thino-indhold`,"Set custom height for Thino content. Like 200px or 20rem":`Indstil tilpasset højde for Thino-indhold. Som 200px eller 20rem`,"Input height":`Indtast højde`,"Submit issue":`Indsend problem`,"Current version":`Nuværende version`,"Bug report":`Fejlrapport`,"Click the button to copy debug info and open the issue page":`Klik på knappen for at kopiere fejlfindingsinfo og åbne problemsiden`,"Copy and go":`Kopier og gå`,"Debug info copied":`Fejlfindingsinfo kopieret`,"Feature request":`Funktionsanmodning`,"Submit your feature request to the issue page":`Indsend din funktionsanmodning til problemsiden`,Go:`Gå`,"Toggle query list visibility":`Skift synlighed for forespørgselsliste`,"Toggle tags visibility":`Skift synlighed for tags`,"Toggle sidebar visibility":`Skift synlighed for sidepanel`,Collapse:`Sammenfold`,Expand:`Udvid`,"Max height for collapse":`Maksimal højde for sammenfoldning`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`Den maksimale højde for thino-sammenfoldning, når indstillet til 0, vil thino ikke folde sammen. 0 som standard. (Dette er ikke linjeantal, det er højde i px.)`,"Render content":`Generer indhold`,"Optimize for Callout":`Optimer for Callout`,"Won't render content contains more than 3 callouts automatically. True by default":`Vil ikke automatisk gengive indhold, der indeholder mere end 3 callouts. Sand som standard`,"The value should be greater than":`Værdien skal være større end`,"Append Text":`Tilføj tekst`,"Prepend Text":`Foranstil tekst`,"Thino height when collapsed":`Thino-højde når sammenfoldet`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`Højden for thino når den er sammenfoldet, når indstillet til 0, vil thino ikke folde sammen. 100 som standard. (Dette er ikke linjeantal, det er højde i px.)`,"This option will allow you use other views when leaf width is not enough. False by default.":`Denne mulighed vil tillade dig at bruge andre visninger, når bladbredden ikke er tilstrækkelig. Falsk som standard.`,"Can select other views when leaf width is not enough":`Kan vælge andre visninger, når bladbredden ikke er tilstrækkelig`,"TRASH BOX":`PAPIRKURV`,"Wait templater to finish parse before insert thino":`Vent på at skabelonbehandler færdiggør parsing før indsættelse af thino`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`Denne mulighed vil tillade dig at vente på at skabelonbehandleren færdiggør parsing før indsættelse af thino, hvilket kan medføre at du skal bekræfte to gange mellem indsættelse af thino. Falsk som standard.`,"Get thino capture extension":`Få thino-optagelsesudvidelse`,"You can capture idea/text from chrome now.":`Du kan nu optage idé/tekst fra Chrome.`,"Open File":`Åbn fil`,"Exported CSV file":`Eksporteret CSV-fil`,"Updated At":`Opdateret den`,"Export to CSV":`Eksporter til CSV`,"Quick add button on mobile navbar":`Hurtig tilføj-knap på mobil navigationslinje`,"Always show status text":`Vis altid statustekst`,"Support filter by metadata from file":`Understøt filtrering efter metadata fra fil`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`Når dette aktiveres, kan du filtrere via metadata fra fil, som tags i fil. Men thinos fra lærred understøttes ikke. Falsk som standard.`,"Show source near timestamp in thino":`Vis kilde nær tidsstempel i thino`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`Når dette aktiveres, kan du se kilden nær tidsstemplet i thino. Du kan indstille titel i metadata for at overskrive dette. Falsk som standard.`,"Show Update Message":`Vis opdateringsbesked`,"Show update message when Thino is updated. True by default":`Vis opdateringsbesked når Thino opdateres. Sand som standard`,"Sync manually":`Synkroniser manuelt`,"Show all scrollbars":`Vis alle rullebjælker`,"TIME RANGE":`TIDSINTERVAL`,WITHIN:`INDEN FOR`,"7 days":`7 dage`,"14 days":`14 dage`,"30 days":`30 dage`,"3 months":`3 måneder`,"6 months":`6 måneder`,"1 year":`1 år`,"This week":`Denne uge`,"Last week":`Sidste uge`,"This month":`Denne måned`,"Last month":`Sidste måned`,"This year":`Dette år`,"Last year":`Sidste år`,"No history":`Ingen historik`,"Today Remaining":`Resterende i dag`,"Today Total":`I alt i dag`,"Historical Statistics":`Historisk statistik`,byTime:`Efter tid`,byTimeReverse:`Efter tid omvendt`,Stat:`Statistik`,Statistics:`Statistikker`,"Daily Thino Count":`Daglig Thino-antal`,Total:`Total`,thinos:`thinos`,"Thino Types":`Thino-typer`,"Distribution of thino types":`Fordeling af thino-typer`,"Thino Status":`Thino-status`,"Distribution of thino status":`Fordeling af thino-status`,"Popular Tags":`Populære tags`,"Top 10 most used tags":`Top 10 mest brugte tags`,"Thino Count":`Thino-antal`,"Hourly distribution":`Timefordeling`,"Current month":`Nuværende måned`,"Monthly distribution":`Månedlig fordeling`,"30 Days":`Sidste 30 dage`,Year:`År`,"Time Distribution":`Tidsfordeling`,"When do you write thinos":`Hvornår skriver du thinos`,"Content Length":`Indholdslængde`,"Distribution of thino lengths":`Fordeling af thino-længder`,"Daily Thinos":`Daglige Thinos`,"Show Time Distribution":`Vis tidsfordeling`,"Hide date picker":`Skjul datoværktøj`,"Show date picker":`Vis datoværktøj`,"Clear filter":`Ryd filter`,"Copy link":`Kopier link`,"Copy embed link":`Kopier indlejringslink`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter for at gemme thino`,"Fixed strings for thinos":`Faste strenge for thinos`,"Use fixed strings for thinos":`Brug faste strenge for thinos`,"Enable to add fixed strings at the beginning or end of thinos.":`Aktiver for at tilføje faste strenge i begyndelsen eller slutningen af thinos.`,"Fixed prefix for thinos":`Fast præfiks for thinos`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Tilføj denne streng i begyndelsen af hver thino. Understøtter pladsholdere som {{TIME|YYYYMMDDHHmmss}}.`,"Fixed suffix for thinos":`Fast suffiks for thinos`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Tilføj denne streng i slutningen af hver thino. Understøtter pladsholdere som {{TIME|YYYYMMDDHHmmss}}.`,"Word count exceeded":`Ordantal overskredet`,"Word count feature":`Ordtællingsfunktion`,"Enable real-time word count display in the editor":`Aktiver realtids ordtælling i editoren`,"Maximum word count":`Maksimalt ordantal`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`Indstil et maksimalt ordantal for thino. Editoren vil vise en advarsel når det overskrides. Indstil til 0 for ubegrænset.`,"No linked thinos found":`Ingen linkede thinos fundet`,"Reference links group":`Referencelinks-gruppe`,"Enable reference links group in thino.":`Aktiver referencelinks-gruppe i thino.`,"No reference links found":`Ingen referencelinks fundet`,"Outgoing Links":`Udgående links`,"Incoming Links":`Indgående links`,"Error fetching reference links":`Fejl ved hentning af referencelinks`,"Double click behavior":`Dobbeltklik-adfærd`,"Set the behavior when double click on a thino.":`Indstil adfærden ved dobbeltklik på en thino.`,"Open thino":`Åbn thino`,"Edit thino":`Rediger thino`,"Go to source":`Gå til kilde`,"Do nothing":`Gør ingenting`,"Use default header in mobile view":`Brug standardoverskrift i mobilvisning`,"Use default header in mobile view of thino rather than custom header.":`Brug standardoverskrift i mobilvisning af thino i stedet for en custom overskrift.`}})),bn,xn=o((()=>{bn={welcome:`Willkommen bei Thino`,ribbonIconTitle:`Thino`,to:`zu`,months:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`],monthsShort:[`Jan.`,`Feb.`,`März`,`Apr.`,`Mai`,`Juni`,`Juli`,`Aug.`,`Sept.`,`Okt.`,`Nov.`,`Dez.`],weekDays:[`Sonntag`,`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`],weekDaysShort:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],year:null,month:null,"Basic Options":`Grundeinstellungen`,"User name":`Benutzername`,"Set your user name here. 'Memos 😏' By default":`Setze deinen Benutzernamen hier. 'Thino 😏' als Standard`,'You can set target heading like "# Heading" to control data location':`Du kannst eine Zielüberschrift wie "# Überschrift" setzen, um den Datenspeicherort zu steuern`,"Insert after heading":`Nach Überschrift einfügen`,"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.":`Wenn leer gelassen, wird der aufgezeichnete Thino-Inhalt am Ende des Tagebuchs eingefügt; wenn ein Titel angegeben wird, werden alle aufgezeichneten Thino-Inhalte einheitlich unter diesem Titel kategorisiert.`,"Allows admonitions to be created using ":`Erlaubt das Erstellen von Hinweisen mit `,"Process Memos below":`Thinos unten verarbeiten`,"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.":`Wenn leer gelassen, zeigt die Thino-Oberfläche alle Thino-Aufzeichnungen an; wenn ein Titel angegeben wird, zeigt die Thino-Oberfläche nur die Inhalte unter diesem Titel an, und anderswo geschriebene Inhalte werden nicht angezeigt.`,"Save Memo button label":`Beschriftung des Thino-Speichern-Buttons`,"The text shown on the save Memo button in the UI. 'NOTEIT' by default.":`Der Text, der auf dem Thino-Speichern-Button in der Benutzeroberfläche angezeigt wird. 'NOTEIT' als Standard.`,"Focus on editor when open memos":`Fokus auf Editor beim Öffnen von Thino`,"Focus on editor when open memos. Focus by default.":`Fokus auf Editor beim Öffnen von Thino. Standardmäßig fokussiert.`,"Open daily memos with open memos":`Tägliche Thinos beim Öffnen von Thino öffnen`,"Open daily memos with open memos. Open by default.":`Tägliche Thinos beim Öffnen von Thino öffnen. Standardmäßig geöffnet.`,"Open Memos when obsidian opens":`Thino beim Öffnen von Obsidian öffnen`,"When enable this, Memos will open when Obsidian opens. False by default.":`Wenn aktiviert, wird Thino beim Öffnen von Obsidian geöffnet. Standardmäßig deaktiviert.`,"Hide done tasks in Memo list":`Erledigte Aufgaben in der Thino-Liste ausblenden`,"Hide all done tasks in Memo list. Show done tasks by default.":`Alle erledigten Aufgaben in der Thino-Liste ausblenden. Standardmäßig werden erledigte Aufgaben angezeigt.`,"Advanced Options":`Erweiterte Einstellungen`,"UI language for date":`UI-Sprache für Datum`,"Translates the date UI language. Only 'en' and 'zh' are available.":`Übersetzt die Datums-UI-Sprache. Nur 'en' und 'zh' sind verfügbar.`,"Default prefix when save thino":`Standardpräfix beim Speichern von Thino`,"Set the default prefix when create memo, 'List' by default.":`Setze das Standardpräfix beim Erstellen von Thino, 'Liste' als Standard.`,"Default insert date format":`Standardformat für Datumseinfügung`,"Set the default date format when insert date by @, 'Tasks' by default.":`Setze das Standarddatumsformat beim Einfügen von Datum mit @, 'Aufgaben' als Standard.`,"Default editor position on mobile":`Standardposition des Editors auf Mobilgeräten`,"Set the default editor position on Mobile, 'Top' by default.":`Setze die Standardposition des Editors auf Mobilgeräten, 'Oben' als Standard.`,"Use button to show editor on mobile":`Button zum Anzeigen des Editors auf Mobilgeräten verwenden`,"Set a float button to call editor on mobile. Only when editor located at the bottom works.":`Setze einen schwebenden Button, um den Editor auf Mobilgeräten aufzurufen. Funktioniert nur, wenn der Editor unten positioniert ist.`,"Show Time When Copy Results":`Zeit beim Kopieren der Ergebnisse anzeigen`,"Show time when you copy results, like 12:00. Copy time by default.":`Zeit beim Kopieren der Ergebnisse anzeigen, wie 12:00. Standardmäßig wird die Zeit kopiert.`,"Show Date When Copy Results":`Datum beim Kopieren der Ergebnisse anzeigen`,"Show date when you copy results, like [[2022-01-01]]. Copy date by default.":`Datum beim Kopieren der Ergebnisse anzeigen, wie [[2022-01-01]]. Standardmäßig wird das Datum kopiert.`,"Add Blank Line Between Different Date":`Leerzeile zwischen verschiedenen Daten einfügen`,"Add blank line when copy result with date. No blank line by default.":`Leerzeile beim Kopieren von Ergebnissen mit Datum einfügen. Standardmäßig keine Leerzeile.`,"Share Options":`Freigabeoptionen`,"Share Memos Image Footer Start":`Start der Fußzeile beim Teilen von Thino-Bildern`,"Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":`Setze hier beliebigen Text, verwende {ThinoNum} für die Anzahl der Thinos, {UsedDay} für Tage. '{ThinoNum} Thino {UsedDay} Tage' als Standard`,"Share Memos Image Footer End":`Ende der Fußzeile beim Teilen von Thino-Bildern`,"Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":`Setze hier beliebigen Text, verwende {UserName} als deinen Benutzernamen. '✍️ Von {UserName}' als Standard`,"Save Shared Image To Folder For Mobile":`Geteiltes Bild für Mobilgeräte in Ordner speichern`,"Save image to folder for mobile. False by Default":`Bild für Mobilgeräte in Ordner speichern. Standardmäßig deaktiviert`,"Say Thank You":`Danke sagen`,Donate:`Spenden`,"If you like this plugin, consider donating to support continued development:":`Wenn dir dieses Plugin gefällt, erwäge eine Spende zur Unterstützung der weiteren Entwicklung:`,"File Name of Recycle Bin":`Dateiname des Papierkorbs`,"Set the filename for recycle bin. 'delete' By default":`Setze den Dateinamen für den Papierkorb. 'delete' als Standard`,"File Name of Query File":`Dateiname der Abfragedatei`,"Set the filename for query file. 'query' By default":`Setze den Dateinamen für die Abfragedatei. 'query' als Standard`,"Use Tags In Vault":`Tags im Vault verwenden`,"Use tags in vault rather than only in Memos. False by default.":`Tags im Vault anstatt nur in Thino verwenden. Standardmäßig deaktiviert.`,"Ready to convert image into background":`Bereit, Bild in Hintergrund umzuwandeln`,List:`Liste`,Task:`Aufgabe`,Top:`Oben`,Bottom:`Unten`,TAG:`TAG`,DAY:`TAG`,QUERY:`ABFRAGE`,EDIT:`BEARBEITEN`,PIN:`ANHEFTEN`,UNPIN:`LÖSEN`,DELETE:`LÖSCHEN`,"CONFIRM!":`BESTÄTIGEN!`,"CREATE FILTER":`FILTER ERSTELLEN`,"Comment it...":`Kommentieren...`,Settings:`Einstellungen`,"Recycle bin":`Papierkorb`,"About Me":`Über mich`,"Fetching data...":`Daten werden geladen...`,"Here is No Memos.":`Keine Thinos vorhanden.`,"Frequently Used Tags":`Häufig verwendete Tags`,"What do you think now...":`Was denkst du gerade...`,READ:`LESEN`,MARK:`MARKIEREN`,SHARE:`TEILEN`,SOURCE:`QUELLE`,RESTORE:`WIEDERHERSTELLEN`,ARCHIVE:`ARCHIVIEREN`,"Daily Review":`Tagesrückblick`,"DELETE AT":`GELÖSCHT AM`,"Noooop!":`Nööö!`,"All Data is Loaded 🎉":`Alle Daten geladen 🎉`,"Quick filter":`Schnellfilter`,TYPE:`TYP`,LINKED:`VERLINKT`,"NO TAGS":`KEINE TAGS`,"HAS LINKS":`HAT LINKS`,"HAS IMAGES":`HAT BILDER`,INCLUDE:`EINSCHLIESSEN`,EXCLUDE:`AUSSCHLIESSEN`,TEXT:`TEXT`,IS:`IST`,AND:`UND`,OR:`ODER`,LIST:`LISTE`,ISNOT:`IST NICHT`,PATH:`PFAD`,METADATA:`METADATEN`,SELECT:`AUSWÄHLEN`,"ADD FILTER TERMS":`FILTERKRITERIEN HINZUFÜGEN`,FILTER:`FILTER`,Filter:`Filter`,TITLE:`TITEL`,"CREATE QUERY":`ABFRAGE ERSTELLEN`,"EDIT QUERY":`ABFRAGE BEARBEITEN`,MATCH:`ÜBEREINSTIMMUNG`,TIMES:`ZEITEN`,"Share Memo Image":`Thino-Bild teilen`,"↗Click the button to save":`↗Klicke den Button zum Speichern`,"Image is generating...":`Bild wird generiert...`,"Image is loading...":`Bild wird geladen...`,"Loading...":`Lädt...`,"😟 Cannot load image, image link maybe broken":`😟 Bild kann nicht geladen werden, Link ist möglicherweise defekt`,"Daily Memos":`Tägliche Thinos`,"CANCEL EDIT":`BEARBEITUNG ABBRECHEN`,"LINK TO THE":`LINK ZUM`,"Mobile Options":`Mobile Optionen`,"Experimental Options":`Experimentelle Optionen`,"Don't support web image yet, please input image path in vault":`Webbilder werden noch nicht unterstützt, bitte Bildpfad im Vault eingeben`,"Background Image in Dark Theme":`Hintergrundbild im dunklen Theme`,"Background Image in Light Theme":`Hintergrundbild im hellen Theme`,'Set background image in dark theme. Set something like "Daily/one.png"':`Setze Hintergrundbild im dunklen Theme. Setze etwas wie "Daily/one.png"`,'Set background image in light theme. Set something like "Daily/one.png"':`Setze Hintergrundbild im hellen Theme. Setze etwas wie "Daily/one.png"`,'Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':`Setze Standard-Thino-Zusammensetzung, verwende {TIME} als "HH:mm" und {CONTENT} als Inhalt. "{TIME} {CONTENT}" als Standard`,"Default Memo Composition":`[Veraltet] Standard-Thino-Zusammensetzung`,"Show Tasks Label":`Aufgaben-Label anzeigen`,"Show tasks label near the time text. False by default":`Aufgaben-Label neben dem Zeittext anzeigen. Standardmäßig deaktiviert`,"Please Open Memos First":`Bitte öffne zuerst Thino`,DATE:`DATUM`,OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:`OBSIDIAN_NLDATES_PLUGIN_NICHT_AKTIVIERT`,BEFORE:`VOR`,AFTER:`NACH`,"Allow Comments On Memos":`Kommentare für Thinos erlauben`,"You can comment on memos. False by default":`Du kannst Thinos kommentieren. Standardmäßig deaktiviert`,Import:`Importieren`,"TITLE CANNOT BE NULL!":`TITEL DARF NICHT LEER SEIN!`,"FILTER CANNOT BE NULL!":`FILTER DARF NICHT LEER SEIN!`,"Comments In Original DailyNotes/Notes":`Kommentare in Original-Tagesnotizen/Notizen`,"You should install Dataview Plugin ver 0.5.9 or later to use this feature.":`Du solltest das Dataview Plugin Ver. 0.5.9 oder höher installieren, um diese Funktion zu nutzen.`,"Open Memos Successfully":`Thino erfolgreich geöffnet`,"Fetch Memos Error":`😭 Fehler beim Laden`,"Copied to clipboard Successfully":`Erfolgreich in die Zwischenablage kopiert`,"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":`Prüfe, ob du das Daily Notes Plugin oder Periodic Notes Plugin geöffnet hast`,"Please finish the last filter setting first":`Bitte beende zuerst die letzte Filtereinstellung`,"Close Memos Successfully":`Thino erfolgreich geschlossen`,"Insert as Memo":`Als Thino einfügen`,"Insert file as memo content":`Datei als Thino-Inhalt einfügen`,"Image load failed":`Bildladung fehlgeschlagen`,"Content cannot be empty":`Inhalt darf nicht leer sein`,"Unable to create new file.":`Neue Datei konnte nicht erstellt werden.`,"Failed to fetch deleted memos: ":`Fehler beim Laden gelöschter Thinos: `,"RESTORE SUCCEED":`WIEDERHERSTELLUNG ERFOLGREICH`,"DELETE SUCCEED":`LÖSCHEN ERFOLGREICH`,"Save Memo button icon":`Thino-Speichern-Button-Symbol`,"The icon shown on the save Memo button in the UI.":`Das Symbol auf dem Thino-Speichern-Button in der Benutzeroberfläche.`,"Fetch Memos From Particular Notes":`Thinos aus bestimmten Notizen laden`,'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':`Du kannst jede Dataview-Abfrage für Thinos setzen. Alle Thinos in diesen Notizen werden in der Liste angezeigt. "#memo" als Standard`,"Allow Memos to Fetch Memo from Notes":`Thino erlauben, Thinos aus Notizen zu laden`,"Use Memos to manage all memos in your notes, not only in daily notes. False by default":`Verwende Thino, um alle Thinos in deinen Notizen zu verwalten, nicht nur in Tagesnotizen. Standardmäßig deaktiviert`,"Always Show Memo Comments":`Thino-Kommentare immer anzeigen`,"Always show memo comments on memos. False by default":`Thino-Kommentare immer bei Thinos anzeigen. Standardmäßig deaktiviert`,"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":`Du hast keinen Ordner für Tagesnotizen in beiden Plugins (periodic-notes und daily-notes) festgelegt.`,"Please check your daily note plugin OR periodic notes plugin settings":`Bitte überprüfe deine Einstellungen für das Daily Note Plugin ODER Periodic Notes Plugin`,"Use which plugin's default configuration":`Welche Plugin-Standardkonfiguration verwenden`,"Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":`Thino verwendet die Plugin-Standardkonfiguration zum Laden von Thinos aus Tagesnotizen, 'Daily' als Standard.`,Daily:`Täglich`,"Always Show Leaf Sidebar on PC":`Seitenleiste auf PC immer anzeigen`,"Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":`Linke Seitenleiste auf PC/Tablet auch bei einer Blattbreite unter 875px anzeigen. Standardmäßig deaktiviert.`,"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":`Du hast kein Format für Tagesnotizen in beiden Plugins (periodic-notes und daily-notes) festgelegt.`,"fetch more":`mehr laden`,"Search all settings":`Alle Einstellungen durchsuchen`,General:`Allgemein`,Theme:`Theme`,Share:`Teilen`,Advanced:`Erweitert`,Thino:`Thino`,"Random Review":`Zufällige Überprüfung`,"ARCHIVED AT":`ARCHIVIERT AM`,"Failed to get memos from daily notes":`Fehler beim Laden von Thinos aus Tagesnotizen`,"Failed to delete memo":`Fehler beim Löschen des Thinos`,"CTRL + ENTER to save":`STRG + ENTER zum Speichern`,"Started from":`Gestartet von`,"Custom Background Image":`Benutzerdefiniertes Hintergrundbild`,"Set custom background image.":`Benutzerdefiniertes Hintergrundbild festlegen.`,"Custom Memo Footer":`Benutzerdefinierte Thino-Fußzeile`,"Set custom memo footer.":`Benutzerdefinierte Thino-Fußzeile festlegen.`,"Heatmap Color Scheme":`Heatmap-Farbschema`,"Set different color scheme for heatmap.":`Verschiedene Farbschemata für die Heatmap festlegen.`,"Enable Local Http Server":`Lokalen HTTP-Server aktivieren`,"Memos Http Server Port":`Thino HTTP-Server-Port`,"Set memos http server port to listen. '43999' by default":`Port für den Thino HTTP-Server festlegen. '43999' als Standard`,"Default Editor Mode":`Standard-Editor-Modus`,"Live-Preview Mode OR Source Mode.":`Live-Vorschau-Modus ODER Quelltext-Modus.`,"Save type for Thino":`Speichertyp für Thino`,DAILY:`TÄGLICH`,MULTI:`MEHRFACH`,CANVAS:`LEINWAND`,ALL:`ALLE`,FILE:`DATEI`,TODO:`TODO`,DONE:`ERLEDIGT`,JOURNAL:`JOURNAL`,OTHER:`ANDERE`,"Failed to create daily note, check if it exists.":`Fehler beim Erstellen der Tagesnotiz, prüfe ob sie existiert.`,"Failed to create daily note. Please check if you created a folder for daily notes.":`Fehler beim Erstellen der Tagesnotiz. Bitte prüfe, ob du einen Ordner für Tagesnotizen erstellt hast.`,"After you verify your account, please refresh this page.":`Nach der Verifizierung deines Kontos aktualisiere bitte diese Seite.`,Verify:`Verifizieren`,"Oops! You forget to verify insider account":`Ups! Du hast vergessen, das Insider-Konto zu verifizieren`,"If you have any questions, please contact us.":`Bei Fragen kontaktiere uns bitte.`,"Delete Thino Directly":`Thino direkt löschen`,"When delete thino directly, it will not be moved to trash. False by default.":`Wenn Thino direkt gelöscht wird, wird es nicht in den Papierkorb verschoben. Standardmäßig deaktiviert.`,"Enable opening thino globally":`Globales Öffnen von Thino aktivieren`,"Enable opening thino globally. False by default.":`Globales Öffnen von Thino aktivieren. Standardmäßig deaktiviert.`,"Key for opening thino globally":`Tastenkombination für globales Öffnen von Thino`,"Set key for opening thino globally. CTRL + SHIFT + T by default.":`Tastenkombination für globales Öffnen von Thino festlegen. STRG + SHIFT + T als Standard.`,"Key for showing thino globally":`Tastenkombination für globales Anzeigen von Thino`,"Set key for showing thino globally. CTRL + SHIFT + E by default.":`Tastenkombination für globales Anzeigen von Thino festlegen. STRG + SHIFT + E als Standard.`,"Get activation code":`Aktivierungscode erhalten`,"Input activation code here":`Aktivierungscode hier eingeben`,"Copy Thino id":`Thino-ID kopieren`,"Activate Pro Version":`Pro-Version aktivieren`,"Please copy Thino id first":`Bitte kopiere zuerst die Thino-ID`,'You can set folder name with file name like "folder/file"':`Du kannst den Ordnernamen mit Dateinamen wie "ordner/datei" festlegen`,'You can set folder name like "folder1/folder2/folder3" to create sub-folder':`Du kannst Ordnernamen wie "ordner1/ordner2/ordner3" festlegen, um Unterordner zu erstellen`,"Default save type":`Standard-Speicherort`,'Set the default save type for thino. "DAILY" by default':`Standard-Speichertyp für Thino festlegen. "DAILY" als Standard`,"Sync Thino via PKMer":`Thino über PKMer synchronisieren`,Unlink:`Verknüpfung aufheben`,Link:`Verknüpfen`,"Connect to PKMer Sync, you can check it in ":`Mit PKMer Sync verbinden, du kannst es überprüfen in `,"PKMer Sync":`PKMer Sync`,"Remove successfully":`Erfolgreich entfernt`,Deactivate:`Deaktivieren`,Remove:`Entfernen`,"Confirm?":`Bestätigen?`,"Sync Status":`Synchronisierungsstatus`,"Start or stop sync":`Synchronisierung starten oder stoppen`,"Stop sync successfully":`Synchronisierung erfolgreich gestoppt`,"Start sync successfully":`Synchronisierung erfolgreich gestartet`,Stop:`Stopp`,Start:`Start`,"Show thino near mouse":`Thino in Mausnähe anzeigen`,"Query not found":`Abfrage nicht gefunden`,"Send to clipboard successfully":`Erfolgreich in die Zwischenablage kopiert`,"Thino - Failed to start HTTP server, please check the port is available.":`Thino - HTTP-Server konnte nicht gestartet werden, bitte prüfe ob der Port verfügbar ist.`,"Thino - Started HTTP server on port":`Thino - HTTP-Server gestartet auf Port`,"Thino - Terminated HTTP server":`Thino - HTTP-Server beendet`,"File not exist":`Datei existiert nicht`,"Thino not found":`Thino nicht gefunden`,"File not found for the given thino path, is creating a new file":`Datei für den angegebenen Thino-Pfad nicht gefunden, erstelle neue Datei`,"Saved sync token successfully":`Sync-Token erfolgreich gespeichert`,"Failed to find daily notes folder":`Tagesnotizen-Ordner konnte nicht gefunden werden`,"Please install obsidian-hover-editor plugin first":`Bitte installiere zuerst das obsidian-hover-editor Plugin`,"Copied app id successfully":`App-ID erfolgreich kopiert`,"Please input token first":`Bitte gib zuerst den Token ein`,"Please enable sync first":`Bitte aktiviere zuerst die Synchronisierung`,"Init Failed":`Initialisierung fehlgeschlagen`,"Verify successfully":`Erfolgreich verifiziert`,"Failed to verify":`Verifizierung fehlgeschlagen`,"Folder not found for the given thino path, is creating a new folder":`Ordner für den angegebenen Thino-Pfad nicht gefunden, erstelle neuen Ordner`,"File not found for the given thino path":`Datei für den angegebenen Thino-Pfad nicht gefunden`,"Failed to read current daily note, check if it exists.":`Aktuelle Tagesnotiz konnte nicht gelesen werden, prüfe ob sie existiert.`,"Failed to save":`Speichern fehlgeschlagen`,"Failed to login, please login again":`Anmeldung fehlgeschlagen, bitte erneut anmelden`,"COPY FAILED":`KOPIEREN FEHLGESCHLAGEN`,"COPY SUCCEED":`KOPIEREN ERFOLGREICH`,"Copy selected text":`Ausgewählten Text kopieren`,"Copy thino":`Thino kopieren`,COPY:`KOPIEREN`,"This is a pro feature, please upgrade to pro version to use it.":`Dies ist eine Pro-Funktion, bitte upgrade auf die Pro-Version um sie zu nutzen.`,"You can get pro version from: ":`Du kannst die Pro-Version hier erhalten: `,Save:`Speichern`,Cancel:`Abbrechen`,"Thino Daily Target":`Thino Tagesziel`,Input:`Eingabe`,"#Tag":`#Tag`,"to create tag":`um Tag zu erstellen`,"You have verified your account. Congrats!":`Du hast dein Konto verifiziert. Glückwunsch!`,"Pro features":`Pro-Funktionen`,"Target Thino Count":`Ziel-Thino-Anzahl`,on:`am`,"Switch waterfall view":`Zur Wasserfall-Ansicht wechseln`,"Switch view":`Ansicht wechseln`,"Switch list view":`Zur Listen-Ansicht wechseln`,"Set daily target":`Tagesziel festlegen`,"Thino Save To: ":`Thino speichern unter: `,"Enter fullscreen mode":`Vollbildmodus aktivieren`,"Exit fullscreen mode":`Vollbildmodus verlassen`,words:`Wörter`,word:`Wort`,"Return To Home Page":`Zur Startseite zurückkehren`,"No thinos to review!":`Keine Thinos zum Überprüfen!`,"Thinos to review":`Thinos zum Überprüfen`,"Start Review":`Überprüfen starten`,Hard:`Schwer`,Good:`Gut`,Easy:`Leicht`,Again:`Wiederholen`,"Clear all review data":`Alle Überprüfungsdaten löschen`,"Daily Progress":`Täglicher Fortschritt`,"Show stats":`Stats anzeigen`,"Hide stats":`Stats ausblenden`,Remaining:`Verbleibend`,"Total Reviews":`Gesamte Überprüfungen`,"Today, you have reviewed all your thinos!":`Heute hast du alle deine Thinos überprüft!`,"Daily review limit reached! Come back tomorrow.":`Tägliche Überprüfungslimit erreicht! Komm morgen wieder.`,"Open thino in center window":`Thino im zentralen Fenster öffnen`,"Open thino in float window":`Thino im schwebenden Fenster öffnen`,"Open thino in right sidebar":`Thino in der rechten Seitenleiste öffnen`,"Open thino in left sidebar":`Thino in der linken Seitenleiste öffnen`,"Show thino editor":`Thino-Editor anzeigen`,"Toggle minimal mode":`Minimalen Modus umschalten`,"Focus on thino editor":`Fokus auf Thino-Editor`,"ReSync web thinos to local":`Web-Thinos mit lokalen synchronisieren`,"Sync local thinos to web":`Lokale Thinos mit Web synchronisieren`,"Show daily thino":`Tägliches Thino anzeigen`,"Focus on search bar":`Fokus auf Suchleiste`,"Show-thino in popover(Hover editor)":`Thino in Popover anzeigen (Hover-Editor)`,"Center window":`Zentrales Fenster`,"Float window":`Schwebendes Fenster`,"Right sidebar":`Rechte Seitenleiste`,"Left sidebar":`Linke Seitenleiste`,"Save thino type when sync local":`Thino-Typ beim lokalen Synchronisieren speichern`,"Set the default save thino type when sync local, FILE by default.":`Standardtyp zum Speichern von Thino beim lokalen Synchronisieren festlegen, standardmäßig DATEI.`,"Sync service":`Synchronisierungsdienst`,"Pro verification status":`Pro-Verifizierungsstatus`,"Live-preview":`Live-Vorschau`,Source:`Quelle`,"Global copy":`Globales Kopieren`,"Set the folder name":`Ordnernamen festlegen`,"Set the filename":`Dateinamen festlegen`,"Set the filename for current location file":`Dateinamen für aktuelle Ortsdatei festlegen`,"Switch calendar type":`Kalendertyp wechseln`,alphabetical:`alphabetisch`,alphabeticalReverse:`alphabetisch rückwärts`,byCount:`nach Anzahl`,byCountReverse:`nach Anzahl rückwärts`,"Type here":`Hier tippen`,Today:`Heute`,Yesterday:`Gestern`,"Last 7 days":`Letzte 7 Tage`,"Last 30 days":`Letzte 30 Tage`,"Last 90 days":`Letzte 90 Tage`,"Last 180 days":`Letzte 180 Tage`,"Last 365 days":`Letzte 365 Tage`,Found:`Gefunden`,"Copy filtered thinos":`Gefilterte Thinos kopieren`,"Bulk delete":`Massenweise löschen`,"Bulk archive":`Massenweise archivieren`,"Bulk tag operation":`Massenhafte Tag-Operation`,"Bulk restore":`Massenweise wiederherstellen`,"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.":`Wenn du das tägliche Notizen-Plugin deaktivierst, könnte es sein, dass das Thino nicht richtig gelöscht oder aktualisiert wird. Bitte aktiviere das Plugin und versuche es erneut.`,Preview:`Vorschau`,"Set and save":`Festlegen und speichern`,"Show day mark in thino list":`Tagesmarkierung in Thino-Liste anzeigen`,"Show day mark on the top of daily range thino. False by default.":`Tagesmarkierung oben auf dem täglichen Bereichs-Thino anzeigen. Standardmäßig deaktiviert.`,"Click to expand or fold, Cmd+Click to show all thinos of the day":`Klicken zum Erweitern oder Falten, Cmd+Klick um alle Thinos des Tages anzuzeigen`,"You can buy a license from":`Du kannst eine Lizenz kaufen von`,"No thinos in range":`Keine Thinos im Bereich`,Month:`Monat`,Week:`Woche`,Day:`Tag`,Agenda:`Agenda`,Tomorrow:`Morgen`,Previous:`Vorherige`,Next:`Nächste`,"Search all columns...":`Alle Spalten durchsuchen...`,"Basic Info":`Grundinformationen`,"Additional Info":`Zusätzliche Informationen`,"Created At":`Erstellt am`,Content:`Inhalt`,"Thino Type":`Thino-Typ`,"Source Type":`Quelltyp`,"Row status":`Zeilenstatus`,Path:`Pfad`,"Pinned Status":`Angeheftet-Status`,Table:`Tabelle`,Chat:`Chat`,Moments:`Momente`,Waterfall:`Wasserfall`,Calendar:`Kalender`,"Go to page":`Zur Seite gehen`,Page:`Seite`,Show:`Zeigen`,rows:`Zeilen`,"Temp Filter":`Temporärer Filter`,"Open link directly in Thino view":`Link direkt in Thino-Ansicht öffnen`,"Day mark range":`Tagesmarkierungsbereich`,"Set the range of day mark. Day by default.":`Bereich der Tagesmarkierung festlegen. Standardmäßig Tag.`,"Thino is locked":`Thino ist gesperrt`,"Please unlock Thino by input password":`Bitte entsperre Thino durch Eingabe des Passworts`,"Auto Download Image":`Automatischer Bilddownload`,"Auto download image when save to thino. 'false' by default":`Automatischer Bilddownload beim Speichern in Thino. Standardmäßig 'false'`,"Thino Http IP Type":`Thino Http IP-Typ`,"Set Thino http server ip to listen. 'localhost' by default":`Thino-HTTP-Server-IP zum Abhören festlegen. Standardmäßig 'localhost'`,"Password to lock Thino":`Passwort zum Sperren von Thino`,Unlock:`Entsperren`,Locked:`Gesperrt`,"Password is incorrect":`Passwort ist falsch`,Lock:`Sperren`,"Need password to unlock Thino":`Passwort zum Entsperren von Thino erforderlich`,"You have not set a password or enable this feature yet":`Du hast noch kein Passwort festgelegt oder diese Funktion aktiviert`,Password:`Passwort`,"Password for Thino":`Passwort für Thino`,"Please input your password to change password settings":`Bitte gib dein Passwort ein, um die Passworteinstellungen zu ändern`,"Please input your password":`Bitte gib dein Passwort ein`,"Lock thino":`Thino sperren`,date:`Datum`,time:`Zeit`,event:`Ereignis`,"Add tag position":`Tag-Position hinzufügen`,"Set the position of the tag when adding tag automatically":`Position des Tags festlegen, wenn Tags automatisch hinzugefügt werden`,"Add tag automatically":`Tag automatisch hinzufügen`,"Add tag to the end or beginning of the thino content when creating a thino and filtering tags":`Tag am Ende oder Anfang des Thino-Inhalts hinzufügen, wenn ein Thino erstellt und Tags gefiltert werden`,"Add tag with new line":`Tag mit neuer Zeile hinzufügen`,"Add tag with new line when adding tag automatically":`Tag mit neuer Zeile hinzufügen, wenn Tags automatisch hinzugefügt werden`,"Input to select more tags":`Eingabe, um weitere Tags auszuwählen`,"Tag Bulk Edit":`Tag-Massenbearbeitung`,"Tag Bulk Select":`Tag-Massenauswahl`,"Exist Tags":`Vorhandene Tags`,"Selected Tags":`Ausgewählte Tags`,"Click to remove exist tag":`Klicken, um vorhandenes Tag zu entfernen`,"Click to remove selected tag":`Klicken, um ausgewähltes Tag zu entfernen`,"Select tags":`Tags auswählen`,"Input to select exist tag":`Eingabe, um vorhandenes Tag auszuwählen`,Beginning:`Anfang`,End:`Ende`,"Set the heading for saving thino":`Überschrift zum Speichern von Thino festlegen`,"# Heading":`# Überschrift`,"Chat view style":`Chat-Ansichtsstil`,"Set the style of chat view":`Stil der Chat-Ansicht festlegen`,"Background image for moments view":`Hintergrundbild für Momente-Ansicht`,"Set the background image for moments view":`Hintergrundbild für Momente-Ansicht festlegen`,"Icon for moments/chat view/share image":`Symbol für Momente/Chat-Ansicht/Freigabebild`,"Set the icon for moments/chat view/share image":`Symbol für Momente/Chat-Ansicht/Freigabebild festlegen`,"Quote for moments view/share image":`Zitat für Momente-Ansicht/Freigabebild`,"Set the quote for moments view/share image":`Zitat für Momente-Ansicht/Freigabebild festlegen`,"Theme for Thino":`Thema für Thino`,"Set the theme for Thino":`Thema für Thino festlegen`,"Interface Details":`Schnittstellendetails`,"Task amount":`Aufgabenmenge`,"Thino status":`Thino-Status`,"Used tags":`Verwendete Tags`,"Used days":`Verwendete Tage`,"Most active day":`Aktivster Tag`,"Most active hour":`Aktivste Stunde`,"Thino amount":`Thino-Menge`,"No content to generate.":`Kein Inhalt zum Generieren.`,"Image generated successfully.":`Bild erfolgreich generiert.`,"Failed to generate image.":`Fehler beim Generieren des Bildes.`,"Share filtered thinos as image":`Gefilterte Thinos als Bild teilen`,"Latest version":`Neueste Version`,"Previous version":`Vorherige Version`,"Thino update info":`Thino-Update-Info`,"Debug info copied to clipboard":`Debug-Informationen in die Zwischenablage kopiert`,"Copy debug info":`Debug-Informationen kopieren`,"Failed to load changelog":`Fehler beim Laden des Changelogs`,"View online":`Online ansehen`,ChangeLog:`Änderungsprotokoll`,"Please open thino first":`Bitte öffne zuerst Thino`,"Insert editor":`Editor einfügen`,"Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":`Bitte lege unterschiedliche Speicherorte für Mehrfachdatei-Einstellungen in Thino fest. Der Tagebuchordner überschneidet sich mit dem Mehrfachdatei-Speicherort, oder es besteht die Gefahr, dass er wiederholt gelesen wird.`,"Default time prefix for thino in daily notes":`Standard-Zeitpräfix für Thino in täglichen Notizen`,"Set default time prefix for thino in daily notes.":`Standard-Zeitpräfix für Thino in täglichen Notizen festlegen.`,"Save image successfully":`Bild erfolgreich gespeichert`,"User quote":`Benutzerzitat`,"Set user quote for thino":`Benutzerzitat für Thino festlegen`,"User icon":`Benutzersymbol`,"Set user icon for thino. You can input http/https link or file path in vault.":`Benutzersymbol für Thino festlegen. Du kannst einen http/https-Link oder Dateipfad im Tresor eingeben.`,"User info":`Benutzerinfo`,"Copy filtered results":`Gefilterte Ergebnisse kopieren`,"Share image":`Bild teilen`,Default:`Standard`,Gray:`Grau`,Grass:`Gras`,Flame:`Flamme`,Olive:`Olive`,Ice:`Eis`,Magenta:`Magenta`,"Daily notes":`Tägliche Notizen`,Editor:`Editor`,"Append/prepend text when share to Thino":`Text anhängen/voranstellen beim Teilen zu Thino`,"Append text when share to Thino":`Text anhängen beim Teilen zu Thino`,"Prepend text when share to Thino":`Text voranstellen beim Teilen zu Thino`,"Add newline when append/prepend text":`Neue Zeile hinzufügen beim Anhängen/Voranstellen von Text`,"Input anything here":`Hier etwas eingeben`,Prepend:`Voranstellen`,Append:`Anhängen`,Both:`Beides`,None:`Keines`,"Hide pinned group":`Angeheftete Gruppe ausblenden`,"Hide pinned group in thino list. False by default.":`Angeheftete Gruppe in Thino-Liste ausblenden. Standardmäßig deaktiviert.`,"Set the heading for the task type of thino, by default 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.":`Überschrift für den Aufgabentyp von Thino festlegen. Standardmäßig wird der aufgezeichnete Thino-Inhalt am Ende des Tagebuchs eingefügt; wenn ein Titel angegeben wird, werden alle aufgezeichneten Thino-Inhalte einheitlich unter diesem Titel kategorisiert.`,"Different insert target for different type":`Unterschiedliches Einfügeziel für verschiedene Typen`,"Toggle this to set different insert target for different type of thino, like task or list type of thino":`Aktiviere dies, um unterschiedliche Einfügeziele für verschiedene Thino-Typen festzulegen, wie Aufgaben- oder Listentyp von Thino`,"You can set whole diary or only part of it":`Du kannst das gesamte Tagebuch oder nur einen Teil davon festlegen`,"Set process target":`Verarbeitungsziel festlegen`,Custom:`Benutzerdefiniert`,"Whole diary":`Gesamtes Tagebuch`,"Set thino insert place":`Thino-Einfügeort festlegen`,"Set where to insert thino content":`Festlegen, wo Thino-Inhalt eingefügt werden soll`,"End of the diary":`Ende des Tagebuchs`,"Custom location":`Benutzerdefinierter Ort`,"Setting guide":`Einstellungsanleitung`,"Details settings":`Detaileinstellungen`,"Start Thino":`Thino starten`,"About Thino Pro":`Über Thino Pro`,Enabled:`Aktiviert`,Enable:`Aktivieren`,"Daily notes folder":`Ordner für tägliche Notizen`,"Set daily notes folder":`Ordner für tägliche Notizen festlegen`,"Daily note name format":`Namensformat für tägliche Notizen`,"Set daily note name format":`Namensformat für tägliche Notizen festlegen`,"Daily note plugin":`Plugin für tägliche Notizen`,"Enable daily note plugin":`Plugin für tägliche Notizen aktivieren`,Selected:`Ausgewählt`,Select:`Auswählen`,"A classic theme for Thino with a two-column layout":`Ein klassisches Thema für Thino mit zweispaltigem Layout`,Classic:`Klassisch`,"A modern theme for Thino with a three-column layout and some unique features.":`Ein modernes Thema für Thino mit dreispaltigem Layout und einigen einzigartigen Funktionen.`,Modern:`Modern`,"Go and enjoy Thino":`Los geht's, viel Spaß mit Thino`,"Congrats! All settings done":`Glückwunsch! Alle Einstellungen abgeschlossen`,"Adjust settings that influence your user experience with Thino.":`Passe Einstellungen an, die deine Benutzererfahrung mit Thino beeinflussen.`,"Set preferences for using Thino":`Präferenzen für die Verwendung von Thino festlegen`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`Wenn du die Thino-Basisversion verwendest, ist die Aktivierung des Plugins für tägliche Notizen erforderlich. Konfiguriere seine Einstellungen, um effektiv damit zu arbeiten.`,"Go with daily note plugin":`Mit Plugin für tägliche Notizen fortfahren`,"Choose a theme for Thino.":`Wähle ein Thema für Thino.`,"Set theme for Thino":`Thema für Thino festlegen`,"Set up your user info for Thino.":`Richte deine Benutzerinformationen für Thino ein.`,"Get started with Thino":`Erste Schritte mit Thino`,"Skip and start Thino":`Überspringen und Thino starten`,"Next step":`Nächster Schritt`,"Back to previous step":`Zurück zum vorherigen Schritt`,"Click to enable =>":`Klicken zum Aktivieren =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`Dies ist Thinos Seitenleiste. Navigiere zu verschiedenen Pfaden oder wähle Abfragefilter.`,"Click here and go to settings page.":`Klicke hier und gehe zur Einstellungsseite.`,"Click here and go to different path.":`Klicke hier und gehe zu einem anderen Pfad.`,"Select or create query filter here.":`Wähle oder erstelle hier Abfragefilter.`,"See the status of Thinos here.":`Siehe hier den Status von Thinos.`,"Search your thino quickly here.":`Suche dein Thino schnell hier.`,"Edit or create your thino here.":`Bearbeite oder erstelle dein Thino hier.`,"See your thinos here.":`Siehe deine Thinos hier.`,"See your time status of thinos here.":`Siehe hier deinen Zeitstatus von Thinos.`,"See your tags here. Tags will be shown when thino contains tags.":`Siehe deine Tags hier. Tags werden angezeigt, wenn Thino Tags enthält.`,Done:`Fertig`,"Thino is ready to use. ":`Thino ist einsatzbereit. `,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`Du kannst Thino jetzt verwenden. Wenn du mehr über Thino Pro erfahren möchtest, klicke auf die Schaltfläche unten.`,"Default time prefix":`Standard-Zeitpräfix`,"Append Text Action":`Text-Anhänge-Aktion`,"Prepend Text Action":`Text-Voranstell-Aktion`,Preset:`Voreinstellung`,"Select Tags":`Tags auswählen`,"It is not available on small view":`Es ist nicht verfügbar in der kleinen Ansicht`,"Append text":`Text anhängen`,"Prepend text":`Text voranstellen`,"Your daily note folder is not set correctly, please check your settings":`Dein Ordner für tägliche Notizen ist nicht korrekt eingestellt, bitte überprüfe deine Einstellungen`,"Default sharing style":`Standard-Freigabestil`,"Set the default style for sharing thino, 'Modern' by default.":`Lege den Standardstil für die Freigabe von Thino fest, standardmäßig "Modern".`,Clean:`Sauber`,Minimal:`Minimal`,Gradient:`Farbverlauf`,"Thino share":`Thino-Freigabe`,"Copy to clipboard failed":`Kopieren in die Zwischenablage fehlgeschlagen`,"Copy to clipboard successfully":`Erfolgreich in die Zwischenablage kopiert`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`Dein Inhalt wurde in die Zwischenablage kopiert und in den Editor eingefügt. Bitte versuche es erneut`,"Share thino":`Thino teilen`,"Set file name after create thino":`Dateinamen nach Erstellung von Thino festlegen`,"You can set file name after create thino. A input box will show when you create thino.":`Du kannst den Dateinamen nach der Erstellung von Thino festlegen. Ein Eingabefeld wird angezeigt, wenn du Thino erstellst.`,SPLIT:`TEILEN`,"Split by Heading 1":`Nach Überschrift 1 teilen`,"Split by Heading 2":`Nach Überschrift 2 teilen`,"Split by Heading 3":`Nach Überschrift 3 teilen`,"Insert task":`Aufgabe einfügen`,"All settings have been reset to default.":`Alle Einstellungen wurden auf die Standardwerte zurückgesetzt.`,"Reset all Thino settings":`Alle Thino-Einstellungen zurücksetzen`,"Reset settings":`Einstellungen zurücksetzen`,"Reset Thino settings to default settings.":`Thino-Einstellungen auf Standardeinstellungen zurücksetzen.`,"Task Management":`Aufgabenverwaltung`,"Append completed date when task done in thino":`Abschlussdatum anhängen, wenn Aufgabe in Thino erledigt ist`,"Append completed date when task done in thino. False by default":`Abschlussdatum anhängen, wenn Aufgabe in Thino erledigt ist. Standardmäßig deaktiviert`,"Set tag for single file that Thino indexes":`Tag für einzelne Datei festlegen, die Thino indiziert`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"Wenn du hier ein Tag festlegst, wird Thino diese Datei indizieren, die dieses Tag enthält, und es in der Liste anzeigen. Du musst kein `#` hinzufügen.","Set tag for file type file":`Tag für Dateityp-Datei festlegen`,"Set tag for multi type file":`Tag für Mehrfachtyp-Datei festlegen`,"Please input the tag":`Bitte gib das Tag ein`,"Merge thinos in to thino share image":`Thinos in Thino-Freigabebild zusammenführen`,"Custom height for Thino content":`Benutzerdefinierte Höhe für Thino-Inhalt`,"Set custom height for Thino content. Like 200px or 20rem":`Benutzerdefinierte Höhe für Thino-Inhalt festlegen. Wie 200px oder 20rem`,"Input height":`Höhe eingeben`,"Submit issue":`Problem melden`,"Current version":`Aktuelle Version`,"Bug report":`Fehlerbericht`,"Click the button to copy debug info and open the issue page":`Klicke auf die Schaltfläche, um Debug-Informationen zu kopieren und die Problemseite zu öffnen`,"Copy and go":`Kopieren und los`,"Debug info copied":`Debug-Informationen kopiert`,"Feature request":`Funktionsanfrage`,"Submit your feature request to the issue page":`Reiche deine Funktionsanfrage auf der Problemseite ein`,Go:`Los`,"Toggle query list visibility":`Abfragelistensichtbarkeit umschalten`,"Toggle tags visibility":`Tag-Sichtbarkeit umschalten`,"Toggle sidebar visibility":`Seitenleistensichtbarkeit umschalten`,Collapse:`Einklappen`,Expand:`Ausklappen`,"Max height for collapse":`Maximale Höhe für Einklappen`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`Die maximale Höhe für Thino-Einklappen, wenn auf 0 gesetzt, würde Thino nicht einklappen. Standardmäßig 0. (Dies ist keine Zeilenanzahl, sondern die Höhe in px.)`,"Render content":`Inhalt rendern`,"Optimize for Callout":`Für Callout optimieren`,"Won't render content contains more than 3 callouts automatically. True by default":`Rendert Inhalte mit mehr als 3 Callouts nicht automatisch. Standardmäßig aktiviert`,"The value should be greater than":`Der Wert sollte größer sein als`,"Append Text":`Text anhängen`,"Prepend Text":`Text voranstellen`,"Thino height when collapsed":`Thino-Höhe im eingeklappten Zustand`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`Die Höhe für Thino im eingeklappten Zustand, wenn auf 0 gesetzt, würde Thino nicht einklappen. Standardmäßig 100. (Dies ist keine Zeilenanzahl, sondern die Höhe in px.)`,"This option will allow you use other views when leaf width is not enough. False by default.":`Diese Option ermöglicht es dir, andere Ansichten zu verwenden, wenn die Blattbreite nicht ausreicht. Standardmäßig deaktiviert.`,"Can select other views when leaf width is not enough":`Kann andere Ansichten auswählen, wenn Blattbreite nicht ausreicht`,"TRASH BOX":`PAPIERKORB`,"Wait templater to finish parse before insert thino":`Warte, bis Templater das Parsen beendet hat, bevor Thino eingefügt wird`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`Diese Option ermöglicht es dir, zu warten, bis Templater das Parsen beendet hat, bevor Thino eingefügt wird, was dazu führen kann, dass du zwischen dem Einfügen von Thino zweimal bestätigen musst. Standardmäßig deaktiviert.`,"Get thino capture extension":`Thino-Erfassungserweiterung holen`,"You can capture idea/text from chrome now.":`Du kannst jetzt Ideen/Text aus Chrome erfassen.`,"Open File":`Datei öffnen`,"Exported CSV file":`Exportierte CSV-Datei`,"Updated At":`Aktualisiert am`,"Export to CSV":`Nach CSV exportieren`,"Quick add button on mobile navbar":`Schnellhinzufügen-Schaltfläche in der mobilen Navigationsleiste`,"Always show status text":`Statustext immer anzeigen`,"Support filter by metadata from file":`Filterung nach Metadaten aus Datei unterstützen`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`Wenn du dies aktivierst, kannst du über Metadaten aus der Datei filtern, wie z.B. Tags in der Datei. Thinos aus Canvas werden jedoch nicht unterstützt. Standardmäßig deaktiviert.`,"Show source near timestamp in thino":`Quelle neben Zeitstempel in Thino anzeigen`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`Wenn du dies aktivierst, kannst du die Quelle neben dem Zeitstempel in Thino sehen. Du kannst den Titel in den Metadaten festlegen, um dies zu überschreiben. Standardmäßig deaktiviert.`,"Show Update Message":`Aktualisierungsnachricht anzeigen`,"Show update message when Thino is updated. True by default":`Aktualisierungsnachricht anzeigen, wenn Thino aktualisiert wird. Standardmäßig aktiviert`,"Sync manually":`Manuell synchronisieren`,"Show all scrollbars":`Alle Scrollbalken anzeigen`,"TIME RANGE":`ZEITRAUM`,WITHIN:`INNERHALB`,"7 days":`7 Tage`,"14 days":`14 Tage`,"30 days":`30 Tage`,"3 months":`3 Monate`,"6 months":`6 Monate`,"1 year":`1 Jahr`,"This week":`Diese Woche`,"Last week":`Letzte Woche`,"This month":`Dieser Monat`,"Last month":`Letzter Monat`,"This year":`Dieses Jahr`,"Last year":`Letztes Jahr`,"No history":`Keine Historie`,"Today Remaining":`Heute verbleibend`,"Today Total":`Heute gesamt`,"Historical Statistics":`Historische Statistiken`,byTime:`Nach Zeit`,byTimeReverse:`Nach Zeit (umgekehrt)`,Stat:`Statistik`,Statistics:`Statistiken`,"Daily Thino Count":`Tägliche Thino-Anzahl`,Total:`Gesamt`,thinos:`Thinos`,"Thino Types":`Thino-Typen`,"Distribution of thino types":`Verteilung der Thino-Typen`,"Thino Status":`Thino-Status`,"Distribution of thino status":`Verteilung des Thino-Status`,"Popular Tags":`Beliebte Tags`,"Top 10 most used tags":`Top 10 der meistverwendeten Tags`,"Thino Count":`Thino-Anzahl`,"Hourly distribution":`Stündliche Verteilung`,"Current month":`Aktueller Monat`,"Monthly distribution":`Monatliche Verteilung`,"30 Days":`Letzte 30 Tage`,Year:`Jahr`,"Time Distribution":`Zeitverteilung`,"When do you write thinos":`Wann schreibst du Thinos`,"Content Length":`Inhaltslänge`,"Distribution of thino lengths":`Verteilung der Thino-Längen`,"Daily Thinos":`Tägliche Thinos`,"Show Time Distribution":`Zeitverteilung anzeigen`,"Hide date picker":`Datumsauswahl ausblenden`,"Show date picker":`Datumsauswahl anzeigen`,"Clear filter":`Filter löschen`,"Copy link":`Link kopieren`,"Copy embed link":`Einbettungslink kopieren`,"Ctrl/Cmd + Enter to save thino":`Strg/Cmd + Enter zum Speichern des Thinos`,"Fixed strings for thinos":`Feste Zeichenketten für Thinos`,"Use fixed strings for thinos":`Feste Zeichenketten für Thinos verwenden`,"Enable to add fixed strings at the beginning or end of thinos.":`Aktivieren, um feste Zeichenketten am Anfang oder Ende von Thinos hinzuzufügen.`,"Fixed prefix for thinos":`Festes Präfix für Thinos`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Füge diese Zeichenkette am Anfang jedes Thinos hinzu. Unterstützt Platzhalter wie {{TIME|YYYYMMDDHHmmss}}.`,"Fixed suffix for thinos":`Festes Suffix für Thinos`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Füge diese Zeichenkette am Ende jedes Thinos hinzu. Unterstützt Platzhalter wie {{TIME|YYYYMMDDHHmmss}}.`,"Word count exceeded":`Wortzahl überschritten`,"Word count feature":`Wortzählfunktion`,"Enable real-time word count display in the editor":`Echtzeit-Wortzählanzeige im Editor aktivieren`,"Maximum word count":`Maximale Wortzahl`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`Lege eine maximale Wortzahl für Thino fest. Der Editor zeigt eine Warnung an, wenn diese überschritten wird. Setze auf 0 für unbegrenzt.`,"No linked thinos found":`Keine verknüpften Thinos gefunden`,"Reference links group":`Referenzlinks-Gruppe`,"Enable reference links group in thino.":`Referenzlinks-Gruppe in Thino aktivieren.`,"No reference links found":`Keine Referenzlinks gefunden`,"Outgoing Links":`Ausgehende Links`,"Incoming Links":`Eingehende Links`,"Error fetching reference links":`Fehler beim Abrufen von Referenzlinks`,"Double click behavior":`Doppelklick-Verhalten`,"Set the behavior when double click on a thino.":`Lege das Verhalten fest, wenn du auf ein Thino doppelklickst.`,"Open thino":`Thino öffnen`,"Edit thino":`Thino bearbeiten`,"Go to source":`Zur Quelle gehen`,"Do nothing":`Nichts tun`,"Use default header in mobile view":`Standardkopfzeile in der mobilen Ansicht verwenden`,"Use default header in mobile view of thino rather than custom header.":`Verwende die Standardkopfzeile in der mobilen Ansicht von Thino anstelle einer benutzerdefinierten Kopfzeile.`}})),Sn,Cn=o((()=>{Sn={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":`User name`,"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 when save thino":`Default prefix when save thino`,"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`,"Daily Review":`Daily Review`,"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`,PATH:`PATH`,METADATA:`METADATA`,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`,"Outer Frame":`Outer Frame`,"Enable Frame":`Enable Frame`,"Frame Padding":`Frame Padding`,"Frame Color":`Frame Color`,"↗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/Tablet even when the leaf width is less than 875px. False by default.":`Show left sidebar on PC/Tablet 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 type for Thino":`Save type for Thino`,DAILY:`DAILY`,MULTI:`MULTI`,CANVAS:`CANVAS`,ALL:`ALL`,FILE:`FILE`,TODO:`TODO`,DONE:`DONE`,JOURNAL:`JOURNAL`,OTHER:`OTHER`,"Journal mode saves memos into periodic note files (daily/weekly/monthly/yearly)":`Journal mode saves memos into periodic note files (daily/weekly/monthly/yearly)`,"Journal granularity":`Journal granularity`,"Choose the period type for journal files":`Choose the period type for journal files`,Daily:`Daily`,Weekly:`Weekly`,Monthly:`Monthly`,Yearly:`Yearly`,"Use independent settings":`Use independent settings`,"When enabled, use custom folder/format/template instead of inheriting from daily notes plugin":`When enabled, use custom folder/format/template instead of inheriting from daily notes plugin`,"Heading date format":`Heading date format`,"Format for date headings in journal files":`Format for date headings in journal files`,Custom:`Custom`,"Custom heading format":`Custom heading format`,Folder:`Folder`,"Folder path for":`Folder path for`,notes:`notes`,"e.g.":`e.g.`,"Date format":`Date format`,"Moment.js format for file names":`Moment.js format for file names`,default:`default`,Template:`Template`,"Template file path for new notes":`Template file path for new notes`,"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 type":`Default save location`,'Set the default save type for thino. "DAILY" by default':`Set the default save type 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`,"Login with PKMer":`Login with PKMer`,"Logout from PKMer":`Logout from PKMer`,"Logged in as":`Logged in as`,Devices:`Devices`,"AI Quota":`AI Quota`,Logout:`Logout`,"Pro activated":`Pro activated`,"Thino Copilot quota":`Thino Copilot quota`,"Contact support":`Contact support`,"Click to manage in Super settings":`Click to manage in Super settings`,"Login with PKMer account to activate Pro features":`Login with PKMer account to activate Pro features`,"Legacy activation (deprecated)":`Legacy activation (deprecated)`,"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 selected text":`Copy selected text`,"Copy thino":`Copy thino`,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`,word:`word`,"Return To Home Page":`Return To Home Page`,"No thinos to review!":`No thinos to review!`,"Thinos to review":`Thinos to review`,"Start Review":`Start Review`,Hard:`Hard`,Good:`Good`,Easy:`Easy`,Again:`Again`,"Clear all review data":`Clear all review data`,"Daily Progress":`Daily Progress`,"Show stats":`Show stats`,"Hide stats":`Hide stats`,Remaining:`Remaining`,"Total Reviews":`Total Reviews`,"Today, you have reviewed all your thinos!":`Today, you have reviewed all your thinos!`,"Daily review limit reached! Come back tomorrow.":`Daily review limit reached! Come back tomorrow.`,"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":`Show daily thino`,"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`,"Send to file":`Send to file`,"Hide entry":`Hide entry`,"Show entry":`Show entry`,More:`More`,"Pin tag":`Pin tag`,"Unpin tag":`Unpin tag`,"Rename tag":`Rename tag`,"Rename all":`Rename all`,"New tag name":`New tag name`,Renamed:`Renamed`,"Set emoji":`Set emoji`,"Set emoji for tag":`Set emoji for tag`,"Custom emoji":`Custom emoji`,"Set color":`Set color`,"Set color for tag":`Set color for tag`,Clear:`Clear`,"Select target file":`Select target file`,"Content format":`Content format`,"List item":`List item`,Callout:`Callout`,"Plain text":`Plain text`,"Archive originals":`Archive originals`,"Delete originals":`Delete originals`,"After sending":`After sending`,Target:`Target`,"Processing...":`Processing...`,"ORGANIZE SUCCEED":`Successfully organized thinos`,"Organize failed":`Organize failed`,"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 in thino list":`Show day mark in thino list`,"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`,"Open link directly in Thino view":`Open link directly in Thino 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`,"Tag Bulk Select":`Tag Bulk Select`,"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/share image":`Icon for moments/chat view/share image`,"Set the icon for moments/chat view/share image":`Set the icon for moments/chat view/share image`,"Quote for moments view/share image":`Quote for moments view/share image`,"Set the quote for moments view/share image":`Set the quote for moments view/share image`,"Theme for Thino":`Theme for Thino`,"Set the theme for Thino":`Set the theme for Thino`,"Interface Details":`Interface 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`,"No content to generate.":`No content to generate.`,"Image generated successfully.":`Image generated successfully.`,"Failed to generate image.":`Failed to generate image.`,"Share filtered thinos as image":`Share filtered thinos as image`,"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`,"Please open thino first":`Please open thino first`,"Insert editor":`Insert editor`,Gallery:`Gallery`,"Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":`Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.`,"Default time prefix for thino in daily notes":`Default time prefix for thino in daily notes`,"Set default time prefix for thino in daily notes.":`Set default time prefix for thino in daily notes.`,"Save image successfully":`Save image successfully`,"User quote":`User quote`,"Set user quote for thino":`Set user quote for thino`,"User icon":`User icon`,"Set user icon for thino. You can input http/https link or file path in vault.":`Set user icon for thino. You can input http/https link or file path in vault.`,"User info":`User info`,"Copy filtered results":`Copy filtered results`,"Share image":`Share image`,Default:`Default`,Gray:`Gray`,Grass:`Grass`,Flame:`Flame`,Olive:`Olive`,Ice:`Ice`,Magenta:`Magenta`,"Daily notes":`Daily notes`,Editor:`Editor`,"Append/prepend text when share to Thino":`Append/prepend text when share to Thino`,"Append text when share to Thino":`Append text when share to Thino`,"Prepend text when share to Thino":`Prepend text when share to Thino`,"Add newline when append/prepend text":`Add newline when append/prepend text`,"Input anything here":`Input anything here`,Prepend:`Prepend`,Append:`Append`,Both:`Both`,None:`None`,"Hide pinned group":`Hide pinned group`,"Hide pinned group in thino list. False by default.":`Hide pinned group in thino list. False by default.`,"Set the heading for the task type of thino, by default 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.":`Set the heading for the task type of thino, by default 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.`,"Different insert target for different type":`Different insert target for different type`,"Toggle this to set different insert target for different type of thino, like task or list type of thino":`Toggle this to set different insert target for different type of thino, like task or list type of thino`,"You can set whole diary or only part of it":`You can set whole diary or only part of it`,"Set process target":`Set process target`,Custom:`Custom`,"Whole diary":`Whole Diary`,"Set thino insert place":`Set thino insert place`,"Set where to insert thino content":`Set where to insert thino content`,"End of the diary":`End of the diary`,"Custom location":`Custom location`,"Setting guide":`User setting guide`,"Details settings":`Details settings`,"Start Thino":`Start Thino`,"About Thino Pro":`About Thino Pro`,Enabled:`Enabled`,Enable:`Enable`,"Daily notes folder":`Daily notes folder`,"Set daily notes folder":`Set daily notes folder`,"Daily note name format":`Daily note name format`,"Set daily note name format":`Set daily note name format`,"Daily note plugin":`Daily note plugin`,"Enable daily note plugin":`Enable daily note plugin`,Selected:`Selected`,Select:`Select`,"A classic theme for Thino with a two-column layout":`A classic theme for Thino with a two-column layout`,Classic:`Classic`,"A modern theme for Thino with a three-column layout and some unique features.":`A modern theme for Thino with a three-column layout and some unique features.`,Modern:`Modern`,"Go and enjoy Thino":`Go and enjoy Thino`,"Congrats! All settings done":`Congrats! All settings done`,"Adjust settings that influence your user experience with Thino.":`Adjust settings that influence your user experience with Thino.`,"Set preferences for using Thino":`Set preferences for using Thino`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.`,"Go with daily note plugin":`Go with daily note plugin`,"Choose a theme for Thino.":`Choose a theme for Thino.`,"Set theme for Thino":`Set theme for Thino`,"Set up your user info for Thino.":`Set up your user info for Thino.`,"Get started with Thino":`Get started with Thino`,"Skip and start Thino":`Skip and start Thino`,"Next step":`Next step`,"Back to previous step":`Back to previous step`,"Click to enable =>":`Click to enable =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`This is Thino's sidebar. Navigate to different path or select query filter.`,"Click here and go to settings page.":`Click here and go to settings page.`,"Click here and go to different path.":`Click here and go to different path.`,"Select or create query filter here.":`Select or create query filter here.`,"See the status of Thinos here.":`See the status of Thinos here.`,"Search your thino quickly here.":`Search your thino quickly here.`,"Edit or create your thino here.":`Edit or create your thino here.`,"See your thinos here.":`See your thinos here.`,"See your time status of thinos here.":`See your time status of thinos here.`,"See your tags here. Tags will be shown when thino contains tags.":`See your tags here. Tags will be shown when thino contains tags.`,Done:`Done`,"Thino is ready to use. ":`Thino is ready to use. `,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`You can start using Thino now. If you want to know more about Thino Pro, click the button below.`,"Default time prefix":`Default time prefix`,"Append Text Action":`Append Text Action`,"Prepend Text Action":`Prepend Text Action`,Preset:`Preset`,"Select Tags":`Select Tags`,"It is not available on small view":`It is not available on small view`,"Append text":`Append text`,"Prepend text":`Prepend text`,"Your daily note folder is not set correctly, please check your settings":`Your daily note folder is not set correctly, please check your settings`,"Default sharing style":`Default sharing style`,"Select the font for the memo content":`Select the font for the memo content`,"Select the background for the memo image":`Select the background for the memo image`,"Select the content type for the left bottom area":`Select the content type for the left bottom area`,"Default text":`Default text`,"Activity heatmap":`Activity heatmap`,"Left bottom content":`Left bottom content`,Font:`Font`,Background:`Background`,"Default font":`Default font`,"Orange gradient":`Orange gradient`,"Blue gradient":`Blue gradient`,"Green gradient":`Green gradient`,"Pink gradient":`Pink gradient`,"Image read failed, please try again":`Image read failed, please try again`,"Please select a valid image file":`Please select a valid image file`,"Default background":`Default background`,"Select local image":`Select local image`,"Image file cannot exceed 5MB":`Image file cannot exceed 5MB`,"Font size":`Font size`,"Adjust the font size":`Adjust the font size`,"Set the default style for sharing thino, 'Modern' by default.":`Set the default style for sharing thino, "Modern" by default.`,Clean:`Clean`,Minimal:`Minimal`,Gradient:`Gradient`,"Thino share":`Thino share`,"Copy to clipboard failed":`Copy to clipboard failed`,"Copy to clipboard successfully":`Copy to clipboard successfully`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`Your content has been copied to clipboard, and inserted into the editor. Please try it again`,"Share thino":`Share thino`,"Set file name after create thino":`Set file name after create thino`,"You can set file name after create thino. A input box will show when you create thino.":`You can set file name after create thino. A input box will show when you create thino.`,SPLIT:`SPLIT`,"Split by Heading 1":`Split by Heading 1`,"Split by Heading 2":`Split by Heading 2`,"Split by Heading 3":`Split by Heading 3`,"Insert task":`Insert task`,"All settings have been reset to default.":`All settings have been reset to default.`,"Reset all Thino settings":`Reset all Thino settings`,"Reset settings":`Reset settings`,"Reset Thino settings to default settings.":`Reset Thino settings to default settings.`,"Task Management":`Task Management`,"Append completed date when task done in thino":`Append completed date when task done in thino`,"Append completed date when task done in thino. False by default":`Append completed date when task done in thino. False by default`,"Set tag for single file that Thino indexes":`Set tag for single file that Thino indexes`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.","Set tag for file type file":`Set tag for file type file`,"Set tag for multi type file":`Set tag for multi type file`,"Ignore folders for multi type":`Ignore folders for multi type`,"Set folders to ignore when using multi type. Separate multiple folders with comma (,).":`Set folders to ignore when using multi type. Separate multiple folders with comma (,).`,"folder1,folder2/subfolder":`folder1,folder2/subfolder`,Interface:`Interface`,"Please input the tag":`Please input the tag`,"Merge thinos in to thino share image":`Merge thinos in to thino share image`,"Custom height for Thino content":`Custom height for Thino content`,"Set custom height for Thino content. Like 200px or 20rem":`Set custom height for Thino content. Like 200px or 20rem`,"Input height":`Input height`,"Submit issue":`Submit issue`,"Current version":`Current version`,"Bug report":`Bug report`,"Click the button to copy debug info and open the issue page":`Click the button to copy debug info and open the issue page`,"Copy and go":`Copy and go`,"Debug info copied":`Debug info copied`,"Feature request":`Feature request`,"Submit your feature request to the issue page":`Submit your feature request to the issue page`,Go:`Go`,"Toggle query list visibility":`Toggle query list visibility`,"Toggle tags visibility":`Toggle tags visibility`,"Toggle sidebar visibility":`Toggle sidebar visibility`,Collapse:`Collapse`,Expand:`Expand`,"Max height for collapse":`Max height for collapse`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)`,"Render content":`Render content`,"Optimize for Callout":`Optimize for Callout`,"Won't render content contains more than 3 callouts automatically. True by default":`Won't render content contains more than 3 callouts automatically. True by default`,"The value should be greater than":`The value should be greater than`,"Append Text":`Append Text`,"Prepend Text":`Prepend Text`,"Thino height when collapsed":`Thino height when collapsed`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`The height for thino when it is collapsed, when set 0, thino would not collapse . 100 by default. (This is not lines count, it is height in px.)`,"This option will allow you use other views when leaf width is not enough. False by default.":`This option will allow you use other views when leaf width is not enough. False by default.`,"Can select other views when leaf width is not enough":`Can select other views when leaf width is not enough`,"TRASH BOX":`TRASH BOX`,"Wait templater to finish parse before insert thino":`Wait templater to finish parse before insert thino`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.`,"Get thino capture extension":`Get thino capture extension`,"You can capture idea/text from chrome now.":`You can capture idea/text from chrome now.`,"Open File":`Open File`,"Exported CSV file":`Exported CSV file`,"Updated At":`Updated At`,"Export to CSV":`Export to CSV`,"Quick add button on mobile navbar":`Quick add button on mobile navbar`,"Always show status text":`Always show status text`,"Support filter by metadata from file":`Support filter by metadata from file`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.`,"Show source near timestamp in thino":`Show source near timestamp in thino`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.`,"Show Update Message":`Show Update Message`,"Show update message when Thino is updated. True by default":`Show update message when Thino is updated. True by default`,"Sync manually":`Sync manually`,"Show all scrollbars":`Show all scrollbars`,"TIME RANGE":`TIME RANGE`,WITHIN:`WITHIN`,"7 days":`7 days`,"14 days":`14 days`,"30 days":`30 days`,"3 months":`3 months`,"6 months":`6 months`,"1 year":`1 year`,"This week":`This week`,"Last week":`Last week`,"This month":`This month`,"Last month":`Last month`,"This year":`This year`,"Last year":`Last year`,"No history":`No history`,"Today Remaining":`Today Remaining`,"Today Total":`Today Total`,"Historical Statistics":`Historical Statistics`,byTime:`By Time`,byTimeReverse:`By Time Reverse`,Stat:`Stat`,Statistics:`Statistics`,"Daily Thino Count":`Daily Thino Count`,Total:`Total`,thinos:`thinos`,"Thino Types":`Thino Types`,"Distribution of thino types":`Distribution of thino types`,"Thino Status":`Thino Status`,"Distribution of thino status":`Distribution of thino status`,"Popular Tags":`Popular Tags`,"Top 10 most used tags":`Top 10 most used tags`,"Thino Count":`Thino Count`,"Hourly distribution":`Hourly distribution`,"Current month":`Current month`,"Monthly distribution":`Monthly distribution`,"30 Days":`Last 30 days`,Year:`Year`,"Time Distribution":`Time Distribution`,"When do you write thinos":`When do you write thinos`,"Content Length":`Content Length`,"Distribution of thino lengths":`Distribution of thino lengths`,"Daily Thinos":`Daily Thinos`,"Show Time Distribution":`Show Time Distribution`,"Hide date picker":`Hide date picker`,"Show date picker":`Show date picker`,"Clear filter":`Clear filter`,"Copy link":`Copy link`,"Copy embed link":`Copy embed link`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter to save thino`,"Fixed strings for thinos":`Fixed strings for thinos`,"Use fixed strings for thinos":`Use fixed strings for thinos`,"Enable to add fixed strings at the beginning or end of thinos.":`Enable to add fixed strings at the beginning or end of thinos.`,"Fixed prefix for thinos":`Fixed prefix for thinos`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`,"Fixed suffix for thinos":`Fixed suffix for thinos`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`,"Word count exceeded":`Word count exceeded`,"Word count feature":`Word count feature`,"Enable real-time word count display in the editor":`Enable real-time word count display in the editor`,"Maximum word count":`Maximum word count`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.`,"No linked thinos found":`No linked thinos found`,"Reference links group":`Reference links group`,"Enable reference links group in thino.":`Enable reference links group in thino.`,"No reference links found":`No reference links found`,"Outgoing Links":`Outgoing Links`,"Incoming Links":`Incoming Links`,"Error fetching reference links":`Error fetching reference links`,"Double click behavior":`Double click behavior`,"Set the behavior when double click on a thino.":`Set the behavior when double click on a thino.`,"Open thino":`Open thino`,"Edit thino":`Edit thino`,"Go to source":`Go to source`,"Do nothing":`Do nothing`,"Use default header in mobile view":`Use default header in mobile view`,"Use default header in mobile view of thino rather than custom header.":`Use default header in mobile view of thino rather than custom header.`,"Using block link when dragging a thino":`Using block link when dragging a thino`,"Using block link when dragging a thino for daily":`Using block link when dragging a thino for daily`,"Matched via tag in content":`Matched via tag in content`,"Matched via tag in file":`Matched via tag in file`,"Focus on editor when open":`Focus on editor when open`,"Focus on editor when open. True by default.":`Focus on editor when open. True by default.`,"Show scroll to top button":`Show scroll to top button`,"Show scroll to top button. True by default":`Show scroll to top button. True by default.`,"Zoom image by default":`Zoom image by default`,"Zoom image by default when viewing image.":`Zoom image by default when viewing image.`,"View archive in random review":`View archive in random review`,"View archived thinos in random review. True by default":`View archived thinos in random review. True by default.`,"Linked by":`Linked by`,Linked:`Linked`,DUPLICATE:`Duplicate`,"Show scrollbars in all thino views.":`Show scrollbars in all thino views.`,"Drag to paste content":`Drag to paste content`,"You will be able to paste content from other apps to thino by dragging rather than pasting the block link.":`You will be able to paste content from other apps to thino by dragging rather than pasting the block link.`,"Dragging behavior":`Dragging behavior`,"Control the behavior when dragging a thino. You will paste the block link by default. Block-link option only works with source type is Daily Note.":`Control the behavior when dragging a thino. You will paste the block link by default. Block-link option only works with source type is Daily Note.`,"Block link":`Block link`,"Quick capture tool that allows you to create and manage your ideas, tasks, and more.":`Quick capture tool that allows you to create and manage your ideas, tasks, and more.`,About:`About`,Blank:`Blank`,Text:`Text`,"Open Documentation":`Open Documentation`,Documentation:`Documentation`,Version:`Version`,"View the documentation for this plugin":`View the documentation for this plugin`,"Activate Pro":`Activate Pro`,Pro:`Pro`,"Activated Pro":`Activated Pro`,Tasks:`Tasks`,"Show release notes":`Show release notes`,"Show release notes when Thino is updated. True by default":`Show release notes when Thino is updated. True by default`,"Open change log":`Open change log`,"Change log":`Change log`,"View the change log for this plugin":`View the change log for this plugin`,items:`items`,"Deleting...":`Deleting...`,"Archiving...":`Archiving...`,"Pinning...":`Pinning...`,"Unpinning...":`Unpinning...`,"Pin/Unpin":`Pin/Unpin`,Confirm:`Confirm`,"Successfully deleted":`Successfully deleted`,"Successfully archived":`Successfully archived`,"Successfully pinned":`Successfully pinned`,"Successfully unpinned":`Successfully unpinned`,"Successfully copied":`Successfully copied`,failed:`failed`,Thinos:`Thinos`,Processed:`Processed`,"Secret Content Masking":`Secret Content Masking`,"Enable secret masking":`Enable secret masking`,"Mask memo content matching a regex pattern":`Mask memo content matching a regex pattern`,"Secret content regex":`Secret content regex`,"Regex pattern to match content that should be masked":`Regex pattern to match content that should be masked`,"Masking style":`Masking style`,"Choose between blur effect or block character replacement":`Choose between blur effect or block character replacement`,"Set secret password":`Set secret password`,"Set or update the password used to reveal masked content":`Set or update the password used to reveal masked content`,"Enter password to reveal":`Enter password to reveal`,"Enter password":`Enter password`,"Confirm password":`Confirm password`,"Passwords do not match":`Passwords do not match`,"Incorrect password":`Incorrect password`,"Password set successfully":`Password set successfully`,"Click to reveal secret content":`Click to reveal secret content`,"Requires Obsidian API 1.11.4+":`Requires Obsidian API 1.11.4+`,"WeChat Integration":`WeChat Integration`,"Receive WeChat messages and save them as Thino memos. Desktop only. Requires Pro.":`Receive WeChat messages and save them as Thino memos. Desktop only. Requires Pro.`,"Enable WeChat":`Enable WeChat`,"Enable WeChat message receiver":`Enable WeChat message receiver`,"Auto start":`Auto start`,"Automatically start WeChat receiver when Obsidian opens":`Automatically start WeChat receiver when Obsidian opens`,"Default reply":`Default reply`,"Auto-reply text when a message is saved. Leave empty to disable.":`Auto-reply text when a message is saved. Leave empty to disable.`,"Voice save mode":`Voice save mode`,"How to save voice messages: transcription text, audio file, or both":`How to save voice messages: transcription text, audio file, or both`,"Text + Audio":`Text + Audio`,"Text only":`Text only`,"Audio only":`Audio only`,Connection:`Connection`,"WeChat is running":`WeChat is running`,"WeChat is stopped":`WeChat is stopped`,"Credentials found. Click Start to connect.":`Credentials found. Click Start to connect.`,"No credentials. Will show QR code on start.":`No credentials. Will show QR code on start.`,Start:`Start`,Stop:`Stop`,"Clear stored credentials and disconnect":`Clear stored credentials and disconnect`,"Voice Codec":`Voice Codec`,"SILK Decoder":`SILK Decoder`,"Installed. Voice messages will be converted to playable WAV files.":`Installed. Voice messages will be converted to playable WAV files.`,"Not installed. Download to enable voice message playback in Obsidian.":`Not installed. Download to enable voice message playback in Obsidian.`,Remove:`Remove`,Download:`Download`,"Downloading...":`Downloading...`,"Voice codec removed":`Voice codec removed`,"Voice codec downloaded":`Voice codec downloaded`,"Download failed":`Download failed`,Commands:`Commands`,"Send messages to the WeChat bot with these command prefixes:":`Send messages to the WeChat bot with these command prefixes:`,or:`or`,"Save to daily note":`Save to daily note`,"Save as task":`Save as task`,"Save as multi-file note":`Save as multi-file note`,"No prefix":`No prefix`,"Save using default save type":`Save using default save type`,"WeChat integration is only available on desktop":`WeChat integration is only available on desktop`,"WeChat is already running":`WeChat is already running`,"WeChat connected":`WeChat connected`,"WeChat disconnected":`WeChat disconnected`,"WeChat logged out":`WeChat logged out`,"Scanned! Please confirm on your phone.":`Scanned! Please confirm on your phone.`,"Login successful!":`Login successful!`,"QR code expired. Please restart.":`QR code expired. Please restart.`,Saved:`Saved`,"Empty message, not saved":`Empty message, not saved`,"Agent Routing":`Agent Routing`,"Route incoming WeChat messages to AI agents (ACP/CLI/HTTP). When enabled, messages with @agent or /agent prefix are forwarded to the specified agent.":`Route incoming WeChat messages to AI agents (ACP/CLI/HTTP). When enabled, messages with @agent or /agent prefix are forwarded to the specified agent.`,"Enable Agent Routing":`Enable Agent Routing`,"Forward messages to AI agents instead of saving as memos":`Forward messages to AI agents instead of saving as memos`,"Default Agent":`Default Agent`,"Agent used when message has no @agent prefix":`Agent used when message has no @agent prefix`,"None (save as memo)":`None (save as memo)`,Agents:`Agents`,"Configure AI agents":`Configure AI agents`,"Add Agent":`Add Agent`,"Agent name":`Agent name`,Delete:`Delete`,Endpoint:`Endpoint`,"OpenAI-compatible API endpoint URL":`OpenAI-compatible API endpoint URL`,"API Key":`API Key`,Command:`Command`,"Path to agent binary":`Path to agent binary`,Args:`Args`,"Extra command-line arguments (space-separated)":`Extra command-line arguments (space-separated)`,Model:`Model`,"System Prompt":`System Prompt`,"Optional system prompt for the agent":`Optional system prompt for the agent`,"Agent Commands":`Agent Commands`,"Send to specific agent":`Send to specific agent`,"Broadcast to multiple agents":`Broadcast to multiple agents`,"no message":`no message`,"Switch default agent":`Switch default agent`,"Reset agent session":`Reset agent session`,"Show current agent info":`Show current agent info`,"Built-in aliases":`Built-in aliases`,"Working Directory":`Working Directory`,"Default working directory for all agents. Leave empty to use vault root.":`Default working directory for all agents. Leave empty to use vault root.`,"Vault root":`Vault root`,"Permission Mode":`Permission Mode`,"Approval policy for agent tool calls":`Approval policy for agent tool calls`,Default:`Default`,"Accept Edits":`Accept Edits`,"Plan Mode":`Plan Mode`,"Don't Ask":`Don't Ask`,"Bypass Permissions":`Bypass Permissions`,"Override global working directory for this agent":`Override global working directory for this agent`,"Use global":`Use global`,Type:`Type`,"Switched to thino mode":`Switched to thino mode`,"Reasoning Effort":`Reasoning Effort`,"Thinking budget level (codex/ACP agents)":`Thinking budget level (codex/ACP agents)`,None:`None`,Low:`Low`,Medium:`Medium`,High:`High`,"Extra High":`Extra High`,"Usage: /thino <content>":`Usage: /thino <content>`,"Allow All File Paths":`Allow All File Paths`,"Skip path restriction when sending files. Enable if agents need to send files from any directory.":`Skip path restriction when sending files. Enable if agents need to send files from any directory.`}})),wn,Tn=o((()=>{wn={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":`User Name`,"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 categorised under that title.":`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 categorised under that title.`,"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 enabled, 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 when save thino":`Default Prefix When Save Thino`,"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`,"Daily Review":`Daily Review`,"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:`IS NOT`,PATH:`PATH`,METADATA:`METADATA`,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 may be 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 haven'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/Tablet even when the leaf width is less than 875px. False by default.":`Show left sidebar on PC/Tablet 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 haven'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 Colour Scheme`,"Set different color scheme for heatmap.":`Set different colour 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 type for Thino":`Save type 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 forgot 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 bin. 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 type":`Default save location`,'Set the default save type for thino. "DAILY" by default':`Set the default save type 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 does 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, 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, 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 selected text":`Copy selected text`,"Copy thino":`Copy thino`,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`,word:`word`,"Return To Home Page":`Return To Home Page`,"No thinos to review!":`No thinos to review!`,"Thinos to review":`Thinos to review`,"Start Review":`Start Review`,Hard:`Hard`,Good:`Good`,Easy:`Easy`,Again:`Again`,"Clear all review data":`Clear all review data`,"Daily Progress":`Daily Progress`,"Show stats":`Show stats`,"Hide stats":`Hide stats`,Remaining:`Remaining`,"Total Reviews":`Total Reviews`,"Today, you have reviewed all your thinos!":`Today, you have reviewed all your thinos!`,"Daily review limit reached! Come back tomorrow.":`Daily review limit reached! Come back tomorrow.`,"Open thino in center window":`Open thino in centre 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":`Show daily thino`,"Focus on search bar":`Focus on search bar`,"Show-thino in popover(Hover editor)":`Show-thino in popover(Hover editor)`,"Center window":`Centre 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 in thino list":`Show day mark in thino list`,"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 licence 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`,"Open link directly in Thino view":`Open link directly in Thino 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 enabled 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`,"Tag Bulk Select":`Tag Bulk Select`,"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/share image":`Icon for moments/chat view/share image`,"Set the icon for moments/chat view/share image":`Set the icon for moments/chat view/share image`,"Quote for moments view/share image":`Quote for moments view/share image`,"Set the quote for moments view/share image":`Set the quote for moments view/share image`,"Theme for Thino":`Theme for Thino`,"Set the theme for Thino":`Set the theme for Thino`,"Interface Details":`Interface 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`,"No content to generate.":`No content to generate.`,"Image generated successfully.":`Image generated successfully.`,"Failed to generate image.":`Failed to generate image.`,"Share filtered thinos as image":`Share filtered thinos as image`,"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`,"Please open thino first":`Please open thino first`,"Insert editor":`Insert editor`,"Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":`Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.`,"Default time prefix for thino in daily notes":`Default time prefix for thino in daily notes`,"Set default time prefix for thino in daily notes.":`Set default time prefix for thino in daily notes.`,"Save image successfully":`Save image successfully`,"User quote":`User quote`,"Set user quote for thino":`Set user quote for thino`,"User icon":`User icon`,"Set user icon for thino. You can input http/https link or file path in vault.":`Set user icon for thino. You can input http/https link or file path in vault.`,"User info":`User info`,"Copy filtered results":`Copy filtered results`,"Share image":`Share image`,Default:`Default`,Gray:`Gray`,Grass:`Grass`,Flame:`Flame`,Olive:`Olive`,Ice:`Ice`,Magenta:`Magenta`,"Daily notes":`Daily notes`,Editor:`Editor`,"Append/prepend text when share to Thino":`Append/prepend text when share to Thino`,"Append text when share to Thino":`Append text when share to Thino`,"Prepend text when share to Thino":`Prepend text when share to Thino`,"Add newline when append/prepend text":`Add newline when append/prepend text`,"Input anything here":`Input anything here`,Prepend:`Prepend`,Append:`Append`,Both:`Both`,None:`None`,"Hide pinned group":`Hide pinned group`,"Hide pinned group in thino list. False by default.":`Hide pinned group in thino list. False by default.`,"Set the heading for the task type of thino, by default 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.":`Set the heading for the task type of thino, by default 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.`,"Different insert target for different type":`Different insert target for different type`,"Toggle this to set different insert target for different type of thino, like task or list type of thino":`Toggle this to set different insert target for different type of thino, like task or list type of thino`,"You can set whole diary or only part of it":`You can set whole diary or only part of it`,"Set process target":`Set process target`,Custom:`Custom`,"Whole diary":`Whole Diary`,"Set thino insert place":`Set thino insert place`,"Set where to insert thino content":`Set where to insert thino content`,"End of the diary":`End of the diary`,"Custom location":`Custom location`,"Setting guide":`User setting guide`,"Details settings":`Details settings`,"Start Thino":`Start Thino`,"About Thino Pro":`About Thino Pro`,Enabled:`Enabled`,Enable:`Enable`,"Daily notes folder":`Daily notes folder`,"Set daily notes folder":`Set daily notes folder`,"Daily note name format":`Daily note name format`,"Set daily note name format":`Set daily note name format`,"Daily note plugin":`Daily note plugin`,"Enable daily note plugin":`Enable daily note plugin`,Selected:`Selected`,Select:`Select`,"A classic theme for Thino with a two-column layout":`A classic theme for Thino with a two-column layout`,Classic:`Classic`,"A modern theme for Thino with a three-column layout and some unique features.":`A modern theme for Thino with a three-column layout and some unique features.`,Modern:`Modern`,"Go and enjoy Thino":`Go and enjoy Thino`,"Congrats! All settings done":`Congrats! All settings done`,"Adjust settings that influence your user experience with Thino.":`Adjust settings that influence your user experience with Thino.`,"Set preferences for using Thino":`Set preferences for using Thino`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.`,"Go with daily note plugin":`Go with daily note plugin`,"Choose a theme for Thino.":`Choose a theme for Thino.`,"Set theme for Thino":`Set theme for Thino`,"Set up your user info for Thino.":`Set up your user info for Thino.`,"Get started with Thino":`Get started with Thino`,"Skip and start Thino":`Skip and start Thino`,"Next step":`Next step`,"Back to previous step":`Back to previous step`,"Click to enable =>":`Click to enable =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`This is Thino's sidebar. Navigate to different path or select query filter.`,"Click here and go to settings page.":`Click here and go to settings page.`,"Click here and go to different path.":`Click here and go to different path.`,"Select or create query filter here.":`Select or create query filter here.`,"See the status of Thinos here.":`See the status of Thinos here.`,"Search your thino quickly here.":`Search your thino quickly here.`,"Edit or create your thino here.":`Edit or create your thino here.`,"See your thinos here.":`See your thinos here.`,"See your time status of thinos here.":`See your time status of thinos here.`,"See your tags here. Tags will be shown when thino contains tags.":`See your tags here. Tags will be shown when thino contains tags.`,Done:`Done`,"Thino is ready to use. ":`Thino is ready to use. `,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`You can start using Thino now. If you want to know more about Thino Pro, click the button below.`,"Default time prefix":`Default time prefix`,"Append Text Action":`Append Text Action`,"Prepend Text Action":`Prepend Text Action`,Preset:`Preset`,"Select Tags":`Select Tags`,"It is not available on small view":`It is not available on small view`,"Append text":`Append text`,"Prepend text":`Prepend text`,"Your daily note folder is not set correctly, please check your settings":`Your daily note folder is not set correctly, please check your settings`,"Default sharing style":`Default sharing style`,"Set the default style for sharing thino, 'Modern' by default.":`Set the default style for sharing thino, "Modern" by default.`,Clean:`Clean`,Minimal:`Minimal`,Gradient:`Gradient`,"Thino share":`Thino share`,"Copy to clipboard failed":`Copy to clipboard failed`,"Copy to clipboard successfully":`Copy to clipboard successfully`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`Your content has been copied to clipboard, and inserted into the editor. Please try it again`,"Share thino":`Share thino`,"Set file name after create thino":`Set file name after create thino`,"You can set file name after create thino. A input box will show when you create thino.":`You can set file name after create thino. A input box will show when you create thino.`,SPLIT:`SPLIT`,"Split by Heading 1":`Split by Heading 1`,"Split by Heading 2":`Split by Heading 2`,"Split by Heading 3":`Split by Heading 3`,"Insert task":`Insert task`,"All settings have been reset to default.":`All settings have been reset to default.`,"Reset all Thino settings":`Reset all Thino settings`,"Reset settings":`Reset settings`,"Reset Thino settings to default settings.":`Reset Thino settings to default settings.`,"Task Management":`Task Management`,"Append completed date when task done in thino":`Append completed date when task done in thino`,"Append completed date when task done in thino. False by default":`Append completed date when task done in thino. False by default`,"Set tag for single file that Thino indexes":`Set tag for single file that Thino indexes`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.","Set tag for file type file":`Set tag for file type file`,"Set tag for multi type file":`Set tag for multi type file`,"Please input the tag":`Please input the tag`,"Merge thinos in to thino share image":`Merge thinos in to thino share image`,"Custom height for Thino content":`Custom height for Thino content`,"Set custom height for Thino content. Like 200px or 20rem":`Set custom height for Thino content. Like 200px or 20rem`,"Input height":`Input height`,"Submit issue":`Submit issue`,"Current version":`Current version`,"Bug report":`Bug report`,"Click the button to copy debug info and open the issue page":`Click the button to copy debug info and open the issue page`,"Copy and go":`Copy and go`,"Debug info copied":`Debug info copied`,"Feature request":`Feature request`,"Submit your feature request to the issue page":`Submit your feature request to the issue page`,Go:`Go`,"Toggle query list visibility":`Toggle query list visibility`,"Toggle tags visibility":`Toggle tags visibility`,"Toggle sidebar visibility":`Toggle sidebar visibility`,Collapse:`Collapse`,Expand:`Expand`,"Max height for collapse":`Max height for collapse`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)`,"Render content":`Render content`,"Optimize for Callout":`Optimize for Callout`,"Won't render content contains more than 3 callouts automatically. True by default":`Won't render content contains more than 3 callouts automatically. True by default`,"The value should be greater than":`The value should be greater than`,"Append Text":`Append Text`,"Prepend Text":`Prepend Text`,"Thino height when collapsed":`Thino height when collapsed`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`The height for thino when it is collapsed, when set 0, thino would not collapse . 100 by default. (This is not lines count, it is height in px.)`,"This option will allow you use other views when leaf width is not enough. False by default.":`This option will allow you use other views when leaf width is not enough. False by default.`,"Can select other views when leaf width is not enough":`Can select other views when leaf width is not enough`,"TRASH BOX":`TRASH BOX`,"Wait templater to finish parse before insert thino":`Wait templater to finish parse before insert thino`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.`,"Get thino capture extension":`Get thino capture extension`,"You can capture idea/text from chrome now.":`You can capture idea/text from chrome now.`,"Open File":`Open File`,"Exported CSV file":`Exported CSV file`,"Updated At":`Updated At`,"Export to CSV":`Export to CSV`,"Quick add button on mobile navbar":`Quick add button on mobile navbar`,"Always show status text":`Always show status text`,"Support filter by metadata from file":`Support filter by metadata from file`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.`,"Show source near timestamp in thino":`Show source near timestamp in thino`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.`,"Show Update Message":`Show Update Message`,"Show update message when Thino is updated. True by default":`Show update message when Thino is updated. True by default`,"Sync manually":`Sync manually`,"Show all scrollbars":`Show all scrollbars`,"TIME RANGE":`TIME RANGE`,WITHIN:`WITHIN`,"7 days":`7 days`,"14 days":`14 days`,"30 days":`30 days`,"3 months":`3 months`,"6 months":`6 months`,"1 year":`1 year`,"This week":`This week`,"Last week":`Last week`,"This month":`This month`,"Last month":`Last month`,"This year":`This year`,"Last year":`Last year`,"No history":`No history`,"Today Remaining":`Today Remaining`,"Today Total":`Today Total`,"Historical Statistics":`Historical Statistics`,byTime:`By Time`,byTimeReverse:`By Time Reverse`,Stat:`Stat`,Statistics:`Statistics`,"Daily Thino Count":`Daily Thino Count`,Total:`Total`,thinos:`thinos`,"Thino Types":`Thino Types`,"Distribution of thino types":`Distribution of thino types`,"Thino Status":`Thino Status`,"Distribution of thino status":`Distribution of thino status`,"Popular Tags":`Popular Tags`,"Top 10 most used tags":`Top 10 most used tags`,"Thino Count":`Thino Count`,"Hourly distribution":`Hourly distribution`,"Current month":`Current month`,"Monthly distribution":`Monthly distribution`,"30 Days":`Last 30 days`,Year:`Year`,"Time Distribution":`Time Distribution`,"When do you write thinos":`When do you write thinos`,"Content Length":`Content Length`,"Distribution of thino lengths":`Distribution of thino lengths`,"Daily Thinos":`Daily Thinos`,"Show Time Distribution":`Show Time Distribution`,"Hide date picker":`Hide date picker`,"Show date picker":`Show date picker`,"Clear filter":`Clear filter`,"Copy link":`Copy link`,"Copy embed link":`Copy embed link`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter to save thino`,"Fixed strings for thinos":`Fixed strings for thinos`,"Use fixed strings for thinos":`Use fixed strings for thinos`,"Enable to add fixed strings at the beginning or end of thinos.":`Enable to add fixed strings at the beginning or end of thinos.`,"Fixed prefix for thinos":`Fixed prefix for thinos`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`,"Fixed suffix for thinos":`Fixed suffix for thinos`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`,"Word count exceeded":`Word count exceeded`,"Word count feature":`Word count feature`,"Enable real-time word count display in the editor":`Enable real-time word count display in the editor`,"Maximum word count":`Maximum word count`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.`,"No linked thinos found":`No linked thinos found`,"Reference links group":`Reference links group`,"Enable reference links group in thino.":`Enable reference links group in thino.`,"No reference links found":`No reference links found`,"Outgoing Links":`Outgoing Links`,"Incoming Links":`Incoming Links`,"Error fetching reference links":`Error fetching reference links`,"Double click behavior":`Double click behavior`,"Set the behavior when double click on a thino.":`Set the behavior when double click on a thino.`,"Open thino":`Open thino`,"Edit thino":`Edit thino`,"Go to source":`Go to source`,"Do nothing":`Do nothing`,"Use default header in mobile view":`Use default header in mobile view`,"Use default header in mobile view of thino rather than custom header.":`Use default header in mobile view of thino rather than custom header.`}})),En,Dn=o((()=>{En={welcome:`¡Bienvenido a Thino!`,ribbonIconTitle:`Thino`,to:`a`,months:[`Enero`,`Febrero`,`Marzo`,`Abril`,`Mayo`,`Junio`,`Julio`,`Agosto`,`Septiembre`,`Octubre`,`Noviembre`,`Diciembre`],monthsShort:[`Ene.`,`Feb.`,`Mar.`,`Abr.`,`May.`,`Jun.`,`Jul.`,`Ago.`,`Sep.`,`Oct.`,`Nov.`,`Dic.`],weekDays:[`Domingo`,`Lunes`,`Martes`,`Miércoles`,`Jueves`,`Viernes`,`Sábado`],weekDaysShort:[`Dom`,`Lun`,`Mar`,`Mié`,`Jue`,`Vie`,`Sáb`],year:null,month:null,"Basic Options":`Opciones básicas`,"User name":`Nombre de usuario`,"Set your user name here. 'Memos 😏' By default":`Establece tu nombre de usuario aquí. 'Thino 😏' por defecto`,'You can set target heading like "# Heading" to control data location':`Puedes establecer un encabezado objetivo como "# Encabezado" para controlar la ubicación de los datos`,"Insert after heading":`Insertar después del encabezado`,"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.":`Si se deja en blanco, el contenido thino registrado se insertará al final del diario; si se proporciona un título, todo el contenido thino registrado se categorizará uniformemente bajo ese título.`,"Allows admonitions to be created using ":`Permite crear advertencias usando `,"Process Memos below":`Procesar thinos debajo`,"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.":`Si se deja en blanco, la interfaz de Thino mostrará todos los contenidos de registros thino; si se proporciona un título, la interfaz de Thino solo mostrará los contenidos bajo ese título, y los contenidos escritos en otros lugares no se mostrarán.`,"Save Memo button label":`Etiqueta del botón Guardar thino`,"The text shown on the save Memo button in the UI. 'NOTEIT' by default.":`El texto mostrado en el botón guardar Thino en la interfaz. 'NOTEIT' por defecto.`,"Focus on editor when open memos":`Enfocar en el editor al abrir thinos`,"Focus on editor when open memos. Focus by default.":`Enfocar en el editor al abrir thinos. Enfocado por defecto.`,"Open daily memos with open memos":`Abrir thinos diarios al abrir thinos`,"Open daily memos with open memos. Open by default.":`Abrir thinos diarios al abrir thinos. Abierto por defecto.`,"Open Memos when obsidian opens":`Abrir Thino cuando se abre Obsidian`,"When enable this, Memos will open when Obsidian opens. False by default.":`Cuando esto está habilitado, Thino se abrirá cuando se abra Obsidian. Deshabilitado por defecto.`,"Hide done tasks in Memo list":`Ocultar tareas completadas en la lista de thinos`,"Hide all done tasks in Memo list. Show done tasks by default.":`Ocultar todas las tareas completadas en la lista de thinos. Mostrar tareas completadas por defecto.`,"Advanced Options":`Opciones avanzadas`,"UI language for date":`Idioma de la interfaz para fechas`,"Translates the date UI language. Only 'en' and 'zh' are available.":`Traduce el idioma de la interfaz de fechas. Solo 'en' y 'zh' están disponibles.`,"Default prefix when save thino":`Prefijo predeterminado al guardar thino`,"Set the default prefix when create memo, 'List' by default.":`Establece el prefijo predeterminado al crear thino, 'Lista' por defecto.`,"Default insert date format":`Formato de fecha de inserción predeterminado`,"Set the default date format when insert date by @, 'Tasks' by default.":`Establece el formato de fecha predeterminado al insertar fecha con @, 'Tareas' por defecto.`,"Default editor position on mobile":`Posición predeterminada del editor en móvil`,"Set the default editor position on Mobile, 'Top' by default.":`Establece la posición predeterminada del editor en móvil, 'Arriba' por defecto.`,"Use button to show editor on mobile":`Usar botón para mostrar editor en móvil`,"Set a float button to call editor on mobile. Only when editor located at the bottom works.":`Establece un botón flotante para llamar al editor en móvil. Solo funciona cuando el editor está ubicado en la parte inferior.`,"Show Time When Copy Results":`Mostrar hora al copiar resultados`,"Show time when you copy results, like 12:00. Copy time by default.":`Mostrar hora cuando copias resultados, como 12:00. Copiar hora por defecto.`,"Show Date When Copy Results":`Mostrar fecha al copiar resultados`,"Show date when you copy results, like [[2022-01-01]]. Copy date by default.":`Mostrar fecha cuando copias resultados, como [[2022-01-01]]. Copiar fecha por defecto.`,"Add Blank Line Between Different Date":`Agregar línea en blanco entre fechas diferentes`,"Add blank line when copy result with date. No blank line by default.":`Agregar línea en blanco al copiar resultado con fecha. Sin línea en blanco por defecto.`,"Share Options":`Opciones de compartir`,"Share Memos Image Footer Start":`Inicio del pie de imagen al compartir Thino`,"Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":`Establece lo que quieras aquí, usa {ThinoNum} para mostrar el número de thino, {UsedDay} para días. '{ThinoNum} Thino {UsedDay} Días' por defecto`,"Share Memos Image Footer End":`Final del pie de imagen al compartir Thino`,"Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":`Establece lo que quieras aquí, usa {UserName} como tu nombre de usuario. '✍️ Por {UserName}' por defecto`,"Save Shared Image To Folder For Mobile":`Guardar imagen compartida en carpeta para móvil`,"Save image to folder for mobile. False by Default":`Guardar imagen en carpeta para móvil. Deshabilitado por defecto`,"Say Thank You":`Dar las gracias`,Donate:`Donar`,"If you like this plugin, consider donating to support continued development:":`Si te gusta este plugin, considera donar para apoyar el desarrollo continuo:`,"File Name of Recycle Bin":`Nombre del archivo de la papelera de reciclaje`,"Set the filename for recycle bin. 'delete' By default":`Establece el nombre de archivo para la papelera. 'eliminar' por defecto`,"File Name of Query File":`Nombre del archivo de consulta`,"Set the filename for query file. 'query' By default":`Establece el nombre de archivo para consulta. 'consulta' por defecto`,"Use Tags In Vault":`Usar etiquetas en la bóveda`,"Use tags in vault rather than only in Memos. False by default.":`Usar etiquetas en la bóveda en lugar de solo en Thino. Deshabilitado por defecto.`,"Ready to convert image into background":`Listo para convertir imagen en fondo`,List:`Lista`,Task:`Tarea`,Top:`Arriba`,Bottom:`Abajo`,TAG:`ETIQUETA`,DAY:`DÍA`,QUERY:`CONSULTA`,EDIT:`EDITAR`,PIN:`FIJAR`,UNPIN:`DESFIJAR`,DELETE:`ELIMINAR`,"CONFIRM!":`¡CONFIRMAR!`,"CREATE FILTER":`CREAR FILTRO`,"Comment it...":`Comentar...`,Settings:`Ajustes`,"Recycle bin":`Papelera de reciclaje`,"About Me":`Sobre mí`,"Fetching data...":`Obteniendo datos...`,"Here is No Memos.":`No hay thinos aquí.`,"Frequently Used Tags":`Etiquetas frecuentes`,"What do you think now...":`¿Qué piensas ahora...?`,READ:`LEER`,MARK:`MARCAR`,SHARE:`COMPARTIR`,SOURCE:`FUENTE`,RESTORE:`RESTAURAR`,ARCHIVE:`Archivar`,"Daily Review":`Revisión diaria`,"DELETE AT":`ELIMINADO EL`,"Noooop!":`¡Noooop!`,"All Data is Loaded 🎉":`Todos los datos están cargados 🎉`,"Quick filter":`Filtro rápido`,TYPE:`TIPO`,LINKED:`ENLAZADO`,"NO TAGS":`SIN ETIQUETAS`,"HAS LINKS":`TIENE ENLACES`,"HAS IMAGES":`TIENE IMÁGENES`,INCLUDE:`INCLUIR`,EXCLUDE:`EXCLUIR`,TEXT:`TEXTO`,IS:`ES`,AND:`Y`,OR:`O`,LIST:`LISTA`,ISNOT:`NO ES`,PATH:`RUTA`,METADATA:`METADATOS`,SELECT:`SELECCIONAR`,"ADD FILTER TERMS":`AGREGAR TÉRMINOS DE FILTRO`,FILTER:`FILTRAR`,Filter:`Filtro`,TITLE:`TÍTULO`,"CREATE QUERY":`CREAR CONSULTA`,"EDIT QUERY":`EDITAR CONSULTA`,MATCH:`COINCIDE`,TIMES:`VECES`,"Share Memo Image":`Compartir imagen de Thino`,"↗Click the button to save":`↗Haz clic en el botón para guardar`,"Image is generating...":`Generando imagen...`,"Image is loading...":`Cargando imagen...`,"Loading...":`Cargando...`,"😟 Cannot load image, image link maybe broken":`😟 No se puede cargar la imagen, el enlace puede estar roto`,"Daily Memos":`Thinos diarios`,"CANCEL EDIT":`CANCELAR EDICIÓN`,"LINK TO THE":`ENLAZAR A`,"Mobile Options":`Opciones móviles`,"Experimental Options":`Opciones experimentales`,"Don't support web image yet, please input image path in vault":`Aún no se admiten imágenes web, por favor ingresa la ruta de la imagen en la bóveda`,"Background Image in Dark Theme":`Imagen de fondo en tema oscuro`,"Background Image in Light Theme":`Imagen de fondo en tema claro`,'Set background image in dark theme. Set something like "Daily/one.png"':`Establece la imagen de fondo en tema oscuro. Establece algo como "Daily/one.png"`,'Set background image in light theme. Set something like "Daily/one.png"':`Establece la imagen de fondo en tema claro. Establece algo como "Daily/one.png"`,'Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':`Establece la composición predeterminada de thino, debes usar {TIME} como "HH:mm" y {CONTENT} como contenido. "{TIME} {CONTENT}" por defecto`,"Default Memo Composition":`[Obsoleto] Composición predeterminada de Thino`,"Show Tasks Label":`Mostrar etiqueta de tareas`,"Show tasks label near the time text. False by default":`Mostrar etiqueta de tareas cerca del texto de hora. Deshabilitado por defecto`,"Please Open Memos First":`Por favor abre Thino primero`,DATE:`FECHA`,OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:`PLUGIN_NLDATES_DE_OBSIDIAN_NO_HABILITADO`,BEFORE:`ANTES`,AFTER:`DESPUÉS`,"Allow Comments On Memos":`Permitir comentarios en Thino`,"You can comment on memos. False by default":`Puedes comentar en thinos. Deshabilitado por defecto`,Import:`Importar`,"TITLE CANNOT BE NULL!":`¡EL TÍTULO NO PUEDE ESTAR VACÍO!`,"FILTER CANNOT BE NULL!":`¡EL FILTRO NO PUEDE ESTAR VACÍO!`,"Comments In Original DailyNotes/Notes":`Comentarios en notas diarias/notas originales`,"You should install Dataview Plugin ver 0.5.9 or later to use this feature.":`Debes instalar el Plugin Dataview ver 0.5.9 o posterior para usar esta función.`,"Open Memos Successfully":`Thino abierto exitosamente`,"Fetch Memos Error":`😭 Error al obtener`,"Copied to clipboard Successfully":`Copiado al portapapeles exitosamente`,"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":`Verifica si abriste el Plugin de notas diarias o el Plugin de notas periódicas`,"Please finish the last filter setting first":`Por favor termina la última configuración de filtro primero`,"Close Memos Successfully":`Thino cerrado exitosamente`,"Insert as Memo":`Insertar como Thino`,"Insert file as memo content":`Insertar archivo como contenido de thino`,"Image load failed":`Error al cargar la imagen`,"Content cannot be empty":`El contenido no puede estar vacío`,"Unable to create new file.":`No se puede crear nuevo archivo.`,"Failed to fetch deleted memos: ":`Error al obtener thinos eliminados: `,"RESTORE SUCCEED":`RESTAURACIÓN EXITOSA`,"DELETE SUCCEED":`ELIMINACIÓN EXITOSA`,"Save Memo button icon":`Icono del botón guardar Thino`,"The icon shown on the save Memo button in the UI.":`El icono mostrado en el botón guardar Thino en la interfaz.`,"Fetch Memos From Particular Notes":`Obtener Thinos 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':`Puedes establecer cualquier consulta Dataview para thinos para obtenerlos. Todos los thinos en esas notas se mostrarán en la lista. "#memo" por defecto`,"Allow Memos to Fetch Memo from Notes":`Permitir a Thino obtener Thino de notas`,"Use Memos to manage all memos in your notes, not only in daily notes. False by default":`Usar Thino para administrar todos los thinos en tus notas, no solo en notas diarias. Deshabilitado por defecto`,"Always Show Memo Comments":`Mostrar siempre comentarios de Thino`,"Always show memo comments on memos. False by default":`Mostrar siempre comentarios de thino en thinos. Deshabilitado por defecto`,"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":`No estableciste carpeta para notas diarias en los plugins de notas periódicas y notas diarias.`,"Please check your daily note plugin OR periodic notes plugin settings":`Por favor verifica la configuración de tu plugin de notas diarias O plugin de notas periódicas`,"Use which plugin's default configuration":`Usar la configuración predeterminada de qué plugin`,"Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":`Thino usa la configuración predeterminada del plugin para obtener thinos de diario, 'Diario' por defecto.`,Daily:`Diario`,"Always Show Leaf Sidebar on PC":`Mostrar siempre barra lateral en PC`,"Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":`Mostrar barra lateral izquierda en PC/Tablet incluso cuando el ancho de la hoja es menor a 875px. Deshabilitado por defecto.`,"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":`No estableciste formato para notas diarias en los plugins de notas periódicas y notas diarias.`,"fetch more":`cargar más`,"Search all settings":`Buscar todos los ajustes`,General:`General`,Theme:`Tema`,Share:`Compartir`,Advanced:`Avanzado`,Thino:`Thino`,"Random Review":`Revisión aleatoria`,"ARCHIVED AT":`ARCHIVADO EL`,"Failed to get memos from daily notes":`Error al obtener thinos de notas diarias`,"Failed to delete memo":`Error al eliminar thino`,"CTRL + ENTER to save":`CTRL + ENTER para guardar`,"Started from":`Comenzado desde`,"Custom Background Image":`Imagen de fondo personalizada`,"Set custom background image.":`Establecer imagen de fondo personalizada.`,"Custom Memo Footer":`Pie de Thino personalizado`,"Set custom memo footer.":`Establecer pie de thino personalizado.`,"Heatmap Color Scheme":`Esquema de color del mapa de calor`,"Set different color scheme for heatmap.":`Establecer diferente esquema de color para el mapa de calor.`,"Enable Local Http Server":`Habilitar servidor Http local`,"Memos Http Server Port":`Puerto del servidor Http de Thino`,"Set memos http server port to listen. '43999' by default":`Establecer puerto del servidor http de thino para escuchar. '43999' por defecto`,"Default Editor Mode":`Modo de editor predeterminado`,"Live-Preview Mode OR Source Mode.":`Modo vista previa en vivo O modo fuente.`,"Save type for Thino":`Tipo de guardado para Thino`,DAILY:`DIARIO`,MULTI:`MÚLTIPLE`,CANVAS:`LIENZO`,ALL:`TODO`,FILE:`ARCHIVO`,TODO:`POR HACER`,DONE:`HECHO`,JOURNAL:`DIARIO`,OTHER:`OTRO`,"Failed to create daily note, check if it exists.":`Error al crear nota diaria, verifica si existe.`,"Failed to create daily note. Please check if you created a folder for daily notes.":`Error al crear nota diaria. Por favor verifica si creaste una carpeta para notas diarias.`,"After you verify your account, please refresh this page.":`Después de verificar tu cuenta, por favor actualiza esta página.`,Verify:`Verificar`,"Oops! You forget to verify insider account":`¡Ups! Olvidaste verificar la cuenta insider`,"If you have any questions, please contact us.":`Si tienes alguna pregunta, por favor contáctanos.`,"Delete Thino Directly":`Eliminar Thino directamente`,"When delete thino directly, it will not be moved to trash. False by default.":`Al eliminar thino directamente, no se moverá a la papelera. Deshabilitado por defecto.`,"Enable opening thino globally":`Habilitar apertura global de thino`,"Enable opening thino globally. False by default.":`Habilitar apertura global de thino. Deshabilitado por defecto.`,"Key for opening thino globally":`Tecla para abrir thino globalmente`,"Set key for opening thino globally. CTRL + SHIFT + T by default.":`Establecer tecla para abrir thino globalmente. CTRL + SHIFT + T por defecto.`,"Key for showing thino globally":`Tecla para mostrar thino globalmente`,"Set key for showing thino globally. CTRL + SHIFT + E by default.":`Establecer tecla para mostrar thino globalmente. CTRL + SHIFT + E por defecto.`,"Get activation code":`Obtener código de activación`,"Input activation code here":`Ingresa el código de activación aquí`,"Copy Thino id":`Copiar id de Thino`,"Activate Pro Version":`Activar versión Pro`,"Please copy Thino id first":`Por favor copia el id de Thino primero`,'You can set folder name with file name like "folder/file"':`Puedes establecer nombre de carpeta con nombre de archivo como "carpeta/archivo"`,'You can set folder name like "folder1/folder2/folder3" to create sub-folder':`Puedes establecer nombre de carpeta como "carpeta1/carpeta2/carpeta3" para crear subcarpeta`,"Default save type":`Ubicación de guardado predeterminada`,'Set the default save type for thino. "DAILY" by default':`Establece el tipo de guardado predeterminado para thino. "DIARIO" por defecto`,"Sync Thino via PKMer":`Sincronizar Thino vía PKMer`,Unlink:`Desvincular`,Link:`Vincular`,"Connect to PKMer Sync, you can check it in ":`Conectar a PKMer Sync, puedes verificarlo en `,"PKMer Sync":`PKMer Sync`,"Remove successfully":`Eliminado exitosamente`,Deactivate:`Desactivar`,Remove:`Eliminar`,"Confirm?":`¿Confirmar?`,"Sync Status":`Estado de sincronización`,"Start or stop sync":`Iniciar o detener sincronización`,"Stop sync successfully":`Sincronización detenida exitosamente`,"Start sync successfully":`Sincronización iniciada exitosamente`,Stop:`Detener`,Start:`Iniciar`,"Show thino near mouse":`Mostrar thino cerca del mouse`,"Query not found":`Consulta no encontrada`,"Send to clipboard successfully":`Enviado al portapapeles exitosamente`,"Thino - Failed to start HTTP server, please check the port is available.":`Thino - Error al iniciar servidor HTTP, por favor verifica que el puerto esté disponible.`,"Thino - Started HTTP server on port":`Thino - Servidor HTTP iniciado en el puerto`,"Thino - Terminated HTTP server":`Thino - Servidor HTTP terminado`,"File not exist":`Archivo no existe`,"Thino not found":`Thino no encontrado`,"File not found for the given thino path, is creating a new file":`Archivo no encontrado para la ruta de thino dada, creando nuevo archivo`,"Saved sync token successfully":`Token de sincronización guardado exitosamente`,"Failed to find daily notes folder":`Error al encontrar carpeta de notas diarias`,"Please install obsidian-hover-editor plugin first":`Por favor instala primero el plugin obsidian-hover-editor`,"Copied app id successfully":`ID de aplicación copiado exitosamente`,"Please input token first":`Por favor ingresa el token primero`,"Please enable sync first":`Por favor habilita la sincronización primero`,"Init Failed":`Fallo de inicialización`,"Verify successfully":`Verificación exitosa`,"Failed to verify":`Error al verificar`,"Folder not found for the given thino path, is creating a new folder":`Carpeta no encontrada para la ruta de thino dada, creando nueva carpeta`,"File not found for the given thino path":`Archivo no encontrado para la ruta de thino dada`,"Failed to read current daily note, check if it exists.":`Error al leer nota diaria actual, verifica si existe.`,"Failed to save":`Error al guardar`,"Failed to login, please login again":`Error al iniciar sesión, por favor inicia sesión nuevamente`,"COPY FAILED":`ERROR AL COPIAR`,"COPY SUCCEED":`COPIADO EXITOSO`,"Copy selected text":`Copiar texto seleccionado`,"Copy thino":`Copiar thino`,COPY:`COPIAR`,"This is a pro feature, please upgrade to pro version to use it.":`Esta es una función pro, por favor actualiza a la versión pro para usarla.`,"You can get pro version from: ":`Puedes obtener la versión pro desde: `,Save:`Guardar`,Cancel:`Cancelar`,"Thino Daily Target":`Objetivo diario de Thino`,Input:`Entrada`,"#Tag":`#Etiqueta`,"to create tag":`para crear etiqueta`,"You have verified your account. Congrats!":`¡Has verificado tu cuenta. ¡Felicitaciones!`,"Pro features":`Funciones pro`,"Target Thino Count":`Contador objetivo de Thino`,on:`en`,"Switch waterfall view":`Cambiar a vista cascada`,"Switch view":`Cambiar vista`,"Switch list view":`Cambiar a vista lista`,"Set daily target":`Establecer objetivo diario`,"Thino Save To: ":`Guardar Thino en: `,"Enter fullscreen mode":`Entrar en modo pantalla completa`,"Exit fullscreen mode":`Salir del modo pantalla completa`,words:`palabras`,word:`palabra`,"Return To Home Page":`Volver a la página principal`,"No thinos to review!":`¡No hay thinos para revisar!`,"Thinos to review":`Thinos para revisar`,"Start Review":`Comenzar revisión`,Hard:`Difícil`,Good:`Bueno`,Easy:`Fácil`,Again:`De nuevo`,"Clear all review data":`Borrar todos los datos de revisión`,"Daily Progress":`Progreso diario`,"Show stats":`Mostrar estadísticas`,"Hide stats":`Ocultar estadísticas`,Remaining:`Restante`,"Total Reviews":`Total de revisiones`,"Today, you have reviewed all your thinos!":`¡Hoy has revisado todos tus thinos!`,"Daily review limit reached! Come back tomorrow.":`¡Límite de revisión diaria alcanzado! Vuelve mañana.`,"Open thino in center window":`Abrir thino en ventana central`,"Open thino in float window":`Abrir thino en ventana flotante`,"Open thino in right sidebar":`Abrir thino en barra lateral derecha`,"Open thino in left sidebar":`Abrir thino en barra lateral izquierda`,"Show thino editor":`Mostrar editor de thino`,"Toggle minimal mode":`Alternar modo mínimo`,"Focus on thino editor":`Enfocar en editor de thino`,"ReSync web thinos to local":`Resincronizar thinos web a local`,"Sync local thinos to web":`Sincronizar thinos locales a web`,"Show daily thino":`Mostrar thino diario`,"Focus on search bar":`Enfocar en barra de búsqueda`,"Show-thino in popover(Hover editor)":`Mostrar thino en ventana emergente (Editor flotante)`,"Center window":`Ventana central`,"Float window":`Ventana flotante`,"Right sidebar":`Barra lateral derecha`,"Left sidebar":`Barra lateral izquierda`,"Save thino type when sync local":`Guardar tipo de thino al sincronizar local`,"Set the default save thino type when sync local, FILE by default.":`Establecer el tipo de guardado predeterminado de thino al sincronizar local, ARCHIVO por defecto.`,"Sync service":`Servicio de sincronización`,"Pro verification status":`Estado de verificación Pro`,"Live-preview":`Vista previa en vivo`,Source:`Fuente`,"Global copy":`Copia global`,"Set the folder name":`Establecer el nombre de la carpeta`,"Set the filename":`Establecer el nombre del archivo`,"Set the filename for current location file":`Establecer el nombre del archivo para la ubicación actual`,"Switch calendar type":`Cambiar tipo de calendario`,alphabetical:`alfabético`,alphabeticalReverse:`alfabético inverso`,byCount:`por conteo`,byCountReverse:`por conteo inverso`,"Type here":`Escribe aquí`,Today:`Hoy`,Yesterday:`Ayer`,"Last 7 days":`Últimos 7 días`,"Last 30 days":`Últimos 30 días`,"Last 90 days":`Últimos 90 días`,"Last 180 days":`Últimos 180 días`,"Last 365 days":`Últimos 365 días`,Found:`Encontrado`,"Copy filtered thinos":`Copiar thinos filtrados`,"Bulk delete":`Eliminación masiva`,"Bulk archive":`Archivo masivo`,"Bulk tag operation":`Operación masiva de etiquetas`,"Bulk restore":`Restauración masiva`,"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.":`Si estás desactivando el complemento de notas diarias, es posible que el thino no se elimine o actualice correctamente. Por favor, activa el complemento e inténtalo de nuevo.`,Preview:`Vista previa`,"Set and save":`Establecer y guardar`,"Show day mark in thino list":`Mostrar marca de día en la lista de thinos`,"Show day mark on the top of daily range thino. False by default.":`Mostrar marca de día en la parte superior del rango diario de thino. Falso por defecto.`,"Click to expand or fold, Cmd+Click to show all thinos of the day":`Clic para expandir o plegar, Cmd+Clic para mostrar todos los thinos del día`,"You can buy a license from":`Puedes comprar una licencia desde`,"No thinos in range":`No hay thinos en el rango`,Month:`Mes`,Week:`Semana`,Day:`Día`,Agenda:`Agenda`,Tomorrow:`Mañana`,Previous:`Anterior`,Next:`Siguiente`,"Search all columns...":`Buscar en todas las columnas...`,"Basic Info":`Información básica`,"Additional Info":`Información adicional`,"Created At":`Creado el`,Content:`Contenido`,"Thino Type":`Tipo de Thino`,"Source Type":`Tipo de fuente`,"Row status":`Estado de la fila`,Path:`Ruta`,"Pinned Status":`Estado fijado`,Table:`Tabla`,Chat:`Chat`,Moments:`Momentos`,Waterfall:`Cascada`,Calendar:`Calendario`,"Go to page":`Ir a la página`,Page:`Página`,Show:`Mostrar`,rows:`filas`,"Temp Filter":`Filtro temporal`,"Open link directly in Thino view":`Abrir enlace directamente en vista Thino`,"Day mark range":`Rango de marca de día`,"Set the range of day mark. Day by default.":`Establecer el rango de marca de día. Día por defecto.`,"Thino is locked":`Thino está bloqueado`,"Please unlock Thino by input password":`Por favor, desbloquea Thino introduciendo la contraseña`,"Auto Download Image":`Descarga automática de imagen`,"Auto download image when save to thino. 'false' by default":`Descargar imagen automáticamente al guardar en thino. 'falso' por defecto`,"Thino Http IP Type":`Tipo de IP Http de Thino`,"Set Thino http server ip to listen. 'localhost' by default":`Establecer IP del servidor http de Thino para escuchar. 'localhost' por defecto`,"Password to lock Thino":`Contraseña para bloquear Thino`,Unlock:`Desbloquear`,Locked:`Bloqueado`,"Password is incorrect":`La contraseña es incorrecta`,Lock:`Bloquear`,"Need password to unlock Thino":`Se necesita contraseña para desbloquear Thino`,"You have not set a password or enable this feature yet":`No has establecido una contraseña o habilitado esta función aún`,Password:`Contraseña`,"Password for Thino":`Contraseña para Thino`,"Please input your password to change password settings":`Por favor, introduce tu contraseña para cambiar la configuración de contraseña`,"Please input your password":`Por favor, introduce tu contraseña`,"Lock thino":`Bloquear thino`,date:`fecha`,time:`hora`,event:`evento`,"Add tag position":`Agregar posición de etiqueta`,"Set the position of the tag when adding tag automatically":`Establecer la posición de la etiqueta al agregarla automáticamente`,"Add tag automatically":`Agregar etiqueta automáticamente`,"Add tag to the end or beginning of the thino content when creating a thino and filtering tags":`Agregar etiqueta al final o al principio del contenido del thino al crear un thino y filtrar etiquetas`,"Add tag with new line":`Agregar etiqueta con nueva línea`,"Add tag with new line when adding tag automatically":`Agregar etiqueta con nueva línea al agregar etiqueta automáticamente`,"Input to select more tags":`Ingresa para seleccionar más etiquetas`,"Tag Bulk Edit":`Edición masiva de etiquetas`,"Tag Bulk Select":`Selección masiva de etiquetas`,"Exist Tags":`Etiquetas existentes`,"Selected Tags":`Etiquetas seleccionadas`,"Click to remove exist tag":`Clic para eliminar etiqueta existente`,"Click to remove selected tag":`Clic para eliminar etiqueta seleccionada`,"Select tags":`Seleccionar etiquetas`,"Input to select exist tag":`Ingresa para seleccionar etiqueta existente`,Beginning:`Inicio`,End:`Fin`,"Set the heading for saving thino":`Establecer el encabezado para guardar thino`,"# Heading":`# Encabezado`,"Chat view style":`Estilo de vista de chat`,"Set the style of chat view":`Establecer el estilo de vista de chat`,"Background image for moments view":`Imagen de fondo para vista de momentos`,"Set the background image for moments view":`Establecer la imagen de fondo para vista de momentos`,"Icon for moments/chat view/share image":`Icono para vista de momentos/chat/imagen compartida`,"Set the icon for moments/chat view/share image":`Establecer el icono para vista de momentos/chat/imagen compartida`,"Quote for moments view/share image":`Cita para vista de momentos/imagen compartida`,"Set the quote for moments view/share image":`Establecer la cita para vista de momentos/imagen compartida`,"Theme for Thino":`Tema para Thino`,"Set the theme for Thino":`Establecer el tema para Thino`,"Interface Details":`Detalles de interfaz`,"Task amount":`Cantidad de tareas`,"Thino status":`Estado de Thino`,"Used tags":`Etiquetas usadas`,"Used days":`Días usados`,"Most active day":`Día más activo`,"Most active hour":`Hora más activa`,"Thino amount":`Cantidad de Thinos`,"No content to generate.":`No hay contenido para generar.`,"Image generated successfully.":`Imagen generada exitosamente.`,"Failed to generate image.":`Error al generar imagen.`,"Share filtered thinos as image":`Compartir thinos filtrados como imagen`,"Latest version":`Última versión`,"Previous version":`Versión anterior`,"Thino update info":`Información de actualización de Thino`,"Debug info copied to clipboard":`Información de depuración copiada al portapapeles`,"Copy debug info":`Copiar información de depuración`,"Failed to load changelog":`Error al cargar el registro de cambios`,"View online":`Ver en línea`,ChangeLog:`Registro de cambios`,"Please open thino first":`Por favor, abre thino primero`,"Insert editor":`Insertar editor`,"Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":`Por favor, establece diferentes ubicaciones de guardado para la configuración multi-archivo en Thino. La carpeta del diario se superpone con la ubicación de guardado multi-archivo, o hay riesgo de que se lea repetidamente.`,"Default time prefix for thino in daily notes":`Prefijo de tiempo predeterminado para thino en notas diarias`,"Set default time prefix for thino in daily notes.":`Establecer prefijo de tiempo predeterminado para thino en notas diarias.`,"Save image successfully":`Imagen guardada exitosamente`,"User quote":`Cita de usuario`,"Set user quote for thino":`Establecer cita de usuario para thino`,"User icon":`Icono de usuario`,"Set user icon for thino. You can input http/https link or file path in vault.":`Establecer icono de usuario para thino. Puedes ingresar enlace http/https o ruta de archivo en la bóveda.`,"User info":`Información de usuario`,"Copy filtered results":`Copiar resultados filtrados`,"Share image":`Compartir imagen`,Default:`Predeterminado`,Gray:`Gris`,Grass:`Hierba`,Flame:`Llama`,Olive:`Oliva`,Ice:`Hielo`,Magenta:`Magenta`,"Daily notes":`Notas diarias`,Editor:`Editor`,"Append/prepend text when share to Thino":`Agregar texto al principio/final al compartir en Thino`,"Append text when share to Thino":`Agregar texto al final al compartir en Thino`,"Prepend text when share to Thino":`Agregar texto al principio al compartir en Thino`,"Add newline when append/prepend text":`Agregar nueva línea al agregar texto al principio/final`,"Input anything here":`Ingresa cualquier cosa aquí`,Prepend:`Agregar al principio`,Append:`Agregar al final`,Both:`Ambos`,None:`Ninguno`,"Hide pinned group":`Ocultar grupo fijado`,"Hide pinned group in thino list. False by default.":`Ocultar grupo fijado en la lista de thino. Falso por defecto.`,"Set the heading for the task type of thino, by default 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.":`Establecer el encabezado para el tipo de tarea de thino, por defecto el contenido de thino grabado se insertará al final del diario; si se proporciona un título, todo el contenido de thino grabado se categorizará uniformemente bajo ese título.`,"Different insert target for different type":`Diferente objetivo de inserción para diferente tipo`,"Toggle this to set different insert target for different type of thino, like task or list type of thino":`Activa esto para establecer diferente objetivo de inserción para diferente tipo de thino, como tipo tarea o lista de thino`,"You can set whole diary or only part of it":`Puedes establecer todo el diario o solo una parte`,"Set process target":`Establecer objetivo de proceso`,Custom:`Personalizado`,"Whole diary":`Diario completo`,"Set thino insert place":`Establecer lugar de inserción de thino`,"Set where to insert thino content":`Establecer dónde insertar contenido de thino`,"End of the diary":`Final del diario`,"Custom location":`Ubicación personalizada`,"Setting guide":`Guía de configuración`,"Details settings":`Configuraciones detalladas`,"Start Thino":`Iniciar Thino`,"About Thino Pro":`Acerca de Thino Pro`,Enabled:`Habilitado`,Enable:`Habilitar`,"Daily notes folder":`Carpeta de notas diarias`,"Set daily notes folder":`Establecer carpeta de notas diarias`,"Daily note name format":`Formato de nombre de nota diaria`,"Set daily note name format":`Establecer formato de nombre de nota diaria`,"Daily note plugin":`Complemento de nota diaria`,"Enable daily note plugin":`Habilitar complemento de nota diaria`,Selected:`Seleccionado`,Select:`Seleccionar`,"A classic theme for Thino with a two-column layout":`Un tema clásico para Thino con diseño de dos columnas`,Classic:`Clásico`,"A modern theme for Thino with a three-column layout and some unique features.":`Un tema moderno para Thino con diseño de tres columnas y algunas características únicas.`,Modern:`Moderno`,"Go and enjoy Thino":`Ve y disfruta Thino`,"Congrats! All settings done":`¡Felicitaciones! Todas las configuraciones completadas`,"Adjust settings that influence your user experience with Thino.":`Ajusta las configuraciones que influyen en tu experiencia de usuario con Thino.`,"Set preferences for using Thino":`Establecer preferencias para usar Thino`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`Si estás usando la versión básica de Thino, se requiere habilitar el complemento de nota diaria. Configura sus ajustes para trabajar efectivamente con él.`,"Go with daily note plugin":`Ir con complemento de nota diaria`,"Choose a theme for Thino.":`Elige un tema para Thino.`,"Set theme for Thino":`Establecer tema para Thino`,"Set up your user info for Thino.":`Configura tu información de usuario para Thino.`,"Get started with Thino":`Comenzar con Thino`,"Skip and start Thino":`Saltar e iniciar Thino`,"Next step":`Siguiente paso`,"Back to previous step":`Volver al paso anterior`,"Click to enable =>":`Clic para habilitar =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`Esta es la barra lateral de Thino. Navega a diferentes rutas o selecciona filtro de consulta.`,"Click here and go to settings page.":`Haz clic aquí y ve a la página de configuración.`,"Click here and go to different path.":`Haz clic aquí y ve a una ruta diferente.`,"Select or create query filter here.":`Selecciona o crea filtro de consulta aquí.`,"See the status of Thinos here.":`Ve el estado de los Thinos aquí.`,"Search your thino quickly here.":`Busca tu thino rápidamente aquí.`,"Edit or create your thino here.":`Edita o crea tu thino aquí.`,"See your thinos here.":`Ve tus thinos aquí.`,"See your time status of thinos here.":`Ve tu estado de tiempo de thinos aquí.`,"See your tags here. Tags will be shown when thino contains tags.":`Ve tus etiquetas aquí. Las etiquetas se mostrarán cuando thino contenga etiquetas.`,Done:`Hecho`,"Thino is ready to use. ":`Thino está listo para usar. `,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`Puedes comenzar a usar Thino ahora. Si quieres saber más sobre Thino Pro, haz clic en el botón de abajo.`,"Default time prefix":`Prefijo de tiempo predeterminado`,"Append Text Action":`Acción de agregar texto al final`,"Prepend Text Action":`Acción de agregar texto al principio`,Preset:`Preestablecido`,"Select Tags":`Seleccionar etiquetas`,"It is not available on small view":`No está disponible en vista pequeña`,"Append text":`Agregar texto al final`,"Prepend text":`Agregar texto al principio`,"Your daily note folder is not set correctly, please check your settings":`Tu carpeta de notas diarias no está configurada correctamente, por favor revisa tu configuración`,"Default sharing style":`Estilo de compartir predeterminado`,"Set the default style for sharing thino, 'Modern' by default.":`Establecer el estilo predeterminado para compartir thino, "Moderno" por defecto.`,Clean:`Limpio`,Minimal:`Mínimo`,Gradient:`Gradiente`,"Thino share":`Compartir Thino`,"Copy to clipboard failed":`Error al copiar al portapapeles`,"Copy to clipboard successfully":`Copiado al portapapeles exitosamente`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`Tu contenido ha sido copiado al portapapeles e insertado en el editor. Por favor inténtalo de nuevo`,"Share thino":`Compartir thino`,"Set file name after create thino":`Establecer nombre de archivo después de crear thino`,"You can set file name after create thino. A input box will show when you create thino.":`Puedes establecer el nombre del archivo después de crear thino. Se mostrará una caja de entrada cuando crees thino.`,SPLIT:`DIVIDIR`,"Split by Heading 1":`Dividir por Encabezado 1`,"Split by Heading 2":`Dividir por Encabezado 2`,"Split by Heading 3":`Dividir por Encabezado 3`,"Insert task":`Insertar tarea`,"All settings have been reset to default.":`Todas las configuraciones han sido restablecidas a los valores predeterminados.`,"Reset all Thino settings":`Restablecer todas las configuraciones de Thino`,"Reset settings":`Restablecer configuraciones`,"Reset Thino settings to default settings.":`Restablecer configuraciones de Thino a valores predeterminados.`,"Task Management":`Gestión de tareas`,"Append completed date when task done in thino":`Agregar fecha de completado cuando la tarea se complete en thino`,"Append completed date when task done in thino. False by default":`Agregar fecha de completado cuando la tarea se complete en thino. Falso por defecto`,"Set tag for single file that Thino indexes":`Establecer etiqueta para archivo único que Thino indexa`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"Cuando estableces una etiqueta aquí, Thino indexará este archivo que contiene esta etiqueta y lo mostrará en la lista. No necesitas agregar `#`.","Set tag for file type file":`Establecer etiqueta para archivo tipo archivo`,"Set tag for multi type file":`Establecer etiqueta para archivo multi tipo`,"Please input the tag":`Por favor ingresa la etiqueta`,"Merge thinos in to thino share image":`Fusionar thinos en imagen compartida de thino`,"Custom height for Thino content":`Altura personalizada para contenido de Thino`,"Set custom height for Thino content. Like 200px or 20rem":`Establecer altura personalizada para contenido de Thino. Como 200px o 20rem`,"Input height":`Ingresar altura`,"Submit issue":`Enviar problema`,"Current version":`Versión actual`,"Bug report":`Reporte de error`,"Click the button to copy debug info and open the issue page":`Haz clic en el botón para copiar información de depuración y abrir la página de problemas`,"Copy and go":`Copiar e ir`,"Debug info copied":`Información de depuración copiada`,"Feature request":`Solicitud de función`,"Submit your feature request to the issue page":`Envía tu solicitud de función a la página de problemas`,Go:`Ir`,"Toggle query list visibility":`Alternar visibilidad de lista de consultas`,"Toggle tags visibility":`Alternar visibilidad de etiquetas`,"Toggle sidebar visibility":`Alternar visibilidad de barra lateral`,Collapse:`Colapsar`,Expand:`Expandir`,"Max height for collapse":`Altura máxima para colapsar`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`La altura máxima para colapsar thino, cuando se establece en 0, thino no colapsará. 0 por defecto. (Esto no es conteo de líneas, es altura en px.)`,"Render content":`Renderizar contenido`,"Optimize for Callout":`Optimizar para Callout`,"Won't render content contains more than 3 callouts automatically. True by default":`No renderizará automáticamente contenido que contenga más de 3 callouts. Verdadero por defecto`,"The value should be greater than":`El valor debe ser mayor que`,"Append Text":`Agregar texto al final`,"Prepend Text":`Agregar texto al principio`,"Thino height when collapsed":`Altura de Thino cuando está colapsado`,"The height for thino when it is collapsed, when set 0, thino would not collapse . 100 by default. (This is not lines count, it is height in px.)":`La altura para thino cuando está colapsado, cuando se establece en 0, thino no colapsará. 100 por defecto. (Esto no es conteo de líneas, es altura en px.)`,"This option will allow you use other views when leaf width is not enough. False by default.":`Esta opción te permitirá usar otras vistas cuando el ancho de la hoja no sea suficiente. Falso por defecto.`,"Can select other views when leaf width is not enough":`Puede seleccionar otras vistas cuando el ancho de la hoja no es suficiente`,"TRASH BOX":`PAPELERA`,"Wait templater to finish parse before insert thino":`Esperar a que templater termine de analizar antes de insertar thino`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`Esta opción te permitirá esperar a que templater termine de analizar antes de insertar thino, lo que puede hacer que necesites confirmar dos veces entre insertar thino. Falso por defecto.`,"Get thino capture extension":`Obtener extensión de captura de thino`,"You can capture idea/text from chrome now.":`Ahora puedes capturar idea/texto desde chrome.`,"Open File":`Abrir archivo`,"Exported CSV file":`Archivo CSV exportado`,"Updated At":`Actualizado el`,"Export to CSV":`Exportar a CSV`,"Quick add button on mobile navbar":`Botón de agregar rápido en barra de navegación móvil`,"Always show status text":`Siempre mostrar texto de estado`,"Support filter by metadata from file":`Soportar filtro por metadatos desde archivo`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`Cuando habilites esto, podrás filtrar a través de metadatos desde archivo, como etiquetas en archivo. Pero los thinos desde canvas no están soportados. Falso por defecto.`,"Show source near timestamp in thino":`Mostrar fuente cerca de marca de tiempo en thino`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`Cuando habilites esto, podrás ver la fuente cerca de la marca de tiempo en thino. Puedes establecer título en metadatos para sobrescribir esto. Falso por defecto.`,"Show Update Message":`Mostrar mensaje de actualización`,"Show update message when Thino is updated. True by default":`Mostrar mensaje de actualización cuando Thino se actualiza. Verdadero por defecto`,"Sync manually":`Sincronizar manualmente`,"Show all scrollbars":`Mostrar todas las barras de desplazamiento`,"TIME RANGE":`RANGO DE TIEMPO`,WITHIN:`DENTRO DE`,"7 days":`7 días`,"14 days":`14 días`,"30 days":`30 días`,"3 months":`3 meses`,"6 months":`6 meses`,"1 year":`1 año`,"This week":`Esta semana`,"Last week":`Semana pasada`,"This month":`Este mes`,"Last month":`Mes pasado`,"This year":`Este año`,"Last year":`Año pasado`,"No history":`Sin historial`,"Today Remaining":`Restante hoy`,"Today Total":`Total hoy`,"Historical Statistics":`Estadísticas históricas`,byTime:`Por tiempo`,byTimeReverse:`Por tiempo inverso`,Stat:`Estadística`,Statistics:`Estadísticas`,"Daily Thino Count":`Conteo diario de Thino`,Total:`Total`,thinos:`thinos`,"Thino Types":`Tipos de Thino`,"Distribution of thino types":`Distribución de tipos de thino`,"Thino Status":`Estado de Thino`,"Distribution of thino status":`Distribución de estado de thino`,"Popular Tags":`Etiquetas populares`,"Top 10 most used tags":`Top 10 etiquetas más usadas`,"Thino Count":`Conteo de Thino`,"Hourly distribution":`Distribución por hora`,"Current month":`Mes actual`,"Monthly distribution":`Distribución mensual`,"30 Days":`Últimos 30 días`,Year:`Año`,"Time Distribution":`Distribución de tiempo`,"When do you write thinos":`Cuándo escribes thinos`,"Content Length":`Longitud de contenido`,"Distribution of thino lengths":`Distribución de longitudes de thino`,"Daily Thinos":`Thinos diarios`,"Show Time Distribution":`Mostrar distribución de tiempo`,"Hide date picker":`Ocultar selector de fecha`,"Show date picker":`Mostrar selector de fecha`,"Clear filter":`Limpiar filtro`,"Copy link":`Copiar enlace`,"Copy embed link":`Copiar enlace incrustado`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter para guardar thino`,"Fixed strings for thinos":`Cadenas fijas para thinos`,"Use fixed strings for thinos":`Usar cadenas fijas para thinos`,"Enable to add fixed strings at the beginning or end of thinos.":`Habilitar para agregar cadenas fijas al principio o final de los thinos.`,"Fixed prefix for thinos":`Prefijo fijo para thinos`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Agregar esta cadena al principio de cada thino. Admite marcadores como {{TIME|YYYYMMDDHHmmss}}.`,"Fixed suffix for thinos":`Sufijo fijo para thinos`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`Agregar esta cadena al final de cada thino. Admite marcadores como {{TIME|YYYYMMDDHHmmss}}.`,"Word count exceeded":`Conteo de palabras excedido`,"Word count feature":`Función de conteo de palabras`,"Enable real-time word count display in the editor":`Habilitar visualización de conteo de palabras en tiempo real en el editor`,"Maximum word count":`Conteo máximo de palabras`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`Establecer un conteo máximo de palabras para thino. El editor mostrará una advertencia cuando se exceda. Establecer en 0 para ilimitado.`,"No linked thinos found":`No se encontraron thinos vinculados`,"Reference links group":`Grupo de enlaces de referencia`,"Enable reference links group in thino.":`Habilitar grupo de enlaces de referencia en thino.`,"No reference links found":`No se encontraron enlaces de referencia`,"Outgoing Links":`Enlaces salientes`,"Incoming Links":`Enlaces entrantes`,"Error fetching reference links":`Error al obtener enlaces de referencia`,"Double click behavior":`Comportamiento de doble clic`,"Set the behavior when double click on a thino.":`Establecer el comportamiento al hacer doble clic en un thino.`,"Open thino":`Abrir thino`,"Edit thino":`Editar thino`,"Go to source":`Ir a la fuente`,"Do nothing":`No hacer nada`,"Use default header in mobile view":`Usar encabezado predeterminado en vista móvil`,"Use default header in mobile view of thino rather than custom header.":`Usar encabezado predeterminado en vista móvil de thino en lugar de encabezado personalizado.`}})),On,kn=o((()=>{On={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":`Username`,"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`}})),An,jn=o((()=>{An={}})),Mn,Nn=o((()=>{Mn={}})),Pn,Fn=o((()=>{Pn={}})),In,Ln=o((()=>{In={}})),Rn,zn=o((()=>{Rn={}})),Bn,Vn=o((()=>{Bn={}})),Hn,Un=o((()=>{Hn={}})),Wn,Gn=o((()=>{Wn={}})),Kn,qn=o((()=>{Kn={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":`Nome de Usuário`,"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 when save thino":`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`}})),Jn,Yn=o((()=>{Jn={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":`Nome de Usuário`,"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 when save thino":`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`}})),Xn,Zn=o((()=>{Xn={}})),Qn,$n=o((()=>{Qn={}})),er,tr=o((()=>{er={}})),nr,rr=o((()=>{nr={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":`用户名`,"Set your user name here. 'Memos 😏' By default":`在这里设置你喜欢的用户名。 默认为 'Thino 😏'`,'You can set target heading like "# Heading" to control data location':`你可以设置目标标题,例如 "# Heading" 来控制数据的位置`,"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 when save thino":`保存 Thino 时的默认前缀`,"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:`归档`,"Daily Review":`每日回顾`,"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:`选择`,PATH:`路径`,METADATA:`元数据`,"ADD FILTER TERMS":`添加检索条件`,FILTER:`筛选器`,TITLE:`标题`,"CREATE QUERY":`创建检索式`,"EDIT QUERY":`编辑检索式`,MATCH:`匹配`,TIMES:`次`,"Share Memo Image":`分享 Thino 图片`,"Outer Frame":`外框`,"Enable Frame":`启用外框`,"Frame Padding":`外框边距`,"Frame Color":`外框颜色`,"↗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":`展示任务标签`,Gallery:`画廊`,"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/Tablet 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 type for Thino":`Thino 保存类型`,DAILY:`日记`,MULTI:`多文件`,CANVAS:`画布`,FILE:`单文件`,ALL:`所有`,"Journal mode saves memos into periodic note files (daily/weekly/monthly/yearly)":`Journal 模式将 Thino 保存到周期笔记文件中(日/周/月/年)`,"Journal granularity":`周期粒度`,"Choose the period type for journal files":`选择 Journal 文件的周期类型`,Daily:`日记`,Weekly:`周记`,Monthly:`月报`,Yearly:`年报`,"Use independent settings":`使用独立设置`,"When enabled, use custom folder/format/template instead of inheriting from daily notes plugin":`启用后,使用自定义的文件夹/格式/模板,不再继承日记插件设置`,"Heading date format":`标题日期格式`,"Format for date headings in journal files":`Journal 文件中日期标题的格式`,Custom:`自定义`,"Custom heading format":`自定义标题格式`,Folder:`文件夹`,"Folder path for":`文件夹路径:`,notes:`笔记`,"e.g.":`例如`,"Date format":`日期格式`,"Moment.js format for file names":`文件名的 Moment.js 日期格式`,default:`默认`,Template:`模板`,"Template file path for new notes":`新笔记的模板文件路径`,"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 type":`默认保存类型`,'Set the default save type for thino. "DAILY" by default':`设置 Thino 的默认保存类型。默认为 "日记"`,"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":`验证失败`,"Login with PKMer":`使用 PKMer 登录`,"Logout from PKMer":`退出 PKMer 登录`,"Logged in as":`已登录为`,Devices:`设备数`,"AI Quota":`AI 额度`,Logout:`退出登录`,"Pro activated":`Pro 已激活`,"Thino Copilot quota":`Thino Copilot 额度`,"Contact support":`联系支持`,"Click to manage in Super settings":`点击前往 Super 设置管理`,"Login with PKMer account to activate Pro features":`使用 PKMer 账号登录以激活 Pro 功能`,"Legacy activation (deprecated)":`传统激活方式(已弃用)`,"Failed to save":`保存失败`,"Failed to login, please login again":`登录已过期,请重新登录`,"COPY FAILED":`复制失败`,"COPY SUCCEED":`复制成功`,"Copy selected text":`复制选中文本`,"Copy thino":`复制`,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:`字词`,word:`字`,"Return To Home Page":`返回首页`,"No thinos to review!":`没有 thino 需要回顾!`,"Thinos to review":`Thino 需要回顾`,"Start Review":`开始回顾`,Hard:`困难`,Good:`良好`,Easy:`简单`,Again:`重来`,"Daily Progress":`每日进度`,"Clear all review data":`清除所有回顾数据`,"Show stats":`显示统计`,"Hide stats":`隐藏统计`,Remaining:`剩余`,"Total Reviews":`总回顾`,"Today, you have reviewed all your thinos!":`今天你已经回顾了所有 thino!`,"Daily review limit reached! Come back tomorrow.":`每日回顾上限已达到!明天再来吧。`,"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":`显示每日 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:`分享`,Interface:`界面`,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":`批量恢复`,"Send to file":`发送到文件`,"Select target file":`选择目标文件`,"Content format":`内容格式`,"List item":`列表项`,Callout:`高亮块`,"Plain text":`纯文本`,"Archive originals":`归档原内容`,"Delete originals":`删除原内容`,"After sending":`发送后操作`,Target:`目标`,"Processing...":`处理中...`,"Hide entry":`隐藏入口`,"Show entry":`显示入口`,More:`更多`,"Pin tag":`置顶标签`,"Unpin tag":`取消置顶`,"Rename tag":`重命名标签`,"Rename all":`将所有`,"New tag name":`新标签名`,Renamed:`已重命名`,"Set emoji":`设置 Emoji`,"Set emoji for tag":`设置标签 Emoji`,"Custom emoji":`自定义 Emoji`,"Set color":`设置颜色`,"Set color for tag":`设置标签颜色`,Clear:`清除`,"ORGANIZE SUCCEED":`整理完成`,"Organize failed":`整理失败`,"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 in thino list":`在 Thino 列中展示日期标记`,"Show day mark on the top of daily range thino. False by default.":`在 Thino 列中展示日期标记。默认为关闭`,"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":`# 标题`,"Open link directly in Thino view":`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":`标签批量编辑`,"Tag Bulk Select":`标签批量选择`,"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/share image":`动态/聊天视图/分享图的头像`,"Set the icon for moments/chat view/share image":`设置动态/聊天视图/分享图的头像`,"Quote for moments view/share image":`动态视图/分享图的个性签名`,"Set the quote for moments view/share image":`设置动态视图/分享图的个性签名`,"Theme for Thino":`Thino 主题`,"Set the theme for Thino":`设置 Thino 的主题`,"Interface Details":`界面详情`,"Task amount":`任务数量`,"Thino status":`Thino 状态`,"Used tags":`使用的标签`,"Used days":`使用的天数`,"Most active day":`最活跃的一天`,"Most active hour":`最活跃的一小时`,"Thino amount":`Thino 数量`,"No content to generate.":`没有内容可以生成。`,"Image generated successfully.":`图片生成成功。`,"Failed to generate image.":`图片生成失败。`,"Share filtered thinos as image":`分享筛选的 Thino 为图片`,"Latest version":`最新版本`,"Previous version":`之前版本`,"Thino update info":`Thino 更新信息`,"Debug info copied to clipboard":`调试信息已复制到剪贴板`,"Copy debug info":`复制调试信息`,"Failed to load changelog":`无法加载更新日志`,"View online":`在线查看`,ChangeLog:`更新日志`,"Please open thino first":`请先打开 Thino`,"Insert editor":`插入编辑器`,"Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":`请在 Thino 设置中为多文件设置不同的路径,日记文件夹与多文件保存路径重复,或者存在被重复读取可能`,"Default time prefix for thino in daily notes":`日记中 Thino 的默认时间前缀`,"Set default time prefix for thino in daily notes.":`设置日记中 Thino 的默认时间前缀`,"Save image successfully":`保存图片成功`,"User quote":`用户签名`,"Set user quote for thino":`设置用户签名`,"User icon":`用户头像`,"Set user icon for thino. You can input http/https link or file path in vault.":`设置用户头像。你可以设置 http/https 链接或者 vault 中的文件路径。`,"User info":`用户信息`,"Copy filtered results":`复制筛选结果`,"Share image":`分享图片`,Default:`默认`,Gray:`灰色`,Grass:`草绿`,Flame:`火焰`,Olive:`橄榄`,Ice:`冰`,Magenta:`品红`,"Daily notes":`日记相关`,Editor:`编辑器`,"Append/prepend text when share to Thino":`分享到 Thino 时添加/前置文本`,"Append text when share to Thino":`分享到 Thino 时添加文本`,"Prepend text when share to Thino":`分享到 Thino 时前置文本`,"Add newline when append/prepend text":`添加换行符`,Prepend:`前置`,Append:`后置`,Both:`两者`,None:`无`,"Hide pinned group":`隐藏置顶分组`,"Hide pinned group in thino list. False by default.":`隐藏置顶的 Thino 分组。默认为关闭`,"Set the heading for the task type of thino, by default 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 内容将统一归类到该标题下。`,"Different insert target for different type":`不同类型的 Thino 有不同的插入目标`,"Toggle this to set different insert target for different type of thino, like task or list type of thino":`切换此选项以为不同类型的 Thino 设置不同的插入目标,例如任务或列表类型的 Thino`,"Set process target":`设置处理目标`,"You can set whole diary or only part of it":`你可以设置整个日记或者其中的一部分`,Custom:`自定义`,"Whole diary":`整个日记`,"Set thino insert place":`设置 Thino 插入位置`,"Set where to insert thino content":`设置 Thino 内容插入位置`,"End of the diary":`日记的末尾`,"Custom location":`自定义位置`,"Setting guide":`设置流程`,"Details settings":`详细设置`,"Start Thino":`开始 Thino`,"About Thino Pro":`关于 Thino 专业版`,Enabled:`已启用`,Enable:`启用`,"Daily notes folder":`日记文件夹`,"Set daily notes folder":`设置日记文件夹`,"Daily note name format":`日记文件名格式`,"Set daily note name format":`设置日记文件名格式`,"Daily note plugin":`日记插件`,"Enable daily note plugin":`启用日记插件`,Selected:`已选择`,Select:`选择`,"A classic theme for Thino with a two-column layout":`Thino 的经典主题,采用两列布局`,Classic:`经典`,"A modern theme for Thino with a three-column layout and some unique features.":`Thino 的现代主题,采用三列布局和一些独特的功能。`,Modern:`现代`,"Go and enjoy Thino":`去享受 Thino 吧`,"Congrats! All settings done":`恭喜!所有设置已完成`,"Adjust settings that influence your user experience with Thino.":`调整影响你使用 Thino 的设置。`,"Set preferences for using Thino":`设置使用 Thino 的偏好`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`如果你使用的是 Thino 基础版,启用日记插件是必须的。配置其设置以有效地使用它。`,"Go with daily note plugin":`使用日记插件`,"Choose a theme for Thino.":`选择 Thino 的主题。`,"Set theme for Thino":`设置 Thino 的主题`,"Set up your user info for Thino.":`设置你的用户信息。`,"Get started with Thino":`开始使用 Thino`,"Skip and start Thino":`跳过并开始 Thino`,"Next step":`下一步`,"Back to previous step":`返回上一步`,"Click to enable =>":`点击启用 =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`这是 Thino 的侧边栏。你可以导航到不同的路径或选择查询过滤器。`,"Click here and go to settings page.":`点击这里并转到设置页面。`,"Click here and go to different path.":`点击这里并转到不同的路径。`,"Select or create query filter here.":`在这里选择或创建查询过滤器。`,"See the status of Thinos here.":`在这里看到 Thino 的状态。`,"Search your thino quickly here.":`在这里快速搜索你的 Thino。`,"Edit or create your thino here.":`在这里编辑或创建你的 Thino。`,"See your thinos here.":`在这里看到你的 Thino。`,"See your time status of thinos here.":`在这里看到你的 Thino 时间状态。`,"See your tags here. Tags will be shown when thino contains tags.":`在这里看到你的标签。当 Thino 包含标签时,标签将显示。`,Done:`完成`,"Thino is ready to use. ":`Thino 已准备好使用。`,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`你现在可以开始使用 Thino 了。如果你想了解更多关于 Thino 专业版的信息,请点击下面的按钮。`,"Default time prefix":`默认时间前缀`,"Append Text Action":`分享到 Thino 时的后置文本动作`,"Prepend Text Action":`分享到 Thino 时的前置文本动作`,Preset:`预设`,"Select Tags":`选择标签`,"It is not available on small view":`在窄的视图中不可用`,"Append text":`在末尾添加文本`,"Prepend text":`在开头添加文本`,"Your daily note folder is not set correctly, please check your settings":`你的日记文件夹设置不正确,请检查你的设置`,"Default sharing style":`默认分享样式`,"Select the font for the memo content":`选择备忘录内容的字体`,"Select the background for the memo image":`选择备忘录图片的背景`,"Select the content type for the left bottom area":`选择左下角区域的内容类型`,"Default text":`默认文本`,"Activity heatmap":`活动热图`,"Left bottom content":`左下角内容`,Font:`字体`,Background:`背景`,"Default font":`默认字体`,"Orange gradient":`橙色渐变`,"Blue gradient":`蓝色渐变`,"Green gradient":`绿色渐变`,"Pink gradient":`粉色渐变`,"Image read failed, please try again":`图片读取失败,请重试`,"Please select a valid image file":`请选择有效的图片文件`,"Default background":`默认背景`,"Select local image":`选择本地图片`,"Image file cannot exceed 5MB":`图片文件不能超过 5MB`,"Font size":`字体大小`,"Adjust the font size":`调整字体大小`,"Set the default style for sharing thino, 'Modern' by default.":`设置 Thino 的默认分享样式,默认为"现代"。`,Clean:`清爽`,Minimal:`极简`,Gradient:`渐变`,"Thino share":`Thino 分享`,"Copy to clipboard failed":`复制到剪贴板失败`,"Copy to clipboard successfully":`复制到剪贴板成功`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`你的内容已经复制到剪贴板,并插入到编辑器中。请再试一次`,"Share thino":`分享 Thino`,"Set file name after create thino":`创建 Thino 后设置文件名`,"You can set file name after create thino. A input box will show when you create thino.":`你可以在创建 Thino 后设置文件名。当你创建 Thino 时,会显示一个输入框。`,SPLIT:`分割`,"Split by Heading 1":`按一级标题分割`,"Split by Heading 2":`按二级标题分割`,"Split by Heading 3":`按三级标题分割`,"Insert task":`插入任务`,"All settings have been reset to default.":`所有设置已重置为默认值。`,"Reset all Thino settings":`重置所有 Thino 设置`,"Reset settings":`重置设置`,"Reset Thino settings to default settings.":`将 Thino 设置重置为默认设置。`,"Task Management":`任务管理`,"Append completed date when task done in thino":`在 Thino 中的任务完成时添加完成日期`,"Append completed date when task done in thino. False by default":`在 Thino 中的任务完成时添加完成日期。默认为关闭`,"Set tag for single file that Thino indexes":`Thino 会索引被设置标签的单文件`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"当你在这里设置一个标签时,Thino 会索引包含这个标签的文件,并在列表中显示。不需要添加 `#`。","Set tag for file type file":`为单文件类型文件设置标签`,"Set tag for multi type file":`为多文件类型文件设置标签`,"Please input the tag":`请输入标签`,"Merge thinos in to thino share image":`合并 Thino 到 Thino 分享图片`,"Custom height for Thino content":`自定义 Thino 内容高度`,"Set custom height for Thino content. Like 200px or 20rem":`设置 Thino 内容的自定义高度。如 200px 或 20rem`,"Input height":`输入高度`,"Submit issue":`提交问题`,"Current version":`当前版本`,"Bug report":`Bug 报告`,"Click the button to copy debug info and open the issue page":`点击按钮复制调试信息并打开问题页面`,"Copy and go":`复制并前往`,"Debug info copied":`调试信息已复制`,"Feature request":`功能请求`,"Submit your feature request to the issue page":`提交你的功能请求到问题页面`,Go:`前往`,"Toggle query list visibility":`切换 Query 列表可见性`,"Toggle tags visibility":`切换标签可见性`,"Toggle sidebar visibility":`切换侧边栏可见性`,Collapse:`收起`,Expand:`展开`,"Max height for collapse":`折叠的最大高度`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`Thino 折叠的最大高度,设置为 0 时,Thino 不会折叠。默认为 0。(这不是行数,而是像素高度值)`,"Render content":`渲染内容`,"Optimize for Callout":`优化 Callout 渲染性能问题`,"Won't render content contains more than 3 callouts automatically. True by default":`不会自动渲染包含超过 3 个 Callout 的内容。默认为开启`,"The value should be greater than":`值应大于`,"Append Text":`后置文本`,"Prepend Text":`前置文本`,"Thino height when collapsed":`Thino 折叠时的高度`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`Thino 折叠时的高度,当设置为 0 时,完全折叠。默认为 100。(这不是行数,而是像素高度值)`,"This option will allow you use other views when leaf width is not enough. False by default.":`当页面宽度不够时,可以选择其他视图。默认为关闭。`,"Can select other views when leaf width is not enough":`当页面宽度不够时,可以选择其他视图`,"TRASH BOX":`回收站`,"Wait templater to finish parse before insert thino":`在插入 Thino 之前等待 Templater 完成解析`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`此选项将允许您在插入 Thino 之前等待 Templater 完成解析,这可能会导致您在插入 Thino 之间需要确认两次。默认为关闭。`,"Get thino capture extension":`获取 Thino 剪裁扩展`,"You can capture idea/text from chrome now.":`你现在可以从 Chrome 中捕获想法/文本。`,"Open File":`打开文件`,"Exported CSV file":`导出的 CSV 文件`,"Updated At":`更新于`,"Export to CSV":`导出为 CSV`,"Quick add button on mobile navbar":`移动端导航栏的快速添加按钮`,"Always show status text":`始终显示状态文本`,"Support filter by metadata from file":`支持通过文件中的元数据进行筛选`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`启用后,你可以通过文件中的元数据进行筛选,例如文件中的标签。但画布中的 Thino 不支持。默认为关闭。`,"Show source near timestamp in thino":`在 Thino 时间戳旁显示 Thino 的来源`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`启用后,你可以在 Thino 时间戳旁看到 Thino 的来源。你可以在元数据中设置 title 来覆盖文件名。默认为关闭。`,"Show Update Message":`显示更新消息`,"Show update message when Thino is updated. True by default":`Thino 更新时显示更新消息。默认为开启`,"Sync manually":`手动同步`,"Show all scrollbars":`显示所有滚动条`,"TIME RANGE":`时间范围`,WITHIN:`在内`,"7 days":`7天`,"14 days":`14天`,"30 days":`30天`,"3 months":`3个月`,"6 months":`6个月`,"1 year":`1年`,"This week":`本周`,"Last week":`上周`,"This month":`本月`,"Last month":`上月`,"This year":`今年`,"Last year":`去年`,"No history":`没有历史记录`,"Today Remaining":`今日剩余`,"Today Total":`今日总计`,"Historical Statistics":`历史统计`,byTime:`按时间`,byTimeReverse:`按时间反序`,Stat:`统计`,Statistics:`统计`,"Daily Thino Count":`每日 Thino 数量`,Total:`总计`,thinos:`thinos`,"Thino Types":`Thino 类型`,"Distribution of thino types":`Thino 类型分布`,"Thino Status":`Thino 状态`,"Distribution of thino status":`Thino 状态分布`,"Popular Tags":`常用标签`,"Top 10 most used tags":`Top 10 常用标签`,"Thino Count":`Thino 数量`,"Hourly distribution":`每小时分布`,"Current month":`当前月份`,"Monthly distribution":`每月分布`,"30 Days":`过去 30 天`,Year:`年份`,"Time Distribution":`时间分布`,"When do you write thinos":`你什么时候写 Thino`,"Content Length":`内容长度`,"Distribution of thino lengths":`Thino 长度分布`,"Daily Thinos":`每日 Thino`,"Show Time Distribution":`显示时间分布`,"Hide date picker":`隐藏日期选择器`,"Show date picker":`显示日期选择器`,"Clear filter":`清除筛选`,"Copy link":`复制链接`,"Copy embed link":`复制嵌入链接`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter 保存 Thino`,"Fixed strings for thinos":`固定字符串`,"Use fixed strings for thinos":`使用固定字符串`,"Enable to add fixed strings at the beginning or end of thinos.":`启用为每个 Thino 添加固定字符串。`,"Fixed prefix for thinos":`固定前缀`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`在每个 Thino 的开头添加此字符串。支持占位符,如 {{TIME|YYYYMMDDHHmmss}}。`,"Fixed suffix for thinos":`固定后缀`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`在每个 Thino 的末尾添加此字符串。支持占位符,如 {{TIME|YYYYMMDDHHmmss}}。`,"Word count exceeded":`字数超出限制`,"Word count feature":`字数统计`,"Enable real-time word count display in the editor":`启用实时字数显示`,"Maximum word count":`最大字数`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`设置 Thino 的最大字数。当超过时,编辑器将显示警告。设置为 0 时,没有限制。`,"No linked thinos found":`没有找到链接的 Thino`,"Reference links group":`链接组`,"Enable reference links group in thino.":`在 Thino 中启用链接组。`,"No reference links found":`没有找到链接`,"Error fetching reference links":`获取链接失败`,"Outgoing Links":`出链`,"Incoming Links":`入链`,"Double click behavior":`双击行为`,"Set the behavior when double click on a thino.":`设置双击 Thino 的行为。`,"Open thino":`打开 Thino`,"Edit thino":`编辑 Thino`,"Go to source":`前往来源`,"Do nothing":`什么都不做`,"Use default header in mobile view":`使用默认的移动端头部`,"Use default header in mobile view of thino rather than custom header.":`使用默认的移动端头部,而不是自定义的头部。`,"Ignore folders for multi type":`忽略多文件类型文件夹`,"Set folders to ignore when using multi type. Separate multiple folders with comma (,).":`设置多文件类型时忽略的文件夹。用逗号 (,) 分隔多个文件夹。`,"folder1,folder2/subfolder":`folder1,folder2/subfolder`,"Using block link when dragging a thino":`拖动 Thino 以插入连结`,"Using block link when dragging a thino for daily":`拖动 Thino 以插入连结到日记`,"Matched via tag in content":`通过内容中的标签匹配`,"Matched via tag in file":`通过文件中的标签匹配`,"Focus on editor when open":`打开时聚焦编辑器`,"Focus on editor when open. True by default.":`打开时聚焦编辑器。默认为开启`,"Show scroll to top button":`显示滚动到顶部按钮`,"Show scroll to top button. True by default":`显示滚动到顶部按钮。默认为开启`,"Zoom image by default":`默认缩放图片`,"Zoom image by default when viewing image.":`查看图片时默认缩放图片。`,"View archive in random review":`在随机回顾中查看归档的 Thino`,"View archived thinos in random review. True by default":`在随机回顾中查看归档的 Thino。默认为开启`,"Linked by":`链接自`,Linked:`链接`,DUPLICATE:`复制`,"Show scrollbars in all thino views.":`在所有 Thino 视图中显示滚动条。`,"Drag to paste content":`拖动粘贴内容`,"You will be able to paste content from other apps to thino by dragging rather than pasting the block link.":`你可以通过拖动而不是粘贴块链接来将内容从其他应用粘贴到 Thino 中。`,"Dragging behavior":`拖动行为`,"Control the behavior when dragging a thino. You will paste the block link by default. Block-link option only works with source type is Daily Note.":`控制拖动 Thino 的行为。默认粘贴块链接。块链接选项仅在源类型为日记时有效。`,"Block link":`块链接`,"Quick capture tool that allows you to create and manage your ideas, tasks, and more.":`快速捕获工具,允许你创建和管理你的想法、任务等。`,About:`关于`,Text:`文本`,"Open Documentation":`打开文档`,Documentation:`文档`,Version:`版本`,"View the documentation for this plugin":`查看此插件的文档`,"Activate Pro":`激活专业版`,Pro:`专业版`,"Activated Pro":`已激活专业版`,Tasks:`任务`,"Show release notes":`显示发布说明`,"Show release notes when Thino is updated. True by default":`显示发布说明当 Thino 更新时。默认为开启`,"Open change log":`打开更新日志`,"Change log":`更新日志`,"View the change log for this plugin":`查看此插件的更新日志`,items:`项`,"Deleting...":`删除中...`,"Archiving...":`归档中...`,"Pinning...":`置顶中...`,"Unpinning...":`取消置顶中...`,"Pin/Unpin":`置顶/取消置顶`,Confirm:`确认`,"Successfully deleted":`成功删除`,"Successfully archived":`成功归档`,"Successfully pinned":`成功置顶`,"Successfully unpinned":`成功取消置顶`,"Successfully copied":`成功复制`,failed:`失败`,Thinos:`条 Thino`,Processed:`已处理`,"Secret Content Masking":`隐秘内容遮罩`,"Enable secret masking":`启用隐秘遮罩`,"Mask memo content matching a regex pattern":`对匹配正则表达式的 Thino 内容进行遮罩`,"Secret content regex":`隐秘内容正则`,"Regex pattern to match content that should be masked":`用于匹配需要遮罩内容的正则表达式`,"Masking style":`遮罩样式`,"Choose between blur effect or block character replacement":`选择模糊效果或方块字符替换`,"Set secret password":`设置密码`,"Set or update the password used to reveal masked content":`设置或更新用于揭示遮罩内容的密码`,"Enter password to reveal":`输入密码以揭示内容`,"Enter password":`输入密码`,"Confirm password":`确认密码`,"Passwords do not match":`两次密码不一致`,"Incorrect password":`密码错误`,"Password set successfully":`密码设置成功`,"Click to reveal secret content":`点击揭示隐秘内容`,"Requires Obsidian API 1.11.4+":`需要 Obsidian API 1.11.4+`,"WeChat Integration":`微信集成`,"Receive WeChat messages and save them as Thino memos. Desktop only. Requires Pro.":`接收微信消息并保存为 Thino。仅限桌面端,需要 Pro。`,"Enable WeChat":`启用微信`,"Enable WeChat message receiver":`启用微信消息接收器`,"Auto start":`自动启动`,"Automatically start WeChat receiver when Obsidian opens":`打开 Obsidian 时自动启动微信接收器`,"Default reply":`默认回复`,"Auto-reply text when a message is saved. Leave empty to disable.":`消息保存后的自动回复文本。留空则不回复。`,"Voice save mode":`语音保存方式`,"How to save voice messages: transcription text, audio file, or both":`语音消息的保存方式:转文字、音频文件、或两者皆有`,"Text + Audio":`文字 + 音频`,"Text only":`仅文字`,"Audio only":`仅音频`,Connection:`连接`,"WeChat is running":`微信运行中`,"WeChat is stopped":`微信已停止`,"Credentials found. Click Start to connect.":`已找到凭据,点击启动以连接。`,"No credentials. Will show QR code on start.":`无凭据,启动时将显示二维码。`,Start:`启动`,Stop:`停止`,"Clear stored credentials and disconnect":`清除已保存的凭据并断开连接`,"Voice Codec":`语音编解码器`,"SILK Decoder":`SILK 解码器`,"Installed. Voice messages will be converted to playable WAV files.":`已安装。语音消息将被转换为可播放的 WAV 文件。`,"Not installed. Download to enable voice message playback in Obsidian.":`未安装。下载后可在 Obsidian 中播放语音消息。`,Remove:`移除`,Download:`下载`,"Downloading...":`下载中...`,"Voice codec removed":`语音编解码器已移除`,"Voice codec downloaded":`语音编解码器已下载`,"Download failed":`下载失败`,Commands:`命令`,"Send messages to the WeChat bot with these command prefixes:":`使用以下命令前缀发送消息给微信机器人:`,or:`或`,"Save to daily note":`保存到日记`,"Save as task":`保存为任务`,"Save as multi-file note":`保存为多文件笔记`,"No prefix":`无前缀`,"Save using default save type":`使用默认方式保存`,"WeChat integration is only available on desktop":`微信集成仅在桌面端可用`,"WeChat is already running":`微信已在运行`,"WeChat connected":`微信已连接`,"WeChat disconnected":`微信已断开`,"WeChat logged out":`微信已退出登录`,"Scanned! Please confirm on your phone.":`已扫描!请在手机上确认。`,"Login successful!":`登录成功!`,"QR code expired. Please restart.":`二维码已过期,请重新启动。`,Saved:`已保存`,"Empty message, not saved":`空消息,未保存`,"Agent Routing":`Agent 路由`,"Route incoming WeChat messages to AI agents (ACP/CLI/HTTP). When enabled, messages with @agent or /agent prefix are forwarded to the specified agent.":`将微信消息路由到 AI 代理(ACP/CLI/HTTP)。启用后,带有 @agent 或 /agent 前缀的消息将转发给指定的代理。`,"Enable Agent Routing":`启用 Agent 路由`,"Forward messages to AI agents instead of saving as memos":`将消息转发给 AI 代理,而非保存为备忘录`,"Default Agent":`默认 Agent`,"Agent used when message has no @agent prefix":`消息无 @agent 前缀时使用的默认代理`,"None (save as memo)":`无(保存为备忘录)`,Agents:`代理列表`,"Configure AI agents":`配置 AI 代理`,"Add Agent":`添加代理`,"Agent name":`代理名称`,Delete:`删除`,Endpoint:`接口地址`,"OpenAI-compatible API endpoint URL":`OpenAI 兼容的 API 接口地址`,"API Key":`API 密钥`,Command:`命令`,"Path to agent binary":`代理程序路径`,Args:`参数`,"Extra command-line arguments (space-separated)":`额外的命令行参数(空格分隔)`,Model:`模型`,"System Prompt":`系统提示词`,"Optional system prompt for the agent":`可选的代理系统提示词`,"Agent Commands":`代理命令`,"Send to specific agent":`发送给指定代理`,"Broadcast to multiple agents":`广播给多个代理`,"no message":`无消息`,"Switch default agent":`切换默认代理`,"Reset agent session":`重置代理会话`,"Show current agent info":`显示当前代理信息`,"Built-in aliases":`内置别名`,"Working Directory":`工作目录`,"Default working directory for all agents. Leave empty to use vault root.":`所有代理的默认工作目录。留空则使用 Vault 根目录。`,"Vault root":`Vault 根目录`,"Permission Mode":`权限模式`,"Approval policy for agent tool calls":`代理工具调用的审批策略`,Default:`默认`,"Accept Edits":`接受编辑`,"Plan Mode":`计划模式`,"Don't Ask":`不询问`,"Bypass Permissions":`跳过权限`,"Override global working directory for this agent":`覆盖此代理的全局工作目录`,"Use global":`使用全局`,Type:`类型`,"Switched to thino mode":`已切换到备忘录模式`,"Reasoning Effort":`推理力度`,"Thinking budget level (codex/ACP agents)":`思考预算等级(codex/ACP 代理)`,None:`无`,Low:`低`,Medium:`中`,High:`高`,"Extra High":`极高`,"Usage: /thino <content>":`用法:/thino <内容>`,"Allow All File Paths":`允许所有文件路径`,"Skip path restriction when sending files. Enable if agents need to send files from any directory.":`跳过文件路径限制。如果代理需要发送任意目录的文件,请启用此选项。`}})),ir,ar=o((()=>{ir={welcome:`歡迎使用 Thino`,ribbonIconTitle:`Thino`,to:`至`,months:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],monthsShort:[`1月`,`2月`,`3月`,`4月`,`5月`,`6月`,`7月`,`8月`,`9月`,`10月`,`11月`,`12月`],weekDays:[`星期日`,`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`],weekDaysShort:[`日`,`一`,`二`,`三`,`四`,`五`,`六`],year:null,month:null,"Basic Options":`基本選項`,"User name":`使用者名稱`,"Set your user name here. 'Memos 😏' By default":`設定您的使用者名稱。預設為 'Thino 😏'`,'You can set target heading like "# Heading" to control data location':`您可以設定目標標題如 "# 標題" 來控制資料位置`,"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.":`如果留空,記錄的 thino 內容將插入日記末尾;如果提供標題,所有記錄的 thino 內容將統一歸類在該標題下。`,"Allows admonitions to be created using ":`允許使用以下方式創建提示 `,"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":`儲存 thino 按鈕標籤`,"The text shown on the save Memo button in the UI. 'NOTEIT' by default.":`UI 中儲存 Thino 按鈕顯示的文字。預設為 'NOTEIT'。`,"Focus on editor when open memos":`開啟 thino 時聚焦編輯器`,"Focus on editor when open memos. Focus by default.":`開啟 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.":`啟用此選項時,Obsidian 開啟時將開啟 Thino。預設為關閉。`,"Hide done tasks in Memo list":`在 Thino 列表中隱藏已完成的任務`,"Hide all done tasks in Memo list. Show done tasks by default.":`在 Thino 列表中隱藏所有已完成的任務。預設顯示已完成的任務。`,"Advanced Options":`進階選項`,"UI language for date":`日期 UI 語言`,"Translates the date UI language. Only 'en' and 'zh' are available.":`翻譯日期 UI 語言。僅支援 'en' 和 'zh'。`,"Default prefix when save thino":`儲存 thino 時的預設前綴`,"Set the default prefix when create memo, 'List' by default.":`創建 thino 時的預設前綴,預設為 'List'。`,"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.":`設定行動裝置上的預設編輯器位置,預設為 'Top'。`,"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:":`如果您喜歡這個外掛,請考慮贊助以支持持續開發:`,"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 中使用。預設為關閉。`,"Ready to convert image into background":`準備將圖片轉換為背景`,List:`列表`,Task:`任務`,Top:`頂部`,Bottom:`底部`,TAG:`標籤`,DAY:`日`,QUERY:`查詢`,EDIT:`編輯`,PIN:`釘選`,UNPIN:`取消釘選`,DELETE:`刪除`,"CONFIRM!":`確認!`,"CREATE FILTER":`創建過濾器`,"Comment it...":`添加評論...`,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:`封存`,"Daily Review":`每日回顧`,"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:`不是`,PATH:`路徑`,METADATA:`元資料`,SELECT:`選擇`,"ADD FILTER TERMS":`添加過濾條件`,FILTER:`過濾`,Filter:`過濾`,TITLE:`標題`,"CREATE QUERY":`創建查詢`,"EDIT QUERY":`編輯查詢`,MATCH:`匹配`,TIMES:`次數`,"Share Memo Image":`分享 Thino 圖片`,"↗Click the button to save":`↗點擊按鈕儲存`,"Image is generating...":`圖片生成中...`,"Image is loading...":`圖片載入中...`,"Loading...":`載入中...`,"😟 Cannot load image, image link maybe broken":`😟 無法載入圖片,圖片連結可能已損壞`,"Daily Memos":`每日 Thino`,"CANCEL EDIT":`取消編輯`,"LINK TO THE":`連結到`,"Mobile Options":`行動裝置選項`,"Experimental Options":`實驗性選項`,"Don't support web image yet, please input image path in vault":`尚不支援網路圖片,請輸入儲存庫中的圖片路徑`,"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} 作為內容。預設為 "{TIME} {CONTENT}"`,"Default Memo Composition":`[已棄用] 預設 Thino 組成`,"Show Tasks Label":`顯示任務標籤`,Gallery:`畫廊`,"Show tasks label near the time text. False by default":`在時間文字旁顯示任務標籤。預設為關閉`,"Please Open Memos First":`請先開啟 Thino`,DATE:`日期`,OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:`OBSIDIAN_NLDATES_PLUGIN_未啟用`,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.":`您需要安裝 Dataview 外掛 0.5.9 或更新版本才能使用此功能。`,"Open Memos Successfully":`成功開啟 Thino`,"Fetch Memos Error":`😭 獲取錯誤`,"Copied to clipboard Successfully":`成功複製到剪貼簿`,"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":`請檢查是否已開啟每日筆記外掛或定期筆記外掛`,"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":`還原成功`,"DELETE SUCCEED":`刪除成功`,"Save Memo button icon":`儲存 Thino 按鈕圖示`,"The icon shown on the save Memo button in the UI.":`UI 中儲存 Thino 按鈕顯示的圖示。`,"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':`您可以為 thino 設定任何 Dataview 查詢來獲取它。這些筆記中的所有 thino 都會顯示在列表中。預設為 "#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":`使用 Thino 管理您筆記中的所有 thino,而不僅僅是每日筆記中的。預設為關閉`,"Always Show Memo Comments":`始終顯示 Thino 評論`,"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.":`您尚未在定期筆記和每日筆記外掛中設定每日筆記的資料夾。`,"Please check your daily note plugin OR periodic notes plugin settings":`請檢查您的每日筆記外掛或定期筆記外掛設定`,"Use which plugin's default configuration":`使用哪個外掛的預設配置`,"Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":`Thino 使用外掛的預設配置從每日筆記中獲取 thino,預設為 'Daily'。`,Daily:`每日`,"Always Show Leaf Sidebar on PC":`在 PC 上始終顯示葉面側邊欄`,"Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.":`即使葉面寬度小於 875px,也在 PC/平板上顯示左側邊欄。預設為關閉。`,"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":`您尚未在定期筆記和每日筆記外掛中設定每日筆記的格式。`,"fetch more":`獲取更多`,"Search all settings":`搜尋所有設定`,General:`一般`,Theme:`主題`,Share:`分享`,Advanced:`進階`,Interface:`介面`,Thino:`Thino`,"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'`,"Default Editor Mode":`預設編輯器模式`,"Live-Preview Mode OR Source Mode.":`即時預覽模式或原始碼模式。`,"Save type for Thino":`Thino 的儲存類型`,DAILY:`每日`,MULTI:`多個`,CANVAS:`畫布`,ALL:`全部`,FILE:`檔案`,TODO:`待辦`,DONE:`已完成`,JOURNAL:`日誌`,OTHER:`其他`,"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 時,不會移至垃圾桶。預設為關閉。`,"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。`,"Key for showing thino globally":`全域顯示 thino 的快速鍵`,"Set key for showing thino globally. CTRL + SHIFT + E by default.":`設定全域顯示 thino 的快速鍵。預設為 CTRL + SHIFT + E。`,"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 type":`預設儲存位置`,'Set the default save type for thino. "DAILY" by default':`設定 thino 的預設儲存類型。預設為 "DAILY"`,"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":`成功複製應用程式 id`,"Please input token first":`請先輸入令牌`,"Please enable sync first":`請先啟用同步`,"Init Failed":`初始化失敗`,"Verify successfully":`驗證成功`,"Failed to verify":`驗證失敗`,"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.":`讀取當前每日筆記失敗,請檢查是否存在。`,"Failed to save":`儲存失敗`,"Failed to login, please login again":`登入失敗,請重新登入`,"COPY FAILED":`複製失敗`,"COPY SUCCEED":`複製成功`,"Copy selected text":`複製選定文字`,"Copy thino":`複製 thino`,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:`字`,word:`字`,"Return To Home Page":`返回首頁`,"No thinos to review!":`沒有要回顧的 thino!`,"Thinos to review":`要回顧的 thino`,"Start Review":`開始回顧`,Hard:`困難`,Good:`良好`,Easy:`簡單`,Again:`再次`,"Clear all review data":`清除所有回顧資料`,"Daily Progress":`每日進度`,"Show stats":`顯示統計`,"Hide stats":`隱藏統計`,Remaining:`剩餘`,"Total Reviews":`總回顧次數`,"Today, you have reviewed all your thinos!":`今天,您已回顧完所有 thino!`,"Daily review limit reached! Come back tomorrow.":`已達到每日回顧限制!明天再來。`,"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":`切換最小化模式`,"Focus on thino editor":`聚焦 thino 編輯器`,"ReSync web thinos to local":`重新同步網路 thino 到本地`,"Sync local thinos to web":`同步本地 thino 到網路`,"Show daily thino":`顯示每日 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:`來源`,"Global copy":`全域複製`,"Set the folder name":`設定資料夾名稱`,"Set the filename":`設定檔案名稱`,"Set the filename for current location file":`設定目前位置檔案的檔案名稱`,"Switch calendar type":`切換日曆類型`,alphabetical:`按字母順序`,alphabeticalReverse:`按字母倒序`,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":`複製已篩選的 thinos`,"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 in thino list":`在 thino 列表中顯示日期標記`,"Show day mark on the top of daily range thino. False by default.":`在每日範圍 thino 頂部顯示日期標記。預設為否。`,"Click to expand or fold, Cmd+Click to show all thinos of the day":`點擊展開或摺疊,Cmd+點擊顯示當天所有 thinos`,"You can buy a license from":`您可以從以下位置購買授權:`,"No thinos in range":`範圍內沒有 thinos`,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":`臨時篩選`,"Open link directly in Thino view":`在 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 時自動下載圖片。預設為否。`,"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":`標籤批量編輯`,"Tag Bulk Select":`標籤批量選擇`,"Exist Tags":`現有標籤`,"Selected Tags":`已選標籤`,"Click to remove exist tag":`點擊移除現有標籤`,"Click to remove selected tag":`點擊移除已選標籤`,"Select tags":`選擇標籤`,"Input to select exist tag":`輸入以選擇現有標籤`,Beginning:`開頭`,End:`結尾`,"Set the heading for saving thino":`設定儲存 thino 的標題`,"# Heading":`# 標題`,"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/share image":`動態/聊天視圖/分享圖片的圖示`,"Set the icon for moments/chat view/share image":`設定動態/聊天視圖/分享圖片的圖示`,"Quote for moments view/share image":`動態視圖/分享圖片的引言`,"Set the quote for moments view/share image":`設定動態視圖/分享圖片的引言`,"Theme for Thino":`Thino 主題`,"Set the theme for Thino":`設定 Thino 主題`,"Interface Details":`介面詳情`,"Task amount":`任務數量`,"Thino status":`Thino 狀態`,"Used tags":`已使用標籤`,"Used days":`已使用天數`,"Most active day":`最活躍日`,"Most active hour":`最活躍時段`,"Thino amount":`Thino 數量`,"No content to generate.":`沒有內容可生成。`,"Image generated successfully.":`圖片生成成功。`,"Failed to generate image.":`圖片生成失敗。`,"Share filtered thinos as image":`將已篩選的 thinos 分享為圖片`,"Latest version":`最新版本`,"Previous version":`上一版本`,"Thino update info":`Thino 更新資訊`,"Debug info copied to clipboard":`除錯資訊已複製到剪貼簿`,"Copy debug info":`複製除錯資訊`,"Failed to load changelog":`載入更新日誌失敗`,"View online":`線上檢視`,ChangeLog:`更新日誌`,"Please open thino first":`請先開啟 thino`,"Insert editor":`插入編輯器`,"Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":`請為 Thino 的多檔案設定設定不同的儲存位置。日記資料夾與多檔案儲存位置重疊,或有重複讀取的風險。`,"Default time prefix for thino in daily notes":`每日筆記中 thino 的預設時間前綴`,"Set default time prefix for thino in daily notes.":`設定每日筆記中 thino 的預設時間前綴。`,"Save image successfully":`圖片儲存成功`,"User quote":`使用者引言`,"Set user quote for thino":`設定 thino 的使用者引言`,"User icon":`使用者圖示`,"Set user icon for thino. You can input http/https link or file path in vault.":`設定 thino 的使用者圖示。您可以輸入 http/https 連結或儲存庫中的檔案路徑。`,"User info":`使用者資訊`,"Copy filtered results":`複製篩選結果`,"Share image":`分享圖片`,Default:`預設`,Gray:`灰色`,Grass:`草綠`,Flame:`火焰`,Olive:`橄欖`,Ice:`冰藍`,Magenta:`洋紅`,"Daily notes":`每日筆記`,Editor:`編輯器`,"Append/prepend text when share to Thino":`分享到 Thino 時附加/前置文字`,"Append text when share to Thino":`分享到 Thino 時附加文字`,"Prepend text when share to Thino":`分享到 Thino 時前置文字`,"Add newline when append/prepend text":`附加/前置文字時換行`,"Input anything here":`在此輸入任何內容`,Prepend:`前置`,Append:`附加`,Both:`兩者`,None:`無`,"Hide pinned group":`隱藏釘選群組`,"Hide pinned group in thino list. False by default.":`在 thino 列表中隱藏釘選群組。預設為否。`,"Set the heading for the task type of thino, by default 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 內容將插入日記末尾;如果提供標題,所有記錄的 thino 內容將統一歸類在該標題下。`,"Different insert target for different type":`不同類型的不同插入目標`,"Toggle this to set different insert target for different type of thino, like task or list type of thino":`切換此選項以為不同類型的 thino 設定不同的插入目標,如任務或列表類型的 thino`,"You can set whole diary or only part of it":`您可以設定整個日記或僅部分內容`,"Set process target":`設定處理目標`,Custom:`自訂`,"Whole diary":`整個日記`,"Set thino insert place":`設定 thino 插入位置`,"Set where to insert thino content":`設定插入 thino 內容的位置`,"End of the diary":`日記末尾`,"Custom location":`自訂位置`,"Setting guide":`設定指南`,"Details settings":`詳細設定`,"Start Thino":`開始使用 Thino`,"About Thino Pro":`關於 Thino Pro`,Enabled:`已啟用`,Enable:`啟用`,"Daily notes folder":`每日筆記資料夾`,"Set daily notes folder":`設定每日筆記資料夾`,"Daily note name format":`每日筆記名稱格式`,"Set daily note name format":`設定每日筆記名稱格式`,"Daily note plugin":`每日筆記外掛程式`,"Enable daily note plugin":`啟用每日筆記外掛程式`,Selected:`已選擇`,Select:`選擇`,"A classic theme for Thino with a two-column layout":`具有雙欄佈局的 Thino 經典主題`,Classic:`經典`,"A modern theme for Thino with a three-column layout and some unique features.":`具有三欄佈局和一些獨特功能的 Thino 現代主題。`,Modern:`現代`,"Go and enjoy Thino":`開始使用並享受 Thino`,"Congrats! All settings done":`恭喜!所有設定已完成`,"Adjust settings that influence your user experience with Thino.":`調整影響您使用 Thino 體驗的設定。`,"Set preferences for using Thino":`設定使用 Thino 的偏好`,"If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.":`如果您使用的是 Thino 基本版,需要啟用每日筆記外掛程式。配置其設定以有效使用。`,"Go with daily note plugin":`使用每日筆記外掛程式`,"Choose a theme for Thino.":`為 Thino 選擇主題。`,"Set theme for Thino":`設定 Thino 主題`,"Set up your user info for Thino.":`設定您的 Thino 使用者資訊。`,"Get started with Thino":`開始使用 Thino`,"Skip and start Thino":`跳過並開始使用 Thino`,"Next step":`下一步`,"Back to previous step":`返回上一步`,"Click to enable =>":`點擊啟用 =>`,"This is Thino's sidebar. Navigate to different path or select query filter.":`這是 Thino 的側邊欄。導航到不同路徑或選擇查詢篩選器。`,"Click here and go to settings page.":`點擊此處前往設定頁面。`,"Click here and go to different path.":`點擊此處前往不同路徑。`,"Select or create query filter here.":`在此選擇或建立查詢篩選器。`,"See the status of Thinos here.":`在此查看 Thinos 的狀態。`,"Search your thino quickly here.":`在此快速搜尋您的 thino。`,"Edit or create your thino here.":`在此編輯或建立您的 thino。`,"See your thinos here.":`在此查看您的 thinos。`,"See your time status of thinos here.":`在此查看您的 thinos 時間狀態。`,"See your tags here. Tags will be shown when thino contains tags.":`在此查看您的標籤。當 thino 包含標籤時會顯示標籤。`,Done:`完成`,"Thino is ready to use. ":`Thino 已準備就緒。`,"You can start using Thino now. If you want to know more about Thino Pro, click the button below.":`您現在可以開始使用 Thino。如果您想了解更多關於 Thino Pro 的資訊,請點擊下方按鈕。`,"Default time prefix":`預設時間前綴`,"Append Text Action":`附加文字動作`,"Prepend Text Action":`前置文字動作`,Preset:`預設`,"Select Tags":`選擇標籤`,"It is not available on small view":`在小視圖中不可用`,"Append text":`附加文字`,"Prepend text":`前置文字`,"Your daily note folder is not set correctly, please check your settings":`您的每日筆記資料夾設定不正確,請檢查您的設定`,"Default sharing style":`預設分享樣式`,"Set the default style for sharing thino, 'Modern' by default.":`設定分享 thino 的預設樣式,預設為「現代」。`,Clean:`簡潔`,Minimal:`極簡`,Gradient:`漸層`,"Thino share":`Thino 分享`,"Copy to clipboard failed":`複製到剪貼簿失敗`,"Copy to clipboard successfully":`成功複製到剪貼簿`,"Your content has been copied to clipboard, and inserted into the editor. Please try it again":`您的內容已複製到剪貼簿,並插入到編輯器中。請重試`,"Share thino":`分享 thino`,"Set file name after create thino":`建立 thino 後設定檔案名稱`,"You can set file name after create thino. A input box will show when you create thino.":`您可以在建立 thino 後設定檔案名稱。建立 thino 時會顯示輸入框。`,SPLIT:`分割`,"Split by Heading 1":`按一級標題分割`,"Split by Heading 2":`按二級標題分割`,"Split by Heading 3":`按三級標題分割`,"Insert task":`插入任務`,"All settings have been reset to default.":`所有設定已重設為預設值。`,"Reset all Thino settings":`重設所有 Thino 設定`,"Reset settings":`重設設定`,"Reset Thino settings to default settings.":`將 Thino 設定重設為預設設定。`,"Task Management":`任務管理`,"Append completed date when task done in thino":`在 thino 中完成任務時附加完成日期`,"Append completed date when task done in thino. False by default":`在 thino 中完成任務時附加完成日期。預設為否`,"Set tag for single file that Thino indexes":`設定 Thino 索引的單一檔案的標籤`,"When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.":"當您在此設定標籤時,Thino 將索引包含此標籤的檔案並在列表中顯示。不需要加上 `#`。","Set tag for file type file":`設定檔案類型檔案的標籤`,"Set tag for multi type file":`設定多類型檔案的標籤`,"Please input the tag":`請輸入標籤`,"Merge thinos in to thino share image":`將 thinos 合併到 thino 分享圖片中`,"Custom height for Thino content":`自訂 Thino 內容高度`,"Set custom height for Thino content. Like 200px or 20rem":`設定 Thino 內容的自訂高度。如 200px 或 20rem`,"Input height":`輸入高度`,"Submit issue":`提交問題`,"Current version":`目前版本`,"Bug report":`錯誤回報`,"Click the button to copy debug info and open the issue page":`點擊按鈕複製除錯資訊並開啟問題頁面`,"Copy and go":`複製並前往`,"Debug info copied":`除錯資訊已複製`,"Feature request":`功能請求`,"Submit your feature request to the issue page":`將您的功能請求提交到問題頁面`,Go:`前往`,"Toggle query list visibility":`切換查詢列表可見性`,"Toggle tags visibility":`切換標籤可見性`,"Toggle sidebar visibility":`切換側邊欄可見性`,Collapse:`摺疊`,Expand:`展開`,"Max height for collapse":`摺疊的最大高度`,"The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)":`thino 摺疊的最大高度,設為 0 時 thino 不會摺疊。預設為 0。(這不是行數,而是以像素為單位的高度。)`,"Render content":`渲染內容`,"Optimize for Callout":`優化 Callout`,"Won't render content contains more than 3 callouts automatically. True by default":`不會自動渲染包含超過 3 個 callouts 的內容。預設為是`,"The value should be greater than":`值應大於`,"Append Text":`附加文字`,"Prepend Text":`前置文字`,"Thino height when collapsed":`Thino 摺疊時的高度`,"The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)":`thino 摺疊時的高度,設為 0 時 thino 不會摺疊。預設為 100。(這不是行數,而是以像素為單位的高度。)`,"This option will allow you use other views when leaf width is not enough. False by default.":`此選項將允許您在葉寬度不足時使用其他視圖。預設為否。`,"Can select other views when leaf width is not enough":`當葉寬度不足時可以選擇其他視圖`,"TRASH BOX":`垃圾箱`,"Wait templater to finish parse before insert thino":`在插入 thino 前等待模板解析完成`,"This option will allow you to wait for templater to finish parse before insert thino, which may casue you need to confirm twice between insert thino. False by default.":`此選項將允許您在插入 thino 前等待模板解析完成,這可能導致您需要在插入 thino 時確認兩次。預設為否。`,"Get thino capture extension":`獲取 thino 擷取擴充功能`,"You can capture idea/text from chrome now.":`您現在可以從 Chrome 擷取想法/文字。`,"Open File":`開啟檔案`,"Exported CSV file":`匯出的 CSV 檔案`,"Updated At":`更新時間`,"Export to CSV":`匯出為 CSV`,"Quick add button on mobile navbar":`行動導航欄上的快速新增按鈕`,"Always show status text":`始終顯示狀態文字`,"Support filter by metadata from file":`支援從檔案中的元資料進行篩選`,"When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.":`啟用此選項後,您可以通過檔案中的元資料進行篩選,如檔案中的標籤。但不支援來自畫布的 thinos。預設為否。`,"Show source near timestamp in thino":`在 thino 中的時間戳記附近顯示來源`,"When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.":`啟用此選項後,您可以在 thino 中的時間戳記附近看到來源。您可以在元資料中設定標題來覆寫此設定。預設為否。`,"Show Update Message":`顯示更新訊息`,"Show update message when Thino is updated. True by default":`Thino 更新時顯示更新訊息。預設為是`,"Sync manually":`手動同步`,"Show all scrollbars":`顯示所有捲軸`,"TIME RANGE":`時間範圍`,WITHIN:`在`,"7 days":`7 天`,"14 days":`14 天`,"30 days":`30 天`,"3 months":`3 個月`,"6 months":`6 個月`,"1 year":`1 年`,"This week":`本週`,"Last week":`上週`,"This month":`本月`,"Last month":`上月`,"This year":`今年`,"Last year":`去年`,"No history":`無歷史記錄`,"Today Remaining":`今日剩餘`,"Today Total":`今日總計`,"Historical Statistics":`歷史統計`,byTime:`按時間`,byTimeReverse:`按時間倒序`,Stat:`統計`,Statistics:`統計資料`,"Daily Thino Count":`每日 Thino 數量`,Total:`總計`,thinos:`thinos`,"Thino Types":`Thino 類型`,"Distribution of thino types":`Thino 類型分佈`,"Thino Status":`Thino 狀態`,"Distribution of thino status":`Thino 狀態分佈`,"Popular Tags":`熱門標籤`,"Top 10 most used tags":`前 10 個最常用標籤`,"Thino Count":`Thino 數量`,"Hourly distribution":`每小時分佈`,"Current month":`本月`,"Monthly distribution":`每月分佈`,"30 Days":`最近 30 天`,Year:`年`,"Time Distribution":`時間分佈`,"When do you write thinos":`您何時寫 thinos`,"Content Length":`內容長度`,"Distribution of thino lengths":`Thino 長度分佈`,"Daily Thinos":`每日 Thinos`,"Show Time Distribution":`顯示時間分佈`,"Hide date picker":`隱藏日期選擇器`,"Show date picker":`顯示日期選擇器`,"Clear filter":`清除篩選`,"Copy link":`複製連結`,"Copy embed link":`複製嵌入連結`,"Ctrl/Cmd + Enter to save thino":`Ctrl/Cmd + Enter 儲存 thino`,"Fixed strings for thinos":`Thinos 的固定字串`,"Use fixed strings for thinos":`使用 thinos 的固定字串`,"Enable to add fixed strings at the beginning or end of thinos.":`啟用在 thinos 的開頭或結尾新增固定字串。`,"Fixed prefix for thinos":`Thinos 的固定前綴`,"Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`在每個 thino 的開頭添加此字串。支援像 {{TIME|YYYYMMDDHHmmss}} 這樣的佔位符。`,"Fixed suffix for thinos":`Thinos 的固定後綴`,"Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.":`在每個 thino 的結尾添加此字串。支援像 {{TIME|YYYYMMDDHHmmss}} 這樣的佔位符。`,"Word count exceeded":`字數超出限制`,"Word count feature":`字數統計功能`,"Enable real-time word count display in the editor":`在編輯器中啟用即時字數顯示`,"Maximum word count":`最大字數`,"Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.":`為 thino 設定最大字數。超出時編輯器將顯示警告。設為 0 則無限制。`,"No linked thinos found":`未找到相關連結的 thinos`,"Reference links group":`參考連結群組`,"Enable reference links group in thino.":`在 thino 中啟用參考連結群組。`,"No reference links found":`未找到參考連結`,"Outgoing Links":`外部連結`,"Incoming Links":`內部連結`,"Error fetching reference links":`獲取參考連結時出錯`,"Double click behavior":`雙擊行為`,"Set the behavior when double click on a thino.":`設定在 thino 上雙擊時的行為。`,"Open thino":`開啟 thino`,"Edit thino":`編輯 thino`,"Go to source":`前往來源`,"Do nothing":`不做任何操作`,"Use default header in mobile view":`在行動裝置視圖中使用預設標頭`,"Use default header in mobile view of thino rather than custom header.":`在 thino 的行動裝置視圖中使用預設標頭而非自定義標頭。`,"Ignore folders for multi type":`忽略多文件類型文件夾`,"Set folders to ignore when using multi type. Separate multiple folders with comma (,).":`設置多文件類型時忽略的文件夾。用逗號 (,) 分隔多個文件夾。`,"folder1,folder2/subfolder":`folder1,folder2/subfolder`,"Using block link when dragging a thino":`拖動 thino 以插入連結`,"Using block link when dragging a thino for daily":`拖動 thino 以插入連結到日記`,"Matched via tag in content":`通過內容中的標籤匹配`,"Matched via tag in file":`通過文件中的標籤匹配`,"Focus on editor when open":`打開時聚焦編輯器`,"Focus on editor when open. True by default.":`打開時聚焦編輯器。默認為開啟`,"Show scroll to top button":`顯示滾動到頂部按鈕`,"Show scroll to top button. True by default":`顯示滾動到頂部按鈕。默認為開啟`,"Zoom image by default":`預設縮放圖片`,"Zoom image by default when viewing image.":`查看圖片時預設縮放圖片。`,"View archive in random review":`在隨機回顧中查看歸檔的 Thino`,"View archived thinos in random review. True by default":`在隨機回顧中查看歸檔的 Thino。默認為開啟`,"Linked by":`鏈接自`,Linked:`鏈接`,DUPLICATE:`複製`,"Show scrollbars in all thino views.":`在所有 Thino 視圖中顯示滾動條。`,"Drag to paste content":`拖動粘貼內容`,"You will be able to paste content from other apps to thino by dragging rather than pasting the block link.":`您將能夠通過拖動而不是粘貼塊鏈接來將內容從其他應用程序粘貼到 Thino 中。`,"Dragging behavior":`拖動行為`,"Control the behavior when dragging a thino. You will paste the block link by default. Block-link option only works with source type is Daily Note.":`控制拖動 Thino 的行為。默認粘貼塊鏈接。塊鏈接選項僅在源類型為日記時有效。`,"Block link":`塊鏈接`,"Quick capture tool that allows you to create and manage your ideas, tasks, and more.":`快速捕獲工具,允許你創建和管理你的想法、任務等。`,About:`關於`,Text:`文本`,"Open Documentation":`開啟文件`,Documentation:`文件`,Version:`版本`,"View the documentation for this plugin":`查看此插件的文件`,"Activate Pro":`激活專業版`,"Activated Pro":`已激活專業版`,Tasks:`任務`,"Show release notes":`顯示發布說明`,"Show release notes when Thino is updated. True by default":`顯示發布說明當 Thino 更新時。默認為開啟`,"Open change log":`開啟更新日志`,"Change log":`更新日志`,"View the change log for this plugin":`查看此插件的更新日志`}}));function M(e){let t=or&&or[e]||Sn[e];return t===null?t:t||e}var or,N=o((()=>{hn(),_n(),yn(),xn(),Cn(),Tn(),Dn(),kn(),jn(),Nn(),Fn(),Ln(),zn(),Vn(),Un(),Gn(),qn(),Yn(),Zn(),$n(),tr(),rr(),ar(),or={ar:mn,cs:gn,da:vn,de:bn,en:Sn,"en-gb":wn,es:En,fr:On,hi:An,id:Mn,it:Pn,ja:In,ko:Rn,nl:Bn,nn:Hn,pl:Wn,pt:Kn,"pt-br":Jn,ro:Xn,ru:Qn,tr:er,"zh-cn":nr,"zh-tw":ir}[f.moment.locale()]}));function sr(){return{userState:fn.getState(),queryState:{queries:$r.getState().queries},memoState:{memos:F.getState().memos,commentMemos:F.getState().commentMemos,tags:F.getState().tags,tagsNum:F.getState().tagsNum,preparingUpdateMemo:F.getState().preparingUpdateMemo},globalState:si.getState(),locationState:di.getState(),dailyNotesState:I.getState()}}var cr=o((()=>{vi()})),lr,ur=o((()=>{cr(),vi(),lr={getState:sr}})),dr,fr,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or=o((()=>{ur(),dr=/```([\s\S]*?)```/g,fr=/\*\*(.+?)\*\*/g,pr=/\*(.+?)\*/g,mr=/\[ \] /g,hr=/\[.{1}\] /g,gr=/^[*-]/g,_r=/(\d+)\. /g,vr=/\[\[([^\]]+)\]\]/g,yr=/\[([^\]]+)\]\((([^\]]+).md)\)/g,br=(e,t)=>{let n=e.replace(dr,`<pre lang=''>$1</pre>`).replace(gr,`<span class='counter-block'>•</span>`).replace(_r,`<span class='counter-block'>$1.</span>`).replace(mr,`<span class='todo-block' data-type='todo'>⬜</span>`).replace(hr,`<span class='todo-block' data-type='done'>✅</span>`).replace(fr,`<strong>$1</strong>`).replace(pr,`<em>$1</em>`).replace(/<br>/g,`</p><p>`).replace(/&/g,`&`),r=n;if(t){if(vr.test(n)){let e=n.match(vr);for(let t=0;t<e.length;t++)if(!/(jpeg|jpg|gif|png|svg|bmp|wepg)/g.test(e[t])){let i=Sr(e[t]);if(/\|/g.test(i)){let[a,o]=i.split(`|`),s=xr(a,o);r=n.replace(e[t],s)}else{let n=xr(i,``);r=r.replace(e[t],n)}}}if(yr.test(n)){let e=n.match(yr);for(let t=0;t<e.length;t++)if(!/(jpeg|jpg|gif|png|svg|bmp|wepg)/g.test(e[t])){let i=xr(wr(e[t]),Cr(e[t]));r=n.replace(e[t],i)}}}return r},xr=(e,t)=>{let{metadataCache:n}=lr.getState().dailyNotesState.app;return n.getFirstLinkpathDest(decodeURIComponent(e),``)instanceof f.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>`},Sr=e=>/\[\[([^\]]+)\]\]/g.exec(e)?.[1],Cr=e=>yr.exec(e)?.[1],wr=e=>/\[([^\]]+)\]\((([^\]]+).md)\)/g.exec(e)?.[3],Tr=e=>{let t=document.createElement(`div`);return t.className=`memo-content-text`,t.innerHTML=e,t.innerText},Er=e=>e.replace(/\n/g,`<br>`),Dr=e=>{let t=document.createElement(`div`);return t.textContent=e,t.innerHTML}})),kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr=o((()=>{kr=`mobile-show-sidebar`,Ar=3600*24*1e3,jr=/\s#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,Mr=/(<p>|<br>)#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,Nr=/^#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/gu,Pr=/(\s|:|\(|>|^)((http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-]))/g,Fr=/\[([\s\S]*?)\]\(([\s\S]*?)\)/gu,Ir=/([^\s<\\*>'(]+\.(jpeg|jpg|gif|png|svg))(\]\])?(\))?/g,Lr=/(\s|:|^)(http[s]?:\/\/)([^\/\s]+\/)(\S*?)(jpeg|jpg|gif|png|svg|bmp|webp)(?!\))/g,Rr=/!\[\[(([^|\]]+?)\.(jpeg|jpg|gif|png|svg|bmp|webp))?(\|)?([^\]]*)?\]\]/gi,zr=/(!\[([^\]]*)\]\(([^)"\s]*\.(jpg|jpeg|png|gif|svg|bmp|webp))(?:\s*"[^"]*")?\s*\))/gi,Br=/\[@(.+?)\]\((.+?)\)/g,Vr=/[#*"\/\\<>:|\[\]\?]/gim,Hr=/^(-|\*|\d\.)\s(\[.\]\s)?(\d{1,2}:\d{2}(:\d{2})?)(-\d{1,2}:\d{2}(:\d{2})?)?\s(.*)/g,Ur=[{title:`DAILY`,icon:`list`},{title:`CANVAS`,icon:`layout-dashboard`},{title:`MULTI`,icon:`file-text`},{title:`FILE`,icon:`edit`},{title:`JOURNAL`,icon:`book-open`}]}));function Gr(){let e=``,t=app.plugins.getPlugin(`obsidian-memos`).settings,n=``,r=window.app.plugins.getPlugin(`periodic-notes`)?.calendarSetManager?.getActiveConfig(`day`)?.folder,i=window.app.plugins.getPlugin(`periodic-notes`)?.settings?.daily?.format;switch(n=r===void 0?i:r,t?.UseDailyOrPeriodic||`Daily`){case`Daily`:e=C().format||`YYYY-MM-DD`;break;case`Periodic`:e=n||`YYYY-MM-DD`;break;default:e=C().format||`YYYY-MM-DD`;break}return e===void 0&&new f.Notice(M(`You didn't set format for daily notes in both periodic-notes and daily-notes plugins.`)),e}function Kr(){let e=``,t=app.plugins.getPlugin(`obsidian-memos`).settings,n=``,r=window.app.plugins.getPlugin(`periodic-notes`)?.calendarSetManager?.getActiveConfig(`day`)?.folder,i=window.app.plugins.getPlugin(`periodic-notes`)?.settings?.daily?.folder;switch(n=r===void 0?i:r,t?.UseDailyOrPeriodic||`Daily`){case`Daily`:e=C().folder||``;break;case`Periodic`:e=n||``;break;default:e=C().folder||``;break}return e===void 0&&new f.Notice(M(`You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.`)),e}function qr(){let e=Kr();return!(e!==void 0&&!app.vault.getFolderByPath(e))}function Jr(e,t){e=Dr(e),e=Er(e).split(`<br>`).map(e=>`<p>${e===``?`<br>`:e}</p>`).join(``),e=br(e,t),e=e.replace(jr,`<span class='tag-span'>#$1</span>`).replace(Mr,`<p><span class='tag-span'>#$2</span>`).replace(Pr,`$1<a class='link' target='_blank' rel='noreferrer' href='$2'>$2</a>`).replace(Fr,`<a class='link' target='_blank' rel='noreferrer' href='$2'>$1</a>`).replace(Br,`<span class='memo-link-text' data-value='$2'>$1</span>`).replace(/\^\S{6}/g,``);let n=document.createElement(`div`);n.innerHTML=e;for(let e=0;e<n.children.length;e++){let t=n.children[e];if(t.tagName===`P`&&t.textContent===``&&t.firstElementChild?.tagName!==`BR`){t.remove(),e--;continue}}return n.innerHTML}function Yr(e,t){return Object.keys(t).every(n=>typeof t[n]==`object`&&t[n]!==null&&typeof e[n]==`object`&&e[n]!==null?Yr(e[n],t[n]):Object.prototype.hasOwnProperty.call(e,n)&&e[n]===t[n])}var Xr,P,Zr,Qr=o((()=>{Ce(),N(),Or(),Wr(),(function(e){function t(){return parseInt((0,f.moment)().format(`x`))}e.getNowTimeStamp=t;function n(e){let t=new RegExp([`(?:[0-9]+(?:(?:,|\\.)[0-9]+)*|[\\-'’A-Za-z\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AD\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC])+`,`\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u4E00-\\u9FD5`,`[\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u4E00-\\u9FD5]{1}`].join(`|`),`g`);return(e.match(t)||[]).length}e.getWordCount=n;function r(e){k()&&e?.EnabledLocationList.some(e=>e.value===`DAILY`)&&e?.EnabledLocationList.some(e=>e.value===`MULTI`)&&Kr().contains(e?.MemoOtherSaveLocation.MemoDefaultMultiFilePath)&&new f.Notice(M(`Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.`),5e3)}e.checkDailyInMulti=r;function i(){let e=navigator.userAgent,t=`Unknown`;return e.indexOf(`Win`)==-1?e.indexOf(`Mac`)==-1?e.indexOf(`Linux`)!=-1&&(t=`Linux`):t=`MacOS`:t=`Windows`,t}e.getOSVersion=i;function a(e){return typeof e==`string`&&(e=e.replaceAll(`-`,`/`)),new Date(e).getTime()}e.getTimeStampByDate=a;function o(e,t=`createdAt`){return t===`createdAt`&&e.createdAtTs!=null?e.createdAtTs:t===`updatedAt`&&e.updatedAtTs!=null?e.updatedAtTs:a(e[t])}e.getMemoTimestamp=o;function s(e){return e.createdAtTs==null&&e.createdAt&&(e.createdAtTs=a(e.createdAt)),e.updatedAtTs==null&&e.updatedAt&&(e.updatedAtTs=a(e.updatedAt)),e}e.stampMemoTimestamps=s;function c(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=`${r.id}|${r.updatedAt||r.createdAt}|${r.deletedAt||``}|${r.rowStatus||``}|${r.pinned?1:0}|${r.content||``}`;for(let e=0;e<i.length;e++)t=t*31+i.charCodeAt(e)|0}return String(t)}e.computeMemosHash=c;function l(e){let t=new Date(a(e));return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}e.getDateStampByDate=l;function u(e){let t=new Date(a(e));return`${t.getFullYear()}/${t.getMonth()+1}/${t.getDate()}`}e.getDateString=u;function d(e){let t=new Date(a(e)),n=t.getHours(),r=t.getMinutes();return`${n<10?`0`+n:n}:${r<10?`0`+r:r}`}e.getTimeString=d;function p(e){let t=new Date(a(e)),n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate(),o=t.getHours(),s=t.getMinutes(),c=t.getSeconds();return`${n}/${r<10?`0`+r:r}/${i<10?`0`+i:i} ${o<10?`0`+o:o}:${s<10?`0`+s:s}:${c<10?`0`+c:c}`}e.getDateTimeString=p;function m(e){return Array.from(new Set(e))}e.dedupe=m;function h(e){let t=new Set,n=[];for(let r of e)t.has(r.id)||(t.add(r.id),n.push(r));return n}e.dedupeObjectWithId=h;function g(e,t){let n=null;return()=>{n&&clearTimeout(n),n=setTimeout(e,t)}}e.debounce=g;function _(e,t,n=!1,r){let i=null,a=!1;function o(...o){if(i&&clearTimeout(i),n&&!a){let t=e.apply(this,o);r&&typeof r==`function`&&r(t),a=!0}else i=setTimeout(()=>{let t=e.apply(this,o);r&&typeof r==`function`&&r(t),a=!1,i=null},t)}return o.cancel=function(){i&&clearTimeout(i),i=null,a=!1},o}e.debouncePlus=_;function v(e,t){let n=!0;return()=>{if(!n)return!1;n=!1,setTimeout(()=>{e(),n=!0},t)}}e.throttle=v;function y(e){let t=[],n=Object.keys(e).sort();for(let r of n){let n=e[r];n&&(typeof n==`object`?t.push(...y(n).split(`&`)):t.push(`${r}=${n}`))}return t.join(`&`)}e.transformObjectToParamsString=y;function b(e){let t={},n=e.split(`&`);for(let e of n){let[n,r]=e.split(`=`);n&&r&&(t[n]=r)}return t}e.transformParamsStringToObject=b;function x(e){if(!e)return{};let t={},n=Object.keys(e).sort();for(let r of n){let n=e[r];if(typeof n==`object`){let e=x(JSON.parse(JSON.stringify(n)));e&&Object.keys(e).length>0&&(t[r]=e)}else n&&(t[r]=n)}return t}e.filterObjectNullKeys=x;async function S(e){if(navigator.clipboard&&navigator.clipboard.writeText)try{await navigator.clipboard.writeText(e)}catch(e){console.warn(`Copy to clipboard failed.`,e)}else console.warn(`Copy to clipboard failed, methods not supports.`)}e.copyTextToClipboard=S;function C(e){return new Promise(t=>{let n=new Image;n.onload=()=>{let{width:e,height:r}=n;t(e>0&&r>0?{width:e,height:r}:{width:0,height:0})},n.onerror=()=>{t({width:0,height:0})},n.className=`thino-hidden`,n.src=e,document.body.appendChild(n),n.remove()})}e.getImageSize=C;async function w(e){let t,n=app.plugins.getPlugin(`obsidian-memos`).settings.UseDailyOrPeriodic===`Daily`;try{return!n&&window.app.plugins?.getPlugin(`periodic-notes`)?.calendarSetManager?.getActiveConfig(`day`)?.enabled?(t=await window.app.plugins.getPlugin(`periodic-notes`).createPeriodicNote(`day`,e),t):(t=await app.internalPlugins.getPluginById(`daily-notes`).instance.getDailyNote(e)||await fe(e),t)}catch(e){return console.error(e),new f.Notice(M(`Failed to create daily note. Please check if you created a folder for daily notes.`)),null}}e.createDailyNoteCheck=w;function T(e){let t=[],n=0;for(;n<e;n++)t.push((16*Math.random()|0).toString(16));return t.join(``)}e.randomId=T;function E(e){return e.replace(/[\p{P}\p{Z}\p{S}]/gu,``).length}e.countWords=E;async function D(e){try{let t=await(0,f.requestUrl)(e),n=new Uint8Array(t.arrayBuffer);return new Blob([n],{type:`image/png`})}catch(t){return console.error(`error in grabImageFromUrl`,e,t),new Blob}}e.grabImageFromUrl=D})(Xr||={}),P=Xr,Zr=(e,t)=>{let n=window.atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);return new Blob([r],{type:t})}})),$r,ei=o((()=>{Me(),qe(),Kt(),dn(),Qr(),$r=Ae()(Be(Ke(Gt(e=>({queries:[],setQueries:t=>e(e=>{e.queries=P.dedupeObjectWithId(t.sort((e,t)=>P.getTimeStampByDate(t.createdAt)-P.getTimeStampByDate(e.createdAt)).sort((e,t)=>P.getTimeStampByDate(t.pinnedAt??0)-P.getTimeStampByDate(e.pinnedAt??0)))}),insertQuery:t=>e(e=>{let n=[t,...e.queries].sort((e,t)=>P.getTimeStampByDate(t.createdAt)-P.getTimeStampByDate(e.createdAt));e.queries=P.dedupeObjectWithId(n)}),deleteQueryById:t=>e(e=>{e.queries=e.queries.filter(e=>e.id!==t)}),updateQuery:t=>e(e=>{let n=e.queries.findIndex(e=>e.id===t.id);n!==-1&&(e.queries[n]={...e.queries[n],...t})}),toggleQueryPin:t=>e(e=>{let n=e.queries.find(e=>e.id===t);n&&(n.pinnedAt=n.pinnedAt?void 0:new Date().toISOString(),e.queries.sort((e,t)=>{let n=P.getTimeStampByDate(t.pinnedAt??0)-P.getTimeStampByDate(e.pinnedAt??0);return n===0?P.getTimeStampByDate(t.createdAt)-P.getTimeStampByDate(e.createdAt):n}))}),clearQueries:()=>e(e=>{e.queries=[]})})),{name:`query-store-cache`,storage:un.queries,partialize:e=>({queries:e.queries.slice(0,50)}),version:1}),{name:`query-store`}))}));function ti(e,t){let n=P.getMemoTimestamp(e),r=P.getMemoTimestamp(t);return n===r?t.id.localeCompare(e.id):r-n}function ni(){try{let e=localStorage.getItem(`memo-store-cache`);if(e){let t=JSON.parse(e)?.state?.memos||[];if(Array.isArray(t)&&t.length>0)return t.forEach(P.stampMemoTimestamps),console.log(`[MemoStore] Quick-loaded ${t.length} memos from cache`),t}}catch(e){console.debug(`[MemoStore] Failed to quick-load from cache:`,e)}return[]}var ri,F,ii=o((()=>{Me(),qe(),Kt(),dn(),Qr(),ri=ni(),F=Ae()(Ue(Be(Ke(Gt(e=>({memos:ri,commentMemos:[],tags:[],tagsNum:{},memosHash:ri.length>0?P.computeMemosHash(ri):``,preparingUpdateMemo:[],setMemos:t=>e(()=>{let e=[...t].sort(ti),n=P.dedupeObjectWithId(e);return{memos:n,memosHash:P.computeMemosHash(n)}}),insertMemo:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t.id);if(n>=0){let r=[...e.memos];return r[n]=t,{memos:r,memosHash:P.computeMemosHash(r)}}let r=P.getMemoTimestamp(t),i=e.memos.findIndex(e=>P.getMemoTimestamp(e)<r),a;return a=i===-1?[...e.memos,t]:i===0&&e.memos.length>0&&P.getMemoTimestamp(e.memos[0])<r?[t,...e.memos]:[...e.memos.slice(0,i),t,...e.memos.slice(i)],{memos:a,memosHash:P.computeMemosHash(a)}}),deleteMemoById:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t);if(n===-1)return e;let r=[...e.memos];return r.splice(n,1),{memos:r,memosHash:P.computeMemosHash(r)}}),deleteMemoBatch:t=>e(e=>{let n=new Set(t),r=e.memos.filter(e=>!n.has(e.id));return{memos:r,memosHash:P.computeMemosHash(r)}}),updateMemo:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t.id);if(n!==-1){let r=[...e.memos];return r[n]=t,r.sort(ti),{memos:r,memosHash:P.computeMemosHash(r)}}return e}),updateMemoBatch:(t,n)=>e(e=>{let r=new Map(t.map(e=>[e.id,e])),i=new Set(e.memos.map(e=>e.id)),a=e.memos.map(e=>e.path===n&&r.has(e.id)?r.get(e.id):e),o=t.filter(e=>!i.has(e.id)),s=[...a,...o].sort(ti);return{memos:s,memosHash:P.computeMemosHash(s)}}),archiveMemo:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t.id);if(n!==-1){let r=[...e.memos];return r[n]=t,{memos:r,memosHash:P.computeMemosHash(r)}}return e}),unarchiveMemo:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t.id);if(n!==-1){let r=[...e.memos];return r[n]=t,{memos:r,memosHash:P.computeMemosHash(r)}}return e}),archiveMemoBulk:t=>e(e=>{let n=new Map(t.map(e=>[e.id,e])),r=e.memos.map(e=>n.has(e.id)?n.get(e.id):e);return{memos:r,memosHash:P.computeMemosHash(r)}}),pinMemo:t=>e(e=>{let n=e.memos.findIndex(e=>e.id===t.id);if(n!==-1){let r=[...e.memos];return r[n]=t,{memos:r,memosHash:P.computeMemosHash(r)}}return e}),replaceMemoById:(t,n)=>e(e=>{let r=e.memos.findIndex(e=>e.id===t);if(r!==-1){let t=[...e.memos];return t[r]=n,{memos:t,memosHash:P.computeMemosHash(t)}}return e}),clearMemos:()=>e(()=>({memos:[],commentMemos:[],memosHash:``})),setMemosAndComments:(t,n)=>e(()=>{let e=[...t].sort(ti),r=[...n].sort((e,t)=>P.getMemoTimestamp(t)-P.getMemoTimestamp(e)),i=P.dedupeObjectWithId(e);return{memos:i,commentMemos:P.dedupeObjectWithId(r),memosHash:P.computeMemosHash(i)}}),setCommentMemos:t=>e(()=>{let e=[...t].sort((e,t)=>P.getMemoTimestamp(t)-P.getMemoTimestamp(e));return{commentMemos:P.dedupeObjectWithId(e)}}),insertCommentMemo:t=>e(e=>{let n=[t,...e.commentMemos].sort((e,t)=>P.getMemoTimestamp(t)-P.getMemoTimestamp(e));return{commentMemos:P.dedupeObjectWithId(n)}}),updateCommentMemo:t=>e(e=>{let n=e.commentMemos.findIndex(e=>e.id===t.id);if(n!==-1){let r=[...e.commentMemos];return r[n]=t,{commentMemos:r}}return e}),setTags:(t,n)=>e(e=>{e.tags=t,e.tagsNum=n}),setWaitingForTemplater:t=>e(e=>{e.preparingUpdateMemo.push(t)}),prepareUpdateThino:(t,n)=>e(e=>{e.preparingUpdateMemo=e.preparingUpdateMemo.filter(e=>e.id!==n);let r=e.memos.findIndex(e=>e.id===n);r!==-1&&(e.memos[r]=t)}),removePrepareUpdateThino:()=>e(e=>{e.preparingUpdateMemo=[]}),removeParticularPrepareUpdateThino:t=>e(e=>{e.preparingUpdateMemo=e.preparingUpdateMemo.filter(e=>e.id!==t)})})),{name:`memo-store-cache`,storage:un.memos,partialize:e=>{let t=e.memos.slice(0,200);try{let e={state:{memos:t.slice(0,100)},version:1,updatedAt:Date.now()};localStorage.setItem(`memo-store-cache`,JSON.stringify(e))}catch(e){console.debug(`[MemoStore] Failed to update quick cache:`,e)}return{memos:t,tags:e.tags,tagsNum:e.tagsNum}},version:1,migrate:(e,t)=>{if(t<1&&e.memos){let t=Array.isArray(e.memos)?e.memos:[];return{...e,memos:P.dedupeObjectWithId(t.filter(e=>e&&e.id))}}return e},merge:(e,t)=>{let n={...t,...e};return t.memos.length===0&&e?.memos?.length>0&&(n.memos=P.dedupeObjectWithId(e.memos)),t.tags.length>0&&(n.tags=t.tags,n.tagsNum=t.tagsNum),n}}),{name:`memo-store`})))}));function ai(){try{let e=localStorage.getItem(`memo-store-cache`);if(e){let t=JSON.parse(e)?.state?.memos||[];if(Array.isArray(t)&&t.length>0)return console.log(`[GlobalState] Found cached memos, setting loaded=true`),!0}}catch(e){console.debug(`[GlobalState] Failed to check cache for loaded state:`,e)}return!1}var oi,si,ci=o((()=>{Me(),qe(),Kt(),dn(),oi={markMemoId:``,editMemoId:``,commentMemoId:``,isMobileView:!1,showSiderbarInMobileView:!1,changedByMemos:!1,memoListView:`list`,globalEditorShown:!1,shouldSplitMemoWord:!0,shouldHideImageUrl:!0,shouldUseMarkdownParser:!0,useTinyUndoHistoryCache:!1,useVirtualScrolling:!0,manifest:null,refresh:!1,loaded:ai(),locked:!1,exited:!1,collapsedGroups:[],instances:{}},si=Ae()(Ue(Be(Ke(Gt((e,t)=>({...oi,setMarkMemoId:t=>e(e=>{e.markMemoId=t}),setEditMemoId:t=>e(e=>{e.editMemoId=t}),setCommentMemoId:t=>e(e=>{e.commentMemoId=t}),setGlobalEditorShown:t=>e(e=>{e.globalEditorShown=t}),clearEditorStates:()=>e(e=>{e.markMemoId=``,e.editMemoId=``,e.commentMemoId=``,e.globalEditorShown=!1}),setMobileView:t=>e(e=>{e.isMobileView=t}),setShowSidebarInMobileView:t=>e(e=>{e.showSiderbarInMobileView===t&&typeof t==`boolean`||(e.showSiderbarInMobileView=t)}),setMemoListView:t=>e(e=>{e.memoListView=t}),toggleSidebarInMobileView:()=>e(e=>{e.showSiderbarInMobileView=!e.showSiderbarInMobileView}),setAppSetting:t=>e(e=>{Object.assign(e,t)}),updateSetting:(t,n)=>e(e=>{e[t]=n}),setLoaded:t=>e(e=>{e.loaded=t}),setRefresh:t=>e(e=>{e.refresh=t}),setLocked:t=>e(e=>{e.locked=t}),setExited:t=>e(e=>{e.exited=t}),setChangedByMemos:t=>e(e=>{e.changedByMemos=t}),setManifest:t=>e(e=>{e.manifest=t}),toggleCollapsedGroup:t=>e(e=>{let n=e.collapsedGroups.indexOf(t);n>=0?e.collapsedGroups.splice(n,1):e.collapsedGroups.push(t)}),setCollapsedGroup:(t,n)=>e(e=>{let r=e.collapsedGroups.indexOf(t);n&&r<0?e.collapsedGroups.push(t):!n&&r>=0&&e.collapsedGroups.splice(r,1)}),setInstance:(t,n)=>e(e=>{e.instances[t]=n}),getInstance:e=>t().instances[e],removeInstance:t=>e(e=>{delete e.instances[t]}),clearInstances:()=>e(e=>{e.instances={}}),reset:()=>e(()=>({...oi,instances:{}}))})),{name:`global-state-store-cache`,storage:un.ui,partialize:e=>({shouldSplitMemoWord:e.shouldSplitMemoWord,shouldHideImageUrl:e.shouldHideImageUrl,shouldUseMarkdownParser:e.shouldUseMarkdownParser,useTinyUndoHistoryCache:e.useTinyUndoHistoryCache,useVirtualScrolling:e.useVirtualScrolling,memoListView:e.memoListView,isMobileView:e.isMobileView,showSiderbarInMobileView:e.showSiderbarInMobileView,collapsedGroups:e.collapsedGroups}),version:1}),{name:`global-state-store`})))})),li,ui,di,fi=o((()=>{Me(),qe(),Kt(),dn(),li={tag:``,duration:null,type:``,path:``,metadata:{},text:``,filter:``},ui={pathname:`/`,hash:``,query:li},di=Ae()(Ue(Be(Ke(Gt((e,t)=>({...ui,setLocation:t=>e(()=>t),setPathname:t=>e(e=>{e.pathname!==t&&(e.pathname=t)}),setHash:t=>e(e=>{e.hash!==t&&(e.hash=t)}),navigate:(t,n)=>e(e=>{e.pathname=t,n&&(e.query={...li,...n})}),reload:()=>e(()=>ui),setQuery:t=>e(e=>{e.query={...t}}),updateQuery:t=>e(e=>{e.query={...e.query,...t}}),setTagQuery:t=>e(e=>{e.query.tag!==t&&(e.query={...e.query,tag:t})}),setDurationQuery:t=>e(e=>{e.query={...e.query,duration:t}}),setPathQuery:t=>e(e=>{e.query.path!==t&&(e.query={...e.query,path:t})}),setTypeQuery:t=>e(e=>{e.query.type!==t&&(e.query={...e.query,type:t})}),setTextQuery:t=>e(e=>{e.query.text!==t&&(e.query={...e.query,text:t})}),setFilterQuery:t=>e(e=>{e.query.filter!==t&&(e.query={...e.query,filter:t})}),setMetadataQuery:(t,n)=>e(e=>{let r={...e.query.metadata||{}};r[t]=n,e.query={...e.query,metadata:r}}),clearQuery:()=>e(e=>{e.query={...li}}),buildUrl:()=>{let e=t(),n=new URLSearchParams;e.query.tag&&n.set(`tag`,e.query.tag),e.query.type&&n.set(`type`,e.query.type),e.query.text&&n.set(`text`,e.query.text),e.query.path&&n.set(`path`,e.query.path),e.query.filter&&n.set(`filter`,e.query.filter),e.query.duration&&(n.set(`from`,e.query.duration.from.toString()),n.set(`to`,e.query.duration.to.toString()));let r=n.toString();return`${e.pathname}${r?`?`+r:``}${e.hash?`#`+e.hash:``}`},parseUrl:t=>e(e=>{try{let n=new URL(t,`http://localhost`);e.pathname=n.pathname,e.hash=n.hash.slice(1);let r=n.searchParams;e.query={tag:r.get(`tag`)||``,type:r.get(`type`)||``,text:r.get(`text`)||``,path:r.get(`path`)||``,filter:r.get(`filter`)||``,duration:r.has(`from`)&&r.has(`to`)?{from:parseInt(r.get(`from`)),to:parseInt(r.get(`to`))}:null,metadata:{}}}catch(e){console.error(`Failed to parse URL:`,e)}})})),{name:`location-store-cache`,storage:un.ui,partialize:e=>({query:{tag:e.query.tag,type:e.query.type,text:e.query.text,path:e.query.path,filter:e.query.filter,duration:e.query.duration,metadata:{}}}),version:1}),{name:`location-store`})))})),pi,I,mi=o((()=>{Me(),qe(),Kt(),dn(),pi={dailyNotes:{},app:null,view:null,settings:null,editor:null,plugin:null,verifyState:{appId:``}},I=Ae()(Ue(Be(Ke(Gt((e,t)=>({...pi,setDailyNotes:t=>e(e=>{e.dailyNotes=t}),setApp:t=>e(e=>{e.app||=t}),setView:t=>e(e=>{(!t||!e.view||e.view?.leaf?.id!==t?.leaf?.id)&&(e.view=t)}),setSettings:t=>e(e=>{e.settings={...t}}),setEditor:t=>e(e=>{(!e.editor||e.editor!==t)&&(e.editor=t)}),setPlugin:t=>e(e=>{e.plugin||=t}),setVerifyState:t=>e(e=>{e.verifyState=t}),updateVerifyState:t=>e(e=>{Object.assign(e.verifyState,t)}),addDailyNote:(t,n)=>e(e=>{e.dailyNotes[t]=n}),removeDailyNote:t=>e(e=>{delete e.dailyNotes[t]}),getDailyNote:e=>t().dailyNotes[e],hasDailyNote:e=>e in t().dailyNotes,clearFiles:()=>e(e=>{e.dailyNotes={}}),clearView:()=>e(e=>{if(e.view){try{e.view.unload?.()}catch(e){console.error(`Error unloading view:`,e)}e.view=null}}),clearEditor:()=>e(e=>{e.editor=null}),reset:()=>e(()=>({...pi})),isInitialized:()=>{let e=t();return!!(e.app&&e.plugin&&e.settings)},getActiveFile:()=>{let e=t();return e.app?.workspace?e.app.workspace.getActiveFile():null}})),{name:`daily-notes-store-cache`,storage:un.ui,partialize:e=>({verifyState:e.verifyState}),version:1}),{name:`daily-notes-store`})))})),hi,gi,_i=o((()=>{Me(),qe(),hi={selectedIds:[]},gi=Ae()(Be(Ue((e,t)=>({...hi,toggleSelection:t=>{e(e=>{let n=e.selectedIds;return n.indexOf(t)>-1?{selectedIds:n.filter(e=>e!==t)}:{selectedIds:[...n,t]}})},selectMultiple:t=>{e(e=>{let n=new Set(e.selectedIds);return t.forEach(e=>n.add(e)),{selectedIds:Array.from(n)}})},addSelection:t=>{e(e=>e.selectedIds.includes(t)?e:{selectedIds:[...e.selectedIds,t]})},removeSelection:t=>{e(e=>({selectedIds:e.selectedIds.filter(e=>e!==t)}))},clearSelection:()=>{e({selectedIds:[]})},isSelected:e=>t().selectedIds.includes(e),getSelectedCount:()=>t().selectedIds.length,getSelectedIds:()=>t().selectedIds,setSelection:t=>{e({selectedIds:[...t]})}})),{name:`SelectionStore`}))})),vi=o((()=>{pn(),ei(),ii(),ci(),fi(),mi(),_i(),pn(),ei(),ii(),ci(),fi(),mi(),_i()})),yi,L,bi=o((()=>{vi(),Ce(),yi=class{initialized=!1;getState(){return I.getState()}setApp(e){return I.getState().setApp(e),e}setPlugin(e){return I.getState().setPlugin(e),e}setSettings(e){return I.getState().setSettings(e),this.initialized||=!0,e}setView(e){return I.getState().setView(e),e}setEditor(e){return I.getState().setEditor(e),e}async updateDailyNotes(e,t){let n=`day-${re(e,`day`).format(`YYYY-MM-DD`)}T00:00:00+08:00`;return t?I.getState().removeDailyNote(n):I.getState().addDailyNote(n,e),this.getState().dailyNotes}setVerifyState(e){return I.getState().setVerifyState(e),e}async fechLocalDailyNotes(){try{let e=ce();return I.getState().setDailyNotes(e),e}catch(e){console.error(e)}}},L=new yi})),xi,Si=o((()=>{(function(e){function t(e){let t={};for(let n of e)try{let e=localStorage.getItem(n);e!==null&&(t[n]=JSON.parse(e))}catch(e){console.error(`Get storage failed in `,n,e)}return t}e.get=t;function n(e){for(let t in e)try{let n=JSON.stringify(e[t]);localStorage.setItem(t,n)}catch(e){console.error(`Save storage failed in `,t,e)}}e.set=n;function r(e){for(let t of e)try{localStorage.removeItem(t)}catch(e){console.error(`Remove storage failed in `,t,e)}}e.remove=r;function i(){let e=document.createElement(`iframe`);e.style.display=`none`,document.body.appendChild(e),e.contentWindow?.localStorage.setItem(`t`,Date.now().toString()),e.remove()}e.emitStorageChangedEvent=i})(xi||={})})),Ci,R,wi=o((()=>{Si(),vi(),Ci=class{constructor(){let e=xi.get([`shouldSplitMemoWord`,`shouldHideImageUrl`,`shouldUseMarkdownParser`,`useTinyUndoHistoryCache`]),t={shouldSplitMemoWord:e.shouldSplitMemoWord||!0,shouldHideImageUrl:e.shouldHideImageUrl||!0,shouldUseMarkdownParser:e.shouldUseMarkdownParser||!0,useTinyUndoHistoryCache:e.useTinyUndoHistoryCache||!1};this.setAppSetting(t)}getState=()=>si.getState();setEditMemoId=e=>{si.getState().setEditMemoId(e)};setRefresh=e=>{si.getState().setRefresh(e)};setCommentMemoId=e=>{si.getState().setCommentMemoId(e)};setMarkMemoId=e=>{si.getState().setMarkMemoId(e)};setLoaded=e=>{si.getState().setLoaded(e)};setGlobalEditorShown=e=>{si.getState().setGlobalEditorShown(e)};setIsMobileView=e=>{si.getState().setMobileView(e)};setChangedByMemos=e=>{si.getState().setChangedByMemos(e)};setShowSiderbarInMobileView=e=>{si.getState().setShowSidebarInMobileView(e)};setAppSetting=e=>{si.getState().setAppSetting(e),xi.set(e)};setMemoListView=e=>{si.getState().setMemoListView(e)};setInstance=(e,t)=>{si.getState().setInstance(e,t)};setLocked=e=>{si.getState().setLocked(e)};setExitSteps=e=>{si.getState().setExited(e)};setPluginManifest=e=>{si.getState().setManifest(e)}},R=new Ci})),Ti,z,Ei=o((()=>{vi(),Ti=class{constructor(){this.updateStateWithLocation(),window.onpopstate=()=>{this.updateStateWithLocation()}}updateStateWithLocation=()=>{let{pathname:e,search:t,hash:n}=window.location,r=new URLSearchParams(t),i={pathname:`/`,hash:``,query:{tag:``,duration:null,text:``,type:``,filter:``,path:``,metadata:{}}};i.query.tag=r.get(`tag`)||``,i.query.type=r.get(`type`)??``,i.query.text=r.get(`text`)??``,i.query.filter=r.get(`filter`)??``;let a=parseInt(r.get(`from`)??`0`),o=parseInt(r.get(`to`)??`0`);o>a&&o!==0&&(i.query.duration={from:a,to:o}),i.hash=n,i.pathname=this.getValidPathname(e),di.getState().setLocation(i)};getState=()=>di.getState();clearQuery=()=>{di.getState().clearQuery()};setQuery=e=>{di.getState().setQuery(e)};reloadApp=()=>{di.getState().reload()};setHash=e=>{di.getState().setHash(e)};setPathname=e=>{di.getState().setPathname(e)};pushHistory=e=>{di.getState().setPathname(e)};replaceHistory=e=>{di.getState().setPathname(e)};setMemoTypeQuery=(e=``)=>{di.getState().setTypeQuery(e)};setMemoFilter=e=>{console.log(`ThinoDebug setMemoFilter`,{filterId:e}),di.getState().setFilterQuery(e)};setTextQuery=e=>{di.getState().setTextQuery(e)};setTimeQuery=e=>{di.getState().setDurationQuery(e)};setPathQuery=e=>{di.getState().setPathQuery(e)};setMetadataQuery=(e,t)=>{di.getState().setMetadataQuery(e,t)};setTagQuery=e=>{di.getState().setTagQuery(e)};setFromAndToQuery=(e,t)=>{di.getState().setDurationQuery({from:e,to:t})};getValidPathname=e=>[`/`,`/homeboard`,`/recycle`,`/setting`].includes(e)?e:`/`},z=new Ti})),Di,Oi,ki,Ai,ji,Mi=o((()=>{H(),Di=e=>`${e.vault.configDir}/query.json`,Oi=async(e,t)=>{try{return await e.vault.adapter.read(t),!0}catch(e){return console.error(e),!1}},ki=async e=>(await Oi(e,Di(e))||await ji(e),JSON.parse(await e.vault.adapter.read(Di(e))).queries||[]),Ai=async(e,t)=>{await e.vault.adapter.write(Di(e),JSON.stringify({queries:t},null,2))},ji=async e=>{let t=R.getState().manifest,n=e.plugins.getPlugin(t.id||`obsidian-memos`).settings,r=e.metadataCache.getFirstLinkpathDest(n.QueryFileName,``);if(!r)await e.vault.adapter.write(Di(e),JSON.stringify({queries:[]},null,2));else{let t=(await e.vault.read(r)).split(`
|
||
`);t.length===0&&await e.vault.adapter.write(Di(e),JSON.stringify({queries:[]},null,2));let n=[];for(let e=0;e<t.length;e++){let r=e,i=`未命名`,a=t[e],o=(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),s=`[]`,c=a.match(/^\d{14,16}/);c&&(o=(0,f.moment)(c[0].slice(0,14),`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:ss`));let l=a.match(/\[\{(.+)\}\]/);l&&(s=l[0]);let u=a.match(/\s(.+)\s\[\{/);u&&(i=u[0].slice(1,-3)),n.push({id:r,pinnedAt:``,createdAt:o,updatedAt:o,title:i,querystring:s,userId:`Memos`})}await e.vault.adapter.write(Di(e),JSON.stringify({queries:n},null,2))}}})),Ni,Pi=o((()=>{ur(),Mi(),Ni=async()=>{let{app:e}=lr.getState().dailyNotesState;return await Oi(e,Di(e))||await ji(e),await ki(e)||[]}})),Fi,Ii,Li=o((()=>{ur(),N(),Mi(),Fi=(e,t)=>({createdAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),id:e,pinnedAt:``,querystring:t,title:M(`Temp Filter`),updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),userId:`Thino`}),Ii=async(e,t)=>{let n=await ki(lr.getState().dailyNotesState.app)||[],r={createdAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),id:(0,f.moment)().format(`YYYYMMDDHHmmss`)+n.length,pinnedAt:``,querystring:t,title:e,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),userId:`Thino`};return n.push(r),await Ai(lr.getState().dailyNotesState.app,n),r}}));function Ri(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(typeof e!=`object`)return e===t;if(Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ri(e[n],t[n]))return!1;return!0}if(e.constructor!==t.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp)return e.toString()===t.toString();let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!r.includes(i)||!Ri(e[i],t[i]))return!1;return!0}function zi(e){return e==null?!0:typeof e==`string`||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:typeof e==`object`?Object.keys(e).length===0:!1}var Bi=o((()=>{}));function Vi(e){let t=e.match(/^#+/);return t?t[0].length:0}function Hi(e,t){let n=e.split(`
|
||
`),r=``,i=[],a=!1,o=1;for(let e=0;e<n.length;e++){let s=n[e];if(s.startsWith(`#`)&&/^#{1,6}\s/g.test(s)){if(a&&Vi(s)<=Vi(t))break;r=s,r===t?(a=!0,o=e+1):a&&Vi(s)>Vi(t)?i.push(s):(a=!1,i=[])}else a&&i.push(s)}return t?zi(i)?{content:``,startLine:-1}:{content:i.join(`
|
||
`),startLine:o}:{content:e,startLine:0}}function Ui(e){let t={};for(let n of e)n.parent&&n.parent>0&&(t[n.position.start.line]=n.parent);return t}function Wi(e,t,n){let r={},i=(e,t)=>{for(;e[t]!==void 0&&e[t]!==t;)t=e[t];return t},a=L.getState().app,o=n.split(`
|
||
`),s=t+o.length-1,c=a.metadataCache.getFileCache(e)?.listItems,l={};if(!c)return[];let u=e=>RegExp(`^(-|\\*|\\d\\.)\\s(\\[.\\]\\s)?(\\d{1,2}:\\d{2}(:\\d{2})?)(-\\d{1,2}:\\d{2}(:\\d{2})?)?\\s?`).test(e);return c.forEach(e=>{let n=e.position.start.line,a=e.position.end.line;if(n>=t&&a<=s){let s=n-t,c=a-t,d=o.slice(s,c+1),f=d.join(`
|
||
`);if(e.parent&&e.parent>0&&(r[e.position.start.line]=e.parent),e.parent&&l[e.parent]){if(n-e.parent===1){let t=o[s]?.match(/^(\s*)/);t&&(l[e.parent].indent=t[0])}let t=RegExp(`^`+l[e.parent].indent);l[e.parent].content+=`
|
||
`+f.split(`
|
||
`).map(e=>e?.replace(t,``)).join(`
|
||
`)}else if(e.parent&&l[i(r,e.parent)]){let t=RegExp(`^`+l[i(r,e.parent)].indent);l[i(r,e.parent)].content+=`
|
||
`+f.split(`
|
||
`).map(e=>e?.replace(t,``)).join(`
|
||
`)}else if(u(f)||new RegExp(Hr).test(f)){l[n]||(l[n]={content:``,blockId:``,indent:``});let t=d.length>1&&d[1]?.match(/^(\s*)/);t&&(l[n].indent=t[0]),l[n].content=f.split(`
|
||
`).map(e=>e?.replace(l[n].indent,``)).join(`
|
||
`),l[n].blockId=e.id}}}),Object.keys(l).map(e=>{let t=parseInt(e);return{line:l[t].content,blockId:l[t].blockId||``,index:t}})}async function Gi(e,t){let n=t.vault.getAbstractFileByPath(e);return n||(new f.Notice(M(`File not found for the given thino path, is creating a new file`)),n=await t.vault.create(e,`{"nodes": [], "edges": []}`),V.markPathPending(e),R.setChangedByMemos(!0)),n}async function Ki(e,t){let n;try{n=await t.vault.read(e)}catch(r){console.error(r),n=await t.vault.cachedRead(e)}let r=t.metadataCache.getFileCache(e)?.frontmatterPosition;return r?n.slice(r.end.offset+1):n}function qi(e){let t=e.split(/\r?\n/),n=[],r=!1,i=[],a=``;for(let e=0;e<t.length;e++){let o=t[e];o.startsWith(`> [!thino]`)?(r&&(n.push({metadata:a,content:i.join(`
|
||
`).trim()}),i=[]),r=!0,a=o.replace(`> [!thino]`,``).trim()):r&&o.startsWith(`>`)?i.push(o.replace(/^> /,``)):r&&!o.startsWith(`>`)&&(r=!1,n.push({metadata:a,content:i.join(`
|
||
`).trim()}),i=[],a=``)}return r&&n.push({metadata:a,content:i.join(`
|
||
`).trim()}),n}var Ji=o((()=>{Bi(),Wr(),H(),N()}));async function Yi(e,t={}){let{maxRetries:n=3,retryDelay:r=200,useExponentialBackoff:i=!0,forceReread:a=!1}=t;return Xi(e,0,n,r,i,a)}async function Xi(e,t,n,r,i,a){try{let{vault:t,metadataCache:n}=lr.getState().dailyNotesState.app;if(a)await t.read(e);else try{await t.cachedRead(e)}catch{await t.read(e)}n.getFileCache(e),await new Promise(e=>setTimeout(e,150));let r=n.getFileCache(e)?.listItems||[];return console.log(`🔄 File cache refreshed for ${e.path}, found ${r.length} list items`),!0}catch(o){if(console.warn(`Failed to refresh file cache for ${e.path} (attempt ${t+1}):`,o),t<n){let o=i?r*2**t:r;return await new Promise(e=>setTimeout(e,o)),Xi(e,t+1,n,r,i,a)}return!1}}async function Zi(e){try{let{metadataCache:t}=lr.getState().dailyNotesState.app,n=t.getFileCache(e),r=n?.listItems||[];return r.length===0&&await Yi(e)&&(n=t.getFileCache(e),r=n?.listItems||[]),r}catch(t){return console.error(`Failed to get list items for ${e.path}:`,t),[]}}var Qi=o((()=>{ur()}));async function $i(e,t,n,r){let i=n.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-]+)($|\s|\n)/g,``).trim(),a=ea(i),o=null,s=0;for(let n of e){if(!n.position)continue;let e=ta(i,t.slice(n.position.start.line,n.position.end.line+1).join(`
|
||
`).replace(/^- \d{2}:\d{2}\s*/,``).replace(/^- \[.\]\s*\d{2}:\d{2}\s*/,``).replace(/^- \[.\]\s*/,``).replace(/^- /,``).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-]+)($|\s|\n)/g,``).trim(),a);if(e===1)return console.log(`✅ Found memo by exact content match at line ${n.position.start.line}`),n;e>s&&e>.8&&(o=n,s=e)}return o&&s>.8?(console.log(`✅ Found memo by best content match (score: ${s.toFixed(2)}) at line ${o.position.start.line}`),o):(console.warn(`⚠️ Could not find memo by content for memo ${r.slice(-6)} (best score: ${s.toFixed(2)})`),null)}function ea(e){let t=e.split(/\s+/).filter(e=>e.length>3),n=[...new Set(t)].slice(0,5).join(` `);return`${e.substring(0,30)}|${e.length>30?e.substring(e.length-30):``}|${n}`}function ta(e,t,n){if(e===t)return 1;if(n===ea(t))return .95;let r=Math.min(e.length,t.length)/Math.max(e.length,t.length);if(r<.5)return 0;let i=new Set(e.toLowerCase().split(/\s+/)),a=new Set(t.toLowerCase().split(/\s+/)),o=new Set([...i].filter(e=>a.has(e))),s=new Set([...i,...a]),c=o.size/s.size,l=e.length>20&&t.includes(e.substring(0,Math.min(50,e.length)))?.3:0;return Math.max(c,l)*r}function na(e,t){let n=/%%(.*?)%%/,r=e.match(n);if(!r)return e;let i=r[1].trim(),a={};i.split(` `).forEach(e=>{let[t,n]=e.slice(1,-1).split(`::`);a[t]=n});for(let e of Object.keys(t))if(e!==`id`&&e!==`content`){if(e===`rowStatus`&&t.rowStatus===`ARCHIVED`){a.archived=`true`;continue}else if(e===`rowStatus`&&t.rowStatus===`NORMAL`){delete a.archived;continue}e===`deleted`&&t.deleted?a.deleted=(0,f.moment)().format(`YYYYMMDDHHmmss`):typeof t[e]==`boolean`?t[e]?a[e]=`true`:delete a[e]:t[e]&&(typeof t[e]==`string`||typeof t[e]==`boolean`)&&(a[e]=t[e])}let o=Object.entries(a).map(([e,t])=>`[${e}::${t}]`).join(` `);return e.replace(n,`%% ${o} %%`)}async function ra(e,t){if(!e.sourceType||e.sourceType!==`MULTI`)return e;let{vault:n,fileManager:r}=lr.getState().dailyNotesState.app,i=n.getAbstractFileByPath(e.path);if(!i)return e;let a=(0,f.moment)();if(console.log(t),V.markPathPending(i.path),await r.processFrontMatter(i,e=>{(t.pinned!==void 0||t.thinoType||t.rowStatus||t.visibility||t.deleted)&&R.setChangedByMemos(!0),t.id&&(e.id=t.id),t.thinoType&&(e.thinoType=t.thinoType),t.rowStatus&&(e.rowStatus=t.rowStatus),t.visibility&&(e.visibility=t.visibility),t.webId&&(e.webId=t.webId),t.pinned!==void 0&&(e.pinned=t.pinned),t.deleted!==void 0&&(e.deletedAt=t.deleted?a.format(`YYYY/MM/DD HH:mm:ss`):``),e.createdAt||=a.format(`YYYY/MM/DD HH:mm:ss`),e.updatedAt=a.format(`YYYY/MM/DD HH:mm:ss`)}),t.content){let r=await n.read(i),a=r,o=t.content.replace(/\$/g,`$$$$`);a=r.replace(e.content,o),await n.modify(i,a)}return R.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:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned===void 0?e.pinned:t.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 ia(e,t){if(!e.sourceType||e.sourceType!==`FILE`)return e;let{vault:n}=lr.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;let i=(0,f.moment)(),a=``;try{a=await n.read(r)}catch(e){console.error(e),a=await n.cachedRead(r)}let o=a.split(/\r?\n/),s=o.findIndex(t=>t.includes(`id::`+e.id)||t.includes(`Id::`+e.id)||e.webId&&t.includes(e.webId)),c=o[s];if(!c)return e;let l=na(c,t);if(console.log(t,l),!c)return e;let u=l+`
|
||
`,d=o.findIndex((e,t)=>t>s&&e.trim()===``),p=``;d===-1&&(p=o.slice(s+1).join(`
|
||
`)),d!==-1&&(p=o.slice(s+1,d).join(`
|
||
`));let m=p;t?.content&&(m=t.content.split(/\r?\n/).map(e=>`> `+e).join(`
|
||
`));let h=u+m,g=h.split(/\r?\n/);console.log(h,g,s),o.splice(s,d===-1?o.length-s:d-s,...g);let _=o.join(`
|
||
`);return V.markPathPending(r.path),R.setChangedByMemos(!0),await n.modify(r,_),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||i.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned===void 0?e.pinned:t.pinned,webId:t.webId||e.webId,deletedAt:t.deleted?i.format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt?e.deletedAt:``}}async function aa(e,t){if(!e.sourceType||e.sourceType!==`CANVAS`)return e;let{vault:n}=lr.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;let i=await n.read(r),a=JSON.parse(i),o=a.nodes.find(t=>t.id===e.id);if(!o)return e;t.content&&(o.text=t.content),t.thinoType&&(o.thinoType=t.thinoType),t.rowStatus&&(o.rowStatus=t.rowStatus),t.visibility&&(o.visibility=t.visibility),t.pinned!==void 0&&(o.pinned=t.pinned),t.webId&&(o.webId=t.webId);let s=(0,f.moment)();t.deleted!==void 0&&(o.deletedAt=t.deleted?s.format(`YYYY/MM/DD HH:mm:ss`):``),o.updatedAt=s.format(`YYYY/MM/DD HH:mm:ss`),V.markPathPending(r.path),R.setChangedByMemos(!0);let c=JSON.stringify(a,null,2);return await n.modify(r,c),{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),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?s.format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt?e.deletedAt:``}}function oa(e,t,n){let r=[];if(!t.find(t=>t.position.start.line===e))return r;let i=(n[e]||``).match(/^(\s*)/),a=i?i[1].length:0,o=e=>/^(\s*)- (\[.\] )?\d{2}:\d{2}/.test(e);for(let i of t){let s=i.position.start.line;if(s<=e)continue;let c=n[s]||``,l=c.match(/^(\s*)/),u=l?l[1].length:0;if(u>a){let i=!0;for(let r of t){let t=r.position.start.line;if(t>e&&t<s){let e=(n[t]||``).match(/^(\s*)/);if((e?e[1].length:0)<=a){i=!1;break}}}i&&r.push(s)}else if(u===a){if(o(c))break}else break}return r}async function sa(e,t){Oa()||new f.Notice(M(`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.`));let{vault:n,metadataCache:r}=lr.getState().dailyNotesState.app,i=lr.getState().dailyNotesState.app,{settings:a}=lr.getState().dailyNotesState,o=e.id.toString().slice(0,14),s=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).isSame((0,f.moment)(o,`YYYYMMDDHHmmss`))?(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`):(0,f.moment)(o,`YYYYMMDDHHmmss`),c=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).isSame(s,`day`),l=e.path,u=n.getAbstractFileByPath(l)||n.getAbstractFileByPath(e.path);if(!u)return new f.Notice(M(`Please check your daily note plugin OR periodic notes plugin settings`)),e;let d=(await n.read(u)).split(`
|
||
`),p=r.getFileCache(u),m=p?.listItems||[];if(m.length===0&&(console.log(`⚠️ No list items found for memo ${e.id.slice(-6)}, attempting to refresh file cache...`),await Yi(u)&&(p=r.getFileCache(u),m=p?.listItems||[],m.length>0&&console.log(`✅ File cache refresh successful, found ${m.length} list items`)),m.length===0)){console.warn(`⚠️ No list items found for memo ${e.id.slice(-6)} even after cache refresh. This might be a newly created memo.`);let n={...e,content:t.content||e.content,thinoType:t.thinoType||e.thinoType,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),pinned:t.pinned===void 0?e.pinned:t.pinned,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,webId:t.webId||e.webId,deletedAt:t.deleted?(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt||``};return console.warn(`Returning updated memo without file modification for memo ${e.id.slice(-6)}`),n}let h=parseInt(e.id.slice(14)),g=h;Ui(m);let _=m.find(e=>e.position.start.line===h);if(!_&&e.content&&(console.log(`🔍 Memo not found at original line ${h}, searching by content...`),_=await $i(m,d,e.content,e.id)),!_&&e.hasId&&(console.log(`🔍 Searching by block ID: ${e.hasId}`),_=m.find(t=>t.position?d.slice(t.position.start.line,t.position.end.line+1).join(`
|
||
`).includes(`^${e.hasId}`):!1)),!_){console.warn(`⚠️ List item not found after all search strategies for memo ${e.id.slice(-6)}. Original line: ${h}. This might indicate a line number mismatch.`);let n={...e,content:t.content||e.content,thinoType:t.thinoType||e.thinoType,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),pinned:t.pinned===void 0?e.pinned:t.pinned,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,webId:t.webId||e.webId,deletedAt:t.deleted?(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt||``};return console.warn(`Returning updated memo without file modification for memo ${e.id.slice(-6)}`),n}let v=_.position.start.line;v!==h&&console.log(`📍 Memo location corrected: ${h} → ${v} for memo ${e.id.slice(-6)}`),g=v+e.content.split(`
|
||
`).length,g>=d.length&&(g=d.length-1);let y=m.find(e=>{let t=e.position.start.line;if(t<=v)return!1;let n=d[t]||``;return/^(\s*)- (\[.\] )?\d{2}:\d{2}/.test(n)});y&&g>=y.position.start.line&&(console.warn(`⚠️ Limiting endLine to prevent including next memo. Original: ${g}, Limited: ${y.position.start.line-1}`),g=y.position.start.line-1);let b=d.slice(v,g+1),x=b.join(`
|
||
`),S=x;console.log(`Original content:`,x);let C=i.vault.getConfig(`useTab`)===void 0||app.vault.getConfig(`useTab`)===!0,w=C?1:i.vault.getConfig(`tabSize`),T=(C?` `:` `).repeat(w),E=x.match(/\s\^([0-9a-zA-Z-]+)($|\s|\n)/),D=t.hasId===void 0?E?E[1]:e.hasId||null:t.hasId,O=ya(b[0]||``),k;k=O.fullTimeMatch?O.fullTimeMatch:c?(0,f.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 A=k;!O.fullTimeMatch&&a.DefaultTimePrefix!==`HH:mm`&&(A=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(a.DefaultTimePrefix));let j={pinned:x.includes(`[pinned::true]`),deleted:x.match(/\[deleted::([^\]]+)\]/)?.[1]||``,archived:x.includes(`[archived::true]`),webId:x.match(/\[webId::([^\]]+)\]/)?.[1]||``,visibility:x.match(/\[visibility::"([^"]+)"\]/)?.[1]||``};if(x.match(/^(- \[.\] |- |(\*|\d{1,2}\.) )/)?.[0],t.content){let n=t.thinoType?t.thinoType===`TASK-TODO`?`- [ ] `:t.thinoType===`TASK-DONE`?`- [x] `:t.thinoType.startsWith(`TASK`)?`- [${t.thinoType.slice(5)}] `:`- `:e.thinoType===`TASK-TODO`?`- [ ] `:e.thinoType===`TASK-DONE`?`- [x] `:e.thinoType.startsWith(`TASK`)?`- [${e.thinoType.slice(5)}] `:`- `,r=[];if((t.pinned===void 0?j.pinned:t.pinned)&&r.push(`[pinned::true]`),t.deleted||t.deleted!==!1&&j.deleted){let e=t.deleted?(0,f.moment)().format(`YYYYMMDDHHmmss`):j.deleted;r.push(`[deleted::${e}]`)}(t.rowStatus===`ARCHIVED`||t.rowStatus!==`NORMAL`&&j.archived)&&r.push(`[archived::true]`),(t.webId===void 0?j.webId:t.webId)&&r.push(`[webId::${t.webId===void 0?j.webId:t.webId}]`),(t.visibility||j.visibility)&&r.push(`[visibility::"${t.visibility||j.visibility}"]`);let i=D?`^${D}`:``,a=t.content.trim().split(`
|
||
`).length>1;/^((-|\*|\d\.|>)\s|```)/g.test(t.content);let o=t.content.trim().split(`
|
||
`);if(/(^(-|\*|\d\.|>)\s)/g.test(o[o.length-1]),a){let e=o.map(e=>T+e),t=!1;for(let n=e.length-1;n>=0;n--)if(!/(^(-|\*|\d\.|>)\s)/g.test(e[n].trim())){e[n]=e[n]+(D?` ${i}`:``),t=!0;break}!t&&D&&(e[e.length-1]+=` ${i}`),S=`${n}${A}\n${e.join(`
|
||
`)} ${r.join(` `)}`.trim()}else S=`${n}${A} ${t.content.trim()} ${r.join(` `)}`.trim()+(i?` ${i}`:``)}else{if(t.thinoType){let e=t.thinoType===`TASK-TODO`?`- [ ] `:t.thinoType===`TASK-DONE`?`- [x] `:t.thinoType.startsWith(`TASK`)?`- [${t.thinoType.slice(5)}] `:`- `;S=S.replace(/^((- \[.\] )|((-|\*) ))/,e)}if(t.rowStatus&&(t.rowStatus===`ARCHIVED`?S.includes(`[archived::`)?S=S.replace(/\[archived::(true|false)\]/,`[archived::true]`):S+=(S.endsWith(` `)?``:` `)+`[archived::true]`:t.rowStatus===`NORMAL`&&(S=S.replace(/\s?\[archived::(true|false)\]/,``))),t.visibility){let e=`[visibility::"${t.visibility}"]`;S.includes(`[visibility::`)?S=S.replace(/\[visibility::"(PUBLIC|PROTECTED)"\]/,e):S+=(S.endsWith(` `)?``:` `)+e}if(t.pinned!==void 0&&(t.pinned?S.includes(`[pinned::`)?S=S.replace(/\[pinned::(true|false)\]/,`[pinned::true]`):S+=(S.endsWith(` `)?``:` `)+`[pinned::true]`:S=S.replace(/\s?\[pinned::(true|false)\]/,``)),t.webId!==void 0&&(S.includes(`[webId::`)?S=t.webId===``?S.replace(/\s?\[webId::([^\]]+)\]/,``):S.replace(/\[webId::([^\]]+)\]/,`[webId::${t.webId}]`):t.webId!==``&&(S+=(S.endsWith(` `)?``:` `)+`[webId::${t.webId}]`)),t.deleted!==void 0){let e=(0,f.moment)();if(t.deleted){let t=`[deleted::${e.format(`YYYYMMDDHHmmss`)}]`;S.includes(`[deleted::`)?S=S.replace(/\[deleted::([^\]]+)\]/,t):S+=(S.endsWith(` `)?``:` `)+t}else S=S.replace(/\s?\[deleted::([^\]]+)\]/,``)}if(t.hasId!==void 0||D){let e=t.hasId===void 0?D:t.hasId;S=S.replace(/\s\^([0-9a-zA-Z-]+)($|\s|\n)/g,``),e&&(S=S.trimEnd(),S+=` ^${e}`)}}if(S!==x){let r=g-v+1,i=S.trim().split(`
|
||
`);r>10&&i.length<r/2&&console.warn(`⚠️ Safety check: Replacing ${r} lines with ${i.length} lines for memo ${e.id.slice(-6)}. This might indicate content mixing.`);let a=(x.match(/^- \d{2}:\d{2}/gm)||[]).length;if(a>1){console.warn(`⚠️ Safety check: Original content contains ${a} memo-like structures. Limiting replacement to single memo.`);let e=x.match(/^- \d{2}:\d{2}.*$/m);if(e){let t=x.indexOf(e[0]),n=x.substring(t+e[0].length).match(/^- \d{2}:\d{2}/m);if(n){let r=v+x.substring(0,t+e[0].length+x.substring(t+e[0].length).indexOf(n[0])).split(`
|
||
`).length-1;g=Math.min(g,r-1),console.log(`📍 Limited endLine to ${g} to prevent including next memo`)}}}let o=g-v+1;d.splice(v,o,S.trim()),V.markPathPending(u.path),R.setChangedByMemos(!0),await n.modify(u,d.join(`
|
||
`)),console.log(`memo`,e,t.deleted);let s=(0,f.moment)();return{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),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,hasId:t.hasId??e.hasId,deletedAt:t.deleted?s.format(`YYYY/MM/DD HH:mm:ss`):t.deleted===!1?``:e.deletedAt?e.deletedAt:``}}return e}async function ca(e,t,n){let{vault:r,metadataCache:i}=lr.getState().dailyNotesState.app||window.app,a=r.getFileByPath(e);if(!a)return;let o=i.getFileCache(a)?.listItems||[];Ui(o);let s=[],c=r.getConfig(`useTab`)===void 0||app.vault.getConfig(`useTab`)===!0,l=c?1:r.getConfig(`tabSize`),u=(c?` `:` `).repeat(l);function d(e,t){let n=[];for(let r in t)t[r]===e&&n.push(parseInt(r),...d(parseInt(r),t));return n}let p=(0,f.moment)(),m=(await r.read(a)).split(`
|
||
`);return t.map(e=>{let t=parseInt(e.id.slice(14)),n=o.find(e=>e.position.start.line===t);if(!n&&e.content&&(console.log(`🔍 Bulk update: Memo not found at original line ${t}, searching by content...`),n=o.find(t=>{if(!t.position)return!1;let n=m.slice(t.position.start.line,t.position.end.line+1).join(`
|
||
`).replace(/^- \d{2}:\d{2}\s*/,``).replace(/^- \[.\]\s*\d{2}:\d{2}\s*/,``).replace(/^- \[.\]\s*/,``).replace(/^- /,``).trim(),r=e.content.trim();return n.includes(r.substring(0,50))})),!n)return console.warn(`⚠️ Bulk update: Could not find memo ${e.id.slice(-6)} at line ${t}`),null;let r=n.position.start.line,i=oa(r,o,m).map(e=>{let t=o.find(t=>t.position.start.line===e);return t?t.position.end.line:-1}),a=Math.max(...i,n.position.end.line),s=o.find(e=>e.position.start.line>r&&(!e.parent||e.parent<=0));return s&&a>=s.position.start.line&&(console.warn(`⚠️ Bulk update: Limiting endLine to prevent including next block. Original: ${a}, Limited: ${s.position.start.line-1}`),a=s.position.start.line-1),{id:e.id,start:r,end:a}}).filter(Boolean).forEach(e=>{let r=m.slice(e.start,e.end+1).join(`
|
||
`),i=r.split(`
|
||
`),a=i[i.length-1].trim(),o=r,c=/\[(pinned|archived|deleted|webId|visibility)::[^\]]*\]\s*$/.test(a),l=(e,t)=>e.split(`
|
||
`).length>1&&(/```/g.test(a)||!c)?e+`
|
||
`+u+t:e+(e.endsWith(` `)?``:` `)+t;if(n===`delete`){let e=`[deleted::`+p.format(`YYYYMMDDHHmmss`)+`]`;o=o.replace(/\[deleted::([^\]]+)\]/,``),o=l(o,e)}if(n===`restoreFromDelete`&&(o=o.replace(/ ?\[deleted::([^\]]+)\]/,``)),n===`archive`){let e=`[archived::true]`;o=o.includes(`[archived::`)?o.replace(/\[archived::(true|false)\]/,e):l(o,e)}n===`restoreFromArchive`&&(o=o.replace(/ ?\[archived::(true|false)\]/,``)),n===`deleteForever`?m.splice(e.start,e.end-e.start+1):m.splice(e.start,e.end-e.start+1,o),s.push({...t.find(t=>t.id===e.id),deletedAt:n===`delete`?p.format(`YYYY/MM/DD HH:mm:ss`):``,rowStatus:n===`archive`?`ARCHIVED`:`NORMAL`})}),V.markPathPending(a.path),R.setChangedByMemos(!0),await r.modify(a,m.join(`
|
||
`)),s}async function la(e,t){return!e.sourceType||e.sourceType!==`JOURNAL`?e:{...await sa({...e,sourceType:`DAILY`},t),sourceType:`JOURNAL`}}var ua,da,fa=o((()=>{ur(),N(),H(),Aa(),Ji(),Qi(),ua=e=>{switch(e?.sourceType){case`CANVAS`:return aa(e,{id:e.id,pinned:!0});case`DAILY`:return sa(e,{id:e.id,pinned:!0});case`MULTI`:return ra(e,{id:e.id,pinned:!0});case`FILE`:return ia(e,{id:e.id,pinned:!0});case`JOURNAL`:return la(e,{id:e.id,pinned:!0})}},da=e=>{switch(e?.sourceType){case`CANVAS`:return aa(e,{id:e.id,pinned:!1});case`DAILY`:return sa(e,{id:e.id,pinned:!1});case`MULTI`:return ra(e,{id:e.id,pinned:!1});case`FILE`:return ia(e,{id:e.id,pinned:!1});case`JOURNAL`:return la(e,{id:e.id,pinned:!1})}}}));async function pa(e,t){if(!t)return 0;let{vault:n}=lr.getState().dailyNotesState.app,r=e?.DefaultMemoComposition,i=e?.ProcessEntriesBelow&&e?.ProcessContentTarget!==`whole`?e?.ProcessEntriesBelow:``,a=e?.ProcessContentTarget===`whole`?``:e?.DifferentInsertTarget?e?.InsertAfterForTask?e?.InsertAfterForTask:``:i,o;try{o=await n.read(t)}catch(e){console.error(e),o=await n.cachedRead(t)}let s;s=r!=``&&/{TIME}/g.test(r)&&/{CONTENT}/g.test(r)?`(-|\\*) (\\[(.{1})\\]\\s)?`+r.replace(/{TIME}/g,`((\\<time\\>)?\\d{1,2}:\\d{2}(\\:\\d{2})?)?`).replace(/ {CONTENT}/g,``):`(-|\\*) (\\[(.{1})\\]\\s)?((\\<time\\>)?\\d{1,2}\\:\\d{2}(\\:\\d{2})?)?`;let c=new RegExp(s,`g`),l=(o.match(c)||[]).length,u=new RegExp(i.replace(/([.?*+^$[\]\\(){}|-])/g,`\\$1`),`g`),d=new RegExp(a.replace(/([.?*+^$[\]\\(){}|-])/g,`\\$1`),`g`),f=(o.match(u)||[]).length,p=(o.match(d)||[]).length;return o=null,f||p?l:0}function ma(e,t,n,r,i){let a=lr.getState().dailyNotesState.app||window.app,o=re(i,`day`)||(0,f.moment)(i.stat.ctime),s=Wi(i,n,t),c=a?.metadataCache.getFileCache(i),l={frontmatter:c?.frontmatter||{},tags:c?.frontmatter?.tags||[]};for(let t of s){ha(o,t,e);let{rawText:n,memoType:a}=ga(t),{content:s,pinned:c,archived:u,deleted:d,deletedAtStr:p,webId:m,visibility:h}=_a(n,t),g=va(s);r.push({id:o.format(`YYYYMMDDHHmmss`)+`${t.index}`,content:s.trim(),createdAt:o.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:o.format(`YYYY/MM/DD HH:mm:ss`),createdAtTs:o.valueOf(),updatedAtTs:o.valueOf(),thinoType:a,hasId:t.blockId?t.blockId:``,linkId:g,path:i.path,deletedAt:d?(0,f.moment)(p,`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:SS`):``,rowStatus:u?`ARCHIVED`:`NORMAL`,visibility:h,pinned:c,creatorName:`Thino`,resourceList:[],sourceType:`DAILY`,webId:m,fileInfo:l})}}function ha(e,t,n){let r=ya(t.line);if(r.startHour&&r.startMin)e.hours(parseInt(r.startHour)),e.minutes(parseInt(r.startMin)),r.startSec?e.seconds(parseInt(r.startSec)):e.seconds(0);else{let r=wa(n.DefaultMemoComposition,t.line),i=Ta(n.DefaultMemoComposition,t.line),a=Ea(t.line);e.hours(parseInt(r)),e.minutes(parseInt(i)),a?e.seconds(parseInt(a)):e.seconds(0)}}function ga(e){let t=ba(e.line),n;if(/^\s*[-*]\s(\[(.)\])\s/g.test(e.line)){let r=Da(e.line);t=xa(e.line),n=Ca(r)}else n=`JOURNAL`;return{rawText:t,memoType:n}}function _a(e,t){if(!e)return{content:``,pinned:!1,archived:!1,deleted:!1,deletedAtStr:``,webId:``,visibility:`PRIVATE`};let n=e.trim().replaceAll(/<br>/g,`
|
||
`),r=new RegExp(/\[(pinned|PINNED)::true\]/,`g`).test(e),i=new RegExp(/\[(archived|ARCHIVED)::true\]/,`g`).test(e),a=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,`g`).test(e),o=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,`g`).exec(e)?.[2],s=new RegExp(/\[(webId|WEBID)::([^\]]*)\]/,`g`).exec(e)?.[2],c=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,`g`).test(e)?`PUBLIC`:`PRIVATE`;return n=n.replace(/\s?\[pinned::[^\]]+\]/g,``).replace(/\s?\[visibility::[^\]]+\]/g,``).replace(/\s?\[archived::[^\]]+\]/g,``).replace(/\s?\[deleted::[^\]]+\]/g,``).replace(/\s?\[webId::[^\]]+\]/g,``),t.blockId&&(n=n.replace(`^`+t.blockId,``)),{content:n,pinned:r,archived:i,deleted:a,deletedAtStr:o,webId:s,visibility:c}}function va(e){let t=[],n=/(?:\[\[([^\]|]+)#\^([a-zA-Z0-9-]+)(?:\|[^\]]+)?\]\])|(?:\[.+?\]\(([^)]+)#\^([a-zA-Z0-9-]+)\))/g,r;for(;(r=n.exec(e))!==null;)r[1]&&r[2]?t.push(`${r[1]}#^${r[2]}`):r[3]&&r[4]&&t.push(`${r[3]}#^${r[4]}`);return t}function ya(e){let t=/^\s*(-|\*|\d+\.)\s+(\[.\]\s+)?((\d{1,2}):(\d{2})(:(\d{2}))?)-(\d{1,2}):(\d{2})(:(\d{2}))?/,n=/^\s*(-|\*|\d+\.)\s+(\[.\]\s+)?(\d{1,2}):(\d{2})(:(\d{2}))?/,r=e.match(t);if(r){let e=r[0].replace(/^\s*(-|\*|\d+\.)\s+(\[.\]\s+)?/,``);return{startHour:r[4],startMin:r[5],startSec:r[7],endHour:r[8],endMin:r[9],endSec:r[11],fullTimeMatch:e}}let i=e.match(n);if(i){let e=i[0].replace(/^\s*(-|\*|\d+\.)\s+(\[.\]\s+)?/,``);return{startHour:i[3],startMin:i[4],startSec:i[6],fullTimeMatch:e}}return{startHour:``,startMin:``,fullTimeMatch:``}}function ba(e){let t=ya(e);return t.fullTimeMatch?e.replace(RegExp(`^(-|\\*|\\d\\.) (${t.fullTimeMatch})\\s(.*)`),`$3`):e.replace(/^(-|\*|\d\.) (\d{1,2}:\d{2}(:\d{2})?)\s(.*)/g,`$4`)}function xa(e){return ka(e)}async function Sa(e,t=!1){let n=lr.getState().dailyNotesState.app,r=n.vault.getFileByPath(e.path);if(r&&e.hasId)return t?`!`+n.fileManager.generateMarkdownLink(r,``,`#^`+e.hasId,e.id):e.hasId?n.fileManager.generateMarkdownLink(r,``,`#^`+e.hasId,e.id):`[@THINO](${e.id})`;let i=P.randomId(6);return await sa(e,{id:e.id,hasId:i}),r?t?`!`+n.fileManager.generateMarkdownLink(r,``,`#^`+i,e.id):n.fileManager.generateMarkdownLink(r,``,`#^`+i,e.id):`[@THINO](${e.id})`}var Ca,wa,Ta,Ea,Da,Oa,ka,Aa=o((()=>{ur(),Ce(),N(),Ji(),Qr(),fa(),Ca=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},wa=(e,t)=>{let n=ya(t);if(n.startHour)return n.startHour;let r;return r=e!=``&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?`^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?`+e.replace(/{TIME}/g,`(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?`).replace(/{CONTENT}/g,`(.*)`):`^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)`,new RegExp(r,``).exec(t)?.[6]},Ta=(e,t)=>{let n=ya(t);if(n.startMin)return n.startMin;let r;return r=e!=``&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?`^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?`+e.replace(/{TIME}/g,`(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?`).replace(/{CONTENT}/g,`(.*)`):`^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)`,new RegExp(r,``).exec(t)?.[7]},Ea=e=>{let t=ya(e);return t.startSec?t.startSec:RegExp(`^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\d{1,2})\\:(\\d{2})\\:(\\d{2})(.*)`,``).exec(e)?.[7]},Da=e=>/^\s*[\-\*]\s(\[(.{1})\])\s(.*)/.exec(e)?.[2],Oa=()=>k()?!0:(new f.Notice(M(`Check if you opened Daily Notes Plugin Or Periodic Notes Plugin`)),!1),ka=e=>{let t=ya(e);return t.fullTimeMatch?RegExp(`^(-|\\*|\\d\\.)\\s+\\[.\\]\\s(${t.fullTimeMatch})\\s([\\w\\W]*)`).exec(e)?.[3]:RegExp(`^(-|\\*|\\d\\.)\\s+\\[.\\]\\s(\\d{1,2}:\\d{2}(:\\d{2})?)\\s([\\w\\W]*)`,``).exec(e)?.[4]}}));function ja(){let e=window;return e.__THINO_PERF__||={records:{}},e.__THINO_PERF__}var Ma,Na,Pa=o((()=>{Ma=()=>typeof performance<`u`?performance.now():Date.now(),Na={start(e){try{let t=ja();t.records[e]={label:e,start:Ma()}}catch{console.log(`Do nothing`)}},end(e,t){try{let n=ja().records[e];if(!n)return;n.end=Ma(),n.duration=n.end-n.start,console.log(`[THINO][PERF] ${e}: ${n.duration.toFixed(1)}ms`,t||``)}catch{console.log(`Do nothing`)}},mark(e){this.start(e),this.end(e)},getAll(){try{return{...ja().records}}catch{return{}}}}}));async function Fa(e,t){if(!e)return t;let n=lr.getState().dailyNotesState.app||window.app;if(!await n.vault.adapter.exists(e.path))return console.log(`ThinoDebug getMemosFromFiles: file no longer exists`,e.path),t;let r=lr.getState().dailyNotesState.settings,i=await Ki(e,n),a=r.IgnoreFolderForMultiType;if(new Set(a.filter(e=>e!==``)).has(e.parent?.path))return t;let o=(0,f.moment)(e.stat.ctime).format(`YYYY/MM/DD HH:mm:ss`),s=n?.metadataCache.getFileCache(e),c={frontmatter:s?.frontmatter||{},tags:s?.frontmatter?.tags||[]};await n.fileManager.processFrontMatter(e,n=>{if(n.id||=P.randomId(16),n.createdAt?o=(0,f.moment)(n.createdAt,`YYYY/MM/DD HH:mm:ss`).isValid()?n.createdAt:o:n.createdAt=o,!i.trim())return t;let r=!!n.pinned,a=n.rowStatus&&n.rowStatus===`ARCHIVED`,s=!!n.deletedAt,l=n.deletedAt?n.deletedAt:``,u=n.visibility?n.visibility:`PRIVATE`,d=n.thinoType?n.thinoType:`JOURNAL`,p=n.webId?n.webId:``,m=n.id?n.id:``,h=n.hasId?n.hasId:``,g=n.linkId?n.linkId:``,_=e.path,v={id:m,content:i,createdAt:o,updatedAt:o,deletedAt:s?(0,f.moment)(l,`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:SS`):``,pinned:r,rowStatus:a?`ARCHIVED`:`NORMAL`,visibility:u,thinoType:d,hasId:h,linkId:g,path:_,creatorName:`Memo`,sourceType:`MULTI`,resourceList:[],webId:p,fileInfo:c};return P.stampMemoTimestamps(v),t.push(v),t})}async function Ia(e,t){if(!e)return t;if(!await(lr.getState().dailyNotesState.app||window.app).vault.adapter.exists(e.path))return console.log(`ThinoDebug getMemosFromSingleFile: file no longer exists`,e.path),t;let{vault:n,metadataCache:r}=lr.getState().dailyNotesState.app||window.app,i;try{i=await n.read(e)}catch(n){return console.log(`ThinoDebug getMemosFromSingleFile: file read failed, likely deleted`,e.path,n),t}if(!i)return;let a=(0,f.moment)(e.stat.ctime).format(`YYYY/MM/DD HH:mm:ss`),o=(0,f.moment)(e.stat.mtime).format(`YYYY/MM/DD HH:mm:ss`),s=e.path,c=[],l=[],u=r.getFileCache(e),d={frontmatter:u?.frontmatter||{},tags:u?.frontmatter?.tags||[]},p=qi(i);for(let e of p){let n=e.metadata.match(/\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}/g);if(!n)continue;let r=e.metadata.match(/id::([^\]]*)/g)?.[0]?.replace(`id::`,``);if(!r)continue;let i=n?n[0]:a,u=n?n[0]:o,p=e.metadata.match(/webId::([^\]]*)/g)?e.metadata.match(/webId::([^\]]*)/g)?.[0]?.replace(`webId::`,``):``,m=e.metadata.contains(`[pinned::true]`),h=e.metadata.contains(`[archived::true]`),g=e.metadata.contains(`[deleted::`),_=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,`g`).exec(e.metadata)?.[2],v=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,`g`).test(e.metadata)?`PUBLIC`:`PRIVATE`,y=new RegExp(/\[(thinoType|THINOTYPE)::([^\]]*)\]/,`g`).exec(e.metadata)?.[2],b={id:r,content:e.content,createdAt:i,updatedAt:u,deletedAt:g?(0,f.moment)(_,`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:SS`):``,pinned:m,rowStatus:h?`ARCHIVED`:`NORMAL`,visibility:v,thinoType:y||`JOURNAL`,hasId:``,linkId:c,path:s,creatorName:`Thino`,sourceType:`FILE`,resourceList:l,webId:p,fileInfo:d};P.stampMemoTimestamps(b),t.push(b)}return t}async function La(e,t){if(!e)return[];let n=lr.getState().dailyNotesState.app||window.app;if(!await n.vault.adapter.exists(e.path))return console.log(`ThinoDebug getMemosFromDailyNote: file no longer exists`,e.path),t;let r=lr.getState().dailyNotesState.settings,{vault:i}=n;if(await pa(r,e)===0)return;let a;try{a=await i.read(e)}catch(n){return console.log(`ThinoDebug getMemosFromDailyNote: file read failed, likely deleted`,e.path,n),t}let{content:o,startLine:s}=Hi(a,r?.ProcessContentTarget===`whole`?``:r.ProcessEntriesBelow),c=``,l=0;if(r.DifferentInsertTarget&&r?.ProcessContentTarget!==`whole`&&r.InsertAfterForTask&&!o.includes(r.InsertAfterForTask)){let{content:e,startLine:t}=Hi(a,r.InsertAfterForTask);c=e,l=t}let u=[];ma(r,o,s,u,e),r.DifferentInsertTarget&&c&&ma(r,c,l,u,e),u.length!==0&&t.push(...u.sort((e,t)=>e.createdAt>t.createdAt?-1:1))}async function Ra(e,t){let n=lr.getState().dailyNotesState.app||window.app;if(!(e instanceof f.TFile))return;if(!await n.vault.adapter.exists(e.path))return console.log(`ThinoDebug getMemosFromCanvas: file no longer exists`,e.path),t;let r;try{r=await n.vault.read(e)}catch(t){console.error(t),r=await n.vault.cachedRead(e)}if(!r)return;let i=JSON.parse(r)?.nodes;for(let n of i){if(n.type===`group`||n.createdAt===void 0||n.text.trim()===``)continue;let r=(0,f.moment)(n?.createdAt,`YYYYMMDDHHmmss`),i=(0,f.moment)(n?.updatedAt,`YYYYMMDDHHmmss`),a=r.format(`YYYY/MM/DD HH:mm:SS`),o=i.format(`YYYY/MM/DD HH:mm:SS`),s=n?.deletedAt?(0,f.moment)(n?.deletedAt,`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:SS`):``,c=!!n?.pinned,l=n?.archived?`ARCHIVED`:`NORMAL`,u=n?.visibility?n?.visibility:`PRIVATE`,d=n?.thinoType?n?.thinoType:`JOURNAL`,p=n?.text?n?.text:``,m=n?.id?n?.id:``,h=n?.hasId?n?.hasId:``,g=n?.linkId?n?.linkId:``,_=e.path,v=[],y=n?.webId?n?.webId:void 0;t.push({id:m,content:p,createdAt:a,updatedAt:o,createdAtTs:r.valueOf(),updatedAtTs:i.valueOf(),deletedAt:s,pinned:c,rowStatus:l,visibility:u,thinoType:d,hasId:h,linkId:g,path:_,creatorName:`Memo`,sourceType:`CANVAS`,resourceList:v,webId:y,fileInfo:{frontmatter:{},tags:[]}})}}async function za(e=[]){let t=[],n=[],r=lr.getState().dailyNotesState.app||app,{vault:i}=r,{settings:a}=lr.getState().dailyNotesState,o=r.loadLocalStorage(`tokenForSync`),s=async(e,n)=>{for(let r of e)try{await n(r,t,a)}catch(e){console.error(e),new f.Notice(e)}};try{if(e.includes(`CANVAS`)){let e=Ba(i),n=t.length;Na.start(`startup:getMemos:CANVAS`),await s(e,Ra),Na.end(`startup:getMemos:CANVAS`,{files:e.length,memosAdded:t.length-n})}}catch(e){console.error(e)}try{if(e.includes(`MULTI`)){let e=Va(i,r,a),n=t.length;Na.start(`startup:getMemos:MULTI`),await s(e,Fa),Na.end(`startup:getMemos:MULTI`,{files:e.length,memosAdded:t.length-n})}}catch(e){console.error(e)}try{if(e.includes(`DAILY`)){let e=await Ha(i),n=t.length;Na.start(`startup:getMemos:DAILY`),await s(e,La),Na.end(`startup:getMemos:DAILY`,{files:e.length,memosAdded:t.length-n})}}catch(e){console.error(e)}try{if(e.includes(`FILE`)||o){let e=Ua(i,r,a),n=t.length;Na.start(`startup:getMemos:FILE`),await s(e,Ia),Na.end(`startup:getMemos:FILE`,{files:e.length,memosAdded:t.length-n})}}catch(e){console.error(e)}try{if(e.includes(`JOURNAL`)){let e=Wa(i,a),n=t.length;Na.start(`startup:getMemos:JOURNAL`),await s(e,Ga),Na.end(`startup:getMemos:JOURNAL`,{files:e.length,memosAdded:t.length-n})}}catch(e){console.error(e)}return{memos:t,commentMemos:n}}function Ba(e){return e.getAllLoadedFiles().filter(e=>e instanceof f.TFile&&e.extension===`canvas`&&e.name.includes(`.thino`))}function Va(e,t,n){let r=e.getMarkdownFiles(),i=r.filter(e=>e.parent?.path.includes(n.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim())&&!e.path?.endsWith(`thino.md`)),a=n.TagForMultiTypeFiles?r.filter(e=>!(e.parent?.path.includes(n.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim())&&!e.path?.endsWith(`thino.md`))&&(0,f.getAllTags)(t.metadataCache.getFileCache(e))?.contains(`#`+n.TagForMultiTypeFiles.replace(`#`,``))):[];return console.log(`MULTI FILES`,i,a),[...i,...a]}async function Ha(e){let t=Kr();t===void 0&&new f.Notice(M(`Please check your daily note plugin OR periodic notes plugin settings`)+`folder path is empty or undefined`),e.getAbstractFileByPath((0,f.normalizePath)(t))||new f.Notice(M(`Failed to find daily notes folder`));let n=ce();return Object.values(n).filter(e=>e instanceof f.TFile&&e.extension===`md`)}function Ua(e,t,n){let r=e.getMarkdownFiles(),i=r.filter(e=>e.name.trim().includes(`thino`)),a=n.TagForFileTypeFiles?r.filter(e=>!e.name.trim().includes(`thino`)&&(0,f.getAllTags)(t.metadataCache.getFileCache(e))?.contains(`#`+n.TagForFileTypeFiles.replace(`#`,``))):[];return[...i,...a]}function Wa(e,t){let{getAllPeriodicNotes:n,setThinoPeriodicSettings:r}=(Ce(),d(y)),i=t?.JournalSettings?.granularity||`day`,a=t?.JournalSettings;if(a?.useIndependentSettings){let e={day:a.daily,week:a.weekly,month:a.monthly,year:a.yearly}[i];e&&(e.folder||e.format||e.template)&&r(i,e)}try{let e=n(i);return Object.values(e).filter(e=>e instanceof f.TFile)}catch(e){return console.error(`Failed to get journal files:`,e),[]}}async function Ga(e,t){if(!e||!await(lr.getState().dailyNotesState.app||window.app).vault.adapter.exists(e.path))return t;let n=lr.getState().dailyNotesState.settings;return(n?.JournalSettings?.granularity||`day`)===`day`?Ka(e,t,n):qa(e,t,n)}async function Ka(e,t,n){let r=[];await La(e,r);for(let e of r)e.sourceType=`JOURNAL`,t.push(e);return t}async function qa(e,t,n){let{vault:r,metadataCache:i}=lr.getState().dailyNotesState.app||window.app,a;try{a=await r.read(e)}catch{return t}if(!a)return t;let o=i.getFileCache(e),s={frontmatter:o?.frontmatter||{},tags:o?.frontmatter?.tags||[]},c=a.split(/\r?\n/),l=[];for(let e=0;e<c.length;e++){let t=c[e].match(/^##\s+(.+)$/);t&&(l.length>0&&(l[l.length-1].endLine=e-1),l.push({heading:t[1].trim(),startLine:e,endLine:c.length-1}))}let u=/^(\d{1,2}):(\d{2})(?::(\d{2}))?(?:\s|$)/,d=n?.JournalSettings?.headingDateFormat||`YYYY-MM-DD`;for(let n of l){let r=(0,f.moment)(n.heading,d,!1);if(!r.isValid()){let e=n.heading.match(/(\d{4})[/-](\d{1,2})[/-](\d{1,2})/);e&&(r=(0,f.moment)(`${e[1]}-${e[2]}-${e[3]}`,`YYYY-M-D`,!0))}if(!(!r||!r.isValid()))for(let i=n.startLine+1;i<=n.endLine;i++){let a=c[i];if(!a)continue;let o=a.match(/^(\s*)(-|\*|\d+\.)\s+(\[(.)\]\s+)?(.*)/);if(!o||o[1].length>0)continue;let l=o[4],d=o[5]||``,p=r.clone(),m=d,h=d.match(u);h&&(p.hours(parseInt(h[1])).minutes(parseInt(h[2])),h[3]&&p.seconds(parseInt(h[3])),m=d.slice(h[0].length));let g=m,_=``,v=0;for(let e=i+1;e<=n.endLine;e++){let t=c[e];if(t&&/^(-|\*|\d+\.)\s/.test(t)||t&&/^##\s/.test(t))break;if(!t||t.trim()===``){v++;continue}if(!_){let e=t.match(/^(\s+)/);_=e?e[0]:``}for(let e=0;e<v;e++)g+=`
|
||
`;v=0;let n=_?t.replace(RegExp(`^`+_),``):t;g+=`
|
||
`+n}let y=/\[(pinned|PINNED)::true\]/.test(g),b=/\[(archived|ARCHIVED)::true\]/.test(g),x=/\[(deleted|DELETED)::([^\]]*)\]/.test(g),S=/\[(deleted|DELETED)::([^\]]*)\]/.exec(g)?.[2],C=/\[(webId|WEBID)::([^\]]*)\]/.exec(g)?.[2],w=/\[(id|ID)::([^\]]*)\]/.exec(g)?.[2],T=/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/.test(g)?`PUBLIC`:`PRIVATE`,E=g.replace(/\s?\[pinned::[^\]]+\]/g,``).replace(/\s?\[visibility::[^\]]+\]/g,``).replace(/\s?\[archived::[^\]]+\]/g,``).replace(/\s?\[deleted::[^\]]+\]/g,``).replace(/\s?\[webId::[^\]]+\]/g,``).replace(/\s?\[id::[^\]]+\]/g,``).trim(),D=`JOURNAL`;l!==void 0&&(D=l===` `?`TASK-TODO`:l===`x`?`TASK-DONE`:`TASK-${l}`);let O={id:w||p.format(`YYYYMMDDHHmmss`)+`${i}`,content:E,createdAt:p.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:p.format(`YYYY/MM/DD HH:mm:ss`),createdAtTs:p.valueOf(),updatedAtTs:p.valueOf(),deletedAt:x?(0,f.moment)(S,`YYYYMMDDHHmmss`).format(`YYYY/MM/DD HH:mm:SS`):``,thinoType:D,hasId:``,linkId:[],path:e.path,pinned:y,rowStatus:b?`ARCHIVED`:`NORMAL`,visibility:T,creatorName:`Thino`,resourceList:[],sourceType:`JOURNAL`,webId:C,fileInfo:s};P.stampMemoTimestamps(O),t.push(O)}}return t}var Ja=o((()=>{Ce(),ur(),N(),Qr(),Ji(),Aa(),Pa()})),Ya,Xa=o((()=>{ur(),Mi(),Ya=async(e,t,n)=>{let r=await ki(lr.getState().dailyNotesState.app)||[],i=r.find(t=>t.id===e),a={...i,title:t,querystring:n},o=r.findIndex(t=>t.id===e);return r[o]=a,await Ai(lr.getState().dailyNotesState.app,r),[i]}}));function Za(e){return e.substring(e.lastIndexOf(`.`)+1)}function Qa(e){return{id:e.id,createdAt:Date.now().toString(),filename:e.id,type:`${Za(e.id)}`,size:e.size.toString()}}function $a(e){let t=e?.matchAll(fo);return t?Array.from(t).map(e=>Qa({url:e.groups?.link,id:uo,size:0,mtime:``})).filter(e=>e.type!=`html`):[]}function eo(e){return{id:e.id,createdAt:(0,f.moment)(e.ctime.toString(),`x`).format(`YYYY/MM/DD HH:mm:ss`),updatedAt:(0,f.moment)(e.mtime.toString(),`x`).format(`YYYY/MM/DD HH:mm:ss`),deletedAt:e.ttime?.toString()?(0,f.moment)(e.ttime.toString(),`x`).format(`YYYY-MM-DD HH:mm:ss`):``,rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,resourceList:$a(e.content),creatorName:`thino`,sourceType:e?.thinoType||`FILE`,visibility:`PUBLIC`,localId:e.originalId,deleted:!!e.dtime,thinoType:e?.thinoStatus||`JOURNAL`}}function to(){return(lr.getState().dailyNotesState.app||app)?.loadLocalStorage(`tokenForSync`)||``}async function no(e){return(0,f.requestUrl)({url:`${lo}/thino/getThinos${e?`?since=${e}&includeDeleted=true`:``}`,method:`GET`,headers:{Authorization:`Bearer ${to()}`}}).then(e=>{e.status>=400&&console.error(`Failed to fetch memos: ${e.status}`);try{return e.json.payload.map(e=>eo(e))}catch(e){console.error(`Error processing memo response: ${e}`)}}).catch(e=>(console.error(e),[]))}async function ro(e){return(0,f.requestUrl)({url:`${lo}/thino/createThino`,method:`POST`,contentType:`application/json`,body:JSON.stringify({content:e.content,thinoType:e?.thinoType||`FILE`,thinoStatus:e?.thinoStatus||`JOURNAL`,pinned:!1,rowStatus:`NORMAL`,encrypted:!1}),headers:{Authorization:`Bearer ${to()}`}}).then(e=>{e.status>=400&&console.error(`Failed to create memo: ${e.status}`);try{let t=e.json;return eo(t.payload)}catch(e){console.error(`Error processing memo creation response: ${e}`)}}).catch(e=>(console.error(e),null))}function io(e){return{id:e.id,ctime:(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).valueOf(),mtime:(0,f.moment)(e.updatedAt,`YYYY/MM/DD HH:mm:ss`).valueOf(),ttime:e.deletedAt?(0,f.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`,thinoStatus:e.thinoType,tags:[]}}async function ao(e){let t=`${lo}/thino/createThinosByData`,n=e.map(e=>io(e));return(0,f.requestUrl)({url:t,method:`POST`,contentType:`application/json`,body:JSON.stringify(n),headers:{Authorization:`Bearer ${to()}`}}).then(e=>{e.status>=400&&console.error(`Failed to create thinos: ${e.status}`);try{return e.json.payload.map(e=>eo(e))}catch(e){console.error(`Error processing thinos creation response: ${e}`)}}).catch(e=>(console.error(e),[]))}async function oo(e){return(0,f.requestUrl)({url:`${lo}/thino/updateThinoById/${e.id}`,method:`POST`,contentType:`application/json`,body:JSON.stringify(e),headers:{Authorization:`Bearer ${to()}`}}).then(e=>{e.status>=400&&console.error(`Failed to update memo: ${e.status}`);try{let t=e.json;return eo(t.payload)}catch(e){console.error(`Error processing memo update response: ${e}`)}}).catch(e=>(console.error(e),null))}async function so(e){return(0,f.requestUrl)({url:`${lo}/thino/recoverThinoFromTrash/${e}`,method:`POST`,headers:{Authorization:`Bearer ${to()}`}}).then(e=>{e.status>=400&&console.error(`Failed to recover memo: ${e.status}`);try{let t=e.json;return eo(t.payload)}catch(e){console.error(`Error processing memo recovery response: ${e}`)}}).catch(e=>(console.error(e),null))}async function co(e){return(0,f.requestUrl)({url:`${lo}/thino/deleteThinoById/${e}`,method:`DELETE`,headers:{Authorization:`Bearer ${to()}`}}).then(e=>{e.status>=400&&console.error(`Failed to delete memo: ${e.status}`)}).catch(e=>(console.error(e),null))}var lo,uo,fo,po=o((()=>{ur(),lo=`https://api.thino.pkmer.cn/test`,uo=`unknown`,fo=/!\[(?<content>[^\]]+)\]\((?<link>[^)]+)\)/g}));function mo(){return(Rg(),d(Fg)).default}var ho,go,_o=o((()=>{bi(),po(),ho=class{_pollingInterval=null;_pollingActive=!1;isSyncEnabled(){let e=L.getState().settings;return!!(L.getState().app?.loadLocalStorage(`tokenForSync`)&&e?.startSync)}getToken(){return L.getState().app?.loadLocalStorage(`tokenForSync`)||``}getLastUpdatedTime(){let e=L.getState().app;try{return e?.loadLocalStorage?.(`thinoLastUpdated`)||(0,f.moment)(`2000-01-01 00:01:00`,`YYYY-MM-DD HH:mm:ss`).format(`x`)}catch(e){return console.error(e),(0,f.moment)().format(`x`)}}setLastUpdatedTime(){let e=L.getState().app;try{e?.saveLocalStorage?.(`thinoLastUpdated`,(0,f.moment)().format(`x`))}catch(e){console.error(e)}}resetLastUpdatedTime(){let e=L.getState().app;try{e?.saveLocalStorage?.(`thinoLastUpdated`,(0,f.moment)(`2000-01-01 00:01:00`,`YYYY-MM-DD HH:mm:ss`).format(`x`))}catch(e){console.error(e)}}async pullFromWeb(e){if(!this.isSyncEnabled())return;let t=await no(e);if(!t||t.length===0)return;t.sort((e,t)=>(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).isAfter((0,f.moment)(t.createdAt,`YYYY/MM/DD HH:mm:ss`))?1:-1);let n=mo(),r=t.filter(e=>!e.deleted),i=t.filter(e=>e.deleted);for(let e of r){let t=await n.createOrPatchThinoFromWeb(e);t&&n.pushMemo(t)}for(let e of i){let t=n.getMemoByWebId(e.id);t&&await n.deleteMemoById(t.id,`local`)}n.updateTagsState(),this.setLastUpdatedTime()}async pushToWeb(){if(!this.isSyncEnabled())return;let e=mo(),t=await ao(e.getState().memos.filter(e=>!e.webId));for(let n of t)await e.createOrPatchThinoFromWeb(n)}async syncCreate(e,t,n){if(!this.isSyncEnabled())return null;try{return await ro({content:e,thinoType:t===`DAILY`||t===`JOURNAL`?`DAILY`:`FILE`,thinoStatus:n?`JOURNAL`:`TASK-TODO`})}catch(e){return console.error(e),null}}async syncCreateForWebId(e,t){if(!this.isSyncEnabled())return``;try{return(await ro({content:e,thinoType:`DAILY`,thinoStatus:t?`JOURNAL`:`TASK-TODO`}))?.id||``}catch(e){return console.error(e),``}}async syncEdit(e){if(this.isSyncEnabled()&&e?.webId)try{oo({id:e.webId,content:e.content,rowStatus:e.rowStatus,pinned:e.pinned,ttime:e.deletedAt?(0,f.moment)(e.deletedAt,`YYYY/MM/DD HH:mm:ss`).valueOf():0,thinoType:e.sourceType===`DAILY`||e.sourceType===`JOURNAL`?`DAILY`:`FILE`,thinoStatus:e.thinoType===`JOURNAL`?`JOURNAL`:e.thinoType===`TASK-TODO`?`TASK-TODO`:`TASK-DONE`})}catch(e){console.error(e)}}async syncDelete(e){if(this.isSyncEnabled()&&e)try{await co(e)}catch(e){console.error(e)}}async syncPin(e,t){if(!this.isSyncEnabled()||!e)return null;try{return await oo({id:e,pinned:t})}catch(e){return console.error(e),null}}async syncRecover(e){if(this.isSyncEnabled()&&e)try{await so(e)}catch(e){console.error(e)}}startPolling(e){if(this._pollingActive||!this.isSyncEnabled()||L.getState().settings?.SyncManually)return;let t=this.getLastUpdatedTime();this.pullFromWeb(t),this._pollingInterval=window.setInterval(async()=>{console.log(`syncing...`);let e=this.getLastUpdatedTime();await this.pullFromWeb(e)},3e4),e.registerInterval(this._pollingInterval),this._pollingActive=!0}stopPolling(){this._pollingInterval!==null&&(window.clearInterval(this._pollingInterval),this._pollingInterval=null),this._pollingActive=!1}},go=new ho}));function vo(e){return e?.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`)||e}function yo(e,t){return e&&e.replace(/\{\{TIME\|(.*?)\}\}/g,(e,n)=>{try{return t.format(n)}catch(t){return console.error(`Invalid time format:`,n,t),e}})}function bo(e){let t=[],n=e;for(;n.contains(`
|
||
`);){let e=n.indexOf(`
|
||
`);t.push(n.slice(0,e)),n=n.slice(e+1)}return t.push(n),t}async function xo({content:e,isList:t,name:n}){let r=lr.getState().dailyNotesState.settings,i=(0,f.moment)(),a=P.randomId(16),o=r?.MemoOtherSaveLocation.MemoDefaultMultiFilePath||`Thino`,s=`${o}/${n||`${i.format(`YYYYMMDD`)}-${a}`}.md`,c={id:a,content:e,deletedAt:``,path:s,createdAt:i.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:i.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`,fileInfo:{tags:[],frontmatter:{}}},l=L.getState().app||window.app,{vault:u,fileManager:d}=l,p=u.getAbstractFileByPath(o);(!p||!(p instanceof f.TFolder))&&(new f.Notice(M(`Folder not found for the given thino path, is creating a new folder`)),await u.createFolder(o)),R.setChangedByMemos(!0),V.markPathPending(s);let m,h=l.vault.getFileByPath(s);if(h){let t=`${o}/${i.format(`YYYYMMDD`)}-${a}.md`;V.markPathPending(t),m=await u.create(t,e)}else m=await u.create(s,e);await d.processFrontMatter(m,e=>{e.id=a,e.createdAt=i.format(`YYYY/MM/DD HH:mm:ss`),e.updatedAt=i.format(`YYYY/MM/DD HH:mm:ss`),e.thinoType=t?`JOURNAL`:`TASK-TODO`}),(!n||h)&&r?.SetFileNameAfterCreate&&l.fileManager.promptForFileRename(m);let g=l.metadataCache.getFileCache(m),_={tags:g?.frontmatter?.tags||[],frontmatter:g?.frontmatter||{}};return{...c,fileInfo:_}}async function So({content:e,isList:t}){let n=lr.getState().dailyNotesState.settings,r=(0,f.moment)(),i=P.randomId(16),a=n?.MemoOtherSaveLocation.MemoDefaultSingleFilePath||`basic.thino.md`,o={id:i,content:e,deletedAt:``,path:a,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`,fileInfo:{tags:[],frontmatter:{}}},s=L.getState().app,{vault:c}=s,l=c.getAbstractFileByPath(a);(!l||!(l instanceof f.TFile))&&(new f.Notice(M(`File not found for the given thino path, is creating a new file`)),l=await c.create(a,``));let u=s.metadataCache.getFileCache(l),d={tags:u?.frontmatter?.tags||[],frontmatter:u?.frontmatter||{}},p=``;try{p=await c.read(l)||await c.cachedRead(l)}catch(e){console.error(e),new f.Notice(M(`Failed to read current daily note, check if it exists.`))}let m=p.indexOf(`# ${r.format(`YYYY-MM-DD`)}`),h=p.indexOf(`
|
||
#`,m+1);h===-1&&(h=p.length);let g=`\n${`> [!thino] ${r.format(`YYYY/MM/DD HH:mm:ss`)} %% [id::${i}] [thinoType::${t?`JOURNAL`:`TASK-TODO`}] %%`}\n> ${e.replace(/\n/g,`
|
||
> `)}\n`,_;if(m===-1){let e=`# ${r.format(`YYYY-MM-DD`)}`;_=`${p.substring(0,h)}\n${e}${g}\n${p.substring(h)}`}else _=`${p.substring(0,h)}${g}${p.substring(h)}`;return setTimeout(async()=>{R.setChangedByMemos(!0),V.markPathPending(l.path),await c.modify(l,_)},200),{...o,fileInfo:d}}async function Co(e){let t=lr.getState().dailyNotesState.settings,n=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`),r=e.id,i=t?.MemoOtherSaveLocation.MemoDefaultSingleFilePath||`basic.thino.md`,a={id:r,content:e.content,deletedAt:e.deletedAt||``,path:i,createdAt:n.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:n.format(`YYYY/MM/DD HH:mm:ss`),thinoType:e.thinoType||`JOURNAL`,hasId:``,linkId:[],pinned:e.pinned,visibility:`PUBLIC`,rowStatus:e.rowStatus||`NORMAL`,creatorName:`Thino`,resourceList:[],sourceType:`FILE`,webId:e.id,fileInfo:e?.fileInfo},o=L.getState().app,{vault:s}=o,c=s.getAbstractFileByPath(i);(!c||!(c instanceof f.TFile))&&(new f.Notice(M(`File not found for the given thino path, is creating a new file`)),c=await s.create(i,``));let l=``;try{l=await s.read(c)||await s.cachedRead(c)}catch(e){console.error(e),new f.Notice(M(`Failed to read current daily note, check if it exists.`))}let u=o.metadataCache.getFileCache(c),d={tags:u?.frontmatter?.tags||[],frontmatter:u?.frontmatter||{}},p=l.indexOf(`# ${n.format(`YYYY-MM-DD`)}`),m=l.indexOf(`
|
||
#`,p+1);m===-1&&(m=l.length);let h=`\n${`> [!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}]`:``} %%`}\n> ${e.content.replace(/\n/g,`
|
||
> `)}\n`,g;if(p===-1){let e=`# ${n.format(`YYYY-MM-DD`)}`;g=`${l.substring(0,m)}\n${e}${h}\n${l.substring(m)}`}else g=`${l.substring(0,m)}${h}${l.substring(m)}`;return R.setChangedByMemos(!0),V.markPathPending(c.path),await s.modify(c,g),{...a,fileInfo:d}}async function wo({content:e,isList:t}){let n=lr.getState().dailyNotesState.settings?.MemoOtherSaveLocation.MemoDefaultCanvasPath||`basic.thino.canvas`,r=(0,f.moment)(),i=P.randomId(16),a={id:i,content:e,deletedAt:``,path:n,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:`CANVAS`,fileInfo:{tags:[],frontmatter:{}}},o=L.getState().app,{vault:s}=o,c=await Gi(n,o);if(!c||!(c instanceof f.TFile)){new f.Notice(M(`File not found for the given thino path, is creating a new file`));return}let l=await s.read(c),u=JSON.parse(l);if(u.nodes.find(e=>e.id===a.id))return;let d;u.nodes.length>0&&(d=[...u.nodes].reduce((e,t)=>{if(!e.createdAt)return t;let n=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`),r=(0,f.moment)(t.createdAt,`YYYY/MM/DD HH:mm:ss`);return n.isAfter(r)?e:t}));let p=d?{x:d.x,y:d.y+100,width:d.width,height:d.height}:{x:0,y:0,width:200,height:100};u.nodes.push({...p,type:`text`,id:i,text:e,deletedAt:``,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:[]}),R.setChangedByMemos(!0),V.markPathPending(c.path);let m=JSON.stringify(u,null,2);return await s.modify(c,m),a}async function To(e,t,n,r){let{vault:i}=lr.getState().dailyNotesState.app||window.app,a=lr.getState().dailyNotesState.app||window.app,o=lr.getState().dailyNotesState.settings,s=a.vault.getConfig(`useTab`)===void 0||window.app.vault.getConfig(`useTab`)===!0,c=s?1:a.vault.getConfig(`tabSize`),l=(s?` `:` `).repeat(c),u=e.split(`
|
||
`).join(`
|
||
`+l),d=n||(0,f.moment)(),{DifferentInsertTarget:p,InsertAfterForTask:m,InsertType:h}=o,g=d.format(o.DefaultTimePrefix||`HH:mm`),_=``,v=``;o.UseMemoFixedStrings&&(_=yo(o.MemoFixedPrefix||``,d),v=yo(o.MemoFixedSuffix||``,d));let y=h===`end`?``:t?o.InsertAfter:p&&m||o.InsertAfter,b=``;!r&&e&&(b=await go.syncCreateForWebId(e,t));let x=_?_+(_.endsWith(` `)?``:` `)+u:u,S=v?x+(x.endsWith(` `)?``:` `)+v:x,C=t?`- `:`- [ ] `,w=o?.DefaultMemoComposition?`${C}${o?.DefaultMemoComposition?.replace(/{TIME}/g,g).replace(/{CONTENT}/g,(S.split(`
|
||
`).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(S)?`
|
||
`+l:``)+S)}${S.split(`
|
||
`).length>1&&/((-|\*|\d\.|>)\s|```)/g.test(S.split(`
|
||
`)[S.split(`
|
||
`).length-1])&&b?`
|
||
`+l:` `}${b?`[webId::${b}]`:``}`:`${C}${g} ${S.split(`
|
||
`).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(S)?`
|
||
`+l:``}${S}${S.split(`
|
||
`).length>1&&/((-|\*|\d\.|>)\s|```)/g.test(S.split(`
|
||
`)[S.split(`
|
||
`).length-1])&&b?`
|
||
`+l:` `}${b?`[webId::${b}]`:``}`,T=ue(d,ce()),E=performance.now(),D=`fake`+P.randomId(16),O=!1,k=a.plugins.getPlugin(`templater-obsidian`),A;if(T?(A=T,console.log(`[Thino:Perf] daily note exists +${(performance.now()-E).toFixed(1)}ms`)):(k?.templater&&k?.settings.trigger_on_file_creation&&(V.setWaitingForTemplater({origin:e,date:d,isList:t,id:D,type:b?`web`:`local`}),O=!0),R.setChangedByMemos(!0),A=await P.createDailyNoteCheck(d),V.markPathPending(A.path),console.log(`[Thino:Perf] daily note created +${(performance.now()-E).toFixed(1)}ms`)),!A){new f.Notice(M(`Failed to create daily note, check if it exists.`));return}if(T||(await L.fechLocalDailyNotes(),console.log(`[Thino:Perf] fechLocalDailyNotes done +${(performance.now()-E).toFixed(1)}ms`)),k&&k?.templater&&k?.settings.trigger_on_file_creation&&O)return R.setChangedByMemos(!0),{id:D,content:S,deletedAt:``,createdAt:d.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:d.format(`YYYY/MM/DD HH:mm:ss`),thinoType:t?`JOURNAL`:`TASK-TODO`,path:A.path,hasId:``,linkId:[],webId:b,pinned:!1,visibility:`PUBLIC`,rowStatus:`NORMAL`,creatorName:`Thino`,resourceList:[],sourceType:`DAILY`,fileInfo:{tags:[],frontmatter:{}}};let j=``;try{j=await i.read(A)||await i.cachedRead(A)}catch(e){console.error(e),new f.Notice(M(`Failed to read current daily note, check if it exists.`))}let ee=a.metadataCache.getFileCache(A),te={tags:ee?.frontmatter?.tags||[],frontmatter:ee?.frontmatter||{}},ne=await Do(y,w,j);console.log(`[Thino:Perf] insertAfterHandler done +${(performance.now()-E).toFixed(1)}ms`),await i.modify(A,ne.content),console.log(`[Thino:Perf] vault.modify done +${(performance.now()-E).toFixed(1)}ms`);let re=ne.posNum===-1?No(ne.content).length-(w.split(`
|
||
`).length-1)-1:ne.posNum+1;return R.setChangedByMemos(!0),console.log(`[Thino:Perf] createMemoInDailyNote return +${(performance.now()-E).toFixed(1)}ms`),{id:d.format(`YYYYMMDDHHmm`)+`00`+re,content:S,deletedAt:``,createdAt:d.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:d.format(`YYYY/MM/DD HH:mm:ss`),thinoType:t?`JOURNAL`:`TASK-TODO`,path:A.path,hasId:``,linkId:[],webId:b,pinned:!1,visibility:`PUBLIC`,rowStatus:`NORMAL`,creatorName:`Thino`,resourceList:[],sourceType:`DAILY`,fileInfo:te}}async function Eo(e){let{vault:t}=lr.getState().dailyNotesState.app||window.app,n=lr.getState().dailyNotesState.app||window.app,{DefaultMemoComposition:r,InsertAfter:i,DefaultTimePrefix:a,DifferentInsertTarget:o,InsertAfterForTask:s,InsertType:c,UseMemoFixedStrings:l,MemoFixedPrefix:u,MemoFixedSuffix:d}=lr.getState().dailyNotesState.settings,p=(e.pinned?` [pinned::true]`:``)+(e.rowStatus===`ARCHIVED`?` [archived::true]`:``)+(e.visibility===`PRIVATE`?` [visibility::"PRIVATE"]`:``);if(e.id){let t=` [webId::`+e.id+`]`;p+=t}let m=(0,f.moment)();if(e.deletedAt){let e=` [deleted::`+m.format(`YYYYMMDDHHmmss`)+`]`;p+=e}let h=n.vault.getConfig(`useTab`)===void 0||n.vault.getConfig(`useTab`)===!0,g=h?1:n.vault.getConfig(`tabSize`),_=(h?` `:` `).repeat(g),v=e.content.split(`
|
||
`).join(`
|
||
`+_),y=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`),b=``,x=``;l&&(b=yo(u||``,y),x=yo(d||``,y));let S=b?b+(b.endsWith(` `)?``:` `)+v:v,C=x?S+(S.endsWith(` `)?``:` `)+x:S,w=y.format(a||`HH:mm`),T=!e.thinoType||e.thinoType===`JOURNAL`?`- `:e.thinoType===`TASK-TODO`?`- [ ] `:`- [x] `,E=r?`${T}${r?.replace(/{TIME}/g,w).replace(/{CONTENT}/g,(C.split(`
|
||
`).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(C)?`
|
||
`+_:``)+C)}${C.split(`
|
||
`).length>1&&/```/g.test(C.split(`
|
||
`)[C.split(`
|
||
`).length-1])&&p.trim()?`
|
||
`+_:` `}${p}`:`${T}${w} ${C.split(`
|
||
`).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(C)?`
|
||
`+_:``}${C}${C.split(`
|
||
`).length>1&&/```/g.test(C.split(`
|
||
`)[C.split(`
|
||
`).length-1])&&p.trim()?`
|
||
`+_:` `}${p}`,D=ue(y,ce()),O=`fake`+P.randomId(16),k=!1,A=n.plugins.getPlugin(`templater-obsidian`),j;if(D?j=D:(A?.templater&&A?.settings.trigger_on_file_creation&&(V.setWaitingForTemplater({origin:e.content,date:y,isList:e.thinoType&&e.thinoType===`JOURNAL`,id:O,type:`local`}),k=!0),R.setChangedByMemos(!0),j=await P.createDailyNoteCheck(y),V.markPathPending(j.path)),!j){new f.Notice(M(`Failed to create daily note, check if it exists.`)),new f.Notice(M(`Your content has been copied to clipboard, and inserted into the editor. Please try it again`)),await navigator.clipboard.writeText(e.content);let t=n.workspace.getLeavesOfType(`thino_view`).first();n.workspace.trigger(`send-to-thino`,e.content,t);return}if(D||await L.fechLocalDailyNotes(),A&&A?.templater&&A?.settings.trigger_on_file_creation&&k)return R.setChangedByMemos(!0),{id:O,content:e.content,deletedAt:e.deletedAt??``,createdAt:y.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:y.format(`YYYY/MM/DD HH:mm:ss`),thinoType:e.thinoType||`JOURNAL`,path:j.path,hasId:``,linkId:[],pinned:e.pinned??!1,visibility:`PUBLIC`,rowStatus:e.rowStatus??`NORMAL`,webId:e.webId||e.id,creatorName:`Thino`,resourceList:[],sourceType:`DAILY`,fileInfo:e?.fileInfo||{tags:[],frontmatter:{}}};let ee=n.metadataCache.getFileCache(j),te={tags:ee?.frontmatter?.tags||[],frontmatter:ee?.frontmatter||{}},ne=``;try{ne=await t.read(j)||await t.cachedRead(j)}catch(e){console.error(e),new f.Notice(M(`Failed to read current daily note, check if it exists.`))}let re=await Do(c===`end`?``:e.thinoType&&o&&s||i,E,ne);await t.modify(j,re.content);let ie=re.posNum===-1?No(re.content).length-1:re.posNum+1;return R.setChangedByMemos(!0),{id:y.format(`YYYYMMDDHHmm`)+`00`+ie,content:e.content,deletedAt:e.deletedAt??``,createdAt:y.format(`YYYY/MM/DD HH:mm:ss`),updatedAt:y.format(`YYYY/MM/DD HH:mm:ss`),thinoType:e.thinoType||`JOURNAL`,path:j.path,hasId:``,linkId:[],pinned:e.pinned??!1,visibility:`PUBLIC`,rowStatus:e.rowStatus??`NORMAL`,webId:e.id,creatorName:`Thino`,resourceList:[],sourceType:`DAILY`,fileInfo:te}}async function Do(e,t,n){let r=RegExp(`(\s*?)${await vo(e)}(\s*?)`),i=bo(n),a=i.findIndex(e=>r.test(e)),o=e?.trim()===``?!0:a===-1;o&&console.info(`unable to find insert after line in file.`);let s=i.slice(a+1).findIndex(e=>/(^#+ |---|^\^[a-zA-Z0-9-]{2,}$)/.test(e)),c=s!==-1;if(c){let e;for(let t=s+a;t>a;t--)if(!/^[\s\n ]*$/.test(i[t])){e=t;break}return e||=a,await Oo(t,n,o?-1:e,c)}else return await Oo(t,n,i.length-1,c)}async function Oo(e,t,n,r){if(n<-1)throw Error(`Invalid position`);if(n===-1)return{content:`${t}\n${e}`,posNum:-1};let i=t.split(`
|
||
`),a=i.slice(0,n+1).join(`
|
||
`),o=i.slice(n+1).join(`
|
||
`),s=o.trim().length>0;return{content:`${a}${!s&&!r||!a.endsWith(`
|
||
`)?`
|
||
`:``}${e}${(s||r?`
|
||
`:``)+o}`,posNum:n}}function ko(e,t,n){let r=n||Po[t]||`YYYY-MM-DD`;return`## ${e.format(r)}`}function Ao(e,t){let n=e.findIndex(e=>e.trim()===t);if(n===-1){let t=e.length;for(;t>0&&e[t-1].trim()===``;)t--;return{insertIndex:t,needsNewHeading:!0}}let r=e.length;for(let t=n+1;t<e.length;t++)if(/^##\s/.test(e[t])){r=t;break}let i=r;for(;i>n+1&&e[i-1].trim()===``;)i--;return{insertIndex:i,needsNewHeading:!1}}function jo(e,t){let n=e?.JournalSettings;if(!n?.useIndependentSettings)return;let r={day:n.daily,week:n.weekly,month:n.monthly,year:n.yearly}[t];r&&(r.folder||r.format||r.template)&&b(t,r)}async function Mo({content:e,isList:t}){let n=lr.getState().dailyNotesState.settings,r=L.getState().app,{vault:i}=r,a=(0,f.moment)(),o=n?.JournalSettings?.granularity||`day`;jo(n,o);let s=de(a,le(o),o);if(!s)try{R.setChangedByMemos(!0),s=await pe(a,o),V.markPathPending(s.path)}catch(e){console.error(e),new f.Notice(M(`Failed to create daily note, check if it exists.`));return}let c=r.metadataCache.getFileCache(s),l={tags:c?.frontmatter?.tags||[],frontmatter:c?.frontmatter||{}},u=``;try{u=await i.read(s)||await i.cachedRead(s)}catch(e){console.error(e),new f.Notice(M(`Failed to read current daily note, check if it exists.`))}let d=r.vault.getConfig(`useTab`)===void 0||r.vault.getConfig(`useTab`)===!0,p=d?1:r.vault.getConfig(`tabSize`),m=(d?` `:` `).repeat(p),h=e.split(`
|
||
`).join(`
|
||
`+m),g=a.format(n?.DefaultTimePrefix||`HH:mm`),_=``,v=``;n?.UseMemoFixedStrings&&(_=yo(n.MemoFixedPrefix||``,a),v=yo(n.MemoFixedSuffix||``,a));let y=_?_+(_.endsWith(` `)?``:` `)+h:h,b=v?y+(y.endsWith(` `)?``:` `)+v:y,x=t?`- `:`- [ ] `,S=b.split(`
|
||
`).length>1,C=/^((-|\*|\d\.|>)\s|```)/g.test(b),w=n?.DefaultMemoComposition?`${x}${n.DefaultMemoComposition.replace(/{TIME}/g,g).replace(/{CONTENT}/g,(S||C?`
|
||
`+m:``)+b)}`:`${x}${g} ${S||C?`
|
||
`+m:``}${b}`,T,E;if(o===`day`){let e=await Do(n?.InsertType===`end`?``:n?.InsertAfter||``,w,u);T=e.content,E=e.posNum===-1?No(T).length-1:e.posNum+1}else{let e=ko(a,`day`,n?.JournalSettings?.headingDateFormat||``),t=u.split(/\r?\n/),{insertIndex:r,needsNewHeading:i}=Ao(t,e);if(i){let n=u.trim()?[``,e,``,w]:[e,``,w];t.splice(r,0,...n)}else t.splice(r,0,w);T=t.join(`
|
||
`),E=r+(i?3:0)}return setTimeout(async()=>{R.setChangedByMemos(!0),V.markPathPending(s.path),await i.modify(s,T)},200),{id:a.format(`YYYYMMDDHHmm`)+`00`+E,content:b,deletedAt:``,path:s.path,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:`JOURNAL`,fileInfo:l}}var No,Po,Fo=o((()=>{Ce(),ur(),H(),Qr(),Ji(),N(),_o(),No=e=>e.split(/\r?\n/),Po={day:me,week:he,month:ge,year:ve}}));async function Io(e){let t=lr.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof f.TFile)){new f.Notice(M(`File not found for the given thino path`));return}await t.vault.delete(n)}async function Lo(e){let t=lr.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof f.TFile)){new f.Notice(M(`File not found for the given thino path`));return}let r=(await t.vault.read(n)).split(`
|
||
`),i=r.findIndex(t=>t.includes(e.id));if(i===-1){new f.Notice(M(`Thino not found`));return}let a=r.findIndex((e,t)=>t>i&&e.trim()===``);a===-1?r.splice(i,r.length-i):r.splice(i,a-i);let o=r.join(`
|
||
`);if(!o){new f.Notice(M(`Thino not found`));return}V.markPathPending(n.path),R.setChangedByMemos(!0),await t.vault.modify(n,o)}async function Ro(e){let t=lr.getState().dailyNotesState.app,n=t.metadataCache.getFirstLinkpathDest(``,e.path);if(!n){new f.Notice(M(`File not found for the given thino path`));return}let r=await t.vault.read(n),i=JSON.parse(r),a=i.nodes,o=a.findIndex(t=>t.id===e.id);if(o===-1){new f.Notice(M(`Thino not found`));return}a.splice(o,1);let s=i.edges;s.filter(t=>t.fromNode===e.id||t.toNode===e.id).forEach(e=>{let t=s.findIndex(t=>t.id===e.id);t!==-1&&s.splice(t,1)}),V.markPathPending(n.path),R.setChangedByMemos(!0);let c=JSON.stringify(i,null,2);await t.vault.modify(n,c)}async function zo(e){Oa()||new f.Notice(M(`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);let{vault:t}=lr.getState().dailyNotesState.app,n=e.path,r=t.getAbstractFileByPath(n);if(!r){new f.Notice(M(`Please check your daily note plugin OR periodic notes plugin settings`));return}let i=await t.read(r);if(!i){new f.Notice(M(`Thino not found`));return}let a=i.split(`
|
||
`),o=await Zi(r),s=parseInt(e.id.slice(14)),c=o.find(e=>e.position?.start.line===s);if(!c&&e.content&&(console.log(`[delete] Memo not found at line ${s}, searching by content...`),c=await $i(o,a,e.content,e.id)),!c&&e.hasId&&(c=o.find(t=>t.position?a.slice(t.position.start.line,t.position.end.line+1).join(`
|
||
`).includes(`^${e.hasId}`):!1)),!c){console.error(`[delete] Memo ${e.id} not found in ${e.path} after all strategies`),new f.Notice(M(`Thino not found`));return}let l=c.position.start.line;l!==s&&console.log(`[delete] Memo location corrected: ${s} → ${l}`);let u=c.position.end.line;function d(e,t){let n=[];for(let r in t)if(t[r]===e){let e=parseInt(r);n.push(e,...d(e,t))}return n}let p=d(l,Ui(o));if(p.length>0){let e=p.map(e=>{let t=o.find(t=>t.position?.start.line===e);return t?t.position.end.line:-1});u=Math.max(u,...e)}let m=o.find(e=>e.position?.start.line>l&&!p.includes(e.position.start.line));m&&(u=Math.min(u,m.position.start.line-1)),u=Math.min(u,a.length-1),V.markPathPending(r.path),R.setChangedByMemos(!0),a.splice(l,u-l+1),await t.modify(r,a.join(`
|
||
`))}async function Bo(){let{vault:e,metadataCache:t}=lr.getState().dailyNotesState.app,n=lr.getState().dailyNotesState.settings,r=Kr()+`/`+n.DeleteFileName+`.md`,i=[],a=t.getFirstLinkpathDest(``,r);if(a instanceof f.TFile){let t=await e.read(a),n=Ho(t);if(n.length===0)return i;for(let e=0;e<n.length;e++){let t=n[e];if(/- /.test(t)){let r=(0,f.moment)(Uo(t).slice(0,13),`YYYYMMDDHHmmss`),a=Go(n[e]),o=(0,f.moment)(a.slice(0,13),`YYYYMMDDHHmmss`),s=Wo(n[e]);i.push({id:a,content:s,user_id:1,createdAt:r.format(`YYYY/MM/DD HH:mm:SS`),updatedAt:r.format(`YYYY/MM/DD HH:mm:SS`),deletedAt:o})}else continue}n=null,t=null}return i}async function Vo(e){return zo({...e,sourceType:`DAILY`})}var Ho,Uo,Wo,Go,Ko=o((()=>{ur(),Ce(),Fo(),Qr(),N(),H(),Aa(),Ji(),Qi(),fa(),Ho=e=>e.split(/\r?\n/),Uo=e=>/^- (\d{14})(\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e)?.[1],Wo=e=>/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e)?.[2],Go=e=>/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e)?.[4]}));async function qo(e){let t=await ki(lr.getState().dailyNotesState.app)||[],n=t.findIndex(t=>t.id===e);t.splice(n,1),await Ai(lr.getState().dailyNotesState.app,t)}var Jo=o((()=>{ur(),Mi()})),Yo,Xo,Zo=o((()=>{ur(),Mi(),N(),Yo=async e=>{let{app:t}=lr.getState().dailyNotesState,n=await ki(t)||[],r=n.find(t=>t.id===e);if(r){let e=(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`);return r.pinnedAt=e,await Ai(t,n),e}else{new f.Notice(M(`Query not found`));return}},Xo=async e=>{let{app:t}=lr.getState().dailyNotesState,n=await ki(t)||[],r=n.find(t=>t.id===e);if(r){r.pinnedAt=``,await Ai(t,n);return}else{new f.Notice(M(`Query not found`));return}}})),Qo,$o,es=o((()=>{Pi(),Li(),Ja(),Xa(),Ko(),Jo(),Zo(),fa(),H(),(function(e){async function t(e){return await za(e)}e.getMyMemos=t;async function n(e){return await za([e])}e.updateSpecificTypeMemo=n;function r(){return Bo()}e.getMyDeletedMemos=r;function i(e){let t=V.getMemoById(e);if(t)switch(t?.sourceType){case`DAILY`:return sa(t,{id:t.id,deleted:!1});case`CANVAS`:return aa(t,{id:t.id,deleted:!1});case`MULTI`:return ra(t,{id:t.id,deleted:!1});case`FILE`:return ia(t,{id:t.id,deleted:!1});case`JOURNAL`:return la(t,{id:t.id,deleted:!1})}}e.restoreMemo=i;function a(e){return Vo(e)}e.deleteMemoInJournalFile=a;function o(e){return Lo(e)}e.deleteMemoInSingleFile=o;function s(e){return Io(e)}e.deleteMemoInMultiFiles=s;function c(e){return zo(e)}e.deleteMemoInDailyNote=c;function l(e){return Ro(e)}e.deleteMemoInCanvas=l;function u(){return Ni()}e.getMyQueries=u;async function d(e,t){return await Ii(e,t)}e.createQuery=d;function f(e,t,n){return Ya(e,t,n)}e.updateQuery=f;function p(e){return qo(e)}e.deleteQueryById=p;function m(e){return Yo(e)}e.pinQuery=m;function h(e){return Xo(e)}e.unpinQuery=h})(Qo||={}),$o=Qo}));function ts(e,t,n){let r=t.workspace.getLeavesOfType(`markdown`);for(let i of r)if(i.view?.file?.path===e){t.workspace.revealLeaf(i);try{return i.view.setEphemeralState({line:n}),!0}catch(e){return console.error(e),!1}}return!1}var ns,rs,is,as,os=o((()=>{bi(),N(),ns=async e=>{let t=L.getState().app,n=t.workspace.getLeavesOfType(`markdown`);for(let r of n)if(r.view?.file?.path===e){t.workspace.revealLeaf(r);return}let r=t.metadataCache.getFirstLinkpathDest(``,e);if(!r){new f.Notice(M(`File not found for the given thino path`));return}await t.workspace.getLeaf(!0).openFile(r)},rs=async(e,t)=>{let{app:n}=L.getState(),r=parseInt(e.slice(14));if(ts(t,n,r))return;let i=n.metadataCache.getFirstLinkpathDest(``,t);if(!f.Platform.isMobile)await n.workspace.getLeaf(!0).openFile(i,{eState:{line:r}});else{let e=n.workspace.activeLeaf;e===null&&(e=n.workspace.getLeaf(!0)),await e.openFile(i,{eState:{line:r}})}},is=async(e,t)=>{let n=L.getState().app,r=n.metadataCache.getFirstLinkpathDest(``,t);if(!r){new f.Notice(M(`File not found for the given thino path`));return}let i=``;try{i=await n.vault.read(r)}catch(e){console.error(e),i=await n.vault.cachedRead(r)}let a=i.split(/\r?\n/).findIndex(t=>t.contains(e)),o=n.workspace.getLeavesOfType(`markdown`);for(let e of o)if(e.view?.file?.path===r.path){n.workspace.revealLeaf(e);try{e.view.editor?.setCursor({line:a,ch:1});return}catch(e){console.error(e)}}let s=n.workspace.getLeaf(!0);await s.openFile(r,{eState:{line:a}});try{s.view.editor?.setCursor({line:a,ch:1})}catch(e){console.error(e)}},as=async(e,t)=>{let n=L.getState().app,r=(e,t)=>{console.log(Array.from(e.nodes));let n=Array.from(e.nodes.values())?.find(e=>e.id===t);return n?(e.selectOnly(n),e.zoomToSelection(),!0):!1},i=n.workspace.getLeavesOfType(`canvas`);for(let a of i){let i=a.view;if(i?.file?.path===t&&(n.workspace.revealLeaf(a),r(i.canvas,e)))return}let a=n.metadataCache.getFirstLinkpathDest(``,t);if(!a){new f.Notice(M(`File not found for the given thino path`));return}let o=n.workspace.getLeaf(!0);await o.openFile(a),setTimeout(()=>{r(o.view?.canvas,e)},10)}}));function ss(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e==`object`&&t===`[object Date]`?new e.constructor(+e):typeof e==`number`||t===`[object Number]`||typeof e==`string`||t===`[object String]`?new Date(e):new Date(NaN)}var cs=o((()=>{}));function ls(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}var us=o((()=>{}));function ds(e,t){let n=ss(e);return isNaN(t)?ls(e,NaN):(t&&n.setDate(n.getDate()+t),n)}var fs=o((()=>{cs(),us()}));function ps(e,t){let n=ss(e);if(isNaN(t))return ls(e,NaN);if(!t)return n;let r=n.getDate(),i=ls(e,n.getTime());return i.setMonth(n.getMonth()+t+1,0),r>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}var ms=o((()=>{cs(),us()})),hs=o((()=>{})),gs=o((()=>{})),_s=o((()=>{})),vs=o((()=>{})),ys=o((()=>{})),bs=o((()=>{})),xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js=o((()=>{xs=365.2425,Ss=6048e5,Cs=864e5,ws=6e4,Ts=36e5,Es=1e3,Ds=3600,Os=Ds*24,Os*7,ks=Os*xs,As=ks/12,As*3})),Ms=o((()=>{}));function Ns(){return Ps}var Ps,Fs=o((()=>{Ps={}}));function Is(e,t){let n=Ns(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=ss(e),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}var Ls=o((()=>{cs(),Fs()}));function Rs(e){return Is(e,{weekStartsOn:1})}var zs=o((()=>{Ls()}));function Bs(e){let t=ss(e),n=t.getFullYear(),r=ls(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let i=Rs(r),a=ls(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);let o=Rs(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}var Vs=o((()=>{us(),zs(),cs()}));function Hs(e){let t=ss(e);return t.setHours(0,0,0,0),t}var Us=o((()=>{cs()}));function Ws(e){let t=ss(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}var Gs=o((()=>{cs()}));function Ks(e,t){let n=Hs(e),r=Hs(t),i=+n-Ws(n),a=+r-Ws(r);return Math.round((i-a)/Cs)}var qs=o((()=>{js(),Us(),Gs()}));function Js(e){let t=Bs(e),n=ls(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Rs(n)}var Ys=o((()=>{Vs(),zs(),us()})),Xs=o((()=>{})),Zs=o((()=>{})),Qs=o((()=>{})),$s=o((()=>{})),ec=o((()=>{})),tc=o((()=>{}));function nc(e,t){return ps(e,t*12)}var rc=o((()=>{ms()})),ic=o((()=>{})),ac=o((()=>{})),oc=o((()=>{})),sc=o((()=>{})),cc=o((()=>{})),lc=o((()=>{})),uc=o((()=>{})),dc=o((()=>{})),fc=o((()=>{})),pc=o((()=>{})),mc=o((()=>{}));function hc(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}var gc=o((()=>{}));function _c(e){if(!hc(e)&&typeof e!=`number`)return!1;let t=ss(e);return!isNaN(Number(t))}var vc=o((()=>{gc(),cs()})),yc=o((()=>{})),bc=o((()=>{})),xc=o((()=>{})),Sc=o((()=>{})),Cc=o((()=>{})),wc=o((()=>{})),Tc=o((()=>{})),Ec=o((()=>{}));function Dc(e,t){let n=ss(e),r=ss(t),i=Oc(n,r),a=Math.abs(Ks(n,r));n.setDate(n.getDate()-i*a);let o=i*(a-Number(Oc(n,r)===-i));return o===0?0:o}function Oc(e,t){let n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}var kc=o((()=>{qs(),cs()})),Ac=o((()=>{})),jc=o((()=>{})),Mc=o((()=>{})),Nc=o((()=>{})),Pc=o((()=>{}));function Fc(e){let t=ss(e);return t.setHours(23,59,59,999),t}var Ic=o((()=>{cs()}));function Lc(e){let t=ss(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}var Rc=o((()=>{cs()})),zc=o((()=>{})),Bc=o((()=>{})),Vc=o((()=>{})),Hc=o((()=>{})),Uc=o((()=>{})),Wc=o((()=>{})),Gc=o((()=>{})),Kc=o((()=>{})),qc=o((()=>{})),Jc=o((()=>{})),Yc=o((()=>{})),Xc=o((()=>{})),Zc=o((()=>{})),Qc=o((()=>{})),$c=o((()=>{}));function el(e){let t=ss(e);return t.setDate(1),t.setHours(0,0,0,0),t}var tl=o((()=>{cs()})),nl=o((()=>{}));function rl(e){let t=ss(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}var il=o((()=>{cs()}));function al(e){let t=ss(e),n=ls(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}var ol=o((()=>{cs(),us()})),sl=o((()=>{})),cl=o((()=>{})),ll=o((()=>{})),ul=o((()=>{}));function dl(e,t){let n=Ns(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=ss(e),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}var fl=o((()=>{cs(),Fs()})),pl=o((()=>{})),ml=o((()=>{})),hl=o((()=>{})),gl=o((()=>{})),_l=o((()=>{})),vl=o((()=>{})),yl=o((()=>{})),bl=o((()=>{})),xl,Sl,Cl=o((()=>{xl={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},Sl=(e,t,n)=>{let r,i=xl[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r}}));function wl(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Tl=o((()=>{})),El,Dl,Ol,kl,Al=o((()=>{Tl(),El={full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},Dl={full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},Ol={full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},kl={date:wl({formats:El,defaultWidth:`full`}),time:wl({formats:Dl,defaultWidth:`full`}),dateTime:wl({formats:Ol,defaultWidth:`full`})}})),jl,Ml,Nl=o((()=>{jl={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Ml=(e,t,n,r)=>jl[e]}));function Pl(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var Fl=o((()=>{})),Il,Ll,Rl,zl,Bl,Vl,Hl,Ul,Wl=o((()=>{Fl(),Il={narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},Ll={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},Rl={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},zl={narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},Bl={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},Vl={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},Hl=(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},Ul={ordinalNumber:Hl,era:Pl({values:Il,defaultWidth:`wide`}),quarter:Pl({values:Ll,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:Pl({values:Rl,defaultWidth:`wide`}),day:Pl({values:zl,defaultWidth:`wide`}),dayPeriod:Pl({values:Bl,defaultWidth:`wide`,formattingValues:Vl,defaultFormattingWidth:`wide`})}}));function Gl(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?ql(s,e=>e.test(o)):Kl(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function Kl(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ql(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}var Jl=o((()=>{}));function Yl(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var Xl=o((()=>{})),Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou,su,cu,lu,uu=o((()=>{Jl(),Xl(),Zl=/^(\d+)(th|st|nd|rd)?/i,Ql=/\d+/i,$l={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},eu={any:[/^b/i,/^(a|c)/i]},tu={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},nu={any:[/1/i,/2/i,/3/i,/4/i]},ru={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},iu={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},au={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ou={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},su={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cu={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},lu={ordinalNumber:Yl({matchPattern:Zl,parsePattern:Ql,valueCallback:e=>parseInt(e,10)}),era:Gl({matchPatterns:$l,defaultMatchWidth:`wide`,parsePatterns:eu,defaultParseWidth:`any`}),quarter:Gl({matchPatterns:tu,defaultMatchWidth:`wide`,parsePatterns:nu,defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Gl({matchPatterns:ru,defaultMatchWidth:`wide`,parsePatterns:iu,defaultParseWidth:`any`}),day:Gl({matchPatterns:au,defaultMatchWidth:`wide`,parsePatterns:ou,defaultParseWidth:`any`}),dayPeriod:Gl({matchPatterns:su,defaultMatchWidth:`any`,parsePatterns:cu,defaultParseWidth:`any`})}})),du,fu=o((()=>{Cl(),Al(),Nl(),Wl(),uu(),du={code:`en-US`,formatDistance:Sl,formatLong:kl,formatRelative:Ml,localize:Ul,match:lu,options:{weekStartsOn:0,firstWeekContainsDate:1}}})),pu=o((()=>{fu()}));function mu(e){let t=ss(e);return Ks(t,al(t))+1}var hu=o((()=>{qs(),ol(),cs()}));function gu(e){let t=ss(e),n=Rs(t)-+Js(t);return Math.round(n/Ss)+1}var _u=o((()=>{js(),zs(),Ys(),cs()}));function vu(e,t){let n=ss(e),r=n.getFullYear(),i=Ns(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=ls(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=Is(o,t),c=ls(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=Is(c,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}var yu=o((()=>{us(),Ls(),cs(),Fs()}));function bu(e,t){let n=Ns(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=vu(e,t),a=ls(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),Is(a,t)}var xu=o((()=>{us(),yu(),Ls(),Fs()}));function Su(e,t){let n=ss(e),r=Is(n,t)-+bu(n,t);return Math.round(r/Ss)+1}var Cu=o((()=>{js(),Ls(),xu(),cs()}));function wu(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var Tu=o((()=>{})),Eu,Du=o((()=>{Tu(),Eu={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return wu(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):wu(n+1,2)},d(e,t){return wu(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return wu(e.getHours()%12||12,t.length)},H(e,t){return wu(e.getHours(),t.length)},m(e,t){return wu(e.getMinutes(),t.length)},s(e,t){return wu(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return wu(Math.trunc(r*10**(n-3)),t.length)}}}));function Ou(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+wu(a,2)}function ku(e,t){return e%60==0?(e>0?`-`:`+`)+wu(Math.abs(e)/60,2):Au(e,t)}function Au(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=wu(Math.trunc(r/60),2),a=wu(r%60,2);return n+i+t+a}var ju,Mu,Nu=o((()=>{hu(),_u(),Vs(),Cu(),yu(),Tu(),Du(),ju={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},Mu={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return Eu.y(e,t)},Y:function(e,t,n,r){let i=vu(e,r),a=i>0?i:1-i;return t===`YY`?wu(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):wu(a,t.length)},R:function(e,t){return wu(Bs(e),t.length)},u:function(e,t){return wu(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return wu(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return wu(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return Eu.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return wu(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=Su(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):wu(i,t.length)},I:function(e,t,n){let r=gu(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):wu(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):Eu.d(e,t)},D:function(e,t,n){let r=mu(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):wu(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return wu(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return wu(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return wu(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?ju.noon:r===0?ju.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?ju.evening:r>=12?ju.afternoon:r>=4?ju.morning:ju.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return Eu.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):Eu.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):wu(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):wu(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):Eu.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):Eu.s(e,t)},S:function(e,t){return Eu.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return ku(r);case`XXXX`:case`XX`:return Au(r);default:return Au(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return ku(r);case`xxxx`:case`xx`:return Au(r);default:return Au(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Ou(r,`:`);default:return`GMT`+Au(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Ou(r,`:`);default:return`GMT`+Au(r,`:`)}},t:function(e,t,n){return wu(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return wu(e.getTime(),t.length)}}})),Pu,Fu,Iu,Lu,Ru=o((()=>{Pu=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Fu=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},Iu=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Pu(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Pu(r,t)).replace(`{{time}}`,Fu(i,t))},Lu={p:Fu,P:Iu}}));function zu(e){return Uu.test(e)}function Bu(e){return Wu.test(e)}function Vu(e,t,n){let r=Hu(e,t,n);if(console.warn(r),Gu.includes(e))throw RangeError(r)}function Hu(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var Uu,Wu,Gu,Ku=o((()=>{Uu=/^D+$/,Wu=/^Y+$/,Gu=[`D`,`DD`,`YY`,`YYYY`]}));function qu(e,t,n){let r=Ns(),i=n?.locale??r.locale??du,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=ss(e);if(!_c(s))throw RangeError(`Invalid time value`);let c=t.match(Xu).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Lu[t];return n(e,i.formatLong)}return e}).join(``).match(Yu).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Ju(e)};if(Mu[t])return{isToken:!0,value:e};if(t.match($u))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&Bu(a)||!n?.useAdditionalDayOfYearTokens&&zu(a))&&Vu(a,t,String(e));let o=Mu[a[0]];return o(s,a,i.localize,l)}).join(``)}function Ju(e){let t=e.match(Zu);return t?t[1].replace(Qu,`'`):e}var Yu,Xu,Zu,Qu,$u,ed=o((()=>{pu(),Fs(),Nu(),Ru(),Ku(),vc(),cs(),Yu=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Xu=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zu=/^'([^]*?)'?$/,Qu=/''/g,$u=/[a-zA-Z]/})),td=o((()=>{})),nd=o((()=>{})),rd=o((()=>{})),id=o((()=>{})),ad=o((()=>{})),od=o((()=>{})),sd=o((()=>{})),cd=o((()=>{})),ld=o((()=>{})),ud=o((()=>{})),dd=o((()=>{})),fd=o((()=>{})),pd=o((()=>{})),md=o((()=>{})),hd=o((()=>{})),gd=o((()=>{})),_d=o((()=>{})),vd=o((()=>{}));function yd(){return Object.assign({},Ns())}var bd=o((()=>{Fs()})),xd=o((()=>{}));function Sd(e){let t=ss(e).getDay();return t===0&&(t=7),t}var Cd=o((()=>{cs()})),wd=o((()=>{})),Td=o((()=>{})),Ed=o((()=>{})),Dd=o((()=>{})),Od=o((()=>{})),kd=o((()=>{})),Ad=o((()=>{})),jd=o((()=>{})),Md=o((()=>{})),Nd=o((()=>{})),Pd=o((()=>{})),Fd=o((()=>{})),Id=o((()=>{})),Ld=o((()=>{})),Rd=o((()=>{})),zd=o((()=>{})),Bd=o((()=>{})),Vd=o((()=>{})),Hd=o((()=>{}));function Ud(e,t){let n=ss(e),r=ss(t);return n.getTime()>r.getTime()}var Wd=o((()=>{cs()})),Gd=o((()=>{})),Kd=o((()=>{})),qd=o((()=>{})),Jd=o((()=>{})),Yd=o((()=>{})),Xd=o((()=>{}));function Zd(e,t){let n=t instanceof Date?ls(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}var Qd=o((()=>{us()})),$d,ef,tf,nf,rf=o((()=>{Qd(),us(),$d=10,ef=class{subPriority=0;validate(e,t){return!0}},tf=class extends ef{constructor(e,t,n,r,i){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=r,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}},nf=class extends ef{priority=$d;subPriority=-1;set(e,t){return t.timestampIsSet?e:ls(e,Zd(e,Date))}}})),af,of=o((()=>{rf(),af=class{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new tf(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}}})),sf,cf=o((()=>{of(),sf=class extends af{priority=140;parse(e,t,n){switch(t){case`G`:case`GG`:case`GGG`:return n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`});case`GGGGG`:return n.era(e,{width:`narrow`});default:return n.era(e,{width:`wide`})||n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`R`,`u`,`t`,`T`]}})),lf,uf,df=o((()=>{lf={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},uf={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/}}));function ff(e,t){return e&&{value:t(e.value),rest:e.rest}}function pf(e,t){let n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function mf(e,t){let n=t.match(e);if(!n)return null;if(n[0]===`Z`)return{value:0,rest:t.slice(1)};let r=n[1]===`+`?1:-1,i=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(i*Ts+a*ws+o*Es),rest:t.slice(n[0].length)}}function hf(e){return pf(lf.anyDigitsSigned,e)}function gf(e,t){switch(e){case 1:return pf(lf.singleDigit,t);case 2:return pf(lf.twoDigits,t);case 3:return pf(lf.threeDigits,t);case 4:return pf(lf.fourDigits,t);default:return pf(RegExp(`^\\d{1,`+e+`}`),t)}}function _f(e,t){switch(e){case 1:return pf(lf.singleDigitSigned,t);case 2:return pf(lf.twoDigitsSigned,t);case 3:return pf(lf.threeDigitsSigned,t);case 4:return pf(lf.fourDigitsSigned,t);default:return pf(RegExp(`^-?\\d{1,`+e+`}`),t)}}function vf(e){switch(e){case`morning`:return 4;case`evening`:return 17;case`pm`:case`noon`:case`afternoon`:return 12;default:return 0}}function yf(e,t){let n=t>0,r=n?t:1-t,i;if(r<=50)i=e||100;else{let t=r+50,n=Math.trunc(t/100)*100,a=e>=t%100;i=e+n-(a?100:0)}return n?i:1-i}function bf(e){return e%400==0||e%4==0&&e%100!=0}var xf=o((()=>{js(),df()})),Sf,Cf=o((()=>{of(),xf(),Sf=class extends af{priority=130;incompatibleTokens=[`Y`,`R`,`u`,`w`,`I`,`i`,`e`,`c`,`t`,`T`];parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`yy`});switch(t){case`y`:return ff(gf(4,e),r);case`yo`:return ff(n.ordinalNumber(e,{unit:`year`}),r);default:return ff(gf(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){let r=e.getFullYear();if(n.isTwoDigitYear){let t=yf(n.year,r);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}let i=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}}})),wf,Tf=o((()=>{yu(),Ls(),of(),xf(),wf=class extends af{priority=130;parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`YY`});switch(t){case`Y`:return ff(gf(4,e),r);case`Yo`:return ff(n.ordinalNumber(e,{unit:`year`}),r);default:return ff(gf(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,r){let i=vu(e,r);if(n.isTwoDigitYear){let t=yf(n.year,i);return e.setFullYear(t,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Is(e,r)}let a=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Is(e,r)}incompatibleTokens=[`y`,`R`,`u`,`Q`,`q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]}})),Ef,Df=o((()=>{zs(),us(),of(),xf(),Ef=class extends af{priority=130;parse(e,t){return _f(t===`R`?4:t.length,e)}set(e,t,n){let r=ls(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Rs(r)}incompatibleTokens=[`G`,`y`,`Y`,`u`,`Q`,`q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]}})),Of,kf=o((()=>{of(),xf(),Of=class extends af{priority=130;parse(e,t){return _f(t===`u`?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`G`,`y`,`Y`,`R`,`w`,`I`,`i`,`e`,`c`,`t`,`T`]}})),Af,jf=o((()=>{of(),xf(),Af=class extends af{priority=120;parse(e,t,n){switch(t){case`Q`:case`QQ`:return gf(t.length,e);case`Qo`:return n.ordinalNumber(e,{unit:`quarter`});case`QQQ`:return n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`});case`QQQQQ`:return n.quarter(e,{width:`narrow`,context:`formatting`});default:return n.quarter(e,{width:`wide`,context:`formatting`})||n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]}})),Mf,Nf=o((()=>{of(),xf(),Mf=class extends af{priority=120;parse(e,t,n){switch(t){case`q`:case`qq`:return gf(t.length,e);case`qo`:return n.ordinalNumber(e,{unit:`quarter`});case`qqq`:return n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`});case`qqqqq`:return n.quarter(e,{width:`narrow`,context:`standalone`});default:return n.quarter(e,{width:`wide`,context:`standalone`})||n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`Q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]}})),Pf,Ff=o((()=>{df(),of(),xf(),Pf=class extends af{incompatibleTokens=[`Y`,`R`,`q`,`Q`,`L`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`];priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`M`:return ff(pf(lf.month,e),r);case`MM`:return ff(gf(2,e),r);case`Mo`:return ff(n.ordinalNumber(e,{unit:`month`}),r);case`MMM`:return n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`});case`MMMMM`:return n.month(e,{width:`narrow`,context:`formatting`});default:return n.month(e,{width:`wide`,context:`formatting`})||n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}}})),If,Lf=o((()=>{df(),of(),xf(),If=class extends af{priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`L`:return ff(pf(lf.month,e),r);case`LL`:return ff(gf(2,e),r);case`Lo`:return ff(n.ordinalNumber(e,{unit:`month`}),r);case`LLL`:return n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`});case`LLLLL`:return n.month(e,{width:`narrow`,context:`standalone`});default:return n.month(e,{width:`wide`,context:`standalone`})||n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]}}));function Rf(e,t,n){let r=ss(e),i=Su(r,n)-t;return r.setDate(r.getDate()-i*7),r}var zf=o((()=>{Cu(),cs()})),Bf,Vf=o((()=>{zf(),Ls(),df(),of(),xf(),Bf=class extends af{priority=100;parse(e,t,n){switch(t){case`w`:return pf(lf.week,e);case`wo`:return n.ordinalNumber(e,{unit:`week`});default:return gf(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,r){return Is(Rf(e,n,r),r)}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]}}));function Hf(e,t){let n=ss(e),r=gu(n)-t;return n.setDate(n.getDate()-r*7),n}var Uf=o((()=>{_u(),cs()})),Wf,Gf=o((()=>{Uf(),zs(),df(),of(),xf(),Wf=class extends af{priority=100;parse(e,t,n){switch(t){case`I`:return pf(lf.week,e);case`Io`:return n.ordinalNumber(e,{unit:`week`});default:return gf(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return Rs(Hf(e,n))}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]}})),Kf,qf,Jf,Yf=o((()=>{df(),of(),xf(),Kf=[31,28,31,30,31,30,31,31,30,31,30,31],qf=[31,29,31,30,31,30,31,31,30,31,30,31],Jf=class extends af{priority=90;subPriority=1;parse(e,t,n){switch(t){case`d`:return pf(lf.date,e);case`do`:return n.ordinalNumber(e,{unit:`date`});default:return gf(t.length,e)}}validate(e,t){let n=bf(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=qf[r]:t>=1&&t<=Kf[r]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]}})),Xf,Zf=o((()=>{df(),of(),xf(),Xf=class extends af{priority=90;subpriority=1;parse(e,t,n){switch(t){case`D`:case`DD`:return pf(lf.dayOfYear,e);case`Do`:return n.ordinalNumber(e,{unit:`date`});default:return gf(t.length,e)}}validate(e,t){return bf(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`L`,`w`,`I`,`d`,`E`,`i`,`e`,`c`,`t`,`T`]}}));function Qf(e,t,n){let r=Ns(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=ss(e),o=a.getDay(),s=(t%7+7)%7,c=7-i;return ds(a,t<0||t>6?t-(o+c)%7:(s+c)%7-(o+c)%7)}var $f=o((()=>{fs(),cs(),Fs()})),ep,tp=o((()=>{$f(),of(),ep=class extends af{priority=90;parse(e,t,n){switch(t){case`E`:case`EE`:case`EEE`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`EEEEE`:return n.day(e,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=Qf(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`D`,`i`,`e`,`c`,`t`,`T`]}})),np,rp=o((()=>{$f(),of(),xf(),np=class extends af{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`e`:case`ee`:return ff(gf(t.length,e),i);case`eo`:return ff(n.ordinalNumber(e,{unit:`day`}),i);case`eee`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`eeeee`:return n.day(e,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=Qf(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`c`,`t`,`T`]}})),ip,ap=o((()=>{$f(),of(),xf(),ip=class extends af{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`c`:case`cc`:return ff(gf(t.length,e),i);case`co`:return ff(n.ordinalNumber(e,{unit:`day`}),i);case`ccc`:return n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});case`ccccc`:return n.day(e,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});default:return n.day(e,{width:`wide`,context:`standalone`})||n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=Qf(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`e`,`t`,`T`]}}));function op(e,t){let n=ss(e);return ds(n,t-Sd(n))}var sp=o((()=>{fs(),Cd(),cs()})),cp,lp=o((()=>{sp(),of(),xf(),cp=class extends af{priority=90;parse(e,t,n){let r=e=>e===0?7:e;switch(t){case`i`:case`ii`:return gf(t.length,e);case`io`:return n.ordinalNumber(e,{unit:`day`});case`iii`:return ff(n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiii`:return ff(n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiiii`:return ff(n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);default:return ff(n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=op(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`E`,`e`,`c`,`t`,`T`]}})),up,dp=o((()=>{of(),xf(),up=class extends af{priority=80;parse(e,t,n){switch(t){case`a`:case`aa`:case`aaa`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`aaaaa`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(vf(n),0,0,0),e}incompatibleTokens=[`b`,`B`,`H`,`k`,`t`,`T`]}})),fp,pp=o((()=>{of(),xf(),fp=class extends af{priority=80;parse(e,t,n){switch(t){case`b`:case`bb`:case`bbb`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`bbbbb`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(vf(n),0,0,0),e}incompatibleTokens=[`a`,`B`,`H`,`k`,`t`,`T`]}})),mp,hp=o((()=>{of(),xf(),mp=class extends af{priority=80;parse(e,t,n){switch(t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`BBBBB`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(vf(n),0,0,0),e}incompatibleTokens=[`a`,`b`,`t`,`T`]}})),gp,_p=o((()=>{df(),of(),xf(),gp=class extends af{priority=70;parse(e,t,n){switch(t){case`h`:return pf(lf.hour12h,e);case`ho`:return n.ordinalNumber(e,{unit:`hour`});default:return gf(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){let r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):!r&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`H`,`K`,`k`,`t`,`T`]}})),vp,yp=o((()=>{df(),of(),xf(),vp=class extends af{priority=70;parse(e,t,n){switch(t){case`H`:return pf(lf.hour23h,e);case`Ho`:return n.ordinalNumber(e,{unit:`hour`});default:return gf(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`K`,`k`,`t`,`T`]}})),bp,xp=o((()=>{df(),of(),xf(),bp=class extends af{priority=70;parse(e,t,n){switch(t){case`K`:return pf(lf.hour11h,e);case`Ko`:return n.ordinalNumber(e,{unit:`hour`});default:return gf(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`h`,`H`,`k`,`t`,`T`]}})),Sp,Cp=o((()=>{df(),of(),xf(),Sp=class extends af{priority=70;parse(e,t,n){switch(t){case`k`:return pf(lf.hour24h,e);case`ko`:return n.ordinalNumber(e,{unit:`hour`});default:return gf(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){let r=n<=24?n%24:n;return e.setHours(r,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`H`,`K`,`t`,`T`]}})),wp,Tp=o((()=>{df(),of(),xf(),wp=class extends af{priority=60;parse(e,t,n){switch(t){case`m`:return pf(lf.minute,e);case`mo`:return n.ordinalNumber(e,{unit:`minute`});default:return gf(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=[`t`,`T`]}})),Ep,Dp=o((()=>{df(),of(),xf(),Ep=class extends af{priority=50;parse(e,t,n){switch(t){case`s`:return pf(lf.second,e);case`so`:return n.ordinalNumber(e,{unit:`second`});default:return gf(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=[`t`,`T`]}})),Op,kp=o((()=>{of(),xf(),Op=class extends af{priority=30;parse(e,t){return ff(gf(t.length,e),e=>Math.trunc(e*10**(-t.length+3)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=[`t`,`T`]}})),Ap,jp=o((()=>{us(),Gs(),df(),of(),xf(),Ap=class extends af{priority=10;parse(e,t){switch(t){case`X`:return mf(uf.basicOptionalMinutes,e);case`XX`:return mf(uf.basic,e);case`XXXX`:return mf(uf.basicOptionalSeconds,e);case`XXXXX`:return mf(uf.extendedOptionalSeconds,e);default:return mf(uf.extended,e)}}set(e,t,n){return t.timestampIsSet?e:ls(e,e.getTime()-Ws(e)-n)}incompatibleTokens=[`t`,`T`,`x`]}})),Mp,Np=o((()=>{us(),Gs(),df(),of(),xf(),Mp=class extends af{priority=10;parse(e,t){switch(t){case`x`:return mf(uf.basicOptionalMinutes,e);case`xx`:return mf(uf.basic,e);case`xxxx`:return mf(uf.basicOptionalSeconds,e);case`xxxxx`:return mf(uf.extendedOptionalSeconds,e);default:return mf(uf.extended,e)}}set(e,t,n){return t.timestampIsSet?e:ls(e,e.getTime()-Ws(e)-n)}incompatibleTokens=[`t`,`T`,`X`]}})),Pp,Fp=o((()=>{us(),of(),xf(),Pp=class extends af{priority=40;parse(e){return hf(e)}set(e,t,n){return[ls(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens=`*`}})),Ip,Lp=o((()=>{us(),of(),xf(),Ip=class extends af{priority=20;parse(e){return hf(e)}set(e,t,n){return[ls(e,n),{timestampIsSet:!0}]}incompatibleTokens=`*`}})),Rp,zp=o((()=>{cf(),Cf(),Tf(),Df(),kf(),jf(),Nf(),Ff(),Lf(),Vf(),Gf(),Yf(),Zf(),tp(),rp(),ap(),lp(),dp(),pp(),hp(),_p(),yp(),xp(),Cp(),Tp(),Dp(),kp(),jp(),Np(),Fp(),Lp(),Rp={G:new sf,y:new Sf,Y:new wf,R:new Ef,u:new Of,Q:new Af,q:new Mf,M:new Pf,L:new If,w:new Bf,I:new Wf,d:new Jf,D:new Xf,E:new ep,e:new np,c:new ip,i:new cp,a:new up,b:new fp,B:new mp,h:new gp,H:new vp,K:new bp,k:new Sp,m:new wp,s:new Ep,S:new Op,X:new Ap,x:new Mp,t:new Pp,T:new Ip}}));function Bp(e,t,n,r){let i=yd(),a=r?.locale??i.locale??du,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0;if(t===``)return e===``?ss(n):ls(n,NaN);let c={firstWeekContainsDate:o,weekStartsOn:s,locale:a},l=[new nf],u=t.match(Up).map(e=>{let t=e[0];if(t in Lu){let n=Lu[t];return n(e,a.formatLong)}return e}).join(``).match(Hp),d=[];for(let i of u){!r?.useAdditionalWeekYearTokens&&Bu(i)&&Vu(i,t,e),!r?.useAdditionalDayOfYearTokens&&zu(i)&&Vu(i,t,e);let o=i[0],s=Rp[o];if(s){let{incompatibleTokens:t}=s;if(Array.isArray(t)){let e=d.find(e=>t.includes(e.token)||e.token===o);if(e)throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${i}\` at the same time`)}else if(s.incompatibleTokens===`*`&&d.length>0)throw RangeError(`The format string mustn't contain \`${i}\` and any other token at the same time`);d.push({token:o,fullToken:i});let r=s.run(e,i,a.match,c);if(!r)return ls(n,NaN);l.push(r.setter),e=r.rest}else{if(o.match(qp))throw RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");if(i===`''`?i=`'`:o===`'`&&(i=Vp(i)),e.indexOf(i)===0)e=e.slice(i.length);else return ls(n,NaN)}}if(e.length>0&&Kp.test(e))return ls(n,NaN);let f=l.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>l.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]),p=ss(n);if(isNaN(p.getTime()))return ls(n,NaN);let m={};for(let e of f){if(!e.validate(p,c))return ls(n,NaN);let t=e.set(p,m,c);Array.isArray(t)?(p=t[0],Object.assign(m,t[1])):p=t}return ls(n,p)}function Vp(e){return e.match(Wp)[1].replace(Gp,`'`)}var Hp,Up,Wp,Gp,Kp,qp,Jp=o((()=>{us(),bd(),pu(),cs(),Ru(),Ku(),zp(),rf(),Hp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Up=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Wp=/^'([^]*?)'?$/,Gp=/''/g,Kp=/\S/,qp=/[a-zA-Z]/})),Yp=o((()=>{})),Xp=o((()=>{})),Zp=o((()=>{})),Qp=o((()=>{})),$p=o((()=>{})),em=o((()=>{})),tm=o((()=>{})),nm=o((()=>{})),rm=o((()=>{})),im=o((()=>{})),am=o((()=>{})),om=o((()=>{})),sm=o((()=>{})),cm=o((()=>{})),lm=o((()=>{})),um=o((()=>{})),dm=o((()=>{})),fm=o((()=>{})),pm=o((()=>{})),mm=o((()=>{})),hm=o((()=>{})),gm=o((()=>{})),_m=o((()=>{})),vm=o((()=>{})),ym=o((()=>{})),bm=o((()=>{})),xm=o((()=>{}));function Sm(e,t){let n=+ss(e),[r,i]=[+ss(t.start),+ss(t.end)].sort((e,t)=>e-t);return n>=r&&n<=i}var Cm=o((()=>{cs()}));function wm(e,t){return ds(e,-t)}var Tm=o((()=>{fs()})),Em=o((()=>{})),Dm=o((()=>{})),Om=o((()=>{})),km=o((()=>{})),Am=o((()=>{})),jm=o((()=>{})),Mm=o((()=>{})),Nm=o((()=>{})),Pm=o((()=>{})),Fm=o((()=>{})),Im=o((()=>{})),Lm=o((()=>{})),Rm=o((()=>{})),zm=o((()=>{})),Bm=o((()=>{})),Vm=o((()=>{})),Hm=o((()=>{})),Um=o((()=>{})),Wm=o((()=>{})),Gm=o((()=>{})),Km=o((()=>{})),qm=o((()=>{})),Jm=o((()=>{})),Ym=o((()=>{})),Xm=o((()=>{})),Zm=o((()=>{})),Qm=o((()=>{})),$m=o((()=>{})),eh=o((()=>{})),th=o((()=>{})),nh=o((()=>{})),rh=o((()=>{})),ih=o((()=>{})),ah=o((()=>{})),oh=o((()=>{})),sh=o((()=>{})),ch=o((()=>{})),lh=o((()=>{})),uh=o((()=>{})),dh=o((()=>{})),fh=o((()=>{})),ph=o((()=>{})),mh=o((()=>{})),hh=o((()=>{})),gh=o((()=>{})),_h=o((()=>{})),vh=o((()=>{})),yh=o((()=>{})),bh=o((()=>{})),xh=o((()=>{})),Sh=o((()=>{})),Ch=o((()=>{})),wh=o((()=>{})),Th=o((()=>{})),Eh=o((()=>{})),Dh=o((()=>{})),Oh=o((()=>{})),kh=o((()=>{}));function Ah(e,t){return ps(e,-t)}var jh=o((()=>{ms()})),Mh=o((()=>{})),Nh=o((()=>{})),Ph=o((()=>{})),Fh=o((()=>{})),Ih=o((()=>{})),Lh=o((()=>{})),Rh=o((()=>{})),zh=o((()=>{}));function Bh(e,t){return nc(e,-t)}var Vh=o((()=>{rc()})),Hh=o((()=>{})),Uh=o((()=>{})),Wh=o((()=>{})),Gh=o((()=>{})),Kh=o((()=>{hs(),ys(),fs(),Ms(),Zs(),bs(),Qs(),ms(),$s(),ec(),tc(),rc(),ic(),sc(),cc(),lc(),uc(),dc(),us(),fc(),pc(),yc(),qs(),bc(),xc(),Sc(),wc(),Tc(),Ec(),kc(),jc(),Nc(),Ac(),Pc(),Bc(),Vc(),Hc(),Uc(),Wc(),Gc(),Kc(),Jc(),Yc(),Zc(),Qc(),$c(),nl(),sl(),cl(),Ic(),ll(),ul(),pl(),ml(),hl(),Rc(),gl(),_l(),vl(),yl(),fl(),il(),bl(),ed(),td(),nd(),rd(),id(),ad(),od(),sd(),cd(),ld(),ud(),dd(),fd(),pd(),md(),hu(),hd(),_d(),vd(),bd(),xd(),Cd(),_u(),Vs(),wd(),Td(),Ed(),Dd(),Od(),Cc(),kd(),Ad(),jd(),Cu(),Md(),yu(),Pd(),Fd(),Id(),Ld(),Rd(),zd(),Bd(),Vd(),Hd(),Wd(),Gd(),gc(),Kd(),qd(),Jd(),Yd(),Xd(),zc(),gd(),Yp(),Xp(),Zp(),mc(),$p(),tm(),nm(),rm(),im(),am(),sm(),em(),cm(),gs(),_s(),lm(),um(),dm(),fm(),pm(),mm(),hm(),gm(),_m(),vm(),ym(),bm(),vc(),xm(),vs(),Cm(),Em(),Dm(),km(),Am(),Nd(),jm(),Om(),Mm(),Nm(),ac(),Pm(),Fm(),Im(),Lm(),oc(),Rm(),zm(),Bm(),Vm(),Hm(),Um(),Wm(),Gm(),Km(),qm(),Jm(),Ym(),Xm(),Jp(),Zm(),Qm(),$m(),eh(),th(),nh(),rh(),ih(),ah(),oh(),sh(),ch(),lh(),uh(),dh(),fh(),ph(),hh(),gh(),$f(),_h(),vh(),yh(),sp(),Uf(),Xs(),bh(),xh(),mh(),Sh(),Ch(),zf(),wh(),Th(),Us(),Eh(),Qp(),zs(),Ys(),qc(),tl(),Xc(),om(),Dh(),Oh(),Ls(),xu(),ol(),kh(),Mh(),Nh(),Tm(),Ph(),Mc(),Fh(),Ih(),jh(),Lh(),Rh(),zh(),Vh(),cs(),Qd(),Hh(),Uh(),Wh(),Gh()}));function qh(e){let t;try{if(t=Yh&&(self.URL||self.webkitURL).createObjectURL(Yh),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(Jh),{name:e?.name})}}var Jh,Yh,Xh=o((()=>{Jh="(function(){function e(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e==`object`&&t===`[object Date]`?new e.constructor(+e):typeof e==`number`||t===`[object Number]`||typeof e==`string`||t===`[object String]`?new Date(e):new Date(NaN)}function t(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function n(n,r){let i=e(n);return isNaN(r)?t(n,NaN):(r&&i.setDate(i.getDate()+r),i)}function r(n,r){let i=e(n);if(isNaN(r))return t(n,NaN);if(!r)return i;let a=i.getDate(),o=t(n,i.getTime());return o.setMonth(i.getMonth()+r+1,0),a>=o.getDate()?o:(i.setFullYear(o.getFullYear(),o.getMonth(),a),i)}let i={};function a(){return i}function o(t,n){let r=a(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=e(t),s=o.getDay(),c=(s<i?7:0)+s-i;return o.setDate(o.getDate()-c),o.setHours(0,0,0,0),o}function s(e,t){return r(e,t*12)}function c(t){let n=e(t),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function l(t){let n=e(t);return n.setDate(1),n.setHours(0,0,0,0),n}function u(t){let n=e(t),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function d(n){let r=e(n),i=t(n,0);return i.setFullYear(r.getFullYear(),0,1),i.setHours(0,0,0,0),i}function f(t,n){let r=a(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=e(t),s=o.getDay(),c=(s<i?-7:0)+6-(s-i);return o.setDate(o.getDate()+c),o.setHours(23,59,59,999),o}function p(t,n){let r=+e(t),[i,a]=[+e(n.start),+e(n.end)].sort((e,t)=>e-t);return r>=i&&r<=a}function m(e,t){return n(e,-t)}function h(e,t){return r(e,-t)}function g(e,t){return s(e,-t)}let _=/\\s#([^\\u2000-\\u206F\\u2E00-\\u2E7F'!\"#$%&()*+,.:;<=>?@^`{|}~\\[\\]\\\\\\s]+)/g,v=/(<p>|<br>)#([^\\u2000-\\u206F\\u2E00-\\u2E7F'!\"#$%&()*+,.:;<=>?@^`{|}~\\[\\]\\\\\\s]+)/g,y=/^#([^\\u2000-\\u206F\\u2E00-\\u2E7F'!\"#$%&()*+,.:;<=>?@^`{|}~\\[\\]\\\\\\s]+)/gu,b=/(\\s|:|\\(|>|^)((http|ftp|https):\\/\\/([\\w_-]+(?:(?:\\.[\\w_-]+)+))([\\w.,@?^=%&:/~+#-]*[\\w@?^=%&/~+#-]))/g,x=/([^\\s<\\\\*>'(]+\\.(jpeg|jpg|gif|png|svg))(\\]\\])?(\\))?/g,S=/\\[@(.+?)\\]\\((.+?)\\)/g;function C(e){return[/#([^\\s#]+)/g,/\\n#([^\\s#]+)/g,/^#([^\\s#]+)/g].reduce((t,n)=>((e.match(n)||[]).forEach(e=>{let r=e.replace(n,`$1`).trim().split(`/`),i=``;r.forEach(e=>{i+=e,t.add(i),i+=`/`})}),t),new Set)}function w(e){if(!Array.isArray(e)||e.length===0)return new Set;let t=e.filter(e=>!!e).map(e=>e.toString().trim());if(t.length===0)return new Set;let n=new Set;return t.forEach(e=>{let t=e.split(`/`),r=``;t.forEach((e,t)=>{r+=(t>0?`/`:``)+e,n.add(r)})}),n}function T(e){let t=e.toLowerCase();return e=>e.includes(t)}function E(e,t,n){let{onlyFilterType:r,filterArchived:i=!0,filterDeleted:a=!0,filterDoneTasks:o=!1,filterComments:s=!0,filterTagsInFile:c=!1}=n||{},l=/#([^\\s#]+)/g,u=/^#([^\\s#]+)/g,d=/\\n#([^\\s#]+)/g,f=/\\[(.+?)\\]\\((.+?)\\)/g,p=/!\\[(.+?)\\]\\((.+?)\\)/g,m=/\\[\\[(.+?)\\]\\]/g,h=e;if(r&&r!==`all`)switch(r){case`archived`:h=e.filter(e=>e.rowStatus===`ARCHIVED`&&!e.deletedAt),console.log(h,e);break;case`deleted`:h=e.filter(e=>e.deletedAt!==``&&e.deletedAt);break;case`doneTasks`:h=e.filter(e=>e.thinoType===`TASK-DONE`);break;case`comments`:h=e.filter(e=>e.content.includes(`comment:`));break}else h=e.filter(e=>!(i&&e.rowStatus===`ARCHIVED`||a&&e.deletedAt||s&&e.content.includes(`comment:`)||o&&e.thinoType===`TASK-DONE`));if(console.log(t,D(t)),D(t))return h;let{tag:g,duration:_,type:v,text:y,filter:b,path:x,metadata:S}=t,E=y?.toLowerCase()||``,A=!S||Object.keys(S).length===0,j=E?T(E):null;return h.filter(e=>{if(b)try{let n=t.filterContent;if(Array.isArray(n)&&!k(e,n))return!1}catch(e){console.error(`Failed to parse query filters:`,e)}if(!A&&Object.keys(S).some(t=>e.fileInfo?.frontmatter[t]!==S[t])||x&&e.path&&!e.path.toLowerCase().includes(x.toLowerCase()))return!1;if(j){let t=j(e.content.toLowerCase()),n=e.path?e.path.toLowerCase().includes(E):!1;if(e.thinoType===`MULTI`&&e.path){if(!t&&!n)return!1}else if(!t)return!1}if(g){let t=C(e.content),n=c?w(e.fileInfo?.tags||[]):new Set;if(!t.has(g)&&!n.has(g))return!1}if(_&&_.from!==0&&_.to!==0){let t=e.createdAtTs??O(e.createdAt);if(t<_.from||t>_.to)return!1}if(v)switch(v){case`NOT_TAGGED`:if(e.content.match(l)||e.content.match(u)||e.content.match(d))return!1;break;case`LINKED`:if(!e.content.match(f))return!1;break;case`IMAGED`:if(!e.content.match(p))return!1;break;case`CONNECTED`:if(!e.content.match(m))return!1;break}return!0})}function D(e){if(!e)return!0;let{tag:t,duration:n,type:r,text:i,filter:a,path:o,metadata:s}=e,c=!s||Object.keys(s).length===0;return!(t||n&&n.from<n.to||r||i||a||o||!c)}function O(e){return new Date(e).getTime()}function k(e,t){if(!Array.isArray(t)||t.length===0)return!0;let n=A(e,t[0]);for(let r=1;r<t.length;r++){let i=t[r],a=A(e,i);i.relation===`OR`?n||=a:n&&=a}return n}function A(e,t){if(!t||typeof t!=`object`||!t.type||!t.value||typeof t.value!=`object`)return!0;let{type:n,value:r}=t,i=r.operator,a=r.value;switch(n){case`TAG`:{let t=typeof a==`string`?a:``,n=e.content.includes(`#${t}`);return i===`CONTAIN`?n:!n}case`TEXT`:{let t=typeof a==`string`?a.toLowerCase():``,n=e.content.toLowerCase().includes(t);return i===`CONTAIN`?n:!n}case`TYPE`:{let t=!1;return(a===`NOT_TAGGED`&&e.content.match(_)===null&&e.content.match(v)===null&&e.content.match(y)===null||a===`LINKED`&&e.content.match(b)!==null||a===`IMAGED`&&e.content.match(x)!==null||a===`CONNECTED`&&e.content.match(S)!==null)&&(t=!0),i===`IS`?t:!t}case`DATE`:{let t=typeof a==`string`?new Date(a):typeof a==`object`&&a&&`value`in a?new Date(a.value):null;if(!t)return!0;let n=new Date(e.createdAt);return i===`CONTAIN`?n>=t:n<t}case`LIST`:switch(a){case`TODO`:{let t=e.thinoType===`TASK-TODO`;return i===`IS`?t:!t}case`DONE`:{let t=e.thinoType===`TASK-DONE`;return i===`IS`?t:!t}case`LIST`:{let t=e.thinoType===`JOURNAL`;return i===`IS`?t:!t}case`OTHER`:{let t=![`TASK-TODO`,`TASK-DONE`,`JOURNAL`].includes(e.thinoType);return i===`IS`?t:!t}default:return!0}case`SOURCE`:return i===`IS`?e.sourceType===a:e.sourceType!==a;case`PATH`:{if(!e.path)return i!==`CONTAIN`;let t=typeof a==`string`?a.toLowerCase():``,n=e.path.toLowerCase().includes(t);return i===`CONTAIN`?n:!n}case`METADATA`:{if(!e.fileInfo?.frontmatter)return i!==`CONTAIN`;let t=typeof a==`object`&&a?a:{name:``,value:``},n=`name`in t?t.name:``,r=`value`in t?t.value:``;if(!n)return!0;let o=e.fileInfo.frontmatter[n]===r;return i===`CONTAIN`?o:!o}case`TIME_RANGE`:{let t=new Date,n,r=t;if(typeof a!=`string`)return!0;switch(a){case`7d`:n=m(t,7);break;case`14d`:n=m(t,14);break;case`30d`:n=m(t,30);break;case`90d`:n=m(t,90);break;case`180d`:n=m(t,180);break;case`365d`:n=m(t,365);break;case`thisWeek`:n=o(t),r=f(t);break;case`thisMonth`:n=l(t),r=c(t);break;case`thisYear`:n=d(t),r=u(t);break;case`lastWeek`:{let e=m(t,7);n=o(e),r=f(e);break}case`lastMonth`:{let e=h(t,1);n=l(e),r=c(e);break}case`lastYear`:{let e=g(t,1);n=d(e),r=u(e);break}default:return!0}let s=new Date(e.createdAt);return i===`WITHIN`?p(s,{start:n,end:r}):i===`BEFORE`?s<n:!0}default:return!0}}let j=e=>{let t={};return e.forEach(e=>{let n=e.createdAt.split(` `)[0];t[n]?t[n]++:t[n]=1}),Object.keys(t).sort((e,n)=>t[n]-t[e])[0]||``},M=e=>{let t={};return e.forEach(e=>{let n=e.createdAt.slice(11,13);t[n]?t[n]++:t[n]=1}),Object.keys(t).sort((e,n)=>t[n]-t[e])[0]||``},N=(e,t)=>{let n=Math.abs(t.getTime()-e.getTime());return Math.round(n/864e5)+1};function P(e,t){let n=new Set,r={},i=new Map;for(let a of e){if(a.deletedAt!==``&&a.deletedAt||a.rowStatus===`ARCHIVED`)continue;let e=[];if(t.filterTagsInFile&&!i.has(a.path)){let t=(Array.isArray(a?.fileInfo?.tags)?a.fileInfo.tags:typeof a?.fileInfo?.tags==`string`?[a.fileInfo.tags]:[]).filter(e=>e).map(e=>e.toString().trim());i.set(a.path,t),e.push(...t)}let o=a.content.replace(/<[^>]*>/g,``).replace(/\\`\\`\\`(.*)?\\n[\\s\\S]*?\\n\\`\\`\\`/gm,``).replace(/\\`([^\\`].*?)\\`/g,``),s=[...Array.from(o.match(_)||[]),...Array.from(o.match(y)||[]),...Array.from(o.match(v)||[])];e.push(...s);for(let t of e){if(!t||t===`undefined`)continue;let e=t.replace(_,`$1`).replace(y,`$1`).replace(v,`$2`).trim();e&&!/^\\d+$/.test(e)&&(n.add(e),r[e]=(r[e]||0)+1)}}return{tagsSet:n,counts:r}}self.addEventListener(`message`,e=>{Promise.resolve().then(async()=>{try{let{type:t,data:n}=e.data;if(t===`filter-memos`){let{memos:e,query:t,filterOptions:r}=n,i=E(e,t,r);console.log(`filteredMemos`,i),postMessage({type:`filter-result`,data:i})}else if(t===`build-tag-tree`){let{memos:e,filterOptions:t}=n,{tagsSet:r,counts:i}=P(e,t);postMessage({type:`build-tag-tree-result`,data:{tagsSet:r,counts:i}})}else if(t===`calculate-stats-banner`){let{memos:e,tags:t}=n,r=e.filter(e=>!(e.deletedAt!==``&&e.deletedAt)).length,i=t.length,a=e.length>0?e[e.length-1]:null,o=0;if(a&&a.createdAt){let e=a.createdAt.split(` `)[0].split(`/`);o=N(new Date(parseInt(e[0]),parseInt(e[1])-1,parseInt(e[2])),new Date)}let s=e.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`).filter(e=>e.thinoType&&e.thinoType?.startsWith(`TASK`)).length,c=j(e),l=M(e);postMessage({type:`stats-banner-result`,data:{memosLength:r,tagsLength:i,createdDays:o,taskAmount:s,mostActiveDay:c,mostActiveHour:l,earliestMemo:a,lengthOverflow:r>9999||i>999||o>999}})}else if(t===`calculate-stats`){let{memos:e}=n,t=new Date,r=new Date(t),i=[...Array(30)].map((t,n)=>{let i=new Date(r);i.setDate(r.getDate()-(29-n));let a=i.toISOString().split(`T`)[0].replace(/-/g,`/`),o=e.filter(e=>e.createdAt.split(` `)[0]===a).length;return{date:`${(i.getMonth()+1).toString().padStart(2,`0`)}/${i.getDate().toString().padStart(2,`0`)}`,count:o}}),a=t.getMonth(),o=t.getFullYear(),s=new Date(o,a+1,0).getDate(),c=[...Array(s)].map((t,n)=>{let r=new Date(o,a,n+1),i=r.toISOString().split(`T`)[0].replace(/-/g,`/`),s=e.filter(e=>e.createdAt.split(` `)[0]===i).length;return{date:`${(r.getMonth()+1).toString().padStart(2,`0`)}/${r.getDate().toString().padStart(2,`0`)}`,count:s}}),l=[...Array(12)].map((t,n)=>{let r=new Date(o,n,1),i=r.toISOString().slice(0,7).replace(/-/g,`/`),a=e.filter(e=>e.createdAt.slice(0,7)===i).length;return{date:`${(r.getMonth()+1).toString().padStart(2,`0`)}`,count:a}}),u=[...Array(24)].map((t,n)=>{let r=e.filter(e=>parseInt(e.createdAt.split(` `)[1].split(`:`)[0])===n).length;return{hour:`${n.toString().padStart(2,`0`)}:00`,count:r}}),d=[{period:`00:00-03:00`,count:0},{period:`03:00-06:00`,count:0},{period:`06:00-09:00`,count:0},{period:`09:00-12:00`,count:0},{period:`12:00-15:00`,count:0},{period:`15:00-18:00`,count:0},{period:`18:00-21:00`,count:0},{period:`21:00-24:00`,count:0}];e.forEach(e=>{let t=parseInt(e.createdAt.split(` `)[1].split(`:`)[0]);t<3?d[0].count++:t<6?d[1].count++:t<9?d[2].count++:t<12?d[3].count++:t<15?d[4].count++:t<18?d[5].count++:t<21?d[6].count++:d[7].count++});let f=[{min:0,max:25,label:`0-25`},{min:26,max:50,label:`26-50`},{min:51,max:75,label:`51-75`},{min:76,max:100,label:`76-100`},{min:101,max:200,label:`101-200`},{min:201,max:500,label:`201-500`},{min:501,max:1/0,label:`500+`}].map(t=>({range:t.label,count:e.filter(e=>{let n=e.content.length;return n>=t.min&&n<=t.max}).length}));postMessage({type:`stats-result`,data:{dailyData:i,monthlyData:c,yearlyData:l,hourlyData:u,timeDistData:d,lengthData:f}})}}catch(e){console.error(`Worker failed to process:`,e),postMessage({type:`error`,error:e.message||`Unknown error in worker`})}})})})();",Yh=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,Jh],{type:`text/javascript;charset=utf-8`})}));function Zh(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}var Qh=o((()=>{}));function $h(e){e.worker.terminate(),e.active&&e.active[1].reject(`Terminated`),e.active=void 0}var eg,tg,ng,rg,ig,ag,og=o((()=>{Xh(),Qh(),H(),eg={workers:8,utilization:.75,workerName:`Thino Parser Worker`},tg=function(e){return e[e.HIGH=0]=`HIGH`,e[e.MEDIUM=1]=`MEDIUM`,e[e.LOW=2]=`LOW`,e}(tg||{}),ng=function(e){return e.BUILD_TAG_TREE=`BUILD_TAG_TREE`,e.CALCULATE_STATS=`CALCULATE_STATS`,e.CALCULATE_STATS_BANNER=`CALCULATE_STATS_BANNER`,e.FILTER_MEMOS=`FILTER_MEMOS`,e.PARSE_FILE=`PARSE_FILE`,e.FILTER_MEMOS_TOP_K=`FILTER_MEMOS_TOP_K`,e}(ng||{}),rg={[ng.BUILD_TAG_TREE]:tg.HIGH,[ng.CALCULATE_STATS]:tg.HIGH,[ng.CALCULATE_STATS_BANNER]:tg.HIGH,[ng.FILTER_MEMOS]:tg.LOW,[ng.PARSE_FILE]:tg.MEDIUM,[ng.FILTER_MEMOS_TOP_K]:tg.HIGH},ig=e=>{let t={...e};if(e.filter){let n=Bg.getQueryById(e.filter);n&&n.querystring&&(t.filterContent=JSON.parse(n.querystring))}return t},ag=class extends f.Component{workers;nextWorkerId;shutdown;taskQueue;outstanding;throttle;cacheVersion=0;memoVersions=new Map;app;plugin;constructor(e,t,n,r){super(),this.workers=new Map,this.shutdown=!1,this.nextWorkerId=0,this.throttle=n??(()=>({...eg,workerName:r??eg.workerName})),this.taskQueue=[],this.outstanding=new Map,this.app=e,this.plugin=t}import(e){let t=e.map(e=>e.id).join(`,`),n=this.outstanding.get(t);if(n)return n;let r=Zh();return this.outstanding.set(t,r),this.addToQueue({type:ng.FILTER_MEMOS,memos:e,promise:r,priority:tg.LOW,timestamp:Date.now(),outstandingKey:t}),this.schedule(),r}addToQueue(e){this.taskQueue.push(e),this.taskQueue.sort((e,t)=>e.priority===t.priority?e.timestamp-t.timestamp:e.priority-t.priority)}getNextTask(){if(this.taskQueue.length!==0)return this.taskQueue.shift()}unthrottle(){for(let e of this.workers.values())e.availableAt=Date.now()}async schedule(){if(this.taskQueue.length===0||this.shutdown)return;let e=this.availableWorker();if(!e)return;let t=this.getNextTask();if(t){e.active=[t.memos,t.promise,Date.now(),t.outstandingKey];try{switch(t.type){case ng.CALCULATE_STATS:e.worker.postMessage({type:`calculate-stats`,data:{memos:t.memos}});break;case ng.CALCULATE_STATS_BANNER:e.worker.postMessage({type:`calculate-stats-banner`,data:{memos:t.memos,tags:t.tags||[]}});break;case ng.FILTER_MEMOS:case ng.FILTER_MEMOS_TOP_K:e.worker.postMessage({type:`filter-memos`,data:{memos:t.memos,query:ig(t.query),filterOptions:t.filterOptions,topK:t.topK,returnIds:!!t.topK}});break;case ng.BUILD_TAG_TREE:e.worker.postMessage({type:`build-tag-tree`,data:{memos:t.memos,filterOptions:t.filterOptions}});break;case ng.PARSE_FILE:e.worker.postMessage({type:`parse-file`,data:{filePath:t.filePath,mtime:t.mtime,cacheVersion:this.cacheVersion}});break}}catch(t){console.log(`Obsidian-Thino: Background processing failed. `+t),e.active=void 0,setTimeout(this.schedule.bind(this),0)}}}finish(e,t){if(!e.active){console.log(`Obsidian-Thino: Received a stale worker message. Ignoring.`,t);return}let[n,r,i,a]=e.active;if(`error`in t?r.reject(t.error):r.resolve(t),a)this.outstanding.delete(a);else for(let[e,t]of this.outstanding.entries())if(t===r){this.outstanding.delete(e);break}if(this.workers.size>this.throttle().workers)this.workers.delete(e.id),$h(e);else{let t=Date.now(),n=Math.max(.1,this.throttle().utilization)-1,r=(t-i)*n;e.active=void 0,r<=1e-10?(e.availableAt=t,this.schedule()):(e.availableAt=t+r,setTimeout(this.schedule.bind(this),r))}}availableWorker(){let e=Date.now();for(let t of this.workers.values())if(!t.active&&t.availableAt<=e)return t;if(this.workers.size<this.throttle().workers){let e=this.newWorker();return this.workers.set(e.id,e),e}}newWorker(){let e={id:this.nextWorkerId++,availableAt:Date.now(),worker:new qh,name:this.throttle().workerName};return e.worker.onmessage=async t=>await this.handleWorkerMessage(e,t.data),e}onunload(){for(let e of this.workers.values())$h(e);for(;this.taskQueue.length>0;){let e=this.taskQueue.shift();e&&e.promise.reject(`Terminated`)}this.shutdown=!0}invalidateCache(e){if(!e||e.length===0){this.cacheVersion++,console.log(`Invalidated all cache, new version:`,this.cacheVersion);return}for(let t of e){let e=this.memoVersions.get(t)||0;this.memoVersions.set(t,e+1)}let t=[];this.outstanding.forEach((n,r)=>{let i=r.split(`_`);e.some(e=>i.includes(e))&&t.push(r)}),t.forEach(e=>this.outstanding.delete(e)),console.log(`Invalidated cache for ${e.length} memos`)}getVersionString(e){let t=`_v${this.cacheVersion}`;if(e&&e.length>0){let n=e.slice(0,10).map(e=>`${e.id}:${this.memoVersions.get(e.id)||0}`).join(`;`);t+=`_m${n}_len${e.length}`}return t}async calculateStats(e,t=!1){try{if(!e||e.length===0)return{};let n=t?`_force${Date.now()}`:this.getVersionString(e),r=e.map(e=>e.id).join(`,`)+`_stats`+n,i=this.outstanding.get(r);if(i&&!t)return i;let a=Zh();return this.outstanding.set(r,a),this.addToQueue({type:ng.CALCULATE_STATS,memos:e,promise:a,priority:rg[ng.CALCULATE_STATS],timestamp:Date.now(),outstandingKey:r}),this.schedule(),a}catch(e){return console.error(`Obsidian-Thino: Failed to calculate stats. `+e),Promise.reject(e)}}async calculateStatsBanner(e,t,n=!1){try{if(!e||e.length===0)return{memosLength:0,tagsLength:t?.length||0,createdDays:0,taskAmount:0,mostActiveDay:``,mostActiveHour:``,earliestMemo:null,lengthOverflow:!1};let r=n?`_force${Date.now()}`:this.getVersionString(e),i=e.map(e=>e.id).join(`,`)+`_banner`+r,a=this.outstanding.get(i);if(a&&!n)return a;let o=Zh();return this.outstanding.set(i,o),this.addToQueue({type:ng.CALCULATE_STATS_BANNER,memos:e,tags:t,promise:o,priority:rg[ng.CALCULATE_STATS_BANNER],timestamp:Date.now(),outstandingKey:i}),this.schedule(),o}catch(e){return console.error(`Obsidian-Thino: Failed to calculate banner stats. `+e),Promise.reject(e)}}async parseFile(e,t,n){try{let r=`parse_${e}_${t}_v${n}`,i=this.outstanding.get(r);if(i)return console.log(`ThinoDebug parseFile: using existing promise`,{filePath:e}),i;let a=Zh();return this.outstanding.set(r,a),this.addToQueue({type:ng.PARSE_FILE,memos:[],promise:a,filePath:e,mtime:t,priority:rg[ng.PARSE_FILE],timestamp:Date.now()}),this.schedule(),a}catch(e){return console.error(`Obsidian-Thino: Failed to parse file. `+e),Promise.reject(e)}}async filterMemos(e,t,n={},r,i=!1){try{if(!e||e.length===0)return[];let a=ig(t),o=JSON.stringify(a),s=JSON.stringify({...n,filterTagsInFile:this.plugin.settings.FilterByMetadata}),c=i?`_force${Date.now()}`:this.getVersionString(e),l=e.slice(0,20).map(e=>`${e.id}-${e.updatedAt||e.createdAt}`).join(`|`)+`|total:${e.length}_filter_`+o+`_`+s+(r?`_topK${r}`:``)+c,u=this.outstanding.get(l);if(u&&!i)return console.log(`Using cached filter result`),u;let d=Zh();this.outstanding.set(l,d);let f=r?ng.FILTER_MEMOS_TOP_K:ng.FILTER_MEMOS;return this.addToQueue({type:f,memos:e,promise:d,query:a,filterOptions:n,topK:r,priority:rg[f],timestamp:Date.now(),outstandingKey:l}),this.schedule(),d}catch(e){return console.error(`Obsidian-Thino: Failed to filter memos. `+e),Promise.reject(e)}}async buildTagTree(e,t=!1){try{if(!e||e.length===0)return{};let n={filterTagsInFile:this.plugin.settings.FilterByMetadata},r=t?`_force${Date.now()}`:this.getVersionString(e),i=e.map(e=>e.id).join(`,`)+`_tags_`+JSON.stringify(n)+r,a=this.outstanding.get(i);if(a&&!t)return a;let o=Zh();return this.outstanding.set(i,o),this.addToQueue({type:ng.BUILD_TAG_TREE,memos:e,promise:o,filterOptions:n,priority:rg[ng.BUILD_TAG_TREE],timestamp:Date.now(),outstandingKey:i}),this.schedule(),o}catch(e){return console.error(`Obsidian-Thino: Failed to build tag tree. `+e),Promise.reject(e)}}async handleWorkerMessage(e,t){if(t.type===`stats-result`){e.active&&(console.log(`[${e.name}] Received stats-result for worker #${e.id}`),this.finish(e,t.data));return}if(t.type===`stats-banner-result`){e.active&&(console.log(`[${e.name}] Received stats-banner-result for worker #${e.id}`),this.finish(e,t.data));return}if(t.type===`filter-result`){e.active&&(console.log(`[${e.name}] Received filter-result for worker #${e.id}`,t.data),this.finish(e,t.data));return}if(t.type===`build-tag-tree-result`){e.active&&(console.log(`[${e.name}] Received build-tag-tree-result for worker #${e.id}`,t.data),this.finish(e,t.data));return}if(t.type===`parse-file-result`){e.active&&(console.log(`[${e.name}] Received parse-file-result for worker #${e.id}`,t.data),this.finish(e,t.data));return}if(t.type===`error`){e.active&&(console.log(`[${e.name}] Error from worker #${e.id}:`,t.error),this.finish(e,{error:t.error}));return}}memoUpdated(e){let t=this.memoVersions.get(e)||0;this.memoVersions.set(e,t+1);let n=[];this.outstanding.forEach((t,r)=>{r.includes(e)&&n.push(r)}),n.forEach(e=>this.outstanding.delete(e)),console.log(`Updated version for memo ${e} to ${t+1}`)}memosUpdated(e){if(!e||e.length===0)return;for(let t of e){let e=this.memoVersions.get(t)||0;this.memoVersions.set(t,e+1)}let t=[];this.outstanding.forEach((n,r)=>{let i=r.split(`,`)[0].split(`_`);e.some(e=>i.includes(e))&&t.push(r)}),t.forEach(e=>this.outstanding.delete(e)),console.log(`Updated versions for ${e.length} memos`)}}}));function sg(e){return e.thinoWorkerManager||(e.thinoWorkerManager=new ag(e.app,e),e.addChild(e.thinoWorkerManager)),e.thinoWorkerManager}function cg(e,t,n){let{filterArchived:r=!0,filterDeleted:i=!0,filterDoneTasks:a=!1,filterComments:o=!0}=n,s=e.filter(e=>!(r&&e.rowStatus===`ARCHIVED`||i&&e.deletedAt||o&&e.content.includes(`comment:`)||a&&e.thinoType===`TASK-DONE`));if(lg(t))return s;let{tag:c,duration:l,type:u,text:d,filter:p,path:m,metadata:h}=t,g=d?.toLowerCase()||``,_=!h||Object.keys(h).length===0,v=g?(0,f.prepareSimpleSearch)(g):null;return console.log(`prepared`,v),s.filter(e=>{if(p){let t=Bg.getQueryById(p);if(console.log(`queryFilter`,t),t){let n=JSON.parse(t.querystring);if(Array.isArray(n)&&!fg(e,n))return!1}}if(!_&&Object.keys(h).some(t=>e.fileInfo?.frontmatter[t]!==h[t])||m&&e.path&&!e.path.toLowerCase().includes(m.toLowerCase()))return!1;if(v){let t=v(e.content.toLowerCase()),n=e.path?e.path.toLowerCase().includes(g):!1;if(e.thinoType===`MULTI`&&e.path){if(!t&&!n)return!1}else if(!t)return!1}if(c){let t=ug(e.content),n=e?.fileInfo?.tags?dg(e.fileInfo.tags):new Set;if(!t.has(c)&&!n.has(c))return!1}if(l&&l.from!==0&&l.to!==0){let t=P.getMemoTimestamp(e);if(t<l.from||t>l.to)return!1}if(u)switch(u){case`NOT_TAGGED`:if(e.content.match(jr)||e.content.match(Mr)||e.content.match(Nr))return!1;break;case`LINKED`:if(!e.content.match(Pr))return!1;break;case`IMAGED`:if(!e.content.match(Ir))return!1;break;case`CONNECTED`:if(!e.content.match(Br))return!1;break}return!0})}function lg(e){if(!e)return!0;let{tag:t,duration:n,type:r,text:i,filter:a,path:o,metadata:s}=e,c=!s||Object.keys(s).length===0;return!(t||n&&n.from<n.to||r||i||a||o||!c)}function ug(e){return[jr,Nr,Mr]?.reduce((t,n)=>((e.match(n)||[]).forEach(e=>{let r=(e?.replace(n,`$1`).trim()).split(`/`),i=``;r.forEach(e=>{i+=e,t.add(i),i+=`/`})}),t),new Set)}function dg(e){if(!Array.isArray(e)||e.length===0)return new Set;let t=e.filter(e=>!!e).map(e=>e.toString().trim());if(t.length===0)return new Set;let n=new Set;return t.forEach(e=>{let t=e.split(`/`),r=``;t.forEach((e,t)=>{r+=(t>0?`/`:``)+e,n.add(r)})}),n}function fg(e,t){return!Array.isArray(t)||t.length===0?!0:t.every(t=>{if(!t||typeof t!=`object`||!t.type||!t.value||typeof t.value!=`object`)return!0;let{type:n,value:r}=t,i=r.operator,a=r.value;switch(console.log(n,r),n){case`TAG`:{let t=typeof a==`string`?a:``,n=ug(e.content),r=Array.from(n).some(e=>e===t||e.startsWith(`${t}/`));return i===`CONTAIN`?r:!r}case`TEXT`:{let t=typeof a==`string`?a.toLowerCase():``,n=e.content.toLowerCase().includes(t);return i===`CONTAIN`?n:!n}case`TYPE`:{let t=!1;return(a===`NOT_TAGGED`&&e.content.match(jr)===null&&e.content.match(Mr)===null&&e.content.match(Nr)===null||a===`LINKED`&&e.content.match(Pr)!==null||a===`IMAGED`&&e.content.match(Ir)!==null||a===`CONNECTED`&&e.content.match(Br)!==null)&&(t=!0),i===`IS`?t:!t}case`DATE`:{let t=typeof a==`string`?new Date(a):typeof a==`object`&&a&&`value`in a?new Date(a.value):null;if(!t)return!0;let n=new Date(e.createdAt);return i===`CONTAIN`?n>=t:n<t}case`LIST`:switch(a){case`TODO`:{let t=e.thinoType===`TASK-TODO`;return i===`IS`?t:!t}case`DONE`:{let t=e.thinoType===`TASK-DONE`;return i===`IS`?t:!t}case`LIST`:{let t=e.thinoType===`JOURNAL`;return i===`IS`?t:!t}case`OTHER`:{let t=![`TASK-TODO`,`TASK-DONE`,`JOURNAL`].includes(e.thinoType);return i===`IS`?t:!t}default:return!0}case`SOURCE`:return i===`IS`?e.sourceType===a:e.sourceType!==a;case`PATH`:{if(!e.path)return i!==`CONTAIN`;let t=typeof a==`string`?a.toLowerCase():``,n=e.path.toLowerCase().includes(t);return i===`CONTAIN`?n:!n}case`METADATA`:{if(!e.fileInfo?.frontmatter)return i!==`CONTAIN`;let t=typeof a==`object`&&a?a:{name:``,value:``},n=`name`in t?t.name:``,r=`value`in t?t.value:``;if(!n)return!0;let o=e.fileInfo.frontmatter[n]===r;return i===`CONTAIN`?o:!o}case`TIME_RANGE`:{let t=new Date,n,r=t;if(typeof a!=`string`)return!0;switch(a){case`7d`:n=wm(t,7);break;case`14d`:n=wm(t,14);break;case`30d`:n=wm(t,30);break;case`90d`:n=wm(t,90);break;case`180d`:n=wm(t,180);break;case`365d`:n=wm(t,365);break;case`thisWeek`:n=Is(t),r=dl(t);break;case`thisMonth`:n=el(t),r=Lc(t);break;case`thisYear`:n=al(t),r=rl(t);break;case`lastWeek`:{let e=wm(t,7);n=Is(e),r=dl(e);break}case`lastMonth`:{let e=Ah(t,1);n=el(e),r=Lc(e);break}case`lastYear`:{let e=Bh(t,1);n=al(e),r=rl(e);break}default:return!0}let o=new Date(e.createdAt);return i===`WITHIN`?Sm(o,{start:n,end:r}):i===`BEFORE`?o<n:!0}default:return!0}})}var pg,mg=o((()=>{H(),Wr(),Qr(),Kh(),og(),pg=async({memos:e,query:t={},filterOptions:n={},plugin:r,topK:i,forceRefresh:a=!1})=>{let o={onlyFilterType:`all`,filterArchived:!0,filterDeleted:!0,filterDoneTasks:!!n.filterDoneTasks,filterComments:!0,...n},s={...t};if(!r){let t=cg(e,s,o);if(i){let e=t.slice(0,i);return{ids:e.map(e=>e.id),total:t.length,partial:e.length<t.length}}return t}try{console.log(`ThinoDebug calculateMemos start`,{query:s,options:o,memos:e?.length,topK:i,forceRefresh:a});let t=await sg(r).filterMemos(e,s,o,i,a);return console.log(`ThinoDebug calculateMemos worker result`,{isArray:Array.isArray(t),hasIds:t&&`ids`in t,length:Array.isArray(t)?t.length:t?.ids?.length}),t}catch(t){console.error(`Failed to filter memos using worker, falling back to synchronous filtering`,t);let n=cg(e,s,o);if(console.log(`ThinoDebug calculateMemos fallback result`,{length:n?.length}),i){let e=n.slice(0,i);return{ids:e.map(e=>e.id),total:n.length,partial:e.length<n.length}}return n}}}));function hg(e,t){switch(t){case`createdAt`:return e.createdAtTs??new Date(e.createdAt).getTime();case`updatedAt`:return e.updatedAtTs??new Date(e.updatedAt).getTime();case`content-length`:return e.content.length;case`sourceType`:return e.sourceType||``;case`thinoType`:return e.thinoType||``;case`pinned`:return e.pinned?1:0;default:return t in e&&e[t]||``}}function gg(e,t,n){let r=0;if(typeof e==`number`&&typeof t==`number`)r=e-t;else if(typeof e==`string`&&typeof t==`string`)r=e.localeCompare(t);else{let n=String(e),i=String(t);r=n.localeCompare(i)}return n===`desc`?-r:r}function _g(e,t){return e.slice().sort((e,n)=>e.pinned===n.pinned?gg(hg(e,t.field),hg(n,t.field),t.direction):e.pinned?-1:1)}function vg(){return{field:`createdAt`,direction:`desc`,label:`Created Time`}}function yg(e){try{let t=e?.loadLocalStorage(`memoSortConfig`);if(t){let e=JSON.parse(t);if(e.field&&e.direction&&e.label)return e}}catch(e){console.warn(`Failed to load sort config:`,e)}return vg()}var bg=o((()=>{})),xg,Sg=o((()=>{Me(),qe(),Kt(),dn(),bg(),xg=Ae()(Ue(Be(Ke(Gt(e=>({sort:vg(),setSort:t=>e(e=>void(e.sort=t))})),{name:`memo-sort-store-cache`,storage:un.ui,partialize:e=>({sort:e.sort}),version:1}),{name:`memo-sort-store`})))})),Cg,wg=o((()=>{Me(),qe(),Cg=Ae()(Be((e,t)=>({tagCache:new Map,lastTagQuery:``,lastTagResult:[],quickTagFilter:(n,r)=>{let i=t().tagCache.get(r);if(i)return console.log(`ThinoDebug quickTagFilter: cache hit`,r),i;console.log(`ThinoDebug quickTagFilter: filtering`,r,`memos:`,n.length);let a=typeof r==`string`?r.split(`,`).map(e=>e.trim()).filter(Boolean):[],o=n.filter(e=>{if(e.rowStatus===`ARCHIVED`||e.deletedAt||e.content.includes(`comment:`))return!1;if(!a.length)return!0;let t=a.some(t=>{let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return[`^#${n}$`,`^#${n}\\s`,`\\s#${n}\\s`,`\\s#${n}$`,`^#${n}/`,`\\s#${n}/`,`#${n}\\n`,`\\n#${n}`].some(t=>new RegExp(t).test(e.content))}),n=e.fileInfo?.tags,r=[];if(Array.isArray(n))r=n.filter(Boolean).map(String);else if(typeof n==`string`)r=n.split(`,`).map(e=>e.trim()).filter(Boolean);else if(n&&typeof n[Symbol.iterator]==`function`)try{r=Array.from(n).map(String)}catch{r=[]}let i=r.length>0&&a.some(e=>r.some(t=>t===e||t.startsWith(`${e}/`)));return t||i});console.log(`ThinoDebug quickTagFilter: filtered result`,o.length);let s=new Map(t().tagCache);if(s.size>20){let e=s.keys().next().value;s.delete(e)}return s.set(r,o),e({tagCache:s,lastTagQuery:r,lastTagResult:o}),o},clearCache:()=>{console.log(`ThinoDebug quickTagFilter: clearing cache`),e({tagCache:new Map,lastTagQuery:``,lastTagResult:[]})}})))})),Tg,Eg,B,Dg=o((()=>{Me(),qe(),Kt(),dn(),Tg={totalMemos:0,indexedMemos:0,isIndexing:!1,lastIndexedAt:null,failedMemos:[]},Eg={enabled:!1,engineInstalled:!1,engineDownloading:!1,engineDownloadStatus:``,wasmReady:!1,modelReady:!1,assetDownloading:!1,assetDownloadProgress:0,assetDownloadStatus:``,assetDownloadError:null,embeddingReady:!1,loadingStatus:``,loadingProgress:0,indexStatus:{...Tg},messages:[],isProcessing:!1,conversations:[],activeConversationId:null,searchQuery:``,searchResults:[],isSearching:!1,providers:{},activeEmbeddingProvider:`local`,activeCompletionProvider:`openai`,embeddingModel:`Xenova/paraphrase-multilingual-MiniLM-L12-v2`},B=Ae()(Ue(Be(Ke(Gt(e=>({...Eg,setEnabled:t=>e(e=>{e.enabled=t}),setEngineInstalled:t=>e(e=>{e.engineInstalled=t}),setEngineDownloading:t=>e(e=>{e.engineDownloading=t}),setEngineDownloadStatus:t=>e(e=>{e.engineDownloadStatus=t}),setWasmReady:t=>e(e=>{e.wasmReady=t}),setModelReady:t=>e(e=>{e.modelReady=t}),setAssetDownloading:t=>e(e=>{e.assetDownloading=t}),setAssetDownloadProgress:t=>e(e=>{e.assetDownloadProgress=t}),setAssetDownloadStatus:t=>e(e=>{e.assetDownloadStatus=t}),setAssetDownloadError:t=>e(e=>{e.assetDownloadError=t}),setEmbeddingReady:t=>e(e=>{e.embeddingReady=t}),setLoadingStatus:t=>e(e=>{e.loadingStatus=t}),setLoadingProgress:t=>e(e=>{e.loadingProgress=t}),updateIndexStatus:t=>e(e=>{Object.assign(e.indexStatus,t)}),resetIndexStatus:()=>e(e=>{e.indexStatus={...Tg}}),addMessage:t=>e(e=>{if(e.messages.push(t),e.activeConversationId){let n=e.conversations.find(t=>t.id===e.activeConversationId);n&&(n.messages.push(t),n.updatedAt=Date.now())}}),updateMessage:(t,n)=>e(e=>{let r=e.messages.findIndex(e=>e.id===t);if(r!==-1&&Object.assign(e.messages[r],n),e.activeConversationId){let r=e.conversations.find(t=>t.id===e.activeConversationId);if(r){let e=r.messages.find(e=>e.id===t);e&&(Object.assign(e,n),r.updatedAt=Date.now())}}}),clearMessages:()=>e(e=>{e.messages=[]}),setIsProcessing:t=>e(e=>{e.isProcessing=t}),createConversation:()=>{let t=`conv-${Date.now()}`,n=Date.now();return e(e=>{e.conversations.push({id:t,title:`New Chat`,messages:[],createdAt:n,updatedAt:n}),e.activeConversationId=t,e.messages=[]}),t},setActiveConversation:t=>e(e=>{if(e.activeConversationId=t,t){let n=e.conversations.find(e=>e.id===t);e.messages=n?n.messages.map(e=>({...e})):[]}else e.messages=[]}),deleteConversation:t=>e(e=>{e.conversations=e.conversations.filter(e=>e.id!==t),e.activeConversationId===t&&(e.activeConversationId=null,e.messages=[])}),renameConversation:(t,n)=>e(e=>{let r=e.conversations.find(e=>e.id===t);r&&(r.title=n)}),loadExternalMessages:t=>e(e=>{e.activeConversationId=null,e.messages=t}),setSearchQuery:t=>e(e=>{e.searchQuery=t}),setSearchResults:t=>e(e=>{e.searchResults=t}),setIsSearching:t=>e(e=>{e.isSearching=t}),updateProvider:(t,n)=>e(e=>{e.providers[t]={...e.providers[t],...n}}),removeProvider:t=>e(e=>{delete e.providers[t]}),setActiveEmbeddingProvider:t=>e(e=>{e.activeEmbeddingProvider=t}),setActiveCompletionProvider:t=>e(e=>{e.activeCompletionProvider=t}),setEmbeddingModel:t=>e(e=>{e.embeddingModel=t}),reset:()=>e(()=>({...Eg}))})),{name:`super-store-cache`,storage:un.ui,partialize:e=>({enabled:e.enabled,providers:e.providers,activeEmbeddingProvider:e.activeEmbeddingProvider,activeCompletionProvider:e.activeCompletionProvider,embeddingModel:e.embeddingModel,conversations:e.conversations,activeConversationId:e.activeConversationId}),onRehydrateStorage:()=>(e,t)=>{t||queueMicrotask(()=>{let e=B.getState();e.activeConversationId&&e.setActiveConversation(e.activeConversationId)})},version:3,migrate:(e,t)=>(t<2&&(e.embeddingModel=`Xenova/paraphrase-multilingual-MiniLM-L12-v2`),t<3&&(e.conversations=e.conversations||[],e.activeConversationId=e.activeConversationId||null),e)}),{name:`super-store`})))}));function Og(e){let t=F.getState().memos,{query:n}=di.getState(),{settings:r}=I.getState(),i=Ag.getState().filteredMemos;if(console.group(`=== Thino Search Debug ===`),console.log(`Total memos in store:`,t.length),console.log(`Filtered memos shown:`,i.length),console.log(`Current query:`,JSON.stringify(n,null,2)),console.log(`HideDoneTasks:`,r?.HideDoneTasks),e){let a=e.toLowerCase(),o=t.filter(e=>e.content.toLowerCase().includes(a));console.log(`Memos matching "${e}":`,o.length),o.forEach(e=>{let t=i.some(t=>t.id===e.id);console.log(` [${t?`SHOWN`:`HIDDEN`}] id=${e.id} type=${e.thinoType} source=${e.sourceType} rowStatus=${e.rowStatus} deleted=${!!e.deletedAt} content="${e.content.slice(0,60)}"`),t||(e.rowStatus===`ARCHIVED`&&console.log(` -> REASON: memo is archived`),e.deletedAt&&console.log(` -> REASON: memo is deleted`),e.content.includes(`comment:`)&&console.log(` -> REASON: content contains "comment:" (treated as comment)`),r?.HideDoneTasks&&e.thinoType===`TASK-DONE`&&console.log(` -> REASON: HideDoneTasks setting`),n.filter&&console.log(` -> CHECK: query.filter is active:`,n.filter),n.tag&&console.log(` -> CHECK: tag filter active:`,n.tag),n.type&&console.log(` -> CHECK: type filter active:`,n.type))}),o.length===0&&(console.log(`No memos contain this text. All task-type memos:`),t.filter(e=>e.thinoType?.startsWith(`TASK`)).forEach(e=>console.log(` id=${e.id} type=${e.thinoType} content="${e.content.slice(0,80)}"`)))}if(n.filter){let e=Bg.getQueryById(n.filter);e?console.log(`Active filter:`,e.title,`| filters:`,e.querystring):(console.warn(`STALE FILTER: query.filter references non-existent query:`,n.filter),console.warn(`Run: window.__thinoClearFilter() to clear it`))}console.groupEnd()}function kg(){di.getState().setFilterQuery(``),Ag.getState().recompute(),console.log(`Filter cleared. Recomputing...`)}var Ag,jg=o((()=>{Me(),qe(),mg(),ii(),vi(),Sg(),bg(),wg(),H(),Dg(),typeof window<`u`&&(window.__thinoDebugSearch=Og,window.__thinoClearFilter=kg),Ag=Ae()(Be((e,t)=>({filteredMemos:[],lastNonEmpty:[],isCalculating:!1,error:null,version:0,lastQuerySig:void 0,lastSortSig:void 0,lastTopKey:void 0,inflightSig:void 0,recompute:async()=>{let n=F.getState().memos,{query:r}=di.getState(),{settings:i,plugin:a}=I.getState(),o=xg.getState().sort;if(!n||n.length===0){e({isCalculating:!1}),console.log(`ThinoDebug recompute skipped: memos empty, keep previous view`);return}!r?.metadata||Object.keys(r.metadata).length;let s=B.getState().enabled&&r?.text?B.getState().searchResults.map(e=>e.entry.memoId).join(`,`):``,c=JSON.stringify({tag:r?.tag||``,dur:r?.duration?[r.duration.from,r.duration.to]:null,type:r?.type||``,text:r?.text||``,filter:r?.filter||``,path:r?.path||``,metadata:r?.metadata||{},hideDone:!!i?.HideDoneTasks,superResults:s}),l=JSON.stringify(o||null),u=F.getState().memosHash||``,d=t();if(d.lastQuerySig===c&&d.lastSortSig===l&&d.lastMemosSig===u&&!d.error){console.log(`ThinoDebug recompute skipped: no changes detected`);return}let f=`${c}|${l}|${u}`;if(d.inflightSig===f){console.log(`ThinoDebug recompute skipped: already in flight`);return}if(r?.tag&&!r.text&&!r.type&&!r.filter&&!r.path&&(!r.metadata||Object.keys(r.metadata).length===0)&&(!r.duration||r.duration.from===0&&r.duration.to===0)&&!i?.HideDoneTasks){console.log(`ThinoDebug recompute: using fast tag filter for`,r.tag);let t=Cg.getState().quickTagFilter(n,r.tag),i=_g(t,o);console.log(`ThinoDebug fast tag filter result`,{tag:r.tag,filteredCount:t.length,sortedCount:i.length}),e(e=>{let t=e.version+1;return{filteredMemos:[...i],lastNonEmpty:i.length>0?[...i]:e.lastNonEmpty,isCalculating:!1,error:null,version:t,lastQuerySig:c,lastSortSig:l,lastMemosSig:u,lastTopKey:i.slice(0,5).map(e=>`${e.id}-${e.updatedAt||e.createdAt}`).join(`,`),inflightSig:void 0}});return}let p=B.getState();if(p.enabled&&r?.text&&p.searchResults.length>0&&!p.isSearching){console.log(`ThinoDebug recompute: using Super search results`,{resultCount:p.searchResults.length,query:r.text});let t=new Map;p.searchResults.forEach((e,n)=>{t.has(e.entry.memoId)||t.set(e.entry.memoId,n)});let o=new Map(n.map(e=>[e.id,e])),s=[];for(let[e]of t){let t=o.get(e);t&&s.push(t)}let d=await pg({memos:s,query:{...r,text:``},filterOptions:{filterDoneTasks:i?.HideDoneTasks||!1},plugin:a});if(!Array.isArray(d))return;let f=new Set(d.map(e=>e.id)),m=s.filter(e=>f.has(e.id)),h=m.slice(0,5).map(e=>`${e.id}-${e.updatedAt||e.createdAt}`).join(`,`);e(e=>{let t=e.version+1;return{filteredMemos:[...m],lastNonEmpty:m.length>0?[...m]:e.lastNonEmpty,isCalculating:!1,error:null,version:t,lastQuerySig:c,lastSortSig:l,lastMemosSig:u,lastTopKey:h,inflightSig:void 0}});return}console.log(`ThinoDebug recompute: using Worker for complex query`,{query:r,hasTag:!!r?.tag,hasText:!!r?.text,hasType:!!r?.type,hasFilter:!!r?.filter}),e({inflightSig:f});try{let t=await pg({memos:n,query:r,filterOptions:{filterDoneTasks:i?.HideDoneTasks||!1},plugin:a});if(!Array.isArray(t))return;let s=_g(t,o),d=!r?.metadata||Object.keys(r.metadata).length===0,f=!(r?.tag||r?.duration&&r.duration.from<r.duration.to||r?.type||r?.text||r?.filter||r?.path||!d),p=(n?.length||0)>0,m=(s||[]).slice(0,5).map(e=>`${e.id}-${e.updatedAt||e.createdAt}`).join(`,`);e(e=>{if(e.lastQuerySig===c&&e.lastSortSig===l&&e.lastMemosSig===u&&e.lastTopKey===m&&e.filteredMemos.length===s.length)return console.log(`ThinoDebug recompute result unchanged, skipping update`),{isCalculating:!1,error:null,inflightSig:void 0};let t=p&&s.length===0&&f?e.lastNonEmpty.length>0?e.lastNonEmpty:e.filteredMemos:s,n=e.version+1;return console.log(`ThinoDebug recompute set filtered`,{nextLen:s.length,safeLen:t.length,prevVersion:e.version,nextVersion:n,queryEmpty:f}),{filteredMemos:[...t],lastNonEmpty:s.length>0?[...s]:e.lastNonEmpty,isCalculating:!1,error:null,version:n,lastQuerySig:c,lastSortSig:l,lastMemosSig:u,lastTopKey:m,inflightSig:void 0}})}catch(t){e(e=>({isCalculating:!1,error:t?.message||String(t),version:e.version+1}))}},setFilteredMemos:t=>e(()=>({filteredMemos:t})),quickInsertMemo:t=>{let{query:n}=di.getState(),{settings:r}=I.getState(),i=xg.getState().sort;if(!(()=>{if(!n||Object.keys(n).every(e=>!n[e]))return!0;if(n.tag&&!t.content.includes(`#${n.tag}`)||n.text&&!t.content.toLowerCase().includes(n.text.toLowerCase()))return!1;if(n.type)switch(n.type){case`NOT_TAGGED`:if(t.content.match(/#[^\s#]+/))return!1;break;case`LINKED`:if(!t.content.match(/\[.+?\]\(.+?\)/))return!1;break;case`IMAGED`:if(!t.content.match(/!\[.+?\]\(.+?\)/))return!1;break;case`CONNECTED`:if(!t.content.match(/\[\[.+?\]\]/))return!1;break}return!(r?.HideDoneTasks&&t.thinoType===`TASK-DONE`)})()){console.log(`ThinoDebug quickInsert: memo filtered out`,t.id);return}e(e=>{let n=_g([t,...[...e.filteredMemos]],i);return console.log(`ThinoDebug quickInsert: adding memo`,{memoId:t.id,prevCount:e.filteredMemos.length,newCount:n.length}),{filteredMemos:n,version:e.version+1,lastNonEmpty:n.length>0?n:e.lastNonEmpty}})},quickDeleteMemo:t=>{e(e=>{let n=e.filteredMemos.findIndex(e=>e.id===t);if(n===-1)return console.log(`ThinoDebug quickDelete: memo not in filtered list`,t),e;let r=[...e.filteredMemos];return r.splice(n,1),console.log(`ThinoDebug quickDelete: removing memo`,{memoId:t,prevCount:e.filteredMemos.length,newCount:r.length}),{filteredMemos:r,version:e.version+1,lastNonEmpty:r.length>0?r:[],lastMemosSig:void 0}})},quickDeleteBatch:n=>{n.length!==0&&(n.length<=10?e(e=>{let t=new Set(n),r=e.filteredMemos.filter(e=>!t.has(e.id));return r.length===e.filteredMemos.length?(console.log(`ThinoDebug quickDeleteBatch: no memos to remove`),e):r.length===e.filteredMemos.length&&r.every((t,n)=>t.id===e.filteredMemos[n].id)?e:(console.log(`ThinoDebug quickDeleteBatch: removing memos`,{removeCount:n.length,prevCount:e.filteredMemos.length,newCount:r.length}),{filteredMemos:r,version:e.version+1,lastNonEmpty:r.length>0?r:[],lastMemosSig:void 0})}):(console.log(`ThinoDebug quickDeleteBatch: large batch, triggering recompute`),t().recompute()))},quickUpdateBatch:n=>{if(n.length===0)return;let{query:r}=di.getState(),{settings:i}=I.getState(),a=xg.getState().sort;n.length<=10?e(e=>{let t=n.filter(e=>e.content&&e.content.trim()!==``&&e.rowStatus!==`DELETED`&&e.rowStatus!==`ARCHIVED`&&!e.deletedAt);if(console.log(`ThinoDebug quickUpdateBatch: filtering memos`,{inputCount:n.length,validCount:t.length,archivedCount:n.filter(e=>e.rowStatus===`ARCHIVED`).length,deletedCount:n.filter(e=>e.deletedAt).length,archivedIds:n.filter(e=>e.rowStatus===`ARCHIVED`).map(e=>e.id),currentFilteredCount:e.filteredMemos.length,currentFilteredIds:e.filteredMemos.map(e=>e.id)}),t.length===0){let t=new Set(n.map(e=>e.id)),r=e.filteredMemos.filter(e=>!t.has(e.id));return console.log(`ThinoDebug quickUpdateBatch: all memos empty/deleted/archived, removing`,{removeCount:n.length,prevCount:e.filteredMemos.length,newCount:r.length,removedIds:[...t],remainingIds:r.map(e=>e.id)}),{filteredMemos:r,version:e.version+1,lastNonEmpty:r.length>0?r:[],lastMemosSig:void 0}}let o=new Map(t.map(e=>[e.id,e])),s=new Set(n.map(e=>e.id)),c=e.filteredMemos.filter(e=>!s.has(e.id)||o.has(e.id)).map(e=>o.has(e.id)?o.get(e.id):e),l=new Set(e.filteredMemos.map(e=>e.id)),u=t.filter(e=>l.has(e.id)?!1:!r||Object.keys(r).every(e=>!r[e])?!0:!(r.tag&&!e.content.includes(`#${r.tag}`)||r.text&&!e.content.toLowerCase().includes(r.text.toLowerCase())||i?.HideDoneTasks&&e.thinoType===`TASK-DONE`));u.length>0&&(c=[...c,...u]);let d=_g(c,a);if(d.length===e.filteredMemos.length&&d.every((t,n)=>t.id===e.filteredMemos[n].id))return e;console.log(`ThinoDebug quickUpdateBatch: updating memos`,{inputCount:n.length,validCount:t.length,addedCount:u.length,finalCount:d.length});let f=d.length<e.filteredMemos.length;return{filteredMemos:d,version:e.version+1,lastNonEmpty:d.length>0?d:[],lastMemosSig:f?void 0:e.lastMemosSig}}):(console.log(`ThinoDebug quickUpdateBatch: large batch, triggering recompute`),t().recompute())}})))})),Mg,Ng,Pg=o((()=>{Mg=class{cache=new Map;DEFAULT_TTL=300*1e3;set(e,t,n){this.cache.set(e,{data:t,timestamp:Date.now(),ttl:n||this.DEFAULT_TTL})}get(e){let t=this.cache.get(e);return t?Date.now()-t.timestamp>t.ttl?(this.cache.delete(e),null):t.data:null}has(e){return this.get(e)!==null}clear(e){e?this.cache.delete(e):this.cache.clear()}getCachedMemos(e){return this.get(`memos:${e}`)}cacheMemos(e,t){this.set(`memos:${e}`,t,600*1e3)}getCachedFileContent(e){return this.get(`file:${e}`)}cacheFileContent(e,t){this.set(`file:${e}`,t,30*1e3)}invalidateFile(e){this.clear(`file:${e}`);for(let[e]of this.cache)e.startsWith(`memos:`)&&this.clear(e)}cleanup(){let e=Date.now();for(let[t,n]of this.cache)e-n.timestamp>n.ttl&&this.cache.delete(t)}},Ng=new Mg,setInterval(()=>{Ng.cleanup()},300*1e3)})),Fg=c({default:()=>V}),Ig,Lg,V,Rg=o((()=>{Ig=u(_()),es(),Qr(),vi(),Fo(),fa(),N(),Ja(),H(),os(),wi(),_o(),Pa(),jg(),wg(),Pg(),Lg=class{initialized=!1;_pendingWritePaths=new Map;markPathPending(e){let t=this._pendingWritePaths.get(e);t&&clearTimeout(t);let n=setTimeout(()=>this._pendingWritePaths.delete(e),5e3);this._pendingWritePaths.set(e,n)}releasePathPending(e){let t=this._pendingWritePaths.get(e);t&&clearTimeout(t),this._pendingWritePaths.delete(e)}isPathPending(e){return this._pendingWritePaths.has(e)}getState(){return F.getState()}async fetchAllMemos(){let e=L.getState().settings;if(!e)return console.warn(`Settings not initialized yet in fetchAllMemos`),[];P.checkDailyInMulti(e);let t=`all-memos:${e.EnabledLocationList.map(e=>e.value).join(`,`)}`,n=Ng.get(t);if(n&&this.initialized)return n.memos.forEach(P.stampMemoTimestamps),n.commentMemos.forEach(P.stampMemoTimestamps),(0,Ig.startTransition)(()=>{F.getState().setMemosAndComments(n.memos,n.commentMemos)}),this.fetchFreshMemos(e,t).catch(console.error),n.memos;Na.start(`startup:api.getMyMemos`);let r=await $o.getMyMemos(e.EnabledLocationList.map(e=>e.value));Na.end(`startup:api.getMyMemos`,{sources:e.EnabledLocationList.map(e=>e.value)});let i=[...r.memos],a=[...r.commentMemos];return Ng.set(t,{memos:i,commentMemos:a},300*1e3),i.forEach(P.stampMemoTimestamps),a.forEach(P.stampMemoTimestamps),(0,Ig.startTransition)(()=>{F.getState().setMemosAndComments(i,a)}),queueMicrotask(()=>{Cg.getState().clearCache()}),this.initialized||(this.initialized=!0,R.setLoaded(!0)),i}async fetchFreshMemos(e,t){let n=await $o.getMyMemos(e.EnabledLocationList.map(e=>e.value)),r=[...n.memos],i=[...n.commentMemos];Ng.set(t,{memos:r,commentMemos:i},300*1e3);let a=F.getState().memosHash;r.forEach(P.stampMemoTimestamps),i.forEach(P.stampMemoTimestamps),P.computeMemosHash(r)!==a&&((0,Ig.startTransition)(()=>{F.getState().setMemosAndComments(r,i)}),queueMicrotask(()=>{Cg.getState().clearCache()}))}async updateTypeMemos(e){let t=await $o.updateSpecificTypeMemo(e),n=this.getState().memos.filter(t=>t.sourceType!==e);F.getState().setMemos([...n,...t.memos])}async removeTypeMemos(e){let t=this.getState().memos.filter(t=>t.sourceType!==e);F.getState().setMemos([...t])}async fetchDeletedMemos(){let e=await $o.getMyDeletedMemos();return e.sort((e,t)=>P.getTimeStampByDate(t.deletedAt)-P.getTimeStampByDate(e.deletedAt)),e}pushMemo(e){F.getState().insertMemo(e),Ag.getState().quickInsertMemo(e),e.path&&this.releasePathPending(e.path)}pushCommentMemo(e){F.getState().insertCommentMemo(e),Ag.getState().recompute()}getMemoById(e){for(let t of this.getState().memos)if(t.id===e)return t;return null}getCommentMemoById(e){for(let t of this.getState().commentMemos)if(t.id===e)return t;return null}getMemoByWebId(e){for(let t of this.getState().memos)if(t.webId===e||t.id===e)return t;return null}async finishWaitingForTemplaterThinos(){let e=this.getState().preparingUpdateMemo;if(console.log(`preparingUpdateMemos`,e),e.length!==0)for(let t of e){let e=this.getMemoById(t.id),n=t.type===`local`?await To(t.origin,t.isList,t.date,!0):await Eo(e);await this.replaceOldThinoWithNewThino(t.id,n),F.getState().removeParticularPrepareUpdateThino(t.id)}}async replaceOldThinoWithNewThino(e,t){this.getMemoById(e)&&F.getState().replaceMemoById(e,t)}async updateMemoById(e,t,n){let r=this.getMemoByWebId(e);if(!r)return;let i=null,a=n?{}:{content:t.content,rowStatus:t.rowStatus,pinned:t.pinned,deleted:!!t.deletedAt,thinoType:t.thinoType||`JOURNAL`},o=Yr({...r,deleted:!!t.deletedAt},{...a,webId:t.id});if(console.log(`update web id`,r,o,t.id),o)return r;switch(r.sourceType){case`DAILY`:i=await sa(r,{id:r.id,webId:t.id,...a});break;case`CANVAS`:i=await aa(r,{id:r.id,webId:t.id,...a});break;case`MULTI`:i=await ra(r,{id:r.id,webId:t.id,...a});break;case`FILE`:i=await ia(r,{id:r.id,webId:t.id,...a});break;case`JOURNAL`:i=await la(r,{id:r.id,webId:t.id,...a});break}if(!i)return r;F.getState().updateMemo(i)}async archiveThinoBulk(e){let t=[];for(let n of e){let e;switch(n.sourceType){case`DAILY`:e=await sa(n,{id:n.id,rowStatus:`ARCHIVED`}),t.push(e);break;case`CANVAS`:e=await aa(n,{id:n.id,rowStatus:`ARCHIVED`}),t.push(e);break;case`MULTI`:e=await ra(n,{id:n.id,rowStatus:`ARCHIVED`}),t.push(e);break;case`FILE`:e=await ia(n,{id:n.id,rowStatus:`ARCHIVED`}),t.push(e);break;case`JOURNAL`:e=await la(n,{id:n.id,rowStatus:`ARCHIVED`}),t.push(e);break}}return t.length>0?(F.getState().archiveMemoBulk(t),t):e}async dealWithDailyThinoBulk(e,t,n){let r=await ca(e,t,n);return n===`deleteForever`?await this.deleteThinosWithIdBulk(r.map(e=>e.id)):this.editMemoBulk(r),r}async deleteThinosWithIdBulk(e){for(let t of e)F.getState().deleteMemoById(t)}async archiveMemo(e){let t=null;switch(e.sourceType){case`DAILY`:t=await sa(e,{id:e.id,rowStatus:`ARCHIVED`});break;case`CANVAS`:t=await aa(e,{id:e.id,rowStatus:`ARCHIVED`});break;case`MULTI`:t=await ra(e,{id:e.id,rowStatus:`ARCHIVED`});break;case`FILE`:t=await ia(e,{id:e.id,rowStatus:`ARCHIVED`});break;case`JOURNAL`:t=await la(e,{id:e.id,rowStatus:`ARCHIVED`});break}if(!t)return e;F.getState().archiveMemo(t),di.getState().query?.filter===`ARCHIVED`?Ag.getState().quickInsertMemo(t):Ag.getState().quickDeleteMemo(t.id);try{L.getState().plugin?.thinoWorkerManager?.memoUpdated(t.id)}catch{}return t}async pushToUpdateList(e,t){F.getState().prepareUpdateThino(e,t)}async removePrepareUpdateThinoById(e){F.getState().removeParticularPrepareUpdateThino(e)}async removePrepareUpdateThino(){F.getState().removePrepareUpdateThino()}async unarchiveThinoBulk(e){let t=[];for(let n of e){let e;switch(n.sourceType){case`DAILY`:e=await sa(n,{id:n.id,rowStatus:`NORMAL`}),t.push(e);break;case`CANVAS`:e=await aa(n,{id:n.id,rowStatus:`NORMAL`}),t.push(e);break;case`MULTI`:e=await ra(n,{id:n.id,rowStatus:`NORMAL`}),t.push(e);break;case`FILE`:e=await ia(n,{id:n.id,rowStatus:`NORMAL`}),t.push(e);break;case`JOURNAL`:e=await la(n,{id:n.id,rowStatus:`NORMAL`}),t.push(e);break}}return t.length>0?(F.getState().archiveMemoBulk(t),t):e}async unarchiveMemo(e){let t=null;switch(e.sourceType){case`DAILY`:t=await sa(e,{id:e.id,rowStatus:`NORMAL`});break;case`CANVAS`:t=await aa(e,{id:e.id,rowStatus:`NORMAL`});break;case`MULTI`:t=await ra(e,{id:e.id,rowStatus:`NORMAL`});break;case`FILE`:t=await ia(e,{id:e.id,rowStatus:`NORMAL`});break;case`JOURNAL`:t=await la(e,{id:e.id,rowStatus:`NORMAL`});break}F.getState().unarchiveMemo(t),di.getState().query?.filter===`ARCHIVED`?Ag.getState().quickDeleteMemo(t.id):Ag.getState().quickInsertMemo(t);try{L.getState().plugin?.thinoWorkerManager?.memoUpdated(t.id)}catch{}return t}async hideMemoById(e){let t=this.getMemoById(e);if(!t)return t;let n=null;switch(t.sourceType){case`DAILY`:n=await sa(t,{id:t.id,deleted:!0});break;case`CANVAS`:n=await aa(t,{id:t.id,deleted:!0});break;case`MULTI`:n=await ra(t,{id:t.id,deleted:!0});break;case`FILE`:n=await ia(t,{id:t.id,deleted:!0});break;case`JOURNAL`:n=await la(t,{id:t.id,deleted:!0});break}if(!n)return t;if(n)return n}async restoreMemoById(e){return await $o.restoreMemo(e)}async deleteMemoById(e,t){let n=this.getMemoById(e);try{switch(n.sourceType){case`DAILY`:await $o.deleteMemoInDailyNote(n);break;case`CANVAS`:await $o.deleteMemoInCanvas(n);break;case`MULTI`:await $o.deleteMemoInMultiFiles(n);break;case`FILE`:await $o.deleteMemoInSingleFile(n);break;case`JOURNAL`:await $o.deleteMemoInJournalFile(n);break}F.getState().deleteMemoById(e),Ag.getState().quickDeleteMemo(e);try{L.getState().plugin?.thinoWorkerManager?.memoUpdated(n.id)}catch{}}catch(e){console.error(e),new f.Notice(M(`Failed to delete memo`))}t!==`local`&&n.webId&&await go.syncDelete(n.webId)}async removeMemosInFile(e,t){let n=[];try{if(e.path.endsWith(`.md`)&&!e.path.contains(`.thino`)&&!t){let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim());n.push(...t)}else if(e.path.contains(`thino.canvas`)){let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim());n.push(...t)}else if(e?.parent?.path.contains(t)||!e?.parent&&!e?.parent?.path){let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim());t.length>0&&n.push(...t)}else e.path.endsWith(`.md`)&&e.path.contains(`.thino`)&&await Ia(e,n);let r=n.map(e=>e.id);F.getState().deleteMemoBatch(r),r.length>0&&(Ag.getState().quickDeleteBatch(r),console.log(`ThinoDebug removeMemosInFile: removed`,r.length,`memos from`,e.path))}catch(e){console.error(e)}}async removeThinosByPath(e){let t=this.getState().memos.filter(t=>t.path===e).map(e=>e.id);F.getState().deleteMemoBatch(t),t.length>0&&(Ag.getState().quickDeleteBatch(t),console.log(`ThinoDebug removeThinosByPath: removed`,t.length,`memos from`,e))}async updateMemosInFile(e,t){let n=L.getState().app,r=await n.vault.adapter.exists(e.path);if(console.log(n,r),!r){let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim());if(t.length>0){console.log(`ThinoDebug updateMemosInFile: file no longer exists, removing`,t.length,`memos`);let e=t.map(e=>e.id);F.getState().deleteMemoBatch(e),Ag.getState().quickDeleteBatch(e),this.updateTagsState()}return}let i=[],a=async()=>{if(e.path.endsWith(`.md`)&&!e.path.contains(`.thino`)&&!t){await La(e,i);return}else if(e.path.contains(`thino.canvas`)){await Ra(e,i);return}else if(e?.parent?.path.contains(t)&&!e.path.endsWith(`.thino.md`)){await Fa(e,i);return}else if(e.path.endsWith(`.thino.md`)){console.log(e),await Ia(e,i);return}};try{if(await a(),i.length===0){let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim());if(t.length>0){console.log(`ThinoDebug updateMemosInFile: file empty or deleted, removing`,t.length,`old memos`);let e=t.map(e=>e.id);F.getState().deleteMemoBatch(e),Ag.getState().quickDeleteBatch(e),this.updateTagsState();return}}try{let t=this.getState().memos.filter(t=>t.path.trim()===e.path.trim()),n=new Set(i.map(e=>e.id)),r=[];for(let e of t)n.has(e.id)||r.push(e.id);if(r.length>0){console.log(`ThinoDebug updateMemosInFile: removing missing memos for`,e.path,`count:`,r.length),F.getState().deleteMemoBatch(r);try{Ag.getState().quickDeleteBatch(r)}catch{}}}catch(e){console.debug(`ThinoDebug updateMemosInFile: cleanup diff failed`,e)}if(F.getState().updateMemoBatch(i,e.path),i.length<=10){console.log(`ThinoDebug updateMemosInFile: small update, using quickUpdateBatch for`,i.length,`memos`),Ag.getState().quickUpdateBatch(i);let e=L.getState().plugin;e&&e.thinoWorkerManager.memosUpdated(i.map(e=>e.id)),this.updateTagsState()}else console.log(`ThinoDebug updateMemosInFile: large update, using editMemoBulk for`,i.length,`memos`),this.editMemoBulk(i)}catch(e){console.error(e)}}async updateMemoProperty(e){let t=await ra(e,{id:P.randomId(16)});F.getState().updateMemo(t),Ag.getState().recompute()}editMemo(e,t=!1){F.getState().updateMemo(e);let n=L.getState().plugin;n&&!t&&n.thinoWorkerManager.memoUpdated(e.id),t||Ag.getState().recompute(),go.syncEdit(e)}editMemoBulk(e){let t=L.getState().plugin;t&&t.thinoWorkerManager.memosUpdated(e.map(e=>e.id));for(let t of e)this.editMemo(t,!0);this.updateTagsState(),e.length<=10?(console.log(`ThinoDebug editMemoBulk: small batch, using quickUpdateBatch for`,e.length,`memos`),Ag.getState().quickUpdateBatch(e)):(console.log(`ThinoDebug editMemoBulk: large batch, using recompute for`,e.length,`memos`),Ag.getState().recompute())}editCommentMemo(e){F.getState().updateCommentMemo(e)}getThinoViaKeyword(e){let{memos:t}=this.getState();return t.filter(t=>t.content.toLowerCase().includes(e?.toLowerCase()))}updateTagsStateThrottled=P.throttle(()=>{let{memos:e}=this.getState(),{plugin:t}=L.getState();!t||!e||e.length===0||t.thinoWorkerManager.buildTagTree(e).then(({tagsSet:e,counts:t})=>{F.getState().setTags(Array.from(e),t)})},300);async throttleUpdateTagsState(){this.updateTagsStateThrottled()}updateTagsState(){this.updateTagsStateThrottled()}clearMemos(){F.getState().clearMemos()}async getLinkedMemos(e){let{memos:t}=this.getState();return t.filter(t=>t.content.includes(e))}async getLinkedMemoByBlockId(e,t){let{memos:n}=this.getState();return n.find(n=>n.hasId===e?t&&n.path?n.path.includes(t)||t.includes(n.path):!0:!1)}async getLinkedMemosByLinkId(e,t){let{memos:n}=this.getState(),r=`${t}#^${e}`;return n.filter(n=>n.linkId?n.linkId.some(n=>n===r||t&&n.endsWith(`#^${e}`)):!1)}async getCommentMemos(e){let{memos:t}=this.getState();return t.filter(t=>t.content.includes(`comment: `+e))}async createMemoMultiFile({content:e,isList:t,name:n}){return await xo({content:e,isList:t,name:n})}async createMemoSingleFile({content:e,isList:t}){return await So({content:e,isList:t})}async createMemoJournalFile({content:e,isList:t}){return await Mo({content:e,isList:t})}async createOrPatchThinoFromWeb(e){let t=this.getState().memos;if(e.localId&&t?.some(t=>t.id===e.localId))return await this.updateMemoById(e.localId,e,!0),null;if(console.log(`thino`,e),t?.some(t=>t.id===e.id)||t?.some(t=>t.webId===e.id))return await this.updateMemoById(e.id,e,!1),console.log(`thino`,e),null;let n=e.sourceType,r=L.getState().settings;switch(r&&r?.saveThinoType&&(n=r.saveThinoType===`FILE`?e.sourceType:r.saveThinoType),n){case`FILE`:case`MULTI`:case`CANVAS`:return await Co(e);case`DAILY`:case`JOURNAL`:return await Eo(e);default:return await Co(e)}}async initSync(){await go.pushToWeb()}async createMemoCanvas({text:e,isList:t}){return await wo({content:e,isList:t})}async createMemoDaily(e,t){return await To(e,t)}setWaitingForTemplater({origin:e,date:t,isList:n,id:r,type:i}){F.getState().setWaitingForTemplater({origin:e,date:t,isList:n,id:r,type:i})}async pinMemoById(e){let t=await ua(this.getMemoById(e));F.getState().pinMemo(t);let n=await go.syncPin(t.webId,!0);n&&this.editMemo(n)}async unpinMemoById(e){let t=await da(this.getMemoById(e));F.getState().pinMemo(t);let n=await go.syncPin(t.webId,!1);n&&this.editMemo(n)}async importMemos(e,t,n){return await To(e,t,n)}async createThino({content:e,isList:t,type:n,name:r}){let i=null;switch(n.toLowerCase()){case`canvas`:i=await V.createMemoCanvas({text:e,isList:t});break;case`multi`:i=await V.createMemoMultiFile({content:e,isList:t,name:r});break;case`daily`:i=await V.createMemoDaily(e,t);break;case`file`:i=await V.createMemoSingleFile({content:e,isList:t});break;case`journal`:i=await V.createMemoJournalFile({content:e,isList:t});break;default:i=await V.createMemoDaily(e,t);break}let a=L.getState().plugin;return a&&a.thinoWorkerManager.memoUpdated(i.id),i&&n!==`DAILY`&&setTimeout(async()=>{let r=await go.syncCreate(e,n,t);r&&await this.updateMemoById(i.id,r,!0)},200),i}async openThinoByID(e){let t=this.getMemoById(e);if(console.log(t.path),t)switch(t.sourceType){case`DAILY`:await rs(t.id,t.path);break;case`CANVAS`:await as(t.id,t.path);break;case`MULTI`:await ns(t.path);break;case`FILE`:await is(t.id,t.path);break;case`JOURNAL`:await rs(t.id,t.path);break}}async updateMemo(e,t,n){let r=this.getMemoById(e);if(!r)return console.warn(`Memo with ID ${e} not found for update`),null;if(r){let e=null;switch(r.sourceType){case`DAILY`:e=await sa(r,{id:r.id,content:t,thinoType:n||r.thinoType});break;case`CANVAS`:e=await aa(r,{id:r.id,content:t,thinoType:n||r.thinoType});break;case`MULTI`:e=await ra(r,{id:r.id,content:t,thinoType:n||r.thinoType});break;case`FILE`:e=await ia(r,{id:r.id,content:t,thinoType:n||r.thinoType});break;case`JOURNAL`:e=await la(r,{id:r.id,content:t,thinoType:n||r.thinoType});break}if(e)return this.editMemo(e),e}return console.warn(`Failed to update memo ${e}: no updated memo returned`),null}},V=new Lg})),zg,Bg,Vg=o((()=>{es(),vi(),Li(),H(),zg=class{getState(){return $r.getState()}async getMyAllQueries(){let e=z.getState().query.filter,t=this.getQueryById(e),n=await $o.getMyQueries();return $r.getState().setQueries([...n,...t?[t]:[]]),n}getQueryById(e){return this.getState().queries.find(t=>t.id===e)}pushQuery(e){$r.getState().insertQuery(e)}editQuery(e){$r.getState().updateQuery(e)}async deleteQuery(e){await $o.deleteQueryById(e),$r.getState().deleteQueryById(e)}async createQuery(e,t){return await $o.createQuery(e,t)}createTempQuery(e,t){return Fi(e,t)}async updateQuery(e,t,n){return await $o.updateQuery(e,t,n)}async pinQuery(e){await $o.pinQuery(e)}async unpinQuery(e){await $o.unpinQuery(e)}},Bg=new zg})),Hg,Ug,Wg,Gg=o((()=>{Ce(),vi(),H(),Hg=class{async upload(e){let{vault:t,fileManager:n}=I.getState().app,r=await e.arrayBuffer(),i=Ug(e.type),a=ce(),o=(0,f.moment)(),s=ue(o,a),c;if(s)s instanceof f.TFile&&(c=await t.createBinary(await t.getAvailablePathForAttachments(`Pasted Image ${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,i,s),r));else{let e=await fe(o);c=await t.createBinary(await t.getAvailablePathForAttachments(`Pasted Image ${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,i,e),r)}return n.generateMarkdownLink(c,c.path,``,``)}async parseHtml(e){let t=await e.text(),n=document.createElement(`html`);n.innerHTML=t;let r=Array.from(n.getElementsByClassName(`memo`));for(let e of r){let t=e.getElementsByClassName(`content`)[0],n=(0,f.htmlToMarkdown)(t.innerHTML),r=await V.importMemos(n,!0,(0,f.moment)(e.getElementsByClassName(`time`)[0].innerHTML));V.pushMemo(r)}}},Ug=e=>/^image\/(.+)$/.exec(e)?.[1],Wg=new Hg})),H=o((()=>{bi(),wi(),Ei(),Rg(),Vg(),Gg(),_o()})),Kg=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,ee(x);else{var t=n(l);t!==null&&te(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&te(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function ee(e){C=e,S||(S=!0,k())}function te(t,n){w=g(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,ee(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,te(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),qg=s(((e,t)=>{t.exports=Kg()})),Jg=s((e=>{var t=_(),n=qg();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var v={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){v[e]=new g(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];v[t]=new g(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){v[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){v[e]=new g(e,2,!1,e,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(e){v[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){v[e]=new g(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){v[e]=new g(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){v[e]=new g(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){v[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function b(e){return e[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(e){var t=e.replace(y,b);v[t]=new g(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(y,b);v[t]=new g(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(y,b);v[t]=new g(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){v[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),v.xlinkHref=new g(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){v[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function x(e,t,n,r){var i=v.hasOwnProperty(t)?v[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var S=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,C=Symbol.for(`react.element`),w=Symbol.for(`react.portal`),T=Symbol.for(`react.fragment`),E=Symbol.for(`react.strict_mode`),D=Symbol.for(`react.profiler`),O=Symbol.for(`react.provider`),k=Symbol.for(`react.context`),A=Symbol.for(`react.forward_ref`),j=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.offscreen`),ie=Symbol.iterator;function ae(e){return typeof e!=`object`||!e?null:(e=ie&&e[ie]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Object.assign,se;function ce(e){if(se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);se=t&&t[1]||``}return`
|
||
`+se+e}var le=!1;function ue(e,t){if(!e||le)return``;le=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
||
`),a=r.stack.split(`
|
||
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
||
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{le=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ce(e):``}function de(e){switch(e.tag){case 5:return ce(e.type);case 16:return ce(`Lazy`);case 13:return ce(`Suspense`);case 19:return ce(`SuspenseList`);case 0:case 2:case 15:return e=ue(e.type,!1),e;case 11:return e=ue(e.type.render,!1),e;case 1:return e=ue(e.type,!0),e;default:return``}}function fe(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case T:return`Fragment`;case w:return`Portal`;case D:return`Profiler`;case E:return`StrictMode`;case j:return`Suspense`;case ee:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case k:return(e.displayName||`Context`)+`.Consumer`;case O:return(e._context.displayName||`Context`)+`.Provider`;case A:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}function pe(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return fe(t);case 8:return t===E?`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 t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function me(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function he(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ge(e){var t=he(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _e(e){e._valueTracker||=ge(e)}function ve(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=he(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function ye(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function be(e,t){var n=t.checked;return oe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=me(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function Se(e,t){t=t.checked,t!=null&&x(e,`checked`,t,!1)}function Ce(e,t){Se(e,t);var n=me(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?Te(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Te(e,t.type,me(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function we(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function Te(e,t,n){(t!==`number`||ye(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var Ee=Array.isArray;function De(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+me(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Oe(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return oe({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function ke(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(Ee(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:me(n)}}function Ae(e,t){var n=me(t.value),r=me(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function je(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function Me(e){switch(e){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 Ne(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?Me(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Pe,Fe=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(Pe||=document.createElement(`div`),Pe.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Pe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ie(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Le={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},Re=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Le).forEach(function(e){Re.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Le[t]=Le[e]})});function ze(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Le.hasOwnProperty(e)&&Le[e]?(``+t).trim():t+`px`}function Be(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=ze(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Ve=oe({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 He(e,t){if(t){if(Ve[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Ue(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){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 We=null;function Ge(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ke=null,qe=null,Je=null;function Ye(e){if(e=Hi(e)){if(typeof Ke!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Wi(t),Ke(e.stateNode,e.type,t))}}function Xe(e){qe?Je?Je.push(e):Je=[e]:qe=e}function Ze(){if(qe){var e=qe,t=Je;if(Je=qe=null,Ye(e),t)for(e=0;e<t.length;e++)Ye(t[e])}}function Qe(e,t){return e(t)}function $e(){}var et=!1;function tt(e,t,n){if(et)return e(t,n);et=!0;try{return Qe(e,t,n)}finally{et=!1,(qe!==null||Je!==null)&&($e(),Ze())}}function nt(e,t){var n=e.stateNode;if(n===null)return null;var i=Wi(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var rt=!1;if(c)try{var it={};Object.defineProperty(it,`passive`,{get:function(){rt=!0}}),window.addEventListener(`test`,it,it),window.removeEventListener(`test`,it,it)}catch{rt=!1}function at(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var ot=!1,st=null,ct=!1,lt=null,ut={onError:function(e){ot=!0,st=e}};function dt(e,t,n,r,i,a,o,s,c){ot=!1,st=null,at.apply(ut,arguments)}function ft(e,t,n,i,a,o,s,c,l){if(dt.apply(this,arguments),ot){if(ot){var u=st;ot=!1,st=null}else throw Error(r(198));ct||(ct=!0,lt=u)}}function pt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function mt(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ht(e){if(pt(e)!==e)throw Error(r(188))}function gt(e){var t=e.alternate;if(!t){if(t=pt(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return ht(a),e;if(o===i)return ht(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function _t(e){return e=gt(e),e===null?null:vt(e)}function vt(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=vt(e);if(t!==null)return t;e=e.sibling}return null}var yt=n.unstable_scheduleCallback,bt=n.unstable_cancelCallback,xt=n.unstable_shouldYield,St=n.unstable_requestPaint,Ct=n.unstable_now,wt=n.unstable_getCurrentPriorityLevel,Tt=n.unstable_ImmediatePriority,Et=n.unstable_UserBlockingPriority,Dt=n.unstable_NormalPriority,Ot=n.unstable_LowPriority,kt=n.unstable_IdlePriority,At=null,jt=null;function Mt(e){if(jt&&typeof jt.onCommitFiberRoot==`function`)try{jt.onCommitFiberRoot(At,e,void 0,(e.current.flags&128)==128)}catch{}}var Nt=Math.clz32?Math.clz32:It,Pt=Math.log,Ft=Math.LN2;function It(e){return e>>>=0,e===0?32:31-(Pt(e)/Ft|0)|0}var Lt=64,Rt=4194304;function zt(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Bt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=zt(a))):r=zt(s)}else o=n&~i,o===0?a!==0&&(r=zt(a)):r=zt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Nt(t),i=1<<n,r|=e[n],t&=~i;return r}function Vt(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 Ht(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Nt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Vt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Ut(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Wt(){var e=Lt;return Lt<<=1,!(Lt&4194240)&&(Lt=64),e}function Gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Kt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nt(t),e[t]=n}function qt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Nt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Jt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Nt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Yt=0;function Xt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Zt,Qt,$t,en,tn,nn=!1,rn=[],an=null,on=null,sn=null,cn=new Map,ln=new Map,un=[],dn=`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 fn(e,t){switch(e){case`focusin`:case`focusout`:an=null;break;case`dragenter`:case`dragleave`:on=null;break;case`mouseover`:case`mouseout`:sn=null;break;case`pointerover`:case`pointerout`:cn.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:ln.delete(t.pointerId)}}function pn(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Hi(t),t!==null&&Qt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function mn(e,t,n,r,i){switch(t){case`focusin`:return an=pn(an,e,t,n,r,i),!0;case`dragenter`:return on=pn(on,e,t,n,r,i),!0;case`mouseover`:return sn=pn(sn,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return cn.set(a,pn(cn.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,ln.set(a,pn(ln.get(a)||null,e,t,n,r,i)),!0}return!1}function hn(e){var t=Vi(e.target);if(t!==null){var n=pt(t);if(n!==null){if(t=n.tag,t===13){if(t=mt(n),t!==null){e.blockedOn=t,tn(e.priority,function(){$t(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function gn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);We=r,n.target.dispatchEvent(r),We=null}else return t=Hi(n),t!==null&&Qt(t),e.blockedOn=n,!1;t.shift()}return!0}function _n(e,t,n){gn(e)&&n.delete(t)}function vn(){nn=!1,an!==null&&gn(an)&&(an=null),on!==null&&gn(on)&&(on=null),sn!==null&&gn(sn)&&(sn=null),cn.forEach(_n),ln.forEach(_n)}function yn(e,t){e.blockedOn===t&&(e.blockedOn=null,nn||(nn=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,vn)))}function bn(e){function t(t){return yn(t,e)}if(0<rn.length){yn(rn[0],e);for(var n=1;n<rn.length;n++){var r=rn[n];r.blockedOn===e&&(r.blockedOn=null)}}for(an!==null&&yn(an,e),on!==null&&yn(on,e),sn!==null&&yn(sn,e),cn.forEach(t),ln.forEach(t),n=0;n<un.length;n++)r=un[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<un.length&&(n=un[0],n.blockedOn===null);)hn(n),n.blockedOn===null&&un.shift()}var xn=S.ReactCurrentBatchConfig,Sn=!0;function Cn(e,t,n,r){var i=Yt,a=xn.transition;xn.transition=null;try{Yt=1,Tn(e,t,n,r)}finally{Yt=i,xn.transition=a}}function wn(e,t,n,r){var i=Yt,a=xn.transition;xn.transition=null;try{Yt=4,Tn(e,t,n,r)}finally{Yt=i,xn.transition=a}}function Tn(e,t,n,r){if(Sn){var i=Dn(e,t,n,r);if(i===null)gi(e,t,r,En,n),fn(e,r);else if(mn(i,e,t,n,r))r.stopPropagation();else if(fn(e,r),t&4&&-1<dn.indexOf(e)){for(;i!==null;){var a=Hi(i);if(a!==null&&Zt(a),a=Dn(e,t,n,r),a===null&&gi(e,t,r,En,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else gi(e,t,r,null,n)}}var En=null;function Dn(e,t,n,r){if(En=null,e=Ge(r),e=Vi(e),e!==null)if(t=pt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=mt(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return En=e,null}function On(e){switch(e){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(wt()){case Tt:return 1;case Et:return 4;case Dt:case Ot:return 16;case kt:return 536870912;default:return 16}default:return 16}}var kn=null,An=null,jn=null;function Mn(){if(jn)return jn;var e,t=An,n=t.length,r,i=`value`in kn?kn.value:kn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return jn=i.slice(e,1<r?1-r:void 0)}function Nn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Pn(){return!0}function Fn(){return!1}function In(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Pn:Fn,this.isPropagationStopped=Fn,this}return oe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Pn)},persist:function(){},isPersistent:Pn}),t}var Ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rn=In(Ln),zn=oe({},Ln,{view:0,detail:0}),Bn=In(zn),Vn,Hn,Un,Wn=oe({},zn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Un&&(Un&&e.type===`mousemove`?(Vn=e.screenX-Un.screenX,Hn=e.screenY-Un.screenY):Hn=Vn=0,Un=e),Vn)},movementY:function(e){return`movementY`in e?e.movementY:Hn}}),Gn=In(Wn),Kn=In(oe({},Wn,{dataTransfer:0})),qn=In(oe({},zn,{relatedTarget:0})),Jn=In(oe({},Ln,{animationName:0,elapsedTime:0,pseudoElement:0})),Yn=In(oe({},Ln,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Xn=In(oe({},Ln,{data:0})),Zn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Qn={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`},$n={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function er(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$n[e])?!!t[e]:!1}function tr(){return er}var nr=In(oe({},zn,{key:function(e){if(e.key){var t=Zn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Nn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Qn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tr,charCode:function(e){return e.type===`keypress`?Nn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Nn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),rr=In(oe({},Wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ir=In(oe({},zn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tr})),ar=In(oe({},Ln,{propertyName:0,elapsedTime:0,pseudoElement:0})),M=In(oe({},Wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),or=[9,13,27,32],N=c&&`CompositionEvent`in window,sr=null;c&&`documentMode`in document&&(sr=document.documentMode);var cr=c&&`TextEvent`in window&&!sr,lr=c&&(!N||sr&&8<sr&&11>=sr),ur=` `,dr=!1;function fr(e,t){switch(e){case`keyup`:return or.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function pr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var mr=!1;function hr(e,t){switch(e){case`compositionend`:return pr(t);case`keypress`:return t.which===32?(dr=!0,ur):null;case`textInput`:return e=t.data,e===ur&&dr?null:e;default:return null}}function gr(e,t){if(mr)return e===`compositionend`||!N&&fr(e,t)?(e=Mn(),jn=An=kn=null,mr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return lr&&t.locale!==`ko`?null:t.data;default:return null}}var _r={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 vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!_r[e.type]:t===`textarea`}function yr(e,t,n,r){Xe(r),t=vi(t,`onChange`),0<t.length&&(n=new Rn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var br=null,xr=null;function Sr(e){di(e,0)}function Cr(e){if(ve(Ui(e)))return e}function wr(e,t){if(e===`change`)return t}var Tr=!1;if(c){var Er;if(c){var Dr=`oninput`in document;if(!Dr){var Or=document.createElement(`div`);Or.setAttribute(`oninput`,`return;`),Dr=typeof Or.oninput==`function`}Er=Dr}else Er=!1;Tr=Er&&(!document.documentMode||9<document.documentMode)}function kr(){br&&(br.detachEvent(`onpropertychange`,Ar),xr=br=null)}function Ar(e){if(e.propertyName===`value`&&Cr(xr)){var t=[];yr(t,xr,e,Ge(e)),tt(Sr,t)}}function jr(e,t,n){e===`focusin`?(kr(),br=t,xr=n,br.attachEvent(`onpropertychange`,Ar)):e===`focusout`&&kr()}function Mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Cr(xr)}function Nr(e,t){if(e===`click`)return Cr(t)}function Pr(e,t){if(e===`input`||e===`change`)return Cr(t)}function Fr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ir=typeof Object.is==`function`?Object.is:Fr;function Lr(e,t){if(Ir(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!Ir(e[i],t[i]))return!1}return!0}function Rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zr(e,t){var n=Rr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Rr(n)}}function Br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(){for(var e=window,t=ye();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ye(e.document)}return t}function Hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Ur(e){var t=Vr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Br(n.ownerDocument.documentElement,n)){if(r!==null&&Hr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=zr(n,a);var o=zr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Wr=c&&`documentMode`in document&&11>=document.documentMode,Gr=null,Kr=null,qr=null,Jr=!1;function Yr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jr||Gr==null||Gr!==ye(r)||(r=Gr,`selectionStart`in r&&Hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qr&&Lr(qr,r)||(qr=r,r=vi(Kr,`onSelect`),0<r.length&&(t=new Rn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Gr)))}function Xr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var P={animationend:Xr(`Animation`,`AnimationEnd`),animationiteration:Xr(`Animation`,`AnimationIteration`),animationstart:Xr(`Animation`,`AnimationStart`),transitionend:Xr(`Transition`,`TransitionEnd`)},Zr={},Qr={};c&&(Qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete P.animationend.animation,delete P.animationiteration.animation,delete P.animationstart.animation),`TransitionEvent`in window||delete P.transitionend.transition);function $r(e){if(Zr[e])return Zr[e];if(!P[e])return e;var t=P[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qr)return Zr[e]=t[n];return e}var ei=$r(`animationend`),ti=$r(`animationiteration`),ni=$r(`animationstart`),ri=$r(`transitionend`),F=new Map,ii=`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 ai(e,t){F.set(e,t),o(t,[e])}for(var oi=0;oi<ii.length;oi++){var si=ii[oi];ai(si.toLowerCase(),`on`+(si[0].toUpperCase()+si.slice(1)))}ai(ei,`onAnimationEnd`),ai(ti,`onAnimationIteration`),ai(ni,`onAnimationStart`),ai(`dblclick`,`onDoubleClick`),ai(`focusin`,`onFocus`),ai(`focusout`,`onBlur`),ai(ri,`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 ci=`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(` `),li=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ci));function ui(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,ft(r,t,void 0,e),e.currentTarget=null}function di(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ui(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;ui(i,s,l),a=c}}}if(ct)throw e=lt,ct=!1,lt=null,e}function fi(e,t){var n=t[Ri];n===void 0&&(n=t[Ri]=new Set);var r=e+`__bubble`;n.has(r)||(hi(t,e,2,!1),n.add(r))}function pi(e,t,n){var r=0;t&&(r|=4),hi(n,e,r,t)}var I=`_reactListening`+Math.random().toString(36).slice(2);function mi(e){if(!e[I]){e[I]=!0,i.forEach(function(t){t!==`selectionchange`&&(li.has(t)||pi(t,!1,e),pi(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[I]||(t[I]=!0,pi(`selectionchange`,!1,t))}}function hi(e,t,n,r){switch(On(t)){case 1:var i=Cn;break;case 4:i=wn;break;default:i=Tn}n=i.bind(null,t,n,e),i=void 0,!rt||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function gi(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Vi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}tt(function(){var r=a,i=Ge(n),o=[];a:{var s=F.get(e);if(s!==void 0){var c=Rn,l=e;switch(e){case`keypress`:if(Nn(n)===0)break a;case`keydown`:case`keyup`:c=nr;break;case`focusin`:l=`focus`,c=qn;break;case`focusout`:l=`blur`,c=qn;break;case`beforeblur`:case`afterblur`:c=qn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Gn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=ir;break;case ei:case ti:case ni:c=Jn;break;case ri:c=ar;break;case`scroll`:c=Bn;break;case`wheel`:c=M;break;case`copy`:case`cut`:case`paste`:c=Yn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=rr}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=nt(p,f),h!=null&&u.push(_i(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==We&&(l=n.relatedTarget||n.fromElement)&&(Vi(l)||l[Li]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Vi(l):null,l!==null&&(d=pt(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Gn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=rr,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Ui(c),m=l==null?s:Ui(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Vi(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=yi(m))p++;for(m=0,h=f;h;h=yi(h))m++;for(;0<p-m;)u=yi(u),p--;for(;0<m-p;)f=yi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=yi(u),f=yi(f)}u=null}else u=null;c!==null&&L(o,s,c,u,!1),l!==null&&d!==null&&L(o,d,l,u,!0)}}a:{if(s=r?Ui(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=wr;else if(vr(s))if(Tr)g=Pr;else{g=Mr;var _=jr}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Nr);if(g&&=g(e,r)){yr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&Te(s,`number`,s.value)}switch(_=r?Ui(r):window,e){case`focusin`:(vr(_)||_.contentEditable===`true`)&&(Gr=_,Kr=r,qr=null);break;case`focusout`:qr=Kr=Gr=null;break;case`mousedown`:Jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Jr=!1,Yr(o,n,i);break;case`selectionchange`:if(Wr)break;case`keydown`:case`keyup`:Yr(o,n,i)}var v;if(N)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else mr?fr(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(lr&&n.locale!==`ko`&&(mr||y!==`onCompositionStart`?y===`onCompositionEnd`&&mr&&(v=Mn()):(kn=i,An=`value`in kn?kn.value:kn.textContent,mr=!0)),_=vi(r,y),0<_.length&&(y=new Xn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=pr(n),v!==null&&(y.data=v)))),(v=cr?hr(e,n):gr(e,n))&&(r=vi(r,`onBeforeInput`),0<r.length&&(i=new Xn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}di(o,t)})}function _i(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=nt(e,n),a!=null&&r.unshift(_i(e,a,i)),a=nt(e,t),a!=null&&r.push(_i(e,a,i))),e=e.return}return r}function yi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function L(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=nt(n,a),c!=null&&o.unshift(_i(n,c,s))):i||(c=nt(n,a),c!=null&&o.push(_i(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var bi=/\r\n?/g,xi=/\u0000|\uFFFD/g;function Si(e){return(typeof e==`string`?e:``+e).replace(bi,`
|
||
`).replace(xi,``)}function Ci(e,t,n){if(t=Si(t),Si(e)!==t&&n)throw Error(r(425))}function R(){}var wi=null,Ti=null;function z(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ei=typeof setTimeout==`function`?setTimeout:void 0,Di=typeof clearTimeout==`function`?clearTimeout:void 0,Oi=typeof Promise==`function`?Promise:void 0,ki=typeof queueMicrotask==`function`?queueMicrotask:Oi===void 0?Ei:function(e){return Oi.resolve(null).then(e).catch(Ai)};function Ai(e){setTimeout(function(){throw e})}function ji(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),bn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);bn(t)}function Mi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Ni(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Pi=Math.random().toString(36).slice(2),Fi=`__reactFiber$`+Pi,Ii=`__reactProps$`+Pi,Li=`__reactContainer$`+Pi,Ri=`__reactEvents$`+Pi,zi=`__reactListeners$`+Pi,Bi=`__reactHandles$`+Pi;function Vi(e){var t=e[Fi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Li]||n[Fi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Ni(e);e!==null;){if(n=e[Fi])return n;e=Ni(e)}return t}e=n,n=e.parentNode}return null}function Hi(e){return e=e[Fi]||e[Li],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ui(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Wi(e){return e[Ii]||null}var Gi=[],Ki=-1;function qi(e){return{current:e}}function Ji(e){0>Ki||(e.current=Gi[Ki],Gi[Ki]=null,Ki--)}function Yi(e,t){Ki++,Gi[Ki]=e.current,e.current=t}var Xi={},Zi=qi(Xi),Qi=qi(!1),$i=Xi;function ea(e,t){var n=e.type.contextTypes;if(!n)return Xi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ta(e){return e=e.childContextTypes,e!=null}function na(){Ji(Qi),Ji(Zi)}function ra(e,t,n){if(Zi.current!==Xi)throw Error(r(168));Yi(Zi,t),Yi(Qi,n)}function ia(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,pe(e)||`Unknown`,a));return oe({},n,i)}function aa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xi,$i=Zi.current,Yi(Zi,e),Yi(Qi,Qi.current),!0}function oa(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=ia(e,t,$i),i.__reactInternalMemoizedMergedChildContext=e,Ji(Qi),Ji(Zi),Yi(Zi,e)):Ji(Qi),Yi(Qi,n)}var sa=null,ca=!1,la=!1;function ua(e){sa===null?sa=[e]:sa.push(e)}function da(e){ca=!0,ua(e)}function fa(){if(!la&&sa!==null){la=!0;var e=0,t=Yt;try{var n=sa;for(Yt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}sa=null,ca=!1}catch(t){throw sa!==null&&(sa=sa.slice(e+1)),yt(Tt,fa),t}finally{Yt=t,la=!1}}return null}var pa=[],ma=0,ha=null,ga=0,_a=[],va=0,ya=null,ba=1,xa=``;function Sa(e,t){pa[ma++]=ga,pa[ma++]=ha,ha=e,ga=t}function Ca(e,t,n){_a[va++]=ba,_a[va++]=xa,_a[va++]=ya,ya=e;var r=ba;e=xa;var i=32-Nt(r)-1;r&=~(1<<i),n+=1;var a=32-Nt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ba=1<<32-Nt(t)+i|n<<i|r,xa=a+e}else ba=1<<a|n<<i|r,xa=e}function wa(e){e.return!==null&&(Sa(e,1),Ca(e,1,0))}function Ta(e){for(;e===ha;)ha=pa[--ma],pa[ma]=null,ga=pa[--ma],pa[ma]=null;for(;e===ya;)ya=_a[--va],_a[va]=null,xa=_a[--va],_a[va]=null,ba=_a[--va],_a[va]=null}var Ea=null,Da=null,Oa=!1,ka=null;function Aa(e,t){var n=au(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ja(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,Ea=e,Da=Mi(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,Ea=e,Da=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=ya===null?null:{id:ba,overflow:xa},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=au(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ea=e,Da=null,!0);default:return!1}}function Ma(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Na(e){if(Oa){var t=Da;if(t){var n=t;if(!ja(e,t)){if(Ma(e))throw Error(r(418));t=Mi(n.nextSibling);var i=Ea;t&&ja(e,t)?Aa(i,n):(e.flags=e.flags&-4097|2,Oa=!1,Ea=e)}}else{if(Ma(e))throw Error(r(418));e.flags=e.flags&-4097|2,Oa=!1,Ea=e}}}function Pa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ea=e}function Fa(e){if(e!==Ea)return!1;if(!Oa)return Pa(e),Oa=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!z(e.type,e.memoizedProps)),t&&=Da){if(Ma(e))throw Ia(),Error(r(418));for(;t;)Aa(e,t),t=Mi(t.nextSibling)}if(Pa(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){Da=Mi(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}Da=null}}else Da=Ea?Mi(e.stateNode.nextSibling):null;return!0}function Ia(){for(var e=Da;e;)e=Mi(e.nextSibling)}function La(){Da=Ea=null,Oa=!1}function Ra(e){ka===null?ka=[e]:ka.push(e)}var za=S.ReactCurrentBatchConfig;function Ba(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Va(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Ha(e){var t=e._init;return t(e._payload)}function Ua(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=cu(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=fu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===T?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ne&&Ha(i)===t.type)?(r=a(t,n.props),r.ref=Ba(e,t,n),r.return=e,r):(r=lu(n.type,n.key,n.props,null,e.mode,r),r.ref=Ba(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=pu(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=uu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=fu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case C:return n=lu(t.type,t.key,t.props,null,e.mode,n),n.ref=Ba(e,null,t),n.return=e,n;case w:return t=pu(t,e.mode,n),t.return=e,t;case ne:var r=t._init;return f(e,r(t._payload),n)}if(Ee(t)||ae(t))return t=uu(t,e.mode,n,null),t.return=e,t;Va(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case C:return n.key===i?l(e,t,n,r):null;case w:return n.key===i?u(e,t,n,r):null;case ne:return i=n._init,p(e,t,i(n._payload),r)}if(Ee(n)||ae(n))return i===null?d(e,t,n,r,null):null;Va(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case C:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case w:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ne:var a=r._init;return m(e,t,n,a(r._payload),i)}if(Ee(r)||ae(r))return e=e.get(n)||null,d(t,e,r,i,null);Va(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Oa&&Sa(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Oa&&Sa(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Oa&&Sa(r,h),l}function g(a,s,c,l){var u=ae(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Oa&&Sa(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Oa&&Sa(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Oa&&Sa(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===T&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case C:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===T){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===ne&&Ha(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ba(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===T?(r=uu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=lu(i.type,i.key,i.props,null,e.mode,o),o.ref=Ba(e,r,i),o.return=e,e=o)}return s(e);case w:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=pu(i,e.mode,o),r.return=e,e=r}return s(e);case ne:return l=i._init,_(e,r,l(i._payload),o)}if(Ee(i))return h(e,r,i,o);if(ae(i))return g(e,r,i,o);Va(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=fu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Wa=Ua(!0),Ga=Ua(!1),Ka=qi(null),qa=null,Ja=null,Ya=null;function Xa(){Ya=Ja=qa=null}function Za(e){var t=Ka.current;Ji(Ka),e._currentValue=t}function Qa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function $a(e,t){qa=e,Ya=Ja=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Us=!0),e.firstContext=null)}function eo(e){var t=e._currentValue;if(Ya!==e)if(e={context:e,memoizedValue:t,next:null},Ja===null){if(qa===null)throw Error(r(308));Ja=e,qa.dependencies={lanes:0,firstContext:e}}else Ja=Ja.next=e;return t}var to=null;function no(e){to===null?to=[e]:to.push(e)}function ro(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,no(t)):(n.next=i.next,i.next=n),t.interleaved=n,io(e,r)}function io(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ao=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function so(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function co(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function lo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$c&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,io(e,n)}return i=r.interleaved,i===null?(t.next=t,no(r)):(t.next=i.next,i.next=t),r.interleaved=t,io(e,n)}function uo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jt(e,n)}}function fo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function po(e,t,n,r){var i=e.updateQueue;ao=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=oe({},d,f);break a;case 2:ao=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);sl|=o,e.lanes=o,e.memoizedState=d}}function mo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var ho={},go=qi(ho),_o=qi(ho),vo=qi(ho);function yo(e){if(e===ho)throw Error(r(174));return e}function bo(e,t){switch(Yi(vo,t),Yi(_o,e),Yi(go,ho),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ne(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ne(t,e)}Ji(go),Yi(go,t)}function xo(){Ji(go),Ji(_o),Ji(vo)}function So(e){yo(vo.current);var t=yo(go.current),n=Ne(t,e.type);t!==n&&(Yi(_o,e),Yi(go,n))}function Co(e){_o.current===e&&(Ji(go),Ji(_o))}var wo=qi(0);function To(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Eo=[];function Do(){for(var e=0;e<Eo.length;e++)Eo[e]._workInProgressVersionPrimary=null;Eo.length=0}var Oo=S.ReactCurrentDispatcher,ko=S.ReactCurrentBatchConfig,Ao=0,jo=null,Mo=null,No=null,Po=!1,Fo=!1,Io=0,Lo=0;function Ro(){throw Error(r(321))}function zo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ir(e[n],t[n]))return!1;return!0}function Bo(e,t,n,i,a,o){if(Ao=o,jo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Oo.current=e===null||e.memoizedState===null?Cs:ws,e=n(i,a),Fo){o=0;do{if(Fo=!1,Io=0,25<=o)throw Error(r(301));o+=1,No=Mo=null,t.updateQueue=null,Oo.current=Ts,e=n(i,a)}while(Fo)}if(Oo.current=Ss,t=Mo!==null&&Mo.next!==null,Ao=0,No=Mo=jo=null,Po=!1,t)throw Error(r(300));return e}function Vo(){var e=Io!==0;return Io=0,e}function Ho(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return No===null?jo.memoizedState=No=e:No=No.next=e,No}function Uo(){if(Mo===null){var e=jo.alternate;e=e===null?null:e.memoizedState}else e=Mo.next;var t=No===null?jo.memoizedState:No.next;if(t!==null)No=t,Mo=e;else{if(e===null)throw Error(r(310));Mo=e,e={memoizedState:Mo.memoizedState,baseState:Mo.baseState,baseQueue:Mo.baseQueue,queue:Mo.queue,next:null},No===null?jo.memoizedState=No=e:No=No.next=e}return No}function Wo(e,t){return typeof t==`function`?t(e):t}function Go(e){var t=Uo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=Mo,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Ao&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,jo.lanes|=d,sl|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Ir(i,t.memoizedState)||(Us=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,jo.lanes|=o,sl|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ko(e){var t=Uo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Ir(o,t.memoizedState)||(Us=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function qo(){}function Jo(e,t){var n=jo,i=Uo(),a=t(),o=!Ir(i.memoizedState,a);if(o&&(i.memoizedState=a,Us=!0),i=i.queue,os(Zo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||No!==null&&No.memoizedState.tag&1){if(n.flags|=2048,ts(9,Xo.bind(null,n,i,a,t),void 0,null),el===null)throw Error(r(349));Ao&30||Yo(n,t,a)}return a}function Yo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=jo.updateQueue,t===null?(t={lastEffect:null,stores:null},jo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Xo(e,t,n,r){t.value=n,t.getSnapshot=r,Qo(t)&&$o(e)}function Zo(e,t,n){return n(function(){Qo(t)&&$o(e)})}function Qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ir(e,n)}catch{return!0}}function $o(e){var t=io(e,1);t!==null&&Dl(t,e,1,-1)}function es(e){var t=Ho();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:e},t.queue=e,e=e.dispatch=vs.bind(null,jo,e),[t.memoizedState,e]}function ts(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=jo.updateQueue,t===null?(t={lastEffect:null,stores:null},jo.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function ns(){return Uo().memoizedState}function rs(e,t,n,r){var i=Ho();jo.flags|=e,i.memoizedState=ts(1|t,n,void 0,r===void 0?null:r)}function is(e,t,n,r){var i=Uo();r=r===void 0?null:r;var a=void 0;if(Mo!==null){var o=Mo.memoizedState;if(a=o.destroy,r!==null&&zo(r,o.deps)){i.memoizedState=ts(t,n,a,r);return}}jo.flags|=e,i.memoizedState=ts(1|t,n,a,r)}function as(e,t){return rs(8390656,8,e,t)}function os(e,t){return is(2048,8,e,t)}function ss(e,t){return is(4,2,e,t)}function cs(e,t){return is(4,4,e,t)}function ls(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function us(e,t,n){return n=n==null?null:n.concat([e]),is(4,4,ls.bind(null,t,e),n)}function ds(){}function fs(e,t){var n=Uo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ps(e,t){var n=Uo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ms(e,t,n){return Ao&21?(Ir(n,t)||(n=Wt(),jo.lanes|=n,sl|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Us=!0),e.memoizedState=n)}function hs(e,t){var n=Yt;Yt=n!==0&&4>n?n:4,e(!0);var r=ko.transition;ko.transition={};try{e(!1),t()}finally{Yt=n,ko.transition=r}}function gs(){return Uo().memoizedState}function _s(e,t,n){var r=El(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ys(e))bs(t,n);else if(n=ro(e,t,n,r),n!==null){var i=Tl();Dl(n,e,r,i),xs(n,t,r)}}function vs(e,t,n){var r=El(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ys(e))bs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ir(s,o)){var c=t.interleaved;c===null?(i.next=i,no(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=ro(e,t,i,r),n!==null&&(i=Tl(),Dl(n,e,r,i),xs(n,t,r))}}function ys(e){var t=e.alternate;return e===jo||t!==null&&t===jo}function bs(e,t){Fo=Po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jt(e,n)}}var Ss={readContext:eo,useCallback:Ro,useContext:Ro,useEffect:Ro,useImperativeHandle:Ro,useInsertionEffect:Ro,useLayoutEffect:Ro,useMemo:Ro,useReducer:Ro,useRef:Ro,useState:Ro,useDebugValue:Ro,useDeferredValue:Ro,useTransition:Ro,useMutableSource:Ro,useSyncExternalStore:Ro,useId:Ro,unstable_isNewReconciler:!1},Cs={readContext:eo,useCallback:function(e,t){return Ho().memoizedState=[e,t===void 0?null:t],e},useContext:eo,useEffect:as,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),rs(4194308,4,ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){return rs(4,2,e,t)},useMemo:function(e,t){var n=Ho();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ho();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=_s.bind(null,jo,e),[r.memoizedState,e]},useRef:function(e){var t=Ho();return e={current:e},t.memoizedState=e},useState:es,useDebugValue:ds,useDeferredValue:function(e){return Ho().memoizedState=e},useTransition:function(){var e=es(!1),t=e[0];return e=hs.bind(null,e[1]),Ho().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=jo,a=Ho();if(Oa){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),el===null)throw Error(r(349));Ao&30||Yo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(Zo.bind(null,i,o,e),[e]),i.flags|=2048,ts(9,Xo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Ho(),t=el.identifierPrefix;if(Oa){var n=xa,r=ba;n=(r&~(1<<32-Nt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Io++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Lo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},ws={readContext:eo,useCallback:fs,useContext:eo,useEffect:os,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Go,useRef:ns,useState:function(){return Go(Wo)},useDebugValue:ds,useDeferredValue:function(e){return ms(Uo(),Mo.memoizedState,e)},useTransition:function(){return[Go(Wo)[0],Uo().memoizedState]},useMutableSource:qo,useSyncExternalStore:Jo,useId:gs,unstable_isNewReconciler:!1},Ts={readContext:eo,useCallback:fs,useContext:eo,useEffect:os,useImperativeHandle:us,useInsertionEffect:ss,useLayoutEffect:cs,useMemo:ps,useReducer:Ko,useRef:ns,useState:function(){return Ko(Wo)},useDebugValue:ds,useDeferredValue:function(e){var t=Uo();return Mo===null?t.memoizedState=e:ms(t,Mo.memoizedState,e)},useTransition:function(){return[Ko(Wo)[0],Uo().memoizedState]},useMutableSource:qo,useSyncExternalStore:Jo,useId:gs,unstable_isNewReconciler:!1};function Es(e,t){if(e&&e.defaultProps){for(var n in t=oe({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ds(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:oe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Os={isMounted:function(e){return(e=e._reactInternals)?pt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tl(),i=El(e),a=co(r,i);a.payload=t,n!=null&&(a.callback=n),t=lo(e,a,i),t!==null&&(Dl(t,e,i,r),uo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tl(),i=El(e),a=co(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=lo(e,a,i),t!==null&&(Dl(t,e,i,r),uo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tl(),r=El(e),i=co(n,r);i.tag=2,t!=null&&(i.callback=t),t=lo(e,i,r),t!==null&&(Dl(t,e,r,n),uo(t,e,r))}};function ks(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Lr(n,r)||!Lr(i,a):!0}function As(e,t,n){var r=!1,i=Xi,a=t.contextType;return typeof a==`object`&&a?a=eo(a):(i=ta(t)?$i:Zi.current,r=t.contextTypes,a=(r=r!=null)?ea(e,i):Xi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Os,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function js(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Os.enqueueReplaceState(t,t.state,null)}function Ms(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},oo(e);var a=t.contextType;typeof a==`object`&&a?i.context=eo(a):(a=ta(t)?$i:Zi.current,i.context=ea(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(Ds(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Os.enqueueReplaceState(i,i.state,null),po(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Ns(e,t){try{var n=``,r=t;do n+=de(r),r=r.return;while(r);var i=n}catch(e){i=`
|
||
Error generating stack: `+e.message+`
|
||
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function Ps(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Fs(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Is=typeof WeakMap==`function`?WeakMap:Map;function Ls(e,t,n){n=co(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){hl||(hl=!0,gl=r),Fs(e,t)},n}function Rs(e,t,n){n=co(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Fs(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Fs(e,t),typeof r!=`function`&&(_l===null?_l=new Set([this]):_l.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function zs(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Is;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Ql.bind(null,e,t,n),t.then(e,e))}function Bs(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Vs(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=co(-1,1),t.tag=2,lo(n,t,1))),n.lanes|=1),e)}var Hs=S.ReactCurrentOwner,Us=!1;function Ws(e,t,n,r){t.child=e===null?Ga(t,null,n,r):Wa(t,e.child,n,r)}function Gs(e,t,n,r,i){n=n.render;var a=t.ref;return $a(t,i),r=Bo(e,t,n,r,a,i),n=Vo(),e!==null&&!Us?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,dc(e,t,i)):(Oa&&n&&wa(t),t.flags|=1,Ws(e,t,r,i),t.child)}function Ks(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ou(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,qs(e,t,a,r,i)):(e=lu(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Lr:n,n(o,r)&&e.ref===t.ref)return dc(e,t,i)}return t.flags|=1,e=cu(a,r),e.ref=t.ref,e.return=t,t.child=e}function qs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Lr(a,r)&&e.ref===t.ref)if(Us=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Us=!0);else return t.lanes=e.lanes,dc(e,t,i)}return Xs(e,t,n,r,i)}function Js(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Yi(il,rl),rl|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Yi(il,rl),rl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Yi(il,rl),rl|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Yi(il,rl),rl|=r;return Ws(e,t,i,n),t.child}function Ys(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Xs(e,t,n,r,i){var a=ta(n)?$i:Zi.current;return a=ea(t,a),$a(t,i),n=Bo(e,t,n,r,a,i),r=Vo(),e!==null&&!Us?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,dc(e,t,i)):(Oa&&r&&wa(t),t.flags|=1,Ws(e,t,n,i),t.child)}function Zs(e,t,n,r,i){if(ta(n)){var a=!0;aa(t)}else a=!1;if($a(t,i),t.stateNode===null)uc(e,t),As(t,n,r),Ms(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=eo(l):(l=ta(n)?$i:Zi.current,l=ea(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&js(t,o,r,l),ao=!1;var f=t.memoizedState;o.state=f,po(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Qi.current||ao?(typeof u==`function`&&(Ds(t,n,u,r),c=t.memoizedState),(s=ao||ks(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,so(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Es(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=eo(c):(c=ta(n)?$i:Zi.current,c=ea(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&js(t,o,r,c),ao=!1,f=t.memoizedState,o.state=f,po(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Qi.current||ao?(typeof p==`function`&&(Ds(t,n,p,r),m=t.memoizedState),(l=ao||ks(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Qs(e,t,n,r,a,i)}function Qs(e,t,n,r,i,a){Ys(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&oa(t,n,!1),dc(e,t,a);r=t.stateNode,Hs.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Wa(t,e.child,null,a),t.child=Wa(t,null,s,a)):Ws(e,t,s,a),t.memoizedState=r.state,i&&oa(t,n,!0),t.child}function $s(e){var t=e.stateNode;t.pendingContext?ra(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ra(e,t.context,!1),bo(e,t.containerInfo)}function ec(e,t,n,r,i){return La(),Ra(i),t.flags|=256,Ws(e,t,n,r),t.child}var tc={dehydrated:null,treeContext:null,retryLane:0};function nc(e){return{baseLanes:e,cachePool:null,transitions:null}}function rc(e,t,n){var r=t.pendingProps,i=wo.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Yi(wo,i&1),e===null)return Na(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=du(o,r,0,null),e=uu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=nc(n),t.memoizedState=tc,e):ic(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return oc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=cu(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=uu(a,o,n,null),a.flags|=2):a=cu(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?nc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=tc,r}return a=e.child,e=a.sibling,r=cu(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ic(e,t){return t=du({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function ac(e,t,n,r){return r!==null&&Ra(r),Wa(t,e.child,null,n),e=ic(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function oc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Ps(Error(r(422))),ac(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=du({mode:`visible`,children:i.children},a,0,null),o=uu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Wa(t,e.child,null,s),t.child.memoizedState=nc(s),t.memoizedState=tc,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return ac(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Ps(o,i,void 0),ac(e,t,s,i)}if(c=(s&e.childLanes)!==0,Us||c){if(i=el,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,io(e,a),Dl(i,e,a,-1))}return Vl(),i=Ps(Error(r(421))),ac(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=eu.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Da=Mi(a.nextSibling),Ea=t,Oa=!0,ka=null,e!==null&&(_a[va++]=ba,_a[va++]=xa,_a[va++]=ya,ba=e.id,xa=e.overflow,ya=t),t=ic(t,i.children),t.flags|=4096,t)}function sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qa(e.return,t,n)}function cc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function lc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Ws(e,t,r.children,n),r=wo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&sc(e,n,t);else if(e.tag===19)sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Yi(wo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&To(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),cc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&To(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}cc(t,!0,n,null,a);break;case`together`:cc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function uc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sl|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=cu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=cu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fc(e,t,n){switch(t.tag){case 3:$s(t),La();break;case 5:So(t);break;case 1:ta(t.type)&&aa(t);break;case 4:bo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Yi(Ka,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Yi(wo,wo.current&1),e=dc(e,t,n),e===null?null:e.sibling):rc(e,t,n):(Yi(wo,wo.current&1),t.flags|=128,null);Yi(wo,wo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return lc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Yi(wo,wo.current),r)break;return null;case 22:case 23:return t.lanes=0,Js(e,t,n)}return dc(e,t,n)}var pc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},mc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,yo(go.current);var o=null;switch(n){case`input`:i=be(e,i),r=be(e,r),o=[];break;case`select`:i=oe({},i,{value:void 0}),r=oe({},r,{value:void 0}),o=[];break;case`textarea`:i=Oe(e,i),r=Oe(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=R)}He(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&fi(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},hc=function(e,t,n,r){n!==r&&(t.flags|=4)};function gc(e,t){if(!Oa)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function _c(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vc(e,t,n){var i=t.pendingProps;switch(Ta(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _c(t),null;case 1:return ta(t.type)&&na(),_c(t),null;case 3:return i=t.stateNode,xo(),Ji(Qi),Ji(Zi),Do(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Fa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ka!==null&&(jl(ka),ka=null))),_c(t),null;case 5:Co(t);var o=yo(vo.current);if(n=t.type,e!==null&&t.stateNode!=null)mc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return _c(t),null}if(e=yo(go.current),Fa(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Fi]=t,i[Ii]=s,e=(t.mode&1)!=0,n){case`dialog`:fi(`cancel`,i),fi(`close`,i);break;case`iframe`:case`object`:case`embed`:fi(`load`,i);break;case`video`:case`audio`:for(o=0;o<ci.length;o++)fi(ci[o],i);break;case`source`:fi(`error`,i);break;case`img`:case`image`:case`link`:fi(`error`,i),fi(`load`,i);break;case`details`:fi(`toggle`,i);break;case`input`:xe(i,s),fi(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},fi(`invalid`,i);break;case`textarea`:ke(i,s),fi(`invalid`,i)}for(var c in He(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&Ci(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&Ci(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&fi(`scroll`,i)}switch(n){case`input`:_e(i),we(i,s,!0);break;case`textarea`:_e(i),je(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=R)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=Me(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Fi]=t,e[Ii]=i,pc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Ue(n,i),n){case`dialog`:fi(`cancel`,e),fi(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:fi(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ci.length;o++)fi(ci[o],e);o=i;break;case`source`:fi(`error`,e),o=i;break;case`img`:case`image`:case`link`:fi(`error`,e),fi(`load`,e),o=i;break;case`details`:fi(`toggle`,e),o=i;break;case`input`:xe(e,i),o=be(e,i),fi(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=oe({},i,{value:void 0}),fi(`invalid`,e);break;case`textarea`:ke(e,i),o=Oe(e,i),fi(`invalid`,e);break;default:o=i}for(s in He(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Be(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Fe(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Ie(e,u):typeof u==`number`&&Ie(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&fi(`scroll`,e):u!=null&&x(e,s,u,c))}switch(n){case`input`:_e(e),we(e,i,!1);break;case`textarea`:_e(e),je(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+me(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&De(e,!!i.multiple,i.defaultValue,!0):De(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=R)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return _c(t),null;case 6:if(e&&t.stateNode!=null)hc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=yo(vo.current),yo(go.current),Fa(t)){if(i=t.stateNode,n=t.memoizedProps,i[Fi]=t,(s=i.nodeValue!==n)&&(e=Ea,e!==null))switch(e.tag){case 3:Ci(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Ci(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Fi]=t,t.stateNode=i}return _c(t),null;case 13:if(Ji(wo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Oa&&Da!==null&&t.mode&1&&!(t.flags&128))Ia(),La(),t.flags|=98560,s=!1;else if(s=Fa(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Fi]=t}else La(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_c(t),s=!1}else ka!==null&&(jl(ka),ka=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||wo.current&1?al===0&&(al=3):Vl())),t.updateQueue!==null&&(t.flags|=4),_c(t),null);case 4:return xo(),e===null&&mi(t.stateNode.containerInfo),_c(t),null;case 10:return Za(t.type._context),_c(t),null;case 17:return ta(t.type)&&na(),_c(t),null;case 19:if(Ji(wo),s=t.memoizedState,s===null)return _c(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)gc(s,!1);else{if(al!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=To(e),c!==null){for(t.flags|=128,gc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Yi(wo,wo.current&1|2),t.child}e=e.sibling}s.tail!==null&&Ct()>pl&&(t.flags|=128,i=!0,gc(s,!1),t.lanes=4194304)}else{if(!i)if(e=To(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),gc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Oa)return _c(t),null}else 2*Ct()-s.renderingStartTime>pl&&n!==1073741824&&(t.flags|=128,i=!0,gc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(_c(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ct(),t.sibling=null,n=wo.current,Yi(wo,i?n&1|2:n&1),t);case 22:case 23:return Ll(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?rl&1073741824&&(_c(t),t.subtreeFlags&6&&(t.flags|=8192)):_c(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function yc(e,t){switch(Ta(t),t.tag){case 1:return ta(t.type)&&na(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xo(),Ji(Qi),Ji(Zi),Do(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Co(t),null;case 13:if(Ji(wo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));La()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ji(wo),null;case 4:return xo(),null;case 10:return Za(t.type._context),null;case 22:case 23:return Ll(),null;case 24:return null;default:return null}}var bc=!1,xc=!1,Sc=typeof WeakSet==`function`?WeakSet:Set,Cc=null;function wc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Zl(e,t,n)}else n.current=null}function Tc(e,t,n){try{n()}catch(n){Zl(e,t,n)}}var Ec=!1;function Dc(e,t){if(wi=Sn,e=Vr(),Hr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Ti={focusedElem:e,selectionRange:n},Sn=!1,Cc=t;Cc!==null;)if(t=Cc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Cc=e;else for(;Cc!==null;){t=Cc;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Es(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Zl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Cc=e;break}Cc=t.return}return h=Ec,Ec=!1,h}function Oc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Tc(t,n,a)}i=i.next}while(i!==r)}}function kc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ac(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function jc(e){var t=e.alternate;t!==null&&(e.alternate=null,jc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fi],delete t[Ii],delete t[Ri],delete t[zi],delete t[Bi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Mc(e){return e.tag===5||e.tag===3||e.tag===4}function Nc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Mc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=R));else if(r!==4&&(e=e.child,e!==null))for(Pc(e,t,n),e=e.sibling;e!==null;)Pc(e,t,n),e=e.sibling}function Fc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Fc(e,t,n),e=e.sibling;e!==null;)Fc(e,t,n),e=e.sibling}var Ic=null,Lc=!1;function Rc(e,t,n){for(n=n.child;n!==null;)zc(e,t,n),n=n.sibling}function zc(e,t,n){if(jt&&typeof jt.onCommitFiberUnmount==`function`)try{jt.onCommitFiberUnmount(At,n)}catch{}switch(n.tag){case 5:xc||wc(n,t);case 6:var r=Ic,i=Lc;Ic=null,Rc(e,t,n),Ic=r,Lc=i,Ic!==null&&(Lc?(e=Ic,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ic.removeChild(n.stateNode));break;case 18:Ic!==null&&(Lc?(e=Ic,n=n.stateNode,e.nodeType===8?ji(e.parentNode,n):e.nodeType===1&&ji(e,n),bn(e)):ji(Ic,n.stateNode));break;case 4:r=Ic,i=Lc,Ic=n.stateNode.containerInfo,Lc=!0,Rc(e,t,n),Ic=r,Lc=i;break;case 0:case 11:case 14:case 15:if(!xc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Tc(n,t,o),i=i.next}while(i!==r)}Rc(e,t,n);break;case 1:if(!xc&&(wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Zl(n,t,e)}Rc(e,t,n);break;case 21:Rc(e,t,n);break;case 22:n.mode&1?(xc=(r=xc)||n.memoizedState!==null,Rc(e,t,n),xc=r):Rc(e,t,n);break;default:Rc(e,t,n)}}function Bc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Sc),t.forEach(function(t){var r=tu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Vc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Ic=c.stateNode,Lc=!1;break a;case 3:Ic=c.stateNode.containerInfo,Lc=!0;break a;case 4:Ic=c.stateNode.containerInfo,Lc=!0;break a}c=c.return}if(Ic===null)throw Error(r(160));zc(o,s,a),Ic=null,Lc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Zl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Hc(t,e),t=t.sibling}function Hc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Vc(t,e),Uc(e),i&4){try{Oc(3,e,e.return),kc(3,e)}catch(t){Zl(e,e.return,t)}try{Oc(5,e,e.return)}catch(t){Zl(e,e.return,t)}}break;case 1:Vc(t,e),Uc(e),i&512&&n!==null&&wc(n,n.return);break;case 5:if(Vc(t,e),Uc(e),i&512&&n!==null&&wc(n,n.return),e.flags&32){var a=e.stateNode;try{Ie(a,``)}catch(t){Zl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&Se(a,o),Ue(c,s);var u=Ue(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Be(a,f):d===`dangerouslySetInnerHTML`?Fe(a,f):d===`children`?Ie(a,f):x(a,d,f,u)}switch(c){case`input`:Ce(a,o);break;case`textarea`:Ae(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?De(a,!!o.multiple,o.multiple?[]:``,!1):De(a,!!o.multiple,o.defaultValue,!0)):De(a,!!o.multiple,m,!1)}a[Ii]=o}catch(t){Zl(e,e.return,t)}}break;case 6:if(Vc(t,e),Uc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Zl(e,e.return,t)}}break;case 3:if(Vc(t,e),Uc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{bn(t.containerInfo)}catch(t){Zl(e,e.return,t)}break;case 4:Vc(t,e),Uc(e);break;case 13:Vc(t,e),Uc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(fl=Ct())),i&4&&Bc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(xc=(u=xc)||d,Vc(t,e),xc=u):Vc(t,e),Uc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Cc=e,d=e.child;d!==null;){for(f=Cc=d;Cc!==null;){switch(p=Cc,m=p.child,p.tag){case 0:case 11:case 14:case 15:Oc(4,p,p.return);break;case 1:wc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Zl(i,n,e)}}break;case 5:wc(p,p.return);break;case 22:if(p.memoizedState!==null){qc(f);continue}}m===null?qc(f):(m.return=p,Cc=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=ze(`display`,s))}catch(t){Zl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Zl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Vc(t,e),Uc(e),i&4&&Bc(e);break;case 21:break;default:Vc(t,e),Uc(e)}}function Uc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Mc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Ie(a,``),i.flags&=-33),Fc(e,Nc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Pc(e,Nc(e),o);break;default:throw Error(r(161))}}catch(t){Zl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wc(e,t,n){Cc=e,Gc(e,t,n)}function Gc(e,t,n){for(var r=(e.mode&1)!=0;Cc!==null;){var i=Cc,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||bc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||xc;s=bc;var l=xc;if(bc=o,(xc=c)&&!l)for(Cc=i;Cc!==null;)o=Cc,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Jc(i):(c.return=o,Cc=c);for(;a!==null;)Cc=a,Gc(a,t,n),a=a.sibling;Cc=i,bc=s,xc=l}Kc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Cc=a):Kc(e,t,n)}}function Kc(e){for(;Cc!==null;){var t=Cc;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:xc||kc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!xc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Es(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&mo(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}mo(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&bn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}xc||t.flags&512&&Ac(t)}catch(e){Zl(t,t.return,e)}}if(t===e){Cc=null;break}if(n=t.sibling,n!==null){n.return=t.return,Cc=n;break}Cc=t.return}}function qc(e){for(;Cc!==null;){var t=Cc;if(t===e){Cc=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Cc=n;break}Cc=t.return}}function Jc(e){for(;Cc!==null;){var t=Cc;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{kc(4,t)}catch(e){Zl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Zl(t,i,e)}}var a=t.return;try{Ac(t)}catch(e){Zl(t,a,e)}break;case 5:var o=t.return;try{Ac(t)}catch(e){Zl(t,o,e)}}}catch(e){Zl(t,t.return,e)}if(t===e){Cc=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Cc=s;break}Cc=t.return}}var Yc=Math.ceil,Xc=S.ReactCurrentDispatcher,Zc=S.ReactCurrentOwner,Qc=S.ReactCurrentBatchConfig,$c=0,el=null,tl=null,nl=0,rl=0,il=qi(0),al=0,ol=null,sl=0,cl=0,ll=0,ul=null,dl=null,fl=0,pl=1/0,ml=null,hl=!1,gl=null,_l=null,vl=!1,yl=null,bl=0,xl=0,Sl=null,Cl=-1,wl=0;function Tl(){return $c&6?Ct():Cl===-1?Cl=Ct():Cl}function El(e){return e.mode&1?$c&2&&nl!==0?nl&-nl:za.transition===null?(e=Yt,e===0?(e=window.event,e=e===void 0?16:On(e.type),e):e):(wl===0&&(wl=Wt()),wl):1}function Dl(e,t,n,i){if(50<xl)throw xl=0,Sl=null,Error(r(185));Kt(e,n,i),(!($c&2)||e!==el)&&(e===el&&(!($c&2)&&(cl|=n),al===4&&Nl(e,nl)),Ol(e,i),n===1&&$c===0&&!(t.mode&1)&&(pl=Ct()+500,ca&&fa()))}function Ol(e,t){var n=e.callbackNode;Ht(e,t);var r=Bt(e,e===el?nl:0);if(r===0)n!==null&&bt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&bt(n),t===1)e.tag===0?da(Pl.bind(null,e)):ua(Pl.bind(null,e)),ki(function(){!($c&6)&&fa()}),n=null;else{switch(Xt(r)){case 1:n=Tt;break;case 4:n=Et;break;case 16:n=Dt;break;case 536870912:n=kt;break;default:n=Dt}n=ru(n,kl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function kl(e,t){if(Cl=-1,wl=0,$c&6)throw Error(r(327));var n=e.callbackNode;if(Yl()&&e.callbackNode!==n)return null;var i=Bt(e,e===el?nl:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Hl(e,i);else{t=i;var a=$c;$c|=2;var o=Bl();(el!==e||nl!==t)&&(ml=null,pl=Ct()+500,Rl(e,t));do try{Wl();break}catch(t){zl(e,t)}while(1);Xa(),Xc.current=o,$c=a,tl===null?(el=null,nl=0,t=al):t=0}if(t!==0){if(t===2&&(a=Ut(e),a!==0&&(i=a,t=Al(e,a))),t===1)throw n=ol,Rl(e,0),Nl(e,i),Ol(e,Ct()),n;if(t===6)Nl(e,i);else{if(a=e.current.alternate,!(i&30)&&!Ml(a)&&(t=Hl(e,i),t===2&&(o=Ut(e),o!==0&&(i=o,t=Al(e,o))),t===1))throw n=ol,Rl(e,0),Nl(e,i),Ol(e,Ct()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:ql(e,dl,ml);break;case 3:if(Nl(e,i),(i&130023424)===i&&(t=fl+500-Ct(),10<t)){if(Bt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){Tl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Ei(ql.bind(null,e,dl,ml),t);break}ql(e,dl,ml);break;case 4:if(Nl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-Nt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=Ct()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Yc(i/1960))-i,10<i){e.timeoutHandle=Ei(ql.bind(null,e,dl,ml),i);break}ql(e,dl,ml);break;case 5:ql(e,dl,ml);break;default:throw Error(r(329))}}}return Ol(e,Ct()),e.callbackNode===n?kl.bind(null,e):null}function Al(e,t){var n=ul;return e.current.memoizedState.isDehydrated&&(Rl(e,t).flags|=256),e=Hl(e,t),e!==2&&(t=dl,dl=n,t!==null&&jl(t)),e}function jl(e){dl===null?dl=e:dl.push.apply(dl,e)}function Ml(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ir(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Nl(e,t){for(t&=~ll,t&=~cl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Nt(t),r=1<<n;e[n]=-1,t&=~r}}function Pl(e){if($c&6)throw Error(r(327));Yl();var t=Bt(e,0);if(!(t&1))return Ol(e,Ct()),null;var n=Hl(e,t);if(e.tag!==0&&n===2){var i=Ut(e);i!==0&&(t=i,n=Al(e,i))}if(n===1)throw n=ol,Rl(e,0),Nl(e,t),Ol(e,Ct()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ql(e,dl,ml),Ol(e,Ct()),null}function Fl(e,t){var n=$c;$c|=1;try{return e(t)}finally{$c=n,$c===0&&(pl=Ct()+500,ca&&fa())}}function Il(e){yl!==null&&yl.tag===0&&!($c&6)&&Yl();var t=$c;$c|=1;var n=Qc.transition,r=Yt;try{if(Qc.transition=null,Yt=1,e)return e()}finally{Yt=r,Qc.transition=n,$c=t,!($c&6)&&fa()}}function Ll(){rl=il.current,Ji(il)}function Rl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Di(n)),tl!==null)for(n=tl.return;n!==null;){var r=n;switch(Ta(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&na();break;case 3:xo(),Ji(Qi),Ji(Zi),Do();break;case 5:Co(r);break;case 4:xo();break;case 13:Ji(wo);break;case 19:Ji(wo);break;case 10:Za(r.type._context);break;case 22:case 23:Ll()}n=n.return}if(el=e,tl=e=cu(e.current,null),nl=rl=t,al=0,ol=null,ll=cl=sl=0,dl=ul=null,to!==null){for(t=0;t<to.length;t++)if(n=to[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}to=null}return e}function zl(e,t){do{var n=tl;try{if(Xa(),Oo.current=Ss,Po){for(var i=jo.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Po=!1}if(Ao=0,No=Mo=jo=null,Fo=!1,Io=0,Zc.current=null,n===null||n.return===null){al=1,ol=t,tl=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=nl,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Bs(s);if(m!==null){m.flags&=-257,Vs(m,s,c,o,t),m.mode&1&&zs(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){zs(o,u,t),Vl();break a}l=Error(r(426))}}else if(Oa&&c.mode&1){var _=Bs(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Vs(_,s,c,o,t),Ra(Ns(l,c));break a}}o=l=Ns(l,c),al!==4&&(al=2),ul===null?ul=[o]:ul.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Ls(o,l,t);fo(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(_l===null||!_l.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Rs(o,c,t);fo(o,x);break a}}o=o.return}while(o!==null)}Kl(n)}catch(e){t=e,tl===n&&n!==null&&(tl=n=n.return);continue}break}while(1)}function Bl(){var e=Xc.current;return Xc.current=Ss,e===null?Ss:e}function Vl(){(al===0||al===3||al===2)&&(al=4),el===null||!(sl&268435455)&&!(cl&268435455)||Nl(el,nl)}function Hl(e,t){var n=$c;$c|=2;var i=Bl();(el!==e||nl!==t)&&(ml=null,Rl(e,t));do try{Ul();break}catch(t){zl(e,t)}while(1);if(Xa(),$c=n,Xc.current=i,tl!==null)throw Error(r(261));return el=null,nl=0,al}function Ul(){for(;tl!==null;)Gl(tl)}function Wl(){for(;tl!==null&&!xt();)Gl(tl)}function Gl(e){var t=nu(e.alternate,e,rl);e.memoizedProps=e.pendingProps,t===null?Kl(e):tl=t,Zc.current=null}function Kl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=yc(n,t),n!==null){n.flags&=32767,tl=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{al=6,tl=null;return}}else if(n=vc(n,t,rl),n!==null){tl=n;return}if(t=t.sibling,t!==null){tl=t;return}tl=t=e}while(t!==null);al===0&&(al=5)}function ql(e,t,n){var r=Yt,i=Qc.transition;try{Qc.transition=null,Yt=1,Jl(e,t,n,r)}finally{Qc.transition=i,Yt=r}return null}function Jl(e,t,n,i){do Yl();while(yl!==null);if($c&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(qt(e,o),e===el&&(tl=el=null,nl=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||vl||(vl=!0,ru(Dt,function(){return Yl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Qc.transition,Qc.transition=null;var s=Yt;Yt=1;var c=$c;$c|=4,Zc.current=null,Dc(e,n),Hc(n,e),Ur(Ti),Sn=!!wi,Ti=wi=null,e.current=n,Wc(n,e,a),St(),$c=c,Yt=s,Qc.transition=o}else e.current=n;if(vl&&(vl=!1,yl=e,bl=a),o=e.pendingLanes,o===0&&(_l=null),Mt(n.stateNode,i),Ol(e,Ct()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(hl)throw hl=!1,e=gl,gl=null,e;return bl&1&&e.tag!==0&&Yl(),o=e.pendingLanes,o&1?e===Sl?xl++:(xl=0,Sl=e):xl=0,fa(),null}function Yl(){if(yl!==null){var e=Xt(bl),t=Qc.transition,n=Yt;try{if(Qc.transition=null,Yt=16>e?16:e,yl===null)var i=!1;else{if(e=yl,yl=null,bl=0,$c&6)throw Error(r(331));var a=$c;for($c|=4,Cc=e.current;Cc!==null;){var o=Cc,s=o.child;if(Cc.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(Cc=u;Cc!==null;){var d=Cc;switch(d.tag){case 0:case 11:case 15:Oc(8,d,o)}var f=d.child;if(f!==null)f.return=d,Cc=f;else for(;Cc!==null;){d=Cc;var p=d.sibling,m=d.return;if(jc(d),d===u){Cc=null;break}if(p!==null){p.return=m,Cc=p;break}Cc=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}Cc=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Cc=s;else b:for(;Cc!==null;){if(o=Cc,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Oc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,Cc=v;break b}Cc=o.return}}var y=e.current;for(Cc=y;Cc!==null;){s=Cc;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,Cc=b;else b:for(s=y;Cc!==null;){if(c=Cc,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:kc(9,c)}}catch(e){Zl(c,c.return,e)}if(c===s){Cc=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,Cc=x;break b}Cc=c.return}}if($c=a,fa(),jt&&typeof jt.onPostCommitFiberRoot==`function`)try{jt.onPostCommitFiberRoot(At,e)}catch{}i=!0}return i}finally{Yt=n,Qc.transition=t}}return!1}function Xl(e,t,n){t=Ns(n,t),t=Ls(e,t,1),e=lo(e,t,1),t=Tl(),e!==null&&(Kt(e,1,t),Ol(e,t))}function Zl(e,t,n){if(e.tag===3)Xl(e,e,n);else for(;t!==null;){if(t.tag===3){Xl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_l===null||!_l.has(r))){e=Ns(n,e),e=Rs(t,e,1),t=lo(t,e,1),e=Tl(),t!==null&&(Kt(t,1,e),Ol(t,e));break}}t=t.return}}function Ql(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Tl(),e.pingedLanes|=e.suspendedLanes&n,el===e&&(nl&n)===n&&(al===4||al===3&&(nl&130023424)===nl&&500>Ct()-fl?Rl(e,0):ll|=n),Ol(e,t)}function $l(e,t){t===0&&(e.mode&1?(t=Rt,Rt<<=1,!(Rt&130023424)&&(Rt=4194304)):t=1);var n=Tl();e=io(e,t),e!==null&&(Kt(e,t,n),Ol(e,n))}function eu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$l(e,n)}function tu(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),$l(e,n)}var nu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qi.current)Us=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Us=!1,fc(e,t,n);Us=!!(e.flags&131072)}else Us=!1,Oa&&t.flags&1048576&&Ca(t,ga,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;uc(e,t),e=t.pendingProps;var a=ea(t,Zi.current);$a(t,n),a=Bo(null,t,i,e,a,n);var o=Vo();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ta(i)?(o=!0,aa(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,oo(t),a.updater=Os,t.stateNode=a,a._reactInternals=t,Ms(t,i,e,n),t=Qs(null,t,i,!0,o,n)):(t.tag=0,Oa&&o&&wa(t),Ws(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(uc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=su(i),e=Es(i,e),a){case 0:t=Xs(null,t,i,e,n);break a;case 1:t=Zs(null,t,i,e,n);break a;case 11:t=Gs(null,t,i,e,n);break a;case 14:t=Ks(null,t,i,Es(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Es(i,a),Xs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Es(i,a),Zs(e,t,i,a,n);case 3:a:{if($s(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,so(e,t),po(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ns(Error(r(423)),t),t=ec(e,t,i,n,a);break a}else if(i!==a){a=Ns(Error(r(424)),t),t=ec(e,t,i,n,a);break a}else for(Da=Mi(t.stateNode.containerInfo.firstChild),Ea=t,Oa=!0,ka=null,n=Ga(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(La(),i===a){t=dc(e,t,n);break a}Ws(e,t,i,n)}t=t.child}return t;case 5:return So(t),e===null&&Na(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,z(i,a)?s=null:o!==null&&z(i,o)&&(t.flags|=32),Ys(e,t),Ws(e,t,s,n),t.child;case 6:return e===null&&Na(t),null;case 13:return rc(e,t,n);case 4:return bo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Wa(t,null,i,n):Ws(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Es(i,a),Gs(e,t,i,a,n);case 7:return Ws(e,t,t.pendingProps,n),t.child;case 8:return Ws(e,t,t.pendingProps.children,n),t.child;case 12:return Ws(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Yi(Ka,i._currentValue),i._currentValue=s,o!==null)if(Ir(o.value,s)){if(o.children===a.children&&!Qi.current){t=dc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=co(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Qa(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Qa(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ws(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,$a(t,n),a=eo(a),i=i(a),t.flags|=1,Ws(e,t,i,n),t.child;case 14:return i=t.type,a=Es(i,t.pendingProps),a=Es(i.type,a),Ks(e,t,i,a,n);case 15:return qs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Es(i,a),uc(e,t),t.tag=1,ta(i)?(e=!0,aa(t)):e=!1,$a(t,n),As(t,i,a),Ms(t,i,a,n),Qs(null,t,i,!0,e,n);case 19:return lc(e,t,n);case 22:return Js(e,t,n)}throw Error(r(156,t.tag))};function ru(e,t){return yt(e,t)}function iu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function au(e,t,n,r){return new iu(e,t,n,r)}function ou(e){return e=e.prototype,!(!e||!e.isReactComponent)}function su(e){if(typeof e==`function`)return ou(e)?1:0;if(e!=null){if(e=e.$$typeof,e===A)return 11;if(e===te)return 14}return 2}function cu(e,t){var n=e.alternate;return n===null?(n=au(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function lu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ou(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case T:return uu(n.children,a,o,t);case E:s=8,a|=8;break;case D:return e=au(12,n,t,a|2),e.elementType=D,e.lanes=o,e;case j:return e=au(13,n,t,a),e.elementType=j,e.lanes=o,e;case ee:return e=au(19,n,t,a),e.elementType=ee,e.lanes=o,e;case re:return du(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case O:s=10;break a;case k:s=9;break a;case A:s=11;break a;case te:s=14;break a;case ne:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=au(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function uu(e,t,n,r){return e=au(7,e,r,t),e.lanes=n,e}function du(e,t,n,r){return e=au(22,e,r,t),e.elementType=re,e.lanes=n,e.stateNode={isHidden:!1},e}function fu(e,t,n){return e=au(6,e,null,t),e.lanes=n,e}function pu(e,t,n){return t=au(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function mu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gt(0),this.expirationTimes=Gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hu(e,t,n,r,i,a,o,s,c){return e=new mu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=au(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},oo(a),e}function gu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:w,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function _u(e){if(!e)return Xi;e=e._reactInternals;a:{if(pt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(ta(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(ta(n))return ia(e,n,t)}return t}function vu(e,t,n,r,i,a,o,s,c){return e=hu(n,r,!0,e,i,a,o,s,c),e.context=_u(null),n=e.current,r=Tl(),i=El(n),a=co(r,i),a.callback=t??null,lo(n,a,i),e.current.lanes=i,Kt(e,i,r),Ol(e,r),e}function yu(e,t,n,r){var i=t.current,a=Tl(),o=El(i);return n=_u(n),t.context===null?t.context=n:t.pendingContext=n,t=co(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=lo(i,t,o),e!==null&&(Dl(e,i,o,a),uo(e,i,o)),o}function bu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function xu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Su(e,t){xu(e,t),(e=e.alternate)&&xu(e,t)}function Cu(){return null}var wu=typeof reportError==`function`?reportError:function(e){console.error(e)};function Tu(e){this._internalRoot=e}Eu.prototype.render=Tu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));yu(e,t,null,null)},Eu.prototype.unmount=Tu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Il(function(){yu(null,e,null,null)}),t[Li]=null}};function Eu(e){this._internalRoot=e}Eu.prototype.unstable_scheduleHydration=function(e){if(e){var t=en();e={blockedOn:null,target:e,priority:t};for(var n=0;n<un.length&&t!==0&&t<un[n].priority;n++);un.splice(n,0,e),n===0&&hn(e)}};function Du(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ou(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function ku(){}function Au(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=bu(o);a.call(e)}}var o=vu(t,r,e,0,null,!1,!1,``,ku);return e._reactRootContainer=o,e[Li]=o.current,mi(e.nodeType===8?e.parentNode:e),Il(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=bu(c);s.call(e)}}var c=hu(e,0,!1,null,null,!1,!1,``,ku);return e._reactRootContainer=c,e[Li]=c.current,mi(e.nodeType===8?e.parentNode:e),Il(function(){yu(t,c,n,r)}),c}function ju(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=bu(o);s.call(e)}}yu(t,o,e,i)}else o=Au(n,t,e,i,r);return bu(o)}Zt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=zt(t.pendingLanes);n!==0&&(Jt(t,n|1),Ol(t,Ct()),!($c&6)&&(pl=Ct()+500,fa()))}break;case 13:Il(function(){var t=io(e,1);t!==null&&Dl(t,e,1,Tl())}),Su(e,1)}},Qt=function(e){if(e.tag===13){var t=io(e,134217728);t!==null&&Dl(t,e,134217728,Tl()),Su(e,134217728)}},$t=function(e){if(e.tag===13){var t=El(e),n=io(e,t);n!==null&&Dl(n,e,t,Tl()),Su(e,t)}},en=function(){return Yt},tn=function(e,t){var n=Yt;try{return Yt=e,t()}finally{Yt=n}},Ke=function(e,t,n){switch(t){case`input`:if(Ce(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Wi(i);if(!a)throw Error(r(90));ve(i),Ce(i,a)}}}break;case`textarea`:Ae(e,n);break;case`select`:t=n.value,t!=null&&De(e,!!n.multiple,t,!1)}},Qe=Fl,$e=Il;var Mu={usingClientEntryPoint:!1,Events:[Hi,Ui,Wi,Xe,Ze,Fl]},Nu={findFiberByHostInstance:Vi,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},Pu={bundleType:Nu.bundleType,version:Nu.version,rendererPackageName:Nu.rendererPackageName,rendererConfig:Nu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=_t(e),e===null?null:e.stateNode},findFiberByHostInstance:Nu.findFiberByHostInstance||Cu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Fu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fu.isDisabled&&Fu.supportsFiber)try{At=Fu.inject(Pu),jt=Fu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Du(t))throw Error(r(200));return gu(e,t,null,n)},e.createRoot=function(e,t){if(!Du(e))throw Error(r(299));var n=!1,i=``,a=wu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=hu(e,1,!1,null,null,n,!1,i,a),e[Li]=t.current,mi(e.nodeType===8?e.parentNode:e),new Tu(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=_t(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Il(e)},e.hydrate=function(e,t,n){if(!Ou(t))throw Error(r(200));return ju(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!Du(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=wu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=vu(t,null,e,1,n??null,a,!1,o,s),e[Li]=t.current,mi(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Eu(t)},e.render=function(e,t,n){if(!Ou(t))throw Error(r(200));return ju(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!Ou(e))throw Error(r(40));return e._reactRootContainer?(Il(function(){ju(null,null,e,!1,function(){e._reactRootContainer=null,e[Li]=null})}),!0):!1},e.unstable_batchedUpdates=Fl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Ou(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return ju(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),Yg=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Jg()})),Xg=s((e=>{var t=Yg();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),Zg=s((e=>{var t=_(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),Qg=s(((e,t)=>{t.exports=Zg()}));Wr();var U=u(_()),$g=u(Xg()),W=Qg(),e_=e=>{let{children:t,className:n,clickSpaceDestroy:r,destroy:i}=e,a=()=>{r&&i()},o=e=>{(e.key===`Escape`||(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`w`)&&i()};return(0,W.jsx)(`div`,{className:`dialog-wrapper ${n}`,onClick:a,onKeyDown:e=>o(e),children:(0,W.jsx)(`div`,{className:`dialog-container`,onClick:e=>e.stopPropagation(),children:t})})};function t_(e,t,n){let r=document.createElement(`div`);document.body.append(r),setTimeout(()=>{r.firstElementChild?.classList.add(`showup`)},0);let i={destroy:()=>{r.firstElementChild?.classList.remove(`showup`),r.firstElementChild?.classList.add(`showoff`),setTimeout(()=>{r.detach(),s.unmount(),document.body.find(`.domtoimage-thino`)&&document.body.findAll(`.domtoimage-thino`).forEach(e=>{e.detach()})},200)}},a={...n,destroy:i.destroy},o=(0,W.jsx)(e_,{destroy:i.destroy,clickSpaceDestroy:!0,...e,children:(0,W.jsx)(t,{...a})}),s=$g.createRoot(r);return s.render(o),i}function n_(){return localStorage.getItem(`language`)||navigator.language||`en`}function r_(){let e=n_().toLowerCase();return e===`zh`||e.startsWith(`zh-`)}var i_=o((()=>{}));N(),i_();var a_=`thino-changelog-view`;async function o_(e){let{workspace:t}=e,n=t.getLeavesOfType(a_);if(n.length>0){t.revealLeaf(n[0]);return}let r=t.getLeaf(`tab`);await r.setViewState({type:a_,active:!0}),t.revealLeaf(r)}var s_=class extends f.ItemView{component;version;constructor(e,t){super(e),this.version=t}getViewType(){return a_}getDisplayText(){return M(`Thino update info`)}getIcon(){return`info`}async onOpen(){let e=this.containerEl.children[1];e.empty(),e.addClass(`thino-changelog-modal`),e.createEl(`h2`,{text:M(`Thino update info`),cls:`thino-changelog-title`}).createDiv({cls:`thino-changelog-version`,text:`${this.version}`});try{e.createEl(`h3`,{text:M(`Latest version`)});let t=e.createDiv(`current-change-log`);e.createEl(`hr`),e.createEl(`h3`,{text:M(`Previous version`)});let n=e.createDiv(`prev-change-log`),r=await(0,f.requestUrl)(`https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md`);this.component=new f.Component;let[i,a]=this.getLatestVersionContent(r.text),o=i,s=a;try{o=r_()?i.replaceAll(`> [!tips]+`,`> [!tips]-`).replaceAll(`> [!note]-`,`> [!note]+`):i,s=r_()?a.replaceAll(`> [!tips]+`,`> [!tips]-`).replaceAll(`> [!note]-`,`> [!note]+`):a}catch(e){console.error(e)}await f.MarkdownRenderer.render(this.app,o,t,``,this.component),await f.MarkdownRenderer.render(this.app,s,n,``,this.component)}catch(t){console.error(t),e.createEl(`p`,{text:M(`Failed to load changelog`)}),e.createEl(`a`,{text:M(`View online`),attr:{href:`https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md`,target:`_blank`}})}}async onClose(){this.component?.unload()}getLatestVersionContent(e){let t=[...e.matchAll(/^# .+/gm)];if(t.length===0)return[e,``];let n=t[0].index||0,r=e.length;return t.length>1&&(r=t[1].index||e.length),[e.substring(n,r).trim(),e.substring(r).trim()]}};H(),N(),vi();var c_=class extends f.Modal{plugin;constructor(e,t,n){super(e),this.version=n,this.plugin=t}onOpen(){super.onOpen(),this.titleEl.setText(M(`Submit issue`)),new f.Setting(this.contentEl).setName(M(`Current version`)+`: `+this.version),new f.Setting(this.contentEl).setName(M(`Bug report`)).setDesc(M(`Click the button to copy debug info and open the issue page`)).addButton(e=>{e.setButtonText(M(`Copy and go`)).onClick(async()=>{await N7(this.plugin),new f.Notice(M(`Debug info copied`)),setTimeout(()=>{window.open(`https://github.com/Quorafind/Obsidian-Thino/issues/new/choose`,`_blank`),this.close()},100)})}),new f.Setting(this.contentEl).setName(M(`Feature request`)).setDesc(M(`Submit your feature request to the issue page`)).addButton(e=>{e.setButtonText(M(`Go`)).onClick(async()=>{window.open(`https://github.com/Quorafind/Obsidian-Thino/issues/new/choose`,`_blank`),this.close()})})}};function l_(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=l_(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function u_(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=l_(e))&&(r&&(r+=` `),r+=t);return r}N(),H(),Rg(),Qr(),vi(),Si(),Kh();var d_=(e,t,n)=>{console.warn(`This function is deprecated, use ThinoWorkerManager.calculateStatsBanner() instead`);let r={memosLength:0,tagsLength:0,createdDays:0,taskAmount:0,mostActiveDay:``,mostActiveHour:``,earliestMemo:null,lengthOverflow:!1};if(r.memosLength=e.filter(e=>!(e.deletedAt!==``&&e.deletedAt)).length,r.tagsLength=t.length,r.earliestMemo=e.length>0?e[e.length-1]:null,r.earliestMemo&&r.earliestMemo.createdAt){let e=Bp(r.earliestMemo.createdAt,`yyyy/MM/dd HH:mm:ss`,new Date);r.createdDays=Dc(new Date,e)+1}return r.taskAmount=e.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`).filter(e=>e.thinoType&&e.thinoType?.startsWith(`TASK`)).length,r.mostActiveDay=f_(e),r.mostActiveHour=p_(e),r.lengthOverflow=r.memosLength>9999||r.tagsLength>999||r.createdDays>999,n&&__(n)&&v_({tags:r.tagsLength,memos:r.memosLength,days:r.createdDays},n),r},f_=e=>{let t={};return e.forEach(e=>{let n=e.createdAt.split(` `)[0];t[n]?t[n]++:t[n]=1}),Object.keys(t).sort((e,n)=>t[n]-t[e])[0]},p_=e=>{let t={};return e.forEach(e=>{let n=e.createdAt.slice(11,13);t[n]?t[n]++:t[n]=1}),Object.keys(t).sort((e,n)=>t[n]-t[e])[0]};function m_(e,t=1e3){let[n,r]=(0,U.useState)(e),i=(0,U.useRef)(),a=(0,U.useRef)(),o=(0,U.useRef)(!0);return(0,U.useEffect)(()=>(o.current=!0,()=>{o.current=!1,i.current&&cancelAnimationFrame(i.current)}),[]),(0,U.useEffect)(()=>{if(!o.current)return;let s=n,c=e-s;if(Math.abs(c)<.01){r(e);return}let l=n=>{if(!o.current)return;a.current||=n;let u=n-a.current,d=Math.min(u/t,1),f=s+c*d;o.current&&r(f),d<1&&o.current?i.current=requestAnimationFrame(l):(o.current&&r(e),a.current=void 0)};return i.current=requestAnimationFrame(l),()=>{i.current&&cancelAnimationFrame(i.current),a.current=void 0}},[e,t,n]),Math.round(n)}var h_=({statusType:e})=>{let{memos:t,tags:n}=F(),{pathname:r}=di(),{settings:i,app:a,plugin:o}=I(),s=(0,U.useRef)(!0),c=(0,U.useRef)(null),[l,u]=(0,U.useState)({memosLength:0,createdDays:0,tagsLength:0,taskAmount:0,mostActiveDay:``,mostActiveHour:``,earliestMemo:null,lengthOverflow:!1}),[d,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(null),g=m_(l.memosLength),_=m_(l.createdDays),v=U.useCallback((e,t)=>{if(!s.current)return;if(d&&t===m){z.setMemoFilter(``),p(!1);return}let n=Bg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([e]));Bg.pushQuery(n),z.setMemoFilter(n.id),p(!0),h(t)},[d,m]),y=U.useCallback(()=>{v({type:`LIST`,value:{operator:`IS_NOT`,value:`LIST`},relation:`AND`},`LIST`)},[v]),b=U.useCallback(()=>{v({type:`TYPE`,value:{operator:`IS_NOT`,value:`NOT_TAGGED`},relation:`AND`},`TYPE`)},[v]),x=U.useCallback(()=>{R.setShowSiderbarInMobileView(!1),z.setPathname(`/daily`)},[]),S=U.useCallback(()=>{if(!l.mostActiveDay)return;let e=Bp(l.mostActiveDay,`yyyy/MM/dd`,new Date),t=Hs(e).getTime(),n=Fc(e).getTime();z.setFromAndToQuery(t,n)},[l.mostActiveDay]);return(0,U.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]),(0,U.useEffect)(()=>{if(!a||!a.appId||!s.current)return;let e=__(a);s.current&&u(t=>({...t,tagsLength:e.tags,memosLength:e.memos,createdDays:e.days}))},[a]),(0,U.useEffect)(()=>{if(!s.current||!V.initialized||!o?.thinoWorkerManager||!t||r!==`/`)return;let e=!1,i=async()=>{try{let r=await o.thinoWorkerManager.calculateStatsBanner(t,n);if(e||!s.current)return;let i={memosLength:r.memosLength,tagsLength:Math.max(r.tagsLength,n.length),earliestMemo:r.earliestMemo,lengthOverflow:r.lengthOverflow,createdDays:r.createdDays||0,taskAmount:r.taskAmount||0,mostActiveDay:r.mostActiveDay||``,mostActiveHour:r.mostActiveHour||``};s.current&&u(e=>({...e,...i})),a&&s.current&&v_({tags:i.tagsLength,memos:i.memosLength,days:i.createdDays},a)}catch(r){if(e||!s.current)return;console.error(`Failed to calculate stats banner:`,r);try{let e=d_(t,n,o.app);s.current&&u(t=>({...t,memosLength:e.memosLength,tagsLength:e.tagsLength,earliestMemo:e.earliestMemo,lengthOverflow:e.lengthOverflow}))}catch(e){console.error(`Fallback calculation also failed:`,e)}}},c=window.requestIdleCallback(()=>{e||i()},{timeout:2e3});return()=>{e=!0,window.cancelIdleCallback(c)}},[n,t,r,o,a]),(0,U.useEffect)(()=>{if(!s.current||e===`banner`||!o?.thinoWorkerManager)return;let r=!1,i=async()=>{try{let e=await o.thinoWorkerManager.calculateStatsBanner(t,n);if(r||!s.current)return;u(t=>({...t,taskAmount:e.taskAmount||0,mostActiveDay:e.mostActiveDay||``,mostActiveHour:e.mostActiveHour||``}))}catch(e){!r&&s.current&&console.error(`Failed to calculate sidebar stats:`,e)}},a=window.requestIdleCallback(()=>{r||i()},{timeout:2e3});return()=>{r=!0,window.cancelIdleCallback(a)}},[t,n,e,o]),(0,U.useEffect)(()=>{!s.current||!c.current||!l.earliestMemo?.createdAt||(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(c.current,M(`Started from`)+` `+P.getDateTimeString(l.earliestMemo?.createdAt??``))},[l.earliestMemo]),(0,W.jsx)(`div`,{className:u_(`status-text-container`,l.lengthOverflow?`text-overflow`:``,e),children:e===`banner`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`status-text memos-text`,children:[(0,W.jsx)(`span`,{className:`amount-text`,children:g}),(0,W.jsx)(`span`,{className:`type-text`,children:`THINO`})]}),(0,W.jsxs)(`div`,{className:`status-text tags-text`,children:[(0,W.jsx)(`span`,{className:`amount-text`,children:l.tagsLength}),(0,W.jsx)(`span`,{className:`type-text`,children:M(`TAG`)})]}),(0,W.jsxs)(`div`,{ref:c,className:`status-text duration-text`,onClick:x,children:[(0,W.jsx)(`span`,{className:`amount-text`,children:_??0}),(0,W.jsx)(`span`,{className:`type-text`,children:M(`DAY`)})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`status-sidebar-header title-text`,children:(0,W.jsx)(`span`,{className:`normal-text`,children:M(`Thino status`)})}),(0,W.jsxs)(`div`,{className:`status-sidebar-wrapper`,children:[(0,W.jsxs)(`div`,{className:`status-text memos-text`,children:[(0,W.jsx)(`span`,{className:`type-text`,children:M(`Thino amount`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:g})]}),(0,W.jsxs)(`div`,{className:`status-text memos-text`,onClick:y,children:[(0,W.jsx)(`span`,{className:`type-text`,children:M(`Task amount`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:l.taskAmount??0})]}),(0,W.jsxs)(`div`,{className:`status-text tags-text`,onClick:b,children:[(0,W.jsx)(`span`,{className:`type-text`,children:M(`Used tags`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:l.tagsLength})]}),(0,W.jsxs)(`div`,{ref:c,className:`status-text duration-text`,onClick:x,children:[(0,W.jsx)(`span`,{className:`type-text`,children:M(`Used days`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:_??0})]}),(0,W.jsxs)(`div`,{className:`status-text most-active-day-text`,onClick:S,children:[(0,W.jsx)(`span`,{className:`type-text`,children:M(`Most active day`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:l.mostActiveDay})]}),(0,W.jsxs)(`div`,{className:`status-text most-active-hour-text`,children:[(0,W.jsx)(`span`,{className:`type-text`,children:M(`Most active hour`)}),(0,W.jsx)(`span`,{className:`amount-text`,children:l.mostActiveHour})]})]})]})})};function g_(e){return`userBannerCache:${e}`}function __(e){try{if(!e?.appId)return{tags:0,memos:0,days:0};let t=g_(e.appId),n=xi.get([t])[t];return n?JSON.parse(n):{tags:0,memos:0,days:0}}catch(e){return console.error(e),{tags:0,memos:0,days:0}}}function v_({tags:e,memos:t,days:n},r){try{if(!r?.appId)return;let i={tags:e,memos:t,days:n},a=g_(r.appId);xi.set({[a]:JSON.stringify(i)})}catch(e){console.error(e)}}function y_(e,t){let n=e.length,r=0,i=0,a=0;for(let o=0;o<n;o++)r+=e[o]*t[o],i+=e[o]*e[o],a+=t[o]*t[o];let o=Math.sqrt(i)*Math.sqrt(a);return o===0?0:r/o}var b_=2,x_=5e3,S_=384,C_=class{vectors=new Map;memoIndex=new Map;dirty=!1;saveTimer=null;adapter=null;storePath=``;dimensions=S_;async initialize(e,t){this.adapter=e,this.storePath=`${t}/vectors/index.json`;let n=`${t}/vectors`;if(await e.exists(n)||await e.mkdir(n),await e.exists(this.storePath))try{let t=await e.read(this.storePath),n=JSON.parse(t);if(n.version===b_){this.dimensions=n.dimensions;for(let[e,t]of Object.entries(n.entries))this.vectors.set(e,t),this.addToMemoIndex(t.memoId,e)}}catch(e){console.warn(`[VectorStore] Failed to load index, starting fresh:`,e)}}async addVectorBatch(e){for(let t of e){if(t.vector.length!==this.dimensions&&this.vectors.size>0){console.warn(`[VectorStore] Dimension mismatch: expected ${this.dimensions}, got ${t.vector.length}`);continue}this.vectors.size===0&&t.vector.length!==this.dimensions&&(this.dimensions=t.vector.length),this.vectors.set(t.id,t),this.addToMemoIndex(t.memoId,t.id)}this.markDirty()}async removeVectorsByMemoId(e){let t=this.memoIndex.get(e);if(t){for(let e of t)this.vectors.delete(e);this.memoIndex.delete(e),this.markDirty()}}search(e,t=10,n=.6){if(this.vectors.size===0)return[];let r=[];for(let t of this.vectors.values()){let i=y_(e,t.vector);i>=n&&r.push({entry:t,score:i})}return r.sort((e,t)=>t.score-e.score),r.slice(0,t)}hasVector(e){return this.memoIndex.has(e)}getVectorUpdatedAt(e){let t=this.memoIndex.get(e);return!t||t.length===0?null:this.vectors.get(t[0])?.updatedAt??null}async save(){if(!this.dirty||!this.adapter)return;let e={version:b_,dimensions:this.dimensions,entries:Object.fromEntries(this.vectors)};try{await this.adapter.write(this.storePath,JSON.stringify(e)),this.dirty=!1}catch(e){console.error(`[VectorStore] Failed to save:`,e)}}async clear(){this.vectors.clear(),this.memoIndex.clear(),this.dirty=!1,this.adapter&&await this.adapter.exists(this.storePath)&&await this.adapter.remove(this.storePath)}getStats(){return{totalEntries:this.vectors.size,dimensions:this.dimensions,memoCount:this.memoIndex.size}}dispose(){this.saveTimer&&=(clearTimeout(this.saveTimer),null),this.dirty&&this.save().catch(()=>{})}addToMemoIndex(e,t){let n=this.memoIndex.get(e)||[];n.includes(t)||(n.push(t),this.memoIndex.set(e,n))}markDirty(){this.dirty=!0,this.saveTimer&&clearTimeout(this.saveTimer),this.saveTimer=setTimeout(()=>this.save(),x_)}};function w_(e){let t=e;return t=t.replace(/!\[\[.*?\]\]/g,``),t=t.replace(/!\[.*?\]\(.*?\)/g,``),t=t.replace(/\[\[([^\]|]+)\|([^\]]+)\]\]/g,`$2`),t=t.replace(/\[\[([^\]]+)\]\]/g,`$1`),t=t.replace(/\[([^\]]+)\]\([^)]+\)/g,`$1`),t=t.replace(/```[\s\S]*?```/g,`[code]`),t=t.replace(/<[^>]+>/g,``),t=t.replace(/\n{3,}/g,`
|
||
|
||
`),t=t.trim(),t}function T_(e,t=500){let n=w_(e.content);if(!n)return[];if(n.length<=t)return[{text:n,memoId:e.id,chunkIndex:0}];let r=n.split(/\n\n+/).filter(Boolean),i=[],a=``,o=0;for(let n of r){if(a.length+n.length+2>t&&a.length>0){i.push({text:a.trim(),memoId:e.id,chunkIndex:o}),o++;let t=a.split(/[.!?]\s/).pop()||``;a=t.length<100?t+`
|
||
|
||
`:``}a+=(a?`
|
||
|
||
`:``)+n}return a.trim()&&i.push({text:a.trim(),memoId:e.id,chunkIndex:o}),i}var E_='(function(){let e=null,t=null,n=null,r=new Map,i=new Map,a=``,o=self.fetch.bind(self);self.fetch=async(e,t)=>{let n=typeof e==`string`?e:e instanceof URL?e.href:e.url;if(n?.includes(`ort-wasm-simd-threaded`)){let e=n.split(`/`).pop();if(e&&r.has(e)){let t=r.get(e),n=e.endsWith(`.mjs`)?`application/javascript`:`application/wasm`;return new Response(t,{status:200,headers:{"Content-Type":n}})}}if(n?.includes(`huggingface.co`)&&a){let e=n.indexOf(`/resolve/main/`);if(e!==-1){let t=n.slice(e+14).split(`?`)[0];if(i.has(t)){let e=i.get(t),n=t.endsWith(`.json`)?`application/json`:`application/octet-stream`;return new Response(e,{status:200,headers:{"Content-Type":n,"Content-Length":String(e.byteLength)}})}}}return o(e,t)};function s(){let e=[];if(typeof process<`u`&&process.versions){let t=Object.getOwnPropertyDescriptor(process.versions,`node`);Object.defineProperty(process.versions,`node`,{get:()=>void 0,configurable:!0}),e.push(()=>{t?Object.defineProperty(process.versions,`node`,t):delete process.versions.node})}if(typeof globalThis.require==`function`){let t=globalThis.require;globalThis.require=function(e){if(e===`onnxruntime-node`||e.includes(`onnxruntime-node`))throw Error(`onnxruntime-node blocked in worker — using web backend`);return t(e)},Object.assign(globalThis.require,t),e.push(()=>{globalThis.require=t})}return()=>e.forEach(e=>e())}async function c(n){let r=n,i={},a=(e,t,n)=>{let a=r.match(t);i[e]=a?a.length:0,r=r.replace(t,n)};a(`process?.release?.name`,/"node"===process\\?\\.release\\?\\.name/g,`false`),a(`process.release.name alt`,/"node"===process\\.release\\.name/g,`false`),a(`release?.name==="node"`,/process\\?\\.release\\?\\.name==="node"/g,`false`),a(`onnxruntime-node`,/onnxruntime-node/g,`__ort_node_blocked__`);let o=new Blob([r],{type:`text/javascript`}),s=URL.createObjectURL(o);try{let n=await import(s);e=n.pipeline,t=n.env}finally{URL.revokeObjectURL(s)}if(!e||!t)throw Error(`Failed to load transformers library: pipeline or env not found`)}self.onmessage=async o=>{let l=o.data;switch(l.type){case`init`:{if(a=l.modelId,l.wasmFiles)for(let[e,t]of Object.entries(l.wasmFiles))r.set(e,t);if(l.modelFiles)for(let[e,t]of Object.entries(l.modelFiles))i.set(e,t);let o=s();try{await c(l.transformersScript)}catch(e){o(),self.postMessage({type:`init-error`,error:`Failed to load transformers: ${e?.message||String(e)}`});break}t.allowLocalModels=!1,t.useBrowserCache!==void 0&&(t.useBrowserCache=!1);try{let e=t.version||`3.8.1`;t.backends?.onnx?.wasm&&(t.backends.onnx.wasm.wasmPaths=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@${e}/dist/`,t.backends.onnx.wasm.numThreads=1,t.backends.onnx.wasm.proxy=!1)}catch{}try{self.postMessage({type:`progress`,status:`Initializing model...`,progress:5}),n=await e(`feature-extraction`,l.modelId,{device:`wasm`,dtype:`q8`,progress_callback:e=>{e?.status===`progress`&&e?.progress!=null&&self.postMessage({type:`progress`,status:`Loading model...`,progress:Math.round(e.progress)})}}),self.postMessage({type:`ready`})}catch(e){self.postMessage({type:`init-error`,error:e?.message||String(e)})}finally{o()}break}case`embed`:if(!n){self.postMessage({type:`error`,id:l.id,error:`Extractor not initialized`});break}try{let e=(await n(l.texts,{pooling:`mean`,normalize:!0})).tolist(),t=l.texts.map(e=>Math.ceil(e.length/4));self.postMessage({type:`result`,id:l.id,vectors:e,tokenCounts:t})}catch(e){self.postMessage({type:`error`,id:l.id,error:e?.message||String(e)})}break;case`dispose`:try{n?.dispose?.()}catch{}n=null,e=null,t=null,r.clear(),i.clear(),self.close();break}}})();',D_=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,E_],{type:`text/javascript;charset=utf-8`});function O_(e){let t;try{if(t=D_&&(self.URL||self.webkitURL).createObjectURL(D_),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(E_),{name:e?.name})}}var k_=`Xenova/paraphrase-multilingual-MiniLM-L12-v2`,A_=[`ort-wasm-simd-threaded.jsep.mjs`,`ort-wasm-simd-threaded.jsep.wasm`],j_=[`config.json`,`tokenizer.json`,`tokenizer_config.json`,`onnx/model_quantized.onnx`],M_=class{worker=null;_initialized=!1;initializing=!1;activeDevice=null;onProgress=null;assetManager=null;pendingEmbeds=new Map;nextEmbedId=1;initResolve=null;initReject=null;setProgressCallback(e){this.onProgress=e}setAssetManager(e){this.assetManager=e}async initialize(e,t){if(!(this._initialized&&this.worker)&&!this.initializing){this.initializing=!0;try{this.onProgress?.(`Reading local assets...`,0),console.log(`[EmbeddingService] Starting worker-based initialization`);let t=e||k_,[n,r,i]=await Promise.all([this.readAllWasmFiles(),this.readAllModelFiles(t),this.readTransformersScript()]);if(!i)throw Error(`transformers.min.js not found. Please import the Transformers.js runtime from the settings page.`);this.onProgress?.(`Initializing embedding worker...`,5),this.worker=new O_,this.worker.onmessage=e=>this.handleWorkerMessage(e),this.worker.onerror=e=>{console.error(`[EmbeddingService] Worker error:`,e),this.initReject?.(Error(e.message||`Worker error`))};let a=[...Object.values(n),...Object.values(r)];await new Promise((e,o)=>{this.initResolve=e,this.initReject=o,this.worker.postMessage({type:`init`,modelId:t,wasmFiles:n,modelFiles:r,transformersScript:i},a)}),this._initialized=!0,this.activeDevice=`wasm`,this.onProgress?.(`Ready`,100),console.log(`[EmbeddingService] Worker initialization complete`)}catch(e){throw console.error(`[EmbeddingService] Initialization FAILED:`,e),this.terminateWorker(),e}finally{this.initializing=!1,this.initResolve=null,this.initReject=null}}}async embed(e){if(!this._initialized||!this.worker)throw Error(`EmbeddingService is not initialized. Call initialize() first.`);if(e.length===0)return{vectors:[],tokenCounts:[]};let t=this.nextEmbedId++;return new Promise((n,r)=>{this.pendingEmbeds.set(t,{resolve:n,reject:r}),this.worker.postMessage({type:`embed`,id:t,texts:e})})}async embedMemo(e){let t=T_(e);if(t.length===0)return[];let n=t.map(e=>e.text),{vectors:r,tokenCounts:i}=await this.embed(n);return t.map((t,n)=>({id:`${e.id}-${t.chunkIndex}`,vector:r[n],content:t.text,memoId:e.id,chunkIndex:t.chunkIndex,updatedAt:e.updatedAt,metadata:{tokenCount:i[n],sourceType:e.sourceType}}))}isReady(){return this._initialized&&this.worker!==null}getDevice(){return this.activeDevice}dispose(){}terminateWorker(){if(this.worker){try{this.worker.postMessage({type:`dispose`})}catch{}this.worker.terminate(),this.worker=null}this._initialized=!1,this.activeDevice=null;for(let[,{reject:e}]of this.pendingEmbeds)e(Error(`Worker terminated`));this.pendingEmbeds.clear()}handleWorkerMessage(e){let t=e.data;switch(t.type){case`ready`:this.initResolve?.();break;case`init-error`:this.initReject?.(Error(t.error));break;case`progress`:this.onProgress?.(t.status,t.progress);break;case`result`:{let e=this.pendingEmbeds.get(t.id);e&&(this.pendingEmbeds.delete(t.id),e.resolve({vectors:t.vectors,tokenCounts:t.tokenCounts}));break}case`error`:{let e=this.pendingEmbeds.get(t.id);e&&(this.pendingEmbeds.delete(t.id),e.reject(Error(t.error)));break}}}async readTransformersScript(){return this.assetManager?await this.assetManager.readTransformersScript():null}async readAllWasmFiles(){let e={};if(!this.assetManager)return e;for(let t of A_){let n=await this.assetManager.readWasmFile(t);n&&(e[t]=n)}return e}async readAllModelFiles(e){let t={};if(!this.assetManager)return t;for(let n of j_){let r=await this.assetManager.readModelFile(e,n);r&&(t[n]=r)}return t}};function N_(e){if(!f.Platform.isDesktop)return{};try{return window.require(e)}catch{return{}}}var P_=o((()=>{}));P_();var F_=[`ort-wasm-simd-threaded.jsep.mjs`,`ort-wasm-simd-threaded.jsep.wasm`],I_=`transformers.min.js`,L_=[`config.json`,`tokenizer.json`,`tokenizer_config.json`,`onnx/model_quantized.onnx`],R_=`https://cdn.jsdelivr.net/npm/@huggingface/transformers`,z_=`https://huggingface.co`,B_=class{adapter=null;basePath=``;initialize(e,t){this.adapter=e,this.basePath=t}async isWasmReady(){if(!this.adapter)return!1;try{let e=await this.readManifest(this.wasmDir());if(!e)return!1;for(let t of F_)if(!e.files[t]||!await this.adapter.exists(this.wasmPath(t)))return!1;return!!await this.adapter.exists(this.wasmPath(I_))}catch{return!1}}async isModelReady(e){if(!this.adapter)return!1;try{let t=await this.readManifest(this.modelDir(e));if(!t)return!1;for(let n of L_)if(!t.files[n]||!await this.adapter.exists(this.modelPath(e,n)))return!1;return!0}catch{return!1}}async isFullyReady(e){return await this.isWasmReady()&&await this.isModelReady(e)}async downloadWasm(e,t,n){this.ensureAdapter(),await this.ensureDir(this.wasmDir());let r=`${R_}@${e}/dist`,i={version:e,downloadedAt:new Date().toISOString(),files:{}},a=[...F_,I_];for(let e=0;e<a.length;e++){if(n?.aborted)throw new DOMException(`Download aborted`,`AbortError`);let o=a[e],s=`${r}/${o}`,c=Math.round((e+.5)/a.length*50);t?.({phase:`wasm`,fileName:o,bytesDownloaded:0,bytesTotal:0,overallProgress:c});let l=(await(0,f.requestUrl)({url:s})).arrayBuffer;if(o.endsWith(`.mjs`)){let e=new TextDecoder().decode(l),t=this.patchEmscriptenModule(e);l=new TextEncoder().encode(t).buffer}await this.adapter.writeBinary(this.wasmPath(o),l),i.files[o]={size:l.byteLength},t?.({phase:`wasm`,fileName:o,bytesDownloaded:l.byteLength,bytesTotal:l.byteLength,overallProgress:Math.round((e+1)/a.length*50)})}await this.writeManifest(this.wasmDir(),i)}async downloadModel(e,t,n){this.ensureAdapter();let r=this.modelDir(e);await this.ensureDir(r),await this.ensureDir(`${r}/onnx`);let i={version:e,downloadedAt:new Date().toISOString(),files:{}};for(let r=0;r<L_.length;r++){if(n?.aborted)throw new DOMException(`Download aborted`,`AbortError`);let a=L_[r],o=`${z_}/${e}/resolve/main/${a}`,s=50+Math.round((r+.5)/L_.length*50);t?.({phase:`model`,fileName:a,bytesDownloaded:0,bytesTotal:0,overallProgress:s});let c=(await(0,f.requestUrl)({url:o})).arrayBuffer;await this.adapter.writeBinary(this.modelPath(e,a),c),i.files[a]={size:c.byteLength},t?.({phase:`model`,fileName:a,bytesDownloaded:c.byteLength,bytesTotal:c.byteLength,overallProgress:50+Math.round((r+1)/L_.length*50)})}await this.writeManifest(r,i)}async downloadAll(e,t,n,r){await this.downloadWasm(e,n,r),await this.downloadModel(t,n,r)}async readWasmFile(e){if(!this.adapter)return null;let t=this.wasmPath(e);try{return await this.adapter.exists(t)?await this.adapter.readBinary(t):null}catch{return null}}async readTransformersScript(){if(!this.adapter)return null;let e=this.wasmPath(I_);try{return await this.adapter.exists(e)?await this.adapter.read(e):null}catch{return null}}async readModelFile(e,t){if(!this.adapter)return null;let n=this.modelPath(e,t);try{return await this.adapter.exists(n)?await this.adapter.readBinary(n):null}catch{return null}}async importModelFromFolder(e,t,n){this.ensureAdapter();let r=N_(`fs`),i=N_(`path`),a=this.modelDir(e);await this.ensureDir(a),await this.ensureDir(`${a}/onnx`);let o=[],s=[],c={version:e,downloadedAt:new Date().toISOString(),files:{}};for(let a of L_){let l=i.join(t,a);n?.(a);try{if(r.existsSync(l)){let t=r.readFileSync(l),n=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);await this.adapter.writeBinary(this.modelPath(e,a),n),c.files[a]={size:t.byteLength},o.push(a)}else s.push(a)}catch{s.push(a)}}return o.length===L_.length&&await this.writeManifest(a,c),{imported:o,missing:s}}async importWasmFromFolder(e,t){this.ensureAdapter();let n=N_(`fs`),r=N_(`path`);await this.ensureDir(this.wasmDir());let i=[],a=[],o={version:`imported`,downloadedAt:new Date().toISOString(),files:{}},s=[...F_,I_];for(let c of s){let s=r.join(e,c);t?.(c);try{if(n.existsSync(s)){let e=n.readFileSync(s),t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(c.endsWith(`.mjs`)){let e=new TextDecoder().decode(t),n=this.patchEmscriptenModule(e);t=new TextEncoder().encode(n).buffer}await this.adapter.writeBinary(this.wasmPath(c),t),o.files[c]={size:t.byteLength},i.push(c)}else a.push(c)}catch{a.push(c)}}return i.length===s.length&&await this.writeManifest(this.wasmDir(),o),{imported:i,missing:a}}async removeAll(){if(this.adapter)try{for(let e of F_)await this.safeRemove(this.wasmPath(e));await this.safeRemove(this.wasmPath(I_)),await this.safeRemove(`${this.wasmDir()}/manifest.json`)}catch{}}wasmDir(){return`${this.basePath}/wasm`}wasmPath(e){return`${this.basePath}/wasm/${e}`}modelDir(e){return`${this.basePath}/models/${this.sanitizeModelId(e)}`}modelPath(e,t){return`${this.basePath}/models/${this.sanitizeModelId(e)}/${t}`}sanitizeModelId(e){return e.replace(/\//g,`--`)}patchEmscriptenModule(e){return e.replace(/"string"==typeof process\.versions\.node/g,`false`).replace(/typeof\s+globalThis\.process\?\.versions\?\.node\s*==\s*["']string["']/g,`false`)}async readManifest(e){if(!this.adapter)return null;let t=`${e}/manifest.json`;try{if(!await this.adapter.exists(t))return null;let e=await this.adapter.read(t);return JSON.parse(e)}catch{return null}}async writeManifest(e,t){await this.adapter.write(`${e}/manifest.json`,JSON.stringify(t,null,2))}async ensureDir(e){await this.adapter.exists(e)||await this.adapter.mkdir(e)}async safeRemove(e){try{await this.adapter.exists(e)&&await this.adapter.remove(e)}catch{}}ensureAdapter(){if(!this.adapter)throw Error(`AssetManager not initialized`)}},V_=class{providers=new Map;activeEmbeddingType=null;activeCompletionType=null;register(e){let t=this.providers.get(e.type);t&&t!==e&&t.dispose(),this.providers.set(e.type,e)}unregister(e){let t=this.providers.get(e);t&&(t.dispose(),this.providers.delete(e),this.activeEmbeddingType===e&&(this.activeEmbeddingType=null),this.activeCompletionType===e&&(this.activeCompletionType=null))}setActiveEmbeddingProvider(e){if(!this.providers.has(e)){console.debug(`[ProviderManager] Embedding provider "${e}" not registered, skipping.`);return}this.activeEmbeddingType=e}setActiveCompletionProvider(e){if(!this.providers.has(e)){console.debug(`[ProviderManager] Completion provider "${e}" not registered, skipping.`);return}this.activeCompletionType=e}getEmbeddingProvider(){return this.activeEmbeddingType?this.providers.get(this.activeEmbeddingType)??null:null}getCompletionProvider(){return this.activeCompletionType?this.providers.get(this.activeCompletionType)??null:null}getProvider(e){return this.providers.get(e)??null}getAllProviders(){return Array.from(this.providers.values())}async initializeAll(){let e=await Promise.allSettled(Array.from(this.providers.entries()).map(async([e,t])=>{if(!await t.isAvailable()){console.info(`[ProviderManager] Provider "${e}" is not available, skipping init.`);return}await t.initialize(),console.info(`[ProviderManager] Provider "${e}" initialized successfully.`)}));for(let t of e)t.status===`rejected`&&console.error(`[ProviderManager] Provider initialization failed:`,t.reason)}disposeAll(){let e=Array.from(this.providers.values());for(let t of e)try{t.dispose()}catch(e){console.error(`[ProviderManager] Error disposing provider "${t.type}":`,e)}this.providers.clear(),this.activeEmbeddingType=null,this.activeCompletionType=null}},H_=class{name=`Local (Transformers.js)`;type=`local`;embeddingService;constructor(e){this.embeddingService=e}async isAvailable(){return f.Platform.isDesktop}async initialize(){if(!f.Platform.isDesktop)throw Error(`Local provider is only available on desktop.`);await this.embeddingService.initialize()}async embed(e){if(!this.embeddingService.isReady())throw Error(`Local embedding service is not initialized. Call initialize() first.`);let t=await this.embeddingService.embed(e);return t.vectors.map((e,n)=>({vector:new Float32Array(e),tokenCount:t.tokenCounts[n]}))}async complete(e,t){throw Error(`Local text generation not supported. Configure an API provider for chat features.`)}async*completeStream(e,t){throw Error(`Local text generation not supported. Configure an API provider for chat features.`)}dispose(){}},U_=`https://api.openai.com`,W_=`text-embedding-3-small`,G_=`gpt-5.2`,K_=class{name=`OpenAI`;type=`openai`;apiKey;baseUrl;embeddingModel;completionModel;maxTokens;constructor(e){this.apiKey=e.apiKey??``,this.baseUrl=(e.baseUrl??U_).replace(/\/+$/,``).replace(/\/v1$/,``),this.embeddingModel=e.embeddingModel??W_,this.completionModel=e.completionModel??G_,this.maxTokens=e.maxTokens??4096}async isAvailable(){return!!this.apiKey&&!!this.baseUrl}async initialize(){if(!this.apiKey)throw Error(`OpenAI provider requires an API key.`);if(!this.baseUrl)throw Error(`OpenAI provider requires a base URL.`)}async embed(e){if(e.length===0)return[];let t=await(0,f.requestUrl)({url:`${this.baseUrl}/v1/embeddings`,method:`POST`,headers:{Authorization:`Bearer ${this.apiKey}`,"Content-Type":`application/json`},body:JSON.stringify({model:this.embeddingModel,input:e})});if(t.status>=400){let e=t.json?.error?.message??`HTTP ${t.status}`;throw Error(`OpenAI embeddings request failed: ${e}`)}return[...t.json.data].sort((e,t)=>e.index-t.index).map(e=>({vector:new Float32Array(e.embedding),tokenCount:0}))}async complete(e,t){let n=await(0,f.requestUrl)({url:`${this.baseUrl}/v1/chat/completions`,method:`POST`,headers:{Authorization:`Bearer ${this.apiKey}`,"Content-Type":`application/json`},body:JSON.stringify({model:this.completionModel,messages:this.mapMessages(e),max_tokens:t?.maxTokens??this.maxTokens,temperature:t?.temperature??.7,stream:!1,...t?.tools?.length?{tools:this.mapToolDefs(t.tools)}:{}})});if(n.status>=400){let e=n.json?.error?.message??`HTTP ${n.status}`;throw Error(`OpenAI completion request failed: ${e}`)}let r=n.json?.choices?.[0]?.message?.content;if(typeof r!=`string`)throw Error(`OpenAI completion returned an unexpected response format.`);return r}async*completeStream(e,t){let n=await fetch(`${this.baseUrl}/v1/chat/completions`,{method:`POST`,headers:{Authorization:`Bearer ${this.apiKey}`,"Content-Type":`application/json`},body:JSON.stringify({model:this.completionModel,messages:this.mapMessages(e),max_tokens:t?.maxTokens??this.maxTokens,temperature:t?.temperature??.7,stream:!0,...t?.tools?.length?{tools:this.mapToolDefs(t.tools)}:{}})});if(!n.ok){let e=`HTTP ${n.status}`;try{e=(await n.json())?.error?.message??e}catch{}throw Error(`OpenAI streaming request failed: ${e}`)}if(!n.body)throw Error(`OpenAI streaming response has no body.`);let r=n.body.getReader(),i=new TextDecoder(`utf-8`),a=``,o=new Map,s=0;try{for(;;){let{done:e,value:t}=await r.read();if(e)break;a+=i.decode(t,{stream:!0});let n=a.split(`
|
||
`);a=n.pop()??``;for(let e of n){let t=e.trim();if(!t||t.startsWith(`:`)||!t.startsWith(`data: `))continue;let n=t.slice(6);if(n===`[DONE]`){o.size>0?yield{content:``,done:!0,tool_calls:this.collectToolCalls(o)}:yield{content:``,done:!0};return}try{let e=JSON.parse(n)?.choices?.[0],t=e?.delta,r=e?.finish_reason;if(t){let e=Object.keys(t).filter(e=>t[e]!==null&&t[e]!==void 0&&t[e]!==``);e.length>0&&console.log(`[OpenAIProvider] delta keys=[${e.join(`,`)}]${r?` finish_reason=${r}`:``}`,e.includes(`tool_calls`)?t.tool_calls:``)}if(r&&!t&&console.log(`[OpenAIProvider] finish_reason=${r} (no delta)`),typeof t?.content==`string`&&t.content.length>0&&(r&&s>0&&t.content.length>s?console.log(`[OpenAIProvider] Skipping duplicate final delta (${t.content.length} chars, already streamed ${s})`):(s+=t.content.length,yield{content:t.content,done:!1})),typeof t?.reasoning_content==`string`&&t.reasoning_content.length>0&&(yield{content:``,done:!1,reasoning:t.reasoning_content}),t?.tool_calls)for(let e of t.tool_calls){let t=e.index??0,n=o.get(t);n?(e.id&&(n.id=e.id),e.function?.name&&(n.name+=e.function.name),n.arguments+=e.function?.arguments??``):o.set(t,{id:e.id??``,name:e.function?.name??``,arguments:e.function?.arguments??``})}}catch{}}}if(a.trim()){let e=a.trim();if(e.startsWith(`data: `)&&e.slice(6)!==`[DONE]`)try{let t=JSON.parse(e.slice(6))?.choices?.[0]?.delta;typeof t?.content==`string`&&t.content.length>0&&(yield{content:t.content,done:!1})}catch{}}o.size>0?yield{content:``,done:!0,tool_calls:this.collectToolCalls(o)}:yield{content:``,done:!0}}finally{r.releaseLock()}}dispose(){}mapMessages(e){return e.map(e=>e.role===`tool`?{role:`tool`,content:e.content,tool_call_id:e.tool_call_id}:e.role===`assistant`&&e.tool_calls?.length?{role:`assistant`,content:e.content||null,tool_calls:e.tool_calls.map(e=>({id:e.id,type:`function`,function:{name:e.name,arguments:e.arguments}}))}:{role:e.role,content:e.content})}mapToolDefs(e){return e.map(e=>({type:`function`,function:{name:e.name,description:e.description,parameters:e.parameters}}))}collectToolCalls(e){return Array.from(e.entries()).sort(([e],[t])=>e-t).map(([,e])=>({id:e.id,name:e.name,arguments:e.arguments}))}},q_=`https://api.anthropic.com`,J_=`2023-06-01`,Y_=`claude-sonnet-4-6`,X_=class{name=`Anthropic`;type=`anthropic`;apiKey;baseUrl;completionModel;maxTokens;constructor(e){this.apiKey=e.apiKey??``,this.baseUrl=(e.baseUrl??q_).replace(/\/+$/,``).replace(/\/v1$/,``),this.completionModel=e.completionModel??Y_,this.maxTokens=e.maxTokens??4096}async isAvailable(){return!!this.apiKey}async initialize(){if(!this.apiKey)throw Error(`Anthropic provider requires an API key.`)}async embed(e){throw Error(`Anthropic does not support embeddings. Use Local or OpenAI provider for embeddings.`)}async complete(e,t){let{system:n,apiMessages:r}=this.prepareMessages(e),i=await(0,f.requestUrl)({url:`${this.baseUrl}/v1/messages`,method:`POST`,headers:{"x-api-key":this.apiKey,"anthropic-version":J_,"Content-Type":`application/json`},body:JSON.stringify({model:this.completionModel,max_tokens:t?.maxTokens??this.maxTokens,temperature:t?.temperature??.7,...n?{system:n}:{},messages:r,...t?.tools?.length?{tools:this.mapToolDefs(t.tools)}:{}})});if(i.status>=400){let e=i.json?.error?.message??`HTTP ${i.status}`;throw Error(`Anthropic completion request failed: ${e}`)}let a=i.json?.content?.find(e=>e.type===`text`);if(!a||typeof a.text!=`string`)throw Error(`Anthropic completion returned an unexpected response format.`);return a.text}async*completeStream(e,t){let{system:n,apiMessages:r}=this.prepareMessages(e),i=await fetch(`${this.baseUrl}/v1/messages`,{method:`POST`,headers:{"x-api-key":this.apiKey,"anthropic-version":J_,"Content-Type":`application/json`},body:JSON.stringify({model:this.completionModel,max_tokens:t?.maxTokens??this.maxTokens,temperature:t?.temperature??.7,stream:!0,...n?{system:n}:{},messages:r,...t?.tools?.length?{tools:this.mapToolDefs(t.tools)}:{}})});if(!i.ok){let e=`HTTP ${i.status}`;try{e=(await i.json())?.error?.message??e}catch{}throw Error(`Anthropic streaming request failed: ${e}`)}if(!i.body)throw Error(`Anthropic streaming response has no body.`);let a=i.body.getReader(),o=new TextDecoder(`utf-8`),s=``,c=new Map,l=-1,u=``;try{for(;;){let{done:e,value:t}=await a.read();if(e)break;s+=o.decode(t,{stream:!0});let n=s.split(`
|
||
`);s=n.pop()??``;for(let e of n){let t=e.trim();if(!t||t.startsWith(`:`)||t.startsWith(`event: `)||!t.startsWith(`data: `))continue;let n=t.slice(6);try{let e=JSON.parse(n);switch(e.type){case`content_block_start`:{l++;let t=e.content_block;t?.type===`tool_use`?c.set(l,{id:t.id??``,name:t.name??``,arguments:``}):t?.type;break}case`content_block_delta`:if(e.delta?.type===`text_delta`){let t=e.delta.text;typeof t==`string`&&t.length>0&&(yield{content:t,done:!1})}else if(e.delta?.type===`input_json_delta`){let t=c.get(l);t&&e.delta.partial_json&&(t.arguments+=e.delta.partial_json)}break;case`message_delta`:e.delta?.stop_reason&&(u=e.delta.stop_reason);break;case`message_stop`:u===`tool_use`&&c.size>0?yield{content:``,done:!0,tool_calls:this.collectToolCalls(c)}:yield{content:``,done:!0};return}}catch{}}}if(s.trim()){let e=s.trim();if(e.startsWith(`data: `))try{let t=JSON.parse(e.slice(6));if(t.type===`content_block_delta`&&t.delta?.type===`text_delta`){let e=t.delta.text;typeof e==`string`&&e.length>0&&(yield{content:e,done:!1})}}catch{}}u===`tool_use`&&c.size>0?yield{content:``,done:!0,tool_calls:this.collectToolCalls(c)}:yield{content:``,done:!0}}finally{a.releaseLock()}}dispose(){}prepareMessages(e){let t=e.filter(e=>e.role===`system`),n=e.filter(e=>e.role!==`system`),r=t.length>0?t.map(e=>e.content).join(`
|
||
|
||
`):null,i=[];for(let e of n)if(e.role===`tool`)i.push({role:`user`,content:[{type:`tool_result`,tool_use_id:e.tool_call_id,content:e.content}]});else if(e.role===`assistant`&&e.tool_calls?.length){let t=[];e.content&&t.push({type:`text`,text:e.content});for(let n of e.tool_calls){let e={};try{e=JSON.parse(n.arguments)}catch{}t.push({type:`tool_use`,id:n.id,name:n.name,input:e})}i.push({role:`assistant`,content:t})}else i.push({role:e.role,content:e.content});return{system:r,apiMessages:i}}mapToolDefs(e){return e.map(e=>({name:e.name,description:e.description,input_schema:e.parameters}))}collectToolCalls(e){return Array.from(e.entries()).sort(([e],[t])=>e-t).map(([,e])=>({id:e.id,name:e.name,arguments:e.arguments}))}},Z_=`https://newapi.pkmer.cn`,Q_=`03-agent`,$_=[{id:`03-agent`,displayName:`Agent`,description:`Agent model (powerful)`,price:`1`},{id:`04-fast`,displayName:`Fast`,description:`Fast model (naming, etc.)`,price:`0.001`},{id:`02-summary`,displayName:`Summary`,description:`Summary model`,price:`1`},{id:`01-tag`,displayName:`Tag`,description:`Tag recommendation`,price:`0.001`},{id:`00-image-desc`,displayName:`Image Desc`,description:`Image description`,price:`0.001`},{id:`05-webSummary`,displayName:`Web Summary`,description:`Web summary`,price:`0.001`},{id:`06-image-gen`,displayName:`Image Gen`,description:`Image generation`,price:`1`}],ev=$_.filter(e=>e.id===`03-agent`);async function tv(e,t=!0){try{let n=(await(0,f.requestUrl)({url:`${Z_}/v1/models`,method:`GET`,headers:{Authorization:`Bearer ${e}`}})).json?.data;if(!Array.isArray(n)||n.length===0)return t?ev:$_;let r=new Map($_.map(e=>[e.id,e])),i=n.filter(e=>/^0[0-6]-/.test(e.id)).map(e=>{let t=r.get(e.id);return{id:e.id,displayName:t?.displayName||e.id.replace(/^\d+-/,``),description:t?.description||e.id,price:t?.price||`1`}});return t?i.filter(e=>e.id===`03-agent`):i}catch{return t?ev:$_}}var nv=class{name=`PKMer AI`;type=`pkmer`;delegate;constructor(e){this.delegate=new K_({...e,type:`openai`,baseUrl:e.baseUrl||Z_,completionModel:e.completionModel||Q_})}isAvailable(){return this.delegate.isAvailable()}initialize(){return this.delegate.initialize()}embed(e){return this.delegate.embed(e)}complete(e,t){return this.delegate.complete(e,t)}completeStream(e,t){return this.delegate.completeStream(e,t)}dispose(){this.delegate.dispose()}};vi(),Dg(),Rg();var rv=50,iv=10,av=new class{vectorStore=new C_;embeddingService=new M_;assetManager=new B_;providerManager=new V_;app=null;plugin=null;indexAbort=null;memoUnsubscribe=null;initialized=!1;pendingSubagentImages=[];async initialize(e,t){if(console.log(`[SuperService] initialize() called, initialized:`,this.initialized),this.initialized){console.log(`[SuperService] Already initialized, skipping`);return}this.app=e,this.plugin=t;let n=t.manifest.dir||``;this.assetManager.initialize(e.vault.adapter,`${n}/super`),this.embeddingService.setAssetManager(this.assetManager),await this.vectorStore.initialize(e.vault.adapter,n),B.getState().setEngineInstalled(!0);let r=B.getState();if(f.Platform.isDesktop&&r.activeEmbeddingProvider===`local`){let e=await this.assetManager.isWasmReady(),t=await this.assetManager.isModelReady(r.embeddingModel);console.log(`[SuperService] Asset readiness — wasm:`,e,`model:`,t),r.setWasmReady(e),r.setModelReady(t)}else r.setWasmReady(!0),r.setModelReady(!0);this.setupProviders();let i=null;this.memoUnsubscribe=F.subscribe(e=>e.memos,(e,t)=>{B.getState().enabled&&(i&&clearTimeout(i),i=setTimeout(()=>{i=null,this.handleMemoChanges(e,t)},200))}),this.initialized=!0,console.log(`[SuperService] Phase 1 initialization complete`)}async initializeEmbeddingAndIndex(){console.log(`[SuperService] initializeEmbeddingAndIndex() called`);let e=B.getState();this.embeddingService.setProgressCallback((t,n)=>{e.setLoadingStatus(t),n!=null&&e.setLoadingProgress(n)});let t=this.providerManager.getEmbeddingProvider();if(console.log(`[SuperService] Embedding provider:`,t?.type??`NONE`),t)try{await t.initialize(),console.log(`[SuperService] Embedding provider initialized OK`)}catch(e){throw console.error(`[SuperService] Failed to initialize embedding provider:`,e),e}finally{this.embeddingService.setProgressCallback(null)}console.log(`[SuperService] Starting indexing...`),await this.startIndexing(),console.log(`[SuperService] initializeEmbeddingAndIndex() complete`)}async downloadAssets(){let e=B.getState(),t=e.embeddingModel;e.setAssetDownloading(!0),e.setAssetDownloadError(null),e.setAssetDownloadProgress(0);try{await this.assetManager.downloadAll(`3.8.1`,t,t=>{e.setAssetDownloadProgress(t.overallProgress);let n=t.phase===`wasm`?`WASM runtime`:`Model`;e.setAssetDownloadStatus(`${n}: ${t.fileName}`)}),e.setWasmReady(!0),e.setModelReady(!0),e.setEngineInstalled(!0),e.setAssetDownloadStatus(`Download complete`)}catch(t){throw e.setAssetDownloadError(t?.message||`Unknown error`),t}finally{e.setAssetDownloading(!1)}}async importLocalModel(e){let t=B.getState();t.setAssetDownloading(!0),t.setAssetDownloadError(null),t.setAssetDownloadStatus(`Importing model files...`);try{let n=await this.assetManager.importModelFromFolder(t.embeddingModel,e,e=>t.setAssetDownloadStatus(`Importing: ${e}`));return n.missing.length===0?(t.setModelReady(!0),t.setAssetDownloadStatus(`Model import complete`),await this.assetManager.isWasmReady()&&t.setEngineInstalled(!0)):t.setAssetDownloadStatus(`Missing: ${n.missing.join(`, `)}`),n}catch(e){throw t.setAssetDownloadError(e?.message||`Model import failed`),e}finally{t.setAssetDownloading(!1)}}async importLocalWasm(e){let t=B.getState();t.setAssetDownloading(!0),t.setAssetDownloadError(null),t.setAssetDownloadStatus(`Importing WASM files...`);try{let n=await this.assetManager.importWasmFromFolder(e,e=>t.setAssetDownloadStatus(`Importing: ${e}`));return n.missing.length===0?(t.setWasmReady(!0),t.setAssetDownloadStatus(`WASM import complete`),await this.assetManager.isModelReady(t.embeddingModel)&&t.setEngineInstalled(!0)):t.setAssetDownloadStatus(`Missing: ${n.missing.join(`, `)}`),n}catch(e){throw t.setAssetDownloadError(e?.message||`WASM import failed`),e}finally{t.setAssetDownloading(!1)}}getAssetManager(){return this.assetManager}isEmbeddingReady(){let e=this.providerManager.getEmbeddingProvider();return e?this.embeddingService.isReady()?!0:e.type!==`local`:!1}async startIndexing(){if(!this.isEmbeddingReady()){console.warn(`[SuperService] Skipping indexing: no embedding provider ready.`);return}this.indexAbort&&this.stopIndexing(),this.indexAbort=new AbortController;let e=F.getState().memos.filter(e=>e.rowStatus!==`ARCHIVED`&&!e.deletedAt);B.getState().updateIndexStatus({totalMemos:e.length,indexedMemos:0,isIndexing:!0,failedMemos:[]});let t=document.createDocumentFragment(),n=document.createElement(`span`);n.textContent=`Thino Super: Indexing 0/${e.length} memos...`,t.appendChild(n);let r=new f.Notice(t,0),i=[],a=0,o=0;for(let t=0;t<e.length&&!this.indexAbort.signal.aborted;t+=rv){let r=e.slice(t,t+rv),s=r.filter(e=>{let t=this.vectorStore.getVectorUpdatedAt(e.id);return!t||t<e.updatedAt});if(s.length>0)try{await this.indexMemoBatch(s),o++}catch(e){console.warn(`[SuperService] Batch indexing error:`,e),i.push(...s.map(e=>e.id))}a+=r.length,B.getState().updateIndexStatus({indexedMemos:a,failedMemos:[...i]});let c=Math.round(a/e.length*100);n.textContent=`Thino Super: Indexing ${a}/${e.length} memos (${c}%)`,o>=iv&&(await this.vectorStore.save(),o=0),await new Promise(e=>setTimeout(e,0))}r.hide(),B.getState().updateIndexStatus({isIndexing:!1,lastIndexedAt:new Date().toISOString()}),await this.vectorStore.save(),this.indexAbort=null,i.length>0?new f.Notice(`Thino Super: Indexed ${a} memos (${i.length} failed)`,5e3):new f.Notice(`Thino Super: ${a} memos indexed`,3e3)}async indexMemo(e){let t=await this.buildVectorEntries(e);t.length>0&&(await this.vectorStore.removeVectorsByMemoId(e.id),await this.vectorStore.addVectorBatch(t))}async removeMemoFromIndex(e){await this.vectorStore.removeVectorsByMemoId(e)}async semanticSearch(e,t=10){let n=this.providerManager.getEmbeddingProvider();if(!n)throw Error(`No embedding provider available`);let r=await n.embed([e]);if(r.length===0)return[];let i=Array.from(r[0].vector),a=this.vectorStore.search(i,t),o=F.getState().memos,s=new Map(o.map(e=>[e.id,e]));for(let e of a)e.memo=s.get(e.entry.memoId);let c=new Set;return a.filter(e=>c.has(e.entry.memoId)?!1:(c.add(e.entry.memoId),!0))}textSearch(e,t=20){let n=e.toLowerCase().trim();if(!n)return[];let r=F.getState().memos.filter(e=>e.rowStatus!==`ARCHIVED`&&!e.deletedAt),i=[];for(let e of r){if(i.length>=t)break;e.content.toLowerCase().includes(n)&&i.push({entry:{id:`text-${e.id}`,vector:[],content:e.content,memoId:e.id,chunkIndex:0,updatedAt:e.updatedAt},score:-1,memo:e})}return i}async hybridSearch(e,t=10){let n=[];try{this.providerManager.getEmbeddingProvider()&&(n=await this.semanticSearch(e,t))}catch(e){console.warn(`[SuperService] Semantic search failed, falling back to text:`,e)}let r=this.textSearch(e,t),i=new Set(n.map(e=>e.entry.memoId)),a=[...n];for(let e of r)i.has(e.entry.memoId)||(i.add(e.entry.memoId),a.push(e));return a.slice(0,Math.max(t,a.length))}async*chat(e,t){this.syncCompletionProvider();let n=this.providerManager.getCompletionProvider();if(!n)throw Error(`No completion provider configured. Add an API key in Super settings.`);let r=this.buildToolSystemPrompt(),i=this.getToolDefinitions(),a=[{role:`system`,content:r},...t.filter(e=>e.role!==`system`).slice(-10).map(e=>({role:e.role,content:e.content})),{role:`user`,content:e}],o=0,s=``;for(let e=0;e<5;e++){let t=``,r=0,c,l=s.length;console.log(`[SuperService.chat] round=${e} starting completeStream, prevContentLen=${l}`);for await(let u of n.completeStream(a,{maxTokens:2048,temperature:.7,tools:i})){if(o++,u.reasoning&&(console.log(`[SuperService.chat] seq=${o} round=${e} REASONING len=${u.reasoning.length} preview="${u.reasoning.slice(0,50)}"`),yield{content:``,done:!1,reasoning:u.reasoning}),u.content)if(t+=u.content,e===0||l===0)s+=u.content,r=t.length,console.log(`[SuperService.chat] seq=${o} round=${e} CONTENT len=${u.content.length} totalContent=${t.length} preview="${u.content.slice(0,50)}"`),yield{content:u.content,done:!1};else{let n=s.slice(0,l),i=n.trimEnd();if(t.length<=i.length&&i.startsWith(t))continue;let a=r;r===0&&(t.startsWith(i)?a=i.length:t.startsWith(n)&&(a=l),a>0&&console.log(`[SuperService.chat] round=${e} stripping duplicate prefix: ${a} chars`));let c=t.slice(a);if(c.length>0){let n=c.slice(r>a?r-a:0);if(n.length>0){s+=n,r=t.length,console.log(`[SuperService.chat] seq=${o} round=${e} CONTENT (deduped) len=${n.length} totalContent=${s.length}`),yield{content:n,done:!1};continue}}r=t.length}u.done&&(c=u.tool_calls,console.log(`[SuperService.chat] seq=${o} round=${e} DONE toolCalls=${c?.length??0}`,c?.map(e=>`${e.name}(${e.id})`)))}if(e>0&&l>0&&t.length>0&&r===0){let n=s.slice(0,l),r=n.trimEnd(),i=0;t.startsWith(r)?i=r.length:t.startsWith(n)&&(i=l);let a=t.slice(i);a.trim().length>0?(s+=a,console.log(`[SuperService.chat] round=${e} flushing deduped content: skipped=${i} yielding=${a.length} chars`),yield{content:a,done:!1}):console.log(`[SuperService.chat] round=${e} entire round content (${t.length} chars) was duplicate, skipped`)}if(!c||c.length===0){console.log(`[SuperService.chat] round=${e} no tool calls, finishing. totalYieldedContent=${s.length}`),this.refreshPKMerQuota(),yield{content:``,done:!0};return}a.push({role:`assistant`,content:t,tool_calls:c});for(let t of c){o++,console.log(`[SuperService.chat] seq=${o} round=${e} TOOL_START name=${t.name} id=${t.id} args=${t.arguments.slice(0,80)}`),yield{content:``,done:!1,toolEvent:{type:`tool_start`,toolCallId:t.id,name:t.name,arguments:t.arguments}};let n=await this.executeTool(t.name,t.arguments);this.pendingSubagentImages.length>0&&(yield{content:``,done:!1,subagentImages:this.pendingSubagentImages.splice(0)}),a.push({role:`tool`,content:n,tool_call_id:t.id,name:t.name}),o++,console.log(`[SuperService.chat] seq=${o} round=${e} TOOL_RESULT name=${t.name} id=${t.id} resultLen=${n.length}`),yield{content:``,done:!1,toolEvent:{type:`tool_result`,toolCallId:t.id,name:t.name,result:n}}}}console.log(`[SuperService.chat] exhausted MAX_TOOL_ROUNDS`),this.refreshPKMerQuota(),yield{content:``,done:!0}}getToolDefinitions(){let e=[{name:`search_memos`,description:`Search through memos using natural language. Uses semantic similarity combined with exact text matching. Best for finding memos about a topic, concept, or theme.`,parameters:{type:`object`,properties:{query:{type:`string`,description:`Natural language search query`},limit:{type:`number`,description:`Max results to return (default 10, max 20)`}},required:[`query`]}},{name:`filter_memos`,description:`Filter memos by structured criteria: tags, date ranges, and memo type. Use when the user asks about specific tags, time periods, or task status.`,parameters:{type:`object`,properties:{tag:{type:`string`,description:`Tag to filter by (e.g. "#project")`},from_date:{type:`string`,description:`Start date (e.g. "2025-01-01")`},to_date:{type:`string`,description:`End date (e.g. "2025-12-31")`},type:{type:`string`,enum:[`JOURNAL`,`TASK-TODO`,`TASK-DONE`],description:`Memo type filter`},text:{type:`string`,description:`Text substring to match`},limit:{type:`number`,description:`Max results (default 20, max 50)`}}}},{name:`get_memo`,description:`Retrieve a specific memo by its ID. Use when you need the full content of a memo referenced in search results.`,parameters:{type:`object`,properties:{memo_id:{type:`string`,description:`The memo ID to retrieve`}},required:[`memo_id`]}},{name:`get_related_memos`,description:`Find memos that are linked to, reference, or comment on a given memo.`,parameters:{type:`object`,properties:{memo_id:{type:`string`,description:`The memo ID to find relations for`},relation_type:{type:`string`,enum:[`linked`,`comments`,`all`],description:`Type of relation (default: all)`}},required:[`memo_id`]}}];if(this.providerManager.getCompletionProvider()?.type!==`pkmer`)return e;let t=[{name:`generate_image`,description:`Generate an image from a text description. Use when the user explicitly requests an image, illustration, or visual. Returns the generated image.`,parameters:{type:`object`,properties:{prompt:{type:`string`,description:`Detailed description of the image to generate`}},required:[`prompt`]}},{name:`summarize_text`,description:`Summarize a long piece of text concisely. Use when you need to condense large amounts of retrieved memo content before presenting it.`,parameters:{type:`object`,properties:{text:{type:`string`,description:`The text content to summarize`},style:{type:`string`,enum:[`bullet`,`paragraph`,`headline`],description:`Output format (default: paragraph)`}},required:[`text`]}},{name:`summarize_url`,description:`Fetch and summarize a web page. Use when the user provides a URL and wants its content summarized.`,parameters:{type:`object`,properties:{url:{type:`string`,description:`The URL of the web page to summarize`}},required:[`url`]}},{name:`delegate_fast`,description:`Delegate a quick, self-contained task to a fast model. Ideal for: generating a title, writing a short label, classifying a single item, or any task where speed matters more than depth.`,parameters:{type:`object`,properties:{task:{type:`string`,description:`The specific task to perform (be explicit and concise)`}},required:[`task`]}}];return[...e,...t]}buildToolSystemPrompt(){let e=F.getState().memos.filter(e=>e.rowStatus!==`ARCHIVED`&&!e.deletedAt).length,t=this.providerManager.getCompletionProvider()?.type===`pkmer`,n=[`You are a helpful assistant integrated into Thino, a personal memo/note-taking app.`,`The user has ${e} memos in their collection.`,`You have access to tools for searching and filtering memos.`,`Use these tools to find relevant information before answering questions about the user's notes.`,``,`Guidelines:`,`- Use search_memos for semantic/natural language searches about topics or themes.`,`- Use filter_memos when the user asks about specific tags, date ranges, or task types.`,`- Use get_memo to retrieve full details of a specific memo by ID.`,`- Use get_related_memos to find linked or commented memos.`,`- You may call multiple tools or the same tool multiple times to gather enough context.`,`- If tools return no results, say so honestly rather than guessing.`,`- Be concise and reference specific memos (by date and content) when relevant.`,`- Respond in the same language the user uses.`,`- IMPORTANT: After using tools, do NOT repeat content you already wrote before the tool call. Continue from where you left off and only add new information.`];return t&&n.push(``,`You also have access to specialized subagent tools that delegate to other AI models:`,`- Use generate_image when the user explicitly requests a picture, illustration, or visual output.`,`- Use summarize_text to condense large amounts of text before presenting a final answer.`,`- Use summarize_url when the user provides a URL and wants its content summarized.`,`- Use delegate_fast for quick naming, labeling, or classification subtasks.`,`- Handle creative writing, analysis, and conversation yourself — only delegate when a specialized model is clearly better suited.`,`- Do NOT use generate_image unless the user explicitly requests an image or illustration.`),n.join(`
|
||
`)}async callSubagentText(e,t){let n=B.getState().providers.pkmer;if(!n?.apiKey)throw Error(`PKMer API key not available for subagent call`);let r=new K_({type:`openai`,enabled:!0,apiKey:n.apiKey,baseUrl:n.baseUrl||`https://newapi.pkmer.cn`,completionModel:e,maxTokens:n.maxTokens??4096}),i=[{role:`user`,content:t}],a=``;for await(let e of r.completeStream(i,{maxTokens:4096,temperature:.7}))if(e.content&&(a+=e.content),e.done)break;return a}async executeTool(e,t){try{let n=JSON.parse(t);switch(e){case`search_memos`:{let e=Math.min(n.limit??10,20),t=(await this.hybridSearch(n.query,e)).map(e=>e.memo).filter(e=>!!e);return this.formatMemoResults(t)}case`filter_memos`:{let e=F.getState().memos.filter(e=>e.rowStatus!==`ARCHIVED`&&!e.deletedAt);if(n.tag){let t=n.tag.startsWith(`#`)?n.tag:`#${n.tag}`;e=e.filter(e=>e.content.includes(t))}if(n.from_date&&(e=e.filter(e=>e.createdAt>=n.from_date)),n.to_date&&(e=e.filter(e=>e.createdAt<=n.to_date)),n.type&&(e=e.filter(e=>e.thinoType===n.type)),n.text){let t=n.text.toLowerCase();e=e.filter(e=>e.content.toLowerCase().includes(t))}let t=Math.min(n.limit??20,50),r=e.slice(0,t),i=e.length>t?`\n(Showing ${t} of ${e.length} total matches)`:``;return this.formatMemoResults(r)+i}case`get_memo`:{let e=F.getState().memos.find(e=>e.id===n.memo_id);return e?this.formatSingleMemo(e):`No memo found with ID: ${n.memo_id}`}case`get_related_memos`:{let e=n.relation_type??`all`,t=[];if(e===`linked`||e===`all`){let e=await V.getLinkedMemos(n.memo_id);t.push(...e)}if(e===`comments`||e===`all`){let e=await V.getCommentMemos(n.memo_id);t.push(...e)}return t.length===0?`No related memos found for ID: ${n.memo_id}`:this.formatMemoResults(t)}case`generate_image`:return await this.callSubagentText(`06-image-gen`,n.prompt);case`summarize_text`:{let e=`Summarize the following text in ${n.style??`paragraph`} format:\n\n${n.text}`;return await this.callSubagentText(`02-summary`,e)}case`summarize_url`:return await this.callSubagentText(`05-webSummary`,`Summarize the content of this web page: ${n.url}`);case`delegate_fast`:return await this.callSubagentText(`04-fast`,n.task);default:return`Unknown tool: ${e}`}}catch(e){return`Tool execution error: ${e instanceof Error?e.message:String(e)}`}}formatMemoResults(e){return e.length===0?`No memos found.`:e.map(e=>this.formatSingleMemo(e)).join(`
|
||
---
|
||
`)}formatSingleMemo(e){let t=[`[ID: ${e.id}]`,`[Date: ${e.createdAt}]`];return e.thinoType&&e.thinoType!==`JOURNAL`&&t.push(`[Type: ${e.thinoType}]`),e.pinned&&t.push(`[Pinned]`),t.push(e.content),t.join(` `)}refreshPKMerQuota(){this.plugin&&B.getState().activeCompletionProvider===`pkmer`&&this.plugin.pkmerAuth.refreshQuota().then(e=>{if(!e)return;let t=5e5;B.getState().updateProvider(`pkmer`,{quotaInfo:{remaining:Math.floor(e.remainingQuota/t),total:Math.floor(e.quota/t)}})}).catch(e=>console.warn(`[SuperService] Failed to refresh PKMer quota:`,e))}stopIndexing(){this.indexAbort?.abort(),this.indexAbort=null,B.getState().updateIndexStatus({isIndexing:!1}),this.vectorStore.save().catch(()=>{})}async initializeAndIndex(){return this.initializeEmbeddingAndIndex()}async rebuildIndex(){await this.vectorStore.clear(),B.getState().resetIndexStatus(),await this.startIndexing()}getVectorStats(){return this.vectorStore.getStats()}dispose(){console.log(`[SuperService] dispose() called`),this.memoUnsubscribe?.(),this.memoUnsubscribe=null,this.stopIndexing(),this.vectorStore.dispose(),this.providerManager.disposeAll(),this.initialized=!1,console.log(`[SuperService] dispose() complete`)}syncCompletionProvider(){let e=B.getState(),t=e.activeCompletionProvider,n=e.providers[t];n&&(t===`openai`?this.providerManager.register(new K_(n)):t===`anthropic`?this.providerManager.register(new X_(n)):t===`pkmer`&&n.apiKey&&this.providerManager.register(new nv(n)),this.providerManager.setActiveCompletionProvider(t))}setupProviders(){let e=B.getState();if(f.Platform.isDesktop){let e=new H_(this.embeddingService);this.providerManager.register(e)}let t=e.providers.openai||{type:`openai`,enabled:!1};this.providerManager.register(new K_(t));let n=e.providers.anthropic||{type:`anthropic`,enabled:!1};this.providerManager.register(new X_(n));let r=e.providers.pkmer||{type:`pkmer`,enabled:!1};r.apiKey&&this.providerManager.register(new nv(r)),this.providerManager.setActiveEmbeddingProvider(e.activeEmbeddingProvider),this.providerManager.setActiveCompletionProvider(e.activeCompletionProvider)}async indexMemoBatch(e){let t=[];for(let n of e){let e=await this.buildVectorEntries(n);t.push(...e)}if(t.length>0){for(let t of e)await this.vectorStore.removeVectorsByMemoId(t.id);await this.vectorStore.addVectorBatch(t)}}async buildVectorEntries(e){let t=T_(e);if(t.length===0)return[];let n=this.providerManager.getEmbeddingProvider();if(!n)return[];let r=t.map(e=>e.text),i=await n.embed(r);return t.map((t,n)=>({id:`${e.id}-${t.chunkIndex}`,vector:Array.from(i[n].vector),content:t.text,memoId:e.id,chunkIndex:t.chunkIndex,updatedAt:e.updatedAt}))}handleMemoChanges(e,t){if(!this.initialized)return;let n=new Map(t.map(e=>[e.id,e])),r=new Map(e.map(e=>[e.id,e]));for(let t of e){let e=n.get(t.id);(!e||e.updatedAt!==t.updatedAt)&&this.indexMemo(t).catch(e=>console.warn(`[SuperService] Incremental index error:`,e))}for(let e of t)r.has(e.id)||this.removeMemoFromIndex(e.id).catch(e=>console.warn(`[SuperService] Remove from index error:`,e))}};N(),Wr(),Kh(),mg();var ov=[{text:M(`AND`),value:`AND`},{text:M(`OR`),value:`OR`}],sv={TAG:{value:`TAG`,text:M(`TAG`),operators:[{text:M(`INCLUDE`),value:`CONTAIN`},{text:M(`EXCLUDE`),value:`NOT_CONTAIN`}]},TYPE:{value:`TYPE`,text:M(`TYPE`),operators:[{value:`IS`,text:M(`IS`)},{value:`IS_NOT`,text:M(`ISNOT`)}],values:[{value:`CONNECTED`,text:M(`LINKED`)},{value:`NOT_TAGGED`,text:M(`NO TAGS`)},{value:`LINKED`,text:M(`HAS LINKS`)},{value:`IMAGED`,text:M(`HAS IMAGES`)}]},TEXT:{value:`TEXT`,text:M(`TEXT`),operators:[{value:`CONTAIN`,text:M(`INCLUDE`)},{value:`NOT_CONTAIN`,text:M(`EXCLUDE`)}]},DATE:{value:`DATE`,text:M(`DATE`),operators:[{value:`NOT_CONTAIN`,text:M(`BEFORE`)},{value:`CONTAIN`,text:M(`AFTER`)}]},LIST:{value:`LIST`,text:M(`LIST`),operators:[{value:`IS`,text:M(`IS`)},{value:`IS_NOT`,text:M(`ISNOT`)}],values:[{value:`TODO`,text:M(`TODO`)},{value:`DONE`,text:M(`DONE`)},{value:`LIST`,text:M(`JOURNAL`)},{value:`OTHER`,text:M(`OTHER`)}]},SOURCE:{value:`SOURCE`,text:M(`SOURCE`),operators:[{value:`IS`,text:M(`IS`)},{value:`IS_NOT`,text:M(`ISNOT`)}],values:[{value:`DAILY`,text:M(`DAILY`)},{value:`MULTI`,text:M(`MULTI`)},{value:`FILE`,text:M(`FILE`)},{value:`CANVAS`,text:M(`CANVAS`)}]},PATH:{value:`PATH`,text:M(`PATH`),operators:[{value:`CONTAIN`,text:M(`INCLUDE`)},{value:`NOT_CONTAIN`,text:M(`EXCLUDE`)}]},METADATA:{value:`METADATA`,text:M(`METADATA`),operators:[{value:`CONTAIN`,text:M(`INCLUDE`)},{value:`NOT_CONTAIN`,text:M(`EXCLUDE`)}]},TIME_RANGE:{value:`TIME_RANGE`,text:M(`TIME RANGE`),operators:[{value:`WITHIN`,text:M(`WITHIN`)},{value:`BEFORE`,text:M(`BEFORE`)}],values:[{value:`7d`,text:M(`7 days`)},{value:`14d`,text:M(`14 days`)},{value:`30d`,text:M(`30 days`)},{value:`90d`,text:M(`3 months`)},{value:`180d`,text:M(`6 months`)},{value:`365d`,text:M(`1 year`)},{value:`thisWeek`,text:M(`This week`)},{value:`thisMonth`,text:M(`This month`)},{value:`thisYear`,text:M(`This year`)},{value:`lastWeek`,text:M(`Last week`)},{value:`lastMonth`,text:M(`Last month`)},{value:`lastYear`,text:M(`Last year`)}]}},cv=sv.TYPE.values,lv=e=>{for(let t of cv)if(t.value===e)return t.text;return``},uv=()=>({type:`TAG`,value:{operator:`CONTAIN`,value:``},relation:`AND`}),dv=(e,t)=>{if(!t||t.length===0)return!0;let n=fv(e,t[0]);for(let r=1;r<t.length;r++){let i=t[r],{relation:a}=i,o=fv(e,i);a===`OR`?n||=o:n&&=o}return n},fv=(e,t)=>{if(!t||typeof t!=`object`||!t.type||!t.value||typeof t.value!=`object`)return!0;let{type:n,value:r}=t,i=r.operator,a=r.value;if(a===``&&n!==`TYPE`&&n!==`LIST`)return!0;switch(n){case`TAG`:{let t=ug(e.content),n=typeof a==`string`?a:``,r=Array.from(t).some(e=>e===n||e.startsWith(`${n}/`));return i===`CONTAIN`?r:!r}case`TEXT`:{let t=(0,f.prepareSimpleSearch)(typeof a==`string`?a.toLowerCase():``)(e.content.toLowerCase());return i===`CONTAIN`?t:!t}case`TYPE`:{let t=!1;return(a===`NOT_TAGGED`&&e.content.match(jr)===null&&e.content.match(Mr)===null&&e.content.match(Nr)===null||a===`LINKED`&&e.content.match(Pr)!==null||a===`IMAGED`&&e.content.match(Ir)!==null||a===`CONNECTED`&&e.content.match(Br)!==null)&&(t=!0),i===`IS`?t:!t}case`LIST`:{let t=(e.thinoType===`JOURNAL`?`LIST`:e.thinoType===`TASK-TODO`?`TODO`:e.thinoType===`TASK-DONE`?`DONE`:`OTHER`)===a;return i===`IS`?t:!t}case`SOURCE`:return i===`IS`?e.sourceType===a:e.sourceType!==a;case`PATH`:{if(!e.path)return i!==`CONTAIN`;let t=typeof a==`string`?a.toLowerCase():``,n=e.path.toLowerCase().includes(t);return i===`CONTAIN`?n:!n}case`METADATA`:{if(!e.fileInfo?.frontmatter)return i!==`CONTAIN`;let t=typeof a==`object`&&a?a:{name:``,value:``},n=`name`in t?t.name:``,r=`value`in t?t.value:``;if(!n)return!0;let o=e.fileInfo.frontmatter,s=o[n]&&o[n]?.toString().includes(r);return i===`CONTAIN`?s:!s}case`TIME_RANGE`:{let t=new Date,n,r=t;if(typeof a!=`string`)return!0;switch(a){case`7d`:n=wm(t,7);break;case`14d`:n=wm(t,14);break;case`30d`:n=wm(t,30);break;case`90d`:n=wm(t,90);break;case`180d`:n=wm(t,180);break;case`365d`:n=wm(t,365);break;case`thisWeek`:n=Is(t),r=dl(t);break;case`thisMonth`:n=el(t),r=Lc(t);break;case`thisYear`:n=al(t),r=rl(t);break;case`lastWeek`:{let e=wm(t,7);n=Is(e),r=dl(e);break}case`lastMonth`:{let e=Ah(t,1);n=el(e),r=Lc(e);break}case`lastYear`:{let e=Bh(t,1);n=al(e),r=rl(e);break}default:return!0}let o=new Date(e.createdAt);return i===`WITHIN`?Sm(o,{start:n,end:r}):i===`BEFORE`?o<n:!0}case`DATE`:{let t=null;if(typeof a==`string`){let e=new Date(a);if(!isNaN(e.getTime()))t=e;else{let e=app.plugins.enabledPlugins.has(`nldates-obsidian`)&&app.plugins.getPlugin(`nldates-obsidian`);if(e){let n=e.parseDate(a);if(n.date!==null)t=new Date(n.date);else return!0}else return!0}}else typeof a==`object`&&a&&`value`in a&&(t=new Date(a.value));if(!t||isNaN(t.getTime()))return!0;let n=Ud(new Date(e.createdAt),Hs(t));return i===`CONTAIN`?n:!n}default:return!0}},pv=typeof window<`u`?U.useLayoutEffect:U.useEffect;function mv(e,t,n,r){let i=(0,U.useRef)(t);pv(()=>{i.current=t},[t]),(0,U.useEffect)(()=>{let t=n?.current||window;if(!(t&&t.addEventListener))return;let a=e=>{i.current(e)};return t.addEventListener(e,a,r),()=>{t.removeEventListener(e,a,r)}},[e,n,r])}function hv(e,t,n=`mousedown`){mv(n,n=>{let r=n.target;!r||!r.isConnected||r.closest(`.suggestion-container`)||r.closest(`.menu`)||(Array.isArray(e)?e.every(e=>e.current&&!e.current.contains(r)):e.current&&!e.current.contains(r))&&t(n)})}function gv(e,t,n=[]){let r=(0,U.useRef)(),i=(0,U.useCallback)(()=>{r.current&&clearTimeout(r.current)},[]);return(0,U.useCallback)((...n)=>{i(),r.current=window.setTimeout(()=>{e(...n)},t)},n)}vi(),Dg(),H(),N();var _v=[{value:`7d`,text:M(`7 days`)},{value:`14d`,text:M(`14 days`)},{value:`30d`,text:M(`30 days`)},{value:`90d`,text:M(`3 months`)},{value:`180d`,text:M(`6 months`)},{value:`365d`,text:M(`1 year`)},{value:`thisWeek`,text:M(`This week`)},{value:`thisMonth`,text:M(`This month`)},{value:`thisYear`,text:M(`This year`)},{value:`lastWeek`,text:M(`Last week`)},{value:`lastMonth`,text:M(`Last month`)},{value:`lastYear`,text:M(`Last year`)}];function vv(e){let t=(0,f.moment)(),n,r=t.clone().endOf(`day`);switch(e){case`7d`:n=t.clone().subtract(7,`days`).startOf(`day`);break;case`14d`:n=t.clone().subtract(14,`days`).startOf(`day`);break;case`30d`:n=t.clone().subtract(30,`days`).startOf(`day`);break;case`90d`:n=t.clone().subtract(90,`days`).startOf(`day`);break;case`180d`:n=t.clone().subtract(180,`days`).startOf(`day`);break;case`365d`:n=t.clone().subtract(365,`days`).startOf(`day`);break;case`thisWeek`:n=t.clone().startOf(`week`),r=t.clone().endOf(`week`);break;case`thisMonth`:n=t.clone().startOf(`month`),r=t.clone().endOf(`month`);break;case`thisYear`:n=t.clone().startOf(`year`),r=t.clone().endOf(`year`);break;case`lastWeek`:n=t.clone().subtract(1,`week`).startOf(`week`),r=t.clone().subtract(1,`week`).endOf(`week`);break;case`lastMonth`:n=t.clone().subtract(1,`month`).startOf(`month`),r=t.clone().subtract(1,`month`).endOf(`month`);break;case`lastYear`:n=t.clone().subtract(1,`year`).startOf(`year`),r=t.clone().subtract(1,`year`).endOf(`year`);break;default:return null}return{from:n.valueOf(),to:r.valueOf()}}var yv=({isSearching:e,embeddingReady:t,loadingProgress:n,loadingStatus:r,indexStatus:i})=>{if(e)return(0,W.jsx)(`div`,{className:`search-bar-spinner`});if(!t)return(0,W.jsxs)(`div`,{className:`search-bar-super-badge loading`,title:r||`Loading model...`,children:[(0,W.jsx)(`div`,{className:`search-bar-mini-spinner`}),n>0&&n<100&&(0,W.jsxs)(`span`,{className:`search-bar-progress-text`,children:[Math.round(n),`%`]})]});if(i.isIndexing){let e=i.totalMemos>0?Math.round(i.indexedMemos/i.totalMemos*100):0;return(0,W.jsx)(`div`,{className:`search-bar-super-badge indexing`,title:`Indexing: ${i.indexedMemos}/${i.totalMemos}`,children:(0,W.jsx)(`div`,{className:`search-bar-mini-progress-bar`,children:(0,W.jsx)(`div`,{className:`search-bar-mini-progress-fill`,style:{width:`${e}%`}})})})}return(0,W.jsx)(`div`,{className:`search-bar-super-badge ready`,title:M(`Super search active`)})},bv=({disableSuper:e=!1})=>{let{app:t,view:n}=I(),{query:{type:r,text:i,duration:a}}=di(),o=B(e=>e.enabled),s=B(e=>e.embeddingReady),c=B(e=>e.isSearching),l=B(e=>e.indexStatus),u=B(e=>e.loadingProgress),d=B(e=>e.loadingStatus),p=o&&!e,m=(0,U.useRef)(null),h=(0,U.useRef)(null),g=(0,U.useRef)(null),_=(0,U.useRef)(null),[v,y]=(0,U.useState)(i||``),[b,x]=(0,U.useState)(!1),[S,C]=(0,U.useState)(``),w=!!(r||a||S);(0,U.useEffect)(()=>{y(i||``)},[i]),(0,U.useEffect)(()=>{a||C(``)},[a]),(0,U.useEffect)(()=>{!m||!n||!t||(n.registerEvent(t.workspace.on(`blur-on-memos`,()=>{m.current?.blur()})),n.registerEvent(t.workspace.on(`focus-on-searchBar`,()=>{m.current?.focus()})))},[m,t,n]),(0,U.useEffect)(()=>{h.current&&(0,f.setIcon)(h.current,`search`)},[]),(0,U.useEffect)(()=>{g.current&&(0,f.setIcon)(g.current,`chevron-down`)},[]),hv([_,g],()=>{x(!1)});let T=gv((e,t)=>{if(z.setTextQuery(e),t){let t=B.getState();if(t.setSearchQuery(e),!e.trim()){t.setSearchResults([]),t.setIsSearching(!1);return}t.setIsSearching(!0),av.hybridSearch(e,20).then(e=>t.setSearchResults(e)).catch(e=>{console.warn(`[SearchBar] Hybrid search error:`,e),t.setSearchResults([])}).finally(()=>t.setIsSearching(!1))}},300,[]),E=(0,U.useCallback)(e=>{let t=e.currentTarget.value;y(t),T(t,p)},[T,p]),D=(0,U.useCallback)(()=>{if(y(``),z.setTextQuery(``),p){let e=B.getState();e.setSearchQuery(``),e.setSearchResults([])}m.current?.focus()},[p]),O=(0,U.useCallback)(e=>{let{type:t}=z.getState().query;e===t&&(e=``),z.setMemoTypeQuery(e)},[]),k=(0,U.useCallback)(e=>{if(S===e)C(``),z.setTimeQuery({from:0,to:0});else{let t=vv(e);t&&(C(e),z.setTimeQuery(t))}},[S]),A=(0,U.useCallback)(()=>{x(e=>!e)},[]);return(0,W.jsxs)(`div`,{className:`search-bar-container`,children:[(0,W.jsxs)(`div`,{className:`search-bar-inputer`,children:[(0,W.jsx)(`span`,{ref:h,className:`btn icon-img`}),(0,W.jsx)(`input`,{ref:m,className:`text-input`,type:`text`,value:v,placeholder:p&&!s?`${M(`Type here`)} (${M(`model loading...`)})`:M(`Type here`),onChange:E}),p&&(0,W.jsx)(yv,{isSearching:c,embeddingReady:s,loadingProgress:u,loadingStatus:d,indexStatus:l}),v&&(0,W.jsx)(`button`,{className:`search-bar-clear clickable-icon`,onClick:D,title:M(`Clear search`),children:`×`}),(0,W.jsx)(`div`,{ref:g,className:`search-bar-filter-toggle clickable-icon ${b?`active`:``} ${w?`has-filter`:``}`,onClick:A,title:M(`Toggle filters`)})]}),b&&(0,W.jsxs)(`div`,{className:`search-bar-filters-panel`,ref:_,children:[(0,W.jsxs)(`div`,{className:`search-bar-filter-section`,children:[(0,W.jsx)(`span`,{className:`filter-section-label`,children:M(`TYPE`)}),(0,W.jsx)(`div`,{className:`filter-section-options`,children:cv.map(e=>(0,W.jsx)(`button`,{className:`clickable-icon filter-option-chip ${r===e.value?`active`:``}`,onClick:()=>O(e.value),children:e.text},e.value))})]}),(0,W.jsxs)(`div`,{className:`search-bar-filter-section`,children:[(0,W.jsx)(`span`,{className:`filter-section-label`,children:M(`TIME RANGE`)}),(0,W.jsx)(`div`,{className:`filter-section-options`,children:_v.map(e=>(0,W.jsx)(`button`,{className:`clickable-icon filter-option-chip ${S===e.value?`active`:``}`,onClick:()=>k(e.value),children:e.text},e.value))})]})]})]})},xv=e=>{let{children:t,when:n}=e;return n?(0,W.jsx)(W.Fragment,{children:t}):null};function Sv(){let e=document.createDocumentFragment();e.createEl(`div`,{cls:`thino-info`}).createEl(`div`,{text:M(`This is a pro feature, please upgrade to pro version to use it.`)});let t=e.createEl(`div`,{cls:`thino-link`}).createEl(`div`,{text:M(`You can get pro version from: `)}),n=r_()?`https://pkmer.cn/products/thino/`:`https://thino.pkmer.net/en/`;t.createEl(`a`,{text:`PKMer`,attr:{href:n}}),new f.Notice(e,5e3)}var Cv=o((()=>{N(),i_()}));function wv(){return process.platform===`win32`?process.arch===`ia32`&&Object.hasOwnProperty.call(process.env,`PROCESSOR_ARCHITEW6432`)?`mixed`:`native`:``}function Tv(e){return Av(`sha256`).update(e).digest(`hex`)}function Ev(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 Error(`Unsupported platform: ${process.platform}`)}}function Dv(e=!1){return new Promise((t,n)=>{Ov(jv[process.platform],{},(r,i)=>{if(r)return n(Error(`Error while obtaining machine id: ${r.stack}`));let a=Ev(i.toString());return t(e?a:Tv(a))})})}var Ov,kv,Av,jv,Mv=o((()=>{P_(),{exec:Ov,execSync:kv}=N_(`child_process`),{createHash:Av}=N_(`crypto`),jv=f.Platform.isDesktop&&{darwin:`ioreg -rd1 -c IOPlatformExpertDevice`,win32:`${{native:`%windir%\\System32`,mixed:`%windir%\\sysnative\\cmd.exe /c %windir%\\System32`}[wv()]}\\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`}}));vi(),H(),Cv(),N(),Mv();var Nv={list:`align-left`,waterfall:`layout-grid`,calendar:`calendar`,minimal:`list`,table:`table`,chat:`message-square`,moments:`chrome`,flow:`workflow`},Pv=({className:e})=>{let{app:t,view:n,verifyState:r,settings:i}=I(),{manifest:a,isMobileView:o}=si(),s=(0,U.useRef)(null),c=(0,U.useRef)(null),[l,u]=(0,U.useState)(()=>(window.app||t)?.loadLocalStorage(`thinoListView`)||`list`),[d,p]=(0,U.useState)(null),m=(0,U.useCallback)(()=>{if(!n?.leaf||n.leaf.height===0||!d?.settings)return;let e=d.settings.MemoListView;if(d.settings.SupportSelectOtherView||e===`chat`||e===`moments`||e===`flow`)return;let t=n.leaf.width>950?e:`list`;u(t),R.setMemoListView(t)},[n,d]);(0,U.useEffect)(()=>{if(!a||!t)return;let e=t.plugins.getPlugin(a.id);if(e){p(e);let t=e.settings?.MemoListView||`list`;u(t),R.setMemoListView(t)}},[a,t]),(0,U.useEffect)(()=>{if(!(!t||!n||!d?.settings))return m(),c.current||(c.current=t.workspace.on(`resize`,m),n.registerEvent(c.current)),()=>{c.current&&=(t.workspace.offref(c.current),null)}},[t,n,d,m]),(0,U.useEffect)(()=>{if(!s.current||!l)return;let e=Nv[l]||`list`;(0,f.setIcon)(s.current,e),R.setMemoListView(l),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(s.current,M(`Switch view`))},[l]);let h=(0,U.useMemo)(()=>{let e=[{view:`list`,title:M(`List`)},{view:`chat`,title:M(`Chat`)},{view:`moments`,title:M(`Moments`)},{view:`flow`,title:M(`Flow`)}];return(!o||i?.SupportSelectOtherView)&&e.push({view:`waterfall`,title:M(`Waterfall`)},{view:`calendar`,title:M(`Calendar`)},{view:`table`,title:M(`Table`)}),e},[o,i?.SupportSelectOtherView]),g=(0,U.useCallback)(async e=>{try{let t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),n=f.Platform.isDesktop?await Dv():t?.identifier||t?.uuid;if(!r||r.appId!==n){Sv();return}let i=async e=>{l!==e&&(R.setMemoListView(e),d&&(d.settings={...d.settings,MemoListView:e},await d.saveSettings()),u(e))},a=new f.Menu;console.log(`viewOptions`,h),h.forEach(({view:e,title:t})=>{a.addItem(n=>{n.setChecked(l===e).setIcon(Nv[e]).setTitle(t).onClick(()=>i(e))})}),a.showAtMouseEvent(e.nativeEvent)}catch(e){console.error(`Error handling view switcher click:`,e)}},[r,l,d,h]);return(0,W.jsx)(`div`,{className:(0,U.useMemo)(()=>`memos-view-switcher-wrapper ${e||``} pro`.trim(),[e]),ref:s,onClick:g})};N(),H();var Fv=()=>{let e=(0,U.useRef)(null);return(0,U.useEffect)(()=>{e&&((0,f.setIcon)(e.current,`calendar-check`),f.setTooltip&&(0,f.setTooltip)(e.current,M(`Daily Memos`)))},[e]),(0,W.jsx)(`div`,{className:`memos-review-entry-wrapper`,ref:e,onClick:()=>{z.setPathname(`/daily`)}})},Iv=function(e){return e.reduce(function(e,t){var n=t[0];return e[n]=t[1],e},{})},Lv=typeof window<`u`&&window.document&&window.document.createElement?U.useLayoutEffect:U.useEffect,Rv=`bottom`,zv=`right`,Bv=`left`,Vv=`auto`,Hv=[`top`,Rv,zv,Bv],Uv=`start`,Wv=`clippingParents`,Gv=`viewport`,Kv=`popper`,qv=`reference`,Jv=Hv.reduce(function(e,t){return e.concat([t+`-`+Uv,t+`-end`])},[]),Yv=[].concat(Hv,[Vv]).reduce(function(e,t){return e.concat([t,t+`-`+Uv,t+`-end`])},[]),Xv=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function Zv(e){return e?(e.nodeName||``).toLowerCase():null}function Qv(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function $v(e){return e instanceof Qv(e).Element||e instanceof Element}function ey(e){return e instanceof Qv(e).HTMLElement||e instanceof HTMLElement}function ty(e){return typeof ShadowRoot>`u`?!1:e instanceof Qv(e).ShadowRoot||e instanceof ShadowRoot}function ny(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!ey(i)||!Zv(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function ry(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(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});!ey(r)||!Zv(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var iy={name:`applyStyles`,enabled:!0,phase:`write`,fn:ny,effect:ry,requires:[`computeStyles`]};function ay(e){return e.split(`-`)[0]}var oy=Math.max,sy=Math.min,cy=Math.round;function ly(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function uy(){return!/^((?!chrome|android).)*safari/i.test(ly())}function dy(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&ey(e)&&(i=e.offsetWidth>0&&cy(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&cy(r.height)/e.offsetHeight||1);var o=($v(e)?Qv(e):window).visualViewport,s=!uy()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function fy(e){var t=dy(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 py(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ty(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function my(e){return Qv(e).getComputedStyle(e)}function hy(e){return[`table`,`td`,`th`].indexOf(Zv(e))>=0}function gy(e){return(($v(e)?e.ownerDocument:e.document)||window.document).documentElement}function _y(e){return Zv(e)===`html`?e:e.assignedSlot||e.parentNode||(ty(e)?e.host:null)||gy(e)}function vy(e){return!ey(e)||my(e).position===`fixed`?null:e.offsetParent}function yy(e){var t=/firefox/i.test(ly());if(/Trident/i.test(ly())&&ey(e)&&my(e).position===`fixed`)return null;var n=_y(e);for(ty(n)&&(n=n.host);ey(n)&&[`html`,`body`].indexOf(Zv(n))<0;){var r=my(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function by(e){for(var t=Qv(e),n=vy(e);n&&hy(n)&&my(n).position===`static`;)n=vy(n);return n&&(Zv(n)===`html`||Zv(n)===`body`&&my(n).position===`static`)?t:n||yy(e)||t}function xy(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function Sy(e,t,n){return oy(e,sy(t,n))}function Cy(e,t,n){var r=Sy(e,t,n);return r>n?n:r}function wy(){return{top:0,right:0,bottom:0,left:0}}function Ty(e){return Object.assign({},wy(),e)}function Ey(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var Dy=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,Ty(typeof e==`number`?Ey(e,Hv):e)};function Oy(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=ay(n.placement),c=xy(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=Dy(i.padding,n),d=fy(a),f=c===`y`?`top`:Bv,p=c===`y`?Rv:zv,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=by(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=Sy(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function ky(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||py(t.elements.popper,r)&&(t.elements.arrow=r))}var Ay={name:`arrow`,enabled:!0,phase:`main`,fn:Oy,effect:ky,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function jy(e){return e.split(`-`)[1]}var My={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function Ny(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:cy(n*i)/i||0,y:cy(r*i)/i||0}}function Py(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=Bv,b=`top`,x=window;if(l){var S=by(n),C=`clientHeight`,w=`clientWidth`;if(S===Qv(n)&&(S=gy(n),my(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=Rv;var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=zv;var E=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=E-r.width,p*=c?1:-1}}var D=Object.assign({position:s},l&&My),O=u===!0?Ny({x:p,y:h},Qv(n)):{x:p,y:h};if(p=O.x,h=O.y,c){var k;return Object.assign({},D,(k={},k[b]=v?`0`:``,k[y]=_?`0`:``,k.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,k))}return Object.assign({},D,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function Fy(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,a=n.adaptive,o=a===void 0?!0:a,s=n.roundOffsets,c=s===void 0?!0:s,l={placement:ay(t.placement),variation:jy(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Py(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Py(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var Iy={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:Fy,data:{}},Ly={passive:!0};function Ry(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0?!0:i,o=r.resize,s=o===void 0?!0:o,c=Qv(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,Ly)}),s&&c.addEventListener(`resize`,n.update,Ly),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,Ly)}),s&&c.removeEventListener(`resize`,n.update,Ly)}}var zy={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:Ry,data:{}},By={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Vy(e){return e.replace(/left|right|bottom|top/g,function(e){return By[e]})}var Hy={start:`end`,end:`start`};function Uy(e){return e.replace(/start|end/g,function(e){return Hy[e]})}function Wy(e){var t=Qv(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Gy(e){return dy(gy(e)).left+Wy(e).scrollLeft}function Ky(e,t){var n=Qv(e),r=gy(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=uy();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+Gy(e),y:c}}function qy(e){var t=gy(e),n=Wy(e),r=e.ownerDocument?.body,i=oy(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=oy(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+Gy(e),s=-n.scrollTop;return my(r||t).direction===`rtl`&&(o+=oy(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function Jy(e){var t=my(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Yy(e){return[`html`,`body`,`#document`].indexOf(Zv(e))>=0?e.ownerDocument.body:ey(e)&&Jy(e)?e:Yy(_y(e))}function Xy(e,t){t===void 0&&(t=[]);var n=Yy(e),r=n===e.ownerDocument?.body,i=Qv(n),a=r?[i].concat(i.visualViewport||[],Jy(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(Xy(_y(a)))}function Zy(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Qy(e,t){var n=dy(e,!1,t===`fixed`);return n.top+=e.clientTop,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 $y(e,t,n){return t===`viewport`?Zy(Ky(e,n)):$v(t)?Qy(t,n):Zy(qy(gy(e)))}function eb(e){var t=Xy(_y(e)),n=[`absolute`,`fixed`].indexOf(my(e).position)>=0&&ey(e)?by(e):e;return $v(n)?t.filter(function(e){return $v(e)&&py(e,n)&&Zv(e)!==`body`}):[]}function tb(e,t,n,r){var i=t===`clippingParents`?eb(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=$y(e,n,r);return t.top=oy(i.top,t.top),t.right=sy(i.right,t.right),t.bottom=sy(i.bottom,t.bottom),t.left=oy(i.left,t.left),t},$y(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function nb(e){var t=e.reference,n=e.element,r=e.placement,i=r?ay(r):null,a=r?jy(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case Rv:c={x:o,y:t.y+t.height};break;case zv:c={x:t.x+t.width,y:s};break;case Bv:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?xy(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case Uv:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2);break;default:}}return c}function rb(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?Wv:s,l=n.rootBoundary,u=l===void 0?Gv:l,d=n.elementContext,f=d===void 0?Kv:d,p=n.altBoundary,m=p===void 0?!1:p,h=n.padding,g=h===void 0?0:h,_=Ty(typeof g==`number`?Ey(g,Hv):g),v=f===`popper`?qv:Kv,y=e.rects.popper,b=e.elements[m?v:f],x=tb($v(b)?b:b.contextElement||gy(e.elements.popper),c,u,o),S=dy(e.elements.reference),C=nb({reference:S,element:y,strategy:`absolute`,placement:i}),w=Zy(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}function ib(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?Yv:c,u=jy(r),d=u?s?Jv:Jv.filter(function(e){return jy(e)===u}):Hv,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=rb(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[ay(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function ab(e){if(ay(e)===`auto`)return[];var t=Vy(e);return[Uy(e),t,Uy(t)]}function ob(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!0:o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,h=n.allowedAutoPlacements,g=t.options.placement,_=ay(g)===g,v=c||(_||!m?[Vy(g)]:ab(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(ay(n)===`auto`?ib(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],T=0;T<y.length;T++){var E=y[T],D=ay(E),O=jy(E)===Uv,k=[`top`,Rv].indexOf(D)>=0,A=k?`width`:`height`,j=rb(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),ee=k?O?zv:Bv:O?Rv:`top`;b[A]>x[A]&&(ee=Vy(ee));var te=Vy(ee),ne=[];if(a&&ne.push(j[D]<=0),s&&ne.push(j[ee]<=0,j[te]<=0),ne.every(function(e){return e})){w=E,C=!1;break}S.set(E,ne)}if(C)for(var re=m?3:1,ie=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},ae=re;ae>0&&ie(ae)!==`break`;ae--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var sb={name:`flip`,enabled:!0,phase:`main`,fn:ob,requiresIfExists:[`offset`],data:{_skip:!1}};function cb(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 lb(e){return[`top`,zv,Rv,Bv].some(function(t){return e[t]>=0})}function ub(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=rb(t,{elementContext:`reference`}),s=rb(t,{altBoundary:!0}),c=cb(o,r),l=cb(s,i,a),u=lb(c),d=lb(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var db={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:ub};function fb(e,t,n){var r=ay(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function pb(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=Yv.reduce(function(e,n){return e[n]=fb(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var mb={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:pb};function hb(e){var t=e.state,n=e.name;t.modifiersData[n]=nb({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var gb={name:`popperOffsets`,enabled:!0,phase:`read`,fn:hb,data:{}};function _b(e){return e===`x`?`y`:`x`}function vb(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0?!0:i,o=n.altAxis,s=o===void 0?!1:o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,m=n.tetherOffset,h=m===void 0?0:m,g=rb(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=ay(t.placement),v=jy(t.placement),y=!v,b=xy(_),x=_b(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,E=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(S){if(a){var k=b===`y`?`top`:Bv,A=b===`y`?Rv:zv,j=b===`y`?`height`:`width`,ee=S[b],te=ee+g[k],ne=ee-g[A],re=p?-w[j]/2:0,ie=v===`start`?C[j]:w[j],ae=v===`start`?-w[j]:-C[j],oe=t.elements.arrow,se=p&&oe?fy(oe):{width:0,height:0},ce=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:wy(),le=ce[k],ue=ce[A],de=Sy(0,C[j],se[j]),fe=y?C[j]/2-re-de-le-E.mainAxis:ie-de-le-E.mainAxis,pe=y?-C[j]/2+re+de+ue+E.mainAxis:ae+de+ue+E.mainAxis,me=t.elements.arrow&&by(t.elements.arrow),he=me?b===`y`?me.clientTop||0:me.clientLeft||0:0,ge=D?.[b]??0,_e=ee+fe-ge-he,ve=ee+pe-ge,ye=Sy(p?sy(te,_e):te,ee,p?oy(ne,ve):ne);S[b]=ye,O[b]=ye-ee}if(s){var be=b===`x`?`top`:Bv,xe=b===`x`?Rv:zv,Se=S[x],Ce=x===`y`?`height`:`width`,we=Se+g[be],Te=Se-g[xe],Ee=[`top`,Bv].indexOf(_)!==-1,De=D?.[x]??0,Oe=Ee?we:Se-C[Ce]-w[Ce]-De+E.altAxis,ke=Ee?Se+C[Ce]+w[Ce]-De-E.altAxis:Te,Ae=p&&Ee?Cy(Oe,Se,ke):Sy(p?Oe:we,Se,p?ke:Te);S[x]=Ae,O[x]=Ae-Se}t.modifiersData[r]=O}}var yb={name:`preventOverflow`,enabled:!0,phase:`main`,fn:vb,requiresIfExists:[`offset`]};function bb(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function xb(e){return e===Qv(e)||!ey(e)?Wy(e):bb(e)}function Sb(e){var t=e.getBoundingClientRect(),n=cy(t.width)/e.offsetWidth||1,r=cy(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Cb(e,t,n){n===void 0&&(n=!1);var r=ey(t),i=ey(t)&&Sb(t),a=gy(t),o=dy(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((Zv(t)!==`body`||Jy(a))&&(s=xb(t)),ey(t)?(c=dy(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=Gy(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function wb(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function Tb(e){var t=wb(e);return Xv.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function Eb(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function Db(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var Ob={placement:`bottom`,modifiers:[],strategy:`absolute`};function kb(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function Ab(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?Ob:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},Ob,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:$v(e)?Xy(e):e.contextElement?Xy(e.contextElement):[],popper:Xy(t)};var s=Tb(Db([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(kb(t,n)){i.rects={reference:Cb(t,by(n),i.options.strategy===`fixed`),popper:fy(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:Eb(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!kb(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var jb=Ab({defaultModifiers:[zy,gb,Iy,iy,mb,sb,yb,Ay,db]}),Mb=s(((e,t)=>{var n=typeof Element<`u`,r=typeof Map==`function`,i=typeof Set==`function`,a=typeof ArrayBuffer==`function`&&!!ArrayBuffer.isView;function o(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;var s,c,l;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(!o(e[c],t[c]))return!1;return!0}var u;if(r&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;for(u=e.entries();!(c=u.next()).done;)if(!o(c.value[1],t.get(c.value[0])))return!1;return!0}if(i&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(e[c]!==t[c])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(l=Object.keys(e),s=l.length,s!==Object.keys(t).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(t,l[c]))return!1;if(n&&e instanceof Element)return!1;for(c=s;c--!==0;)if(!((l[c]===`_owner`||l[c]===`__v`||l[c]===`__o`)&&e.$$typeof)&&!o(e[l[c]],t[l[c]]))return!1;return!0}return e!==e&&t!==t}t.exports=function(e,t){try{return o(e,t)}catch(e){if((e.message||``).match(/stack|recursion/i))return console.warn(`react-fast-compare cannot handle circular refs`),!1;throw e}}})),Nb=u(Yg()),Pb=u(Mb()),Fb=[],Ib=function(e,t,n){n===void 0&&(n={});var r=U.useRef(null),i={onFirstUpdate:n.onFirstUpdate,placement:n.placement||`bottom`,strategy:n.strategy||`absolute`,modifiers:n.modifiers||Fb},a=U.useState({styles:{popper:{position:i.strategy,left:`0`,top:`0`},arrow:{position:`absolute`}},attributes:{}}),o=a[0],s=a[1],c=U.useMemo(function(){return{name:`updateState`,enabled:!0,phase:`write`,fn:function(e){var t=e.state,n=Object.keys(t.elements);Nb.flushSync(function(){s({styles:Iv(n.map(function(e){return[e,t.styles[e]||{}]})),attributes:Iv(n.map(function(e){return[e,t.attributes[e]]}))})})},requires:[`computeStyles`]}},[]),l=U.useMemo(function(){var e={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[c,{name:`applyStyles`,enabled:!1}])};return(0,Pb.default)(r.current,e)?r.current||e:(r.current=e,e)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,c]),u=U.useRef();return Lv(function(){u.current&&u.current.setOptions(l)},[l]),Lv(function(){if(!(e==null||t==null)){var r=(n.createPopper||jb)(e,t,l);return u.current=r,function(){r.destroy(),u.current=null}}},[e,t,n.createPopper]),{state:u.current?u.current.state:null,styles:o.styles,attributes:o.attributes,update:u.current?u.current.update:null,forceUpdate:u.current?u.current.forceUpdate:null}},Lb=s(((e,t)=>{var n=!1,r=function(){};if(n){var i=function(e,t){var n=arguments.length;t=Array(n>1?n-1:0);for(var r=1;r<n;r++)t[r-1]=arguments[r];var i=0,a=`Warning: `+e.replace(/%s/g,function(){return t[i++]});typeof console<`u`&&console.error(a);try{throw Error(a)}catch{}};r=function(e,t,n){var r=arguments.length;n=Array(r>2?r-2:0);for(var a=2;a<r;a++)n[a-2]=arguments[a];if(t===void 0)throw Error("`warning(condition, format, ...args)` requires a warning message argument");e||i.apply(null,[t].concat(n))}}t.exports=r}));function Rb(e=!0){let[t,n]=(0,U.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})}}}function zb(e){let[t,n]=(0,U.useState)(()=>!!e);return[t,(0,U.useCallback)(e=>{n(typeof e==`boolean`?e:e=>!e)},[])]}N();var Bb={text:M(`SELECT`),value:``},Vb=(0,U.memo)(e=>{let{className:t,dataSource:n,handleValueChanged:r,value:i}=e,[a,o]=zb(!1),s=(0,U.useRef)(null),c=Bb;for(let e of n)if(e.value===i){c=e;break}(0,U.useEffect)(()=>{a&&window.addEventListener(`click`,e=>{s.current?.contains(e.target)||o(!1)},{capture:!0,once:!0})},[a]);let l=e=>{r&&r(e.value),o(!1)};return(0,W.jsxs)(`div`,{className:`selector-wrapper ${t||``}`,ref:s,children:[(0,W.jsxs)(`div`,{className:`current-value-container ${a?`active`:``}`,onClick:e=>{e.stopPropagation(),o()},children:[(0,W.jsx)(`span`,{className:`value-text`,children:c.text}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-right`)},className:`btn arrow-text`})]}),(0,W.jsx)(`div`,{className:`items-wrapper ${a?``:`thino-hidden`}`,children:n.map(e=>(0,W.jsx)(`div`,{className:`item-container ${e.value===i?`selected`:``}`,onClick:()=>{l(e)},children:e.text},e.value))})]})});N();var Hb=e=>{let{year:t,handleYearChange:n}=e,[r,i]=(0,U.useState)([]),[a,o]=(0,U.useState)(t),s=(0,U.useRef)(null),c=(0,U.useRef)(null),[l,u]=U.useState(!1),d=U.useRef(null);hv(d,()=>{u(!1)}),(0,U.useEffect)(()=>{s.current&&(0,f.setIcon)(s.current,`chevron-left`),c.current&&(0,f.setIcon)(c.current,`chevron-right`)},[s,c,l]),(0,U.useEffect)(()=>{p(a)},[t]);let p=e=>{let t=parseInt(e),n=t-t%10,r=[];for(let e=0;e<10;e++)r.push(`${n+e}`);i(r)};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:`btn year-btn`,onClick:()=>{u(!l)},children:[(0,W.jsx)(`span`,{children:t}),(0,W.jsx)(`span`,{children:M(`year`)})]}),l&&(0,W.jsxs)(`div`,{ref:d,className:`year-picker-wrapper`,children:[(0,W.jsxs)(`div`,{className:`year-picker-header`,children:[(0,W.jsxs)(`div`,{className:`year-picker-header-title`,children:[a,` `+(M(`year`)||``)]}),(0,W.jsxs)(`div`,{className:`year-picker-header-btns`,children:[(0,W.jsx)(`span`,{className:`btn`,ref:s,onClick:()=>{let e=parseInt(a)-10;o(e.toString()),p(e.toString())}}),(0,W.jsx)(`span`,{className:`btn`,ref:c,onClick:()=>{let e=parseInt(a)+10;o(e.toString()),p(e.toString())}})]})]}),(0,W.jsx)(`div`,{className:`year-picker-body`,children:(0,W.jsx)(`div`,{className:`year-picker-body-list`,children:r.map(e=>(0,W.jsx)(`div`,{className:`year-picker-body-item ${e===a?`selected`:``}`,onClick:()=>{o(e),n(e),u(!1)},children:e},e))})})]})]})},Ub=e=>{let{month:t,handleMonthChange:n}=e,[r,i]=(0,U.useState)([]),[a,o]=(0,U.useState)((parseInt(t)+1).toString()),[s,c]=U.useState(!1),l=U.useRef(null);hv(l,()=>{c(!1)}),(0,U.useEffect)(()=>{u()},[t]);let u=()=>{let e=[];for(let t=1;t<=12;t++)e.push(`${t}`);i(e)};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:`btn month-btn`,onClick:()=>{c(!s)},children:[(0,W.jsxs)(`span`,{children:[M(`monthsShort`)[parseInt(t)]||parseInt(t)+1,` `]}),(0,W.jsx)(`span`,{children:M(`month`)||``})]}),s&&(0,W.jsxs)(`div`,{ref:l,className:`month-picker-wrapper`,children:[(0,W.jsxs)(`div`,{className:`month-picker-header`,children:[(0,W.jsxs)(`div`,{className:`month-picker-header-title`,children:[a,` `+(M(`month`)||``)]}),(0,W.jsx)(`div`,{className:`month-picker-header-btns`})]}),(0,W.jsx)(`div`,{className:`month-picker-body`,children:(0,W.jsx)(`div`,{className:`month-picker-body-list`,children:r.map(e=>(0,W.jsx)(`div`,{className:`month-picker-body-item ${e===a?`selected`:``}`,onClick:()=>{o(e),n(e),c(!1)},children:e},e))})})]})]})};Wr(),N();var Wb=e=>{let{className:t,datestamp:n,handleDateStampChange:r}=e,[i,a]=(0,U.useState)(Kb(n)),[o,s]=(0,U.useState)(n);(0,U.useEffect)(()=>{a(Kb(n))},[n]);let c=new Date(i),l=c.getDay(),u=[];for(let e=0;e<l;e++)u.push({date:0,datestamp:c.getTime()-Ar*(7-e)});let d=Gb(i);for(let e=1;e<=d;e++)u.push({date:e,datestamp:c.getTime()+Ar*(e-1)});let p=(e,t)=>{r(t,e.nativeEvent),s(t)},m=e=>{let t=c.getFullYear(),n=c.getMonth()+1,r=0;r=n===1&&e===-1?new Date(`${t-1}/12/1`).getTime():n===12&&e===1?new Date(`${t+1}/1/1`).getTime():new Date(`${t}/${n+e}/1`).getTime(),a(Kb(r))};return(0,W.jsxs)(`div`,{className:`date-picker-wrapper ${t}`,children:[(0,W.jsxs)(`div`,{className:`date-picker-header`,children:[(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-left`)},className:`btn btn-text`,onClick:()=>m(-1)}),(0,W.jsxs)(`span`,{className:`normal-text`,children:[(0,W.jsx)(Hb,{year:c.getFullYear().toString(),handleYearChange:e=>{a(Kb(new Date(`${e}/${c.getMonth()+1}/1`).getTime()))}}),(0,W.jsx)(Ub,{month:c.getMonth().toString(),handleMonthChange:e=>{a(Kb(new Date(`${c.getFullYear()}/${parseInt(e)}/1`).getTime()))}})]}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-right`)},className:`btn btn-text`,onClick:()=>m(1)})]}),(0,W.jsxs)(`div`,{className:`date-picker-day-container`,children:[(0,W.jsx)(`div`,{className:`date-picker-day-header`,children:M(`weekDaysShort`).map(e=>(0,W.jsx)(`span`,{className:`day-item`,children:e},e))}),(0,W.jsx)(`div`,{className:`date-picker-day-content`,children:u.map(e=>e.date===0?(0,W.jsx)(`span`,{className:`day-item null`,children:``},e.datestamp):(0,W.jsx)(`span`,{className:`day-item ${e.datestamp===n?`current`:``} ${e.datestamp===o?`selected`:``}`,onClick:t=>p(t,e.datestamp),children:(0,W.jsx)(`span`,{className:`day-item-text`,children:e.date})},e.datestamp))})]})]})};function Gb(e){let 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())/Ar}function Kb(e){let t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}N(),H();var qb=[{label:M(`Today`),value:(0,f.moment)().format(`YYYY-MM-DD`)},{label:M(`Yesterday`),value:(0,f.moment)().subtract(1,`days`).format(`YYYY-MM-DD`)},{label:M(`Last 7 days`),value:(0,f.moment)().subtract(7,`days`).format(`YYYY-MM-DD`)},{label:M(`Last 30 days`),value:(0,f.moment)().subtract(30,`days`).format(`YYYY-MM-DD`)},{label:M(`Last 90 days`),value:(0,f.moment)().subtract(90,`days`).format(`YYYY-MM-DD`)},{label:M(`Last 180 days`),value:(0,f.moment)().subtract(180,`days`).format(`YYYY-MM-DD`)},{label:M(`Last 365 days`),value:(0,f.moment)().subtract(365,`days`).format(`YYYY-MM-DD`)}],Jb=e=>{let{handleValueChange:t,setShownStatus:n}=e;return(0,W.jsxs)(W.Fragment,{children:[e.type===`icon`&&(0,W.jsx)(`div`,{className:`quick-date-btn-group`,children:qb.map((e,r)=>(0,W.jsx)(`div`,{className:`btn action-btn quick-date-btn`,onClick:()=>{t(e.value),n&&n(!1)},children:e.label},r))}),(0,W.jsx)(Wb,{className:`calendar-date-picker`,datestamp:e?.defaultValue||(0,f.moment)().startOf(`day`).valueOf(),handleDateStampChange:(r,i)=>{t(e.type===`icon`?(0,f.moment)(r).format(`YYYY-MM-DD`):r.toString()),n&&n(!1)}})]})},Yb=e=>{let{handleValueChange:t}=e,[n,r]=U.useState(!1),i=U.useRef(null),a=U.useRef(null),o=Ib(a.current,i.current,{placement:`bottom-start`});return hv(i,()=>{r(!1)}),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{ref:t=>{a.current=t,t&&e.type===`icon`&&(0,f.setIcon)(t,`calendar`)},className:`btn calendar-btn ${e.type===`icon`?`icon-btn`:`text-btn`}`,onClick:()=>{!f.Platform.isMobile&&r(!n),!f.Platform.isMobile&&o?.update&&o?.update(),f.Platform.isMobile&&new Xb(L.getState().app,e.type,t).open()},children:e.type===`text`&&e.defaultValue?e.defaultText?e.defaultText:(0,f.moment)(e.defaultValue,`x`).subtract(e.startOrEnd===`end`?1:0,`days`).format(`YYYY/MM/DD`):``}),(0,W.jsx)(`div`,{className:`menu-btns-popup ${n?``:`thino-hidden`}`,ref:i,style:o.styles.popper,children:(0,W.jsx)(Jb,{type:e.defaultText?`icon`:e.type,handleValueChange:t,setShownStatus:r})})]})},Xb=class extends f.Modal{root;type;handleValueChange;constructor(e,t,n){super(e),this.type=t,this.handleValueChange=n}onOpen(){let{contentEl:e}=this;this.root=(0,$g.createRoot)(e),this.root.render((0,W.jsx)(Jb,{type:this.type,handleValueChange:this.handleValueChange.bind(this),setShownStatus:e=>{!e&&this.close()}}))}onClose(){this.root?.unmount()}},Zb=(e,t)=>(e%t+t)%t,Qb=class{owner;values;suggestions;selectedItem;containerEl;constructor(e,t,n){this.owner=e,this.containerEl=t,t.on(`click`,`.suggestion-item`,this.onSuggestionClick.bind(this)),t.on(`mousemove`,`.suggestion-item`,this.onSuggestionMouseover.bind(this)),n.register([],`ArrowUp`,e=>{if(!e.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),n.register([],`ArrowDown`,e=>{if(!e.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),n.register([],`Enter`,e=>{if(!e.isComposing)return this.useSelectedItem(e),!1})}onSuggestionClick(e,t){e.preventDefault();let n=this.suggestions.indexOf(t);this.setSelectedItem(n,!1),this.useSelectedItem(e)}onSuggestionMouseover(e,t){let n=this.suggestions.indexOf(t);this.setSelectedItem(n,!1)}setSuggestions(e){this.containerEl.empty();let t=[];e.forEach(e=>{let n=this.containerEl.createDiv(`suggestion-item`);this.owner.renderSuggestion(e,n),t.push(n)}),this.values=e,this.suggestions=t,this.setSelectedItem(0,!1)}useSelectedItem(e){let t=this.values[this.selectedItem];t&&this.owner.selectSuggestion(t,e)}setSelectedItem(e,t){let n=Zb(e,this.suggestions.length),r=this.suggestions[this.selectedItem],i=this.suggestions[n];r?.removeClass(`is-selected`),i?.addClass(`is-selected`),this.selectedItem=n,t&&i.scrollIntoView(!1)}},$b=class{inputEl;placement=`bottom-start`;popper;scope;suggestEl;suggest;_boundInputChanged;_boundClose;_isOpen=!1;cb;constructor(e,t){this.inputEl=e,this.scope=new f.Scope,this.cb=t,this.suggestEl=createDiv(`suggestion-container`);let n=this.suggestEl.createDiv(`suggestion`);this.suggest=new Qb(this,n,this.scope),this.scope.register([],`Escape`,this.close.bind(this)),this._boundInputChanged=this.onInputChanged.bind(this),this._boundClose=this.close.bind(this),this.inputEl.addEventListener(`input`,this._boundInputChanged),this.inputEl.addEventListener(`focus`,this._boundInputChanged),this.inputEl.addEventListener(`click`,this._boundInputChanged),this.inputEl.addEventListener(`blur`,this._boundClose),this.suggestEl.on(`mousedown`,`.suggestion-container`,e=>{e.preventDefault()})}get isOpen(){return this._isOpen}clearInput(){this.inputEl.value=``,this.inputEl.trigger(`blur`),this.inputEl.trigger(`focus`),this.inputEl.trigger(`input`),this.onInputChanged()}onInputChanged(){let e=this.inputEl.value,t=this.getSuggestions(e);if(!t){this.close();return}t.length>0?(this.suggest.setSuggestions(t),this.open(app.dom.appContainerEl,this.inputEl)):this.close()}open(e,t){app.keymap.pushScope(this.scope),e.appendChild(this.suggestEl),this.popper=jb(t,this.suggestEl,{placement:this.placement,modifiers:[{name:`sameWidth`,enabled:!0,fn:({state:e,instance:t})=>{let n=`${e.rects.reference.width}px`;e.styles.popper.width!==n&&(e.styles.popper.width=n,t.update())},phase:`beforeWrite`,requires:[`computeStyles`]}]}),this._isOpen=!0}close(){app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach(),this._isOpen=!1}destroy(){this.inputEl.removeEventListener(`input`,this._boundInputChanged),this.inputEl.removeEventListener(`focus`,this._boundInputChanged),this.inputEl.removeEventListener(`click`,this._boundInputChanged),this.inputEl.removeEventListener(`blur`,this._boundClose),this.close()}updateCb(e){this.cb=e}};H();var ex=e=>{let t=e.metadataCache.getTags();return[...Object.keys(t)].map(e=>e.split(`#`).pop())},tx=class extends $b{fuzzySearchItemsOptimized(e,t){let n=(0,f.prepareFuzzySearch)(e);return t.map(e=>{let t=n(e);return t?{item:e,match:t,score:t.score}:null}).sort((e,t)=>t?.score-e?.score).filter(Boolean)}getSuggestions(e){let{settings:t,app:n}=L.getState(),r=e.toLocaleLowerCase(),i=t.UseVaultTags?ex(n):V.getState().tags;return this.fuzzySearchItemsOptimized(r,i).map(e=>e.item)}renderSuggestion(e,t){t.toggleClass(`thino-image-suggest-item`,!0),t.createSpan({cls:`suggestion-name`,text:e})}selectSuggestion(e){this.inputEl.value=e,this.cb&&this.cb(e),this.inputEl.dispatchEvent(new Event(`change`)),this.inputEl.trigger(`change`),this.close()}};function nx({allItems:e,initialCount:t=50,loadMoreCount:n=50,enabled:r=!0,onLoadMore:i}){let[a,o]=(0,U.useState)(t),[s,c]=(0,U.useState)(!1),l=(0,U.useRef)(null),u=(0,U.useRef)(!1),d=e.slice(0,a),f=a<e.length,p=(0,U.useCallback)(()=>{!f||u.current||(u.current=!0,c(!0),requestAnimationFrame(()=>{o(Math.min(a+n,e.length)),c(!1),u.current=!1,i?.()}))},[f,a,n,e.length,i]),m=(0,U.useCallback)(()=>{o(t),c(!1),u.current=!1},[t]);return(0,U.useEffect)(()=>{e.length<a&&m()},[e.length,a,m]),(0,U.useEffect)(()=>{if(!r||!l.current||!f)return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&!u.current&&p()},{root:null,rootMargin:`200px`,threshold:.01});return e.observe(l.current),()=>{e.disconnect()}},[r,f,p]),{displayedItems:d,hasMore:f,loadingMore:s,sentinelRef:l,loadMore:p,reset:m}}var rx=!0;function ix(e,t){if(!rx){if(e)return;var n=`Warning: `+t;typeof console<`u`&&console.warn(n);try{throw Error(n)}catch{}}}var ax=class extends Error{constructor(e){super(`react-collapsed: ${e}`)}},ox=(...e)=>ix(e[0],`[react-collapsed] -- ${e[1]}`);function sx(e){let t=(0,U.useRef)(e);return(0,U.useEffect)(()=>{t.current=e}),(0,U.useCallback)((...e)=>t.current?.(...e),[])}function cx(e,t,n){let[r,i]=(0,U.useState)(t),a=(0,U.useRef)(e!==void 0),o=a.current?e:r,s=sx(n),c=(0,U.useCallback)(e=>{let t=typeof e==`function`?e(o):e;a.current||i(t),s?.(t)},[s,o]);return(0,U.useEffect)(()=>{ox(!(a.current&&e==null),"`isExpanded` state is changing from controlled to uncontrolled. useCollapse should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled collapse for the lifetime of the component. Check the `isExpanded` prop."),ox(!(!a.current&&e!=null),"`isExpanded` state is changing from uncontrolled to controlled. useCollapse should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled collapse for the lifetime of the component. Check the `isExpanded` prop.")},[e]),[o,c]}var lx=`(prefers-reduced-motion: reduce)`;function ux(){let[e,t]=(0,U.useState)(!1);return(0,U.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(lx);t(e.matches);let n=e=>{t(e.matches)};if(e.addEventListener)return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)};if(e.addListener)return e.addListener(n),()=>{e.removeListener(n)}},[]),e}var dx=U.useId||(()=>void 0);function fx(){return dx()??``}var px=typeof window<`u`?U.useLayoutEffect:U.useEffect,mx=!1,hx=0,gx=()=>++hx;function _x(e){let t=e||(mx?gx():null),[n,r]=U.useState(t);return px(()=>{n===null&&r(gx())},[]),U.useEffect(()=>{mx===!1&&(mx=!0)},[]),n==null?void 0:String(n)}function vx(e){let t=fx(),n=_x(e);return typeof e==`string`?e:typeof t==`string`?t:n}function yx(e,t){let n=performance.now(),r={};function i(){r.id=requestAnimationFrame(r=>{r-n>t?e():i()})}return i(),r}function bx(e){e.id&&cancelAnimationFrame(e.id)}function xx(e){return e?.current?e.current.scrollHeight:(ox(!0,"Was not able to find a ref to the collapse element via `getCollapseProps`. Ensure that the element exposes its `ref` prop. If it exposes the ref prop under a different name (like `innerRef`), use the `refKey` property to change it. Example:\n\nconst collapseProps = getCollapseProps({refKey: 'innerRef'})"),0)}function Sx(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function Cx(e,t){if(e!=null)if(typeof e==`function`)e(t);else try{e.current=t}catch{throw new ax(`Cannot assign value "${t}" to ref "${e}"`)}}function wx(...e){return e.every(e=>e==null)?null:t=>{e.forEach(e=>{Cx(e,t)})}}function Tx(e){let t=e=>{};t=e=>{if(!e?.current)return;let{paddingTop:t,paddingBottom:n}=window.getComputedStyle(e.current);ox(!(t&&t!==`0px`||n&&n!==`0px`),`Padding applied to the collapse element will cause the animation to break and not perform as expected. To fix, apply equivalent padding to the direct descendent of the collapse element. Example:
|
||
|
||
Before: <div {...getCollapseProps({style: {padding: 10}})}>{children}</div>
|
||
|
||
After: <div {...getCollapseProps()}>
|
||
<div style={{padding: 10}}>
|
||
{children}
|
||
</div>
|
||
</div>`)},(0,U.useEffect)(()=>{t(e)},[e])}var Ex=typeof window>`u`?U.useEffect:U.useLayoutEffect;function Dx({duration:e,easing:t=`cubic-bezier(0.4, 0, 0.2, 1)`,onTransitionStateChange:n=()=>{},isExpanded:r,defaultExpanded:i=!1,hasDisabledAnimation:a,id:o,...s}={}){let c=sx(n),l=vx(o?`${o}`:void 0),[u,d]=cx(r,i),f=(0,U.useRef)(u),[p,m]=(0,U.useState)(!1),h=ux(),g=a??h,_=(0,U.useRef)(),v=(0,U.useRef)(),y=(0,U.useRef)(null),[b,x]=(0,U.useState)(null);Tx(y);let S=`${s.collapsedHeight||0}px`;function C(e){if(!y.current)return;let t=y.current;for(let n in e){let r=e[n];r?t.style[n]=r:t.style.removeProperty(n)}}return Ex(()=>{if(!y.current||u===f.current)return;f.current=u;function n(t){return g?0:e??Sx(t)}let r=e=>`height ${n(e)}ms ${t}`,i=e=>{function t(){u?(C({height:``,overflow:``,transition:``,display:``}),c(`expandEnd`)):(C({transition:``}),c(`collapseEnd`)),m(!1)}v.current&&bx(v.current),v.current=yx(t,e)};return m(!0),u?_.current=requestAnimationFrame(()=>{c(`expandStart`),C({display:`block`,overflow:`hidden`,height:S}),_.current=requestAnimationFrame(()=>{c(`expanding`);let e=xx(y);i(n(e)),y.current&&(y.current.style.transition=r(e),y.current.style.height=`${e}px`)})}):_.current=requestAnimationFrame(()=>{c(`collapseStart`);let e=xx(y);i(n(e)),C({transition:r(e),height:`${e}px`}),_.current=requestAnimationFrame(()=>{c(`collapsing`),C({height:S,overflow:`hidden`})})}),()=>{_.current&&cancelAnimationFrame(_.current),v.current&&bx(v.current)}},[u,S,g,e,t,c]),{isExpanded:u,setExpanded:d,getToggleProps(e){let{disabled:t,onClick:n,refKey:r,...i}={refKey:`ref`,onClick(){},disabled:!1,...e},a=b?b.tagName===`BUTTON`:void 0,o=e?.[r||`ref`],s={id:`react-collapsed-toggle-${l}`,"aria-controls":`react-collapsed-panel-${l}`,"aria-expanded":u,onClick(e){t||(n?.(e),d(e=>!e))},[r||`ref`]:wx(o,x)},c={type:`button`,disabled:t?!0:void 0},f={"aria-disabled":t?!0:void 0,role:`button`,tabIndex:t?-1:0};return a===!1?{...s,...f,...i}:a===!0?{...s,...c,...i}:{...s,...c,...f,...i}},getCollapseProps(e){let{style:t,refKey:n}={refKey:`ref`,style:{},...e},r=e?.[n||`ref`];return{id:`react-collapsed-panel-${l}`,"aria-hidden":!u,"aria-labelledby":`react-collapsed-toggle-${l}`,role:`region`,...e,[n||`ref`]:wx(y,r),style:{boxSizing:`border-box`,...!p&&!u?{display:S===`0px`?`none`:`block`,height:S,overflow:`hidden`}:{},...t}}}}}Wr(),Qr(),H(),Or(),N(),Aa();var Ox=(0,U.memo)(({memoId:e,showOutgoingLinks:t=!0,showIncomingLinks:n=!0})=>{let[r,i]=(0,U.useState)([]),[a,o]=(0,U.useState)([]),[s,c]=(0,U.useState)(null),[l,u]=(0,U.useState)(!1),[d,p]=(0,U.useState)(!1),m=(0,U.useRef)(null);(0,U.useEffect)(()=>{!s&&!l&&!d&&(u(!0),(async()=>{let t=V.getMemoById(e);t&&c(t),u(!1)})())},[e,s,l,d]),(0,U.useEffect)(()=>{s&&!d&&!l&&(u(!0),(async()=>{try{if(t){let e=[],t=[...s.content.matchAll(Br)];for(let n of t)if(n&&n.length===3){let t=n[2],r=V.getMemoById(t);r&&e.push({...r,createdAtStr:P.getDateTimeString(r.createdAt),dateStr:P.getDateString(r.createdAt)})}let n=va(s.content);for(let t of n){let[n,r]=t.split(`#^`),i=r;if(n&&i){let t=await V.getLinkedMemoByBlockId(i,n);t&&(e.some(e=>e.id===t.id)||e.push({...t,createdAtStr:P.getDateTimeString(t.createdAt),dateStr:P.getDateString(t.createdAt)}))}}i([...e])}if(n){let e=await V.getLinkedMemos(s.id),t=[];s.hasId&&s.path&&(t=await V.getLinkedMemosByLinkId(s.hasId,s.path));let n=[...e,...t];o(Array.from(new Map(n.map(e=>[e.id,e])).values()).sort((e,t)=>P.getTimeStampByDate(t.createdAt)-P.getTimeStampByDate(e.createdAt)).map(e=>({...e,createdAtStr:P.getDateTimeString(e.createdAt),dateStr:P.getDateString(e.createdAt)})))}p(!0)}catch(e){console.error(`Error fetching linked memos:`,e)}u(!1)})())},[s,t,n,d,l]);let h=(0,U.useCallback)(e=>{Fx(e)},[]);return(0,W.jsxs)(`div`,{className:u_(`reference-links-group`,l?`loading`:`loaded`),ref:m,children:[l&&(0,W.jsx)(`div`,{className:`links-loading`,children:(0,W.jsx)(`span`,{className:`loading-text`,children:M(`Loading...`)})}),d&&(0,W.jsxs)(W.Fragment,{children:[t&&r.length>0&&(0,W.jsx)(`div`,{className:`links-section outgoing-links`,children:(0,W.jsx)(`div`,{className:`links-list`,children:r.map(e=>{let t=Tr(Jr(e.content)).replaceAll(`
|
||
`,` `);return(0,W.jsxs)(`div`,{"aria-label":`${M(`Linked`)} ${e.content}`,className:`link-item`,onClick:()=>h(e),children:[(0,W.jsx)(`div`,{className:`link-icon`,ref:e=>e&&(0,f.setIcon)(e,`circle-dot`)}),(0,W.jsxs)(`div`,{className:`link-date`,children:[e.dateStr,`:`]}),(0,W.jsx)(`div`,{className:`link-content`,children:t})]},e.id)})})}),n&&a.length>0&&(0,W.jsx)(`div`,{className:`links-section incoming-links`,children:(0,W.jsx)(`div`,{className:`links-list`,children:a.map(e=>{let t=Tr(Jr(e.content)).replaceAll(`
|
||
`,` `);return(0,W.jsxs)(`div`,{"aria-label":`${M(`Linked by`)} ${e.content}`,className:`link-item`,onClick:()=>h(e),children:[(0,W.jsx)(`div`,{className:`link-icon`,ref:e=>e&&(0,f.setIcon)(e,`circle-dot-dashed`)}),(0,W.jsxs)(`div`,{className:`link-date`,children:[e.dateStr,`:`]}),(0,W.jsx)(`div`,{className:`link-content`,children:t})]},e.id)})})}),d&&!l&&r.length===0&&a.length===0&&null]})]})},(e,t)=>e.memoId===t.memoId&&e.showIncomingLinks===t.showIncomingLinks&&e.showOutgoingLinks===t.showOutgoingLinks);vi(),N();var kx=new Set,Ax=`█`;function jx(e,t){if(!t?.enableSecretMasking||!t?.secretContentRegex)return!1;try{return new RegExp(t.secretContentRegex).test(e)}catch{return!1}}var Mx=(0,U.memo)(e=>{let{app:t,view:n,settings:r}=I(),{memoListView:i}=si(),{getCollapseProps:a,getToggleProps:o,isExpanded:s,setExpanded:c}=Dx({defaultExpanded:!0,collapsedHeight:r?.ThinoCollapsedHeight??100}),{memo:l,handleMemoContentClick:u,handleMemoDoubleClick:d}=e,p=U.useRef(null),[m,h]=U.useState(``),g=U.useRef(m),_=U.useRef(0),[v,y]=U.useState(!1),[b,x]=U.useState(!1),[S,C]=U.useState(!1),w=U.useRef(``),T=(0,f.debounce)((e,t,n)=>{for(let r of e){let{height:e}=r.contentRect,i=e>(t?.ThinoMaxHeight||340);y(i),c(!i),n.disconnect()}},500);(0,U.useEffect)(()=>{if(l.content!==g.current){if(r?.OptimizeForCallout&&l.content.split(`> [!`).length>3&&l.content.split(`
|
||
`).length>10&&!b){let e=p.current.createEl(`button`);e.setText(M(`Render content`)),e.onclick=async()=>{x(!0),await E()};let t=p.current.createEl(`textarea`);t.setText(l.content),t.disabled=!0,p.current?.toggleClass([`raw-content`],!0),c(!0),y(!1);return}E()}},[l.content]),(0,U.useEffect)(()=>{b&&_.current!==r?.ThinoMaxHeight&&(p?.current.hasChildNodes()&&x(!1),E())},[r?.ThinoMaxHeight]),(0,U.useEffect)(()=>{if(!b)return;let e=p.current;if(!e)return;if(!r?.ThinoMaxHeight){c(!0),y(!1);return}let t=new ResizeObserver(e=>{console.log(`resizeObserver`),T(e,r,t)});return t.observe(e),()=>t.disconnect()},[b]),(0,U.useEffect)(()=>{e.lockVersion===void 0||e.lockVersion===0||O()},[e.lockVersion]);let E=async()=>{p.current&&n&&t&&l.content!==g.current&&(p.current.empty(),await f.MarkdownRenderer.render(t,l.content,p.current,l.path,n),(p.current?.querySelectorAll(`.internal-link`))?.forEach(e=>{let r=e,i=r.getAttribute(`data-href`);i&&(t.metadataCache.getFirstLinkpathDest(i,l.path)||e.classList.add(`is-unresolved`),r.addEventListener(`mouseover`,e=>{e.stopPropagation(),t.workspace.trigger(`hover-link`,{event:e,source:`thino`,hoverParent:n.containerEl,targetEl:r,linktext:i,sourcePath:r.href})}))})),g.current=l.content,p.current?.toggleClass([`markdown-rendered`],!0),p.current?.toggleClass([`raw-content`],!1),x&&x(!0),_.current=r?.ThinoMaxHeight||340,O()},D=()=>{if(!r?.enableSecretMasking||!r?.secretContentRegex||!(0,f.requireApiVersion)(`1.11.4`)||kx.has(l.id))return!1;try{return new RegExp(r.secretContentRegex).test(l.content)}catch{return!1}},O=()=>{if(!p.current||!D()){C(!1);return}if(C(!0),(r?.secretMaskingStyle||`blur`)===`blur`)p.current.classList.add(`secret-masked-blur`);else{w.current=p.current.innerHTML;let e=p.current.textContent?.length||20;p.current.innerHTML=``,p.current.textContent=Ax.repeat(Math.min(e,80)),p.current.classList.add(`secret-masked-block`)}},k=async n=>{!S||!t||(n.stopPropagation(),n.preventDefault(),new Nx(t,n=>{try{if(n===t.secretStorage.getSecret(`thino-secret-masking-password`)){if(kx.add(l.id),C(!1),e.onReveal?.(),!p.current)return;(r?.secretMaskingStyle||`blur`)===`blur`?p.current.classList.remove(`secret-masked-blur`):(p.current.innerHTML=w.current,p.current.classList.remove(`secret-masked-block`))}else new f.Notice(M(`Incorrect password`))}catch{new f.Notice(M(`Incorrect password`))}}).open())};return(0,W.jsxs)(W.Fragment,{children:[v&&i===`moments`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{className:`thino-collapse-button`,...o({style:{display:`block`,marginTop:2}}),children:M(s?`Collapse`:`Expand`)}),!s&&r?.ThinoCollapsedHeight!==0&&(0,W.jsx)(`div`,{className:`thino-collapse-shadowOverlay`,onDoubleClick:d})]}),(0,W.jsxs)(`div`,{style:{position:`relative`},children:[(0,W.jsx)(`div`,{...a({style:{margin:0}}),ref:p,className:`memo-content-text`,onClick:e=>u(e,l),onDoubleClick:d,onContextMenu:e=>{e.preventDefault()}}),S&&(0,W.jsx)(`div`,{className:`secret-mask-overlay`,onClick:k,"aria-label":M(`Click to reveal secret content`),children:(0,W.jsx)(`span`,{className:`secret-mask-icon`,children:`🔒`})})]}),i===`list`&&r?.enableReferenceLinksGroup&&(0,W.jsx)(Ox,{memoId:l.id}),v&&i!==`moments`&&(0,W.jsxs)(W.Fragment,{children:[!s&&r?.ThinoCollapsedHeight!==0&&(0,W.jsx)(`div`,{className:`thino-collapse-shadowOverlay`,onDoubleClick:d}),(0,W.jsx)(`button`,{className:`thino-collapse-button`,...o({style:{display:`block`,marginTop:2}}),children:M(s?`Collapse`:`Expand`)})]})]})},(e,t)=>e.memo.content===t.memo.content&&e.lockVersion===t.lockVersion),Nx=class extends f.Modal{onSubmit;constructor(e,t){super(e),this.onSubmit=t}onOpen(){let{contentEl:e}=this;this.titleEl.setText(M(`Enter password to reveal`));let t=e.createEl(`input`,{type:`password`,placeholder:M(`Enter password`),cls:`thino-secret-password-input`});t.style.width=`100%`,t.style.marginBottom=`12px`;let n=e.createDiv(`button-group`),r=n.createEl(`button`,{text:M(`Cancel`)}),i=n.createEl(`button`,{text:M(`Confirm`),cls:`mod-cta`});r.onclick=()=>this.close(),i.onclick=()=>{this.onSubmit(t.value),this.close()},t.addEventListener(`keydown`,e=>{e.key===`Enter`&&(this.onSubmit(t.value),this.close())}),setTimeout(()=>t.focus(),50)}onClose(){this.contentEl.empty()}};Wr(),Qr(),H(),Or(),N(),Aa();var Px=e=>{let[t,n]=(0,U.useState)({...e.memo,createdAtStr:P.getDateTimeString(e.memo.createdAt)}),[r,i]=(0,U.useState)([]),[a,o]=(0,U.useState)([]);(0,U.useEffect)(()=>{(async()=>{try{let e=[],n=[...t.content.matchAll(Br)];for(let t of n)if(t&&t.length===3){let n=t[2],r=V.getMemoById(n);r&&e.push({...r,createdAtStr:P.getDateTimeString(r.createdAt),dateStr:P.getDateString(r.createdAt)})}let r=va(t.content);for(let t of r){let[n,r]=t.split(`#^`),i=r;if(n&&i){let t=await V.getLinkedMemoByBlockId(i,n);t&&(e.some(e=>e.id===t.id)||e.push({...t,createdAtStr:P.getDateTimeString(t.createdAt),dateStr:P.getDateString(t.createdAt)}))}}i([...e]);let a=await V.getLinkedMemos(t.id),s=[];t.hasId&&t.path&&(s=await V.getLinkedMemosByLinkId(t.hasId,t.path));let c=[...a,...s];o(Array.from(new Map(c.map(e=>[e.id,e])).values()).sort((e,t)=>P.getTimeStampByDate(t.createdAt)-P.getTimeStampByDate(e.createdAt)).map(e=>({...e,createdAtStr:P.getDateTimeString(e.createdAt),dateStr:P.getDateString(e.createdAt)})))}catch(e){console.error(`Error fetching linked memos:`,e)}})()},[t.id,t.hasId,t.path]);let s=(0,U.useCallback)(async e=>{let t=e.target;if(t.className===`memo-link-text`){let e=t.dataset?.value,r=V.getMemoById(e??``);if(r){let e={...r,createdAtStr:P.getDateTimeString(r.createdAt)};i([]),o([]),n(e)}else new f.Notice(M(`Thino not found`)),t.classList.remove(`memo-link-text`)}},[]),c=(0,U.useCallback)(e=>{i([]),o([]),n({...e,createdAtStr:P.getDateTimeString(e.createdAt)})},[t.id]),l=(0,U.useCallback)(()=>{e.destroy(),R.setEditMemoId(t.id)},[t.id]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`memo-card-container`,children:[(0,W.jsxs)(`div`,{className:`header-container`,children:[(0,W.jsx)(`span`,{className:`time-text`,children:t.createdAtStr}),(0,W.jsxs)(`div`,{className:`btns-container`,children:[(0,W.jsx)(`button`,{ref:e=>{e&&(0,f.setIcon)(e,`edit`)},className:`btn edit-btn`,onClick:l}),(0,W.jsx)(`button`,{ref:e=>{e&&(0,f.setIcon)(e,`x`)},className:`btn close-btn`,onClick:e.destroy})]})]}),(0,W.jsx)(`div`,{className:`memo-container`,children:(0,W.jsx)(`div`,{className:`memo-content-text`,children:(0,W.jsx)(Mx,{memo:t,handleMemoContentClick:s,handleMemoDoubleClick:()=>{}})})}),(0,W.jsx)(`div`,{className:`layer-container`})]}),r.length>0?(0,W.jsxs)(`div`,{className:`linked-memos-wrapper`,children:[(0,W.jsxs)(`span`,{className:`normal-text`,children:[M(`LINKED`),` `,r.length,` THINO`,` `]}),r.map(e=>{let t=Tr(Jr(e.content)).replaceAll(`
|
||
`,` `);return(0,W.jsxs)(`div`,{className:`linked-memo-container`,onClick:()=>c(e),children:[(0,W.jsxs)(`span`,{className:`time-text`,children:[e.dateStr,` `]}),t]},e.id)})]}):null,a.length>0?(0,W.jsxs)(`div`,{className:`linked-memos-wrapper`,children:[(0,W.jsxs)(`span`,{className:`normal-text`,children:[a.length,` THINO `,M(`LINK TO THE`),` THINO`]}),a.map(e=>{let t=Tr(Jr(e.content)).replaceAll(`
|
||
`,` `);return(0,W.jsxs)(`div`,{className:`linked-memo-container`,onClick:()=>c(e),children:[(0,W.jsxs)(`span`,{className:`time-text`,children:[e.dateStr,` `]}),t]},e.id)})]}):null]})};function Fx(e){t_({className:`memo-card-dialog`},Px,{memo:e})}H(),N();var Ix=new Map,Lx=async(e,t=!0)=>{let{vault:n,metadataCache:r}=L.getState().app;if(t&&Ix.has(e))return Promise.resolve(Ix.get(e));if(e.contains(`data:image`))return e;let i,a=await n.adapter.exists((0,f.normalizePath)(e)),o=``;try{if(!a&&!/(http|https)/g.test(e)&&!e.includes(`data:image`)){let t;if(e.startsWith(`app://`)){let t=(0,f.normalizePath)(decodeURIComponent(e).replace(f.Platform.resourcePathPrefix,``).replace(/\?(.*)$/,``).replace((0,f.normalizePath)(app?.vault.adapter.basePath),``));o=(0,f.normalizePath)(decodeURIComponent(t))}else{if(t=r.getFirstLinkpathDest(e,``),!t){new f.Notice(M(`File not exist`));return}o=t.path}}else o=e}catch(e){console.error(e)}if(o){if(!/(http|https)/g.test(o)){if(o){let e=await n.adapter.readBinary(o),t=new Uint8Array(e);i=new Blob([t],{type:`image/png`}),console.log(i)}}else if(o.startsWith(`http://localhost`)){let e=o;e=e.replace(`http://localhost/_capacitor_file_`,``),e=decodeURIComponent(e).replace(/\?(.*)$/,``).replace(app?.vault.adapter.basePath,``),e=(0,f.normalizePath)(decodeURIComponent(e));let t=await n.adapter.readBinary(e),r=new Uint8Array(t);i=new Blob([r],{type:`image/png`})}else try{let t=await(0,f.requestUrl)(e);console.log(e,t);let n=new Uint8Array(t.arrayBuffer);i=new Blob([n],{type:`image/png`}),console.log(i)}catch(e){console.log(`error in grabReleaseFileFromRepository`,URL,e)}return i?await Rx(i,e):``}},Rx=(e,t)=>new Promise(n=>{let r=new FileReader;r.onloadend=()=>{let e=r.result;Ix.set(t,e),n(e)},r.readAsDataURL(e)}),zx=async e=>{if(!e.style.backgroundImage.includes(`url(`)&&!e.style.backgroundImage.includes(`http`))return;let t=e.style.backgroundImage.includes(`url(`)?e.style.backgroundImage.slice(5,-2):e.style.backgroundImage;if(t)return t.startsWith(`http://localhost`)&&(t=t.replace(`http://localhost/_capacitor_file_`,``),t=decodeURIComponent(t).replace(/\?(.*)$/,``).replace(app?.vault.adapter.basePath,``),t=(0,f.normalizePath)(decodeURIComponent(t))),await Lx(t)},Bx=async e=>{if(e.getAttribute(`src`))return e?.src?.startsWith(`http://localhost`)?await Lx(e.getAttribute(`path`)||(0,f.normalizePath)(e?.parentElement.getAttribute(`src`))):await Lx(e.getAttribute(`src`))},Vx=cS(),Hx=lS(),Ux=uS(),Wx=dS(),Gx={copyDefaultStyles:!0,imagePlaceholder:void 0,cacheBust:!1,useCredentials:!1,httpTimeout:3e4,styleCaching:`strict`,corsImg:void 0},Kx={toSvg:Xx,toPng:Qx,toJpeg:$x,toBlob:eS,toPixelData:Zx,toCanvas:tS,impl:{fontFaces:Ux,images:Wx,util:Vx,inliner:Hx,urlCache:[],options:{}}},qx=(typeof Node<`u`?Node.ELEMENT_NODE:void 0)||1,Jx=(typeof globalThis<`u`?globalThis.getComputedStyle:void 0)||(typeof window<`u`?window.getComputedStyle:void 0)||globalThis.getComputedStyle,Yx=(typeof globalThis<`u`?globalThis.atob:void 0)||(typeof window<`u`?window.atob:void 0)||globalThis.atob;function Xx(e,t){let n=Kx.impl.util.getWindow(e);t||={},nS(t);let r=[];return Promise.resolve(e).then(i).then(function(e){return aS(e,t,null,n)}).then(oS).then(sS).then(s).then(c).then(a).then(o);function i(e){if(e.nodeType===qx)return e;let t=e,n=e.parentNode,i=document.createElement(`span`);return n.replaceChild(i,t),i.append(e),r.push({parent:n,child:t,wrapper:i}),i}function a(e){for(;r.length>0;){let e=r.pop();e.parent.replaceChild(e.child,e.wrapper)}return e}function o(e){return Kx.impl.urlCache=[],yS(),e}function s(e){t.bgcolor&&(e.style.backgroundColor=t.bgcolor),t.width&&(e.style.width=`${t.width}px`),t.height&&(e.style.height=`${t.height}px`),t.style&&Object.keys(t.style).forEach(function(n){e.style[n]=t.style[n]});let n=null;return typeof t.onclone==`function`&&(n=t.onclone(e)),Promise.resolve(n).then(function(){return e})}function c(e){let n=t.width||Vx.width(e),r=t.height||Vx.height(e);return Promise.resolve(e).then(function(e){return e.setAttribute(`xmlns`,`http://www.w3.org/1999/xhtml`),new XMLSerializer().serializeToString(e)}).then(Vx.escapeXhtml).then(function(e){let t=(Vx.isDimensionMissing(n)?` width="100%"`:` width="${n}"`)+(Vx.isDimensionMissing(r)?` height="100%"`:` height="${r}"`);return`<svg xmlns="http://www.w3.org/2000/svg"${(Vx.isDimensionMissing(n)?``:` width="${n}"`)+(Vx.isDimensionMissing(r)?``:` height="${r}"`)}><foreignObject${t}>${e}</foreignObject></svg>`}).then(function(e){return`data:image/svg+xml;charset=utf-8,${e}`})}}function Zx(e,t){return rS(e,t).then(function(t){return t.getContext(`2d`).getImageData(0,0,Vx.width(e),Vx.height(e)).data})}function Qx(e,t){return rS(e,t).then(function(e){return e.toDataURL()})}function $x(e,t){return rS(e,t).then(function(e){return e.toDataURL(`image/jpeg`,(t?t.quality:void 0)||1)})}function eS(e,t){return rS(e,t).then(Vx.canvasToBlob)}function tS(e,t){return rS(e,t)}function nS(e){e.copyDefaultStyles===void 0?Kx.impl.options.copyDefaultStyles=Gx.copyDefaultStyles:Kx.impl.options.copyDefaultStyles=e.copyDefaultStyles,e.imagePlaceholder===void 0?Kx.impl.options.imagePlaceholder=Gx.imagePlaceholder:Kx.impl.options.imagePlaceholder=e.imagePlaceholder,e.cacheBust===void 0?Kx.impl.options.cacheBust=Gx.cacheBust:Kx.impl.options.cacheBust=e.cacheBust,e.corsImg===void 0?Kx.impl.options.corsImg=Gx.corsImg:Kx.impl.options.corsImg=e.corsImg,e.useCredentials===void 0?Kx.impl.options.useCredentials=Gx.useCredentials:Kx.impl.options.useCredentials=e.useCredentials,e.httpTimeout===void 0?Kx.impl.options.httpTimeout=Gx.httpTimeout:Kx.impl.options.httpTimeout=e.httpTimeout,e.styleCaching===void 0?Kx.impl.options.styleCaching=Gx.styleCaching:Kx.impl.options.styleCaching=e.styleCaching,Kx.impl.options.requestUrl=e.requestUrl,Kx.impl.options.type=e.type||`image/png`}function rS(e,t){return t||={},Xx(e,t).then(Vx.makeImage).then(function(r){let i=typeof t.scale==`number`?t.scale:1,a=n(e,i),o=a.getContext(`2d`);return o.msImageSmoothingEnabled=!1,o.imageSmoothingEnabled=!1,r&&(o.scale(i,i),o.drawImage(r,0,0)),a});function n(e,n){let r=t.width||Vx.width(e),i=t.height||Vx.height(e);Vx.isDimensionMissing(r)&&(r=Vx.isDimensionMissing(i)?300:i*2),Vx.isDimensionMissing(i)&&(i=r/2);let a=document.createElement(`canvas`);if(a.width=r*n,a.height=i*n,t.bgcolor){let e=a.getContext(`2d`);e.fillStyle=t.bgcolor,e.fillRect(0,0,a.width,a.height)}return a}}var iS=null;function aS(e,t,n,r){let i=t.filter;if(e===iS||Vx.isHTMLScriptElement(e)||Vx.isHTMLStyleElement(e)||Vx.isHTMLLinkElement(e)||n!==null&&i&&!i(e))return Promise.resolve();return Promise.resolve(e).then(a).then(function(t){return s(t,o(e))}).then(function(t){return c(t,e)});function a(e){return Vx.isHTMLCanvasElement(e)?Vx.makeImage(e.toDataURL()):e.cloneNode(!1)}function o(e){return Vx.isElementHostForOpenShadowRoot(e)?e.shadowRoot:e}function s(e,n){let i=s(n),a=Promise.resolve();if(i.length!==0){let s=Jx(o(n));Vx.asArray(i).forEach(function(n){a=a.then(function(){return aS(n,t,s,r).then(function(t){t&&e.appendChild(t)})})})}return a.then(function(){return e});function o(e){return Vx.isShadowRoot(e)?e.host:e}function s(e){return Vx.isShadowSlotElement(e)?e.assignedNodes():e.childNodes}}function c(e,r){if(!Vx.isElement(e)||Vx.isShadowSlotElement(r))return Promise.resolve(e);return Promise.resolve().then(i).then(a).then(o).then(s).then(function(){return e});function i(){a(r,e);function i(e,t){t.font=e.font,t.fontFamily=e.fontFamily,t.fontFeatureSettings=e.fontFeatureSettings,t.fontKerning=e.fontKerning,t.fontSize=e.fontSize,t.fontStretch=e.fontStretch,t.fontStyle=e.fontStyle,t.fontVariant=e.fontVariant,t.fontVariantCaps=e.fontVariantCaps,t.fontVariantEastAsian=e.fontVariantEastAsian,t.fontVariantLigatures=e.fontVariantLigatures,t.fontVariantNumeric=e.fontVariantNumeric,t.fontVariationSettings=e.fontVariationSettings,t.fontWeight=e.fontWeight}function a(e,r){let a=Jx(e);a.cssText?(r.style.cssText=a.cssText,i(a,r.style)):(pS(t,e,a,n,r),n===null&&([`inset-block`,`inset-block-start`,`inset-block-end`].forEach(e=>r.style.removeProperty(e)),[`left`,`right`,`top`,`bottom`].forEach(e=>{r.style.getPropertyValue(e)&&r.style.setProperty(e,`0px`)})))}}function a(){let t=Vx.uid();[`:before`,`:after`].forEach(function(e){n(e)});function n(n){let i=Jx(r,n),a=i.getPropertyValue(`content`);if(a===``||a===`none`)return;let o=e.getAttribute(`class`)||``;e.setAttribute(`class`,`${o} ${t}`);let s=document.createElement(`style`);s.appendChild(c()),e.appendChild(s);function c(){let e=`.${t}:${n}`,r=i.cssText?o():s();return document.createTextNode(`${e}{${r}}`);function o(){return`${i.cssText} content: ${a};`}function s(){return`${Vx.asArray(i).map(e).join(`; `)};`;function e(e){return`${e}: ${i.getPropertyValue(e)}${i.getPropertyPriority(e)?` !important`:``}`}}}}}function o(){Vx.isHTMLTextAreaElement(r)&&(e.innerHTML=r.value),Vx.isHTMLInputElement(r)&&e.setAttribute(`value`,r.value)}function s(){Vx.isSVGElement(e)&&(e.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),Vx.isSVGRectElement(e)&&[`width`,`height`].forEach(function(t){let n=e.getAttribute(t);n&&e.style.setProperty(t,n)}))}}}function oS(e){return Ux.resolveAll().then(function(t){if(t!==``){let n=document.createElement(`style`);e.appendChild(n),n.appendChild(document.createTextNode(t))}return e})}function sS(e){return Wx.inlineAll(e).then(function(){return e})}function cS(){let e=0;return{escape:T,isDataUrl:_,canvasToBlob:b,resolveUrl:x,getAndEncode:w,uid:S,delay:E,asArray:D,escapeXhtml:O,makeImage:C,width:k,height:A,getWindow:t,isElement:a,isElementHostForOpenShadowRoot:n,isShadowRoot:r,isInShadowRoot:i,isHTMLElement:s,isHTMLCanvasElement:o,isHTMLInputElement:l,isHTMLImageElement:c,isHTMLLinkElement:u,isHTMLScriptElement:d,isHTMLStyleElement:f,isHTMLTextAreaElement:p,isShadowSlotElement:m,isSVGElement:h,isSVGRectElement:g,isDimensionMissing:v};function t(e){let t=e?e.ownerDocument:void 0;return(t?t.defaultView:void 0)||globalThis||window}function n(e){return a(e)&&e.shadowRoot!==null}function r(e){return e instanceof t(e).ShadowRoot}function i(e){return e!==null&&Object.prototype.hasOwnProperty.call(e,`getRootNode`)&&r(e.getRootNode())}function a(e){return e instanceof t(e).Element}function o(e){return e instanceof t(e).HTMLCanvasElement}function s(e){return e instanceof t(e).HTMLElement}function c(e){return e instanceof t(e).HTMLImageElement}function l(e){return e instanceof t(e).HTMLInputElement}function u(e){return e instanceof t(e).HTMLLinkElement}function d(e){return e instanceof t(e).HTMLScriptElement}function f(e){return e instanceof t(e).HTMLStyleElement}function p(e){return e instanceof t(e).HTMLTextAreaElement}function m(e){return i(e)&&e instanceof t(e).HTMLSlotElement}function h(e){return e instanceof t(e).SVGElement}function g(e){return e instanceof t(e).SVGRectElement}function _(e){return e.search(/^(data:)/)!==-1}function v(e){return isNaN(e)||e<=0}function y(e){return new Promise(function(t){let n=Yx(e.toDataURL().split(`,`)[1]),r=n.length,i=new Uint8Array(r);for(let e=0;e<r;e++)i[e]=n.charCodeAt(e);t(new Blob([i],{type:Kx.impl.options.type}))})}function b(e){return e.toBlob?new Promise(function(t){e.toBlob(t)}):y(e)}function x(e,t){let n=document.implementation.createHTMLDocument(),r=n.createElement(`base`);n.head.appendChild(r);let i=n.createElement(`a`);return n.body.appendChild(i),r.href=t,i.href=e,i.href}function S(){return`u${t()}${e++}`;function t(){return`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4)}}function C(e){return e===`data:,`?Promise.resolve():new Promise(function(t,n){let r=new Image;Kx.impl.options.useCredentials&&(r.crossOrigin=`use-credentials`),r.onload=function(){window&&window.requestAnimationFrame?window.requestAnimationFrame(function(){t(r)}):t(r)},r.onerror=n,r.src=e})}function w(e){let t=Kx.impl.urlCache.find(function(t){return t.url===e});return t||(t={url:e,promise:null},Kx.impl.urlCache.push(t)),t.promise===null&&(Kx.impl.options.cacheBust&&(e+=(/\?/.test(e)?`&`:`?`)+new Date().getTime()),Kx.impl.options.requestUrl&&/^http/.test(e)?t.promise=Kx.impl.options.requestUrl({url:e,method:`GET`}).then(e=>new Promise(t=>{let n=new FileReader;n.onload=function(e){t(e.target.result)},n.readAsDataURL(new Blob([e.arrayBuffer],{type:e.headers[`content-type`]}))})).catch(t=>(console.error(`cannot fetch resource: `+e+`, error: `+t),``)):t.promise=new Promise(function(t){let n=Kx.impl.options.httpTimeout,r=new XMLHttpRequest;if(r.onreadystatechange=a,r.ontimeout=o,r.responseType=`blob`,r.timeout=n,Kx.impl.options.useCredentials&&(r.withCredentials=!0),Kx.impl.options.corsImg&&e.indexOf(`http`)===0&&e.indexOf(window.location.origin)===-1){let t=(Kx.impl.options.corsImg.method||`GET`).toUpperCase()===`POST`?`POST`:`GET`;r.open(t,(Kx.impl.options.corsImg.url||``).replace(`#{cors}`,e),!0);let n=!1,i=Kx.impl.options.corsImg.headers||{};Object.keys(i).forEach(function(e){i[e].indexOf(`application/json`)!==-1&&(n=!0),r.setRequestHeader(e,i[e])});let a=s(Kx.impl.options.corsImg.data||``);Object.keys(a).forEach(function(t){typeof a[t]==`string`&&(a[t]=a[t].replace(`#{cors}`,e))}),r.send(n?JSON.stringify(a):a)}else r.open(`GET`,e,!0),r.send();let i;if(Kx.impl.options.imagePlaceholder){let e=Kx.impl.options.imagePlaceholder.split(/,/);e&&e[1]&&(i=e[1])}function a(){if(r.readyState!==4)return;if(r.status>=300){i?t(i):c(`cannot fetch resource: ${e}, status: ${r.status}`);return}let n=new FileReader;n.onloadend=function(){t(n.result)},n.readAsDataURL(r.response)}function o(){i?t(i):c(`timeout of ${n}ms occured while fetching resource: ${e}`)}function s(e){try{return JSON.parse(JSON.stringify(e))}catch{c(`corsImg.data is missing or invalid`);return}}function c(e){console.error(e),t(``)}})),t.promise}function T(e){return e.replace(/([.*+?^${}()|[]\/\\])/g,`\\$1`)}function E(e){return function(t){return new Promise(function(n){setTimeout(function(){n(t)},e)})}}function D(e){let t=[],n=e.length;for(let r=0;r<n;r++)t.push(e[r]);return t}function O(e){return e.replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/\n/g,`%0A`)}function k(e){let t=j(e,`width`);if(!isNaN(t))return t;let n=j(e,`border-left-width`),r=j(e,`border-right-width`);return e.scrollWidth+n+r}function A(e){let t=j(e,`height`);if(!isNaN(t))return t;let n=j(e,`border-top-width`),r=j(e,`border-bottom-width`);return e.scrollHeight+n+r}function j(e,t){if(e.nodeType===qx){let n=Jx(e).getPropertyValue(t);if(n.slice(-2)===`px`)return n=n.slice(0,-2),parseFloat(n)}return NaN}}function lS(){let e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:i,shouldProcess:t,impl:{readUrls:n,inline:r}};function t(t){return t.search(e)!==-1}function n(t){let n=[],r;for(;(r=e.exec(t))!==null;)n.push(r[1]);return n.filter(function(e){return!Vx.isDataUrl(e)})}function r(e,t,n,r){return Promise.resolve(t).then(function(e){return n?Vx.resolveUrl(e,n):e}).then(r||Vx.getAndEncode).then(function(n){return e.replace(i(t),`$1${n}$3`)});function i(e){return RegExp(`(url\\(['"]?)(${Vx.escape(e)})(['"]?\\))`,`g`)}}function i(e,i,a){if(o())return Promise.resolve(e);return Promise.resolve(e).then(n).then(function(t){let n=Promise.resolve(e);return t.forEach(function(e){n=n.then(function(t){return r(t,e,i,a)})}),n});function o(){return!t(e)}}}function uS(){return{resolveAll:e,impl:{readAll:t}};function e(){return t().then(function(e){return Promise.all(e.map(function(e){return e.resolve()}))}).then(function(e){return e.join(`
|
||
`)})}function t(){return Promise.resolve(Vx.asArray(document.styleSheets)).then(t).then(e).then(function(e){return e.map(n)});function e(e){return e.filter(function(e){return e.type===CSSRule.FONT_FACE_RULE}).filter(function(e){return Hx.shouldProcess(e.style.getPropertyValue(`src`))})}function t(e){let t=[];return e.forEach(function(e){if(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(e),`cssRules`))try{Vx.asArray(e.cssRules||[]).forEach(t.push.bind(t))}catch(t){console.error(`domtoimage: Error while reading CSS rules from ${e.href}`,t.toString())}}),t}function n(e){return{resolve:function(){let t=(e.parentStyleSheet||{}).href;return Hx.inlineAll(e.cssText,t)},src:function(){return e.style.getPropertyValue(`src`)}}}}}function dS(){return{inlineAll:t,impl:{newImage:e}};function e(e){return{inline:t};function t(t){return Vx.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(t||Vx.getAndEncode).then(function(t){return new Promise(function(n){e.onload=n,e.onerror=n,e.src=t})})}}function t(n){if(!Vx.isElement(n))return Promise.resolve(n);return r(n).then(function(){return Vx.isHTMLImageElement(n)?e(n).inline():Promise.all(Vx.asArray(n.childNodes).map(function(e){return t(e)}))});function r(e){let t=[`background`,`background-image`].map(function(t){let n=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return n?Hx.inlineAll(n).then(function(n){e.style.setProperty(t,n,r)}):Promise.resolve()});return Promise.all(t).then(function(){return e})}}}function fS(e,t,n,r){let i=[`background-clip`].indexOf(t)>=0;r?(e.setProperty(t,n,r),i&&e.setProperty(`-webkit-${t}`,n,r)):(e.setProperty(t,n),i&&e.setProperty(`-webkit-${t}`,n))}function pS(e,t,n,r,i){let a=Kx.impl.options.copyDefaultStyles?_S(e,t):{},o=i.style;Vx.asArray(n).forEach(function(e){let t=n.getPropertyValue(e),i=a[e],s=r?r.getPropertyValue(e):void 0;(t!==i||r&&t!==s)&&fS(o,e,t,n.getPropertyPriority(e))})}var mS=null,hS={},gS=`ADDRESS.ARTICLE.ASIDE.BLOCKQUOTE.DETAILS.DIALOG.DD.DIV.DL.DT.FIELDSET.FIGCAPTION.FIGURE.FOOTER.FORM.H1.H2.H3.H4.H5.H6.HEADER.HGROUP.HR.LI.MAIN.NAV.OL.P.PRE.SECTION.SVG.TABLE.UL.math.svg.BODY.HEAD.HTML`.split(`.`);function _S(e,t){let n=s(t),r=c(n);if(hS[r])return hS[r];let i=vS(),a=l(i.document,n),o=u(i,a);return d(a),hS[r]=o,o;function s(e){let t=[];do{if(e.nodeType===qx){let n=e.tagName;if(t.push(n),gS.includes(n))break}e=e.parentNode}while(e);return t}function c(t){return e.styleCaching===`relaxed`?t.filter((e,t,n)=>t===0||t===n.length-1).join(`>`):t.join(`>`)}function l(e,t){let n=e.body;do{let r=t.pop(),i=e.createElement(r);n.appendChild(i),n=i}while(t.length>0);return n.textContent=``,n}function u(e,t){let n={},r=e.getComputedStyle(t);return Vx.asArray(r).forEach(function(e){n[e]=e===`width`||e===`height`?`auto`:r.getPropertyValue(e)}),n}function d(e){do{let t=e.parentElement;t!==null&&t.removeChild(e),e=t}while(e&&e.tagName!==`BODY`)}}function vS(){if(iS)return iS.contentWindow;let e=document.characterSet||`UTF-8`,t=document.doctype,n=t?`<!DOCTYPE ${r(t.name)} ${r(t.publicId)} ${r(t.systemId)}`.trim()+`>`:``;return iS=document.createElement(`iframe`),iS.id=`domtoimage-sandbox-`+Vx.uid(),iS.className=`domtoimage-thino`,iS.style.visibility=`hidden`,iS.style.position=`fixed`,document.body.appendChild(iS),i(iS,n,e,`domtoimage-sandbox`);function r(e){if(e){let t=document.createElement(`div`);return t.innerText=e,t.innerHTML}else return``}function i(e,t,n,r){try{return e.contentWindow.document.write(`${t}<html><head><meta charset='${n}'><title>${r}</title></head><body></body></html>`),e.contentWindow}catch{}let i=document.createElement(`meta`);i.setAttribute(`charset`,n);try{let n=document.implementation.createHTMLDocument(r);n.head.appendChild(i);let a=t+n.documentElement.outerHTML;return e.setAttribute(`srcdoc`,a),e.contentWindow}catch{}return e.contentDocument.head.appendChild(i),e.contentDocument.title=r,e.contentWindow}}function yS(){iS&&=(document.body.removeChild(iS),null),mS&&clearTimeout(mS),mS=setTimeout(()=>{mS=null,hS={}},20*1e3)}async function bS(e,t,n){return await Kx.toCanvas(e,{width:e.clientWidth,height:e.clientHeight,quality:1,scale:t?2:1,requestUrl:f.requestUrl,type:n})}var xS=async(e,t)=>(console.log(t),(await bS(e,!0,`image/jpeg`)).toDataURL()),SS=({children:e,styles:t,className:n,onReady:r})=>{let i=(0,U.useRef)(null),[a,o]=(0,U.useState)(null);return(0,U.useLayoutEffect)(()=>{if(i.current&&!a){let e=i.current.attachShadow({mode:`open`}),n=document.head.querySelector(`link[href="app.css"]`);if(n){let t=n.cloneNode(!0);e.appendChild(t)}if(t){let n=document.createElement(`style`);n.textContent=t,e.appendChild(n)}o(e)}},[]),(0,U.useLayoutEffect)(()=>{a&&r&&requestAnimationFrame(()=>{r()})},[a,r]),(0,W.jsx)(`div`,{ref:i,className:n,style:{display:`contents`},children:a&&(0,Nb.createPortal)(e,a)})},CS=`.theme-light{--memos-masonry-width:1400px;--memos-masonry-content-width:1000px;--memos-list-width:848px;--memos-list-content-width:600px;--memos-calendar-width:1200px;--memos-calendar-content-width:1000px;--memos-table-width:1200px;--memos-table-content-width:1000px;--memos-chat-width:1200px;--memos-chat-content-width:1000px;--memos-sidebar-width:260px;--memos-text-accent:var(--text-accent);--memos-text-accent-hover:var(--text-accent-hover);--memos-text-muted:var(--text-muted);--memos-text-faint:var(--text-faint);--memos-text-hover:var(--text-normal);--memos-accent:var(--memos-stat-day-L4-bg);--memos-accent-hover:var(--memos-stat-day-L3-bg);--memos-radius-s:2px;--memos-radius-m:var(--radius-s);--memos-radius-l:var(--radius-m);--memos-radius-xl:var(--radius-l);--memos-radius-full:var(--radius-xl);--memos-text-black:#37352f;--memos-text-gray:#52504b;--memos-text-lightgray:#d4d4d4;--memos-text-blue:#5783f7;--memos-text-unresolved-blue:#8fa2d6;--memos-text-green:#16a34a;--memos-text-red:#d28653;--memos-text-light-red:#d24c42;--memos-memo-bg:var(--color-base-00);--memos-memo-bg-primary:var(--color-base-30);--memos-memo-modal-bg:var(--background-modifier-cover);--memos-more-action-bg:var(--memos-memo-bg);--memos-location-wrapper-bg:var(--memos-memo-bg);--memos-memo-border:var(--color-base-20);--memos-memo-bg-hover:var(--background-modifier-hover);--memos-dialog-cover:var(--background-modifier-cover);--memos-memo-border-hover:var(--background-modifier-border-hover);--memos-memo-shadow:0 0 8px 0 rgba(0,0,0,.2);--memos-memo-shadow-s:0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);--memos-share-memo-shadow-webkit:15px 15px 27px #e1e1e3, -15px -15px 27px #fff;--memos-share-memo-shadow:15px 15px 27px #c1c1c1, -15px -15px 27px #e2e2e2;--memos-time-text-color:var(--memos-bg-whitegray);--memos-editor-save-btn-bg:var(--memos-text-green);--memos-editor-save-btn-color:var(--memos-bg-lightgray);--memos-editor-suggest-color:var(--memos-text-green);--memos-filter-bg:var(--memos-bg-gray);--memos-filter-hover-filter:contrast(1) brightness(1) invert(.5);--memos-filter-save-btn-bg:var(--memos-text-green);--memos-bg-black:#2f3437;--memos-bg-gray:#e4e4e4;--memos-bg-whitegray:#f8f8f8;--memos-bg-searchbar-lightgray:var(--background-secondary);--memos-bg-lightgray:#eaeaea;--memos-bg-blue:#3b82f6;--memos-bg-yellow:yellow;--memos-bg-light-blue:#eef3fe;--memos-bg-paper-yellow:#fbf4de;--memos-bg-accent:var(--color-accent);--memos-icon:var(--color-base-20);--memos-icon-hover:var(--color-base-30);--memos-show-editor-btn:opacity(30%);--memos-stat-day-L0-bg:var(--color-base-10);--rdp-border-color:#9b9b9b;--rdp-text-color:var(--text-muted);--rdp-cell-size:40px;--rdp-accent-color:#00f;--rdp-background-color:#e7edff;--rdp-accent-color-dark:#3003e1;--rdp-background-color-dark:#180270;--rdp-outline:2px solid var(--rdp-accent-color);--rdp-outline-selected:2px solid rgba(0,0,0,.75);--thino-text-on-accent:var(--text-on-accent);--thino-modern-primary:var(--thino-background-muted);--thino-modern-secondary:var(--thino-background-primary);--thino-setting-border:var(--color-base-40);--thino-modern-text-faint:var(--color-base-50);--thino-modern-text-faint-hover:var(--color-base-70);--thino-button-text-faint:var(--color-base-20);--thino-divider:var(--color-base-10);--thino-divider-hover:var(--color-base-30);--thino-wrapper-border:var(--color-base-20);--thino-wrapper-border-hover:var(--color-base-60);--thino-button-background:var(--color-base-30);--thino-wrapper-background:var(--color-base-60);--thino-wrapper-background-hover:var(--color-base-30);--thino-background-primary:var(--background-primary);--thino-background-secondary:var(--background-secondary);--thino-background-primary-alt:var(--background-primary-alt);--thino-modifier-cover:var(--background-modifier-cover);--thino-modifier-hover:var(--background-modifier-hover);--thino-modifier-border:var(--background-modifier-border);--thino-modifier-border-hover:var(--background-modifier-border-hover);--thino-ui-small:14px;--thino-ui-tiny:10px;--thino-share-background-color:rgba(255,255,255,.5)}.theme-dark{--memos-masonry-width:1400px;--memos-masonry-content-width:1000px;--memos-list-width:848px;--memos-list-content-width:600px;--memos-calendar-width:1200px;--memos-calendar-content-width:1000px;--memos-table-width:1200px;--memos-table-content-width:1000px;--memos-chat-width:1200px;--memos-chat-content-width:1000px;--memos-sidebar-width:260px;--memos-text-accent:var(--text-accent);--memos-text-accent-hover:var(--text-accent-hover);--memos-text-muted:var(--text-muted);--memos-text-hover:var(--text-normal);--memos-text-faint:var(--text-faint);--memos-text-green:#35e06f;--memos-accent:var(--memos-stat-day-L3-bg);--memos-accent-hover:var(--memos-stat-day-L4-bg);--memos-radius-s:2px;--memos-radius-m:var(--radius-s);--memos-radius-l:var(--radius-m);--memos-radius-xl:var(--radius-l);--memos-radius-full:var(--radius-xl);--memos-text-black:#d2d1cd;--memos-text-gray:#c7c4bb;--memos-text-lightgray:#525252;--memos-text-blue:#bbbec7;--memos-text-unresolved-blue:#8c92a1;--memos-text-red:#940b01;--memos-text-light-red:#d24c42;--memos-memo-bg:var(--background-secondary);--memos-memo-bg-primary:var(--color-base-30);--memos-bg-searchbar-lightgray:var(--background-modifier-hover);--memos-memo-modal-bg:var(--background-modifier-cover);--memos-more-action-bg:var(--memos-memo-bg-primary);--memos-location-wrapper-bg:var(--memos-memo-bg-primary);--memos-memo-bg-hover:var(--background-modifier-hover);--memos-dialog-cover:var(--background-modifier-cover);--memos-memo-border:var(--color-base-20);--memos-memo-border-hover:var(--background-modifier-border-hover);--memos-memo-shadow:0 0 8px 0 rgba(0,0,0,.2);--memos-memo-shadow-s:0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);--memos-share-memo-shadow-webkit:15px 15px 27px #666, -15px -15px 27px #3a3a3a;--memos-share-memo-shadow:6px 4px 4px 2px #383333, 5px 2px 4px 2px #444;--memos-time-text-color:#b9b9b9;--memos-editor-save-btn-bg:var(--memos-text-red);--memos-editor-save-btn-color:var(--memos-text-hover);--memos-editor-suggest-color:var(--memos-text-red);--memos-filter-bg:var(--memos-memo-bg);--memos-filter-hover-filter:contrast(1) brightness(1) invert(.9);--memos-filter-save-btn-bg:var(--memos-text-red);--memos-bg-black:#cacdcf;--memos-bg-gray:#353535;--memos-bg-whitegray:gray;--memos-bg-lightgray:#727171;--memos-bg-Search-lightgray:#302e2e;--memos-bg-blue:#1e3a8a;--memos-bg-yellow:#777;--memos-bg-light-blue:#6f8f9b;--memos-bg-paper-yellow:#5f5f5f;--memos-icon:var(--color-base-30);--memos-icon-hover:var(--color-base-40);--memos-bg-accent:var(--color-accent);--memos-show-editor-btn:invert(.8) opacity(65%);--memos-stat-day-L0-bg:var(--color-base-90);--rdp-border-color:#9b9b9b;--rdp-text-color:var(--text-muted);--rdp-dark-cell-size:40px;--rdp-dark-accent-color:#494949;--rdp-dark-background-color:#838383;--rdp-dark-accent-color-dark:#050505;--rdp-dark-background-color-dark:#7e7e7e;--rdp-dark-outline:2px solid var(--rdp-accent-color);--rdp-dark-outline-selected:2px solid rgba(255,255,255,.75);--thino-text-on-accent:var(--text-on-accent);--thino-layout-color-primary:var(--background-primary-alt);--thino-layout-color-secondary:var(--background-secondary);--thino-setting-border:var(--color-base-40);--thino-modern-text-faint:var(--color-base-50);--thino-modern-text-faint-hover:var(--color-base-70);--thino-button-text-faint:var(--color-base-20);--thino-divider:var(--color-base-10);--thino-divider-hover:var(--color-base-30);--thino-wrapper-border:var(--color-base-20);--thino-wrapper-border-hover:var(--color-base-60);--thino-button-background:var(--color-base-30);--thino-wrapper-background:var(--color-base-60);--thino-wrapper-background-hover:var(--color-base-30);--thino-background-primary:var(--background-primary);--thino-background-secondary:var(--background-secondary);--thino-background-primary-alt:var(--background-primary-alt);--thino-modifier-cover:var(--background-modifier-cover);--thino-modifier-hover:var(--background-modifier-hover);--thino-modifier-border:var(--background-modifier-border);--thino-modifier-border-hover:var(--background-modifier-border-hover);--thino-ui-small:14px;--thino-ui-tiny:10px;--thino-share-background-color:rgba(45,45,45,0);--thino-modern-primary:var(--thino-background-secondary);--thino-modern-secondary:var(--thino-background-secondary)}.theme-light .heatmap-default{--memos-stat-day-L1-bg:#9be9a8;--memos-stat-day-L2-bg:#40c463;--memos-stat-day-L3-bg:#30a14e;--memos-stat-day-L4-bg:#216e39}.theme-dark .heatmap-default{--memos-stat-day-L4-bg:#f75205;--memos-stat-day-L3-bg:#e03a07;--memos-stat-day-L2-bg:#bf2104;--memos-stat-day-L1-bg:#940b01}.theme-light .heatmap-gray{--memos-stat-day-L1-bg:#a09da6;--memos-stat-day-L2-bg:#7d7986;--memos-stat-day-L3-bg:#464251;--memos-stat-day-L4-bg:#26222e}.theme-dark .heatmap-gray{--memos-stat-day-L1-bg:#26222e;--memos-stat-day-L2-bg:#464251;--memos-stat-day-L3-bg:#7d7986;--memos-stat-day-L4-bg:#a09da6}.theme-light .heatmap-grass{--memos-stat-day-L1-bg:#a0eaab;--memos-stat-day-L2-bg:#40c463;--memos-stat-day-L3-bg:#30a14e;--memos-stat-day-L4-bg:#216e39}.theme-dark .heatmap-grass{--memos-stat-day-L4-bg:#9be9a8;--memos-stat-day-L3-bg:#40c463;--memos-stat-day-L2-bg:#30a14e;--memos-stat-day-L1-bg:#216e39}.theme-light .heatmap-flame{--memos-stat-day-L1-bg:#f75205;--memos-stat-day-L2-bg:#e03a07;--memos-stat-day-L3-bg:#bf2104;--memos-stat-day-L4-bg:#940b01}.theme-dark .heatmap-flame{--memos-stat-day-L4-bg:#f75205;--memos-stat-day-L3-bg:#e03a07;--memos-stat-day-L2-bg:#bf2104;--memos-stat-day-L1-bg:#940b01}.theme-light .heatmap-olive{--memos-stat-day-L1-bg:#9cc069;--memos-stat-day-L2-bg:#78a851;--memos-stat-day-L3-bg:#648b3f;--memos-stat-day-L4-bg:#4f6e30}.theme-dark .heatmap-olive{--memos-stat-day-L4-bg:#9cc069;--memos-stat-day-L3-bg:#78a851;--memos-stat-day-L2-bg:#648b3f;--memos-stat-day-L1-bg:#4f6e30}.theme-light .heatmap-ice{--memos-stat-day-L1-bg:#82bbf0;--memos-stat-day-L2-bg:#5da2eb;--memos-stat-day-L3-bg:#3889e6;--memos-stat-day-L4-bg:#126fe0}.theme-dark .heatmap-ice{--memos-stat-day-L4-bg:#82bbf0;--memos-stat-day-L3-bg:#5da2eb;--memos-stat-day-L2-bg:#3889e6;--memos-stat-day-L1-bg:#126fe0}.theme-light .heatmap-magenta{--memos-stat-day-L1-bg:#fa9fb5;--memos-stat-day-L2-bg:#ea4e9c;--memos-stat-day-L3-bg:#ae017e;--memos-stat-day-L4-bg:#610070}.theme-dark .heatmap-magenta{--memos-stat-day-L4-bg:#fa9fb5;--memos-stat-day-L3-bg:#ea4e9c;--memos-stat-day-L2-bg:#ae017e;--memos-stat-day-L1-bg:#610070}.mono-font-family{font-family:ubuntu-mono,SFMono-Regular,Menlo,Consolas,PT Mono,Liberation Mono,Courier,monospace}.hide-scroll-bar::-webkit-scrollbar{cursor:pointer;width:0;height:0}.hide-scroll-bar::-webkit-scrollbar-thumb{background-color:#d5d5d5;border-radius:8px;width:0;height:0}.hide-scroll-bar::-webkit-scrollbar-thumb:hover{background-color:#ccc}.hide-scroll-bar::-webkit-scrollbar{display:none}.share-memo-image-dialog{--dialog-width-desktop:1000px;--dialog-height-desktop:85vh;--panel-width:360px;--card-width:400px;--card-min-height:500px;--transition-fast:.15s ease;--transition-medium:.3s ease;--transition-slow:.5s ease-out;--shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--shadow-md:0 4px 6px -1px rgba(0,0,0,.1);--shadow-lg:0 10px 15px -3px rgba(0,0,0,.1);--shadow-xl:0 20px 25px -5px rgba(0,0,0,.1);--shadow-2xl:0 25px 50px -12px rgba(0,0,0,.25);--card-bg:rgba(255,255,255,.9);--card-text:#334155;--card-font:var(--font-interface);--card-font-size:16px;--card-radius:16px;--card-shadow:var(--shadow-xl);--card-padding:40px;--card-border:1px solid rgba(255,255,255,.5);--card-blur:12px}.share-memo-image-dialog .custom-scrollbar::-webkit-scrollbar{width:4px;height:4px}.share-memo-image-dialog .custom-scrollbar::-webkit-scrollbar-track{background:0 0}.share-memo-image-dialog .custom-scrollbar::-webkit-scrollbar-thumb{background-color:var(--background-modifier-border);border-radius:20px}.share-memo-image-dialog .custom-scrollbar:hover::-webkit-scrollbar-thumb{background-color:var(--text-muted)}.share-memo-image-dialog>.dialog-container{width:var(--dialog-width-desktop);max-width:95vw;height:var(--dialog-height-desktop);background-color:var(--background-primary);max-height:95vh;box-shadow:var(--shadow-2xl);border:1px solid var(--background-modifier-border);animation:dialogSlideIn var(--transition-medium) ease-out;border-radius:16px;flex-direction:row;padding:0;display:flex;overflow:hidden}@keyframes dialogSlideIn{0%{opacity:0;transform:scale(.95)translateY(10px)}to{opacity:1;transform:scale(1)translateY(0)}}.share-memo-image-dialog>.dialog-container>.dialog-header-container{display:none}.share-memo-image-dialog>.dialog-container>.dialog-content-container{flex-direction:row;justify-content:flex-start;align-items:stretch;width:100%;height:100%;display:flex;position:relative}.share-preview-area{background-color:var(--background-secondary);flex:1;justify-content:center;align-items:center;padding:40px;display:flex;position:relative;overflow:hidden}.share-preview-area:before{content:"";background-image:radial-gradient(var(--background-modifier-border) 1px, transparent 1px);opacity:.5;pointer-events:none;background-size:20px 20px;position:absolute;top:0;bottom:0;left:0;right:0}.share-preview-area .style-indicator{-webkit-backdrop-filter:blur(8px);color:#fff;letter-spacing:.05em;z-index:20;pointer-events:none;box-shadow:var(--shadow-lg);transition:all var(--transition-medium);background-color:rgba(0,0,0,.75);border-radius:999px;padding:6px 16px;font-size:12px;font-weight:500;position:absolute;top:24px;left:50%;transform:translate(-50%)}.share-preview-area .preview-nav-btn{z-index:30;box-shadow:var(--shadow-lg);color:var(--text-normal);border:1px solid var(--background-modifier-border);cursor:pointer;transition:all var(--transition-medium) cubic-bezier(.4, 0, .2, 1);opacity:0;height:var(--size-4-10);width:var(--size-4-10);border-radius:50%;padding:14px;position:absolute;top:50%;transform:translateY(-50%)scale(.9)}.share-preview-area .preview-nav-btn.prev{left:24px}.share-preview-area .preview-nav-btn.next{right:24px}.share-preview-area .preview-nav-btn:hover{background-color:var(--interactive-accent);color:var(--text-on-accent);box-shadow:var(--shadow-xl);border-color:transparent;transform:translateY(-50%)scale(1.1)}.share-preview-area .preview-nav-btn svg{width:20px;height:20px}.share-preview-area:hover .preview-nav-btn{opacity:1;transform:translateY(-50%)scale(1)}.share-preview-area .mobile-back-btn{display:none}.memo-share-card-wrapper{transition:transform var(--transition-slow);justify-content:center;align-items:center;display:flex;position:relative}.memo-share-card-wrapper>.memo-shortcut-img{z-index:100;border-radius:var(--card-radius);cursor:pointer;width:100%;height:auto;transition:transform var(--transition-fast);position:absolute;top:0;left:0}.memo-share-card-wrapper>.memo-shortcut-img:hover{transform:scale(1.01)}.memo-share-card{width:var(--card-width);min-height:var(--card-min-height);border-radius:var(--card-radius);background-color:var(--card-bg);box-shadow:var(--card-shadow);color:var(--card-text);font-family:var(--card-font);transition:all var(--transition-slow);position:relative;overflow:hidden}.memo-share-card .card-bg-layer{z-index:0;border-radius:inherit;position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden}.memo-share-card .card-bg-layer .bg-image{background-position:50%;background-repeat:repeat;width:100%;height:100%}.memo-share-card .card-content-layer{z-index:10;height:100%;min-height:inherit;padding:var(--card-padding);-webkit-backdrop-filter:blur(var(--card-blur));border-radius:inherit;background-color:var(--card-bg);flex-direction:column;display:flex;position:relative}.memo-share-card .card-content-layer .card-header{align-items:center;gap:12px;margin-bottom:32px;display:flex}.memo-share-card .card-content-layer .card-header.center{justify-content:center}.memo-share-card .card-content-layer .card-header .avatar{background-position:50%;background-size:cover;border:2px solid rgba(255,255,255,.5);border-radius:50%;justify-content:center;align-items:center;width:32px;min-width:32px;height:32px;font-size:12px;font-weight:700;display:flex}.memo-share-card .card-content-layer .card-header .avatar:has(svg){border:1px solid var(--background-modifier-border)}.memo-share-card .card-content-layer .card-header .avatar svg{opacity:.6;width:16px;height:16px}.memo-share-card .card-content-layer .card-header .user-meta{flex-direction:column;display:flex}.memo-share-card .card-content-layer .card-header .user-meta .from-label{text-transform:uppercase;letter-spacing:.05em;opacity:.6;margin-bottom:2px;font-size:12px;font-weight:700;line-height:1}.memo-share-card .card-content-layer .card-header .user-meta .username{font-size:14px;font-weight:700;line-height:1.25}.memo-share-card .card-content-layer .card-body{font-size:var(--card-font-size);word-break:break-word;flex:1;padding:0;line-height:1.7}.memo-share-card .card-content-layer .card-body .card-title{font-weight:700;font-size:calc(var(--card-font-size) * 1.4);margin-bottom:16px;line-height:1.3}.memo-share-card .card-content-layer .card-body img{max-width:100%;box-shadow:var(--shadow-sm);border-radius:8px;margin:8px 0}.memo-share-card .card-content-layer .card-body blockquote{opacity:.85;border-left:3px solid;margin-left:0;padding-left:1em;font-style:italic}.memo-share-card .card-content-layer .card-body ul,.memo-share-card .card-content-layer .card-body ol{padding-left:1.5em}.memo-share-card .card-content-layer .card-body code{background:rgba(0,0,0,.05);border-radius:4px;padding:2px 6px;font-size:.9em}.memo-share-card .card-content-layer .card-body pre{background:rgba(0,0,0,.05);border-radius:8px;padding:12px;overflow-x:auto}.memo-share-card .card-content-layer .card-body .tag{opacity:.6;box-shadow:unset;border:unset;margin-right:8px;font-size:12px}.memo-share-card .card-content-layer .card-timestamp{opacity:.5;font-size:12px;font-family:var(--font-monospace);justify-content:flex-end;margin-top:16px;display:flex}.memo-share-card .card-content-layer .card-footer{border-top:1px dashed rgba(128,128,128,.2);justify-content:space-between;align-items:flex-end;gap:16px;margin-top:auto;padding-top:20px;display:flex}.memo-share-card .card-content-layer .card-footer .footer-left{flex-direction:column;gap:8px;font-size:12px;display:flex}.memo-share-card .card-content-layer .card-footer .footer-left .footer-text{opacity:.5}.memo-share-card .card-content-layer .card-footer .footer-right{opacity:.6;letter-spacing:.02em;align-items:center;gap:8px;font-size:14px;font-weight:600;display:flex}.memo-share-card .card-content-layer .card-footer .footer-logo{opacity:.8;justify-content:center;align-items:center;width:40px;height:40px;display:flex}.memo-share-card .card-content-layer .card-footer .footer-logo .logo-placeholder{opacity:.1;background:currentColor;border-radius:8px;justify-content:center;align-items:center;width:100%;height:100%;display:flex}.memo-share-card .card-content-layer .card-footer .footer-logo .logo-placeholder:after{content:"";opacity:.5;background:currentColor;border-radius:50%;width:50%;height:50%}.memo-share-card .card-content-layer .card-footer .footer-logo .qr-placeholder{border:1px solid;justify-content:center;align-items:center;width:100%;height:100%;padding:4px;display:flex}.memo-share-card .card-content-layer .card-footer .footer-logo .qr-placeholder svg{width:100%;height:100%}.memo-share-card[data-theme=modern]{--card-bg:rgba(255,255,255,.9);--card-text:#334155;--card-radius:16px;--card-blur:12px}.memo-share-card[data-theme=modern] .card-content-layer:before{content:"";border-radius:inherit inherit 0 0;background:linear-gradient(90deg,#6366f1,#a855f7,#ec4899);height:4px;position:absolute;top:0;left:0;right:0}.memo-share-card[data-theme=vintage]{--card-bg:#fffbf0;--card-text:#5c4033;--card-radius:2px;--card-font:"Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;--card-blur:0;--card-border:none}.memo-share-card[data-theme=vintage] .card-content-layer{border:4px double rgba(139,90,43,.3)}.memo-share-card[data-theme=vintage] .ancient-corner{opacity:.6;z-index:20;border-style:solid;border-color:#8b5a2b;width:16px;height:16px;position:absolute}.memo-share-card[data-theme=vintage] .ancient-corner.top-left{border-width:2px 0 0 2px;top:8px;left:8px}.memo-share-card[data-theme=vintage] .ancient-corner.top-right{border-width:2px 2px 0 0;top:8px;right:8px}.memo-share-card[data-theme=vintage] .ancient-corner.bottom-left{border-width:0 0 2px 2px;bottom:8px;left:8px}.memo-share-card[data-theme=vintage] .ancient-corner.bottom-right{border-width:0 2px 2px 0;bottom:8px;right:8px}.memo-share-card[data-theme=vintage] .inner-border{pointer-events:none;z-index:15;border:1px solid rgba(139,90,43,.1);position:absolute;top:8px;bottom:8px;left:8px;right:8px}.memo-share-card[data-theme=vintage] .card-body{line-height:1.8}.memo-share-card[data-theme=vintage] .card-footer{border-top-color:rgba(139,90,43,.2)}.memo-share-card[data-theme=cyber]{--card-bg:#1e293b;--card-text:#4ade80;--card-radius:8px;--card-blur:0;--card-shadow:none;--card-border:1px solid rgba(74,222,128,.2)}.memo-share-card[data-theme=cyber] .card-content-layer{background-color:var(--card-bg)}.memo-share-card[data-theme=cyber] .cyber-dots{opacity:.3;gap:4px;display:flex;position:absolute;top:8px;right:8px}.memo-share-card[data-theme=cyber] .cyber-dots .dot{background:currentColor;border-radius:50%;width:4px;height:4px}.memo-share-card[data-theme=cyber] .card-footer{border-top-color:rgba(74,222,128,.2)}.memo-share-card[data-theme=cyber] code{background:rgba(74,222,128,.1)}.memo-share-card[data-theme=outline]{--card-bg:#fff;--card-text:#000;--card-radius:0;--card-blur:0;--card-shadow:none;--card-border:3px solid #000}.memo-share-card[data-theme=outline] .card-content-layer{-webkit-backdrop-filter:none}.memo-share-card[data-theme=classic-gradient]{--card-bg:rgba(255,255,255,.95);--card-text:#1e293b;--card-radius:16px;--card-blur:12px}.memo-share-card[data-theme=nordic]{--card-bg:#fff;--card-text:#334155;--card-radius:12px;--card-blur:0;--card-shadow:0 4px 6px -1px rgba(0,0,0,.05)}.memo-share-card[data-theme=nordic] .card-content-layer{border-left:6px solid #d4a373}.memo-share-card[data-theme=nordic] .nordic-dot{background-color:#d4a373;border-radius:50%;width:8px;height:8px;position:absolute;top:40px;right:40px}.memo-share-card[data-theme=nordic] .card-header{border-bottom:1px solid #f1f5f9;margin-bottom:36px;padding-bottom:20px}.memo-share-card[data-theme=nordic] .card-body{font-weight:300;line-height:1.8}.memo-share-card[data-theme=japanese]{--card-bg:#fdfbf7;--card-text:#2c2c2c;--card-radius:2px;--card-font:"Hiragino Mincho ProN", "Yu Mincho", "SimSun", serif;--card-shadow:0 2px 8px rgba(0,0,0,.06)}.memo-share-card[data-theme=japanese] .card-content-layer{background-image:radial-gradient(#e5e5e5 1px,transparent 0);background-size:40px 40px;padding-right:70px!important}.memo-share-card[data-theme=japanese] .japanese-decor{pointer-events:none}.memo-share-card[data-theme=japanese] .japanese-decor .stamp{opacity:.15;z-index:0;border:2px solid #ef4444;border-radius:50%;width:50px;height:50px;position:absolute;bottom:40px;right:24px}.memo-share-card[data-theme=japanese] .japanese-decor .stamp:after{content:"メモ";color:#ef4444;writing-mode:vertical-rl;justify-content:center;align-items:center;font-size:14px;font-weight:700;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.memo-share-card[data-theme=japanese] .japanese-decor .vertical-line{border-right:1px dashed #d1d5db;width:1px;position:absolute;top:48px;bottom:100px;right:24px}.memo-share-card[data-theme=social]{--card-bg:#fff;--card-text:#1e293b;--card-radius:24px;--card-shadow:0 20px 40px -10px rgba(0,0,0,.1)}.memo-share-card[data-theme=social] .card-header .avatar{background-clip:content-box;border:2px solid transparent;box-shadow:0 0 0 2px #fff,0 0 0 4px #d62976}.memo-share-card[data-theme=social] .card-footer{border-top:1px solid #f1f5f9;padding-top:16px}.memo-share-card[data-theme=social] .card-footer .footer-left{flex-direction:row;align-items:center;gap:16px;display:flex}.memo-share-card[data-theme=social] .card-footer .footer-left:before{content:"❤";color:#ef4444;font-size:18px}.memo-share-card[data-theme=social] .card-footer .footer-left:after{content:"💬";opacity:.6;filter:grayscale();font-size:16px}.memo-share-card[data-theme=magazine]{--card-bg:#fff;--card-text:#000;--card-radius:0}.memo-share-card[data-theme=magazine] .magazine-decor .top-bar,.memo-share-card[data-theme=magazine] .magazine-decor .bottom-bar{background:#000;position:absolute;left:20px;right:20px}.memo-share-card[data-theme=magazine] .magazine-decor .top-bar{height:8px;top:0}.memo-share-card[data-theme=magazine] .magazine-decor .bottom-bar{height:4px;bottom:0}.memo-share-card[data-theme=magazine] .magazine-decor .side-text{transform-origin:100% 0;letter-spacing:4px;white-space:nowrap;font-size:10px;font-weight:700;position:absolute;top:120px;right:12px;transform:rotate(90deg)}.memo-share-card[data-theme=magazine] .card-body{font-family:Times New Roman,Georgia,serif;font-size:1.1em}.memo-share-card[data-theme=magazine] .card-body p:first-of-type:first-letter{float:left;margin-right:8px;font-size:3.5em;font-weight:700;line-height:.8}.memo-share-card[data-theme=handwritten]{--card-bg:#fffbeb;--card-text:#4b5563;--card-border:2px solid rgba(0,0,0,.1);border-radius:255px 15px 225px/15px 225px 15px 255px!important}.memo-share-card[data-theme=handwritten] .tape-decoration{z-index:20;background-color:rgba(255,255,255,.6);border-left:2px dotted rgba(0,0,0,.1);border-right:2px dotted rgba(0,0,0,.1);width:120px;height:32px;position:absolute;top:-12px;left:50%;transform:translate(-50%)rotate(-2deg);box-shadow:0 2px 4px rgba(0,0,0,.1)}.memo-share-card[data-theme=handwritten] .card-body{font-family:Comic Sans MS,Chalkboard SE,cursive}.memo-share-card[data-theme=colorful]{--card-bg:rgba(255,255,255,.2);--card-text:#fff;--card-radius:20px;--card-blur:20px;--card-border:1px solid rgba(255,255,255,.4);--card-shadow:0 8px 32px 0 rgba(31,38,135,.37)}.memo-share-card[data-theme=colorful] .card-content-layer{text-shadow:0 1px 3px rgba(0,0,0,.2)}.memo-share-card[data-theme=colorful] .card-header,.memo-share-card[data-theme=colorful] .card-footer{border-color:rgba(255,255,255,.3)}.memo-share-card[data-theme=colorful] .avatar{border-color:rgba(255,255,255,.8)!important}.heatmap-display{opacity:.7;gap:3px;display:flex}.heatmap-display .heatmap-cell{width:12px;height:12px;transition:opacity var(--transition-fast);background-color:currentColor;border-radius:2px}.heatmap-display .heatmap-cell.level-0{opacity:.15}.heatmap-display .heatmap-cell.level-1{opacity:.35}.heatmap-display .heatmap-cell.level-2{opacity:.55}.heatmap-display .heatmap-cell.level-3{opacity:.75}.heatmap-display .heatmap-cell.level-4{opacity:1}.texture-decoration{opacity:.4;align-items:center;gap:8px;display:flex}.texture-decoration .line{background:currentColor;width:48px;height:1px}.texture-decoration .diamond{border:1px solid;width:8px;height:8px;transform:rotate(45deg)}.share-config-panel{width:var(--panel-width);background-color:var(--background-primary);border-left:1px solid var(--background-modifier-border);z-index:40;flex-direction:column;height:100%;display:flex}.share-config-panel .panel-header{border-bottom:1px solid var(--background-modifier-border);background:var(--background-primary);justify-content:space-between;align-items:center;padding:16px 20px;display:flex}.share-config-panel .panel-header .panel-title{align-items:center;gap:8px;margin:0;font-size:15px;font-weight:600;display:flex}.share-config-panel .panel-header .panel-title svg{width:18px;height:18px;color:var(--interactive-accent)}.share-config-panel .panel-header .close-btn{background:var(--background-secondary);color:var(--text-muted);cursor:pointer;transition:all var(--transition-fast);border-radius:50%;justify-content:center;align-items:center;padding:8px;display:flex}.share-config-panel .panel-header .close-btn:hover{color:var(--text-normal);background:var(--background-modifier-hover)}.share-config-panel .panel-header .close-btn svg{width:16px;height:16px}.share-config-panel .panel-content{flex:1;padding:20px 20px 100px;overflow-y:auto}.share-config-panel .panel-content .config-section{margin-bottom:28px}.share-config-panel .panel-content .config-section .section-title{color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em;align-items:center;gap:6px;margin-bottom:12px;font-size:11px;font-weight:700;display:flex}.share-config-panel .panel-content .config-section .section-title svg{width:14px;height:14px}.share-config-panel .panel-footer{border-top:1px solid var(--background-modifier-border);background:var(--background-secondary);flex-direction:column;gap:12px;padding:16px 20px;display:flex}.share-config-panel .panel-footer .action-buttons{gap:12px;display:flex}.share-config-panel .panel-footer .action-buttons .action-btn{cursor:pointer;transition:all var(--transition-fast);border:none;border-radius:10px;flex:1;justify-content:center;align-items:center;gap:8px;padding:12px 16px;font-size:13px;font-weight:600;display:flex}.share-config-panel .panel-footer .action-buttons .action-btn svg{width:16px;height:16px}.share-config-panel .panel-footer .action-buttons .action-btn.secondary{background-color:var(--background-primary);color:var(--text-normal)}.share-config-panel .panel-footer .action-buttons .action-btn.secondary:hover{background-color:var(--background-modifier-hover)}.share-config-panel .panel-footer .action-buttons .action-btn.primary{background-color:var(--text-normal);color:var(--background-primary);box-shadow:var(--shadow-lg);flex:1.5}.share-config-panel .panel-footer .action-buttons .action-btn.primary:hover{opacity:.9;transform:translateY(-1px)}.share-config-panel .panel-footer .action-buttons .action-btn.primary:active{transform:scale(.98)}.share-config-panel .panel-footer .action-buttons .action-btn:disabled{opacity:.5;cursor:not-allowed}.share-config-panel .panel-footer .export-message{text-align:center;color:var(--interactive-accent);font-size:12px;font-weight:500;animation:1s ease-in-out infinite pulse}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.config-tabs{background-color:var(--background-secondary);border-radius:8px;margin-bottom:16px;padding:4px;display:flex}.config-tabs.theme-presets{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}.config-tabs .tab-btn{color:var(--text-muted);cursor:pointer;transition:all var(--transition-fast);box-shadow:none;background:0 0;border:none;border-radius:6px;flex:1;padding:8px 12px;font-size:12px;font-weight:500}.config-tabs .tab-btn:hover{color:var(--text-normal)}.config-tabs .tab-btn.active{background-color:var(--background-primary);color:var(--interactive-accent);box-shadow:var(--shadow-sm)}.gradient-picker-grid{grid-template-columns:repeat(5,1fr);gap:8px;display:grid}.gradient-picker-grid .color-option{aspect-ratio:1;cursor:pointer;transition:all var(--transition-fast);border:2px solid transparent;border-radius:8px;position:relative}.gradient-picker-grid .color-option:hover{transform:scale(1.08)}.gradient-picker-grid .color-option.active{border-color:var(--interactive-accent);box-shadow:var(--shadow-md);transform:scale(1.1)}.gradient-picker-grid .color-option.active:after{content:"✓";color:#fff;background:rgba(0,0,0,.3);border-radius:6px;justify-content:center;align-items:center;font-size:14px;font-weight:700;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.gradient-picker-grid .color-option.upload-btn{border:2px dashed var(--background-modifier-border);color:var(--text-muted);justify-content:center;align-items:center;font-size:20px;display:flex}.gradient-picker-grid .color-option.upload-btn:hover{border-color:var(--interactive-accent);color:var(--interactive-accent)}.config-toggle{background:var(--background-secondary);border:1px solid var(--background-modifier-border);border-radius:8px;justify-content:space-between;align-items:center;margin-bottom:8px;padding:10px 12px;display:flex}.config-toggle .toggle-label{color:var(--text-normal);font-size:13px}.config-toggle .toggle-switch{background-color:var(--background-modifier-border);cursor:pointer;width:36px;height:20px;transition:background-color var(--transition-fast);border-radius:99px;position:relative}.config-toggle .toggle-switch .thumb{width:16px;height:16px;transition:transform var(--transition-fast);background-color:#fff;border-radius:50%;position:absolute;top:2px;left:2px;box-shadow:0 1px 3px rgba(0,0,0,.2)}.config-toggle .toggle-switch.active{background-color:var(--interactive-accent)}.config-toggle .toggle-switch.active .thumb{transform:translate(16px)}.config-slider .slider-header{justify-content:space-between;align-items:center;margin-bottom:8px;display:flex}.config-slider .slider-header .slider-label{color:var(--text-muted);font-size:12px}.config-slider .slider-header .slider-value{color:var(--text-normal);font-size:12px;font-weight:500}.config-slider input[type=range]{background:var(--background-modifier-border);-webkit-appearance:none;appearance:none;border-radius:2px;outline:none;width:100%;height:4px}.config-slider input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:var(--interactive-accent);cursor:pointer;width:16px;height:16px;transition:transform var(--transition-fast);border-radius:50%}.config-slider input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.1)}.config-slider input[type=range]::-moz-range-thumb{background:var(--interactive-accent);cursor:pointer;border:none;border-radius:50%;width:16px;height:16px}.config-select .select-label{color:var(--text-muted);margin-bottom:6px;font-size:12px;display:block}.config-select select{background:var(--background-primary);width:100%;color:var(--text-normal);cursor:pointer;transition:border-color var(--transition-fast);border-radius:6px;font-size:13px}.config-select select:focus{border-color:var(--interactive-accent);outline:none}.config-button-group{background:var(--background-secondary);border-radius:6px;padding:4px;display:flex}.config-button-group .group-btn{color:var(--text-muted);cursor:pointer;transition:all var(--transition-fast);box-shadow:none;background:0 0;border:none;border-radius:4px;flex:1;padding:6px 12px;font-size:12px}.config-button-group .group-btn:hover{color:var(--text-normal)}.config-button-group .group-btn.active{background:var(--background-primary);color:var(--interactive-accent);box-shadow:var(--shadow-sm)}.config-color-picker{align-items:center;gap:12px;display:flex}.config-color-picker .color-label{color:var(--text-muted);font-size:12px}.config-color-picker input[type=color]{cursor:pointer;background:0 0;border:none;border-radius:6px;width:32px;height:32px;padding:0}.config-color-picker input[type=color]::-webkit-color-swatch-wrapper{padding:0}.config-color-picker input[type=color]::-webkit-color-swatch{border:2px solid var(--background-modifier-border);border-radius:6px}.config-input .input-label{color:var(--text-muted);margin-bottom:6px;font-size:12px;display:block}.config-input input[type=text]{border:1px solid var(--background-modifier-border);background:var(--background-primary);width:100%;color:var(--text-normal);transition:border-color var(--transition-fast);border-radius:6px;padding:8px 12px;font-size:13px}.config-input input[type=text]:focus{border-color:var(--interactive-accent);outline:none}.config-input input[type=text]::placeholder{color:var(--text-muted)}.mobile-theme-switcher{display:none}.mobile-theme-switcher .theme-nav{grid-template-columns:1fr 1fr;gap:12px;display:grid}.mobile-theme-switcher .theme-nav .nav-btn{border:1px solid var(--background-modifier-border);background:var(--background-primary);color:var(--text-normal);cursor:pointer;transition:all var(--transition-fast);border-radius:8px;justify-content:center;align-items:center;gap:8px;padding:10px 16px;font-size:13px;font-weight:500;display:flex}.mobile-theme-switcher .theme-nav .nav-btn:active{background:var(--background-modifier-hover)}.mobile-theme-switcher .theme-nav .nav-btn svg{width:16px;height:16px}.mobile-theme-switcher .current-theme{text-align:center;color:var(--interactive-accent);background:rgba(var(--interactive-accent-rgb), .1);border-radius:6px;margin-top:8px;padding:6px 12px;font-size:12px;font-weight:500}@media (max-width:768px){.share-memo-image-dialog>.dialog-container{border:none;border-radius:0;flex-direction:column;width:100%;max-width:100%;height:100%;max-height:100%}.share-memo-image-dialog>.dialog-container>.dialog-content-container[data-step=edit] .share-preview-area{display:none}.share-memo-image-dialog>.dialog-container>.dialog-content-container[data-step=edit] .share-config-panel{display:flex}.share-memo-image-dialog>.dialog-container>.dialog-content-container[data-step=preview] .share-preview-area{height:100%;display:flex}.share-memo-image-dialog>.dialog-container>.dialog-content-container[data-step=preview] .share-config-panel{display:none}.share-memo-image-dialog>.dialog-container>.dialog-content-container[data-step=preview] .mobile-action-bar{display:flex}.share-memo-image-dialog .share-preview-area{height:calc(100% - 80px);padding:60px 16px 16px}.share-memo-image-dialog .share-preview-area .mobile-back-btn{z-index:30;backdrop-filter:blur(8px);color:var(--text-normal);box-shadow:var(--shadow-md);cursor:pointer;background:rgba(255,255,255,.9);border-radius:999px;align-items:center;gap:6px;padding:8px 12px;font-size:12px;font-weight:600;display:flex;position:absolute;top:16px;left:16px}.share-memo-image-dialog .share-preview-area .mobile-back-btn svg{width:14px;height:14px}.share-memo-image-dialog .share-preview-area .preview-nav-btn{display:none}.share-memo-image-dialog .share-preview-area .memo-share-card{max-width:360px;min-height:auto;width:100%!important}.share-memo-image-dialog .share-config-panel{border-left:none;border-radius:0;width:100%;height:100%;position:fixed;top:0;left:0}.share-memo-image-dialog .share-config-panel .panel-content{padding-bottom:160px}.share-memo-image-dialog .mobile-theme-switcher{display:block}.share-memo-image-dialog .mobile-action-bar{background:var(--background-primary);border-top:1px solid var(--background-modifier-border);z-index:50;width:100%;padding:16px;padding-bottom:calc(16px + env(safe-area-inset-bottom));gap:12px;display:none;position:fixed;bottom:0;left:0}.share-memo-image-dialog .mobile-action-bar .action-btn{cursor:pointer;border:none;border-radius:12px;flex:1;justify-content:center;align-items:center;gap:8px;padding:14px;font-size:14px;font-weight:600;display:flex}.share-memo-image-dialog .mobile-action-bar .action-btn svg{width:16px;height:16px}.share-memo-image-dialog .mobile-action-bar .action-btn.secondary{background:var(--background-primary);color:var(--text-normal)}.share-memo-image-dialog .mobile-action-bar .action-btn.primary{background:var(--interactive-accent);color:var(--text-on-accent);box-shadow:0 4px 12px rgba(var(--interactive-accent-rgb), .3);flex:2}.share-memo-image-dialog .mobile-action-bar .action-btn:active{transform:scale(.98)}.share-memo-image-dialog .mobile-preview-btn{background:var(--background-primary);border-top:1px solid var(--background-modifier-border);z-index:50;width:100%;padding:16px;padding-bottom:calc(16px + env(safe-area-inset-bottom));position:fixed;bottom:0;left:0}.share-memo-image-dialog .mobile-preview-btn .preview-btn{background:var(--interactive-accent);width:100%;color:var(--text-on-accent);cursor:pointer;box-shadow:0 4px 12px rgba(var(--interactive-accent-rgb), .3);border:none;border-radius:12px;justify-content:center;align-items:center;gap:8px;padding:16px;font-size:15px;font-weight:600;display:flex}.share-memo-image-dialog .mobile-preview-btn .preview-btn:active{transform:scale(.98)}.share-memo-image-dialog .mobile-preview-btn .preview-btn svg{width:18px;height:18px}}.is-phone .share-memo-image-dialog>.dialog-container>.dialog-content-container{flex-direction:column}.is-phone .share-memo-image-dialog>.dialog-container .share-preview-area .style-indicator{top:60px}.is-phone .share-memo-image-dialog>.dialog-container .share-preview-area .memo-share-card{transform-origin:top;transform:scale(.85)}.theme-dark .share-memo-image-dialog .share-preview-area{background-color:var(--background-primary-alt)}.theme-dark .share-memo-image-dialog .share-preview-area:before{background-image:radial-gradient(rgba(255,255,255,.1) 1px,transparent 1px)}.theme-dark .share-memo-image-dialog .share-preview-area .style-indicator{color:var(--text-normal);background-color:rgba(255,255,255,.15)}.theme-dark .share-memo-image-dialog .share-preview-area .preview-nav-btn{color:var(--text-normal);background-color:rgba(30,30,30,.9);border-color:rgba(255,255,255,.1)}.theme-dark .share-memo-image-dialog .share-preview-area .preview-nav-btn:hover{background-color:var(--interactive-accent);color:var(--text-on-accent)}.theme-dark .share-memo-image-dialog .share-preview-area .mobile-back-btn{color:var(--text-normal);background:rgba(30,30,30,.9)}.theme-dark .share-memo-image-dialog .share-config-panel .config-tabs{background-color:var(--background-primary-alt)}.theme-dark .share-memo-image-dialog .share-config-panel .config-tabs .tab-btn.active{background-color:var(--background-secondary)}.theme-dark .share-memo-image-dialog .share-config-panel .config-toggle{background:var(--background-primary-alt);border-color:rgba(255,255,255,.1)}.theme-dark .share-memo-image-dialog .share-config-panel .config-button-group{background:var(--background-primary-alt)}.theme-dark .share-memo-image-dialog .share-config-panel .config-button-group .group-btn.active{background:var(--background-secondary)}.theme-dark .share-memo-image-dialog .share-config-panel .gradient-picker-grid .color-option.active:after{background:rgba(0,0,0,.5)}.theme-dark .share-memo-image-dialog .share-config-panel .gradient-picker-grid .color-option.upload-btn{border-color:rgba(255,255,255,.2)}.theme-dark .share-memo-image-dialog .memo-share-card[data-style=modern] .card-body code{background:rgba(255,255,255,.1)}.theme-dark .share-memo-image-dialog .memo-share-card[data-style=modern] .card-body pre{background:rgba(255,255,255,.05)}.theme-dark .share-memo-image-dialog .mobile-action-bar,.theme-dark .share-memo-image-dialog .mobile-preview-btn{background:var(--background-primary);border-top-color:rgba(255,255,255,.1)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes scaleIn{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.share-memo-image-dialog .heatmap-grid{grid-template-rows:repeat(3,1fr);grid-template-columns:repeat(4,1fr);gap:2px;width:60px;height:36px;display:grid}.share-memo-image-dialog .heatmap-grid .heatmap-cell{background-color:var(--memos-stat-day-L0-bg);border-radius:2px;width:10px;height:10px}.share-memo-image-dialog .heatmap-grid .heatmap-cell.stat-day-L0-bg{background-color:var(--memos-stat-day-L0-bg)}.share-memo-image-dialog .heatmap-grid .heatmap-cell.stat-day-L1-bg{background-color:var(--memos-stat-day-L1-bg)}.share-memo-image-dialog .heatmap-grid .heatmap-cell.stat-day-L2-bg{background-color:var(--memos-stat-day-L2-bg)}.share-memo-image-dialog .heatmap-grid .heatmap-cell.stat-day-L3-bg{background-color:var(--memos-stat-day-L3-bg)}.share-memo-image-dialog .heatmap-grid .heatmap-cell.stat-day-L4-bg{background-color:var(--memos-stat-day-L4-bg)}.share-memo-image-dialog .setting-item{border-bottom:1px solid var(--background-modifier-border);align-items:center;padding:12px 0;display:flex}.share-memo-image-dialog .setting-item .setting-item-info{flex:1}.share-memo-image-dialog .setting-item .setting-item-info .setting-item-name{margin-bottom:2px;font-size:14px;font-weight:500}.share-memo-image-dialog .setting-item .setting-item-info .setting-item-description{color:var(--text-muted);font-size:12px}.share-memo-image-dialog .setting-item .setting-item-control{flex:none}.share-memo-image-dialog .setting-item .setting-item-control select,.share-memo-image-dialog .setting-item .setting-item-control input[type=text]{border:1px solid var(--background-modifier-border);background:var(--background-primary);color:var(--text-normal);border-radius:4px;min-width:120px;padding:6px 10px}.share-memo-image-dialog .setting-item .setting-item-control select:focus,.share-memo-image-dialog .setting-item .setting-item-control input[type=text]:focus{border-color:var(--interactive-accent);outline:none}.share-outer-container{transition:all var(--transition-medium)}.share-outer-container:not(.has-frame){background:0 0;padding:0}.share-memo-image-dialog .fullscreen-preview-overlay{z-index:1000;cursor:zoom-out;background-color:rgba(0,0,0,.9);justify-content:center;align-items:center;padding:40px;animation:.2s ease-out fadeIn;display:flex;position:fixed;top:0;bottom:0;left:0;right:0}.share-memo-image-dialog .fullscreen-preview-overlay .fullscreen-preview-content{flex-direction:column;align-items:center;gap:16px;max-width:100%;max-height:100%;display:flex}.share-memo-image-dialog .fullscreen-preview-overlay .fullscreen-preview-content img{object-fit:contain;border-radius:8px;max-width:100%;max-height:calc(100vh - 120px);animation:.2s ease-out scaleIn;box-shadow:0 25px 50px -12px rgba(0,0,0,.5)}.share-memo-image-dialog .fullscreen-preview-overlay .fullscreen-preview-content .fullscreen-preview-hint{color:rgba(255,255,255,.6);text-align:center;font-size:13px}.share-memo-image-dialog .view-preview-btn{width:100%;box-shadow:none;background-color:var(--background-secondary);border:1px solid var(--background-modifier-border);color:var(--text-normal);cursor:pointer;transition:all var(--transition-fast);border-radius:8px;justify-content:center;align-items:center;gap:8px;padding:10px 16px;font-size:13px;font-weight:500;display:flex}.share-memo-image-dialog .view-preview-btn:hover{background-color:var(--background-modifier-hover);border-color:var(--interactive-accent);color:var(--interactive-accent)}.share-memo-image-dialog .view-preview-btn svg{width:16px;height:16px}`;N(),ur(),H(),Ce(),Qr(),Wr();var wS=({name:e,className:t})=>{let n=(0,U.useRef)(null);return(0,U.useEffect)(()=>{n.current&&(n.current.innerHTML=``,(0,f.setIcon)(n.current,e))},[e]),(0,W.jsx)(`span`,{ref:n,className:u_(`icon`,t)})},TS=[`linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)`,`linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%)`,`linear-gradient(120deg, #d4fc79 0%, #96e6a1 100%)`,`linear-gradient(to top, #cfd9df 0%, #e2ebf0 100%)`,`linear-gradient(to right, #4facfe 0%, #00f2fe 100%)`,`linear-gradient(to right, #fa709a 0%, #fee140 100%)`,`linear-gradient(to right, #6a11cb 0%, #2575fc 100%)`,`linear-gradient(to top, #30cfd0 0%, #330867 100%)`,`linear-gradient(to top, #a8edea 0%, #fed6e3 100%)`,`linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%)`,`linear-gradient(to top, #9890e3 0%, #b1f4cf 100%)`,`linear-gradient(to right, #ff9a9e 0%, #fecfef 99%, #fecfef 100%)`,`linear-gradient(to right, #43e97b 0%, #38f9d7 100%)`],ES=[{name:`点阵`,value:`radial-gradient(#cbd5e1 1px, transparent 1px)`,size:`20px 20px`,bg:`#f8fafc`},{name:`网格`,value:`linear-gradient(#e2e8f0 1px, transparent 1px), linear-gradient(90deg, #e2e8f0 1px, transparent 1px)`,size:`20px 20px`,bg:`#ffffff`},{name:`斜线`,value:`repeating-linear-gradient(45deg, transparent, transparent 10px, #e2e8f0 10px, #e2e8f0 11px)`,size:`20px 20px`,bg:`#ffffff`},{name:`交叉`,value:`repeating-linear-gradient(45deg, #e2e8f0 0, #e2e8f0 1px, transparent 0, transparent 50%), repeating-linear-gradient(135deg, #e2e8f0 0, #e2e8f0 1px, transparent 0, transparent 50%)`,size:`16px 16px`,bg:`#ffffff`},{name:`波点`,value:`radial-gradient(circle, #d1d5db 2px, transparent 2px)`,size:`24px 24px`,bg:`#fafafa`},{name:`菱形`,value:`linear-gradient(135deg, #e5e7eb 25%, transparent 25%), linear-gradient(225deg, #e5e7eb 25%, transparent 25%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(315deg, #e5e7eb 25%, transparent 25%)`,size:`20px 20px`,bg:`#ffffff`},{name:`纸张`,value:`linear-gradient(#f1f5f9 1px, transparent 1px)`,size:`100% 28px`,bg:`#fffef0`},{name:`蓝格`,value:`linear-gradient(#dbeafe 1px, transparent 1px), linear-gradient(90deg, #dbeafe 1px, transparent 1px)`,size:`20px 20px`,bg:`#ffffff`}],DS={modern:{name:M(`Simple`),bgType:`gradient`,bgValue:TS[0],bgColor:`#ffffff`,fontColor:`#334155`,fontFamily:`sans-serif`,borderRadius:`16px`,shadow:`0 20px 25px -5px rgb(0 0 0 / 0.1)`,padding:40,cardBgColor:`rgba(255, 255, 255, 0.9)`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`simple`},vintage:{name:M(`Old`),bgType:`color`,bgValue:`#e6dccd`,bgColor:`#e6dccd`,fontColor:`#5c4033`,fontFamily:`"Kaiti SC", "STKaiti", "KaiTi", serif`,borderRadius:`2px`,shadow:`0 10px 15px -3px rgb(0 0 0 / 0.1)`,padding:50,cardBgColor:`#fffbf0`,textAlign:`center`,showAvatar:!1,showAuthor:!0,footerMode:`pattern`},cyber:{name:M(`Dark`),bgType:`color`,bgValue:`#0f172a`,bgColor:`#0f172a`,fontColor:`#4ade80`,fontFamily:`monospace`,borderRadius:`8px`,shadow:`none`,padding:32,cardBgColor:`#1e293b`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`heatmap`},outline:{name:M(`Border`),bgType:`pattern`,bgValue:ES[1].value,bgColor:`#ffffff`,fontColor:`#000000`,fontFamily:`sans-serif`,borderRadius:`0px`,shadow:`none`,padding:40,cardBgColor:`#ffffff`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`simple`},"classic-gradient":{name:M(`Classic`),bgType:`gradient`,bgValue:TS[4],bgColor:`#ffffff`,fontColor:`#1e293b`,fontFamily:`sans-serif`,borderRadius:`16px`,shadow:`0 20px 25px -5px rgb(0 0 0 / 0.1)`,padding:40,cardBgColor:`rgba(255, 255, 255, 0.95)`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`heatmap`},nordic:{name:M(`Nordic`),bgType:`color`,bgValue:`#F1F5F9`,bgColor:`#F1F5F9`,fontColor:`#334155`,fontFamily:`sans-serif`,borderRadius:`12px`,shadow:`0 4px 6px -1px rgb(0 0 0 / 0.05)`,padding:48,cardBgColor:`#ffffff`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`simple`},japanese:{name:M(`Nihon`),bgType:`color`,bgValue:`#E6E4E0`,bgColor:`#E6E4E0`,fontColor:`#2c2c2c`,fontFamily:`"Hiragino Mincho ProN", "Yu Mincho", "SimSun", serif`,borderRadius:`2px`,shadow:`0 1px 3px rgb(0 0 0 / 0.1)`,padding:48,cardBgColor:`#FDFBF7`,textAlign:`left`,showAvatar:!1,showAuthor:!0,footerMode:`pattern`},social:{name:M(`INS Style`),bgType:`gradient`,bgValue:TS[8],bgColor:`#FFF1EB`,fontColor:`#1e293b`,fontFamily:`sans-serif`,borderRadius:`24px`,shadow:`0 25px 50px -12px rgb(0 0 0 / 0.15)`,padding:36,cardBgColor:`#ffffff`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`simple`},magazine:{name:M(`Magazine`),bgType:`color`,bgValue:`#0F172A`,bgColor:`#0F172A`,fontColor:`#000000`,fontFamily:`"Times New Roman", "Georgia", serif`,borderRadius:`0px`,shadow:`0 20px 25px -5px rgb(255 255 255 / 0.1)`,padding:40,cardBgColor:`#ffffff`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`none`},handwritten:{name:M(`Handwritten`),bgType:`pattern`,bgValue:ES[1].value,bgColor:`#fefce8`,fontColor:`#4b5563`,fontFamily:`"Comic Sans MS", "Chalkboard SE", cursive`,borderRadius:`4px`,shadow:`2px 4px 12px rgba(0, 0, 0, 0.08)`,padding:40,cardBgColor:`#fffbeb`,textAlign:`left`,showAvatar:!0,showAuthor:!0,footerMode:`simple`},colorful:{name:M(`Colorful`),bgType:`gradient`,bgValue:TS[11],bgColor:`#ffffff`,fontColor:`#ffffff`,fontFamily:`sans-serif`,borderRadius:`20px`,shadow:`0 20px 25px -5px rgba(0, 0, 0, 0.2)`,padding:40,cardBgColor:`rgba(255, 255, 255, 0.2)`,textAlign:`center`,showAvatar:!0,showAuthor:!0,footerMode:`none`}},OS={styleVariant:`modern`,bgType:`gradient`,bgValue:TS[0],bgColor:`#ffffff`,bgSize:`20px 20px`,fontColor:`#334155`,fontFamily:`sans-serif`,fontSize:16,textAlign:`left`,borderRadius:`16px`,shadow:`0 20px 25px -5px rgb(0 0 0 / 0.1)`,padding:40,cardBgColor:`rgba(255, 255, 255, 0.9)`,showAvatar:!0,showAuthor:!0,footerMode:`simple`,footerText:`Created with Thino`,showLogo:!0,showOuterFrame:!1,outerPadding:40,outerBgType:`color`,outerBgValue:`#e5e5e5`},kS=(e,t)=>{let n=window.atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);return new Blob([r],{type:t})},AS=async e=>{let t=e.querySelector(`.avatar`);if(!(t&&!/(http|app|base64)/.test(t?.style?.backgroundImage))&&t&&t?.style?.backgroundImage){let e=await zx(t);t.style.backgroundImage=`url("${e}")`}},jS=async e=>{let t=e.querySelectorAll(`img`);for(let e of t)e.src.startsWith(`http://localhost`)?e.src=await Lx(e.getAttribute(`path`)||(0,f.normalizePath)(e?.parentElement?.getAttribute(`src`)||``)):e.src=await Bx(e)},MS=e=>{let t=new Date,n=[];for(let r=13;r>=0;r--){let i=new Date(t);i.setDate(i.getDate()-r);let a=i.toISOString().split(`T`)[0],o=e.filter(e=>new Date(e.createdAt).toISOString().split(`T`)[0]===a).length;n.push({date:a,count:o})}return n},NS=({memos:e,color:t})=>(0,W.jsx)(`div`,{className:`heatmap-display`,children:(0,U.useMemo)(()=>MS(e),[e]).map((e,n)=>(0,W.jsx)(`div`,{className:u_(`heatmap-cell`,`level-${e.count>4?4:e.count}`),style:{backgroundColor:t},title:`${e.date}: ${e.count} memos`},n))}),PS=({color:e})=>(0,W.jsxs)(`div`,{className:`texture-decoration`,style:{color:e},children:[(0,W.jsx)(`div`,{className:`line`}),(0,W.jsx)(`div`,{className:`diamond`}),(0,W.jsx)(`div`,{className:`line`})]}),FS=U.forwardRef(({memo:e,config:t,app:n,view:r,settings:i,memos:a,onImageGenerated:o,onPreviewClick:s},c)=>{let[l,u]=(0,U.useState)(``),[d,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1),[g,_]=(0,U.useState)(null),v=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=new f.Component;return e.load(),_(e),()=>{e.unload()}},[]);let y=(0,U.useMemo)(()=>i?.MomentsIcon?i.MomentsIcon.startsWith(`http`)||i.MomentsIcon.startsWith(`data:`)?`url("${i.MomentsIcon}")`:`url("${n.vault.adapter.getResourcePath((0,f.normalizePath)(i.MomentsIcon))}")`:``,[i?.MomentsIcon,n]),b=(0,U.useCallback)(()=>{h(!0)},[]);(0,U.useEffect)(()=>{!m||!v.current||!g||(v.current.innerHTML=``,(async()=>{v.current?.classList.add(`markdown-rendered`,`markdown-preview-view`),await f.MarkdownRenderer.render(n,e.content+`
|
||
`,v.current,e.path,g)})())},[m,e.content,n,g]);let x=(0,U.useCallback)(async()=>{let e=c?.current;e&&(await AS(e),await jS(e),setTimeout(()=>{xS(e,{pixelRatio:window.devicePixelRatio*2}).then(e=>{u(e),p(!0),o(e)}).catch(e=>{console.error(`Generate image failed:`,e)})},300))},[c,o]);(0,U.useEffect)(()=>{d&&(p(!1),u(``),setTimeout(x,200))},[t]),(0,U.useEffect)(()=>{d||setTimeout(x,200)},[]);let S=(0,U.useMemo)(()=>t.bgType===`color`?{backgroundColor:t.bgValue}:t.bgType===`gradient`?{background:t.bgValue}:t.bgType===`pattern`?{backgroundColor:t.bgColor,backgroundImage:t.bgValue,backgroundSize:t.bgSize||`20px 20px`,backgroundRepeat:`repeat`}:t.bgType===`image`?{backgroundImage:t.bgValue,backgroundSize:`cover`,backgroundPosition:`center`,backgroundRepeat:`no-repeat`}:{},[t.bgType,t.bgValue,t.bgColor,t.bgSize]),C=(0,U.useMemo)(()=>({"--card-bg":t.cardBgColor,"--card-text":t.fontColor,"--card-font":t.fontFamily,"--card-font-size":`${t.fontSize}px`,"--card-radius":t.borderRadius,"--card-shadow":t.shadow,"--card-padding":`${t.padding}px`}),[t]),w=(0,U.useMemo)(()=>{if(!t.showOuterFrame)return{};let e={padding:`${t.outerPadding}px`,display:`flex`,alignItems:`center`,justifyContent:`center`,width:`fit-content`};return t.outerBgType===`color`?e.backgroundColor=t.outerBgValue:t.outerBgType===`gradient`&&(e.background=t.outerBgValue),e},[t.showOuterFrame,t.outerBgType,t.outerBgValue,t.outerPadding]);return(0,W.jsxs)(`div`,{className:`memo-share-card-wrapper`,children:[l&&(0,W.jsx)(`img`,{className:`memo-shortcut-img`,src:l,alt:`Preview`,onClick:()=>s?.(l)}),(0,W.jsx)(SS,{styles:CS,onReady:b,children:(0,W.jsx)(`div`,{ref:c,className:u_(`share-outer-container`,t.showOuterFrame&&`has-frame`),style:t.showOuterFrame?w:void 0,children:(0,W.jsxs)(`div`,{className:`memo-share-card`,"data-theme":t.styleVariant,style:C,children:[(0,W.jsx)(`div`,{className:`card-bg-layer`,children:(0,W.jsx)(`div`,{className:`bg-image`,style:S})}),(0,W.jsxs)(`div`,{className:`card-content-layer`,style:{textAlign:t.textAlign},children:[t.styleVariant===`vintage`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`ancient-corner top-left`}),(0,W.jsx)(`div`,{className:`ancient-corner top-right`}),(0,W.jsx)(`div`,{className:`ancient-corner bottom-left`}),(0,W.jsx)(`div`,{className:`ancient-corner bottom-right`}),(0,W.jsx)(`div`,{className:`inner-border`})]}),t.styleVariant===`cyber`&&(0,W.jsxs)(`div`,{className:`cyber-dots`,children:[(0,W.jsx)(`div`,{className:`dot`}),(0,W.jsx)(`div`,{className:`dot`}),(0,W.jsx)(`div`,{className:`dot`})]}),t.styleVariant===`nordic`&&(0,W.jsx)(`div`,{className:`nordic-dot`}),t.styleVariant===`japanese`&&(0,W.jsxs)(`div`,{className:`japanese-decor`,children:[(0,W.jsx)(`div`,{className:`stamp`}),(0,W.jsx)(`div`,{className:`vertical-line`})]}),t.styleVariant===`handwritten`&&(0,W.jsx)(`div`,{className:`tape-decoration`}),t.styleVariant===`magazine`&&(0,W.jsxs)(`div`,{className:`magazine-decor`,children:[(0,W.jsx)(`div`,{className:`top-bar`}),(0,W.jsx)(`div`,{className:`bottom-bar`}),(0,W.jsx)(`div`,{className:`side-text`,children:`ISSUE 01`})]}),(t.showAvatar||t.showAuthor)&&(0,W.jsxs)(`div`,{className:u_(`card-header`,t.textAlign===`center`&&`center`),children:[t.showAvatar&&(0,W.jsx)(`div`,{className:`avatar`,style:{backgroundImage:y},ref:e=>{e&&!y&&(0,f.setIcon)(e,`user`)}}),t.showAuthor&&(0,W.jsxs)(`div`,{className:`user-meta`,children:[(0,W.jsx)(`div`,{className:`from-label`,children:`From`}),(0,W.jsx)(`div`,{className:`username`,children:i?.UserName||`Thino User`})]})]}),(0,W.jsx)(`div`,{className:`card-body`,ref:v}),(0,W.jsx)(`div`,{className:`card-timestamp`,children:e.createdAtStr}),(0,W.jsxs)(`div`,{className:`card-footer`,children:[(0,W.jsxs)(`div`,{className:`footer-left`,children:[t.footerMode===`heatmap`&&(0,W.jsx)(NS,{memos:a,color:t.fontColor}),t.footerMode===`pattern`&&(0,W.jsx)(PS,{color:t.fontColor}),t.footerMode===`simple`&&t.footerText&&(0,W.jsx)(`span`,{className:`footer-text`,children:t.footerText})]}),t.showLogo&&(0,W.jsx)(`div`,{className:`footer-right`,children:t.styleVariant===`cyber`?(0,W.jsx)(`div`,{className:`footer-logo`,children:(0,W.jsx)(`div`,{className:`qr-placeholder`,children:(0,W.jsx)(wS,{name:`qr-code`})})}):(0,W.jsx)(`span`,{children:`THINO`})})]})]})]})})})]})});FS.displayName=`SharePreviewCard`;var IS=({config:e,onChange:t,onClose:n,onExport:r,isExporting:i,exportMessage:a,isMobile:o,onPreview:s,onViewFullPreview:c,hasPreviewImage:l})=>{let u=(0,U.useRef)(null),d=(0,U.useRef)(null);(0,U.useEffect)(()=>{u.current&&(0,f.setIcon)(u.current,`x`)},[]);let p=(0,U.useCallback)((n,r)=>{t({...e,[n]:r})},[e,t]),m=(0,U.useCallback)(n=>{let r=Object.keys(DS),i=r.indexOf(e.styleVariant),a=n===`next`?i+1:i-1;a>=r.length&&(a=0),a<0&&(a=r.length-1);let o=r[a],s=DS[o];t({...e,styleVariant:o,...s})},[e,t]),h=(0,U.useCallback)(n=>{let r=DS[n];t({...e,styleVariant:n,...r})},[e,t]);return(0,W.jsxs)(`div`,{className:`share-config-panel`,children:[(0,W.jsxs)(`div`,{className:`panel-header`,children:[(0,W.jsxs)(`h3`,{className:`panel-title`,children:[(0,W.jsx)(wS,{name:`layout-grid`}),M(`Share Memo Image`)]}),(0,W.jsx)(`div`,{ref:u,className:`close-btn`,onClick:n})]}),(0,W.jsxs)(`div`,{className:`panel-content custom-scrollbar`,children:[o&&(0,W.jsxs)(`div`,{className:`config-section mobile-theme-switcher`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(wS,{name:`sun`}),M(`Quick Theme`)]}),(0,W.jsxs)(`div`,{className:`theme-nav`,children:[(0,W.jsxs)(`button`,{className:`nav-btn`,onClick:()=>m(`prev`),children:[(0,W.jsx)(wS,{name:`chevron-left`}),M(`Previous`)]}),(0,W.jsxs)(`button`,{className:`nav-btn`,onClick:()=>m(`next`),children:[M(`Next`),(0,W.jsx)(wS,{name:`chevron-right`})]})]}),(0,W.jsxs)(`div`,{className:`current-theme`,children:[M(`Current`),`: `,DS[e.styleVariant].name]})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(wS,{name:`palette`}),M(`Theme Style`)]}),(0,W.jsx)(`div`,{className:`config-tabs theme-presets`,children:Object.keys(DS).map(t=>(0,W.jsx)(`button`,{className:u_(`tab-btn`,e.styleVariant===t&&`active`),onClick:()=>h(t),children:DS[t].name},t))})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(wS,{name:`image`}),M(`Background`)]}),(0,W.jsx)(`div`,{className:`config-tabs`,children:[`color`,`gradient`,`pattern`,`image`].map(t=>(0,W.jsx)(`button`,{className:u_(`tab-btn`,e.bgType===t&&`active`),onClick:()=>p(`bgType`,t),children:{color:M(`Solid`),gradient:M(`Gradient`),pattern:M(`Pattern`),image:M(`Image`)}[t]},t))}),(0,W.jsxs)(`div`,{className:`gradient-picker-grid`,style:{marginTop:`12px`},children:[e.bgType===`gradient`&&TS.map((t,n)=>(0,W.jsx)(`div`,{className:u_(`color-option`,e.bgValue===t&&`active`),style:{background:t},onClick:()=>p(`bgValue`,t)},n)),e.bgType===`pattern`&&ES.map((n,r)=>(0,W.jsx)(`div`,{className:u_(`color-option`,e.bgValue===n.value&&`active`),style:{backgroundColor:n.bg,backgroundImage:n.value,backgroundSize:n.size},onClick:()=>{t({...e,bgValue:n.value,bgColor:n.bg,bgSize:n.size})}},r)),e.bgType===`color`&&(0,W.jsxs)(`div`,{className:`config-color-picker`,style:{gridColumn:`1 / -1`},children:[(0,W.jsx)(`span`,{className:`color-label`,children:M(`Background Color`)}),(0,W.jsx)(`input`,{type:`color`,value:e.bgValue.startsWith(`#`)?e.bgValue:`#ffffff`,onChange:e=>{p(`bgValue`,e.target.value),p(`bgColor`,e.target.value)}})]}),e.bgType===`image`&&(0,W.jsxs)(`div`,{className:`color-option upload-btn`,style:{gridColumn:`1 / -1`,aspectRatio:`auto`,padding:`16px`},onClick:()=>d.current?.click(),children:[`+ `,M(`Upload Image`)]})]}),(0,W.jsx)(`input`,{ref:d,type:`file`,accept:`image/*`,hidden:!0,onChange:n=>{let r=n.target.files?.[0];if(!r)return;if(r.size>5*1024*1024){new f.Notice(M(`Image file cannot exceed 5MB`));return}let i=new FileReader;i.onload=n=>{let r=n.target?.result;t({...e,bgType:`image`,bgValue:`url("${r}")`})},i.onerror=()=>{new f.Notice(M(`Image read failed, please try again`))},i.readAsDataURL(r),n.target.value=``}})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(wS,{name:`type`}),M(`Typography`)]}),(0,W.jsxs)(`div`,{className:`config-slider`,children:[(0,W.jsxs)(`div`,{className:`slider-header`,children:[(0,W.jsx)(`span`,{className:`slider-label`,children:M(`Font Size`)}),(0,W.jsxs)(`span`,{className:`slider-value`,children:[e.fontSize,`px`]})]}),(0,W.jsx)(`input`,{type:`range`,min:`12`,max:`24`,value:e.fontSize,onChange:e=>p(`fontSize`,parseInt(e.target.value))})]}),(0,W.jsxs)(`div`,{className:`config-color-picker`,style:{marginTop:`12px`},children:[(0,W.jsx)(`span`,{className:`color-label`,children:M(`Text Color`)}),(0,W.jsx)(`input`,{type:`color`,value:e.fontColor,onChange:e=>p(`fontColor`,e.target.value)})]}),(0,W.jsxs)(`div`,{className:`config-button-group`,style:{marginTop:`12px`},children:[(0,W.jsx)(`button`,{className:u_(`group-btn`,e.textAlign===`left`&&`active`),onClick:()=>p(`textAlign`,`left`),children:M(`Left`)}),(0,W.jsx)(`button`,{className:u_(`group-btn`,e.textAlign===`center`&&`active`),onClick:()=>p(`textAlign`,`center`),children:M(`Center`)})]})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(wS,{name:`panel-top`}),M(`Header`)]}),(0,W.jsxs)(`div`,{className:`config-toggle`,children:[(0,W.jsx)(`span`,{className:`toggle-label`,children:M(`Show Avatar`)}),(0,W.jsx)(`div`,{className:u_(`toggle-switch`,e.showAvatar&&`active`),onClick:()=>p(`showAvatar`,!e.showAvatar),children:(0,W.jsx)(`div`,{className:`thumb`})})]}),(0,W.jsxs)(`div`,{className:`config-toggle`,children:[(0,W.jsx)(`span`,{className:`toggle-label`,children:M(`Show Author`)}),(0,W.jsx)(`div`,{className:u_(`toggle-switch`,e.showAuthor&&`active`),onClick:()=>p(`showAuthor`,!e.showAuthor),children:(0,W.jsx)(`div`,{className:`thumb`})})]})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(wS,{name:`panel-bottom`}),M(`Footer`)]}),(0,W.jsxs)(`div`,{className:`config-select`,children:[(0,W.jsx)(`label`,{className:`select-label`,children:M(`Footer Style`)}),(0,W.jsxs)(`select`,{value:e.footerMode,onChange:e=>p(`footerMode`,e.target.value),children:[(0,W.jsx)(`option`,{value:`simple`,children:M(`Simple Text`)}),(0,W.jsx)(`option`,{value:`heatmap`,children:M(`Activity Heatmap`)}),(0,W.jsx)(`option`,{value:`pattern`,children:M(`Decoration`)}),(0,W.jsx)(`option`,{value:`none`,children:M(`None`)})]})]}),e.footerMode!==`none`&&(0,W.jsxs)(`div`,{className:`config-input`,style:{marginTop:`12px`},children:[(0,W.jsx)(`label`,{className:`input-label`,children:M(`Footer Text`)}),(0,W.jsx)(`input`,{type:`text`,value:e.footerText,onChange:e=>p(`footerText`,e.target.value),placeholder:M(`Enter footer text...`)})]}),(0,W.jsxs)(`div`,{className:`config-toggle`,style:{marginTop:`12px`},children:[(0,W.jsx)(`span`,{className:`toggle-label`,children:M(`Show Logo`)}),(0,W.jsx)(`div`,{className:u_(`toggle-switch`,e.showLogo&&`active`),onClick:()=>p(`showLogo`,!e.showLogo),children:(0,W.jsx)(`div`,{className:`thumb`})})]})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(wS,{name:`maximize`}),M(`Outer Frame`)]}),(0,W.jsxs)(`div`,{className:`config-toggle`,children:[(0,W.jsx)(`span`,{className:`toggle-label`,children:M(`Enable Frame`)}),(0,W.jsx)(`div`,{className:u_(`toggle-switch`,e.showOuterFrame&&`active`),onClick:()=>p(`showOuterFrame`,!e.showOuterFrame),children:(0,W.jsx)(`div`,{className:`thumb`})})]}),e.showOuterFrame&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`config-slider`,style:{marginTop:`12px`},children:[(0,W.jsxs)(`div`,{className:`slider-header`,children:[(0,W.jsx)(`span`,{className:`slider-label`,children:M(`Frame Padding`)}),(0,W.jsxs)(`span`,{className:`slider-value`,children:[e.outerPadding,`px`]})]}),(0,W.jsx)(`input`,{type:`range`,min:`0`,max:`100`,value:e.outerPadding,onChange:e=>p(`outerPadding`,parseInt(e.target.value))})]}),(0,W.jsx)(`div`,{className:`config-tabs`,style:{marginTop:`12px`},children:[`color`,`gradient`].map(t=>(0,W.jsx)(`button`,{className:u_(`tab-btn`,e.outerBgType===t&&`active`),onClick:()=>p(`outerBgType`,t),children:{color:M(`Solid`),gradient:M(`Gradient`)}[t]},t))}),e.outerBgType===`color`&&(0,W.jsxs)(`div`,{className:`config-color-picker`,style:{marginTop:`12px`},children:[(0,W.jsx)(`span`,{className:`color-label`,children:M(`Frame Color`)}),(0,W.jsx)(`input`,{type:`color`,value:e.outerBgValue.startsWith(`#`)?e.outerBgValue:`#e5e5e5`,onChange:e=>p(`outerBgValue`,e.target.value)})]}),e.outerBgType===`gradient`&&(0,W.jsx)(`div`,{className:`gradient-picker-grid`,style:{marginTop:`12px`},children:TS.map((t,n)=>(0,W.jsx)(`div`,{className:u_(`color-option`,e.outerBgValue===t&&`active`),style:{background:t},onClick:()=>p(`outerBgValue`,t)},n))})]})]}),(0,W.jsxs)(`div`,{className:`config-section`,children:[(0,W.jsxs)(`div`,{className:`section-title`,children:[(0,W.jsx)(wS,{name:`settings`}),M(`Fine-tuning`)]}),(0,W.jsxs)(`div`,{className:`config-fine-tuning`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{className:`select-label`,style:{fontSize:`12px`,color:`var(--text-muted)`,marginBottom:`6px`,display:`block`},children:M(`Border Radius`)}),(0,W.jsx)(`div`,{className:`config-button-group`,children:[`0px`,`16px`,`32px`].map((t,n)=>(0,W.jsx)(`button`,{className:u_(`group-btn`,e.borderRadius===t&&`active`),onClick:()=>p(`borderRadius`,t),children:M(n===0?`Sharp`:n===1?`Round`:`Full`)},t))})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`label`,{className:`select-label`,style:{fontSize:`12px`,color:`var(--text-muted)`,marginBottom:`6px`,display:`block`},children:M(`Shadow`)}),(0,W.jsx)(`div`,{className:`config-button-group`,children:[{value:`none`,label:M(`None`)},{value:`0 10px 15px -3px rgb(0 0 0 / 0.1)`,label:M(`Normal`)},{value:`0 20px 25px -5px rgb(0 0 0 / 0.2)`,label:M(`Strong`)}].map(t=>(0,W.jsx)(`button`,{className:u_(`group-btn`,e.shadow===t.value&&`active`),onClick:()=>p(`shadow`,t.value),children:t.label},t.value))})]})]})]})]}),!o&&(0,W.jsxs)(`div`,{className:`panel-footer`,children:[c&&l&&(0,W.jsxs)(`button`,{className:`view-preview-btn`,onClick:c,children:[(0,W.jsx)(wS,{name:`maximize-2`}),M(`View Preview`)]}),(0,W.jsxs)(`div`,{className:`action-buttons`,children:[(0,W.jsxs)(`button`,{className:`action-btn secondary`,disabled:i,onClick:()=>r(`copy`),children:[(0,W.jsx)(wS,{name:`copy`}),i?`...`:M(`Copy`)]}),(0,W.jsxs)(`button`,{className:`action-btn primary`,disabled:i,onClick:()=>r(`download`),children:[(0,W.jsx)(wS,{name:`download`}),M(i?`Processing...`:`Save Image`)]})]}),a&&(0,W.jsx)(`div`,{className:`export-message`,children:a})]}),o&&s&&(0,W.jsx)(`div`,{className:`mobile-preview-btn`,children:(0,W.jsxs)(`button`,{className:`preview-btn`,onClick:s,children:[(0,W.jsx)(wS,{name:`eye`}),M(`Generate Preview`)]})})]})},LS=e=>{let{memo:t,destroy:n,view:r}=e,{memos:i}=lr.getState().memoState,{app:a,settings:o}=lr.getState().dailyNotesState,s=(0,U.useMemo)(()=>({...t,createdAtStr:P.getDateTimeString(t.createdAt)}),[t]),[c,l]=(0,U.useState)(()=>{let e=(a||window.app).loadLocalStorage(`memoShareConfigV2`);if(e)try{return{...OS,...JSON.parse(e)}}catch{return OS}return OS}),[u,d]=(0,U.useState)(`edit`),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(``),[_,v]=(0,U.useState)(``),[y,b]=(0,U.useState)(!1),x=(0,U.useRef)(null),S=f.Platform.isMobile,C=(0,U.useCallback)(e=>{e&&b(!0)},[]);(0,U.useEffect)(()=>{(a||window.app).saveLocalStorage(`memoShareConfigV2`,JSON.stringify(c))},[c,a]);let w=(0,U.useCallback)(e=>{v(e)},[]),T=(0,U.useCallback)(async e=>{if(!_){new f.Notice(M(`Image is generating...`));return}m(!0),g(M(`Processing...`));try{let t=_.split(`base64,`)[1],n=kS(t,`image/png`);if(e===`download`){let e=await n.arrayBuffer(),{vault:t}=a,r=ce(),i;for(let e in r)if(r[e]instanceof f.TFile){i=r[e];break}if(i){let n=await t.getAvailablePathForAttachments(`Thino_Share_${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,`png`,i);await t.createBinary(n,e),g(M(`Saved`)),new f.Notice(M(`Save image successfully`))}}else if(e===`copy`){let e=new ClipboardItem({"image/png":n});await navigator.clipboard.write([e]),g(M(`Copied`)),new f.Notice(M(`Copy to clipboard successfully`))}}catch(t){console.error(`Export failed:`,t),g(M(`Failed`)),new f.Notice(M(e===`copy`?`Copy to clipboard failed`:`Save image failed`))}setTimeout(()=>{m(!1),g(``)},2e3)},[_,a]),E=(0,U.useCallback)(e=>{let t=Object.keys(DS),n=t.indexOf(c.styleVariant),r=e===`next`?n+1:n-1;r>=t.length&&(r=0),r<0&&(r=t.length-1);let i=t[r],a=DS[i];l(e=>({...e,styleVariant:i,...a}))},[c.styleVariant]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`dialog-header-container`,style:{display:`none`}}),y&&_&&(0,W.jsx)(`div`,{className:`fullscreen-preview-overlay`,onClick:()=>b(!1),children:(0,W.jsxs)(`div`,{className:`fullscreen-preview-content`,children:[(0,W.jsx)(`img`,{src:_,alt:`Preview`}),(0,W.jsx)(`div`,{className:`fullscreen-preview-hint`,children:M(`Click anywhere to close`)})]})}),(0,W.jsxs)(`div`,{className:u_(`dialog-content-container`),"data-step":u,children:[(0,W.jsxs)(`div`,{className:`share-preview-area`,children:[S&&u===`preview`&&(0,W.jsxs)(`div`,{className:`mobile-back-btn`,onClick:()=>d(`edit`),children:[(0,W.jsx)(wS,{name:`arrow-left`}),M(`Back`)]}),(0,W.jsx)(`div`,{className:`style-indicator`,children:DS[c.styleVariant].name}),!S&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{className:`preview-nav-btn prev`,onClick:()=>E(`prev`),children:(0,W.jsx)(wS,{name:`chevron-left`})}),(0,W.jsx)(`button`,{className:`preview-nav-btn next`,onClick:()=>E(`next`),children:(0,W.jsx)(wS,{name:`chevron-right`})})]}),(0,W.jsx)(FS,{ref:x,memo:s,config:c,app:a,view:r,settings:o,memos:i,onImageGenerated:w,onPreviewClick:C}),S&&u===`preview`&&(0,W.jsxs)(`div`,{className:`mobile-action-bar`,children:[(0,W.jsxs)(`button`,{className:`action-btn secondary`,disabled:p,onClick:()=>T(`copy`),children:[(0,W.jsx)(wS,{name:`copy`}),p?`...`:M(`Copy`)]}),(0,W.jsxs)(`button`,{className:`action-btn primary`,disabled:p,onClick:()=>T(`download`),children:[(0,W.jsx)(wS,{name:`download`}),M(p?`Processing...`:`Save`)]})]})]}),(0,W.jsx)(IS,{config:c,onChange:l,onClose:n,onExport:T,isExporting:p,exportMessage:h,isMobile:S,onPreview:S?()=>d(`preview`):void 0,onViewFullPreview:()=>b(!0),hasPreviewImage:!!_})]})]})};function RS(e,t,n){t_({className:`share-memo-image-dialog`},LS,{memo:e,style:t,view:n})}Qr(),ur(),N();var zS=async e=>{e.startsWith(`http`)&&(e=await Lx(e));let t=e.split(`base64,`)[1];await VS(Zr(t,`image/png`)),new f.Notice(M(`Send to clipboard successfully`))},BS=async(e,t)=>{let n=await e.vault.adapter.exists(t),r=``;if(n)r=t;else{let n=e.metadataCache.getFirstLinkpathDest(t,``);if(!n){new f.Notice(M(`File not exist`));return}r=n.path}let i=await e.vault.adapter.readBinary(r),a=new Uint8Array(i);await VS(new Blob([a],{type:`image/png`}))},VS=async e=>{let t=new ClipboardItem({"image/png":e});await window.navigator.clipboard.write([t])},HS=1.1,US=300,WS=20,GS=({destroy:e,imgUrl:t,filepath:n,otherIMGEls:r,currentIndex:i})=>{let a=lr.getState().dailyNotesState.settings.ZoomImageWhenViewing,o=(0,U.useRef)(null),[s,c]=(0,U.useState)(-1),l=lr.getState().dailyNotesState.app,[u,d]=(0,U.useState)(i),[p,m]=(0,U.useState)(t),[h,g]=(0,U.useState)(!1),_={close:(0,U.useRef)(null),previous:(0,U.useRef)(null),next:(0,U.useRef)(null),decrease:(0,U.useRef)(null),increase:(0,U.useRef)(null),zoom:(0,U.useRef)(null),copy:(0,U.useRef)(null)};(0,U.useEffect)(()=>{!n&&!t||((0,f.setIcon)(_.close.current,`x`),_.previous.current&&(0,f.setIcon)(_.previous.current,`arrow-left`),_.next.current&&(0,f.setIcon)(_.next.current,`arrow-right`),(0,f.setIcon)(_.decrease.current,`zoom-out`),(0,f.setIcon)(_.increase.current,`zoom-in`),(0,f.setIcon)(_.zoom.current,`circle`),(0,f.setIcon)(_.copy.current,`clipboard`))},[_]),(0,U.useEffect)(()=>{P.getImageSize(p).then(({width:e})=>{e===0?c(0):(c(40),a&&!h&&(c(80),g(!0)))})},[p,a,h]);let v=()=>{let e=u-1;e<0&&(e=r.length-1),d(e),m(r[e].src)},y=()=>{let e=u+1;e>=r.length&&(e=0),d(e),m(r[e].src)},b=()=>{e()};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{ref:_.close,className:`btn close-btn`,onClick:b}),(0,W.jsxs)(`div`,{className:`img-container internal-embed image-embed is-loaded`,onClick:e=>{e.target!==o.current&&e.target===o.current.parentElement&&b()},onWheel:e=>{if(e.ctrlKey){e.preventDefault();let t=o.current,n=e.nativeEvent.offsetX,r=e.nativeEvent.offsetY,i=n/t.clientWidth,a=r/t.clientHeight,l;l=e.deltaY>0?s/HS:s*HS,l>US?l=US:l<WS&&(l=WS);let u=s;c(l);let d=e.currentTarget;d.scrollLeft+=(l-u)*i,d.scrollTop+=(l-u)*a}else e.deltaX!==0&&(e.currentTarget.scrollLeft+=e.deltaX)},children:[(0,W.jsx)(`img`,{className:s<=0?`thino-hidden`:``,ref:o,height:s+`%`,src:p}),(0,W.jsx)(`span`,{className:`loading-text `+(s===-1?``:`thino-hidden`),children:M(`Image is loading...`)}),(0,W.jsx)(`span`,{className:`loading-text `+(s===0?``:`thino-hidden`),children:M(`😟 Cannot load image, image link maybe broken`)})]}),(0,W.jsxs)(`div`,{className:`action-btns-container`,children:[r&&r?.length>1&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{ref:_.previous,className:`btn`,onClick:v}),(0,W.jsx)(`button`,{ref:_.next,className:`btn`,onClick:y})]}),(0,W.jsx)(`button`,{ref:_.decrease,className:`btn`,onClick:()=>{s>30&&c(s-10)}}),(0,W.jsx)(`button`,{ref:_.increase,className:`btn`,onClick:()=>{c(s+10)}}),(0,W.jsx)(`button`,{ref:_.zoom,className:`btn`,onClick:()=>c(80)}),(0,W.jsx)(`button`,{ref:_.copy,className:`btn`,onClick:async()=>{if(p&&!n)await zS(t);else if(n){let e=r[u].parentElement.getAttribute(`src`);if(!e){await zS(p);return}await BS(l,e)}}})]})]})};function KS({imgUrl:e,filepath:t,otherIMGEls:n,currentIndex:r}){t_({className:`preview-image-dialog`},GS,{imgUrl:e,otherIMGEls:n,currentIndex:r,filepath:t})}function qS({mouseEnterDelayMS:e=0,mouseLeaveDelayMS:t=0}={}){let[n,r]=(0,U.useState)(!1),i,a;return[n,{onMouseEnter:()=>{clearTimeout(a),i=window.setTimeout(()=>r(!0),e)},onMouseLeave:()=>{clearTimeout(i),a=window.setTimeout(()=>r(!1),t)}}]}H(),Qr();var JS=e=>{let t=[];return e.map(e=>{t.length==0?t.push({date:(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`YYYY-MM-DD`),have:[e]}):t.some(t=>{if(t.date==(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`YYYY-MM-DD`))return t.have.push(e),!0})||t.push({date:(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`YYYY-MM-DD`),have:[e]})}),t},YS=e=>V.getState().commentMemos.filter(t=>t.linkId===e.hasId).sort((e,t)=>P.getTimeStampByDate(e.createdAt)-P.getTimeStampByDate(t.createdAt)).map(e=>({...e,createdAtStr:P.getDateTimeString(e.createdAt),dateStr:P.getDateString(e.createdAt)})),XS=e=>{let t=L.getState().settings,n=Gr(),r=t?.ShowDate?` `:``,i=/comment:(.*)$/g,a=/^\d{14}/g,o=(e,t,n)=>{let r=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`HH:mm`);return n?n.replace(/{TIME}/g,r).replace(/{CONTENT}/g,t):`${r} ${t}`},s=e=>{let t=e.match(/TASK-(.*)?/g);return t?t[1]:``},c=e=>e===`TASK-TODO`?`- [ ] `:e===`TASK-DONE`?`- [x] `:e.match(/TASK-(.*)?/g)?`- [${s(e)}] `:`- `,l=e=>e.reduce((e,s)=>{let l=s.sourceType===`MULTI`?`[[${s.path}]]`:`${s.content}`,u=t?.ShowTime?o(s,l,t?.DefaultMemoComposition):l,d=`${c(s.thinoType)}${u}`,p=``;return t.CommentOnMemos&&s.hasId!==void 0&&s.hasId!==``&&(p=YS(s).reduce((e,o)=>{let s=c(o.thinoType),l=o.content.replace(i,``).replace(a,``),u=t?.ShowDate?`${s}[[${(0,f.moment)(o.createdAt).format(n)}]] ${(0,f.moment)(o.createdAt).format(`HH:mm`)} ${l}`:`${s}${l}`;return e+r+` `+u+`
|
||
`},``)),e+r+d.replace(/ \^\S{6}/g,``)+`
|
||
`+p},``);return e.reduce((e,r)=>{let i=t?.ShowDate?`- [[${(0,f.moment)(r.date,`YYYY-MM-DD`).format(n)}]]\n`:``,a=l(r.have),o=t?.ShowDate&&t?.AddBlankLineWhenDate&&!t?.CommentOnMemos?`
|
||
`:``;return e+i+a+o},``).replace(/<br>/g,`
|
||
`)};Wr(),N(),H();var ZS=e=>{let t=new Set;return e.forEach(e=>{let n=new RegExp(jr).exec(e.content),r=new RegExp(Nr).exec(e.content);if(n)for(let e=1;e<n.length;e++)t.add(n[e]);if(r)for(let e=1;e<r.length;e++)t.add(r[e])}),Array.from(t)},QS=class extends f.Modal{root;cb;tags=[];constructor(e,t){super(e),this.cb=t}onOpen(){super.onOpen(),this.containerEl.toggleClass([`thino-bulk-action-dialog`,`tag-actions`],!0),this.root=$g.createRoot(this.contentEl),this.root.render((0,W.jsx)($S,{closeDialog:this.closeDialog.bind(this)}))}closeDialog(e){this.tags=e,this.close()}onClose(){this.cb(this.tags),console.log(this.tags),super.onClose(),this.root?.unmount()}},$S=({closeDialog:e})=>{let[t,n]=U.useState([]),r=U.useRef(null),i=U.useRef(null);(0,U.useEffect)(()=>{if(i.current){if(r.current){r.current.updateCb(a);return}r.current=new tx(i.current,a)}},[i.current,t]);let a=e=>{if(!e)return;let i=new Set(t);i.add(e),console.log(i),n(Array.from(i)),r.current.clearInput()};return(0,W.jsxs)(`div`,{className:`thino-tag-operation`,children:[(0,W.jsx)(`div`,{className:`tag-operation-title`,children:M(`Tag Bulk Select`)}),(0,W.jsxs)(`div`,{className:`tag-operation-content`,children:[(0,W.jsxs)(`div`,{className:`tag-operation-content-title selected-tags`,children:[(0,W.jsx)(`div`,{className:`name`,children:M(`Selected Tags`)}),(0,W.jsx)(`div`,{className:`desc`,children:M(`Click to remove selected tag`)})]}),(0,W.jsx)(`div`,{className:`tag-operation-content-tags selected-tags`,children:t.map(e=>(0,W.jsx)(`div`,{className:`tag-operation-content-tag`,onClick:()=>{n(t.filter(t=>t!==e))},children:e},e))}),(0,W.jsx)(`div`,{className:`tag-operation-content-inputer`,children:(0,W.jsx)(`input`,{placeholder:M(`Input to select exist tag`),ref:i,onKeyDown:e=>{e.key===`Enter`&&a(i.current.value)}})}),(0,W.jsxs)(`div`,{className:`tag-operation-content-btn-group`,children:[(0,W.jsx)(`button`,{className:`cancel-btn`,onClick:()=>{e([])},children:M(`Cancel`)}),(0,W.jsx)(`button`,{className:`save-btn`,onClick:()=>{e(t)},children:M(`Save`)})]})]})]})},eC=({app:e,thinos:t,closeDialog:n})=>{let[r,i]=U.useState([]),[a,o]=U.useState([]),[s,c]=U.useState([]),l=U.useRef(null),u=U.useRef(null),d=U.useRef(null),p=U.useRef(`End`),m=U.useRef(!1),h=U.useRef(null);(0,U.useEffect)(()=>{t&&t.length&&i(ZS(t))},[t]),(0,U.useEffect)(()=>{!d.current||!u.current||(new f.Setting(u.current).setName(M(`Add tag position`)).addDropdown(e=>{e.addOption(`End`,M(`End`)),e.addOption(`Beginning`,M(`Beginning`)),e.setValue(`End`).onChange(async e=>{p.current=e})}),new f.Setting(d.current).setName(M(`Add tag with new line`)).addToggle(e=>{e.setValue(!1).onChange(async e=>{m.current=e})}))},[]);let g=e=>{if(!e)return;let t=new Set(a);t.add(e),o(Array.from(t)),l.current.clearInput()};(0,U.useEffect)(()=>{if(h.current){if(l.current){l.current.updateCb(g);return}l.current=new tx(h.current,g)}},[h.current,a]);let _=()=>{n(),v({remove:s,add:a,targetThinos:t})},v=async({remove:e,add:t,targetThinos:n})=>{let r=m.current||!1,i=[];for(let a of n){let n=a.content;for(let t of e)n=n.replace(RegExp(`#${t}`,`g`),``);if(n=n.trim(),t.length>0&&(n=p.current===`Beginning`?`${t.map(e=>`#${e}`).join(` `)} ${r?`
|
||
`:``}${n}`:`${n} ${r?`
|
||
`:``}${t.map(e=>`#${e}`).join(` `)}`),a&&a.content!==n){let e=await V.updateMemo(a.id,n?.trim());i.push(e)}}i.length>0&&V.editMemoBulk(i),i.length>0&&z.clearQuery()};return(0,W.jsxs)(`div`,{className:`thino-tag-operation`,children:[(0,W.jsx)(`div`,{className:`tag-operation-title`,children:M(`Tag Bulk Edit`)}),(0,W.jsxs)(`div`,{className:`tag-operation-content`,children:[r.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`tag-operation-content-title exist-tags`,children:[(0,W.jsx)(`div`,{className:`name`,children:M(`Exist Tags`)}),(0,W.jsx)(`div`,{className:`desc`,children:M(`Click to remove exist tag`)})]}),(0,W.jsx)(`div`,{className:`tag-operation-content-tags exist-tags`,children:r.map(e=>(0,W.jsx)(`div`,{className:u_(`tag-operation-content-tag`,s.includes(e)&&`tag-operation-content-tag-removed`),onClick:()=>{s.includes(e)||c([...s,e]),s.includes(e)&&c(s.filter(t=>t!==e)),a.includes(e)&&o(a.filter(t=>t!==e))},children:e},e))})]}),(0,W.jsxs)(`div`,{className:`tag-operation-content-title selected-tags`,children:[(0,W.jsx)(`div`,{className:`name`,children:M(`Selected Tags`)}),(0,W.jsx)(`div`,{className:`desc`,children:M(`Click to remove selected tag`)})]}),(0,W.jsx)(`div`,{className:`tag-operation-content-tags selected-tags`,children:a.map(e=>(0,W.jsx)(`div`,{className:`tag-operation-content-tag`,onClick:()=>{o(a.filter(t=>t!==e))},children:e},e))}),(0,W.jsx)(`div`,{className:`tag-operation-content-inputer`,children:(0,W.jsx)(`input`,{placeholder:M(`Input to select exist tag`),ref:h,onKeyDown:e=>{e.key===`Enter`&&g(h.current.value)}})}),(0,W.jsxs)(`div`,{className:`tag-operation-settings`,children:[(0,W.jsx)(`div`,{ref:u}),(0,W.jsx)(`div`,{ref:d})]}),(0,W.jsxs)(`div`,{className:`tag-operation-content-btn-group`,children:[(0,W.jsx)(`button`,{className:`cancel-btn`,onClick:n,children:M(`Cancel`)}),(0,W.jsx)(`button`,{className:`save-btn`,onClick:_,children:M(`Save`)})]})]})]})};vi(),H(),Qr(),N(),Mv(),Cv(),_o(),Ce();var tC=async e=>{let t=e.querySelectorAll(`img`);for(let e of t)e.src.startsWith(`http://localhost`)?e.src=await Lx(e.getAttribute(`path`)||(0,f.normalizePath)(e?.parentElement?.getAttribute(`src`)||``)):e.src=await Lx(e.src)},nC=async()=>{let{verifyState:e}=L.getState(),t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),n=f.Platform.isDesktop?await Dv():t.identifier||t.uuid;return e&&e?.appId===n},rC=async(e,t)=>{if(!(t!==`chat`&&t!==`moments`)){if(t===`moments`){let t=e.querySelectorAll(`.thino-moment-icon`),n=e.find(`.moments-view-user-icon`),r=e.find(`.moments-view-background`);for(let e of t){let t=await zx(e);e.style.backgroundImage=`url(${t})`}if(n){let e=await zx(n);n.style.backgroundImage=`url(${e})`}if(r){let e=await zx(r);r.style.backgroundImage=`url(${e})`}}else if(t===`chat`){let t=e.querySelectorAll(`.icon-img`);for(let e of t){let t=await zx(e);e.style.backgroundImage=`url(${t})`}}}},iC=class extends f.Modal{constructor(e,t,n){super(e),this.title=t,this.cb=n}onOpen(){super.onOpen(),this.containerEl.toggleClass(`thino-bulk-action-dialog`,!0),this.titleEl.setText(this.title+` `+M(`Confirm?`)),this.contentEl.createEl(`button`,{cls:`mod-warning`,text:M(`Confirm?`).replace(/\?|?/,``)}).onclick=()=>{this.cb(`confirm`),this.close()},this.contentEl.createEl(`button`,{text:M(`Cancel`)}).onclick=()=>{this.cb(`cancel`),this.close()}}onClose(){super.onClose()}},aC=class extends f.Modal{root;constructor(e,t){super(e),this.thinos=t}onOpen(){super.onOpen(),this.containerEl.toggleClass([`thino-bulk-action-dialog`,`tag-actions`],!0),this.root=$g.createRoot(this.contentEl),this.root.render((0,W.jsx)(eC,{app:this.app,closeDialog:this.close.bind(this),thinos:this.thinos}))}onClose(){super.onClose(),this.root?.unmount()}},oC=({thinosCount:e,thinos:t})=>{let{memoListView:n}=si(),{query:r,pathname:i}=di(),{settings:a,app:o}=I(),{tag:s,duration:c,type:l,text:u,filter:d,path:p}=r,m=Bg.getQueryById(d),h=!!(s||c&&c.from<c.to||l||u||m||p),g=(0,U.useRef)(null);(0,U.useEffect)(()=>{g&&(0,f.setIcon)(g.current,`more-horizontal`)},[g]);let _=async()=>{if(!(t?.length>0))return;let e=XS(JS(t));await P.copyTextToClipboard(e),new f.Notice(M(`Copied to clipboard Successfully`))},v=async()=>{if(!(t?.length>0))return;if(!await nC()){Sv();return}let e=[...t],n=a.DeleteThinoDirectly;try{let t=e.filter(e=>e.sourceType===`DAILY`),r=e.filter(e=>e.sourceType!==`DAILY`);for(let e of r)if(n)await V.deleteMemoById(e.id);else{let t=await V.hideMemoById(e.id);t&&V.editMemo(t)}let i=lC(t);for(let{path:e,thinos:t}of i)await V.dealWithDailyThinoBulk(e,t,n?`deleteForever`:`delete`);V.updateTagsState(),z.clearQuery()}catch(e){console.error(`error`,e),new f.Notice(e.message)}},y=async()=>{if(!(t?.length>0))return;if(!await nC()){Sv();return}let e=[...t];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`);for(let e of n)await V.deleteMemoById(e.id);let r=lC(t);for(let{path:e,thinos:t}of r){let n=await V.dealWithDailyThinoBulk(e,t,`deleteForever`);for(let e of n)e?.webId&&await go.syncDelete(e.webId)}V.updateTagsState(),z.clearQuery(),new f.Notice(M(`DELETE SUCCEED`))}catch(e){console.error(`error`,e),new f.Notice(e.message)}},b=async()=>{if(!(t?.length>0))return;if(!await nC()){Sv();return}let e=[...t];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`),r=await V.unarchiveThinoBulk(n);for(let e of r)e&&V.editMemo(e);let i=lC(t);for(let{path:e,thinos:t}of i)await V.dealWithDailyThinoBulk(e,t,`restoreFromArchive`);new f.Notice(M(`RESTORE SUCCEED`)),V.updateTagsState(),z.clearQuery()}catch(e){console.error(`error`,e),new f.Notice(e.message)}},x=async()=>{if(!(t?.length>0))return;if(!await nC()){Sv();return}let e=[...t];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`);for(let e of n){let t=await V.restoreMemoById(e.id);t?.webId&&await go.syncRecover(t.webId),t&&V.editMemo(t)}let r=lC(t);for(let{path:e,thinos:t}of r){let n=await V.dealWithDailyThinoBulk(e,t,`restoreFromDelete`);for(let e of n)e?.webId&&await go.syncRecover(e.webId),e&&V.editMemo(e)}V.updateTagsState(),z.clearQuery(),new f.Notice(M(`RESTORE SUCCEED`))}catch(e){new f.Notice(e.message)}},S=async()=>{if(!(t?.length>0))return;if(!await nC()){Sv();return}let e=[...t];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`),r=await V.archiveThinoBulk(n);for(let e of r)e&&V.editMemo(e);let i=lC(t);for(let{path:e,thinos:t}of i)await V.dealWithDailyThinoBulk(e,t,`archive`);V.updateTagsState(),z.clearQuery()}catch(e){console.error(`error`,e),new f.Notice(e.message)}},C=async()=>{if(t?.length>0){if(!await nC()){Sv();return}new aC(o,t).open()}},w=async e=>{document.body.toggleClass(`thino-share-page`,!0),setTimeout(async()=>{if(new f.Notice(M(`Image is generating...`)),!e){new f.Notice(M(`No content to generate.`));return}await rC(e,n),await tC(e);let t;t=document.body.hasClass(`theme-dark`)?`#232323`:`#eaeaea`,console.log(e),xS(e,{backgroundColor:t,pixelRatio:window.devicePixelRatio*2}).then(t=>{if(a?.AutoSaveWhenOnMobile&&f.Platform.isMobile){let e=t.split(`base64,`)[1];Zr(e,`image/png`).arrayBuffer().then(async e=>{let t,n=ce();for(let e in n)if(n[e]instanceof f.TFile){t=n[e];break}t!==void 0&&await o.vault.createBinary(await vault.getAvailablePathForAttachments(`Pasted Image ${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,`png`,t),e)})}document.body.toggleClass(`thino-share-page`,!1),KS({imgUrl:t}),new f.Notice(M(`Image generated successfully.`)),e.hasClass(`share-image`)?e.toggleClass(`share-image`,!1):e.closest(`.share-image`).toggleClass(`share-image`,!1)}).catch(e=>{document.body.toggleClass(`thino-share-page`,!1),console.error(e)})},0)},T=e=>{let r=new f.Menu;switch(r.addItem(e=>{e.setTitle(M(`Clear filter`)).setIcon(`x`).onClick(async()=>{z.clearQuery()})}),r.addSeparator(),r.addItem(e=>{e.setTitle(M(`Copy filtered thinos`)).setIcon(`copy`).onClick(async()=>{await _()})}),r.addItem(e=>{e.setTitle(M(`Share filtered thinos as image`)).setIcon(`image`).onClick(async()=>{let e=document.querySelector(`.memolist-container`);e.toggleClass(`share-image`,!0);try{if(n===`calendar`)e.find(`.rbc-agenda-table`)&&await w(e.find(`.rbc-agenda-table`)),e.find(`.rbc-month-view`)&&await w(e.find(`.rbc-month-view`));else if(n===`table`){if(e.find(`.thino-table`)){let t=e.find(`.thino-table`);console.log(t),await w(t)}}else await w(e)}catch(t){console.error(t),new f.Notice(M(`Failed to generate image.`)),e.toggleClass(`share-image`,!1)}})}),r.addItem(e=>{e.setTitle(M(`Merge thinos in to thino share image`)).setIcon(`image`).onClick(async()=>{let e=``;t.forEach((n,r)=>{e+=`> [!thino] ${n.createdAt}\n${n.content.split(`
|
||
`).map(e=>(console.log(e),e.trim()?`> ${e}\n`:`>
|
||
`))}\n\n`+(r===t.length-1?`
|
||
|
||
`:`
|
||
|
||
------
|
||
|
||
`)}),console.log(e),RS({createdAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),updatedAt:(0,f.moment)().format(`YYYY/MM/DD HH:mm:ss`),content:e.replace(/(^|\n),>/g,`
|
||
>`),id:`temp-`+Math.random().toString(36).substr(2,9),thinoType:`JOURNAL`,sourceType:`DAILY`,rowStatus:`NORMAL`,visibility:`PRIVATE`,pinned:!1,creatorName:`thino`,deletedAt:``,path:``,resourceList:[]},`clean`)})}),r.addSeparator(),i){case`/`:r.addItem(e=>{e.setTitle(M(`Bulk tag operation`)).setIcon(`hash`).onClick(async()=>{await C()})}).addItem(e=>{e.setTitle(M(`Bulk archive`)).setIcon(`archive`).onClick(async()=>{new iC(o,M(`ARCHIVE`),async e=>{e===`confirm`&&await S()}).open()})}).addItem(e=>{e.setTitle(M(`Bulk delete`)).setIcon(`trash`).onClick(async()=>{new iC(o,M(`DELETE`),async e=>{e===`confirm`&&await v()}).open()})}).addItem(e=>{e.setTitle(M(`Send to file`)).setIcon(`file-output`).onClick(async()=>{if(!await nC()){Sv();return}t?.length>0&&hC(o,t)})});break;case`/archive`:r.addItem(e=>{e.setTitle(M(`Bulk restore`)).setIcon(`archive`).onClick(async()=>{new iC(o,M(`RESTORE`),async e=>{e===`confirm`&&await b()}).open()})}).addItem(e=>{e.setTitle(M(`Bulk delete`)).setIcon(`trash`).onClick(async()=>{new iC(o,M(`DELETE`),async e=>{e===`confirm`&&await v()}).open()})});break;case`/recycle`:r.addItem(e=>{e.setTitle(M(`Bulk restore`)).setIcon(`archive-restore`).onClick(async()=>{new iC(o,M(`RESTORE`),async e=>{e===`confirm`&&await x()}).open()})}).addItem(e=>{e.setTitle(M(`Bulk delete`)).setIcon(`trash`).onClick(async()=>{new iC(o,M(`DELETE`),async e=>{e===`confirm`&&await y()}).open()})});break}r.showAtMouseEvent(e.nativeEvent)};return(0,W.jsxs)(`div`,{className:`filter-query-container ${h?``:`thino-hidden`}`,children:[(0,W.jsxs)(`div`,{className:`filter-query`,children:[(0,W.jsx)(`span`,{className:`tip-text`,children:M(`FILTER`)}),(0,W.jsxs)(`div`,{"data-filter-type":`query`,className:`filter-item-container `+(m?``:`thino-hidden`),onClick:()=>{z.setMemoFilter(``)},children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`🔖`}),` `,m?.title]}),(0,W.jsxs)(`div`,{"data-filter-type":`tag`,className:`filter-item-container `+(s?``:`thino-hidden`),onClick:()=>{z.setTagQuery(``)},children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`🏷️`}),` `,s]}),(0,W.jsxs)(`div`,{"data-filter-type":`type`,className:`filter-item-container `+(l?``:`thino-hidden`),onClick:()=>{z.setMemoTypeQuery(``)},children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`📦`}),` `,lv(l)]}),c&&c.from<c.to&&(0,W.jsxs)(`div`,{"data-filter-type":`date`,className:`filter-item-container`,children:[(0,W.jsxs)(`div`,{className:`day-picker-component-group`,children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`🗓️`}),` `,(0,W.jsx)(Yb,{type:`text`,startOrEnd:`start`,defaultValue:(0,f.moment)(c.from,`x`).valueOf(),handleValueChange:e=>{let t=(0,f.moment)(c.to,`x`),n=(0,f.moment)(e,`x`),r=n.isAfter(t)||n.isSame(t);z.setFromAndToQuery(r?t.startOf(`day`).valueOf():(0,f.moment)(e,`x`).startOf(`day`).valueOf(),c.to)}}),(0,W.jsx)(`span`,{children:M(`to`)}),(0,W.jsx)(Yb,{type:`text`,startOrEnd:`end`,defaultValue:(0,f.moment)(c.to,`x`).add(1,`days`).valueOf(),handleValueChange:e=>{let t=(0,f.moment)(c.from,`x`),n=(0,f.moment)(e,`x`),r=n.isBefore(t)||n.isSame(t),i=(0,f.moment)(e,`x`).endOf(`day`).valueOf();console.log(`end`,(0,f.moment)(e,`x`).add(1,`days`).format(`YYYY-MM-DD HH:mm:ss`)),z.setFromAndToQuery(c.from,r?t.endOf(`day`).valueOf():i)}})]}),(0,W.jsx)(`div`,{ref:e=>e&&(0,f.setIcon)(e,`x`),className:`btn close-btn`,onClick:()=>{z.setFromAndToQuery(0,0)}})]}),(0,W.jsxs)(`div`,{className:`filter-item-container `+(u?``:`thino-hidden`),onClick:()=>{z.setTextQuery(``)},children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`🔍`}),` `,u]}),(0,W.jsxs)(`div`,{className:`filter-item-container `+(p?``:`thino-hidden`),onClick:()=>{z.setPathQuery(``)},children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`📦`}),` `,(0,W.jsx)(`span`,{className:`path-text`,children:p})]})]}),(0,W.jsxs)(`div`,{className:`thino-filter-items`,children:[e&&(0,W.jsx)(`div`,{className:`thinos-count`,children:`${e?`${e} Thinos `:``}`}),(0,W.jsx)(`div`,{ref:g,className:`btn memo-action-menu`,onClick:T})]})]})};Qr(),H(),N(),vi(),os();var sC=e=>{let{app:t,settings:n,view:r}=I(),{memo:i,handleUnarchivedMemoAction:a}=e,o=U.useRef(null),s=U.useRef(null),[c,l]=U.useState(``),u={...i,createdAtStr:P.getDateTimeString(i.createdAt),deletedAtStr:P.getDateTimeString(i.deletedAt||i.createdAt)},d=(0,U.useRef)(null);(0,U.useEffect)(()=>{!s||!d.current||(0,f.setIcon)(d.current,`more-horizontal`)},[s]),(0,U.useEffect)(()=>{if(!o.current||!s.current||o.current.hasChildNodes()&&i.content===c||!r)return;l(i.content),o.current.hasChildNodes()&&o.current.empty();async function e(){o.current?.toggleClass([`markdown-rendered`],!0),await f.MarkdownRenderer.render(t,i.content+`
|
||
`,o.current,i.path,r),(o.current?.querySelectorAll(`.internal-link`))?.forEach(e=>{let n=e,a=n.getAttribute(`data-href`);a&&(t.metadataCache.getFirstLinkpathDest(a,i.path)||e.classList.add(`is-unresolved`),n.addEventListener(`mouseover`,e=>{e.stopPropagation(),t.workspace.trigger(`hover-link`,{event:e,source:`thino`,hoverParent:r.containerEl,targetEl:n,linktext:a,sourcePath:n.href})}))})}e()},[i.content,s]);let p=async()=>{switch(u.sourceType){case`DAILY`:await rs(u.id,u.path);break;case`CANVAS`:await as(u.id,u.path);break;case`MULTI`:await ns(u.path);break;case`FILE`:await is(u.id,u.path);break;case`JOURNAL`:await rs(u.id,u.path);break}},m=async()=>{try{if(n.DeleteThinoDirectly)await V.deleteMemoById(u.id);else{let e=await V.hideMemoById(u.id);e&&V.editMemo(e)}}catch(e){new f.Notice(e.message)}},h=async()=>{try{let e=await V.unarchiveMemo(u);e&&V.editMemo(e),a(u.id),new f.Notice(M(`RESTORE SUCCEED`))}catch(e){new f.Notice(e.message)}};return(0,W.jsxs)(`div`,{ref:s,className:`memo-wrapper ${`memos-`+u.id}`,children:[(0,W.jsxs)(`div`,{className:`memo-top-wrapper`,children:[(0,W.jsxs)(`span`,{className:`time-text`,children:[M(`ARCHIVED AT`),` `,u.updatedAt]}),(0,W.jsx)(`div`,{className:`btns-container`,children:(0,W.jsx)(`span`,{ref:d,className:`btn more-action-btn`,onClick:e=>{e.stopPropagation();let t=new f.Menu;t.addItem(e=>{e.setTitle(M(`RESTORE`)).setIcon(`archive-restore`).onClick(h)}),t.addItem(e=>{e.setTitle(M(`SOURCE`)).setIcon(`home`).onClick(p)}),t.addItem(t=>{t.setTitle(M(`DELETE`)).setIcon(`trash`).setWarning(!0).onClick(()=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(M(`CONFIRM!`)).setIcon(`trash`).setWarning(!0).onClick(m)}),t.addItem(e=>{e.setTitle(M(`Cancel`)).setIcon(`x`).onClick(()=>{})}),t.showAtMouseEvent(e.nativeEvent)})}),t.showAtMouseEvent(e.nativeEvent)}})})]}),(0,W.jsx)(`div`,{ref:o,className:`memo-content-text`})]})};H(),N();var cC=({title:e,showSidebar:t=!1,onShowSidebarClick:n,showHomeButton:r=!0,children:i,rightContent:a})=>{let o=(0,U.useCallback)(()=>{n?n():R.setShowSiderbarInMobileView(!0)},[n]),s=(0,U.useCallback)(()=>{z.clearQuery(),z.setPathname(`/`)},[]);return(0,W.jsxs)(`div`,{className:`section-header-container`,children:[(0,W.jsx)(`div`,{className:`title-wrapper`,children:(0,W.jsx)(`div`,{className:`title-btns-left-wrapper`,children:(0,W.jsxs)(`div`,{className:`title-text`,children:[t&&(0,W.jsx)(xv,{when:!0,children:(0,W.jsx)(`button`,{ref:e=>{e&&(0,f.setIcon)(e,`menu`)},className:`btn action-btn clickable-icon`,onClick:o})}),e&&(0,W.jsx)(`span`,{className:`normal-text`,children:e}),r&&(0,W.jsxs)(`button`,{className:`go-home-btn`,onClick:s,children:[`🏠 `,M(`Return To Home Page`)]}),i]})})}),a&&(0,W.jsx)(`div`,{className:`title-btns-right-wrapper`,children:a})]})};vi(),H(),N(),Cv(),mg();var lC=e=>{let t=new Map;for(let n of e){let e=n.path;t.has(e)||t.set(e,[]),t.get(e)?.push(n)}return Array.from(t).map(([e,t])=>({path:e,thinos:t}))},uC=()=>{let{query:e}=di(),{isMobileView:t}=si(),{memos:n}=F(),{plugin:r}=I(),i=Rb(),[a,o]=(0,U.useState)([]),s=U.useRef(null),c=U.useRef(null);(0,U.useEffect)(()=>{c.current&&(0,f.setIcon)(c.current,`more-horizontal`)},[c]),(0,U.useEffect)(()=>{console.log(n),pg({memos:n,query:e,filterOptions:{filterDoneTasks:!1,onlyFilterType:`archived`},plugin:r}).then(e=>{console.log(e),o(e)}),i.setFinish()},[n,s.current,e]);let l=(0,U.useCallback)(e=>{o(t=>t.filter(t=>t.id!==e))},[]),u=(0,U.useCallback)(e=>{o(t=>t.filter(t=>t.id!==e))},[]);(0,U.useCallback)(()=>{R.setShowSiderbarInMobileView(!0)},[]);let d=async()=>{if(!(a?.length>0))return;if(!await nC()){Sv();return}let e=[...a];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`),r=await V.unarchiveThinoBulk(n);for(let e of r)e&&V.editMemo(e);let i=lC(t);for(let{path:e,thinos:t}of i)await V.dealWithDailyThinoBulk(e,t,`restoreFromArchive`);new f.Notice(M(`RESTORE SUCCEED`)),z.clearQuery()}catch(e){console.error(`error`,e),new f.Notice(e.message)}},p=async()=>{if(!(a?.length>0))return;if(!await nC()){Sv();return}let e=[...a],t=L.getState().settings.DeleteThinoDirectly;try{let n=e.filter(e=>e.sourceType===`DAILY`),r=e.filter(e=>e.sourceType!==`DAILY`);for(let e of r)if(t)await V.deleteMemoById(e.id);else{let t=await V.hideMemoById(e.id);t&&V.editMemo(t)}let i=lC(n);for(let{path:e,thinos:n}of i)await V.dealWithDailyThinoBulk(e,n,t?`deleteForever`:`delete`);z.clearQuery()}catch(e){console.error(`error`,e),new f.Notice(e.message)}};return(0,W.jsxs)(`div`,{className:`memo-trash-wrapper`,ref:s,children:[(0,W.jsx)(cC,{showSidebar:t,rightContent:(0,W.jsx)(`div`,{className:`header-right-section`,children:(0,W.jsx)(bv,{disableSuper:!0})}),children:(0,W.jsx)(`span`,{ref:c,className:`menu-popup-btn`,onClick:e=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(M(`Bulk restore`)).setIcon(`archive`).onClick(async()=>{new iC(app,M(`RESTORE`),async e=>{e===`confirm`&&await d()}).open()})}).addItem(e=>{e.setTitle(M(`Bulk delete`)).setIcon(`trash`).onClick(async()=>{new iC(app,M(`DELETE`),async e=>{e===`confirm`&&await p()}).open()})}),t.showAtMouseEvent(e.nativeEvent)}})}),(0,W.jsx)(oC,{thinosCount:a.length,thinos:a}),i.isLoading?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`p`,{className:`tip-text`,children:M(`Fetching data...`)})}):a.length===0?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`p`,{className:`tip-text`,children:M(`Here is No Memos.`)})}):(0,W.jsx)(`div`,{className:`deleted-memos-container`,children:a.map(e=>(0,W.jsx)(sC,{memo:e,handleUnarchivedMemoAction:u,handleDeletedMemoAction:l},`${e.id}-${e.updatedAt}`))})]})};N(),H();function dC(e,t){return e.map(e=>{let n=e.createdAt,r=e.content;switch(t){case`list`:return`- ${r.split(`
|
||
`).join(`
|
||
`)}\n - ${M(`Source`)}: ${n}`;case`callout`:return`> [!thino] ${n}\n${r.split(`
|
||
`).map(e=>`> ${e}`).join(`
|
||
`)}`;case`plain`:return r;default:return r}}).join(`
|
||
|
||
`)}async function fC(e,t,n,r,i){try{let a=dC(t,r);await e.vault.append(n,`
|
||
`+a+`
|
||
`);let o=t.filter(e=>e.sourceType===`DAILY`),s=t.filter(e=>e.sourceType!==`DAILY`);if(i===`archive`){let e=await V.archiveThinoBulk(s);for(let t of e)t&&V.editMemo(t);let t=lC(o);for(let{path:e,thinos:n}of t)await V.dealWithDailyThinoBulk(e,n,`archive`)}else if(i===`delete`){for(let e of s){let t=await V.hideMemoById(e.id);t&&V.editMemo(t)}let e=lC(o);for(let{path:t,thinos:n}of e)await V.dealWithDailyThinoBulk(t,n,`delete`)}V.updateTagsState(),new f.Notice(M(`ORGANIZE SUCCEED`))}catch(e){console.error(`Organize failed:`,e),new f.Notice(e.message||M(`Organize failed`))}}var pC=class extends f.Modal{format=`list`;postAction=`archive`;constructor(e,t,n){super(e),this.memos=t,this.targetFile=n}onOpen(){let{contentEl:e}=this;this.titleEl.setText(M(`Send to file`)),this.containerEl.toggleClass(`thino-organize-dialog`,!0),e.createEl(`p`,{text:`${M(`Target`)}: ${this.targetFile.path}`,cls:`organize-target-path`}),new f.Setting(e).setName(M(`Content format`)).addDropdown(e=>{e.addOption(`list`,M(`List item`)).addOption(`callout`,M(`Callout`)).addOption(`plain`,M(`Plain text`)).setValue(this.format).onChange(e=>{this.format=e})}),new f.Setting(e).setName(M(`After sending`)).addDropdown(e=>{e.addOption(`archive`,M(`Archive originals`)).addOption(`delete`,M(`Delete originals`)).setValue(this.postAction).onChange(e=>{this.postAction=e})}),e.createEl(`p`,{text:`${this.memos.length} Thino(s)`,cls:`organize-memo-count`});let t=e.createDiv({cls:`modal-button-container`});t.createEl(`button`,{text:M(`Cancel`)}).addEventListener(`click`,()=>{this.close()});let n=t.createEl(`button`,{text:M(`Confirm`),cls:`mod-cta`});n.addEventListener(`click`,async()=>{n.disabled=!0,n.setText(M(`Processing...`)),await fC(this.app,this.memos,this.targetFile,this.format,this.postAction),this.close()})}onClose(){this.contentEl.empty()}},mC=class extends f.FuzzySuggestModal{constructor(e,t){super(e),this.memos=t,this.setPlaceholder(M(`Select target file`))}getItems(){return this.app.vault.getMarkdownFiles()}getItemText(e){return e.path}onChooseItem(e){new pC(this.app,this.memos,e).open()}};function hC(e,t){new mC(e,t).open()}Qr(),N(),Wr(),ur(),H();var gC=e=>{let{memo:t,memoListView:n,handlePinMemoClick:r,handleFixMemoClick:i,handleSourceMemoClick:a,handleShowMemoStoryDialog:o,handleCopyMemoClick:s,handleEditMemoClick:c,handleGenMemoImageBtnClick:l,handleMarkMemoClick:u,handleArchiveMemo:d,handleDeleteMemoClick:p,handleSplitMemoClick:m,handleCopyEmbedLink:h,handleReferenceLinksGroupClick:g,handleLockMemo:_,canLockMemo:v}=e,y=z.getState().query.tag,b=lr.getState().dailyNotesState.settings,x=b.EnabledLocationList.find(e=>e.value===`MULTI`),S=(0,U.useRef)(null),C={pinRef:(0,U.useRef)(null),fixRef:(0,U.useRef)(null),typeRef:(0,U.useRef)(null),referenceLinksGroupRef:(0,U.useRef)(null),moreRef:(0,U.useRef)(null)},[w,T]=qS({mouseEnterDelayMS:500}),E=(0,U.useRef)();(0,U.useEffect)(()=>{if(!C.typeRef)return;let e=Ur.find(e=>e.title===t.sourceType);(0,f.setIcon)(C.typeRef.current,e.icon),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(C.typeRef.current,t.path),C.fixRef&&((0,f.setIcon)(C.fixRef.current,`shield-alert`),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(C.fixRef.current,`Update Thino property`)),C.referenceLinksGroupRef&&b?.enableReferenceLinksGroup&&((0,f.setIcon)(C.referenceLinksGroupRef.current,`link`),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(C.referenceLinksGroupRef.current,`Reference links group`))},[C.typeRef,C.referenceLinksGroupRef]),(0,U.useEffect)(()=>{C.pinRef&&(t.pinned?((0,f.setIcon)(C.pinRef.current,`pin-off`),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(C.pinRef.current,M(`UNPIN`))):((0,f.setIcon)(C.pinRef.current,`pin`),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(C.pinRef.current,M(`PIN`))))},[C.pinRef,t.pinned]);let D=(0,f.debounce)(()=>{if(w&&C.moreRef.current){if(E.current&&E.current._loaded||E.current?.useNativeMenu||document.body.find(`.more-action-btns-wrapper`))return;let e=O(),t=C.moreRef.current.getBoundingClientRect();e.showAtPosition({x:t.left,y:t.bottom})}},200);(0,U.useEffect)(()=>{D()},[w]);let O=()=>{let e=new f.Menu;return e.dom.toggleClass([`more-action-btns-wrapper`],!0),e.useNativeMenu?(e.setNoIcon(),e.addItem(e=>{e.setTitle(M(`COPY`)).onClick(s)}),e.addItem(e=>{e.setTitle(M(`EDIT`)).onClick(c)}),e.addItem(e=>{e.setTitle(M(`SHARE`)).onClick(l)})):e.addItem(t=>{let n=t.dom;t.dom.empty(),t.dom.toggleClass([`more-action-btn-group`,`more-action-menu-item`],!0);let r=n.createEl(`span`);new f.ExtraButtonComponent(r).setIcon(`copy`),r.toggleClass([`menu-item-icon`,`more-action-item-icon`],!0),r.onclick=t=>{t.stopPropagation(),t.preventDefault(),s(),e.close()};let i=n.createEl(`span`);i.toggleClass([`menu-item-icon`,`more-action-item-icon`],!0),i.onclick=t=>{t.stopPropagation(),t.preventDefault(),c(),e.close()},new f.ExtraButtonComponent(i).setIcon(`pencil`);let a=n.createEl(`span`);a.toggleClass([`menu-item-icon`,`more-action-item-icon`],!0),a.onclick=t=>{t.stopPropagation(),t.preventDefault(),l(),e.close()},new f.ExtraButtonComponent(a).setIcon(`share-2`)}),e.addSeparator(),t.sourceType===`DAILY`&&(e.addItem(e=>{e.setIcon(`copy`).setTitle(M(`Copy embed link`)).onClick(()=>{h(!0)})}),e.addItem(e=>{e.setIcon(`copy`).setTitle(M(`Copy link`)).onClick(()=>{h(!1)})}),e.addSeparator()),e.addItem(e=>{e.setIcon(`book-open`).setTitle(M(`READ`)).onClick(()=>o(new MouseEvent(`click`)))}),e.addItem(e=>{e.setIcon(`bookmark`).setTitle(M(`MARK`)).onClick(u)}),/(^|\n)#{1,6}\s/g.exec(t.content)?.length>1&&x&&e.addItem(e=>{e.setIcon(`separator-horizontal`).setTitle(M(`SPLIT`)).onClick(m)}),e.addItem(e=>{e.setIcon(`home`).setTitle(M(`SOURCE`)).onClick(()=>a(t))}),v&&_&&e.addItem(t=>{t.setIcon(`lock`).setTitle(M(`Lock`)).onClick(()=>{_(),e.close()})}),e.addItem(n=>{n.setIcon(`file-output`).setTitle(M(`Send to file`)).onClick(()=>{let n=lr.getState().dailyNotesState.app;hC(n,[t]),e.close()})}),e.addSeparator(),e.addItem(e=>{e.setWarning(!0).setIcon(`archive`).setTitle(M(`ARCHIVE`).toUpperCase()).onClick(()=>d(t))}),e.addItem(e=>{e.setWarning(!0).setIcon(`trash`).setTitle(b.DeleteThinoDirectly?M(`DELETE`):M(`TRASH BOX`).toUpperCase()).onClick(()=>{let e=lr.getState().dailyNotesState.app,t=new f.Modal(e);t.titleEl.setText(M(`Confirm`)),t.contentEl.createEl(`p`,{text:M(`Are you sure you want to delete this thino?`)});let n=t.contentEl.createDiv({cls:`modal-button-container`});n.createEl(`button`,{text:M(`Cancel`)}).addEventListener(`click`,()=>{t.close()}),n.createEl(`button`,{text:M(`Confirm`),cls:`mod-warning`}).addEventListener(`click`,()=>{p(),t.close()}),t.open()})}),e.addSeparator(),e.addItem(e=>{e.setDisabled(!0).setTitle(P.getWordCount(t.content.replace(/```[^\S\r\n]*[a-z]*\n.*?\n```/g,``))+` ${M(`words`)}`)}),e.onHide(()=>{}),E.current=e,e},k=e=>{O().showAtMouseEvent(e.nativeEvent)};return(0,W.jsxs)(`div`,{ref:S,className:`memo-top-right-wrapper`,children:[y&&b.FilterByMetadata?t.content.includes(y)?(0,W.jsx)(`span`,{className:`tag-text tag-in-content`,children:M(`Matched via tag in content`)}):t.fileInfo?.tags.includes(y)?(0,W.jsx)(`span`,{className:`tag-text tag-in-file`,children:M(`Matched via tag in file`)}):null:null,(0,W.jsxs)(`div`,{className:`btns-container`,children:[(0,W.jsx)(`span`,{ref:C.fixRef,className:`btn ${t.sourceType!==`MULTI`||t.id!==``?`thino-hidden`:``} fix-memo-btn`,onClick:()=>i(t)}),b?.enableReferenceLinksGroup&&(0,W.jsx)(`span`,{ref:C.referenceLinksGroupRef,className:`btn ${n===`list`||n===`moments`?`thino-hidden`:``} reference-links-group-btn`,onClick:g}),(0,W.jsx)(`span`,{ref:C.typeRef,className:`btn ${t.sourceType===`DAILY`?`thino-hidden`:``} source-type-btn`,onClick:()=>a(t)}),(0,W.jsx)(`span`,{ref:C.pinRef,className:`btn ${e.memo.pinned?`pinned-btn`:`unpinned-btn`} pro`,onClick:r}),(0,W.jsx)(`span`,{...T,ref:e=>{C.moreRef.current=e,e&&(0,f.setIcon)(e,`more-horizontal`)},onClick:k,className:`btn more-action-btn`})]})]})};H();var _C=e=>{let{memo:t,handleMemoTypeToggle:n,handleShowMemoStoryDialog:r,settings:i}=e,a=t.fileInfo?.frontmatter?.title||t.path.split(`/`).pop().split(`.`).shift();return(0,W.jsxs)(`div`,{className:`memo-top-left-wrapper`,children:[e.children,(0,W.jsx)(`span`,{title:t.createdAt,className:`time-text`,onClick:e=>r(e),children:t.createdAt}),(0,W.jsx)(`div`,{className:`btn memo-type-img ${i?.ShowTaskLabel?``:`thino-hidden`}`,onClick:n,children:t.thinoType!==`JOURNAL`&&(0,W.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)})}),i?.ShowSourcePath&&(t.sourceType===`FILE`||t.sourceType===`MULTI`)&&(0,W.jsx)(`span`,{className:`time-text source-path`,"aria-label":a,onClick:()=>{z.setPathQuery(a)},children:a})]})},vC=()=>({type:`initialText`,value:``,timestamp:Date.now(),selectionStart:0,selectionEnd:0}),yC={initialValue:``,interval:300},bC=class{constructor(e,t=yC){this.listeners=[],this.runUndo=()=>{let e=this.actions[this.currentIndex].selectionStart;this.currentIndex>0&&this.currentIndex--,this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(e,e),this.dispatchChange()},this.runRedo=()=>{this.currentIndex<this.actions.length-1&&this.currentIndex++;let e=this.actions[this.currentIndex].selectionEnd;this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(e,e),this.dispatchChange()},this.getActions=()=>this.actions,this.setState=(e,t)=>{this.actions=[...e],this.currentIndex=t<this.actions.length?t:this.actions.length-1,this.dispatchChange()},this.resetState=()=>{this.actions=[vC()],this.currentIndex=0,this.dispatchChange()},this.destroy=()=>{this.rmEventListeners()},this.subscribe=e=>{this.listeners.push(e)},this.handleElementKeydown=e=>{let t=e;t.key===`z`&&!t.shiftKey&&(t.metaKey||t.ctrlKey)?(e.preventDefault(),this.runUndo()):(t.key===`z`&&t.shiftKey&&(t.metaKey||t.ctrlKey)||t.key===`y`&&(t.metaKey||t.ctrlKey))&&(e.preventDefault(),this.runRedo())},this.handleElementInput=e=>{let t=e,n=this.actions[this.currentIndex];this.pushNewAction({type:t.inputType,value:this.element.value,timestamp:Date.now(),selectionStart:this.element.selectionEnd-(this.element.value.length-n.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=e=>{let t=this.actions[this.currentIndex];t&&t.type===e.type&&e.timestamp-t.timestamp<this.config.interval?this.actions[this.currentIndex]=Object.assign(Object.assign({},t),{value:e.value,selectionEnd:e.selectionEnd,timestamp:e.timestamp}):(this.config.maxSize&&this.currentIndex>=this.config.maxSize?(this.actions.shift(),this.actions[0]=vC()):this.currentIndex++,this.actions[this.currentIndex]=e,this.actions=this.actions.slice(0,this.currentIndex+1)),this.dispatchChange()},this.dispatchChange=()=>{for(let e of this.listeners)e([...this.actions],this.currentIndex)},this.element=e,this.config=Object.assign(Object.assign({},yC),t),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=[vC()],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 xC(){let[,e]=(0,U.useState)(!1);return(0,U.useCallback)(()=>{e(e=>!e)},[])}var SC=s(((e,t)=>{(function(){var e=`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`.split(`.`),n=typeof window<`u`,r=n&&window.mozInnerScreenX!=null;function i(t,i,a){if(!n)throw Error(`textarea-caret-position#getCaretCoordinates should only be called in a browser`);var o=a&&a.debug||!1;if(o){var s=document.querySelector(`#input-textarea-caret-position-mirror-div`);s&&s.parentNode.removeChild(s)}var c=document.createElement(`div`);c.id=`input-textarea-caret-position-mirror-div`,document.body.appendChild(c);var l=c.style,u=window.getComputedStyle?getComputedStyle(t):t.currentStyle;l.whiteSpace=`pre-wrap`,t.nodeName!==`INPUT`&&(l.wordWrap=`break-word`),l.position=`absolute`,o||(l.visibility=`hidden`),e.forEach(function(e){l[e]=u[e]}),r?t.scrollHeight>parseInt(u.height)&&(l.overflowY=`scroll`):l.overflow=`hidden`,c.textContent=t.value.substring(0,i),t.nodeName===`INPUT`&&(c.textContent=c.textContent.replace(/\s/g,`\xA0`));var d=document.createElement(`span`);d.textContent=t.value.substring(i)||`.`,c.appendChild(d);var f={top:d.offsetTop+parseInt(u.borderTopWidth),left:d.offsetLeft+parseInt(u.borderLeftWidth)};return o?d.style.backgroundColor=`#aaa`:document.body.removeChild(c),f}t!==void 0&&t.exports!==void 0?t.exports=i:n&&(window.getCaretCoordinates=i)})()})),CC=s(((e,t)=>{var n=globalThis.CustomEvent;function r(){try{var e=new n(`cat`,{detail:{foo:`bar`}});return e.type===`cat`&&e.detail.foo===`bar`}catch{}return!1}t.exports=r()?n:typeof document<`u`&&typeof document.createEvent==`function`?function(e,t){var n=document.createEvent(`CustomEvent`);return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=!!t.bubbles,n.cancelable=!!t.cancelable,n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}})),wC=u(SC()),TC=u(CC());function EC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DC(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(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){EC(e,t,n[t])})}return e}function OC(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function kC(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 AC(e,t,n){return t&&kC(e.prototype,t),n&&kC(e,n),e}function jC(e){return jC=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},jC(e)}function MC(e){return MC=typeof Symbol==`function`&&jC(Symbol.iterator)===`symbol`?function(e){return jC(e)}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:jC(e)},MC(e)}function NC(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function PC(e,t){return t&&(MC(t)===`object`||typeof t==`function`)?t:NC(e)}function FC(e){return FC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},FC(e)}function IC(e,t){return IC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},IC(e,t)}function LC(e,t){if(typeof t!=`function`&&t!==null)throw 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&&IC(e,t)}function RC(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function zC(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)===`[object Arguments]`)return Array.from(e)}function BC(){throw TypeError(`Invalid attempt to spread non-iterable instance`)}function VC(e){return RC(e)||zC(e)||BC()}var HC={ESC:27,UP:38,DOWN:40,LEFT:37,RIGHT:39,ENTER:13,TAB:9},UC=new function e(){var t=this;OC(this,e),this.startListen=function(e){e&&e.addEventListener(`keydown`,t.f)},this.stopListen=function(e){e&&e.removeEventListener(`keydown`,t.f)},this.add=function(e,n){var r=e;return typeof r!=`object`&&(r=[r]),t.listeners[t.index]={keyCode:r,fn:n},t.index++},this.remove=function(e){delete t.listeners[e]},this.removeAll=function(){t.listeners={},t.index=1},this.index=1,this.listeners={},this.f=function(e){if(e){var n=e.keyCode||e.which;Object.values(t.listeners).forEach(function(t){var r=t.keyCode,i=t.fn;r.includes(n)&&(e.stopPropagation(),e.preventDefault(),i(e))})}}},WC=function(e){LC(t,e);function t(){var e,n;OC(this,t);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=PC(this,(e=FC(t)).call.apply(e,[this].concat(i))),n.selectItem=function(){var e=n.props,t=e.item,r=e.onSelectHandler;r(t)},n}return AC(t,[{key:`shouldComponentUpdate`,value:function(e){return this.props.item!==e.item||this.props.selected!==e.selected||this.props.style!==e.style||this.props.className!==e.className}},{key:`render`,value:function(){var e=this,t=this.props,n=t.component,r=t.style,i=t.onClickHandler,a=t.item,o=t.selected,s=t.className,c=t.innerRef;return U.createElement(`li`,{className:`rta__item ${o===!0?`rta__item--selected`:``} ${s||``}`,style:r},U.createElement(`div`,{className:`rta__entity ${o===!0?`rta__entity--selected`:``}`,role:`button`,tabIndex:0,onClick:i,onFocus:this.selectItem,onMouseEnter:this.selectItem,onTouchStart:function(){e.clicked=!0,e.selectItem()},onTouchEnd:function(t){t.preventDefault(),e.clicked&&i(t)},onTouchMove:function(){e.clicked=!1},onTouchCancel:function(){e.clicked=!1},ref:c},U.createElement(n,{selected:o,entity:a})))}}]),t}(U.Component),GC=function(e){LC(t,e);function t(){var e,n;OC(this,t);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=PC(this,(e=FC(t)).call.apply(e,[this].concat(i))),n.state={selectedItem:null},n.cachedIdOfItems=new Map,n.onPressEnter=function(e){e!==void 0&&e.preventDefault();var t=n.props.values;n.modifyText(t[n.getPositionInList()])},n.getPositionInList=function(){var e=n.props.values,t=n.state.selectedItem;return t?e.findIndex(function(e){return n.getId(e)===n.getId(t)}):0},n.getId=function(e){if(n.cachedIdOfItems.has(e))return n.cachedIdOfItems.get(e);var t=n.props.getTextToReplace(e),r=function(){if(t){if(t.key)return t.key;if(typeof e==`string`||!e.key)return t.text}if(!e.key)throw Error(`Item ${JSON.stringify(e)} has to have defined "key" property`);return e.key}();return n.cachedIdOfItems.set(e,r),r},n.listeners=[],n.itemsRef={},n.modifyText=function(e){if(e){var t=n.props.onSelect;t(e)}},n.selectItem=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=n.props.onItemHighlighted;n.state.selectedItem!==e&&n.setState({selectedItem:e},function(){r(e),t&&n.props.dropdownScroll(n.itemsRef[n.getId(e)])})},n.scroll=function(e){e.preventDefault();var t=n.props.values,r=e.keyCode||e.which,i=n.getPositionInList(),a;switch(r){case HC.DOWN:a=i+1;break;case HC.UP:a=i-1;break;default:a=i;break}a=(a%t.length+t.length)%t.length,n.selectItem(t[a],[HC.DOWN,HC.UP].includes(r))},n.isSelected=function(e){var t=n.state.selectedItem;return t?n.getId(t)===n.getId(e):!1},n}return AC(t,[{key:`componentDidMount`,value:function(){this.listeners.push(UC.add([HC.DOWN,HC.UP],this.scroll),UC.add([HC.ENTER,HC.TAB],this.onPressEnter));var e=this.props.values;e&&e[0]&&this.selectItem(e[0])}},{key:`componentDidUpdate`,value:function(e){var t=this,n=e.values,r=this.props.values;n.map(function(e){return t.getId(e)}).join(``)!==r.map(function(e){return t.getId(e)}).join(``)&&r&&r[0]&&this.selectItem(r[0])}},{key:`componentWillUnmount`,value:function(){for(var e;this.listeners.length;)e=this.listeners.pop(),UC.remove(e)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.values,r=t.component,i=t.style,a=t.itemClassName,o=t.className,s=t.itemStyle;return U.createElement(`ul`,{className:`rta__list ${o||``}`,style:i},n.map(function(t){return U.createElement(WC,{key:e.getId(t),innerRef:function(n){e.itemsRef[e.getId(t)]=n},selected:e.isSelected(t),item:t,className:a,style:s,onClickHandler:e.onPressEnter,onSelectHandler:e.selectItem,component:r})}))}}]),t}(U.Component);function KC(e,t){var n=parseInt(getComputedStyle(t).getPropertyValue(`height`),10),r=parseInt(getComputedStyle(e).getPropertyValue(`height`),10)-n,i=t.offsetTop,a=e.scrollTop;i<a+r&&a<i||(e.scrollTop=i)}var qC=`next`,JC={X:{LEFT:`rta__autocomplete--left`,RIGHT:`rta__autocomplete--right`},Y:{TOP:`rta__autocomplete--top`,BOTTOM:`rta__autocomplete--bottom`}},YC=function(e){return console.error(`RTA: dataProvider fails: ${e}
|
||
|
||
Check the documentation or create issue if you think it's bug. https://github.com/webscopeio/react-textarea-autocomplete/issues`)},XC=[`.`,`^`,`$`,`*`,`+`,`-`,`?`,`(`,`)`,`[`,`]`,`{`,`}`,`\\`,`|`],ZC=function(e){return VC(e).map(function(e){return XC.includes(e)?`\\${e}`:e}).join(``)},QC=function(e){LC(t,e);function t(){return OC(this,t),PC(this,FC(t).apply(this,arguments))}return AC(t,[{key:`componentDidMount`,value:function(){var e=this.props.boundariesElement;if(typeof e==`string`){var t=document.querySelector(e);if(!t)throw Error(`RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.`);this.containerElem=t}else if(e instanceof HTMLElement)this.containerElem=e;else throw Error(`RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.`);if(!this.containerElem||!this.containerElem.contains(this.ref))throw Error(`RTA: Invalid prop boundariesElement: it has to be one of the parents of the RTA.`)}},{key:`componentDidUpdate`,value:function(){var e,t,n=this.props.top||0,r=this.props.left||0,i=[],a=[],o=0,s=0,c=this.containerElem.getBoundingClientRect(),l=this.ref.getBoundingClientRect(),u=this.props.textareaRef.getBoundingClientRect(),d=window.getComputedStyle(this.ref),f=parseInt(d.getPropertyValue(`margin-top`),10),p=parseInt(d.getPropertyValue(`margin-bottom`),10),m=parseInt(d.getPropertyValue(`margin-left`),10),h=parseInt(d.getPropertyValue(`margin-right`),10),g=f+p+u.top+n+l.height;m+h+u.left+r+l.width>c.right&&u.left+r>l.width?(s=r-l.width,i.push(JC.X.LEFT),a.push(JC.X.RIGHT)):(s=r,i.push(JC.X.RIGHT),a.push(JC.X.LEFT)),g>c.bottom&&u.top+n>l.height?(o=n-l.height,i.push(JC.Y.TOP),a.push(JC.Y.BOTTOM)):(o=n,i.push(JC.Y.BOTTOM),a.push(JC.Y.TOP)),this.props.renderToBody&&(o+=u.top,s+=u.left),this.ref.style.top=`${o}px`,this.ref.style.left=`${s}px`,(e=this.ref.classList).remove.apply(e,a),(t=this.ref.classList).add.apply(t,i)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.style,r=t.className,i=t.innerRef,a=t.children,o=t.renderToBody,s=document.body,c=U.createElement(`div`,{ref:function(t){e.ref=t,i(t)},className:`rta__autocomplete ${r||``}`,style:n},a);return o&&s!==null?Nb.createPortal(c,s):c}}]),t}(U.Component),$C=function(e){LC(t,e);function t(e){var n;OC(this,t),n=PC(this,FC(t).call(this,e)),n.state={top:null,left:null,currentTrigger:null,actualToken:``,data:null,value:``,dataLoading:!1,selectionEnd:0,component:null,textToReplace:null},n.escListenerInit=function(){n.escListener||=UC.add(HC.ESC,n._closeAutocomplete)},n.escListenerDestroy=function(){n.escListener&&(UC.remove(n.escListener),n.escListener=null)},n.getSelectionPosition=function(){return n.textareaRef?{selectionStart:n.textareaRef.selectionStart,selectionEnd:n.textareaRef.selectionEnd}:null},n.getSelectedText=function(){if(!n.textareaRef)return null;var e=n.textareaRef,t=e.selectionStart,r=e.selectionEnd;return t===r?null:n.state.value.substr(t,r-t)},n.setCaretPosition=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;n.textareaRef&&(n.textareaRef.focus(),n.textareaRef.setSelectionRange(e,e))},n.getCaretPosition=function(){return n.textareaRef?n.textareaRef.selectionEnd:0},n._handleCaretChange=function(e){var t=function(){var e=n.getCaretPosition()-1;n.lastTrigger=n.lastTrigger?e:0};if(e.type===`keydown`){switch(e.keyCode||e.which){case HC.UP:case HC.DOWN:n._isAutocompleteOpen()||t();break;case HC.LEFT:case HC.RIGHT:t();break;default:}return}t()},n._onSelect=function(e){var t=n.state,r=t.selectionEnd,i=t.currentTrigger,a=t.value,o=n.props.onItemSelected;if(i){var s=n._getTextToReplace(i);if(!s){n._closeAutocomplete();return}var c=s(e);if(!c){n._closeAutocomplete();return}o&&o({currentTrigger:i,item:e});var l=function(e,t,n){switch(e){case`start`:return n;case`next`:case`end`:return n+t.length;default:if(!Number.isInteger(e))throw Error(`RTA: caretPosition should be "start", "next", "end" or number.`);return e}},u=a.slice(0,r),d=ZC(i),f=u.length-u.lastIndexOf(i),p=u.search(RegExp(`(?!${d})\$`))-f,m=c.caretPosition===`next`?`${c.text} `:c.text,h=l(c.caretPosition,m,p),g=u.substring(0,p)+m,_=a.replace(u,g);n.setState({value:_,dataLoading:!1},function(){var e=n.tokenRegExpEnding.exec(m),t=e?e[0].length:1;n.lastTrigger=h&&h-t,n.textareaRef.value=_,n.textareaRef.selectionEnd=h,n._changeHandler();var r=n.textareaRef.scrollTop;n.setCaretPosition(h),window.chrome&&(n.textareaRef.scrollTop=r)})}},n._getTextToReplace=function(e){var t=n.props.trigger[e];if(!e||!t)return null;var r=t.output;return function(t){if(typeof t==`object`&&(!r||typeof r!=`function`))throw 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(r){var n=r(t,e);if(n===void 0||typeof n==`number`)throw Error(`Output functor should return string or object in shape {text: string, caretPosition: string | number}.
|
||
Got "${String(n)}". Check the implementation for trigger "${e}"
|
||
|
||
See https://github.com/webscopeio/react-textarea-autocomplete#trigger-type for more information.
|
||
`);if(n===null)return null;if(typeof n==`string`)return{text:n,caretPosition:qC};if(!n.text&&typeof n.text!=`string`)throw Error(`Output "text" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "${e}"
|
||
`);if(!n.caretPosition)throw Error(`Output "caretPosition" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "${e}"
|
||
`);return n}if(typeof t!=`string`)throw Error(`Output item should be string
|
||
`);return{text:`${e}${t}${e}`,caretPosition:qC}}},n._getCurrentTriggerSettings=function(){var e=n.state.currentTrigger;return e?n.props.trigger[e]:null},n._getValuesFromProvider=function(){var e=n.state,t=e.currentTrigger,r=e.actualToken,i=n._getCurrentTriggerSettings();if(!(!t||!i)){var a=i.dataProvider,o=i.component;if(typeof a!=`function`)throw Error(`Trigger provider has to be a function!`);n.setState({dataLoading:!0});var s=a(r);s instanceof Promise||(s=Promise.resolve(s)),s.then(function(e){if(!Array.isArray(e))throw Error(`Trigger provider has to provide an array!`);if(typeof o!=`function`)throw Error(`Component should be defined!`);if(t===n.state.currentTrigger){if(!e.length){n._closeAutocomplete();return}n.setState({dataLoading:!1,data:e,component:o})}}).catch(function(e){return YC(e.message)})}},n._getSuggestions=function(){var e=n.state,t=e.currentTrigger,r=e.data;return!t||!r||r&&!r.length?null:r},n._createRegExp=function(){var e=n.props.trigger;n.tokenRegExp=RegExp(`(${Object.keys(e).sort(function(e,t){return e<t?1:e>t?-1:0}).map(function(e){return ZC(e)}).join(`|`)})((?:(?!\\1)[^\\s])*\$)`),n.tokenRegExpEnding=RegExp(`(${Object.keys(e).sort(function(e,t){return e<t?1:e>t?-1:0}).map(function(e){return ZC(e)}).join(`|`)})\$`)},n._closeAutocomplete=function(){var e=n.state.currentTrigger;n.escListenerDestroy(),n.setState({data:null,dataLoading:!1,currentTrigger:null},function(){e&&n._onItemHighlightedHandler(null)})},n._cleanUpProps=function(){var e=DC({},n.props),t=`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`.split(`.`);for(var r in e)t.includes(r)&&delete e[r];return e},n._changeHandler=function(e){var t=n.props,r=t.trigger,i=t.onChange,a=t.minChar,o=t.onCaretPositionChange,s=t.movePopupAsYouType,c=n.state,l=c.top,u=c.left,d=e;d||(d=new TC.default(`change`,{bubbles:!0}),n.textareaRef.dispatchEvent(d));var f=d.target||n.textareaRef,p=f.selectionEnd,m=f.value;n.lastValueBubbledEvent=m,i&&d&&(d.persist&&d.persist(),i(new Proxy(d,{get:function(e,t,n){return t===`target`?f:Reflect.get(e,t,n)}}))),o&&o(n.getCaretPosition()),n.setState({value:m});var h=function(){var e=(0,wC.default)(f,p),t=e.top,r=e.left;n.setState({top:t-n.textareaRef.scrollTop||0,left:r})},g=function(e){n.lastTrigger=p-e,n._closeAutocomplete(),h()};if(p<=n.lastTrigger){var _=m.slice(0,p),v=n.tokenRegExp.exec(_);g(v?v[0].length:0)}var y=m.slice(n.lastTrigger,p),b=n.tokenRegExp.exec(y),x=b&&b[0],S=b&&b[1]||null,C=S?S.length-1:0,w=n.tokenRegExpEnding.exec(y);if(w?g(w[0].length):n._isAutocompleteOpen()||n._closeAutocomplete(),(!x||x.length<=a+C)&&(n.state.currentTrigger&&!r[n.state.currentTrigger].allowWhitespace||!n.state.currentTrigger)){n._closeAutocomplete();return}if(S&&r[S].afterWhitespace&&!/\s/.test(m[p-x.length-1])&&m[p-x.length-1]!==void 0){n._closeAutocomplete();return}if(n.state.currentTrigger&&r[n.state.currentTrigger].allowWhitespace){if(b=RegExp(`${ZC(n.state.currentTrigger)}.*\$`).exec(m.slice(0,p)),x=b&&b[0],!x){n._closeAutocomplete();return}S=Object.keys(r).find(function(e){return e.slice(0,C+1)===x.slice(0,C+1)})||null}var T=x.slice(1);if(S){(s||l===null&&u===null||n.state.currentTrigger!==S)&&h(),n.escListenerInit();var E=n._getTextToReplace(S);n.setState({selectionEnd:p,currentTrigger:S,textToReplace:E,actualToken:T},function(){try{n._getValuesFromProvider()}catch(e){YC(e.message)}})}},n._selectHandler=function(e){var t=n.props,r=t.onCaretPositionChange,i=t.onSelect;r&&r(n.getCaretPosition()),i&&(e.persist(),i(e))},n._shouldStayOpen=function(e){var t=e.relatedTarget;return t===null&&(t=document.activeElement),!!(n.dropdownRef&&t instanceof Node&&n.dropdownRef.contains(t))},n._onClick=function(e){var t=n.props.onClick;t&&(e.persist(),t(e)),!n._shouldStayOpen(e)&&n._closeAutocomplete()},n._onBlur=function(e){var t=n.props.onBlur;t&&(e.persist(),t(e)),!n._shouldStayOpen(e)&&n._closeAutocomplete()},n._onScrollHandler=function(){n._closeAutocomplete()},n._onItemHighlightedHandler=function(e){var t=n.props.onItemHighlighted,r=n.state.currentTrigger;if(t)if(typeof t==`function`)t({currentTrigger:r,item:e});else throw Error("`onItemHighlighted` has to be a function")},n._dropdownScroll=function(e){var t=n.props.scrollToItem;if(t){if(t===!0){KC(n.dropdownRef,e);return}if(typeof t!=`function`||t.length!==2)throw Error("`scrollToItem` has to be boolean (true for default implementation) or function with two parameters: container, item.");t(n.dropdownRef,e)}},n._isAutocompleteOpen=function(){var e=n.state,t=e.dataLoading,r=e.currentTrigger,i=n._getSuggestions();return!!((t||i)&&r)},n._textareaRef=function(e){n.props.innerRef&&n.props.innerRef(e),n.textareaRef=e},n.lastTrigger=0,n.escListener=null;var r=n.props,i=r.loadingComponent,a=r.trigger,o=r.value;if(o&&(n.state.value=o),n._createRegExp(),!i)throw Error(`RTA: loadingComponent is not defined`);if(!a)throw Error(`RTA: trigger is not defined`);return n}return AC(t,[{key:`componentDidMount`,value:function(){UC.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(e){var t=e.trigger,n=e.value,r=this.props,i=r.trigger,a=r.value;Object.keys(i).join(``)!==Object.keys(t).join(``)&&this._createRegExp(),n!==a&&this.lastValueBubbledEvent!==a&&(this.lastTrigger=0,this._changeHandler())}},{key:`componentWillUnmount`,value:function(){this.escListenerDestroy(),UC.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 e=this,t=this.props,n=t.loadingComponent,r=t.style,i=t.className,a=t.listStyle,o=t.itemStyle,s=t.boundariesElement,c=t.movePopupAsYouType,l=t.listClassName,u=t.itemClassName,d=t.dropdownClassName,f=t.dropdownStyle,p=t.containerStyle,m=t.containerClassName,h=t.loaderStyle,g=t.loaderClassName,_=t.textAreaComponent,v=t.renderToBody,y=this.state,b=y.left,x=y.top,S=y.dataLoading,C=y.component,w=y.value,T=y.textToReplace,E=this._isAutocompleteOpen(),D=this._getSuggestions(),O={},k;return _.component?(k=_.component,O[_.ref]=this._textareaRef):(k=_,O.ref=this._textareaRef),U.createElement(`div`,{className:`rta ${S===!0?`rta--loading`:``} ${m||``}`,style:p},U.createElement(k,Object.assign({},this._cleanUpProps(),{className:`rta__textarea ${i||``}`,onChange:this._changeHandler,onSelect:this._selectHandler,onScroll:this._onScrollHandler,onClick:this._onClick,onBlur:this._onBlur,value:w,style:r},O)),E&&U.createElement(QC,{innerRef:function(t){e.dropdownRef=t},top:x,left:b,style:f,className:d,movePopupAsYouType:c,boundariesElement:s,textareaRef:this.textareaRef,renderToBody:v},D&&C&&T&&U.createElement(GC,{values:D,component:C,style:a,className:l,itemClassName:u,itemStyle:o,getTextToReplace:T,onItemHighlighted:this._onItemHighlightedHandler,onSelect:this._onSelect,dropdownScroll:this._dropdownScroll}),S&&U.createElement(`div`,{className:`rta__loader ${D===null?`rta__loader--empty-suggestion-data`:`rta__loader--suggestion-data`} ${g||``}`,style:h},U.createElement(n,{data:D}))))}}],[{key:`getDerivedStateFromProps`,value:function(e){var t=e.value;return t==null?null:{value:t}}}]),t}(U.Component);$C.defaultProps={movePopupAsYouType:!1,value:null,minChar:1,boundariesElement:`body`,scrollToItem:!0,textAreaComponent:`textarea`,renderToBody:!1},Rg(),bi();var ew=()=>{let{app:e}=L.getState(),t=e.metadataCache.getTags();return[...Object.keys(t)].map(e=>e.split(`#`).pop())},tw=e=>{let t=[],n=L.getState().settings;if(n&&n?.UseVaultTags)t=ew();else{let{tags:e}=V.getState();t=e}let r=e.toLowerCase(),i=[];return t.forEach(e=>{e&&e.toLowerCase().contains(r)&&i.push({name:e,char:e})}),i};bi();var nw=e=>{let{app:t}=L.getState(),n=t.vault.getAllLoadedFiles(),r=[],i;return n.forEach(t=>{e===`[`?i=``:e.contains(`[`)&&(i=e.slice(1));let n=i.toLowerCase();t instanceof f.TFile&&[`md`,`png`,`jpg`,`canvas`,`jpeg`,`gif`].contains(t.extension)&&t.path.toLowerCase().contains(n)&&r.push({name:t.basename,char:t.name,file:t})}),r},rw=u(s(((e,t)=>{var n=_(),r=function(e){return typeof e==`function`};t.exports=function(e){var t=n.useState(e),i=t[0],a=t[1],o=n.useRef(i);return[i,n.useCallback(function(e){o.current=r(e)?e(o.current):e,a(o.current)},[]),o]}}))());vi(),Si(),H(),Qr(),nn();var iw=Jt(`editor-history-db`,`editor-history-store`),aw=50;function ow(e,t){return`thinoEditorHistory:${e}:${t||`view`}`}async function sw(e,t,n){try{if(!t?.appId)return;let r=ow(t.appId,n),i=await Xt(r,iw)||[];if(i.some(t=>t.content===e))return;await Zt(r,[{content:e,timestamp:Date.now()},...i].slice(0,aw),iw)}catch(e){console.error(`Failed to save editor history:`,e)}}var cw=(0,f.debounce)((e,t,n)=>{sw(e,t,n)},1e3);async function lw(e,t){try{return e?.appId&&await Xt(ow(e.appId,t),iw)||[]}catch(e){return console.error(`Failed to get editor history:`,e),[]}}async function uw(e,t){try{if(!e?.appId)return;await Qt(ow(e.appId,t),iw)}catch(e){console.error(`Failed to clear editor history:`,e)}}function dw(e){return e.containerEl.matches(`.memos-list-view`)}function fw(){}function pw(e){let t=e.app.workspace.getLeavesOfType(`thino_view`)[0];return{app:e.app,showSearch:fw,toggleMode:fw,onMarkdownScroll:fw,getMode:()=>`source`,getViewType:()=>`thino_view`,id:t?.id||P.randomId(6),scroll:0,editMode:null,get file(){return t?.view?.file||null},get path(){return(t?.view)?.file?.path||``}}}var mw=(e,t)=>{let{app:n,plugin:r,view:i,dailyNotes:a}=I(),[o,s]=(0,U.useState)(null),[c,l]=(0,U.useState)(!1),[u,d]=(0,U.useState)(``),[p,m]=(0,U.useState)(null),[h,g]=(0,U.useState)(!0),[_,v]=(0,U.useState)(!1),y=(0,U.useRef)(null),b=(0,U.useRef)((0,f.debounce)(async(e,t,n)=>{_w(e,t,n),e.trim()&&!_&&await cw(e,t,n)},100)),x=(0,U.useRef)();(0,U.useEffect)(()=>{if(!p){if(!a&&!(n&&window.app)){let e=(n||window.app)?.vault.getMarkdownFiles();m(e[0]);return}for(let e in a)if(a[e]instanceof f.TFile){m(a[e]);break}}},[a]),(0,U.useEffect)(()=>{if(!r?.MarkdownEditor){console.log(`MarkdownEditor is not available or not a constructor`);return}if(!e)return;class a extends r.MarkdownEditor{updateBottomPadding(){}onUpdate(e,t){super.onUpdate(e,t),C&&C(this.get()),(e.docChanged||e.selectionSet)&&requestAnimationFrame(()=>{try{let t=e.view.dom.closest(`.common-editor-inputer`);if(!t)return;let n=e.view.state.selection.main.head,r=e.view.coordsAtPos(n);if(!r)return;let i=t.getBoundingClientRect();r.bottom>i.bottom?t.scrollTop+=r.bottom-i.bottom+4:r.top<i.top&&(t.scrollTop-=i.top-r.top+4)}catch{}})}}let o=pw(r),c=r.addChild(new a(n,e,o));c&&!t&&i&&R.setInstance(`${i.leaf?.id}`,c),o.editMode=c,c.owner.editor=c.editor;let u=gw(n,t?`modal`:`view`);return c.set&&c.set(u||``,!0),n.workspace.trigger(`thino-editor-created`,e,c.editor),x.current=c.cm,l(!0),s(c),()=>{console.log(`Obsidian-Memos: Removed editor instance.`),l(!1),c?.destroy?.(),r.removeChild(c),x.current=null,y.current=null}},[e,r]),(0,U.useEffect)(()=>{!o||!n||(b.current(u,n,t?`modal`:`view`),h&&g(!1),y.current&&y.current(u))},[u,n]);let S=()=>{o&&o.toggleSource()},C=(0,f.debounce)(e=>w(e),500,!0),w=e=>{d(e)};return{instance:o,value:u,set:e=>{try{o&&(console.log(e),(o?.editor).replaceSelection(e),d(e))}catch(e){console.error(e)}},get:()=>o?o.get():``,append:(e,t)=>{if(!o||t&&t!==i?.leaf?.id)return;let n=(o.get()||``)+e;(o?.editor).replaceSelection(e),d(n)},clear:async(e=!1)=>{o&&(o.clear(),d(``),_w(``,n,t?`modal`:`view`),e&&await uw(n,t?`modal`:`view`))},toggleSource:S,getHistoryEntries:async()=>!o||!n?[]:await lw(n,t?`modal`:`view`),setFullContent:(e,r=!1)=>{o&&(v(r),o.set(e),b.current(e,n,t?`modal`:`view`),v(!1))},editorView:x.current}};function hw(e,t){return`thinoEditorContentCache:${e}:${t||`view`}`}function gw(e,t){try{if(!e?.appId)return``;let n=hw(e.appId,t);return xi.get([n])[n]||``}catch(e){return console.error(e),``}}function _w(e,t,n){try{if(!t?.appId)return;let r=hw(t.appId,n);xi.set({[r]:e})}catch(e){console.error(e)}}Qr(),N();var vw=(0,U.memo)(({value:e,maxCount:t=100})=>{let[n,r]=(0,U.useState)(0);return(0,U.useEffect)(()=>{let t=e.replace(/```[^\S\r\n]*[a-z]*\n.*?\n```/g,``);r(P.getWordCount(t))},[e]),(0,W.jsxs)(`div`,{className:u_(`thino-editor-word-count`,n>t&&t>0&&`exceeded`),children:[n,` `,t>0&&(0,W.jsxs)(`span`,{children:[` / `,t]}),` `,M(`word`)]})},(e,t)=>e.value===t.value&&e.maxCount===t.maxCount);vi(),Si(),ur(),N(),H();function yw(e,t){return{line:e.line,ch:e.ch+t}}var bw=({entity:{name:e,char:t,file:n}})=>(0,W.jsx)(`div`,{children:`${t}`}),xw=({data:e})=>(0,W.jsx)(`div`,{children:`Loading`}),Sw,Cw=(0,U.forwardRef)((e,t)=>{let{useTinyUndoHistoryCache:n,globalEditorShown:r,memoListView:i}=si(),{settings:a,app:o}=I(),{SaveMemoButtonLabel:s,SaveMemoButtonIcon:c}=a,{className:l,inputerType:u,initialContent:d,placeholder:p,showConfirmBtn:m,showCancelBtn:h,onConfirmBtnClick:g,onCancelBtnClick:_,onContentChange:v,onCheckCount:y}=e,b=(0,U.useRef)(null),x=(0,U.useRef)(null),S=(0,U.useRef)(null),C=xC(),{instance:w,value:T,set:E,get:D,append:O,clear:k,toggleSource:A,setFullContent:j}=mw(x.current,e.modal),[,ee,te]=(0,rw.default)(0),[ne,re]=(0,rw.default)(!1);(0,U.useEffect)(()=>{if(a&&a.FocusOnEditor)switch(u){case`minimal`:case`memos`:b.current?.focus();break;case`obsidian`:w&&w.editor?.focus()}},[a,w]),(0,U.useEffect)(()=>{if(!o)return;let e=o.workspace.getLeavesOfType(gW),t,n;e.length>0?(n=e[0].view.containerEl,t=n.offsetHeight):(n=document,t=window.outerHeight),ee(t)},[o]),(0,U.useEffect)(()=>{!b.current||u===`obsidian`||d&&(b.current.value=d,C())},[]),(0,U.useEffect)(()=>{if(u!==`obsidian`)if(n){if(!b.current)return;let{tinyUndoActionsCache:e,tinyUndoIndexCache:t}=xi.get([`tinyUndoActionsCache`,`tinyUndoIndexCache`]);return S.current=new bC(b.current,{interval:5e3,initialActions:e,initialIndex:t}),S.current.subscribe((e,t)=>{xi.set({tinyUndoActionsCache:e,tinyUndoIndexCache:t})}),()=>{S.current?.destroy()}}else S.current?.destroy(),S.current=null,xi.remove([`tinyUndoActionsCache`,`tinyUndoIndexCache`])},[n]),(0,U.useEffect)(()=>{b.current&&(b.current.style.height=`auto`,b.current.style.height=(b.current.scrollHeight??0)+`px`)},[b.current?.value]),(0,U.useImperativeHandle)(t,()=>({element:b.current,blur:()=>{switch(u){case`minimal`:case`memos`:b.current?.blur();break;case`obsidian`:w&&w.editor?.blur()}},focus:e=>{switch(u){case`minimal`:case`memos`:b.current?.focus();break;case`obsidian`:if(w){if(console.log(e,e!==w?.owner?.view?.leaf?.id),e&&e!==w?.owner?.view?.leaf?.id)return;w.editor?.focus()}}},insertTag:e=>{switch(u){case`minimal`:case`memos`:{if(!b.current)return;let e=b.current.value;b.current.value=e.slice(0,b.current.selectionStart)+`# `+e.slice(b.current.selectionStart),v(b.current.value),C();break}case`obsidian`:if(e&&e!==w?.owner?.view?.leaf?.id)return;if(w){let e=w.editor,t=e.getCursor(`from`);e.replaceRange(`#`,t),e.setSelection(yw(t,1))}break}},insertText:(e,t)=>{switch(u){case`minimal`:case`memos`:{if(!b.current)return;let t=b.current.value;b.current.value=t.slice(0,b.current.selectionStart)+e+t.slice(b.current.selectionStart),v(b.current.value),C()}break;case`obsidian`:w&&O(e,t);break}},setContent:e=>{switch(u){case`minimal`:case`memos`:b.current&&(b.current.value=e,v(b.current.value),C());break;case`obsidian`:w&&E(e);break}},updateContent:e=>{switch(u){case`minimal`:case`memos`:b.current&&(b.current.value=e);break;case`obsidian`:w&&j(e);break}},getContent:()=>{switch(u){case`minimal`:case`memos`:return b.current?b.current.value:``;case`obsidian`:return D()}},toggleSource:()=>{switch(u){case`minimal`:case`memos`:break;case`obsidian`:A();break}},clear:(e=!1)=>{switch(u){case`minimal`:case`memos`:b.current&&(b.current.value=``,v(b.current.value),C());break;case`obsidian`:k(e);break}}}),[w,u]);let ie=e=>{if(!b.current)return;let{fileManager:t}=lr.getState().dailyNotesState.app;if(e.currentTrigger===`#`){let t=b.current.value,n;n=Sw==null?0:Sw.length;let r=b.current.selectionStart;for(let e=0;e<t.length;e++)/\s/g.test(t[r])||r++;b.current.value=t.slice(0,b.current.selectionStart-n)+e.item.char+t.slice(r),v(b.current.value),C()}else if(e.currentTrigger===`[[`){let n=t.generateMarkdownLink(e.item.file,e.item.file.path,``,``),r=b.current.value,i;i=Sw==null?2:n.contains(`[[`)?Sw.length+1:e.item.file.extension===`md`?Sw.length+2:Sw.length+1;let a=b.current.selectionStart;for(let e=0;e<r.length;e++)/\s/g.test(r[a])||a++;b.current.value=r.slice(0,b.current.selectionStart-i)+n+r.slice(a),v(b.current.value),C()}},ae=(0,U.useCallback)(()=>{v(b.current?.value||``),C()},[]),oe=async()=>{switch(u){case`minimal`:case`memos`:if(!b.current)return;b.current.value=ce(),g(b.current.value),b.current.value=``,C(),S.current?.resetState();break;case`obsidian`:await y(D())?(g(D()),k(!0),C()):new f.Notice(M(`Word count exceeded`));break}},se=(0,U.useCallback)(()=>{switch(u){case`minimal`:case`memos`:b.current&&(b.current.value=``,v(b.current.value),C());break;case`obsidian`:k(!1);break}_()},[u,w,b]),ce=()=>xi.get([`thinoEditorContentCache`]).thinoEditorContentCache||``,le=()=>{if(b.current)return b.current.value=ce(),b.current.value};return(0,W.jsxs)(`div`,{className:`common-editor-wrapper `+l,children:[(e=>{switch(e){case`memos`:return(0,W.jsx)($C,{className:`common-editor-inputer scroll ${ne?` editing`:``}`,loadingComponent:xw,placeholder:p,movePopupAsYouType:!0,value:le(),innerRef:e=>{b.current=e},onFocus:()=>{re(!0)},onBlur:()=>{re(!1)},onInput:ae,style:{maxHeight:`100%`,minHeight:`100px`},dropdownStyle:{minWidth:180,maxHeight:250,overflowY:`auto`},minChar:0,onItemSelected:ie,scrollToItem:!0,trigger:{"#":{dataProvider:e=>(Sw=e,tw(e).map(({name:e,char:t})=>({name:e,char:t}))),component:bw,afterWhitespace:!0,output:e=>e.char},"[[":{dataProvider:e=>(Sw=e,nw(e).slice(0,10).map(({name:e,char:t,file:n})=>({name:e,char:t,file:n}))),component:bw,afterWhitespace:!0,output:e=>e.char}}});case`minimal`:return(0,W.jsx)(`textarea`,{style:{minHeight:48},className:`common-editor-inputer scroll`,rows:1,placeholder:p,ref:b,onInput:ae});case`obsidian`:return(0,W.jsx)(`div`,{className:`common-editor-inputer common-editor-mod-cm6`,onClick:()=>{w?.editor?.focus()},ref:x});default:return(0,W.jsx)(`div`,{className:`common-editor-inputer common-editor-mod-cm6`,ref:x})}})(u),(0,W.jsxs)(`div`,{className:`common-tools-wrapper`,children:[(0,W.jsx)(`div`,{className:`common-tools-container`,children:(0,W.jsx)(xv,{when:e.tools!==void 0,children:e.tools})}),(0,W.jsxs)(`div`,{className:`btns-container`,children:[a.enableWordCount&&(0,W.jsx)(vw,{value:T,maxCount:a.maxWordCount}),(0,W.jsx)(xv,{when:h,children:(0,W.jsx)(`button`,{className:`action-btn cancel-btn`,onClick:()=>{a&&a.DefaultEditorLocation===`Top`&&!r&&se()},onPointerDown:()=>{(a&&a.DefaultEditorLocation===`Bottom`||r)&&se()},children:z.getState().pathname===`/`&&i===`chat`&&(a?.chatViewStyle===`fluent`||a?.chatViewStyle===`inline`)?``:M(`CANCEL EDIT`)})}),(0,W.jsx)(xv,{when:!!e.clipboardText&&m&&!h,children:(0,W.jsx)(`button`,{"aria-label":M(`Paste clipboard content and save as new thino`),className:`action-btn confirm-btn paste-create-btn`,onClick:async()=>{a&&a.DefaultEditorLocation===`Top`&&!r&&e.onPasteAndCreate?.()},onPointerDown:async()=>{(a&&a.DefaultEditorLocation===`Bottom`||r)&&e.onPasteAndCreate?.()},children:M(`Paste`)})}),(0,W.jsx)(xv,{when:m,children:(0,W.jsxs)(`button`,{"aria-label":M(`Ctrl/Cmd + Enter to save thino`),className:`action-btn confirm-btn`,onClick:async()=>{a&&a.DefaultEditorLocation===`Top`&&!r&&await oe()},onPointerDown:async()=>{(a&&a.DefaultEditorLocation===`Bottom`||r)&&await oe()},children:[i===`chat`&&(a?.chatViewStyle===`fluent`||a?.chatViewStyle===`inline`)?``:s,(0,W.jsx)(`span`,{className:`icon-text`,children:null})]})})]})]})]})}),ww=(e,t)=>({placement:e,modifiers:[{name:`flip`,options:{allowedAutoPlacements:t,rootBoundary:`document`}},{name:`preventOverflow`,options:{rootBoundary:`document`}}]}),Tw=e=>{let t=(0,U.useRef)(null),[n,r]=(0,U.useState)(null),[i,a]=(0,U.useState)(0),o,s,c=()=>{if(f.Platform.isMobile){o=`right-end`,s=[`bottom`];return}let t=window.innerWidth-i>280*1.2,n=window.innerWidth-i<280,r=window.innerWidth>280*1.5;if(e.DefaultEditorLocation!==`Bottom`){t?(o=`right-end`,s=[`left-end`]):n&&r?(o=`left-end`,s=[`right-end`]):(o=`bottom`,s=[`bottom`]);return}t?(o=`top-end`,s=[`top-start`]):n&&i>280?(o=`top-start`,s=[`top-end`]):(o=`top`,s=[`top`])};return(0,U.useEffect)(()=>{e&&c()},[i,e?.DefaultEditorLocation]),{setPosX:a,popperRef:t,setPopperElement:r,popper:Ib(t.current,n,ww(o,s))}};Me(),qe(),Kt(),dn();var Ew=Ae()(Ue(Be(Ke(Gt(e=>({conversations:[],activeConversationId:null,isProcessing:!1,selectedMessageIds:[],createConversation:(t,n)=>{let r=`inline-conv-${Date.now()}`,i=Date.now();return e(e=>{e.conversations.push({id:r,afterThinoId:t,beforeThinoId:n,messages:[],createdAt:i,updatedAt:i,isActive:!0})}),r},addMessage:(t,n)=>e(e=>{let r=e.conversations.find(e=>e.id===t);r&&(r.messages.push(n),r.updatedAt=Date.now())}),updateMessage:(t,n,r)=>e(e=>{let i=e.conversations.find(e=>e.id===t);if(!i)return;let a=i.messages.find(e=>e.id===n);a&&(Object.assign(a,r),i.updatedAt=Date.now())}),deactivateConversation:t=>e(e=>{let n=e.conversations.find(e=>e.id===t);n&&(n.isActive=!1,n.isCollapsed=!0,n.updatedAt=Date.now())}),reactivateConversation:t=>e(e=>{let n=e.conversations.find(e=>e.id===t);n&&(n.isActive=!0,n.isCollapsed=!1,n.updatedAt=Date.now())}),removeConversation:t=>e(e=>{e.conversations=e.conversations.filter(e=>e.id!==t)}),setActiveConversation:t=>e(e=>{e.activeConversationId=t}),setIsProcessing:t=>e(e=>{e.isProcessing=t}),toggleCollapseConversation:t=>e(e=>{let n=e.conversations.find(e=>e.id===t);n&&(n.isCollapsed=!n.isCollapsed)}),toggleMessageSelection:t=>e(e=>{let n=e.selectedMessageIds.indexOf(t);n>=0?e.selectedMessageIds.splice(n,1):e.selectedMessageIds.push(t)}),selectSingleMessage:t=>e(e=>{e.selectedMessageIds=[t]}),clearMessageSelection:()=>e(e=>{e.selectedMessageIds=[]})})),{name:`inline-super-store-cache`,storage:un.ui,partialize:e=>({conversations:e.conversations}),version:1}),{name:`inline-super-store`})));vi(),H(),Qr(),Si(),N(),Wr(),_o(),Cv(),Mv(),Aa(),Dg();var Dw=()=>{let e=new Set,t=z.getState().query.filter,n=z.getState().query.tag,r=Bg.getQueryById(t||``);if(r&&r.querystring){let t=JSON.parse(r.querystring);if(Array.isArray(t))for(let n of t)n.type===`TAG`&&n.value&&n.value.operator===`CONTAIN`&&typeof n.value.value==`string`&&e.add(n.value.value)}return n&&e.add(n),Array.from(e)},Ow=e=>{let{offsetLeft:t,offsetTop:n,offsetHeight:r,offsetWidth:i,selectionEnd:a}=e,o=document.createElement(`div`),s=window.getComputedStyle(e);for(let e of s)o.style.setProperty(e,s.getPropertyValue(e));o.style.position=`fixed`,o.style.visibility=`hidden`,o.style.whiteSpace=`pre-wrap`;let c=e.tagName===`INPUT`?e.value.replace(/ /g,`.`):e.value;o.textContent=c.substring(0,a||0),e.tagName===`TEXTAREA`&&(o.style.height=`auto`);let l=document.createElement(`span`);l.textContent=c.substring(a||0)||`.`,o.appendChild(l),document.body.appendChild(o);let{offsetLeft:u,offsetTop:d,offsetHeight:f,offsetWidth:p}=l;return document.body.removeChild(o),{x:t+u,y:n+d,h:r+f,w:i+p}};function kw(e){if(e)try{return JSON.parse(e)}catch{return}}var Aw=({className:e,editorType:t,destroy:n,modal:r})=>{let i=si(),{app:a,settings:o,view:s,verifyState:c}=I(),[l,u]=zb(!0),d=(0,U.useRef)(l),[p,m]=(0,rw.default)(!0),h=(0,U.useRef)(null),g=(0,U.useRef)(null),_=(0,U.useRef)(i),[v,y]=(0,rw.default)(!1),[b,x]=(0,rw.default)(!1),{setPosX:S,popperRef:C,setPopperElement:w,popper:T}=Tw(o),[E]=(0,rw.default)(parseInt((0,f.moment)().format(`x`))),D=(0,U.useRef)(null),[O,k]=(0,rw.default)(o?.EnabledLocationList.length===1?o?.EnabledLocationList[0].value:o?.MemoSaveLocation||`DAILY`),A=(0,U.useRef)(o.MemoSaveLocation||`DAILY`),[j,ee]=(0,rw.default)(``);(0,U.useEffect)(()=>{d.current=l},[l]),(0,U.useEffect)(()=>{!g.current||!a||!s||(s.registerEvent(a.workspace.on(`focus-on-textarea`,e=>{g.current?.focus(e?.id)})),s.registerEvent(a.workspace.on(`blur-on-memos`,()=>{g.current?.blur()})),s.registerEvent(a.workspace.on(`send-to-thino`,async(e,t)=>{if(console.log(e),typeof e==`string`)g.current?.insertText(e+`
|
||
`,t.id);else{let n=e.toPNG(),r=new Blob([n],{type:`image/png`}),i=new File([r],`image.png`,{type:`image/png`,lastModified:Date.now()});if(!i)return;let a=await oe(i);a&&g.current?.insertText(a+`
|
||
`,t.id)}})))},[g,s,a]),(0,U.useEffect)(()=>{o&&u(o.DefaultPrefix===`List`)},[o?.DefaultPrefix]),(0,U.useEffect)(()=>{if(o){if(o.EnabledLocationList.length===1){k(o.EnabledLocationList[0].value);return}k(o.MemoSaveLocation||`DAILY`)}},[o?.MemoSaveLocation,o?.EnabledLocationList]),(0,U.useEffect)(()=>{if(!o||!D.current)return;let e=Ur.find(e=>e.title===O)?.icon;(0,f.setIcon)(D.current,e),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(D.current,M(`Thino Save To: `)+O),A.current=O;let t=i.manifest;if(t){let e=a?.plugins.getPlugin(t.id);if(e){if(e.settings.MemoSaveLocation===O)return;e.settings.MemoSaveLocation=O,e.saveSettings()}}},[O,p]),(0,U.useEffect)(()=>{g.current&&o&&o.MemoSaveLocation&&k(o.MemoSaveLocation)},[D,o]),(0,U.useEffect)(()=>{if(!g.current||!o||f.Platform.isDesktop||i.globalEditorShown)return;let e=o.UseButtonToShowEditor&&o.DefaultEditorLocation===`Bottom`;if(f.Platform.isDesktop){m(!0);return}if(t&&t===`inline`){m(!0);return}if(m(f.Platform.isMobile&&!e),!e||i.memoListView===`chat`)return;let n=document.body.find(`.memolist-scrollview`);n&&(n.onscroll=()=>{if(i.globalEditorShown)return;if(!i.memoListView&&R.getState().memoListView===`chat`){n.onscroll=null;return}let t=g.current.getContent();f.Platform.isMobile&&e&&!t&&m(!1)})},[i.globalEditorShown,t,g]);let te=()=>{x(!1)};(0,U.useEffect)(()=>{if(a&&(i.markMemoId||i.editMemoId?.trim()&&i.editMemoId!==_.current.editMemoId)){let e=a.workspace.getLeavesOfType(`thino_view`);e.length>0&&a.workspace.revealLeaf(e[0])}if(i.markMemoId){let e=V.getMemoById(i.markMemoId);if(e&&e.sourceType===`DAILY`)Sa(e).then(e=>{let t=`${M(`MARK`)}: ${e}`;g.current?.insertText(t),g.current?.focus(),R.setMarkMemoId(``)});else{let e=`${M(`MARK`)}: [@THINO](${i.markMemoId})`;g.current?.insertText(e),g.current?.focus(),R.setMarkMemoId(``)}return}if(i.editMemoId?.trim()&&i.editMemoId!==_.current.editMemoId){let e=V.getMemoById(i.editMemoId);if(e)switch(u(e.thinoType===`JOURNAL`),o.EditorType){case`memos`:g.current?.setContent(e.content.replace(/ \^\S{6}$/,``)||``),g.current?.focus();break;case`obsidian`:g.current?.clear(!1),g.current?.setContent(e.content.replace(/ \^\S{6}$/,``)||``),g.current?.focus();break}}_.current=i},[i.markMemoId,i.editMemoId]),(0,U.useEffect)(()=>{!g.current||v||o.EditorType===`memos`&&(g.current?.element.addEventListener(`paste`,ne),g.current?.element.addEventListener(`drop`,re),g.current?.element.addEventListener(`click`,ie),y(!0))},[g.current]);let ne=async e=>{if(e.clipboardData&&e.clipboardData.files.length>0){e.preventDefault();let t=e.clipboardData.files;for(let e of t){let t=await oe(e);t&&g.current?.insertText(t)}}},re=async e=>{if(e.dataTransfer&&e.dataTransfer.files.length>0){e.preventDefault();let t=e.dataTransfer.files;for(let e of t){let t=await oe(e);t&&g.current?.insertText(t)}}},ie=()=>{he(g.current?.element.value||``)},ae=async(e,t)=>{let n=e.ctrlKey||e.metaKey,r=e.altKey;if(e.key===`Escape`&&i.globalEditorShown&&(R.setGlobalEditorShown(!1),e.preventDefault()),n&&e.key===`Enter`){e.preventDefault(),e.stopPropagation(),t?(await le(g.current?.getContent()),g.current?.clear(!0)):await le(g.current?.element.value);return}if(r)for(let t=0;t<o.EnabledLocationList.length;t++)e.key===(t+1).toString()&&k(o.EnabledLocationList[t].value);setTimeout(()=>{t||he(g.current?.element.value||``)})},oe=(0,U.useCallback)(async e=>{let{type:t}=e;if(t.startsWith(`image`))try{return`${await Wg.upload(e)}`}catch(e){new f.Notice(e)}},[]),se=(0,U.useCallback)(async e=>{if(o.enableWordCount){let t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),n=f.Platform.isDesktop?await Dv():t.identifier||t.uuid;if(!(c&&c?.appId===n))return Sv(),!1;if(o.maxWordCount===0)return!0;let r=e.replace(/```[^\S\r\n]*[a-z]*\n.*?\n```/g,``),i=P.getWordCount(r),a=o.maxWordCount||1e3;return!(i>a&&a>0)}return!0},[o.enableWordCount,o.maxWordCount]),ce=(0,U.useCallback)(async e=>{let t=Ew.getState(),n=F.getState().memos,r=n.length>0?n[0]:null,i=t.activeConversationId;if(!i||!t.conversations.some(e=>e.id===i&&e.isActive)){let e=t.conversations.find(e=>e.isActive);i=e?e.id:t.createConversation(r?.id??null,null),t.setActiveConversation(i)}let a={id:`inline-msg-${Date.now()}`,role:`user`,content:e,timestamp:Date.now()};t.addMessage(i,a),t.setIsProcessing(!0);let o=`inline-msg-${Date.now()}-a`,s={id:o,role:`assistant`,content:``,timestamp:Date.now(),isStreaming:!0};t.addMessage(i,s);try{let t=(Ew.getState().conversations.find(e=>e.id===i)?.messages??[]).map(e=>({id:e.id,role:e.role,content:e.content,timestamp:e.timestamp})),n=``,r=``,a,s=[],c=0;console.log(`[InlineSuper] streaming started`);for await(let l of av.chat(e,t)){if(c++,l.toolEvent){let{toolEvent:e}=l;if(e.type===`tool_start`)s.length===0&&(a=n.length),console.log(`[InlineSuper] seq=${c} TOOL_START name=${e.name} id=${e.toolCallId} contentLenAtStart=${a} reasoningLen=${r.length}`),s.push({id:e.toolCallId,name:e.name,arguments:e.arguments||``,parsedArgs:kw(e.arguments),status:`running`}),Ew.getState().updateMessage(i,o,{toolCalls:[...s],toolCallOffset:a});else if(e.type===`tool_result`){console.log(`[InlineSuper] seq=${c} TOOL_RESULT name=${e.name} id=${e.toolCallId}`);let t=s.findIndex(t=>t.id===e.toolCallId);t===-1?console.warn(`[InlineSuper] TOOL_RESULT id=${e.toolCallId} NOT FOUND in toolCalls:`,s.map(e=>e.id)):(s[t]={...s[t],result:e.result,status:`completed`},Ew.getState().updateMessage(i,o,{toolCalls:[...s]}))}}l.reasoning&&(r+=l.reasoning,console.log(`[InlineSuper] seq=${c} REASONING totalLen=${r.length}`),Ew.getState().updateMessage(i,o,{reasoning:r})),l.content&&(n+=l.content,console.log(`[InlineSuper] seq=${c} CONTENT totalLen=${n.length} preview="${l.content.slice(0,40)}"`),Ew.getState().updateMessage(i,o,{content:n}))}console.log(`[InlineSuper] streaming done. contentLen=${n.length} reasoningLen=${r.length} toolCallsCount=${s.length} toolCallOffset=${a} toolStatuses=${s.map(e=>e.status).join(`,`)}`),Ew.getState().updateMessage(i,o,{isStreaming:!1,toolCalls:[...s],reasoning:r||void 0,toolCallOffset:a})}catch(e){Ew.getState().updateMessage(i,o,{content:`Error: ${e.message||`Failed to get response`}`,isStreaming:!1})}finally{Ew.getState().setIsProcessing(!1)}},[]),le=async e=>{if(!e||e.trim()===``){new f.Notice(M(`Content cannot be empty`));return}let t=B.getState().enabled,r=e.trim().match(/^@Super\s+([\s\S]+)/i);if(r&&t&&f.Platform.isDesktop){let e=r[1].trim();g.current?.clear(!0),Mw(``),ce(e);return}let i=Ew.getState();i.activeConversationId&&(i.deactivateConversation(i.activeConversationId),i.setActiveConversation(null));let a=L.getState().settings,o=a?.addTagAutomatically,s=a?.addTagWithNewline,c=a?.addTagPosition,l=(Dw()||[]).filter(t=>!e.includes(`#${t}`)),u=async(e,t)=>{t=t.replaceAll(` `,` `),Mw(``);try{if(!e){let e,n=performance.now();switch(console.log(`[Thino:Perf] saveContent start`),A.current){case`CANVAS`:e=await V.createMemoCanvas({text:t,isList:d.current});break;case`MULTI`:e=await V.createMemoMultiFile({content:t,isList:d.current});break;case`DAILY`:e=await V.createMemoDaily(t,d.current);break;case`FILE`:e=await V.createMemoSingleFile({content:t,isList:d.current});break;case`JOURNAL`:e=await V.createMemoJournalFile({content:t,isList:d.current});break}if(!e)return;console.log(`[Thino:Perf] createMemo done +${(performance.now()-n).toFixed(1)}ms`),V.pushMemo(e),console.log(`[Thino:Perf] pushMemo done +${(performance.now()-n).toFixed(1)}ms`),(!o||l.length===0)&&z.clearQuery(),e&&A.current!==`DAILY`&&setTimeout(async()=>{let n=await go.syncCreate(t,A.current,d.current);n&&await V.updateMemoById(e.id,n,!0)},200);return}let n=V.getMemoById(e);if(n&&(n.content!==t||n.thinoType!==(d.current?`JOURNAL`:`TASK-TODO`))){let e=await V.updateMemo(n.id,t,d.current?`JOURNAL`:n.thinoType.startsWith(`TASK`)?n.thinoType:`TASK-TODO`);e.updatedAt=P.getDateTimeString(Date.now()),V.editMemo(e)}R.setEditMemoId(``)}catch(e){new f.Notice(e.message)}};n&&n(),n&&g.current?.clear(!0);let{editMemoId:p}=R.getState();await u(p,l&&l.length>0&&o&&!p?c===`Beginning`?`${l.map(e=>`#${e}`).join(` `)} ${s?`
|
||
`:``}${e}`:`${e} ${s?`
|
||
`:``}${l.map(e=>`#${e}`).join(` `)}`:e),Mw(``)},ue=(0,U.useCallback)(()=>{R.setEditMemoId(``),g.current?.setContent(``),Mw(``)},[]),de=(0,U.useCallback)(async()=>{if(!o?.ShowClipboardOnFocus){ee(``);return}try{if(!navigator.clipboard?.readText){ee(``);return}ee((await navigator.clipboard.readText())?.trim()||``)}catch{ee(``)}},[o?.ShowClipboardOnFocus]),fe=(0,U.useRef)(!1),pe=(0,U.useRef)(``),me=async()=>{if(!(!j||fe.current)&&j!==pe.current){fe.current=!0;try{await le(j),g.current?.clear(!0),pe.current=j,ee(``),setTimeout(()=>{pe.current=``},5e3)}finally{fe.current=!1}}},he=(0,U.useCallback)(e=>{if(Mw(e??``),!g.current)return;let t=g.current.getContent(),n=g.current.element.selectionStart,r=t.slice(0,n),i=t.slice(n);(r.endsWith(`@`)||r.endsWith(`📆`))&&i.startsWith(` `)||(r.endsWith(`@`)||r.endsWith(`📆`))&&i===``?(Se(),x(!0)):x(!1),setTimeout(()=>{g.current?.focus()})},[o.EditorType]),ge=e=>{let t=g.current;if(!t||!o||!e)return;te(),u(!1);let{element:n}=t,{value:r}=n,i=n.selectionStart??r.length,a=n.selectionEnd??i,s=r.slice(0,i),c=r.slice(a),l=s.endsWith(`@`),d=(0,f.moment)(e).format(`YYYY-MM-DD`),p=l?Math.max(i-1,0):i,m=d;if(l)switch(o.InsertDateFormat){case`Dataview`:m=`[due:: ${d}]`;break;case`Tasks`:m=`📅 ${d}`;break}let h=r.slice(0,p)+m+c;n.value=h;let _=p+m.length;n.setSelectionRange(_,_),t.focus(),he(h)},_e=()=>{g.current&&u()},ve=async()=>{let e=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),t=f.Platform.isDesktop?await Dv():e.identifier||e.uuid;return!c||c?.appId!==t?(Sv(),!1):!0},ye=async e=>{if(!await ve())return;let t=new f.Menu;o.EnabledLocationList.forEach(e=>{t.addItem(t=>{t.setTitle(M(e.value)).setIcon(Ur.find(t=>t.title===e.value)?.icon??`file`).setChecked(O===e.value).onClick(()=>{k(e.value)})})});let n=e.target,r=null;for(;!n.hasClass(`location-wrapper`)&&(r=n.parentElement,r);)n=r;let i=n.getBoundingClientRect();setTimeout(()=>{t.showAtPosition({x:i.x,y:i.bottom,width:i.width,left:!1,overlap:!0})},200)},be=(0,U.useCallback)(async e=>{let t=await lw(a,r?`modal`:`view`),n=new f.Menu;if(n.dom.addClass(`history-menu`),t.length===0){n.addItem(e=>{e.setTitle(M(`No history`)),e.setIcon(`file-clock`),e.setDisabled(!0)}),n.showAtMouseEvent(e.nativeEvent);return}t.forEach(e=>{n.addItem(t=>{t.titleEl.addClass(`history-item`),t.titleEl.createEl(`span`,{text:`${e.content.length} chars`}),t.titleEl.createEl(`span`,{text:(0,f.moment)(e.timestamp).format(`YYYY-MM-DD HH:mm:ss`)}),t.onClick(()=>{g.current?.updateContent(e.content)}),t.dom.onmouseover=n=>{let r=new f.HoverPopover(s,t.dom,1e3);r.hoverEl.createEl(`div`,{text:`History content:`,cls:`history-popover-title`}),r.hoverEl.createEl(`div`,{cls:`history-popover-content`},t=>{f.MarkdownRenderer.render(a,e.content,t,``,s)}),r.hoverEl.addClass(`history-popover`),r.load(),s.addChild(r),setTimeout(()=>{r.unload()},1e3)}})}),n.showAtMouseEvent(e.nativeEvent)},[a]),xe=(0,U.useCallback)(()=>{if(!(!g.current&&o.EditorType===`memos`))switch(o.EditorType){case`obsidian`:g.current?.focus(),g.current?.insertTag();break;case`memos`:{let e=g.current.getContent(),t=g.current.element.selectionStart,n=e.slice(0,t),r=e.slice(t),i=n+`# `+r,a=n.length+1;n.endsWith(`#`)&&r.startsWith(` `)&&(i=n.slice(0,n.length-1)+r.slice(1),a=n.length-1),g.current.element.value=i,g.current.element.setSelectionRange(a,a),g.current.focus();let o=new Event(`input`,{bubbles:!0,cancelable:!0});g.current.element.dispatchEvent(o),he(g.current.element.value)}}},[a]),Se=(0,U.useCallback)(()=>{if(!g.current||!C.current||!o||!a)return;a.workspace.getLeavesOfType(gW)[0].view.containerEl.clientWidth;let{x:e,y:t}=Ow(g.current.element),n,r;f.Platform.isMobile?(n=window.innerWidth-e>280?(e+280+16,e+18):window.innerWidth-e<280?(e+280+16,e+34):g.current.element.clientWidth/2,o.DefaultEditorLocation===`Bottom`&&window.innerWidth>875?r=t+4:o.DefaultEditorLocation===`Bottom`&&window.innerWidth<=875?r=t+19:o.DefaultEditorLocation===`Top`&&window.innerWidth<=875&&(r=t+36)):(n=(e+280+16,e+18),r=t+34),S(e),C.current.style.left=`${n}px`,C.current.style.top=`${r}px`},[o,a]),Ce=(0,U.useCallback)(()=>{let e=document.createElement(`input`);document.body.appendChild(e),e.type=`file`,e.multiple=!1,e.accept=`image/png, image/gif, image/jpeg`,e.onchange=async()=>{if(!e.files||e.files.length===0)return;let t=e.files[0],n=await oe(t);n&&g.current?.insertText(n),document.body.removeChild(e)},e.click()},[]),we=!!i.editMemoId,Te=(0,U.useMemo)(()=>({className:`memo-editor`,inputerType:o.EditorType||`obsidian`,modal:r,initialContent:jw(),placeholder:M(`What do you think now...`),showConfirmBtn:!0,showCancelBtn:we,showTools:!0,onConfirmBtnClick:le,onCancelBtnClick:ue,onContentChange:he,onCheckCount:se}),[we,o.EditorType]);return i.memoListView===`flow`?null:(0,W.jsxs)(W.Fragment,{children:[!i.globalEditorShown&&t===`block`&&(0,W.jsx)(`div`,{ref:e=>{h.current=e,e&&f.setIcon&&(0,f.setIcon)(e,`plus-circle`)},className:`memo-show-editor-button ${p?`thino-hidden`:``}`,onClick:()=>{h.current.firstElementChild?.toggleClass(`rotate-hidden`,!0),setTimeout(()=>{m(!0),h.current.firstElementChild.toggleClass(`rotate-hidden`,!1)},500),setTimeout(()=>{g.current?.focus()},600)}}),(0,W.jsxs)(`div`,{className:`memo-editor-wrapper ${e||``} ${we?`edit-ing`:``} ${i.globalEditorShown?`fullscreen-editor`:``} ${p?``:`thino-hidden`}`,onKeyDownCapture:e=>ae(e,!0),onFocusCapture:de,children:[(0,W.jsx)(`span`,{className:`tip-text ${we?``:`thino-hidden`}`,children:`Modifying...`}),(0,W.jsx)(Cw,{ref:g,...Te,clipboardText:j,onPasteAndCreate:me,tools:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`hash`)},className:`btn action-btn add-tag`,onClick:()=>{o&&o.DefaultEditorLocation===`Top`&&!i.globalEditorShown&&xe()},onPointerDown:()=>{(o&&o.DefaultEditorLocation===`Bottom`||i.globalEditorShown)&&xe()}}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`paperclip`)},className:`btn action-btn file-upload`,onClick:()=>{o&&o.DefaultEditorLocation===`Top`&&!i.globalEditorShown&&Ce()},onPointerDown:()=>{(o&&o.DefaultEditorLocation===`Bottom`||i.globalEditorShown)&&Ce()}}),i.editMemoId===``&&(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,l?`layout-list`:`check-square`)},className:u_(`btn action-btn list-or-task`,l?`list`:`task`),onClick:()=>{o&&o.DefaultEditorLocation===`Top`&&!i.globalEditorShown&&_e()},onPointerDown:()=>{(o&&o.DefaultEditorLocation===`Bottom`||i.globalEditorShown)&&_e()}}),(0,W.jsx)(`div`,{ref:e=>{e&&(f.setIcon&&(0,f.setIcon)(e,i.globalEditorShown?`shrink`:`expand`),f.setTooltip&&(0,f.setTooltip)(e,i.globalEditorShown?M(`Exit fullscreen mode`):M(`Enter fullscreen mode`)))},className:`action-btn show-editor pro`,onPointerDown:async()=>{await ve()&&(m(!0),R.setGlobalEditorShown(!i.globalEditorShown))}}),(0,W.jsx)(`div`,{className:`action-btn split-line pro`}),(0,W.jsx)(`div`,{className:`action-btn location-wrapper pro`,onClick:async e=>{o&&o.DefaultEditorLocation===`Top`&&!i.globalEditorShown&&await ye(e)},onPointerDown:async e=>{(o&&o.DefaultEditorLocation===`Bottom`||i.globalEditorShown)&&await ye(e)},children:(0,W.jsx)(`div`,{ref:D,className:`action-btn file-location-btn`})}),(0,W.jsx)(`div`,{className:`action-btn history-btn`,onClick:e=>{o&&o.DefaultEditorLocation===`Top`&&!i.globalEditorShown&&be(e)},onPointerDown:e=>{(o&&o.DefaultEditorLocation===`Bottom`||i.globalEditorShown)&&be(e)},ref:e=>{e&&(0,f.setIcon)(e,`file-clock`)}})]})}),(0,W.jsx)(`div`,{ref:C,className:`date-picker`,children:b&&(0,W.jsx)(`div`,{tabIndex:-1,style:T.styles.popper,...T.attributes.popper,ref:w,role:`dialog`,children:(0,W.jsx)(Wb,{className:`editor-date-picker ${b?``:`thino-hidden`}`,datestamp:E,handleDateStampChange:ge})})})]})]})};function jw(){return xi.get([`thinoEditorContentCache`]).thinoEditorContentCache??``}function Mw(e){xi.set({thinoEditorContentCache:e})}vi();var Nw=e=>{let t=gi(e=>e.toggleSelection);return{isSelected:gi(t=>t.isSelected(e)),handleClick:(0,U.useCallback)(n=>n.shiftKey?(n.preventDefault(),n.stopPropagation(),t(e),!0):!1,[e,t])}};Wr();var Pw={bilibili:{label:`Bilibili`,color:`#00a1d6`,icon:`tv`},youtube:{label:`YouTube`,color:`#ff0000`,icon:`play-circle`},netease:{label:`NetEase Music`,color:`#c20c0c`,icon:`music`},spotify:{label:`Spotify`,color:`#1db954`,icon:`music`},twitter:{label:`Twitter`,color:`#1da1f2`,icon:`message-circle`},general:{label:`Link`,color:`#6c757d`,icon:`external-link`}},Fw=/^https?:\/\/(?:www\.)?bilibili\.com\/video\/(BV[\w]+|av\d+)/i,Iw=/^https?:\/\/b23\.tv\/([\w]+)/i,Lw=/^https?:\/\/(?:www\.)?youtube\.com\/watch\?.*v=([\w-]+)/i,Rw=/^https?:\/\/youtu\.be\/([\w-]+)/i,zw=/^https?:\/\/(?:www\.)?youtube\.com\/shorts\/([\w-]+)/i,Bw=/^https?:\/\/music\.163\.com\/(?:#\/)?song\?id=(\d+)/i,Vw=/^https?:\/\/music\.163\.com\/(?:#\/)?playlist\?id=(\d+)/i,Hw=/^https?:\/\/open\.spotify\.com\/(track|album|playlist)\/([\w]+)/i,Uw=/^https?:\/\/(?:www\.)?(?:twitter|x)\.com\/\w+\/status\/(\d+)/i,Ww=/^(https?:\/\/[^\s]+)$/,Gw=/^\[([^\]]*)\]\((https?:\/\/[^\s)]+)\)$/,Kw=/\s*\^[\w-]+$/,qw=/^(-|\*|\d+\.)\s+(\[.\]\s+)?/;function Jw(e){let t=[],n=e,r,i=new RegExp(Nr.source,`gu`);for(;(r=i.exec(n))!==null;)t.push(r[1]);n=n.replace(new RegExp(Nr.source,`gu`),``);let a=new RegExp(jr.source,`g`);for(;(r=a.exec(n))!==null;)t.push(r[1]);return n=n.replace(new RegExp(jr.source,`g`),``),{tags:t,contentWithoutTags:n.trim()}}function Yw(e){return Fw.test(e)||Iw.test(e)?`bilibili`:Lw.test(e)||Rw.test(e)||zw.test(e)?`youtube`:Bw.test(e)||Vw.test(e)?`netease`:Hw.test(e)?`spotify`:Uw.test(e)?`twitter`:`general`}function Xw(e,t){let n;switch(t){case`bilibili`:if(n=Fw.exec(e),n){let e=n[1];return e.startsWith(`BV`)?`https://player.bilibili.com/player.html?bvid=${e}&autoplay=0&high_quality=1`:`https://player.bilibili.com/player.html?aid=${e.replace(`av`,``)}&autoplay=0&high_quality=1`}return null;case`youtube`:return n=Lw.exec(e),n||=Rw.exec(e),n||=zw.exec(e),n?`https://www.youtube-nocookie.com/embed/${n[1]}`:null;case`netease`:return n=Bw.exec(e),n?`https://music.163.com/outchain/player?type=2&id=${n[1]}&auto=0&height=66`:(n=Vw.exec(e),n?`https://music.163.com/outchain/player?type=0&id=${n[1]}&auto=0&height=430`:null);case`spotify`:return n=Hw.exec(e),n?`https://open.spotify.com/embed/${n[1]}/${n[2]}`:null;default:return null}}function Zw(e){try{return new URL(e).hostname.replace(/^www\./,``)}catch{return e}}function Qw(e){return`https://www.google.com/s2/favicons?domain=${Zw(e)}&sz=32`}var $w=new Map,eT={youtube:e=>`https://www.youtube.com/oembed?url=${encodeURIComponent(e)}&format=json`,twitter:e=>`https://publish.twitter.com/oembed?url=${encodeURIComponent(e)}&format=json`,spotify:e=>`https://open.spotify.com/oembed?url=${encodeURIComponent(e)}`,bilibili:e=>`https://noembed.com/embed?url=${encodeURIComponent(e)}`};async function tT(e,t){let n=eT[t];if(!n)return null;try{let t=await(0,f.requestUrl)({url:n(e),method:`GET`});if(t.status!==200)return null;let r=t.json;return{title:r.title||r.track_name||``,description:r.author_name?`by ${r.author_name}`:``,image:r.thumbnail_url||void 0}}catch{return null}}function nT(e,t){let n=RegExp(`<meta[^>]*(?:property|name)="${t}"[^>]*content="([^"]*)"`,`i`).exec(e);if(n)return iT(n[1]);let r=RegExp(`<meta[^>]*(?:property|name)='${t}'[^>]*content='([^']*)'`,`i`).exec(e);if(r)return iT(r[1]);let i=RegExp(`<meta[^>]*content="([^"]*)"[^>]*(?:property|name)="${t}"`,`i`).exec(e);if(i)return iT(i[1]);let a=RegExp(`<meta[^>]*content='([^']*)'[^>]*(?:property|name)='${t}'`,`i`).exec(e);return a?iT(a[1]):``}function rT(e){let t=/<title[^>]*>([^<]*)<\/title>/i.exec(e);return t?iT(t[1].trim()):``}function iT(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/&#x([0-9a-f]+);/gi,(e,t)=>String.fromCharCode(parseInt(t,16))).replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(parseInt(t)))}async function aT(e){try{let t=await(0,f.requestUrl)({url:e,method:`GET`});if(t.status!==200)return null;let n=t.text,r=nT(n,`og:title`),i=nT(n,`og:description`),a=nT(n,`og:image`),o=nT(n,`description`),s=rT(n),c=r||s||``,l=i||o||``;return!c||c.length<=3?null:{title:c,description:l,image:a||void 0}}catch{return null}}async function oT(e,t){if($w.has(e))return $w.get(e);let n=await tT(e,t||Yw(e));if(n&&n.title)return $w.set(e,n),n;let r=await aT(e);return r?($w.set(e,r),r):null}function sT(e){if(!e||e.trim().length===0)return null;let t=e.trim();if(qw.test(t))return null;t=t.replace(Kw,``).trim(),t=t.replace(/\n/g,` `);let{tags:n,contentWithoutTags:r}=Jw(t),i=r.trim();if(!i)return null;let a=Ww.exec(i);if(a){let e=a[1],t=Yw(e);return{url:e,tags:n,platform:t,embedUrl:Xw(e,t)}}let o=Gw.exec(i);if(o){let e=o[1],t=o[2],r=Yw(t);return{url:t,displayText:e||void 0,tags:n,platform:r,embedUrl:Xw(t,r)}}return null}var cT={bilibili:`tv`,youtube:`play-circle`,netease:`headphones`,spotify:`disc`,twitter:`message-circle`,general:`link`},lT=({linkInfo:e,memo:t,onTagClick:n,onContextMenu:r})=>{let{url:i,displayText:a,tags:o,platform:s}=e,c=Pw[s],l=Zw(i),u=Qw(i),d=s===`bilibili`||s===`youtube`?`video`:s===`netease`||s===`spotify`?`audio`:`link`,p=(0,U.useRef)(null),m=(0,U.useRef)(null),[h,g]=(0,U.useState)(null);(0,U.useEffect)(()=>{p.current&&(0,f.setIcon)(p.current,`external-link`),m.current&&(0,f.setIcon)(m.current,cT[s])},[s]),(0,U.useEffect)(()=>{let e=!1;return oT(i,s).then(t=>{!e&&t&&g(t)}),()=>{e=!0}},[i,s]);let _=a||h?.title||c.label,v=h?.description||``,y=(0,U.useCallback)(e=>{e.target.closest(`.enhanced-link-tags`)||(e.preventDefault(),e.stopPropagation(),window.open(i,`_blank`))},[i]),b=(0,U.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),n?.(t)},[n]);return(0,W.jsxs)(`div`,{className:`enhanced-link-card enhanced-link-card--${d}`,"data-platform":s,"aria-label":t.createdAt,onClick:y,onContextMenu:r,children:[(0,W.jsxs)(`div`,{className:`enhanced-link-card-body`,children:[(0,W.jsx)(`div`,{className:`enhanced-link-card-icon-wrapper`,style:{"--card-accent":c.color},children:(0,W.jsx)(`span`,{ref:m,className:`enhanced-link-card-platform-icon`})}),(0,W.jsxs)(`div`,{className:`enhanced-link-card-content`,children:[(0,W.jsx)(`span`,{className:`enhanced-link-card-title`,children:_}),v&&(0,W.jsx)(`span`,{className:`enhanced-link-card-desc`,children:v}),(0,W.jsxs)(`span`,{className:`enhanced-link-card-url`,children:[(0,W.jsx)(`img`,{className:`enhanced-link-card-favicon`,src:u,alt:``,loading:`lazy`}),l]})]}),(0,W.jsx)(`span`,{ref:p,className:`enhanced-link-card-external`})]}),o.length>0&&(0,W.jsx)(`div`,{className:`enhanced-link-tags`,children:o.map(e=>(0,W.jsxs)(`span`,{className:`tag-span`,onClick:t=>b(t,e),children:[`#`,e]},e))})]})};H(),N(),vi(),Cv(),Mv(),Wr(),Aa(),Qr(),fa();var uT=class extends f.SuggestModal{constructor(e,t){super(e),this.thino=t}sanitisedFileName(e){let t=Vr;return e.replace(t,``).trim().slice(0,255)}ensureUniqueFileNames(e){let t=[];return e.map(e=>{let n=this.sanitisedFileName(e[0]),r=t.filter(e=>e==n);return t.push(n),r.length>=1?`${n}${r.length+1}`:n})}contentSplitByHeading(e,t){let n=e.split(`
|
||
`),r=Array(t).join(`#`)+` `,i=Array(t+1).join(`#`)+` `,a=[],o=[];return n.forEach((e,t)=>{e.startsWith(i)?o.length>0?(a.push(o),o=[],o.push(e)):o.push(e):o.length>0&&!e.startsWith(r)?o.push(e):o.length>0&&(a.push(o),o=[]),t===n.length-1&&o.length>0&&a.push(o)}),a}onChooseSuggestion(e,t){this.selectSuggestion(e,t)}renderSuggestion(e,t){t.setText(e.title)}getSuggestions(){return[{id:`splitByHeading1`,title:M(`Split by Heading 1`)},{id:`splitByHeading2`,title:M(`Split by Heading 2`)},{id:`splitByHeading3`,title:M(`Split by Heading 3`)}]}async selectSuggestion(e,t){let n=[];if(e.id===`splitByHeading1`?n=this.contentSplitByHeading(this.thino.content,1):e.id===`splitByHeading2`?n=this.contentSplitByHeading(this.thino.content,2):e.id===`splitByHeading3`&&(n=this.contentSplitByHeading(this.thino.content,3)),n.length===0){new f.Notice(`No headings found`),this.close();return}let r=this.ensureUniqueFileNames(n);for(let e of n){let t=n.indexOf(e),i=await V.createThino({content:e.join(`
|
||
`),name:r[t],type:`MULTI`,isList:!0});V.pushMemo(i)}let i=this.thino.content;n.forEach((e,t)=>{i=i.replace(e.join(`
|
||
`),`[[${r[t]}]]`)});let a=await V.updateMemo(this.thino.id,i);a&&V.editMemo(a),this.close()}},dT=async(e,t,n)=>{let r=n.getAttribute(`href`),i=n.className;if(i.contains(`tag`))fT(n.innerText.slice(1));else if(i.contains(`internal-link`)){let r=n.getAttribute(`data-href`),i=V.getMemoById(r??``);i?Fx(i):await e.workspace.openLinkText(r,r,!f.Platform.isMobile&&t.navigation!==!0)}else r&&window.open(r,`_blank`)},fT=e=>{let t=z.getState().query.tag;z.setTagQuery(t.contains(`,`)?t.split(`,`).includes(e)?t.split(`,`).filter(t=>t!==e).join(`,`):t+`,`+e:t===e?``:e)},pT=(e,t)=>{let n=t?.getAttribute(`src`),r=t?.parentElement.getAttribute(`src`),i=[...e?.querySelectorAll(`img`)||[]],a=i.indexOf(t);KS({imgUrl:n,filepath:n.startsWith(`app`)?r:void 0,otherIMGEls:i,currentIndex:a})},mT=e=>{let t=e.dataset?.value,n=V.getMemoById(t??``);n?Fx(n):(new f.Notice(`Thino Not Found`),e.classList.remove(`memo-link-text`))},hT=async(e,t,n,r)=>{let i=e?.AppendDateWhenTaskDone?` ✅ `+(0,f.moment)().format(`YYYY-MM-DD`):``,a=r.parentElement.dataset?.task===`x`?`DONE`:`TODO`,o=[...n?.querySelectorAll(`li.task-list-item`)||[]];for(let n of o)if(n===r||n===r.closest(`li.task-list-item`)){let r=o.indexOf(n),s=t.content.split(/\n/),c=[];for(let e=0;e<s.length;e++)/^\s*(-|\*|\d+\.)\s\[.\]\s/.test(s[e])&&c.push(e);let l=c[r],u=s[l],d=u.match(/^\s*(-|\*|\d+\.)\s\[.\]\s/)[0],f=u.replace(/^\s*(-|\*|\d+\.)\s\[.\]\s/,d.replace(/\[.\]/,a===`TODO`?`[x]`:`[ ]`))+(a===`TODO`?i:``);e.AppendDateWhenTaskDone&&a!==`TODO`&&(f=f.replace(/ ✅ \d{4}-\d{2}-\d{2}/g,``)),s[l]=f;let p=s.join(`
|
||
`).trim();if(t&&t.content!==p){let e=await V.updateMemo(t.id,p);V.editMemo(e)}}},gT=(0,U.memo)(e=>{let{editMemoId:t,memoListView:n}=si(),{app:r,view:i,settings:a,verifyState:o}=I(),{pathname:s}=di(),{memo:c,type:l=`inline`}=e,u=(0,U.useRef)(null),d=(0,U.useRef)(null),[p,m]=(0,U.useState)(!1),h=(0,U.useRef)(null),[g,_]=(0,U.useState)(!1),[v,y]=(0,U.useState)(0),[b,x]=(0,U.useState)(!1),{isSelected:S,handleClick:C}=Nw(c.id),w=(0,U.useMemo)(()=>sT(c.content),[c.content]);(0,U.useEffect)(()=>{p&&setTimeout(()=>{R.setEditMemoId(c.id)},100)},[p]),(0,U.useEffect)(()=>{(s===`/review`||s===`/daily`)&&t!==c.id&&p&&m(!1)},[t]),(0,U.useEffect)(()=>{h.current&&!g&&u.current&&(r.dragManager.handleDrag(h.current,e=>{r.dragManager.updateSource([u.current],`is-dragging`);let t=V.getMemoById(c.id);if(e.dataTransfer.setData(`text/plain`,c.content),e.dataTransfer.setData(`text/uri-list`,c.content),e.dataTransfer.setData(`Text`,c.content),a?.DraggingBehavior===`block-link`)if(t?.sourceType===`DAILY`){let e=r.vault.getFileByPath(t.path),n=t.hasId;return t.hasId||(n=P.randomId(6),sa(t,{id:t.id,hasId:n})),{type:`link`,icon:`lucide-link`,title:e.basename,linktext:`${t.path}#^${n}`,sourcePath:t.path,file:e,memo:t,blockId:n,source:`thino-plugin`}}else return null;else if(a?.DraggingBehavior===`text`)return null}),_(!0))},[h.current,u.current,a?.DraggingBehavior]);let T=e=>{if(!C(e)){if(e.ctrlKey||e.metaKey){let e=(0,f.moment)(c.createdAt,`YYYY/MM/DD HH:mm:ss`);z.setFromAndToQuery(e.startOf(`day`).valueOf(),e.endOf(`day`).valueOf());return}Fx(c)}},E=()=>{if(a?.UseButtonToShowEditor&&a?.DefaultEditorLocation===`Bottom`){let e=document.querySelector(`div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.thino-hidden)`);e&&e.trigger(`click`)}R.setMarkMemoId(c.id)},D=async()=>{let e=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),t=f.Platform.isDesktop?await Dv():e.identifier||e.uuid;if(!o||o?.appId!==t){Sv();return}c.pinned?await V.unpinMemoById(c.id):await V.pinMemoById(c.id)},O=()=>{if(a?.UseButtonToShowEditor&&a?.DefaultEditorLocation===`Bottom`&&f.Platform.isMobile){let e=document.querySelector(`div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.thino-hidden)`);e&&e.trigger(`click`)}(s===`/review`||s===`/daily`)&&m(!0),s!==`/review`&&s!==`/daily`&&R.setEditMemoId(c.id)},k=async e=>{e.sourceType===`MULTI`&&e.id.trim()===``&&await V.updateMemoProperty(e)},A=async e=>{await V.openThinoByID(e.id)},j=async e=>{try{let t=await V.archiveMemo(e);t&&V.editMemo(t)}catch(e){console.error(e),new f.Notice(e.message)}},ee=async()=>{try{if(a.DeleteThinoDirectly)await V.deleteMemoById(c.id);else{let e=await V.hideMemoById(c.id);e&&V.editMemo(e)}}catch(e){new f.Notice(e.message)}R.getState().editMemoId===c.id&&R.setEditMemoId(``)},te=()=>{if(d.current&&!d.current.confirmStatus){d.current&&d.current.toggleConfirm(!1);return}},ne=()=>{RS(c)},re=async()=>{let e=await V.updateMemo(c.id,c.content,c.thinoType===`TASK-TODO`?`TASK-DONE`:`TASK-TODO`);e&&V.editMemo(e)},ie=async()=>{navigator.clipboard.writeText(c.content).then(()=>{new f.Notice(M(`COPY SUCCEED`))}).catch(()=>{new f.Notice(M(`COPY FAILED`))})},ae=async()=>{new uT(r,c).open()},oe=()=>{kx.delete(c.id),x(!1),y(e=>e+1)},se=b&&(0,f.requireApiVersion)(`1.11.4`)&&jx(c.content,a),ce=e=>{if(e&&e.target.tagName!==`INPUT`)switch(a?.doubleClickBehavior||`edit-thino`){case`open-thino`:Fx(c);break;case`edit-thino`:O();break;case`go-to-source`:A(c);break;case`do-nothing`:break;default:O();break}},le=async(e,t)=>{if(C(e))return;e.preventDefault(),e.stopPropagation();let n=e.target;if(e.ctrlKey||e.metaKey){await A(t);return}if(n.tagName===`A`){await dT(r,i,n);return}if(n.tagName===`IMG`){pT(u.current,n);return}if(n.tagName===`A`&&n.getAttribute(`href`)){let e=n.getAttribute(`href`);window.open(e,`_blank`);return}if(n.className===`memo-link-text`){mT(n);return}if(n.tagName===`INPUT`&&n.hasClass(`task-list-item-checkbox`)){await hT(a,t,u.current,n);return}},ue=async e=>{let t=await Sa(c,e);navigator.clipboard.writeText(t),new f.Notice(M(`COPY SUCCEED`))},de=e=>{let t=new f.Menu;t.dom.toggleClass(`memo-context-menu`,!0);let i=window.getSelection();i?.toString().length>0&&t.addItem(e=>{e.setIcon(`copy`).setTitle(M(`Copy selected text`)).onClick(()=>{navigator.clipboard.writeText(i.toString()).then(()=>{new f.Notice(M(`COPY SUCCEED`))}).catch(()=>{new f.Notice(M(`COPY FAILED`))})})}).addSeparator(),c.sourceType===`DAILY`&&(t.addItem(e=>{e.setIcon(`link`).setTitle(M(`Copy embed link`)).onClick(()=>{ue(!0)})}),t.addItem(e=>{e.setIcon(`link`).setTitle(M(`Copy link`)).onClick(()=>{ue(!1)})}),t.addSeparator()),a?.enableReferenceLinksGroup&&n!==`list`&&t.addItem(t=>{t.setIcon(`link`).setTitle(M(`Reference links group`)).onClick(()=>fe(e))}),t.addItem(e=>{e.setIcon(`copy`).setTitle(M(`Copy thino`).toLocaleUpperCase()).onClick(async()=>{await ie(),t.close()})}).addItem(t=>{t.setIcon(`book-open`).setTitle(M(`READ`)).onClick(()=>T(e))}).addItem(e=>{e.setIcon(c.pinned?`pin-off`:`pin`).setTitle(c.pinned?M(`UNPIN`):M(`PIN`)).onClick(D)}).addItem(e=>{e.setIcon(`bookmark`).setTitle(M(`MARK`)).onClick(E)}).addItem(e=>{e.setIcon(`share-2`).setTitle(M(`SHARE`)).onClick(ne)}).addItem(e=>{e.setIcon(`pencil`).setTitle(M(`EDIT`)).onClick(O)}).addItem(e=>{e.setIcon(`home`).setTitle(M(`SOURCE`)).onClick(()=>A(c))}),se&&t.addItem(e=>{e.setIcon(`lock`).setTitle(M(`Lock`)).onClick(oe)}),t.addItem(e=>{e.setIcon(`file-output`).setTitle(M(`Send to file`)).onClick(()=>{hC(r,[c])})}),t.addSeparator().addItem(e=>{e.setIcon(`archive`).setWarning(!0).setTitle(M(`ARCHIVE`).toLocaleUpperCase()).onClick(()=>j(c))}).addItem(e=>{e.setIcon(`trash`).setWarning(!0).setTitle(M(`DELETE`)).onClick(async()=>{await ee()})}),t.showAtMouseEvent(e.nativeEvent)},fe=e=>{e.stopPropagation(),e.preventDefault();let t=new f.Menu;(async()=>{try{let n=[],r=[],i=[...c.content.matchAll(Br)];for(let e of i)if(e&&e.length===3){let t=e[2],r=V.getMemoById(t);r&&n.push({...r,createdAtStr:P.getDateTimeString(r.createdAt),dateStr:P.getDateString(r.createdAt)})}let a=va(c.content);for(let e of a){let[t,r]=e.split(`#^`),i=r;if(t&&i){let e=await V.getLinkedMemoByBlockId(i,t);e&&(n.some(t=>t.id===e.id)||n.push({...e,createdAtStr:P.getDateTimeString(e.createdAt),dateStr:P.getDateString(e.createdAt)}))}}let o=await V.getLinkedMemos(c.id),s=[];c.hasId&&c.path&&(s=await V.getLinkedMemosByLinkId(c.hasId,c.path));let l=[...o,...s];Array.from(new Map(l.map(e=>[e.id,e])).values()).sort((e,t)=>P.getTimeStampByDate(t.createdAt)-P.getTimeStampByDate(e.createdAt)).forEach(e=>{r.push({...e,createdAtStr:P.getDateTimeString(e.createdAt),dateStr:P.getDateString(e.createdAt)})}),t.addSections([`Outgoing`,`Incoming`]),n.length>0&&n.forEach(e=>{t.addItem(t=>{let n=e.content.length>10?e.content.substring(0,10)+`...`:e.content;t.setTitle(n).setIcon(`arrow-right`).onClick(()=>{Fx(e)})})}),r.length>0&&r.forEach(e=>{t.addItem(t=>{let n=e.content.length>10?e.content.substring(0,10)+`...`:e.content;t.setTitle(n).setSection(`Incoming`).setIcon(`arrow-left`).onClick(()=>{Fx(e)})})}),n.length===0&&r.length===0&&t.addItem(e=>{e.setDisabled(!0).setTitle(M(`No reference links found`))}),t.showAtMouseEvent(e.nativeEvent)}catch(e){console.error(`Error fetching linked memos:`,e),new f.Notice(M(`Error fetching reference links`))}})()},pe=(0,U.useMemo)(()=>({memo:c,memoListView:n,handlePinMemoClick:D,handleFixMemoClick:k,handleSourceMemoClick:A,handleArchiveMemo:j,handleDeleteMemoClick:ee,handleGenMemoImageBtnClick:ne,handleMarkMemoClick:E,handleEditMemoClick:O,handleCopyMemoClick:ie,handleShowMemoStoryDialog:T,handleSplitMemoClick:ae,handleCopyEmbedLink:ue,handleReferenceLinksGroupClick:fe,handleLockMemo:oe,canLockMemo:se}),[c,se]),me=(0,U.useMemo)(()=>({memo:c,handleMemoTypeToggle:re,handleShowMemoStoryDialog:T,settings:a}),[c,a]);return(0,W.jsx)(W.Fragment,{children:(0,U.useMemo)(()=>(window.__THINO_DEBUG_MEMO_RENDER__&&console.log(`[Memo] render`,c?.id),w&&!p?(0,W.jsx)(lT,{linkInfo:w,memo:{createdAt:c.createdAt,pinned:c.pinned},onTagClick:e=>fT(e),onContextMenu:de}):(0,W.jsxs)(`div`,{ref:u,className:u_(`memo-wrapper`,`memo-container`,{pinned:c.pinned,selected:S}),"data-source-type":c.sourceType,"data-thino-type":c.thinoType,"data-thino-id":c.id,onMouseLeave:te,onMouseOver:e=>{!e.shiftKey||!i||!r||(e.stopPropagation(),r.workspace.trigger(`hover-link`,{event:e,source:`thino`,hoverParent:i.containerEl,targetEl:u.current,linktext:c.path,sourcePath:c.path,state:{scroll:c.sourceType===`DAILY`?parseInt(c.id.slice(14)):0}}))},onContextMenu:de,children:[p&&(0,W.jsx)(Aw,{editorType:`inline`}),!p&&(0,W.jsxs)(W.Fragment,{children:[l===`inline`&&(0,W.jsxs)(`div`,{ref:h,className:`memo-top-wrapper`,draggable:!0,children:[(0,W.jsx)(_C,{...me}),(0,W.jsx)(gC,{...pe})]}),(0,W.jsx)(Mx,{memo:c,lockVersion:v,onReveal:()=>x(!0),handleMemoContentClick:le,handleMemoDoubleClick:ce})]})]})),[c,p,w,se,v])})},(e,t)=>{let n=e.memo,r=t.memo;return n.id===r.id&&n.updatedAt===r.updatedAt&&n.content===r.content&&n.pinned===r.pinned&&n.visibility===r.visibility});H(),N(),Cv(),Mv();var _T=e=>{let{destroy:t,queryId:n,type:r=`dialog`}=e,[i,a]=(0,U.useState)(``),[o,s]=(0,U.useState)(r===`dialog`?[]:[uv()]),c=Rb(!1),[l,u]=(0,U.useState)(!1),[d,p]=zb(!1),m=f.Platform.isDesktop,h=(0,U.useRef)(null),g=(0,U.useRef)(null),[_,v]=(0,U.useState)(!0),y=(0,U.useMemo)(()=>V.getState().memos.filter(e=>e.deletedAt!==``&&e.deletedAt||e.rowStatus===`ARCHIVED`?!1:dv(e,o)),[o]),b=y.length,{displayedItems:x,hasMore:S,sentinelRef:C}=nx({allItems:y,initialCount:20,loadMoreCount:20,enabled:m});(0,U.useLayoutEffect)(()=>{if(!m||!h.current)return;let e=h.current.closest(`.dialog-container`);if(!e)return;e.style.transform=`translateX(-${436/2}px)`;let t=()=>{let t=g.current;if(!t)return;let n=e.getBoundingClientRect();t.style.top=`${n.top}px`,t.style.left=`${n.right+16}px`,t.style.maxHeight=`${window.innerHeight-n.top-32}px`};requestAnimationFrame(t);let n=new ResizeObserver(t);return n.observe(e),window.addEventListener(`resize`,t),()=>{e.style.transform=``,n.disconnect(),window.removeEventListener(`resize`,t)}},[m]),(0,U.useEffect)(()=>{if(!m||!h.current)return;let e=h.current.closest(`.dialog-wrapper`);if(!e)return;let t=new MutationObserver(()=>{if(e.classList.contains(`showoff`)){v(!1);let e=h.current?.closest(`.dialog-container`);e&&(e.style.transform=``)}});return t.observe(e,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[m]),(0,U.useEffect)(()=>()=>{g.current?.remove()},[]),(0,U.useEffect)(()=>{w()},[n]);let w=()=>{let e=Bg.getQueryById(n??``);if(e){a(e.title);let t=JSON.parse(e.querystring);return Array.isArray(t)&&s(t),e}},T=e=>{let t=e.target.value;a(t)},E=async()=>{if(!i)return new f.Notice(M(`TITLE CANNOT BE NULL!`)),null;if(o.length===0)return new f.Notice(M(`FILTER CANNOT BE NULL!`)),null;if(o.length===1&&o[o.length-1].value.value===``)return new f.Notice(M(`Please finish the last filter setting first`)),null;let e,t=Bg.getQueryById(n||``);try{n&&!n.startsWith(`Filter [Temp] `)&&t.title===i?(e=await Bg.updateQuery(n,i,JSON.stringify(o)),Bg.editQuery(e),await Bg.getMyAllQueries()):(e=await Bg.createQuery(i,JSON.stringify(o)),Bg.pushQuery(e),await Bg.getMyAllQueries())}catch(e){new f.Notice(e.message)}return e},D=async()=>{switch(r){case`modal`:case`inline`:if(o.length===0){new f.Notice(M(`FILTER CANNOT BE NULL!`));return}if(o.length===1&&o[o.length-1].value.value===``){new f.Notice(M(`Please finish the last filter setting first`));return}try{let e=Bg.getQueryById(n??``);if(e&&JSON.stringify(o)===e.querystring){z.setMemoFilter(e.id),t();return}let r=Bg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(o));Bg.pushQuery(r),z.setMemoFilter(r.id)}catch(e){new f.Notice(e.message)}t();break;case`dialog`:try{if(!await E())return}catch(e){console.error(e),new f.Notice(e.message)}t();break}},O=()=>{if(o.length===0){new f.Notice(M(`FILTER CANNOT BE NULL!`));return}if(l){z.setMemoFilter(``),u(!1);return}let t=Bg.getQueryById(n??``);if(t&&JSON.stringify(o)===t.querystring){z.setMemoFilter(t.id);return}let r=Bg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(o));Bg.pushQuery(r),z.setMemoFilter(r.id),e.setPreview&&e.setPreview(r.id),u(!0)},k=()=>{if(o.length>0&&o[o.length-1].value.value===``){new f.Notice(M(`Please finish the last filter setting first`));return}s([...o,uv()])},A=(0,U.useCallback)((e,t)=>{s(n=>{let r=[...n];return r[e]=t,r})},[]),j=(0,U.useCallback)(e=>{s(t=>t.filter((t,n)=>n!==e))},[]);return(0,W.jsxs)(W.Fragment,{children:[r===`dialog`&&(0,W.jsxs)(`div`,{className:`dialog-header-container`,ref:h,children:[(0,W.jsxs)(`span`,{className:`title-text`,children:[(0,W.jsx)(`span`,{className:`icon-text`,children:`🔖`}),M(n?`EDIT QUERY`:`CREATE QUERY`)]}),(0,W.jsx)(`button`,{ref:e=>{e&&(0,f.setIcon)(e,`x`)},className:`btn close-btn`,onClick:t})]}),(0,W.jsxs)(`div`,{className:`dialog-content-container`,children:[(r===`dialog`||d)&&(0,W.jsxs)(`div`,{className:`form-item-container input-form-container`,children:[(0,W.jsx)(`span`,{className:`normal-text`,children:M(`TITLE`)}),(0,W.jsx)(`input`,{className:`title-input`,type:`text`,value:i,onChange:T})]}),(0,W.jsxs)(`div`,{className:`form-item-container filter-form-container`,children:[(0,W.jsx)(`span`,{className:`normal-text`,children:M(`FILTER`)}),(0,W.jsxs)(`div`,{className:`filters-wrapper`,children:[o.map((e,t)=>(0,W.jsx)(vT,{index:t,filter:e,handleFilterChange:A,handleFilterRemove:j},t)),(0,W.jsx)(`div`,{className:`create-filter-btn`,onClick:k,children:M(`ADD FILTER TERMS`)})]})]})]}),(0,W.jsx)(`div`,{className:`dialog-footer-container`,children:(0,W.jsxs)(`div`,{className:`btns-container`,children:[(r===`inline`||r===`modal`)&&(0,W.jsx)(`button`,{className:`btn ${d?`mod-cta`:`save-btn`}`,onClick:async()=>{if(!d)p();else{let e=await E();p(!1),t(),e&&z.setMemoFilter(e.id)}},children:M(d?`Set and save`:`Save`)}),(0,W.jsxs)(`div`,{className:`btns-group-container`,children:[(0,W.jsxs)(`span`,{className:`tip-text ${o.length===0&&`thino-hidden`}`,children:[M(`MATCH`),` Thino `,(0,W.jsx)(`strong`,{children:b}),` `,M(`TIMES`)]}),(0,W.jsx)(W.Fragment,{children:r===`inline`&&(0,W.jsx)(`button`,{className:`btn mod-cta`,onClick:O,children:M(`Preview`)})}),(0,W.jsx)(`button`,{className:`btn save-btn ${c.isLoading?`requesting`:``}`,onClick:D,children:M(r===`inline`||r===`modal`?`Filter`:n?`EDIT`:`Save`)})]})]})}),m&&_&&(0,Nb.createPortal)((0,W.jsxs)(`div`,{ref:g,className:`query-preview-floating-panel`,onClick:e=>e.stopPropagation(),children:[(0,W.jsxs)(`div`,{className:`preview-header`,children:[(0,W.jsx)(`span`,{className:`preview-title`,children:M(`Preview`)}),(0,W.jsxs)(`span`,{className:`preview-count`,children:[b,` Thinos`]})]}),(0,W.jsxs)(`div`,{className:`preview-memo-list`,children:[x.length===0&&(0,W.jsx)(`div`,{className:`preview-empty`,children:o.length===0?M(`ADD FILTER TERMS`):`${M(`MATCH`)} 0 ${M(`TIMES`)}`}),x.map(e=>(0,W.jsx)(gT,{memo:e},e.id)),S&&(0,W.jsx)(`div`,{ref:C,className:`preview-sentinel`})]})]}),document.body)]})},vT=(0,U.memo)(e=>{let{index:t,filter:n,handleFilterChange:r,handleFilterRemove:i}=e,{type:a}=n,o=(0,U.useRef)(null),s=(0,U.useRef)(null),c=(0,U.useRef)(n),l=(0,U.useRef)(a);(0,U.useEffect)(()=>{c.current=e.filter},[n]),(0,U.useEffect)(()=>{if(console.log(a!==`TAG`&&s.current),o.current)return a!==`TAG`&&s.current&&(s.current.destroy(),s.current=null,o.current.detach()),a===`TAG`&&!s.current&&(l.current=a,s.current=new tx(o.current,m)),()=>{s.current&&=(s.current.destroy(),null)}},[o,a]);let u=(0,U.useCallback)(e=>{[`AND`,`OR`].includes(e)&&r(t,{...n,relation:e})},[n]),d=(0,U.useCallback)(async e=>{if(n.type!==e){let{verifyState:i}=L.getState(),a=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),o=f.Platform.isDesktop?await Dv():a.identifier||a.uuid,s=i&&i?.appId===o;if((e===`SOURCE`||e===`PATH`||e===`METADATA`||e===`TIME_RANGE`)&&!s){Sv();return}let c=Object.values(sv[e].operators);r(t,{...n,type:e,value:{operator:c[0].value,value:e===`METADATA`?{name:``,value:``}:e===`TIME_RANGE`?sv.TIME_RANGE.values[0].value:``}})}},[n]),p=(0,U.useCallback)(e=>{r(t,{...n,value:{...n.value,operator:e}})},[n]),m=(0,U.useCallback)((e,n=`OTHERS`)=>{n===`OTHERS`?r(t,{...c.current,value:{...c.current.value,value:e}}):r(t,{...c.current,value:{...c.current.value,value:{...c.current.value.value,[n===`METADATA_NAME`?`name`:`value`]:e}}})},[n]),h=()=>{i(t)},g={TYPE:(0,W.jsx)(Vb,{className:`value-selector`,dataSource:sv.TYPE.values,value:n.value.value,handleValueChanged:m}),LIST:(0,W.jsx)(Vb,{className:`value-selector`,dataSource:sv.LIST.values,value:n.value.value,handleValueChanged:m}),SOURCE:(0,W.jsx)(Vb,{className:`value-selector`,dataSource:sv.SOURCE.values,value:n.value.value,handleValueChanged:m}),PATH:(0,W.jsx)(`input`,{type:`text`,className:`value-inputer`,value:n.value.value,onChange:e=>{m(e.target.value)}}),METADATA:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`input`,{type:`text`,className:`value-inputer`,value:n.value.value.name,onChange:e=>{m(e.target.value,`METADATA_NAME`)}}),(0,W.jsx)(`input`,{type:`text`,className:`value-inputer`,value:n.value.value.value,onChange:e=>{m(e.target.value,`METADATA_VALUE`)}})]}),TAG:(0,W.jsx)(`input`,{type:`text`,id:Math.random().toString(36).substring(7),className:`value-inputer`,ref:o,value:n.value.value,onChange:e=>{m(e.target.value)}}),TEXT:(0,W.jsx)(`input`,{type:`text`,className:`value-inputer`,value:n.value.value,onChange:e=>{m(e.target.value)}}),DATE:(0,W.jsxs)(`div`,{className:`date-inputer`,children:[(0,W.jsx)(Yb,{type:`icon`,handleValueChange:m}),(0,W.jsx)(`input`,{type:`text`,className:`value-inputer`,value:n.value.value,onChange:e=>{m(e.target.value)}})]}),TIME_RANGE:(0,W.jsx)(Vb,{className:`value-selector`,dataSource:sv.TIME_RANGE.values,value:n.value.value,handleValueChanged:m})};return(0,W.jsxs)(`div`,{className:`memo-filter-input-wrapper`,children:[t>0&&(0,W.jsx)(Vb,{className:`relation-selector`,dataSource:ov,value:n.relation,handleValueChanged:u}),(0,W.jsx)(Vb,{className:`type-selector`,dataSource:Object.values(sv),value:n.type,handleValueChanged:d}),(0,W.jsxs)(W.Fragment,{children:[Object.keys(sv).includes(a)&&(0,W.jsx)(Vb,{className:`operator-selector`,dataSource:Object.values(sv[a].operators),value:n.value.operator,handleValueChanged:p}),g[a]]}),(0,W.jsx)(`div`,{ref:e=>{e&&(0,f.setIcon)(e,`x`)},className:`btn remove-btn`,onClick:h})]})});function yT(e){t_({className:`create-query-dialog`},_T,{queryId:e})}H(),vi(),Cv(),Mv();var bT=e=>{let{app:t,verifyState:n}=I(),{query:r}=di(),i=U.useRef(null),[a,o]=U.useState(!1),s=U.useRef(null),[c,l]=U.useState(``),u=Ib(i.current,s.current,{placement:`bottom-start`,modifiers:[{name:`offset`,options:{offset:[0,10]}}]});(0,U.useEffect)(()=>{a&&u.update&&u?.update()},[a]),(0,U.useEffect)(()=>{i&&(0,f.setIcon)(i.current,`filter`)},[i]);let d=async()=>{let e=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),t=f.Platform.isDesktop?await Dv():e.identifier||e.uuid;return!n||n?.appId!==t?(Sv(),!1):!0};return hv(s,()=>{o(!1),c&&z.getState().query.filter===c&&z.setMemoFilter(``)}),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`thino-inline-filter-wrapper pro`,ref:i,onClick:async()=>{await d()&&(f.Platform.isDesktop?(o(!a),await u?.update()):new xT(L.getState().app,r.filter,e=>{l(e)}).open())}}),(0,W.jsx)(`div`,{ref:s,className:`thino-inline-filter-container ${a?``:`thino-hidden`}`,style:u.styles.popper,children:a&&(0,W.jsx)(_T,{type:`inline`,queryId:r.filter?.startsWith(`Filter [Temp] `)&&!r.filter?.includes(`Filter [Temp]`)?``:r.filter,destroy:()=>{o(!1)},setPreview:e=>{l(e)}})})]})},xT=class extends f.Modal{root;setPreview;constructor(e,t,n){super(e),this.filter=t,this.setPreview=n}onOpen(){let{contentEl:e}=this;this.root=(0,$g.createRoot)(e),this.root.render((0,W.jsx)(`div`,{className:`thino-inline-filter-container`,children:(0,W.jsx)(_T,{type:`modal`,queryId:this.filter?.startsWith(`Filter [Temp] `)&&!this.filter?.includes(`Filter [Temp]`)?``:this.filter,destroy:()=>{this.close()},setPreview:e=>{this.setPreview(e)}})}))}onClose(){this.root?.unmount()}};vi(),Sg();var ST=[{field:`createdAt`,label:`Created Time`},{field:`updatedAt`,label:`Updated Time`},{field:`content-length`,label:`Content Length`},{field:`sourceType`,label:`Source Type`},{field:`thinoType`,label:`Thino Type`}],CT=({onSortChange:e,currentSort:t})=>{let{app:n}=I(),r=xg(e=>e.sort),i=xg(e=>e.setSort),a=t||r,[o]=(0,U.useState)(U.createRef());(0,U.useEffect)(()=>{o.current&&(0,f.setIcon)(o.current,`arrow-up-down`)},[o.current]);let s=(0,U.useCallback)(t=>{t.stopPropagation();let r=new f.Menu;ST.forEach(({field:t,label:o})=>{r.addItem(r=>{let s=a.field===t&&a.direction===`asc`;r.setTitle(`${o} (Ascending)`).setIcon(s?`check`:``).onClick(()=>{let r={field:t,direction:`asc`,label:o};e&&e(r),i(r),n?.saveLocalStorage(`memoSortConfig`,JSON.stringify(r))})}),r.addItem(r=>{let s=a.field===t&&a.direction===`desc`;r.setTitle(`${o} (Descending)`).setIcon(s?`check`:``).onClick(()=>{let r={field:t,direction:`desc`,label:o};e&&e(r),i(r),n?.saveLocalStorage(`memoSortConfig`,JSON.stringify(r))})})}),r.showAtMouseEvent(t.nativeEvent)},[t,e,n]);return(0,W.jsx)(`div`,{className:`sort-selector-wrapper`,onClick:s,title:(()=>{let e=a;return`${e.label} ${e.direction===`asc`?`↑`:`↓`}`})(),children:(0,W.jsx)(`span`,{ref:o,className:`sort-icon`})})};vi(),H(),_o();var wT=()=>{let{isMobileView:e,showSiderbarInMobileView:t}=si(),[n]=(0,U.useState)(U.createRef());(0,U.useEffect)(()=>{if(!n.current)return;let e=n.current;(0,f.setIcon)(e,`refresh-cw`)},[n.current]);let r=(0,U.useCallback)(async()=>{e&&t||(await go.pullFromWeb(go.getLastUpdatedTime()),await V.fetchAllMemos())},[]);return(0,W.jsx)(`span`,{className:`refresh-icon`,ref:n,onClick:()=>{r(),n&&n.current.firstElementChild.toggleClass(`rotate-hidden`,!0),setTimeout(()=>{n&&n.current.firstElementChild.toggleClass(`rotate-hidden`,!1)},1e3)}})},TT=({onSortChange:e,currentSort:t})=>{let{query:{filter:n}}=di(),{isMobileView:r}=si(),{queries:i}=$r(),[a,o]=(0,U.useState)(`THINO`);return(0,U.useEffect)(()=>{let e=Bg.getQueryById(n);o(e?e.title:`THINO`)},[n,i]),(0,W.jsxs)(`div`,{className:`section-header-container memos-header-container`,children:[(0,W.jsxs)(`div`,{className:`title-text`,children:[(0,W.jsx)(xv,{when:r,children:(0,W.jsx)(`button`,{ref:e=>{e&&(0,f.setIcon)(e,`panel-left`)},className:`btn action-btn clickable-icon`,onClick:(0,U.useCallback)(e=>{e.stopPropagation(),R.setShowSiderbarInMobileView(!0)},[])})}),(0,W.jsx)(`span`,{className:`normal-text`,children:a}),(0,W.jsx)(wT,{})]}),(0,W.jsxs)(`div`,{className:`memos-header-search-section`,children:[(0,W.jsx)(Fv,{}),(0,W.jsx)(Pv,{}),e&&t&&(0,W.jsx)(CT,{onSortChange:e,currentSort:t}),(0,W.jsx)(bT,{}),(0,W.jsx)(bv,{})]})]})};vi(),H(),N();var ET=()=>(0,W.jsxs)(`div`,{className:`user-banner-container user-banner-skeleton`,children:[(0,W.jsxs)(`div`,{className:`userinfo-header-container`,children:[(0,W.jsxs)(`div`,{className:`userinfo-container`,children:[(0,W.jsx)(`div`,{className:`thino-user-icon skeleton-icon`}),(0,W.jsxs)(`div`,{className:`thino-user-info`,children:[(0,W.jsxs)(`span`,{className:`username-container`,children:[(0,W.jsx)(`span`,{className:`username-text skeleton-text skeleton-username`}),(0,W.jsx)(`span`,{className:`user-pro-badge skeleton-badge`})]}),(0,W.jsx)(`span`,{className:`thino-user-quote skeleton-text skeleton-quote`})]})]}),(0,W.jsx)(`span`,{className:`btn-group`,children:(0,W.jsx)(`span`,{className:`btn action-btn menu-popup-btn skeleton-button`})})]}),(0,W.jsx)(`div`,{className:`status-text-container`,children:(0,W.jsxs)(`div`,{className:`status-text`,children:[(0,W.jsx)(`div`,{className:`amount-text skeleton-text skeleton-amount`}),(0,W.jsx)(`div`,{className:`type-text skeleton-text skeleton-type`})]})})]}),DT=()=>{let{settings:e,plugin:t,app:n,verifyState:r}=I(),{manifest:i,showSiderbarInMobileView:a,isMobileView:o}=si(),[s,c]=(0,U.useState)(`Memos`),[l,u]=(0,U.useState)(``),[d,p]=(0,U.useState)(!1);(0,U.useEffect)(()=>{console.log(`isReady`,n,e,i),p(!!(n&&e&&i))},[n,e,i]),(0,U.useEffect)(()=>{if(!e?.MomentsIcon||!n)return;let t=n.vault.adapter.getResourcePath((0,f.normalizePath)(e.MomentsIcon));t&&!e?.MomentsIcon.startsWith(`http`)?u(t):u(e?.MomentsIcon)},[e?.MomentsIcon,n]),(0,U.useEffect)(()=>{e&&c(e.UserName)},[e]);let m=(0,U.useCallback)(()=>{z.pushHistory(`/`),z.clearQuery()},[]),h=()=>{n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},g=()=>{if(e?.needVerify){R.setLocked(!0);return}else new f.Notice(M(`You have not set a password or enable this feature yet`)),n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},_=()=>{o_(n)},v=()=>{R.setShowSiderbarInMobileView(!1),t.settingTab.updateSettings(`FirstLoaded`,!0)},y=()=>{new c_(n,t,i.version).open()},b=(0,U.useCallback)(async e=>{let{type:t}=e;if(t.startsWith(`text`))try{return`${await Wg.parseHtml(e)}`}catch(e){new f.Notice(e)}},[]),x=(0,U.useCallback)(()=>{let e=document.createElement(`input`);document.body.appendChild(e),e.type=`file`,e.multiple=!1,e.accept=`text/html`,e.onchange=async()=>{if(!e.files||e.files.length===0)return;let t=e.files[0];await b(t),document.body.removeChild(e)},e.click()},[]),S=t=>{let n=new f.Menu;n.addItem(e=>{e.setIcon(`user`).setTitle(M(`Settings`)).onClick(h)}),e?.needVerify&&n.addItem(e=>{e.setIcon(`lock`).setTitle(M(`Lock`)).onClick(g)}),n.addItem(e=>{e.setIcon(`import`).setTitle(M(`Import`)).onClick(x)}),n.addSeparator(),n.addItem(e=>{e.setIcon(`file-text`).setTitle(M(`ChangeLog`)).onClick(_)}),n.addItem(e=>{e.setIcon(`settings`).setTitle(M(`Setting guide`)).onClick(v)}),n.addItem(e=>{e.setIcon(`alert-circle`).setTitle(M(`Submit issue`)).onClick(y)}),n.showAtMouseEvent(t.nativeEvent)};return d?(0,W.jsxs)(`div`,{className:`user-banner-container`,children:[(0,W.jsxs)(`div`,{className:`userinfo-header-container`,children:[(0,W.jsxs)(`div`,{className:`userinfo-container`,onClick:()=>{n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},children:[(0,W.jsx)(`div`,{ref:e=>{if(l){e?.empty();return}l||e&&(0,f.setIcon)(e,`Memos`)},className:`thino-user-icon`,style:{backgroundImage:`url("${l}")`}}),(0,W.jsxs)(`div`,{className:`thino-user-info`,children:[(0,W.jsxs)(`span`,{className:`username-container`,children:[(0,W.jsx)(`span`,{"aria-label":s===`MEMO 😉`?`THINO 😉`:s||`THINO`,className:`username-text`,onClick:m,children:s===`MEMO 😉`?`THINO 😉`:s||`THINO`}),(0,W.jsx)(`span`,{className:`user-pro-badge ${r?`activated`:``}`,onClick:()=>{n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},children:`PRO`})]}),e?.MomentsQuote&&(0,W.jsx)(`span`,{className:`thino-user-quote`,children:e?.MomentsQuote})]})]}),(0,W.jsxs)(`span`,{className:`btn-group`,children:[e?.DefaultThemeForThino===`modern`&&!o&&(0,W.jsx)(wT,{}),(0,W.jsx)(`span`,{ref:e=>{e&&e.hasChildNodes()||e&&(0,f.setIcon)(e,`more-horizontal`)},className:`btn action-btn menu-popup-btn`,onClick:S}),a&&(0,W.jsx)(`span`,{ref:e=>{e&&e.hasChildNodes()||e&&(0,f.setIcon)(e,`x`)},className:`btn action-btn close-sidebar-btn`,onClick:()=>{R.setShowSiderbarInMobileView(!1)}})]})]}),(0,W.jsx)(h_,{statusType:`banner`})]}):(0,W.jsx)(ET,{})};vi();var OT=(0,U.memo)(({query:e,className:t})=>{let{memos:n}=F(),{plugin:r}=I(),[i,a]=(0,U.useState)(null),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(!1),u=(0,U.useRef)(null);return(0,U.useEffect)(()=>{e&&r&&(s(!0),r.thinoWorkerManager.filterMemos(n,{tag:``,duration:null,type:``,text:``,path:``,metadata:{},filter:e.id},{},!0).then(e=>{a(e.length),l(!0)}).catch(e=>{console.error(`Error calculating query count:`,e),a(0)}).finally(()=>{s(!1)}))},[e?.id,e?.updatedAt,e?.querystring,r,n]),(0,W.jsx)(`div`,{className:u_(`query-count`,o?`loading`:`loaded`,t),ref:u,children:c&&i!==null&&(0,W.jsx)(`span`,{className:`count-text`,children:i.toString()||``})})},(e,t)=>e.query.id===t.query.id&&e.query.updatedAt===t.query.updatedAt&&e.query.querystring===t.query.querystring);vi(),Qr(),H(),N();var kT=({useVirtual:e=!1,height:t=400})=>{let{queries:n}=$r(),{app:r}=I(),{settings:i}=si(),{query:{filter:a}}=di(),o=Rb(),[s,c]=(0,U.useState)([]),[l,u]=(0,U.useState)(r?.loadLocalStorage(`thino-query-sort-order`)||`byTime`);return(0,U.useEffect)(()=>{c(n.filter(e=>!e.id?.toString().startsWith(`Filter [Temp]`)&&!e.id?.toString().includes(`Filter [Temp]`)).sort((e,t)=>{if(t.pinnedAt&&!e.pinnedAt)return 1;if(e.pinnedAt&&!t.pinnedAt)return-1;switch(l){case`alphabetical`:return e.title.localeCompare(t.title);case`alphabeticalReverse`:return t.title.localeCompare(e.title);case`byTime`:return P.getTimeStampByDate(t.createdAt)-P.getTimeStampByDate(e.createdAt);case`byTimeReverse`:return P.getTimeStampByDate(e.createdAt)-P.getTimeStampByDate(t.createdAt);default:return 0}}))},[n,l]),(0,U.useEffect)(()=>{Bg.getMyAllQueries().catch(()=>{}).finally(()=>{o.setFinish()})},[r]),(0,W.jsxs)(`div`,{className:`queries-wrapper`,children:[(0,W.jsxs)(`div`,{className:`title-text`,children:[(0,W.jsx)(`span`,{className:`normal-text`,children:M(`QUERY`)}),(0,W.jsxs)(`div`,{className:`sort-btn-container`,children:[(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`arrow-down-narrow-wide`)},className:`sort-btn`,onClick:e=>{e.stopPropagation();let t=new f.Menu;for(let e of[`alphabetical`,`alphabeticalReverse`,`byTime`,`byTimeReverse`])t.addItem(t=>{t.setTitle(M(e)).onClick(()=>{u(e),r?.saveLocalStorage(`thino-query-sort-order`,e)}).setChecked(l===e)}),e===`alphabeticalReverse`&&t.addSeparator();t.showAtMouseEvent(e.nativeEvent)}}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`plus`)},className:`btn create-query-btn`,onClick:()=>yT()})]})]}),(0,W.jsx)(xv,{when:o.isSucceed&&s.length===0,children:(0,W.jsx)(`div`,{className:`create-query-btn-container`,children:(0,W.jsx)(`span`,{className:`btn`,onClick:()=>yT(),children:M(`CREATE FILTER`)})})}),(0,W.jsx)(`div`,{className:`queries-container`,children:s.map(e=>(0,W.jsx)(AT,{query:e,isActive:e.id===a},`${e.id}-${(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`x`)}`))})]})},AT=e=>{let{query:t,isActive:n}=e;return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`query-item-container ${n?`active`:``}`,onClick:()=>{console.log(`ThinoDebug QueryList click`,{from:`QueryList`,queryId:t.id,isActive:n}),z.setMemoFilter(n?``:t.id)},children:[(0,W.jsxs)(`div`,{className:`query-text-container`,children:[(0,W.jsx)(`span`,{ref:e=>{e&&!e.hasChildNodes()&&(0,f.setIcon)(e,`filter`)},className:`icon-text`}),(0,W.jsxs)(`span`,{className:`query-text`,children:[t.title,t.pinnedAt&&` 📌`]})]}),(0,W.jsxs)(`div`,{className:`btns-container`,children:[(0,W.jsx)(OT,{query:t}),(0,W.jsx)(`span`,{ref:e=>{e&&!e.hasChildNodes()&&(0,f.setIcon)(e,`more-horizontal`)},className:`btn action-btn toggle-btn`,onClick:e=>{e.stopPropagation();let n=new f.Menu;n.addItem(e=>{e.setTitle(t.pinnedAt?M(`UNPIN`):M(`PIN`)).setIcon(t.pinnedAt?`pin-off`:`pin`).onClick(async()=>{try{t.pinnedAt?await Bg.unpinQuery(t.id):await Bg.pinQuery(t.id),Bg.editQuery({...t,pinnedAt:t.pinnedAt?``:P.getDateTimeString(Date.now())})}catch(e){console.error(e)}})}),n.addItem(e=>{e.setTitle(M(`EDIT`)).setIcon(`edit`).onClick(()=>{yT(t.id)})}),n.addItem(e=>{e.setTitle(M(`DUPLICATE`)).setIcon(`copy`).onClick(async()=>{try{let e=Bg.getQueryById(t.id);if(e){let t=`${e.title} ${M(`DUPLICATE`)}`,n=await Bg.createQuery(t,e.querystring);Bg.pushQuery(n),await Bg.getMyAllQueries(),new f.Notice(`Query "${t}" created successfully`)}}catch(e){console.error(e),new f.Notice(`Failed to duplicate query: ${e.message}`)}})}),n.addItem(n=>{n.setTitle(M(`DELETE`)).setIcon(`trash-2`).setWarning(!0).onClick(()=>{let n=new f.Menu;n.addItem(e=>{e.setTitle(M(`CONFIRM!`)).setIcon(`trash-2`).setWarning(!0).onClick(async()=>{try{await Bg.deleteQuery(t.id)}catch(e){new f.Notice(e.message)}})}),n.addItem(e=>{e.setTitle(M(`Cancel`)).setIcon(`x`).onClick(()=>{})}),n.showAtMouseEvent(e.nativeEvent)})}),n.showAtMouseEvent(e.nativeEvent)}})]})]})})};vi(),H(),Qr(),N(),Mv(),Cv();function jT(e){return(e||window.app)?.loadLocalStorage(`thino-tag-custom`)||{}}function MT(e,t){(e||window.app)?.saveLocalStorage(`thino-tag-custom`,t)}function NT(e){return(e||window.app)?.loadLocalStorage(`thino-pinned-tags`)||[]}function PT(e,t){(e||window.app)?.saveLocalStorage(`thino-pinned-tags`,t)}var FT=[`📌`,`🔥`,`💡`,`⭐`,`❤️`,`🎯`,`📝`,`🚀`,`✅`,`🏷️`,`📚`,`💼`,`🎨`,`🔖`,`⚡`,`🌟`],IT=[`#e53935`,`#d81b60`,`#8e24aa`,`#5e35b1`,`#3949ab`,`#1e88e5`,`#039be5`,`#00acc1`,`#00897b`,`#43a047`,`#7cb342`,`#c0ca33`,`#fdd835`,`#ffb300`,`#fb8c00`,`#f4511e`],LT=({useVirtual:e=!1,height:t=400})=>{let n=di(e=>e.query.tag),r=di(e=>e.query.filter),i=I(e=>e.app),a=F(e=>e.tags),o=F(e=>e.tagsNum),s=F(e=>e.memosHash),[c,l]=(0,U.useState)(!0),u=(0,U.useMemo)(()=>r&&r?.toString()?.startsWith(`Filter [Temp] `)&&Bg.getQueryById(r),[r]),[d,p]=(0,U.useState)([]),[m,h]=(0,U.useState)(()=>jT(i)),[g,_]=(0,U.useState)(()=>NT(i)),[v,y]=(0,U.useState)((i||window.app)?.loadLocalStorage(`thino-tag-sort-order`)||`alphabetical`);(0,U.useEffect)(()=>{l(!0);let e=(i||window.app)?.loadLocalStorage(`thino-temp-tags`);e?.tags?.length>0&&p(b(e.tags||[],e.tagsNum||{}).subTags),l(!1)},[]),(0,U.useEffect)(()=>{V.initialized&&s&&V.updateTagsState()},[s]),(0,U.useEffect)(()=>{if(!a?.length)return;let e=requestAnimationFrame(()=>{p(b(a,o).subTags),l(!1),(i||window.app)?.saveLocalStorage(`thino-temp-tags`,{tags:a,tagsNum:o})});return()=>cancelAnimationFrame(e)},[a,o]);let b=(0,U.useCallback)((e,t)=>{let n=Array.from(e).sort();if(n.length===0)return{key:``,text:``,count:0,subTags:[]};let r={key:``,text:``,count:0,subTags:[]},i=new Map;for(let e of n){let n=e.split(`/`),a=r,o=``;for(let e=0;e<n.length;e++){let r=n[e];o+=e===0?r:`/`+r;let s=i.get(o);if(s||=a.subTags.find(e=>e.text===o),s||(s={key:r,text:o,count:t[o]||0,subTags:[],parent:a},a.subTags.push(s),i.set(o,s)),e===n.length-1){let e=s.parent;for(;e;)e.count||=0,e.count+=t[o]||0,e=e.parent}a=s}}return r},[]),x=e=>{e.stopPropagation();let t=new f.Menu;for(let e of[`alphabetical`,`alphabeticalReverse`,`byCount`,`byCountReverse`])t.addItem(t=>{t.setTitle(M(e)).onClick(()=>{y(e),i?.saveLocalStorage(`thino-tag-sort-order`,e)}).setChecked(v===e)}),e===`alphabeticalReverse`&&t.addSeparator();t.showAtMouseEvent(e.nativeEvent)},S=(0,U.useMemo)(()=>{let e=[...d].sort(VT(v));if(g.length===0)return e;let t=new Set(g),n=e.filter(e=>t.has(e.text)),r=e.filter(e=>!t.has(e.text));return[...n,...r]},[d,v,g]);return(0,W.jsxs)(`div`,{className:`tags-wrapper`,children:[(0,W.jsxs)(`div`,{className:`tags-header title-text`,children:[(0,W.jsx)(`span`,{className:`normal-text`,children:M(`Frequently Used Tags`)}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`arrow-down-narrow-wide`)},className:`tags-sort-btn`,onClick:x})]}),(0,W.jsx)(`div`,{className:`tags-container`,children:c?(0,W.jsx)(`div`,{className:`tag-loading`,children:`Loading...`}):(0,W.jsxs)(W.Fragment,{children:[S.map((e,t)=>(0,W.jsx)(RT,{tag:e,tagQuery:n,filterQuery:u,tagCustom:m,setTagCustom:h,pinnedTags:g,setPinnedTags:_},e.text+`-`+t)),(0,W.jsx)(xv,{when:d.length<5&&V.initialized,children:(0,W.jsxs)(`span`,{className:`tag-tip-container`,children:[M(`Input`),` `,(0,W.jsxs)(`span`,{className:`code-text`,children:[M(`#Tag`),` `]}),M(`to create tag`),`...`]})})]})})]})},RT=U.memo(e=>{let{tag:t,tagQuery:n,filterQuery:r,tagCustom:i,setTagCustom:a,pinnedTags:o,setPinnedTags:s}=e,c=I(e=>e.app),l=(0,U.useMemo)(()=>n===t.text||r&&JSON.parse(r.querystring).find(e=>e.type===`TAG`&&e.value.value===t.text),[t.text,n,r]),u=t.subTags.length>0,[d,p]=zb(!1),m=async e=>{if(e.ctrlKey||e.metaKey){let{verifyState:e}=L.getState(),r=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),i=f.Platform.isDesktop?await Dv():r.identifier||r.uuid;if(!(e&&e?.appId===i)){Sv();return}let a=z.getState().query.filter;if(a&&a?.startsWith(`Filter [Temp] `)){let e=Bg.getQueryById(a).querystring,n=JSON.parse(e),r;if(n.some(e=>e.type===`TAG`&&e.value.value===t.text)){if(r=n.filter(e=>e.value.value!==t.text),r.length===0){z.setMemoFilter(``);return}let e=Bg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{...r[0],relation:`AND`},...r.slice(1)]));Bg.pushQuery(e),z.setMemoFilter(e.id)}else{r=[...n,{type:`TAG`,value:{value:t.text,operator:`CONTAIN`},relation:`OR`}];let e=Bg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(r));Bg.pushQuery(e),z.setMemoFilter(e.id)}}else if(n){z.setTagQuery(``);let e=Bg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{type:`TAG`,value:{value:n,operator:`CONTAIN`},relation:`AND`},{type:`TAG`,value:{value:t.text,operator:`CONTAIN`},relation:`OR`}]));Bg.pushQuery(e),z.setMemoFilter(e.id)}else if(!n){let e=Bg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{type:`TAG`,value:{value:t.text,operator:`CONTAIN`},relation:`AND`}]));Bg.pushQuery(e),z.setMemoFilter(e.id)}P.copyTextToClipboard(`#${t.text} `),[`/`,`/recycle`,`/archive`,`/daily`].includes(z.getState().pathname)||z.setPathname(`/`);return}if(l){if(z.setTagQuery(``),r){let e=JSON.parse(r.querystring).filter(e=>e.value.value!==t.text);if(e.length===0){z.setMemoFilter(``);return}let n=Bg.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{...e[0],relation:`AND`},...e.slice(1)]));Bg.pushQuery(n),z.setMemoFilter(n.id)}}else await P.copyTextToClipboard(`#${t.text} `),[`/`,`/recycle`,`/archive`,`/daily`].includes(z.getState().pathname)||z.setPathname(`/`),z.setTagQuery(t.text)},h=e=>{e.stopPropagation(),p()},g=i[t.text];return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`tag-item-container ${l?`active`:``}`,onClick:m,onContextMenu:e=>{e.preventDefault(),e.stopPropagation();let n=new f.Menu,r=o.includes(t.text);n.addItem(e=>{e.setIcon(r?`pin-off`:`pin`).setTitle(M(r?`Unpin tag`:`Pin tag`)).onClick(()=>{let e;e=r?o.filter(e=>e!==t.text):[...o,t.text],PT(c,e),s(e)})}),n.addSeparator(),n.addItem(e=>{e.setIcon(`pencil`).setTitle(M(`Rename tag`)).onClick(()=>{let e=new f.Modal(c);e.titleEl.setText(M(`Rename tag`)),e.containerEl.toggleClass(`thino-rename-tag-dialog`,!0),e.contentEl.createEl(`p`,{text:`${M(`Rename all`)} #${t.text} ${M(`to`)}:`,cls:`rename-tag-desc`});let n=t.text;new f.Setting(e.contentEl).setName(M(`New tag name`)).addText(e=>{e.setValue(t.text).onChange(e=>n=e)});let r=e.contentEl.createDiv({cls:`modal-button-container`});r.createEl(`button`,{text:M(`Cancel`)}).addEventListener(`click`,()=>e.close());let o=r.createEl(`button`,{text:M(`Confirm`),cls:`mod-warning`});o.addEventListener(`click`,async()=>{if(!n||n===t.text){e.close();return}o.disabled=!0,o.setText(M(`Processing...`));let{memos:r}=F.getState(),s=t.text,l=s.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),u=RegExp(`(^|\\s|<p>|<br>)#${l}(?=[\\s,;.!?\\)\\]|}]|$)`,`g`),d=0;for(let e of r){if(e.rowStatus===`ARCHIVED`||e.deletedAt)continue;if(!u.test(e.content)){u.lastIndex=0;continue}u.lastIndex=0;let t=e.content.replace(u,`$1#${n}`);t!==e.content&&(await V.updateMemo(e.id,t,e.thinoType),d++)}if(i[s]){let e={...i};e[n]=e[s],delete e[s],MT(c,e),a(e)}V.updateTagsState(),new f.Notice(`${M(`Renamed`)} ${d} thino(s)`),e.close()}),e.open()})}),n.addSeparator(),n.addItem(e=>{e.setIcon(`smile`).setTitle(M(`Set emoji`)).onClick(()=>{let e=new f.Modal(c);e.titleEl.setText(M(`Set emoji for tag`)),e.containerEl.toggleClass(`thino-tag-emoji-dialog`,!0);let n=e.contentEl.createDiv({cls:`emoji-grid`});for(let r of FT)n.createEl(`button`,{text:r,cls:[`emoji-btn`,`clickable-icon`]}).addEventListener(`click`,()=>{let n={...i,[t.text]:{...i[t.text],emoji:r}};MT(c,n),a(n),e.close()});new f.Setting(e.contentEl).setName(M(`Custom emoji`)).addText(n=>{n.setPlaceholder(`🏷️`).onChange(()=>{});let r=n.inputEl;r.addEventListener(`keydown`,n=>{if(n.key===`Enter`){let n=r.value.trim();if(n){let r={...i,[t.text]:{...i[t.text],emoji:n}};MT(c,r),a(r),e.close()}}})}),e.contentEl.createDiv({cls:`modal-button-container`}).createEl(`button`,{text:M(`Clear`)}).addEventListener(`click`,()=>{let n={...i};n[t.text]&&(delete n[t.text].emoji,n[t.text].color||delete n[t.text]),MT(c,n),a(n),e.close()}),e.open()})}),n.addItem(e=>{e.setIcon(`palette`).setTitle(M(`Set color`)).onClick(()=>{let e=new f.Modal(c);e.titleEl.setText(M(`Set color for tag`)),e.containerEl.toggleClass(`thino-tag-color-dialog`,!0);let n=e.contentEl.createDiv({cls:`color-grid`});for(let r of IT){let o=n.createEl(`button`,{cls:[`color-btn`,`clickable-icon`]});o.style.backgroundColor=r,o.addEventListener(`click`,()=>{let n={...i,[t.text]:{...i[t.text],color:r}};MT(c,n),a(n),e.close()})}e.contentEl.createDiv({cls:`modal-button-container`}).createEl(`button`,{text:M(`Clear`)}).addEventListener(`click`,()=>{let n={...i};n[t.text]&&(delete n[t.text].color,n[t.text].emoji||delete n[t.text]),MT(c,n),a(n),e.close()}),e.open()})}),n.showAtMouseEvent(e.nativeEvent)},children:[(0,W.jsxs)(`div`,{className:`tag-text-container`,children:[g?.emoji?(0,W.jsx)(`span`,{className:`btn tag-btn tag-emoji`,children:g.emoji}):(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`hash`)},className:`btn tag-btn`,style:g?.color?{color:g.color}:void 0}),(0,W.jsx)(`span`,{className:`tag-text`,style:g?.color?{color:g.color}:void 0,children:t.key})]}),(0,W.jsxs)(`div`,{className:`btns-container`,children:[(0,W.jsx)(`span`,{className:`tag-count count-text`,children:t.count}),u?(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-right`)},className:`btn action-btn toggle-btn ${d?`shown`:``}`,onClick:h}):null]})]}),u&&d&&(0,W.jsx)(`div`,{className:`subtags-container`,children:t.subTags.map((e,t)=>(0,W.jsx)(RT,{tag:e,tagQuery:n,filterQuery:r,tagCustom:i,setTagCustom:a,pinnedTags:o,setPinnedTags:s},e.text+`-`+t))})]})}),zT=new Intl.Collator(void 0,{usage:`sort`,sensitivity:`base`,numeric:!0}).compare,BT={alphabetical:(e,t)=>zT(e.text,t.text),alphabeticalReverse:(e,t)=>-zT(e.text,t.text),byCount:(e,t)=>t.count-e.count,byCountReverse:(e,t)=>e.count-t.count},VT=(e=`byCount`)=>BT.hasOwnProperty(e)?BT[e]:BT.alphabetical,G=class extends f.Setting{settingTab;name=``;desc=``;constructor(e,t){super(e),this.settingTab=t}setName(e){return super.setName(e),this.name=e,this}setDesc(e){return super.setDesc(e),this.desc=e,this}setTab(e){let t=typeof this.name==`string`?this.name:this.name.textContent||``,n=typeof this.desc==`string`?this.desc:this.desc.textContent||``;return this.settingTab.addSettingToMasterSettingsList(e,this.settingEl,t,n),this}};vi(),N();var HT=class extends f.Modal{plugin;settingTab;target=5;cb;constructor(e,t,n,r,i){super(e),this.app=e,this.settingTab=t,this.plugin=n,this.target=r,this.cb=i}onOpen(){let{contentEl:e}=this;e.parentElement?.classList.add(`memo-save-location-modal`),e.createEl(`h3`,{text:M(`Thino Daily Target`)}),new G(e.createDiv(`modal-setting`),this.settingTab).setName(M(`Target Thino Count`)).addSlider(e=>{e.setDynamicTooltip().setValue(this.target).setLimits(1,30,1).onChange(async e=>{this.target=e})});let t=e.createDiv(`button-group`),n=t.createEl(`button`,{text:M(`Cancel`)}),r=t.createEl(`button`,{text:M(`Save`)});r.onclick=async()=>{this.plugin.settings.MemoDailyTarget=this.target,this.settingTab.applySettingsUpdate(),this.cb(this.target),this.close()},n.onclick=async()=>{this.close()}}onClose(){let{contentEl:e}=this;e.empty()}},UT=({allStat:e,todayTimeStamp:t,calendarType:n,handleCalendarTypeChange:r})=>{let{app:i,settings:a}=I(),{manifest:o}=si(),[s,c]=(0,U.useState)(),[l,u]=(0,U.useState)(5),[d,p]=(0,U.useState)(0),[m,h]=(0,U.useState)(0),[g,_]=(0,U.useState)(a.HeatmapColorScheme||`default`),v=(0,U.useRef)(null),y=(0,U.useRef)(null);(0,U.useEffect)(()=>{a.HeatmapColorScheme&&_(a.HeatmapColorScheme)},[a.HeatmapColorScheme]),(0,U.useEffect)(()=>{let e,t=5;o&&i&&(e=i?.plugins.getPlugin(o.id),t=e?.settings.MemoDailyTarget,c(e)),u(t)},[o,i]),(0,U.useEffect)(()=>{let n=e.find(e=>e.timestamp===t),r=n?n.count:0;h(r),p(Math.min(100,r/l*100))},[e,l]),(0,U.useEffect)(()=>{(0,f.requireApiVersion)(`1.4.4`)&&((0,f.setTooltip)(y.current,d.toFixed(2)+`%`),(0,f.setTooltip)(v.current,M(`Set daily target`)+` (${m}/${l})`))},[d,m]),(0,U.useEffect)(()=>{v.current&&(v.current.hasChildNodes()||(0,f.setIcon)(v.current,`crosshair`),(0,f.requireApiVersion)(`1.4.4`)&&(0,f.setTooltip)(y.current,d+`%`))},[v,l]);let b=(0,U.useCallback)(()=>{s&&new HT(i,s?.settingTab,s,l,e=>{u(e)}).open()},[s,l]);return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`usage-daily-progress-wrapper heatmap-${g}`,children:[(0,W.jsx)(`div`,{ref:y,className:`daily-progress-bar`,children:(0,W.jsx)(`div`,{className:`daily-progress-bar-inner`,style:{width:`${d}%`}})}),(0,W.jsx)(`div`,{ref:v,className:`daily-progress-target`,onClick:b}),(0,W.jsx)(`div`,{ref:e=>{e&&(0,f.setIcon)(e,n===`basic`?`layout-grid`:`calendar`),e&&f.setTooltip&&(0,f.setTooltip)(e,M(`Switch calendar type`))},className:`switch-calendar-type-btn`,onClick:()=>r&&r(n===`basic`?`heatmap`:`basic`)})]})})};Wr(),N(),Kh();var WT=(e,t)=>{let n=[],r=Math.floor((e-t)/Ar);for(let e=0;e<=r;e++)n.push({timestamp:t+Ar*e,count:0,list:0});return n},GT=e=>{let{className:t,view:n,datestamp:r,handleDateStampChange:i,handleDateItemClick:a,handleMonthChange:o,dailyStat:s}=e,c=Hs(new Date).getTime(),[l,u]=(0,U.useState)(JT(r)),[d,p]=(0,U.useState)(null),[m,h]=(0,U.useState)(e.dailyStat);(0,U.useEffect)(()=>{u(JT(r));let t=WT(YT(r),JT(r)),n=e.thinos.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`),i=Hs(new Date(l)).getTime();for(let e of n){let n=e.createdAtTs??new Date(e.createdAt.replace(/\//g,`-`)).getTime(),r=Hs(new Date(n)).getTime(),a=Math.round((r-i)/Ar);a>=0&&a<t.length&&(t[a].count+=1,e.thinoType===`JOURNAL`&&(t[a].list+=1))}h(t)},[r,e.thinos]);let g=new Date(l),_=g.getDay(),v=[];for(let e=0;e<_;e++)v.push({date:0,datestamp:g.getTime()-Ar*(7-e)});let y=qT(l);for(let e=1;e<=y;e++)v.push({date:e,datestamp:g.getTime()+Ar*(e-1)});let b=e=>{let t=g.getFullYear(),n=g.getMonth()+1,r=0;r=n===1&&e===-1?new Date(`${t-1}/12/1`).getTime():n===12&&e===1?new Date(`${t+1}/1/1`).getTime():new Date(`${t}/${n+e}/1`).getTime(),u(JT(r)),o&&o(r)};return(0,W.jsxs)(`div`,{className:`heatmap-date-picker-wrapper ${t}`,children:[(0,W.jsxs)(`div`,{className:`date-picker-header`,children:[(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-left`)},className:`btn btn-text`,onClick:()=>b(-1)}),(0,W.jsxs)(`span`,{className:`normal-text`,children:[(0,W.jsx)(Hb,{year:g.getFullYear().toString(),handleYearChange:e=>{u(JT(new Date(`${e}/${g.getMonth()+1}/1`).getTime()))}}),(0,W.jsx)(Ub,{month:g.getMonth().toString(),handleMonthChange:e=>{u(JT(new Date(`${g.getFullYear()}/${parseInt(e)}/1`).getTime()))}})]}),(0,W.jsx)(`span`,{ref:e=>{e&&(0,f.setIcon)(e,`chevron-right`)},className:`btn btn-text`,onClick:()=>b(1)})]}),(0,W.jsxs)(`div`,{className:`date-picker-day-container`,children:[(0,W.jsx)(`div`,{className:`date-picker-day-header`,children:M(`weekDaysShort`).map(e=>(0,W.jsx)(`span`,{className:`day-item`,children:e},e))}),(0,W.jsx)(`div`,{className:`date-picker-day-content`,children:v.map(e=>{if(e.date===0)return(0,W.jsx)(`span`,{className:`day-item null`,children:``},e.datestamp);let t=m.find(t=>t.timestamp===e.datestamp)||{count:0,timestamp:e.datestamp,list:0},o=t.count-t.list,s=t.list;return(0,W.jsxs)(`span`,{className:`day-item ${e.datestamp===c?`current`:``} ${e.datestamp===d?`selected`:``} ${XT(t.count)}`,onClick:n=>{i(r,n.nativeEvent),p(e.datestamp===d?null:e.datestamp),a&&a(n,t)},onMouseOver:r=>{!t||!t.count||KT(new f.HoverPopover(n,r.currentTarget,100),{d:e,list:s,task:o})},children:[(0,W.jsx)(`span`,{className:`day-item-text`,children:e.date}),(0,W.jsx)(W.Fragment,{children:t&&t.count!==0&&(0,W.jsxs)(`span`,{className:`day-item-dots`,children:[o>0&&(0,W.jsx)(`div`,{className:`day-item-dot thino-task-dot ${XT(o)}`}),s>0&&(0,W.jsx)(`div`,{className:`day-item-dot thino-list-dot ${XT(s)}`})]})})]},e.datestamp)})})]})]})};function KT(e,{d:t,list:n,task:r}){e.hoverEl.toggleClass(`thino-hover-popover`,!0);let i=e.hoverEl.createDiv({cls:`thino-hover-popover-content`});i.createDiv({cls:`thino-date-item`,text:`${qu(new Date(t.datestamp),`yyyy-MM-dd`)}`});let a=i.createDiv({cls:`thino-task-item`});a.createSpan({cls:`thino-task-item-title-text`,text:`${M(`Task`)}: `}),a.createSpan({cls:`thino-task-item-title-count`,text:`${r}`});let o=i.createDiv({cls:`thino-list-item`});o.createSpan({cls:`thino-list-item-title-text`,text:`${M(`List`)}: `}),o.createSpan({cls:`thino-list-item-title-count`,text:`${n}`})}function qT(e){let 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())/Ar}function JT(e){let t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}function YT(e){let 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()-Ar}function XT(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`}vi(),H(),Wr(),Kh(),N(),Ce();var ZT={width:12,height:7},QT=(e,t)=>{let n=[];for(let r=0;r<=e;r++)n.push({timestamp:t+Ar*r,count:0,list:0});return n},$T=({initThinos:e,basicType:t})=>{let n=Fc(new Date).getTime();new Date(n).getDay();let r=Hs(new Date).getTime(),i=Array(6-new Date(n).getDay()).fill(0),a=ZT.width*ZT.height,o=wm(Hs(new Date),a),s=o.getTime(),{memos:c}=F(),{view:l,app:u,settings:d}=I(),[p,m]=(0,rw.default)(t||tE(u||window.app)||`heatmap`),[h,g]=(0,rw.default)(Hs(new Date).getTime()),[_,v]=(0,rw.default)(d.HeatmapColorScheme||`default`),[y,b]=(0,rw.default)(QT(a,s)),[x,S]=(0,rw.default)(null),[C,w,T]=(0,rw.default)(``),E=(0,U.useRef)(null);(0,U.useEffect)(()=>{let t=QT(a,s),n=(e||c).filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`);for(let e of n){let n=e.createdAtTs??new Date(e.createdAt.replace(/\//g,`-`)).getTime(),r=Hs(new Date(n)).getTime(),i=Dc(new Date(r),o);i>=0&&i<t.length&&(t[i].count+=1,e.thinoType===`JOURNAL`&&(t[i].list+=1))}b([...t])},[c,e]),(0,U.useEffect)(()=>{d.HeatmapColorScheme&&v(d.HeatmapColorScheme)},[d.HeatmapColorScheme]);let D=(0,U.useCallback)((e,t)=>{if(!t||!t.count)return;let n=t.count-t.list,r=t.list,i={date:t.timestamp,datestamp:t.timestamp};KT(new f.HoverPopover(l,e.currentTarget,100),{d:i,list:r,task:n})},[]),O=()=>{m(p===`heatmap`?`basic`:`heatmap`),eE(u,p===`heatmap`?`basic`:`heatmap`),g(Hs(new Date).getTime())},k=(0,U.useCallback)(async(e,t)=>{if(t.count===0){ee(t);return}let n=z.getState().query.duration,r=n?.from,i=n?.to,a=Dc(new Date(r),new Date(i))===0;if(r===t.timestamp&&a){z.setFromAndToQuery(0,0),S(null),w(null);return}if(e.shiftKey){A(t,r,i,a);return}if(e.ctrlKey||e.metaKey){await j(t.timestamp);return}ee(t)},[]),A=(e,t,n,r)=>{let i=e.timestamp;if(t===0){z.setFromAndToQuery(i,Fc(new Date).getTime()),w(`from`);return}let a=Dc(Fc(new Date(i)),new Date(n));t<i?T.current===`to`?a<0?z.setFromAndToQuery(i,n):(z.setFromAndToQuery(Hs(new Date(n)).getTime(),Fc(new Date(i)).getTime()),w(`from`)):T.current===`from`&&z.setFromAndToQuery(t,Fc(new Date(i)).getTime()):T.current===`to`?z.setFromAndToQuery(i,n):T.current===`from`&&(z.setFromAndToQuery(i,Fc(new Date(t)).getTime()),w(`to`))},j=async e=>{let{app:t,dailyNotes:n}=L.getState(),r=ue((0,f.moment)(e),n);if(r)if(!f.Platform.isMobile)await t.workspace.getLeaf(!0).openFile(r);else{let e=t.workspace.activeLeaf;e===null&&(e=t.workspace.getLeaf(!0)),e.openFile(r)}},ee=e=>{[`/`,`/recycle`].includes(z.getState().pathname)||z.setPathname(`/`),z.setFromAndToQuery(e.timestamp,Fc(new Date(e.timestamp)).getTime()),S(e)},te=(0,U.useMemo)(()=>(0,W.jsx)(GT,{className:`heatmap-${_}`,view:l,datestamp:h,dailyStat:y,thinos:e||c,handleMonthChange:e=>{g(e)},handleDateStampChange:e=>{console.log(e)},handleDateItemClick:(e,t)=>k(e,t)}),[JSON.stringify(y),e,c,l,h,_]);return(0,W.jsxs)(W.Fragment,{children:[p===`basic`&&te,p===`heatmap`&&(0,W.jsxs)(`div`,{className:`usage-heat-map-wrapper heatmap-${_}`,ref:E,children:[(0,W.jsxs)(`div`,{className:`day-tip-text-container`,children:[(0,W.jsx)(`span`,{className:`tip-text`,children:M(`weekDaysShort`)[0]}),(0,W.jsx)(`span`,{className:`tip-text`}),(0,W.jsx)(`span`,{className:`tip-text`,children:M(`weekDaysShort`)[2]}),(0,W.jsx)(`span`,{className:`tip-text`}),(0,W.jsx)(`span`,{className:`tip-text`,children:M(`weekDaysShort`)[4]}),(0,W.jsx)(`span`,{className:`tip-text`}),(0,W.jsx)(`span`,{className:`tip-text`,children:M(`weekDaysShort`)[6]})]}),(0,W.jsxs)(`div`,{className:`usage-heat-map`,children:[y.slice(y.length-84+i.length,y.length).map((e,t)=>{let n=e.count,i=n<=0?``:n<=1?`stat-day-L1-bg`:n<=2?`stat-day-L2-bg`:n<=4?`stat-day-L3-bg`:`stat-day-L4-bg`;return(0,W.jsx)(`span`,{"data-timestamp":e.timestamp,"data-count":e.count,"data-list-count":e.list,"data-task-count":e.count-e.list,className:`stat-container ${i} ${x===e?`current`:``} ${r===e.timestamp?`today`:``}`,onMouseOver:t=>D(t,e),onClick:t=>k(t,e)},t)}),i.map((e,t)=>(0,W.jsx)(`span`,{className:`stat-container null`},t))]})]}),!t&&(0,W.jsx)(UT,{allStat:y,todayTimeStamp:r,calendarType:p,handleCalendarTypeChange:O})]})};function eE(e,t){try{e?.saveLocalStorage(`calendarType`,t)}catch(e){console.error(e)}}function tE(e){try{return e?.loadLocalStorage(`calendarType`)||`heatmap`}catch(e){return console.error(e),`heatmap`}}H(),N(),vi(),Cv(),Mv();function nE(e){return(e||window.app)?.loadLocalStorage(`thino-hidden-entries`)||[]}function rE(e,t){(e||window.app)?.saveLocalStorage(`thino-hidden-entries`,t)}var iE=()=>{let{app:e,settings:t,verifyState:n}=I(),[r,i]=(0,U.useState)(()=>nE(e)),[a,o]=(0,U.useState)(!1),s=[{name:M(`Random Review`),path:`/review`,iconID:`star`},{name:M(`Daily Review`),path:`/daily-review`,iconID:`gallery-thumbnails`},{name:M(`Gallery`),path:`/gallery`,iconID:`image`},{name:M(`Stat`),path:`/stat`,iconID:`chart-bar`},{name:M(`ARCHIVE`),path:`/archive`,iconID:`archive`},{name:M(`Recycle bin`),path:`/recycle`,iconID:`recycle`}],c=(0,U.useMemo)(()=>new Set(r),[r]),l=(0,U.useMemo)(()=>s.filter(e=>!c.has(e.path)),[c,t]),u=(0,U.useMemo)(()=>s.filter(e=>c.has(e.path)),[c,t]),d=(0,U.useRef)([]),p=(0,U.useRef)(null);(0,U.useEffect)(()=>{d.current.forEach((e,t)=>{if(e){let n=[...l,...a?u:[]];n[t]&&(0,f.setIcon)(e,n[t].iconID)}})},[t,l,u,a]),(0,U.useEffect)(()=>{p.current&&(0,f.setIcon)(p.current,a?`chevron-up`:`more-horizontal`)},[a,p.current]);let m=(0,U.useCallback)(async t=>{let r=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),i=f.Platform.isDesktop?await Dv():r.identifier||r.uuid;if(!n&&n?.appId!==i&&(t.path===`/review`||t.path===`/daily-review`||t.path===`/stat`)){Sv();return}if(z.setPathname(t.path),t.path===`/review`&&z.getState().pathname===`/review`){e.workspace.trigger(`refresh-review-memos`);return}z.clearQuery()},[e,n]),h=(0,U.useCallback)((t,n,a)=>{t.preventDefault(),t.stopPropagation();let o=new f.Menu;a?o.addItem(t=>{t.setIcon(`eye`).setTitle(M(`Show entry`)).onClick(()=>{let t=r.filter(e=>e!==n.path);rE(e,t),i(t)})}):o.addItem(t=>{t.setIcon(`eye-off`).setTitle(M(`Hide entry`)).onClick(()=>{let t=[...r,n.path];rE(e,t),i(t)})}),o.showAtMouseEvent(t.nativeEvent)},[e,r]),g=(e,n,r)=>(0,W.jsxs)(`div`,{className:`path-entry-container ${z.getState().pathname===e.path?`active`:``} ${t.DeleteThinoDirectly&&e.path===`/recycle`?`thino-hidden`:``} ${e.path===`/review`||e.path===`/daily-review`||e.path===`/stat`?`pro`:``}`,onClick:()=>m(e),onContextMenu:t=>h(t,e,r),children:[(0,W.jsx)(`span`,{ref:e=>d.current[n]=e,className:`path-entry-icon`}),(0,W.jsx)(`span`,{className:`path-entry-text`,children:e.name})]},e.path);return(0,W.jsxs)(`div`,{className:`path-entry-wrapper`,children:[l.map((e,t)=>g(e,t,!1)),u.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`path-entry-container path-entry-more`,onClick:()=>o(!a),children:[(0,W.jsx)(`span`,{ref:p,className:`path-entry-icon`}),(0,W.jsx)(`span`,{className:`path-entry-text`,children:M(`More`)})]}),a&&u.map((e,t)=>g(e,l.length+t,!0))]})]})};vi(),Wr(),H();var aE=e=>{let{settings:t}=I(),n=di(),{isMobileView:r,showSiderbarInMobileView:i}=si(),a=(0,U.useRef)(null),o=(0,U.useMemo)(()=>e=>{let t=R.getState().showSiderbarInMobileView;if(!t){window.removeEventListener(`click`,o,{capture:!0});return}let n=e.target;!n.closest(`.close-sidebar-btn`)&&n.closest(`.memos-sidebar-wrapper`)||a.current?.contains(e.target)||a.current?.parentNode?.contains(e.target)&&(t&&e.stopPropagation(),R.setShowSiderbarInMobileView(!1),window.removeEventListener(`click`,o,{capture:!0}))},[]);return(0,U.useEffect)(()=>{R.setShowSiderbarInMobileView(!1)},[n]),(0,U.useEffect)(()=>{i?document.body.classList.add(kr):document.body.classList.remove(kr)},[i]),(0,U.useEffect)(()=>{r&&i&&window.addEventListener(`click`,o,{capture:!0})},[r,i]),(0,W.jsxs)(`aside`,{className:u_(`memos-sidebar-wrapper`,e.className),ref:a,children:[e.children,(0,W.jsx)(DT,{}),t?.DefaultThemeForThino===`modern`&&!r?e?.sidebarPosition===`right`?(0,W.jsx)($T,{}):null:(0,W.jsx)($T,{}),t?.DefaultThemeForThino===`modern`&&!r?e?.sidebarPosition===`left`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(iE,{}),(0,W.jsx)(kT,{}),(0,W.jsx)(h_,{statusType:`sidebar`})]}):null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(iE,{}),(0,W.jsx)(kT,{})]}),t?.DefaultThemeForThino===`modern`&&!r?e?.sidebarPosition===`right`?(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(LT,{})}):null:(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(LT,{})})]})},oE=({rows:e=3,className:t=``})=>(0,W.jsx)(`div`,{className:`loading-skeleton-container ${t}`,children:Array.from({length:e}).map((e,t)=>(0,W.jsxs)(`div`,{className:`skeleton-item`,children:[(0,W.jsxs)(`div`,{className:`skeleton-header`,children:[(0,W.jsx)(`div`,{className:`skeleton-avatar`}),(0,W.jsxs)(`div`,{className:`skeleton-meta`,children:[(0,W.jsx)(`div`,{className:`skeleton-line skeleton-line-short`}),(0,W.jsx)(`div`,{className:`skeleton-line skeleton-line-tiny`})]})]}),(0,W.jsxs)(`div`,{className:`skeleton-content`,children:[(0,W.jsx)(`div`,{className:`skeleton-line`}),(0,W.jsx)(`div`,{className:`skeleton-line`}),(0,W.jsx)(`div`,{className:`skeleton-line skeleton-line-medium`})]})]},t))});N(),H(),vi();var sE=()=>{let{settings:e}=I(),[t,n]=U.useState(``);return(0,W.jsx)(`div`,{className:`locked-screen-wrapper`,children:(0,W.jsxs)(`div`,{className:`locked-screen-content`,children:[(0,W.jsx)(`div`,{className:`locked-screen-header`,children:(0,W.jsx)(`div`,{className:`locked-screen-header-title`,children:M(`Locked`)})}),(0,W.jsx)(`div`,{className:`locked-screen-body`,children:(0,W.jsxs)(`div`,{className:`locked-screen-body-content`,children:[(0,W.jsxs)(`div`,{className:`locked-screen-body-content-text`,children:[(0,W.jsx)(`div`,{className:`locked-screen-body-content-text-title`,children:M(`Thino is locked`)}),(0,W.jsx)(`div`,{className:`locked-screen-body-content-text-desc`,children:M(`Please unlock Thino by input password`)})]}),(0,W.jsxs)(`div`,{className:`locked-screen-body-content-inputer`,children:[(0,W.jsx)(`input`,{onKeyDown:n=>{n.key===`Enter`&&(e?.password===t?R.setLocked(!1):new f.Notice(M(`Password is incorrect`)))},onChange:e=>{n(e.target.value)},value:t,type:`password`,className:`locked-screen-body-content-input`}),(0,W.jsx)(`button`,{className:`locked-screen-body-content-btn`,onClick:()=>{e?.password===t?R.setLocked(!1):new f.Notice(M(`Password is incorrect`))},children:M(`Unlock`)})]})]})})]})})},cE=class extends $b{fuzzySearchItemsOptimized(e,t){let n=(0,f.prepareFuzzySearch)(e);return t.map(e=>{let t=n(e.path);return t?{item:e,match:t,score:t.score}:null}).sort((e,t)=>t?.score-e?.score).filter(Boolean)}getSuggestions(e){let t=app.vault.getFiles().filter(e=>[`png`,`jpg`,`jpeg`,`gif`].includes(e.extension)),n=e.toLowerCase();return this.fuzzySearchItemsOptimized(n,t).map(e=>e.item)}renderSuggestion(e,t){let n=e.basename,r=e.parent?.path||``;t.toggleClass(`thino-image-suggest-item`,!0),t.createSpan({cls:`suggestion-name`,text:n}),t.createSpan({cls:`suggestion-path`,text:r})}selectSuggestion(e){this.inputEl.value=e.path,this.inputEl.trigger(`input`),this.close()}};N(),i_(),vi(),Ce(),H();var lE=e=>{let{settings:t,app:n,plugin:r}=I(),{manifest:i}=si(),[a,o]=U.useState(0),[s,c]=U.useState(``),l=U.useRef(null),u=U.useRef(null),[d,p]=U.useState({enabled:!1,path:``,format:``});(0,U.useEffect)(()=>{if(a===2&&t?.EnabledLocationList.find(e=>e.value===`DAILY`))if(!k())p({enabled:!1,path:``,format:``});else{let e=C().folder,t=C().format;p({enabled:!0,path:e,format:t})}},[a]),(0,U.useEffect)(()=>{if(!t?.MomentsIcon||!n){c(``);return}let e=n.vault.adapter.getResourcePath((0,f.normalizePath)(t.MomentsIcon));e&&!t?.MomentsIcon.startsWith(`http`)?c(e):c(t?.MomentsIcon)},[t?.MomentsIcon,n]),(0,U.useEffect)(()=>{u&&(u.current=null)},[a]),(0,U.useEffect)(()=>{l.current&&(u.current||=new cE(l.current))},[l.current]);let m=(e,t)=>{console.log(`key`,e,`value`,t);let i=r;i||=n.plugins.getPlugin(`obsidian-memos`),i.settingTab.updateSettings(e,t)},h=(0,U.useMemo)(()=>{switch(a){case 0:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h1`,{children:M(`Get started with Thino`)}),(0,W.jsx)(`p`,{children:M(`Set up your user info for Thino.`)})]});case 1:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h1`,{children:M(`Set theme for Thino`)}),(0,W.jsx)(`p`,{children:M(`Choose a theme for Thino.`)})]});case 2:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h1`,{children:M(`Go with daily note plugin`)}),(0,W.jsx)(`p`,{children:M(`If you are using the Thino basic version, enabling the daily note plugin is required. Configure its settings to work effectively with it.`)})]});case 3:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h1`,{children:M(`Set preferences for using Thino`)}),(0,W.jsx)(`p`,{children:M(`Adjust settings that influence your user experience with Thino.`)})]});case 4:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h1`,{children:M(`Congrats! All settings done`)}),(0,W.jsx)(`p`,{children:M(`Go and enjoy Thino`)})]})}},[a]),g=()=>{switch(a){case 0:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`thino-user-preview-wrapper`,children:(0,W.jsxs)(`div`,{className:`userinfo-container`,onClick:()=>{n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},children:[(0,W.jsx)(`div`,{ref:e=>{if(t?.MomentsIcon){e?.empty();return}t?.MomentsIcon||e&&(0,f.setIcon)(e,`Memos`)},className:`thino-user-icon`,style:{backgroundImage:`url("${s}")`}}),(0,W.jsxs)(`div`,{className:`thino-user-info`,children:[(0,W.jsx)(`span`,{className:`username-container`,children:(0,W.jsx)(`span`,{"aria-label":t?.UserName===`MEMO 😉`?`THINO 😉`:t?.UserName||`THINO`,className:`username-text`,children:t?.UserName===`MEMO 😉`?`THINO 😉`:t?.UserName||`THINO`})}),t?.MomentsQuote&&(0,W.jsx)(`span`,{className:`thino-user-quote`,children:t?.MomentsQuote})]})]})}),(0,W.jsxs)(`div`,{className:`thino-user-info-wrapper`,children:[(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`User name`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`Set your user name here. 'Memos 😏' By default`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`Thino 😏`,defaultValue:t?.UserName,onInput:e=>m(`UserName`,e.currentTarget.value)})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`User quote`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`Set user quote for thino`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`Share thino with the world`,defaultValue:t?.MomentsQuote,onInput:e=>m(`MomentsQuote`,e.currentTarget.value)})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`User icon`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`Set user icon for thino. You can input http/https link or file path in vault.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,ref:l,placeholder:`Input url or file path`,defaultValue:t?.MomentsIcon,onInput:e=>m(`MomentsIcon`,e.currentTarget.value)})})]})]})]});case 1:return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:u_(`theme-selector-group`,`selected`),children:[(0,W.jsxs)(`div`,{className:u_(`theme-selector`,t?.DefaultThemeForThino===`modern`?`selected`:``),onClick:()=>m(`DefaultThemeForThino`,`modern`),children:[(0,W.jsxs)(`div`,{className:`theme-selector-header-component`,children:[(0,W.jsx)(`div`,{className:`theme-selector-header`,children:M(`Modern`)}),(0,W.jsx)(`div`,{className:`theme-selector-description`,children:M(`A modern theme for Thino with a three-column layout and some unique features.`)})]}),(0,W.jsxs)(`div`,{className:`theme-selector-content`,children:[(0,W.jsx)(`div`,{className:`left-column column-component`}),(0,W.jsx)(`div`,{className:`center-column column-component`}),(0,W.jsx)(`div`,{className:`right-column column-component`})]}),(0,W.jsx)(`div`,{className:`theme-selector-footer`,children:(0,W.jsx)(`button`,{className:`mod-cta`,disabled:t?.DefaultThemeForThino===`modern`,onClick:()=>m(`DefaultThemeForThino`,`modern`),children:t?.DefaultThemeForThino===`modern`?M(`Selected`):M(`Select`)})})]}),(0,W.jsxs)(`div`,{className:u_(`theme-selector`,t?.DefaultThemeForThino===`classic`?`selected`:``),onClick:()=>m(`DefaultThemeForThino`,`classic`),children:[(0,W.jsxs)(`div`,{className:`theme-selector-header-component`,children:[(0,W.jsx)(`div`,{className:`theme-selector-header`,children:M(`Classic`)}),(0,W.jsx)(`div`,{className:`theme-selector-description`,children:M(`A classic theme for Thino with a two-column layout`)})]}),(0,W.jsxs)(`div`,{className:`theme-selector-content`,children:[(0,W.jsx)(`div`,{className:`left-column column-component`}),(0,W.jsx)(`div`,{className:`center-column column-component`})]}),(0,W.jsx)(`div`,{className:`theme-selector-footer`,children:(0,W.jsx)(`button`,{className:`mod-cta`,disabled:t?.DefaultThemeForThino===`classic`,onClick:()=>m(`DefaultThemeForThino`,`classic`),children:t?.DefaultThemeForThino===`classic`?M(`Selected`):M(`Select`)})})]})]})});case 2:return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`daily-note-plugin-status`,children:[(0,W.jsxs)(`div`,{className:`daily-note-plugin-status-header`,children:[(0,W.jsx)(`div`,{className:`plugin-status-header`,children:M(`Daily note plugin`)}),(0,W.jsx)(`div`,{className:`plugin-status-description`,children:M(`Enable daily note plugin`)})]}),(0,W.jsx)(`div`,{className:`daily-note-plugin-status-content`,children:d.enabled&&(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`daily-note-format`,children:[(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`Daily note name format`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`Set daily note name format`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`YYYY-MM-DD`,defaultValue:d.format,onInput:e=>{p({...d,format:e.currentTarget.value.trim()});try{let t=n.internalPlugins.getPluginById(`daily-notes`);t.instance.options={...t.instance.options,format:e.currentTarget.value.trim()},t.saveData({...t.instance.options,format:e.currentTarget.value.trim()})}catch(e){console.error(e)}}})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`Daily notes folder`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`Set daily notes folder`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`YYYY-MM-DD`,defaultValue:d.path,onInput:e=>{p({...d,path:e.currentTarget.value.trim()});try{let t=n.internalPlugins.getPluginById(`daily-notes`);t.instance.options={...t.instance.options,folder:e.currentTarget.value.trim()},t.saveData({...t.instance.options,folder:e.currentTarget.value.trim()})}catch(e){console.error(e)}}})})]})]})})}),(0,W.jsxs)(`div`,{className:`daily-note-plugin-status-footer`,children:[!d.enabled&&(0,W.jsx)(`div`,{className:`notice-click`,children:M(`Click to enable =>`)}),(0,W.jsx)(`button`,{className:`mod-cta`,disabled:d.enabled,onClick:()=>{if(!d.enabled){n.internalPlugins.getPluginById(`daily-notes`).enable();let e=C().folder,t=C().format;p({enabled:!0,format:t,path:e})}},children:d.enabled?M(`Enabled`):M(`Enable`)})]})]}),(0,W.jsxs)(`div`,{className:`thino-daily-settings-wrapper`,children:[(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`Default time prefix`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`Set default time prefix for thino in daily notes.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsxs)(`select`,{className:`dropdown`,defaultValue:t?.DefaultTimePrefix,onChange:e=>m(`DefaultTimePrefix`,e.currentTarget.value),children:[(0,W.jsx)(`option`,{value:`HH:mm`,children:`HH:mm`}),(0,W.jsx)(`option`,{value:`HH:mm:ss`,children:`HH:mm:ss`})]})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`Set thino insert place`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`Set where to insert thino content`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsxs)(`select`,{className:`dropdown`,defaultValue:t?.InsertType,onChange:e=>m(`InsertType`,e.currentTarget.value),children:[(0,W.jsx)(`option`,{value:`end`,children:M(`End of the diary`)}),(0,W.jsx)(`option`,{value:`custom`,children:M(`Custom location`)})]})})]}),t?.InsertType===`custom`&&(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`Insert after heading`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`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.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`# Heading`,defaultValue:t?.InsertAfter,onInput:e=>m(`InsertAfter`,e.currentTarget.value)})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`Set process target`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`You can set whole diary or only part of it`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsxs)(`select`,{className:`dropdown`,defaultValue:t?.ProcessContentTarget,onChange:e=>m(`ProcessContentTarget`,e.currentTarget.value),children:[(0,W.jsx)(`option`,{value:`custom`,children:M(`Custom`)}),(0,W.jsx)(`option`,{value:`whole`,children:M(`Whole diary`)})]})})]}),t?.ProcessContentTarget===`custom`&&(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`Process Memos below`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`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.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`# Heading`,defaultValue:t?.ProcessEntriesBelow,onInput:e=>m(`ProcessEntriesBelow`,e.currentTarget.value)})})]})]})]});case 3:return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`thino-custom-settings-wrapper`,children:[(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`Default prefix when save thino`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`Set the default prefix when create memo, 'List' by default.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,children:(0,W.jsxs)(`select`,{className:`dropdown`,defaultValue:t?.DefaultPrefix,onChange:e=>m(`DefaultPrefix`,e.currentTarget.value),children:[(0,W.jsx)(`option`,{value:`List`,children:M(`List`)}),(0,W.jsx)(`option`,{value:`Task`,children:M(`Task`)})]})})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`Use Tags In Vault`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`Use tags in vault rather than only in Memos. False by default.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,ref:e=>{e&&(e.hasChildNodes()||new f.ToggleComponent(e).setValue(t?.UseVaultTags===void 0?!1:t?.UseVaultTags).onChange(e=>{m(`UseVaultTags`,e)}))}})]}),(0,W.jsxs)(`div`,{className:`setting-item`,children:[(0,W.jsxs)(`div`,{className:`setting-item-info`,children:[(0,W.jsx)(`div`,{className:`setting-item-name`,children:M(`Delete Thino Directly`)}),(0,W.jsx)(`div`,{className:`setting-item-description`,children:M(`When delete thino directly, it will not be moved to trash. False by default.`)})]}),(0,W.jsx)(`div`,{className:`setting-item-control`,ref:e=>{e&&(e.hasChildNodes()||new f.ToggleComponent(e).setValue(t?.DeleteThinoDirectly===void 0?!1:t?.DeleteThinoDirectly).onChange(e=>{m(`DeleteThinoDirectly`,e)}))}})]})]})});case 4:return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:`thino-congrats`,children:[(0,W.jsxs)(`div`,{className:`final-congrats-text`,children:[(0,W.jsx)(`p`,{className:`ready-use`,children:M(`Thino is ready to use. `)}),(0,W.jsx)(`p`,{className:`start-to-use`,children:M(`You can start using Thino now. If you want to know more about Thino Pro, click the button below.`)})]}),(0,W.jsxs)(`div`,{className:`next-btns-group`,children:[(0,W.jsx)(`button`,{onClick:()=>{r_()?window.open(`https://pkmer.cn/products/thino`,`_blank`):window.open(`https://thino.pkmer.net/en/#price`,`_blank`)},children:M(`About Thino Pro`)}),(0,W.jsx)(`button`,{className:`mod-cta`,onClick:()=>{m(`FirstLoaded`,!1),R.getState().isMobileView?(setTimeout(()=>{R.setShowSiderbarInMobileView(!0)},500),setTimeout(()=>{R.setExitSteps(!0)},1e3)):setTimeout(()=>{R.setExitSteps(!0)},800)},children:M(`Start Thino`)})]})]})})}};return(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:`onboarding-view-container`,children:(0,W.jsx)(`div`,{className:`onboarding-view-wrapper`,children:(0,W.jsxs)(`div`,{"data-onboarding-step":a,className:`onboarding-view-content`,children:[(0,W.jsxs)(`div`,{className:`onboarding-step-heading`,children:[(0,W.jsxs)(`div`,{className:`onboarding-step-count`,children:[a+1,`/5`]}),(0,W.jsx)(`div`,{className:`close-btn`,children:(0,W.jsx)(`button`,{onClick:()=>{m(`FirstLoaded`,!1)},children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`lucide lucide-x`,children:[(0,W.jsx)(`path`,{d:`M18 6 6 18`}),(0,W.jsx)(`path`,{d:`m6 6 12 12`})]})})})]}),(0,W.jsxs)(`div`,{className:`onboarding-view-details`,children:[(0,W.jsxs)(`div`,{className:`details-content`,children:[(0,W.jsx)(`div`,{className:`onboarding-header-group`,children:h}),(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:`onboarding-form`,children:g()})})]}),(0,W.jsxs)(`div`,{className:`details-footer`,children:[(0,W.jsx)(`div`,{className:`skip-btn`,children:a!==4&&(0,W.jsx)(`button`,{onClick:()=>{m(`FirstLoaded`,!1)},children:M(`Skip and start Thino`)})}),(0,W.jsxs)(`div`,{className:`navigate-btns-group`,children:[a!==0&&(0,W.jsx)(`button`,{onClick:()=>o(a-1),children:M(`Back to previous step`)}),a!==4&&(0,W.jsx)(`button`,{className:`mod-cta`,onClick:()=>o(a+1),children:M(`Next step`)}),a===4&&(0,W.jsx)(`button`,{className:`details-settings-btn`,onClick:()=>{n.setting.open(),n.setting.openTabById(i.id||`obsidian-memos`)},children:M(`Details settings`)})]})]})]})]})})})})};function uE(e){return uE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},uE(e)}function dE(e,t,n,r){return new(n||=Promise)((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))}function fE(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function pE(e,t,n){var r,i=((r={})[e]=t,r.path=`/`,r.expires=void 0,r);if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),i.expires=a.toUTCString()}var o=[];for(var s in i)o.push(`${s}=${i[s]}`);return document.cookie=o.join(`; `),mE(e)}function mE(e){return(t={},document.cookie.split(`;`).forEach((function(e){var n=e.split(`=`),r=n[0],i=n[1];t[r.trim()]=i})),t)[e];var t}function hE(e,t){t?pE(e._options.dontShowAgainCookie,`true`,e._options.dontShowAgainCookieDays):pE(e._options.dontShowAgainCookie,``,-1)}var gE,_E=(gE={},function(e,t){return t===void 0&&(t=`introjs-stamp`),gE[t]=gE[t]||0,e[t]===void 0&&(e[t]=gE[t]++),e[t]}),vE=new(function(){function e(){this.events_key=`introjs_event`}return e.prototype._id=function(e,t,n){return e+_E(t)+(n?`_${_E(n)}`:``)},e.prototype.on=function(e,t,n,r,i){var a=this._id(t,n,r),o=function(t){return n(r||e,t||window.event)};`addEventListener`in e?e.addEventListener(t,o,i):`attachEvent`in e&&e.attachEvent(`on${t}`,o),e[this.events_key]=e[this.events_key]||{},e[this.events_key][a]=o},e.prototype.off=function(e,t,n,r,i){var a=this._id(t,n,r),o=e[this.events_key]&&e[this.events_key][a];o&&(`removeEventListener`in e?e.removeEventListener(t,o,i):`detachEvent`in e&&e.detachEvent(`on${t}`,o),e[this.events_key][a]=null)},e}()),yE=function(e){return typeof e==`function`};function bE(e,t){if(e instanceof SVGElement){var n=e.getAttribute(`class`)||``;n.match(t)||e.setAttribute(`class`,`${n} ${t}`)}else if(e.classList!==void 0)for(var r=0,i=t.split(` `);r<i.length;r++){var a=i[r];e.classList.add(a)}else e.className.match(t)||(e.className+=` ${t}`)}function xE(e,t){var n=``;return`currentStyle`in e?n=e.currentStyle[t]:document.defaultView&&document.defaultView.getComputedStyle&&(n=document.defaultView.getComputedStyle(e,null).getPropertyValue(t)),n&&n.toLowerCase?n.toLowerCase():n}function SE(e,t){if(e){var n=function(e){var t=window.getComputedStyle(e),n=t.position===`absolute`,r=/(auto|scroll)/;if(t.position===`fixed`)return document.body;for(var i=e;i=i.parentElement;)if(t=window.getComputedStyle(i),(!n||t.position!==`static`)&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.body}(t);n!==document.body&&(n.scrollTop=t.offsetTop-n.offsetTop)}}function CE(){if(window.innerWidth!==void 0)return{width:window.innerWidth,height:window.innerHeight};var e=document.documentElement;return{width:e.clientWidth,height:e.clientHeight}}function wE(e,t,n,r,i){var a;if(t!==`off`&&e&&(a=t===`tooltip`?i.getBoundingClientRect():r.getBoundingClientRect(),!function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom+80<=window.innerHeight&&t.right<=window.innerWidth}(r))){var o=CE().height;a.bottom-(a.bottom-a.top)<0||r.clientHeight>o?window.scrollBy(0,a.top-(o/2-a.height/2)-n):window.scrollBy(0,a.top-(o/2-a.height/2)+n)}}function TE(e){e.setAttribute(`role`,`button`),e.tabIndex=0}function EE(e){var t=e.parentElement;return!(!t||t.nodeName===`HTML`)&&(xE(e,`position`)===`fixed`||EE(t))}function DE(e,t){var n=document.body,r=document.documentElement,i=window.pageYOffset||r.scrollTop||n.scrollTop,a=window.pageXOffset||r.scrollLeft||n.scrollLeft;t||=n;var o=e.getBoundingClientRect(),s=t.getBoundingClientRect(),c=xE(t,`position`),l={width:o.width,height:o.height};return t.tagName.toLowerCase()!==`body`&&c===`relative`||c===`sticky`?Object.assign(l,{top:o.top-s.top,left:o.left-s.left}):EE(e)?Object.assign(l,{top:o.top,left:o.left}):Object.assign(l,{top:o.top+i,left:o.left+a})}function OE(e,t){if(e instanceof SVGElement){var n=e.getAttribute(`class`)||``;e.setAttribute(`class`,n.replace(t,``).replace(/^\s+|\s+$/g,``))}else e.className=e.className.replace(t,``).replace(/^\s+|\s+$/g,``)}function kE(e,t){var n=``;if(e.style.cssText&&(n+=e.style.cssText),typeof t==`string`)n+=t;else for(var r in t)n+=`${r}:${t[r]};`;e.style.cssText=n}function AE(e,t,n){if(n&&t){var r=DE(t.element,e._targetElement),i=e._options.helperElementPadding;t.element instanceof Element&&EE(t.element)?bE(n,`introjs-fixedTooltip`):OE(n,`introjs-fixedTooltip`),t.position===`floating`&&(i=0),kE(n,{width:`${r.width+i}px`,height:`${r.height+i}px`,top:`${r.top-i/2}px`,left:`${r.left-i/2}px`})}}function jE(e,t,n,r,i){return e.left+t+n.width>r.width?(i.style.left=`${r.width-n.width-e.left}px`,!1):(i.style.left=`${t}px`,!0)}function ME(e,t,n,r){return e.left+e.width-t-n.width<0?(r.style.left=`${-e.left}px`,!1):(r.style.right=`${t}px`,!0)}function NE(e,t){e.includes(t)&&e.splice(e.indexOf(t),1)}function PE(e,t,n,r){var i=e.slice(),a=CE(),o=DE(n).height+10,s=DE(n).width+20,c=t.getBoundingClientRect(),l=`floating`;if(c.bottom+o>a.height&&NE(i,`bottom`),c.top-o<0&&NE(i,`top`),c.right+s>a.width&&NE(i,`right`),c.left-s<0&&NE(i,`left`),r&&=r.split(`-`)[0],i.length&&(l=i[0],i.includes(r)&&(l=r)),l===`top`||l===`bottom`){var u=void 0,d=[];l===`top`?(u=`top-middle-aligned`,d=[`top-left-aligned`,`top-middle-aligned`,`top-right-aligned`]):(u=`bottom-middle-aligned`,d=[`bottom-left-aligned`,`bottom-middle-aligned`,`bottom-right-aligned`]),l=function(e,t,n,r){var i=t/2,a=Math.min(n,window.screen.width);return a-e<t&&(NE(r,`top-left-aligned`),NE(r,`bottom-left-aligned`)),(e<i||a-e<i)&&(NE(r,`top-middle-aligned`),NE(r,`bottom-middle-aligned`)),e<t&&(NE(r,`top-right-aligned`),NE(r,`bottom-right-aligned`)),r.length?r[0]:null}(c.left,s,a.width,d)||u}return l}function FE(e,t,n,r,i){if(i===void 0&&(i=!1),t){var a,o,s,c,l=``;n.style.top=``,n.style.right=``,n.style.bottom=``,n.style.left=``,n.style.marginLeft=``,n.style.marginTop=``,r.style.display=`inherit`,l=typeof t.tooltipClass==`string`?t.tooltipClass:e._options.tooltipClass,n.className=[`introjs-tooltip`,l].filter(Boolean).join(` `),n.setAttribute(`role`,`dialog`),(c=t.position)!==`floating`&&e._options.autoPosition&&(c=PE(e._options.positionPrecedence,t.element,n,c)),o=DE(t.element),a=DE(n),s=CE(),bE(n,`introjs-${c}`);var u=o.width/2-a.width/2;switch(c){case`top-right-aligned`:r.className=`introjs-arrow bottom-right`;var d=0;ME(o,d,a,n),n.style.bottom=`${o.height+20}px`;break;case`top-middle-aligned`:r.className=`introjs-arrow bottom-middle`,i&&(u+=5),ME(o,u,a,n)&&(n.style.right=``,jE(o,u,a,s,n)),n.style.bottom=`${o.height+20}px`;break;case`top-left-aligned`:case`top`:r.className=`introjs-arrow bottom`,jE(o,i?0:15,a,s,n),n.style.bottom=`${o.height+20}px`;break;case`right`:n.style.left=`${o.width+20}px`,o.top+a.height>s.height?(r.className=`introjs-arrow left-bottom`,n.style.top=`-${a.height-o.height-20}px`):r.className=`introjs-arrow left`;break;case`left`:i||!0!==e._options.showStepNumbers||(n.style.top=`15px`),o.top+a.height>s.height?(n.style.top=`-${a.height-o.height-20}px`,r.className=`introjs-arrow right-bottom`):r.className=`introjs-arrow right`,n.style.right=`${o.width+20}px`;break;case`floating`:r.style.display=`none`,n.style.left=`50%`,n.style.top=`50%`,n.style.marginLeft=`-${a.width/2}px`,n.style.marginTop=`-${a.height/2}px`;break;case`bottom-right-aligned`:r.className=`introjs-arrow top-right`,ME(o,d=0,a,n),n.style.top=`${o.height+20}px`;break;case`bottom-middle-aligned`:r.className=`introjs-arrow top-middle`,i&&(u+=5),ME(o,u,a,n)&&(n.style.right=``,jE(o,u,a,s,n)),n.style.top=`${o.height+20}px`;break;default:r.className=`introjs-arrow top`,jE(o,0,a,s,n),n.style.top=`${o.height+20}px`}}}function IE(){for(var e=0,t=Array.from(document.querySelectorAll(`.introjs-showElement`));e<t.length;e++)OE(t[e],/introjs-[a-zA-Z]+/g)}function LE(e,t){var n=document.createElement(e);t||={};var r=/^(?:role|data-|aria-)/;for(var i in t){var a=t[i];i===`style`&&typeof a!=`function`?kE(n,a):typeof a==`string`&&i.match(r)?n.setAttribute(i,a):n[i]=a}return n}function RE(e,t,n){if(n===void 0&&(n=!1),n){var r=t.style.opacity||`1`;kE(t,{opacity:`0`}),window.setTimeout((function(){kE(t,{opacity:r})}),10)}e.appendChild(t)}function zE(e,t){return(e+1)/t*100}function BE(e,t){var n=LE(`div`,{className:`introjs-bullets`});!1===e._options.showBullets&&(n.style.display=`none`);var r=LE(`ul`);r.setAttribute(`role`,`tablist`);for(var i=function(){var t=this.getAttribute(`data-step-number`);t!=null&&e.goToStep(parseInt(t,10))},a=0;a<e._introItems.length;a++){var o=e._introItems[a].step,s=LE(`li`),c=LE(`a`);s.setAttribute(`role`,`presentation`),c.setAttribute(`role`,`tab`),c.onclick=i,a===t.step-1&&(c.className=`active`),TE(c),c.innerHTML=` `,c.setAttribute(`data-step-number`,o.toString()),s.appendChild(c),r.appendChild(s)}return n.appendChild(r),n}function VE(e,t,n){var r=e.querySelector(`.introjs-progress .introjs-progressbar`);if(r){var i=zE(t,n);r.style.cssText=`width:${i}%;`,r.setAttribute(`aria-valuenow`,i.toString())}}function HE(e,t){return dE(this,void 0,void 0,(function(){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E=this;return fE(this,(function(D){switch(D.label){case 0:return yE(e._introChangeCallback)?[4,e._introChangeCallback.call(e,t.element)]:[3,2];case 1:D.sent(),D.label=2;case 2:return n=document.querySelector(`.introjs-helperLayer`),r=document.querySelector(`.introjs-tooltipReferenceLayer`),i=`introjs-helperLayer`,typeof t.highlightClass==`string`&&(i+=` ${t.highlightClass}`),typeof e._options.highlightClass==`string`&&(i+=` ${e._options.highlightClass}`),n!==null&&r!==null?(c=r.querySelector(`.introjs-helperNumberLayer`),l=r.querySelector(`.introjs-tooltiptext`),u=r.querySelector(`.introjs-tooltip-title`),d=r.querySelector(`.introjs-arrow`),f=r.querySelector(`.introjs-tooltip`),s=r.querySelector(`.introjs-skipbutton`),o=r.querySelector(`.introjs-prevbutton`),a=r.querySelector(`.introjs-nextbutton`),n.className=i,f.style.opacity=`0`,f.style.display=`none`,SE(e._options.scrollToElement,t.element),AE(e,t,n),AE(e,t,r),IE(),e._lastShowElementTimer&&window.clearTimeout(e._lastShowElementTimer),e._lastShowElementTimer=window.setTimeout((function(){c!==null&&(c.innerHTML=`${t.step} ${e._options.stepNumbersOfLabel} ${e._introItems.length}`),l.innerHTML=t.intro||``,u.innerHTML=t.title||``,f.style.display=`block`,FE(e,t,f,d),function(e,t,n){if(e){var r=t.querySelector(`.introjs-bullets li > a.active`),i=t.querySelector(`.introjs-bullets li > a[data-step-number="${n.step}"]`);r&&i&&(r.className=``,i.className=`active`)}}(e._options.showBullets,r,t),VE(r,e._currentStep,e._introItems.length),f.style.opacity=`1`,(a!=null&&/introjs-donebutton/gi.test(a.className)||a!=null)&&a.focus(),wE(e._options.scrollToElement,t.scrollTo,e._options.scrollPadding,t.element,l)}),350)):(p=LE(`div`,{className:i}),m=LE(`div`,{className:`introjs-tooltipReferenceLayer`}),h=LE(`div`,{className:`introjs-arrow`}),g=LE(`div`,{className:`introjs-tooltip`}),_=LE(`div`,{className:`introjs-tooltiptext`}),v=LE(`div`,{className:`introjs-tooltip-header`}),y=LE(`h1`,{className:`introjs-tooltip-title`}),b=LE(`div`),kE(p,{"box-shadow":`0 0 1px 2px rgba(33, 33, 33, 0.8), rgba(33, 33, 33, ${e._options.overlayOpacity.toString()}) 0 0 0 5000px`}),SE(e._options.scrollToElement,t.element),AE(e,t,p),AE(e,t,m),RE(e._targetElement,p,!0),RE(e._targetElement,m),_.innerHTML=t.intro,y.innerHTML=t.title,b.className=`introjs-tooltipbuttons`,!1===e._options.showButtons&&(b.style.display=`none`),v.appendChild(y),g.appendChild(v),g.appendChild(_),e._options.dontShowAgain&&(x=LE(`div`,{className:`introjs-dontShowAgain`}),(S=LE(`input`,{type:`checkbox`,id:`introjs-dontShowAgain`,name:`introjs-dontShowAgain`})).onchange=function(t){e.setDontShowAgain(t.target.checked)},(C=LE(`label`,{htmlFor:`introjs-dontShowAgain`})).innerText=e._options.dontShowAgainLabel,x.appendChild(S),x.appendChild(C),g.appendChild(x)),g.appendChild(BE(e,t)),g.appendChild(function(e){var t=LE(`div`);t.className=`introjs-progress`,!1===e._options.showProgress&&(t.style.display=`none`);var n=LE(`div`,{className:`introjs-progressbar`});e._options.progressBarAdditionalClass&&(n.className+=` `+e._options.progressBarAdditionalClass);var r=zE(e._currentStep,e._introItems.length);return n.setAttribute(`role`,`progress`),n.setAttribute(`aria-valuemin`,`0`),n.setAttribute(`aria-valuemax`,`100`),n.setAttribute(`aria-valuenow`,r.toString()),n.style.cssText=`width:${r}%;`,t.appendChild(n),t}(e)),w=LE(`div`),!0===e._options.showStepNumbers&&(w.className=`introjs-helperNumberLayer`,w.innerHTML=`${t.step} ${e._options.stepNumbersOfLabel} ${e._introItems.length}`,g.appendChild(w)),g.appendChild(h),m.appendChild(g),(a=LE(`a`)).onclick=function(){return dE(E,void 0,void 0,(function(){return fE(this,(function(t){switch(t.label){case 0:return e._introItems.length-1===e._currentStep?[3,2]:[4,GE(e)];case 1:return t.sent(),[3,6];case 2:return/introjs-donebutton/gi.test(a.className)?yE(e._introCompleteCallback)?[4,e._introCompleteCallback.call(e,e._currentStep,`done`)]:[3,4]:[3,6];case 3:t.sent(),t.label=4;case 4:return[4,dD(e,e._targetElement)];case 5:t.sent(),t.label=6;case 6:return[2]}}))}))},TE(a),a.innerHTML=e._options.nextLabel,(o=LE(`a`)).onclick=function(){return dE(E,void 0,void 0,(function(){return fE(this,(function(t){switch(t.label){case 0:return e._currentStep>0?[4,KE(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},TE(o),o.innerHTML=e._options.prevLabel,TE(s=LE(`a`,{className:`introjs-skipbutton`})),s.innerHTML=e._options.skipLabel,s.onclick=function(){return dE(E,void 0,void 0,(function(){return fE(this,(function(t){switch(t.label){case 0:return e._introItems.length-1===e._currentStep&&yE(e._introCompleteCallback)?[4,e._introCompleteCallback.call(e,e._currentStep,`skip`)]:[3,2];case 1:t.sent(),t.label=2;case 2:return yE(e._introSkipCallback)?[4,e._introSkipCallback.call(e,e._currentStep)]:[3,4];case 3:t.sent(),t.label=4;case 4:return[4,dD(e,e._targetElement)];case 5:return t.sent(),[2]}}))}))},v.appendChild(s),e._introItems.length>1&&b.appendChild(o),b.appendChild(a),g.appendChild(b),FE(e,t,g,h),wE(e._options.scrollToElement,t.scrollTo,e._options.scrollPadding,t.element,g)),(T=e._targetElement.querySelector(`.introjs-disableInteraction`))&&T.parentNode&&T.parentNode.removeChild(T),t.disableInteraction&&function(e,t){var n=document.querySelector(`.introjs-disableInteraction`);n===null&&(n=LE(`div`,{className:`introjs-disableInteraction`}),e._targetElement.appendChild(n)),AE(e,t,n)}(e,t),e._currentStep===0&&e._introItems.length>1?(a!=null&&(a.className=`${e._options.buttonClass} introjs-nextbutton`,a.innerHTML=e._options.nextLabel),!0===e._options.hidePrev?(o!=null&&(o.className=`${e._options.buttonClass} introjs-prevbutton introjs-hidden`),a!=null&&bE(a,`introjs-fullbutton`)):o!=null&&(o.className=`${e._options.buttonClass} introjs-prevbutton introjs-disabled`)):e._introItems.length-1===e._currentStep||e._introItems.length===1?(o!=null&&(o.className=`${e._options.buttonClass} introjs-prevbutton`),!0===e._options.hideNext?(a!=null&&(a.className=`${e._options.buttonClass} introjs-nextbutton introjs-hidden`),o!=null&&bE(o,`introjs-fullbutton`)):a!=null&&(!0===e._options.nextToDone?(a.innerHTML=e._options.doneLabel,bE(a,`${e._options.buttonClass} introjs-nextbutton introjs-donebutton`)):a.className=`${e._options.buttonClass} introjs-nextbutton introjs-disabled`)):(o!=null&&(o.className=`${e._options.buttonClass} introjs-prevbutton`),a!=null&&(a.className=`${e._options.buttonClass} introjs-nextbutton`,a.innerHTML=e._options.nextLabel)),o?.setAttribute(`role`,`button`),a?.setAttribute(`role`,`button`),s?.setAttribute(`role`,`button`),a?.focus(),function(e){bE(e,`introjs-showElement`);var t=xE(e,`position`);t!==`absolute`&&t!==`relative`&&t!==`sticky`&&t!==`fixed`&&bE(e,`introjs-relativePosition`)}(t.element),yE(e._introAfterChangeCallback)?[4,e._introAfterChangeCallback.call(e,t.element)]:[3,4];case 3:D.sent(),D.label=4;case 4:return[2]}}))}))}function UE(e,t){return dE(this,void 0,void 0,(function(){return fE(this,(function(n){switch(n.label){case 0:return e._currentStep=t-2,e._introItems===void 0?[3,2]:[4,GE(e)];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}function WE(e,t){return dE(this,void 0,void 0,(function(){return fE(this,(function(n){switch(n.label){case 0:return e._currentStepNumber=t,e._introItems===void 0?[3,2]:[4,GE(e)];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))}function GE(e){return dE(this,void 0,void 0,(function(){var t,n,r;return fE(this,(function(i){switch(i.label){case 0:if(e._direction=`forward`,e._currentStepNumber!==void 0)for(t=0;t<e._introItems.length;t++)e._introItems[t].step===e._currentStepNumber&&(e._currentStep=t-1,e._currentStepNumber=void 0);return e._currentStep===-1?e._currentStep=0:++e._currentStep,n=e._introItems[e._currentStep],r=!0,yE(e._introBeforeChangeCallback)?[4,e._introBeforeChangeCallback.call(e,n&&n.element,e._currentStep,e._direction)]:[3,2];case 1:r=i.sent(),i.label=2;case 2:return!1===r?(--e._currentStep,[2,!1]):e._introItems.length<=e._currentStep?yE(e._introCompleteCallback)?[4,e._introCompleteCallback.call(e,e._currentStep,`end`)]:[3,4]:[3,6];case 3:i.sent(),i.label=4;case 4:return[4,dD(e,e._targetElement)];case 5:return i.sent(),[2,!1];case 6:return[4,HE(e,n)];case 7:return i.sent(),[2,!0]}}))}))}function KE(e){return dE(this,void 0,void 0,(function(){var t,n;return fE(this,(function(r){switch(r.label){case 0:return e._direction=`backward`,e._currentStep<=0?[2,!1]:(--e._currentStep,t=e._introItems[e._currentStep],n=!0,yE(e._introBeforeChangeCallback)?[4,e._introBeforeChangeCallback.call(e,t&&t.element,e._currentStep,e._direction)]:[3,2]);case 1:n=r.sent(),r.label=2;case 2:return!1===n?(++e._currentStep,[2,!1]):[4,HE(e,t)];case 3:return r.sent(),[2,!0]}}))}))}function qE(e,t){return dE(this,void 0,void 0,(function(){var n,r;return fE(this,(function(i){switch(i.label){case 0:return(n=t.code===void 0?t.which:t.code)===null&&(n=t.charCode===null?t.keyCode:t.charCode),n!==`Escape`&&n!==27||!0!==e._options.exitOnEsc?[3,2]:[4,dD(e,e._targetElement)];case 1:return i.sent(),[3,16];case 2:return n!==`ArrowLeft`&&n!==37?[3,4]:[4,KE(e)];case 3:return i.sent(),[3,16];case 4:return n!==`ArrowRight`&&n!==39?[3,6]:[4,GE(e)];case 5:return i.sent(),[3,16];case 6:return n!==`Enter`&&n!==`NumpadEnter`&&n!==13?[3,16]:(r=t.target||t.srcElement)&&r.className.match(`introjs-prevbutton`)?[4,KE(e)]:[3,8];case 7:return i.sent(),[3,15];case 8:return r&&r.className.match(`introjs-skipbutton`)?e._introItems.length-1===e._currentStep&&yE(e._introCompleteCallback)?[4,e._introCompleteCallback.call(e,e._currentStep,`skip`)]:[3,10]:[3,12];case 9:i.sent(),i.label=10;case 10:return[4,dD(e,e._targetElement)];case 11:return i.sent(),[3,15];case 12:return r&&r.getAttribute(`data-step-number`)?(r.click(),[3,15]):[3,13];case 13:return[4,GE(e)];case 14:i.sent(),i.label=15;case 15:t.preventDefault?t.preventDefault():t.returnValue=!1,i.label=16;case 16:return[2]}}))}))}function JE(e){if(e===null||uE(e)!==`object`||`nodeType`in e)return e;var t={};for(var n in e)`jQuery`in window&&e[n]instanceof window.jQuery?t[n]=e[n]:t[n]=JE(e[n]);return t}function YE(e){var t=document.querySelector(`.introjs-hints`);return t?Array.from(t.querySelectorAll(e)):[]}function XE(e,t){return dE(this,void 0,void 0,(function(){var n;return fE(this,(function(r){switch(r.label){case 0:return n=YE(`.introjs-hint[data-step="${t}"]`)[0],iD(),n&&bE(n,`introjs-hidehint`),yE(e._hintCloseCallback)?[4,e._hintCloseCallback.call(e,t)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))}function ZE(e){return dE(this,void 0,void 0,(function(){var t,n,r,i,a;return fE(this,(function(o){switch(o.label){case 0:t=YE(`.introjs-hint`),n=0,r=t,o.label=1;case 1:return n<r.length?(i=r[n],(a=i.getAttribute(`data-step`))?[4,XE(e,parseInt(a,10))]:[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))}function QE(e){return dE(this,void 0,void 0,(function(){var t,n,r,i,a;return fE(this,(function(o){switch(o.label){case 0:if(!(t=YE(`.introjs-hint`))||!t.length)return[3,1];for(n=0,r=t;n<r.length;n++)i=r[n],(a=i.getAttribute(`data-step`))&&$E(parseInt(a,10));return[3,3];case 1:return[4,aD(e,e._targetElement)];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))}function $E(e){var t=YE(`.introjs-hint[data-step="${e}"]`)[0];t&&OE(t,/introjs-hidehint/g)}function eD(e){var t=YE(`.introjs-hint[data-step="${e}"]`)[0];t&&t.parentNode&&t.parentNode.removeChild(t)}function tD(e){return dE(this,void 0,void 0,(function(){var t,n,r,i,a,o,s;return fE(this,(function(c){switch(c.label){case 0:for((t=document.querySelector(`.introjs-hints`))===null&&(t=LE(`div`,{className:`introjs-hints`})),n=function(t){return function(n){var r=n||window.event;r&&r.stopPropagation&&r.stopPropagation(),r&&r.cancelBubble!==null&&(r.cancelBubble=!0),rD(e,t)}},r=0;r<e._hintItems.length;r++){if(i=e._hintItems[r],document.querySelector(`.introjs-hint[data-step="${r}"]`))return[2];TE(a=LE(`a`,{className:`introjs-hint`})),a.onclick=n(r),i.hintAnimation||bE(a,`introjs-hint-no-anim`),EE(i.element)&&bE(a,`introjs-fixedhint`),o=LE(`div`,{className:`introjs-hint-dot`}),s=LE(`div`,{className:`introjs-hint-pulse`}),a.appendChild(o),a.appendChild(s),a.setAttribute(`data-step`,r.toString()),i.hintTargetElement=i.element,i.element=a,nD(i.hintPosition,a,i.hintTargetElement),t.appendChild(a)}return document.body.appendChild(t),yE(e._hintsAddedCallback)?[4,e._hintsAddedCallback.call(e)]:[3,2];case 1:c.sent(),c.label=2;case 2:return e._options.hintAutoRefreshInterval>=0&&(e._hintsAutoRefreshFunction=(l=function(){return oD(e)},u=e._options.hintAutoRefreshInterval,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];window.clearTimeout(d),d=window.setTimeout((function(){l(e)}),u)}),vE.on(window,`scroll`,e._hintsAutoRefreshFunction,e,!0)),[2]}var l,u,d}))}))}function nD(e,t,n){if(n!==void 0){var r=DE(n),i=20,a=20;switch(e){default:case`top-left`:t.style.left=`${r.left}px`,t.style.top=`${r.top}px`;break;case`top-right`:t.style.left=`${r.left+r.width-i}px`,t.style.top=`${r.top}px`;break;case`bottom-left`:t.style.left=`${r.left}px`,t.style.top=`${r.top+r.height-a}px`;break;case`bottom-right`:t.style.left=`${r.left+r.width-i}px`,t.style.top=`${r.top+r.height-a}px`;break;case`middle-left`:t.style.left=`${r.left}px`,t.style.top=`${r.top+(r.height-a)/2}px`;break;case`middle-right`:t.style.left=`${r.left+r.width-i}px`,t.style.top=`${r.top+(r.height-a)/2}px`;break;case`middle-middle`:t.style.left=`${r.left+(r.width-i)/2}px`,t.style.top=`${r.top+(r.height-a)/2}px`;break;case`bottom-middle`:t.style.left=`${r.left+(r.width-i)/2}px`,t.style.top=`${r.top+r.height-a}px`;break;case`top-middle`:t.style.left=`${r.left+(r.width-i)/2}px`,t.style.top=`${r.top}px`}}}function rD(e,t){return dE(this,void 0,void 0,(function(){var n,r,i,a,o,s,c,l,u,d,f;return fE(this,(function(p){switch(p.label){case 0:return n=document.querySelector(`.introjs-hint[data-step="${t}"]`),r=e._hintItems[t],yE(e._hintClickCallback)?[4,e._hintClickCallback.call(e,n,r,t)]:[3,2];case 1:p.sent(),p.label=2;case 2:return(i=iD())!==void 0&&parseInt(i,10)===t||(a=LE(`div`,{className:`introjs-tooltip`}),o=LE(`div`),s=LE(`div`),c=LE(`div`),a.onclick=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},o.className=`introjs-tooltiptext`,(l=LE(`p`)).innerHTML=r.hint||``,o.appendChild(l),e._options.hintShowButton&&((u=LE(`a`)).className=e._options.buttonClass,u.setAttribute(`role`,`button`),u.innerHTML=e._options.hintButtonLabel,u.onclick=function(){return XE(e,t)},o.appendChild(u)),s.className=`introjs-arrow`,a.appendChild(s),a.appendChild(o),d=n.getAttribute(`data-step`)||``,e._currentStep=parseInt(d,10),f=e._hintItems[e._currentStep],c.className=`introjs-tooltipReferenceLayer introjs-hintReference`,c.setAttribute(`data-step`,d),AE(e,f,c),c.appendChild(a),document.body.appendChild(c),FE(e,f,a,s,!0)),[2]}}))}))}function iD(){var e=document.querySelector(`.introjs-hintReference`);if(e&&e.parentNode){var t=e.getAttribute(`data-step`);return t?(e.parentNode.removeChild(e),t):void 0}}function aD(e,t){return dE(this,void 0,void 0,(function(){var n,r,i,a,o,s,c,l,u,d;return fE(this,(function(f){switch(f.label){case 0:if(e._hintItems=[],e._options.hints&&e._options.hints.length>0)for(n=0,r=e._options.hints;n<r.length;n++)i=r[n],typeof(a=JE(i)).element==`string`&&(a.element=document.querySelector(a.element)),a.hintPosition=a.hintPosition||e._options.hintPosition,a.hintAnimation=a.hintAnimation||e._options.hintAnimation,a.element!==null&&e._hintItems.push(a);else{if(!(o=Array.from(t.querySelectorAll(`*[data-hint]`)))||!o.length)return[2,!1];for(s=0,c=o;s<c.length;s++)l=c[s],u=l.getAttribute(`data-hint-animation`),d=e._options.hintAnimation,u&&(d=u===`true`),e._hintItems.push({element:l,hint:l.getAttribute(`data-hint`)||``,hintPosition:l.getAttribute(`data-hint-position`)||e._options.hintPosition,hintAnimation:d,tooltipClass:l.getAttribute(`data-tooltip-class`)||void 0,position:l.getAttribute(`data-position`)||e._options.tooltipPosition})}return[4,tD(e)];case 1:return f.sent(),vE.on(document,`click`,iD,e,!1),vE.on(window,`resize`,oD,e,!0),[2,!0]}}))}))}function oD(e){for(var t=0,n=e._hintItems;t<n.length;t++){var r=n[t],i=r.hintTargetElement;nD(r.hintPosition,r.element,i)}}function sD(e,t){var n=Array.from(t.querySelectorAll(`*[data-intro]`)),r=[];if(e._options.steps&&e._options.steps.length)for(var i=0,a=e._options.steps;i<a.length;i++){var o=JE(f=a[i]);if(o.step=r.length+1,o.title=o.title||``,typeof o.element==`string`&&(o.element=document.querySelector(o.element)||void 0),o.element===void 0||o.element===null){var s=document.querySelector(`.introjsFloatingElement`);s===null&&(s=LE(`div`,{className:`introjsFloatingElement`}),document.body.appendChild(s)),o.element=s,o.position=`floating`}o.position=o.position||e._options.tooltipPosition,o.scrollTo=o.scrollTo||e._options.scrollTo,o.disableInteraction===void 0&&(o.disableInteraction=e._options.disableInteraction),o.element!==null&&r.push(o)}else{var c=void 0;if(n.length<1)return[];for(var l=0,u=n;l<u.length;l++){var d=u[l];if((!e._options.group||d.getAttribute(`data-intro-group`)===e._options.group)&&d.style.display!==`none`){var f=parseInt(d.getAttribute(`data-step`)||``,10);c=e._options.disableInteraction,d.hasAttribute(`data-disable-interaction`)&&(c=!!d.getAttribute(`data-disable-interaction`)),f>0&&(r[f-1]={step:f,element:d,title:d.getAttribute(`data-title`)||``,intro:d.getAttribute(`data-intro`)||``,tooltipClass:d.getAttribute(`data-tooltip-class`)||void 0,highlightClass:d.getAttribute(`data-highlight-class`)||void 0,position:d.getAttribute(`data-position`)||e._options.tooltipPosition,scrollTo:d.getAttribute(`data-scroll-to`)||e._options.scrollTo,disableInteraction:c})}}for(var p=0,m=0,h=n;m<h.length;m++)if(d=h[m],(!e._options.group||d.getAttribute(`data-intro-group`)===e._options.group)&&d.getAttribute(`data-step`)===null){for(;r[p]!==void 0;)p++;c=d.hasAttribute(`data-disable-interaction`)?!!d.getAttribute(`data-disable-interaction`):e._options.disableInteraction,r[p]={element:d,title:d.getAttribute(`data-title`)||``,intro:d.getAttribute(`data-intro`)||``,step:p+1,tooltipClass:d.getAttribute(`data-tooltip-class`)||void 0,highlightClass:d.getAttribute(`data-highlight-class`)||void 0,position:d.getAttribute(`data-position`)||e._options.tooltipPosition,scrollTo:d.getAttribute(`data-scroll-to`)||e._options.scrollTo,disableInteraction:c}}}for(var g=[],_=0;_<r.length;_++)r[_]&&g.push(r[_]);return(r=g).sort((function(e,t){return e.step-t.step})),r}function cD(e,t){var n=e._currentStep;if(n!=null&&n!=-1){var r=e._introItems[n],i=document.querySelector(`.introjs-tooltipReferenceLayer`),a=document.querySelector(`.introjs-helperLayer`),o=document.querySelector(`.introjs-disableInteraction`);AE(e,r,a),AE(e,r,i),AE(e,r,o),t&&(e._introItems=sD(e,e._targetElement),function(e,t){if(e._options.showBullets){var n=document.querySelector(`.introjs-bullets`);n&&n.parentNode&&n.parentNode.replaceChild(BE(e,t),n)}}(e,r),VE(i,n,e._introItems.length));var s=document.querySelector(`.introjs-arrow`),c=document.querySelector(`.introjs-tooltip`);return c&&s&&FE(e,e._introItems[n],c,s),oD(e),e}}function lD(e){cD(e)}function uD(e,t){if(t===void 0&&(t=!1),e&&e.parentElement){var n=e.parentElement;t?(kE(e,{opacity:`0`}),window.setTimeout((function(){try{n.removeChild(e)}catch{}}),500)):n.removeChild(e)}}function dD(e,t,n){return n===void 0&&(n=!1),dE(this,void 0,void 0,(function(){var r,i,a,o;return fE(this,(function(s){switch(s.label){case 0:return r=!0,e._introBeforeExitCallback===void 0?[3,2]:[4,e._introBeforeExitCallback.call(e,t)];case 1:r=s.sent(),s.label=2;case 2:if(!n&&!1===r)return[2];if((i=Array.from(t.querySelectorAll(`.introjs-overlay`)))&&i.length)for(a=0,o=i;a<o.length;a++)uD(o[a]);return uD(t.querySelector(`.introjs-helperLayer`),!0),uD(t.querySelector(`.introjs-tooltipReferenceLayer`)),uD(t.querySelector(`.introjs-disableInteraction`)),uD(document.querySelector(`.introjsFloatingElement`)),IE(),vE.off(window,`keydown`,qE,e,!0),vE.off(window,`resize`,lD,e,!0),yE(e._introExitCallback)?[4,e._introExitCallback.call(e)]:[3,4];case 3:s.sent(),s.label=4;case 4:return e._currentStep=-1,[2]}}))}))}function fD(e,t){return dE(this,void 0,void 0,(function(){var n;return fE(this,(function(r){switch(r.label){case 0:return e.isActive()?yE(e._introStartCallback)?[4,e._introStartCallback.call(e,t)]:[3,2]:[2,!1];case 1:r.sent(),r.label=2;case 2:return(n=sD(e,t)).length===0?[2,!1]:(e._introItems=n,function(e,t){var n=this,r=LE(`div`,{className:`introjs-overlay`});kE(r,{top:0,bottom:0,left:0,right:0,position:`fixed`}),t.appendChild(r),!0===e._options.exitOnOverlayClick&&(kE(r,{cursor:`pointer`}),r.onclick=function(){return dE(n,void 0,void 0,(function(){return fE(this,(function(n){switch(n.label){case 0:return[4,dD(e,t)];case 1:return n.sent(),[2]}}))}))})}(e,t),[4,GE(e)]);case 3:r.sent(),t.addEventListener,e._options.keyboardNavigation&&vE.on(window,`keydown`,qE,e,!0),vE.on(window,`resize`,lD,e,!0),r.label=4;case 4:return[2,!1]}}))}))}function pD(e,t,n){return e[t]=n,e}var mD=function(){function e(e){this._currentStep=-1,this._introItems=[],this._hintItems=[],this._targetElement=e,this._options={steps:[],hints:[],isActive:!0,nextLabel:`Next`,prevLabel:`Back`,skipLabel:`×`,doneLabel:`Done`,hidePrev:!1,hideNext:!1,nextToDone:!0,tooltipPosition:`bottom`,tooltipClass:``,group:``,highlightClass:``,exitOnEsc:!0,exitOnOverlayClick:!0,showStepNumbers:!1,stepNumbersOfLabel:`of`,keyboardNavigation:!0,showButtons:!0,showBullets:!0,showProgress:!1,scrollToElement:!0,scrollTo:`element`,scrollPadding:30,overlayOpacity:.5,autoPosition:!0,positionPrecedence:[`bottom`,`top`,`right`,`left`],disableInteraction:!1,dontShowAgain:!1,dontShowAgainLabel:`Don't show this again`,dontShowAgainCookie:`introjs-dontShowAgain`,dontShowAgainCookieDays:365,helperElementPadding:10,hintPosition:`top-middle`,hintButtonLabel:`Got it`,hintShowButton:!0,hintAutoRefreshInterval:10,hintAnimation:!0,buttonClass:`introjs-button`,progressBarAdditionalClass:!1}}return e.prototype.isActive=function(){return(!this._options.dontShowAgain||(e=mE(this._options.dontShowAgainCookie))===``||e!==`true`)&&this._options.isActive;var e},e.prototype.clone=function(){return new e(this._targetElement)},e.prototype.setOption=function(e,t){return this._options=pD(this._options,e,t),this},e.prototype.setOptions=function(e){return this._options=function(e,t){for(var n=0,r=Object.entries(t);n<r.length;n++){var i=r[n];e=pD(e,i[0],i[1])}return e}(this._options,e),this},e.prototype.start=function(){return dE(this,void 0,void 0,(function(){return fE(this,(function(e){switch(e.label){case 0:return[4,fD(this,this._targetElement)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.goToStep=function(e){return dE(this,void 0,void 0,(function(){return fE(this,(function(t){switch(t.label){case 0:return[4,UE(this,e)];case 1:return t.sent(),[2,this]}}))}))},e.prototype.addStep=function(e){return this._options.steps||(this._options.steps=[]),this._options.steps.push(e),this},e.prototype.addSteps=function(e){if(!e.length)return this;for(var t=0;t<e.length;t++)this.addStep(e[t]);return this},e.prototype.goToStepNumber=function(e){return dE(this,void 0,void 0,(function(){return fE(this,(function(t){switch(t.label){case 0:return[4,WE(this,e)];case 1:return t.sent(),[2,this]}}))}))},e.prototype.nextStep=function(){return dE(this,void 0,void 0,(function(){return fE(this,(function(e){switch(e.label){case 0:return[4,GE(this)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.previousStep=function(){return dE(this,void 0,void 0,(function(){return fE(this,(function(e){switch(e.label){case 0:return[4,KE(this)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.currentStep=function(){return this._currentStep},e.prototype.exit=function(e){return dE(this,void 0,void 0,(function(){return fE(this,(function(t){switch(t.label){case 0:return[4,dD(this,this._targetElement,e)];case 1:return t.sent(),[2,this]}}))}))},e.prototype.refresh=function(e){return cD(this,e),this},e.prototype.setDontShowAgain=function(e){return hE(this,e),this},e.prototype.onbeforechange=function(e){if(!yE(e))throw Error(`Provided callback for onbeforechange was not a function`);return this._introBeforeChangeCallback=e,this},e.prototype.onchange=function(e){if(!yE(e))throw Error(`Provided callback for onchange was not a function.`);return this._introChangeCallback=e,this},e.prototype.onafterchange=function(e){if(!yE(e))throw Error(`Provided callback for onafterchange was not a function`);return this._introAfterChangeCallback=e,this},e.prototype.oncomplete=function(e){if(!yE(e))throw Error(`Provided callback for oncomplete was not a function.`);return this._introCompleteCallback=e,this},e.prototype.onhintsadded=function(e){if(!yE(e))throw Error(`Provided callback for onhintsadded was not a function.`);return this._hintsAddedCallback=e,this},e.prototype.onhintclick=function(e){if(!yE(e))throw Error(`Provided callback for onhintclick was not a function.`);return this._hintClickCallback=e,this},e.prototype.onhintclose=function(e){if(!yE(e))throw Error(`Provided callback for onhintclose was not a function.`);return this._hintCloseCallback=e,this},e.prototype.onstart=function(e){if(!yE(e))throw Error(`Provided callback for onstart was not a function.`);return this._introStartCallback=e,this},e.prototype.onexit=function(e){if(!yE(e))throw Error(`Provided callback for onexit was not a function.`);return this._introExitCallback=e,this},e.prototype.onskip=function(e){if(!yE(e))throw Error(`Provided callback for onskip was not a function.`);return this._introSkipCallback=e,this},e.prototype.onbeforeexit=function(e){if(!yE(e))throw Error(`Provided callback for onbeforeexit was not a function.`);return this._introBeforeExitCallback=e,this},e.prototype.addHints=function(){return dE(this,void 0,void 0,(function(){return fE(this,(function(e){switch(e.label){case 0:return[4,aD(this,this._targetElement)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.hideHint=function(e){return dE(this,void 0,void 0,(function(){return fE(this,(function(t){switch(t.label){case 0:return[4,XE(this,e)];case 1:return t.sent(),[2,this]}}))}))},e.prototype.hideHints=function(){return dE(this,void 0,void 0,(function(){return fE(this,(function(e){switch(e.label){case 0:return[4,ZE(this)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.showHint=function(e){return $E(e),this},e.prototype.showHints=function(){return dE(this,void 0,void 0,(function(){return fE(this,(function(e){switch(e.label){case 0:return[4,QE(this)];case 1:return e.sent(),[2,this]}}))}))},e.prototype.removeHints=function(){return function(e){for(var t=0,n=YE(`.introjs-hint`);t<n.length;t++){var r=n[t].getAttribute(`data-step`);r&&eD(parseInt(r,10))}vE.off(document,`click`,iD,e,!1),vE.off(window,`resize`,oD,e,!0),e._hintsAutoRefreshFunction&&vE.off(window,`scroll`,e._hintsAutoRefreshFunction,e,!0)}(this),this},e.prototype.removeHint=function(e){return eD(e),this},e.prototype.showHintDialog=function(e){return dE(this,void 0,void 0,(function(){return fE(this,(function(t){switch(t.label){case 0:return[4,rD(this,e)];case 1:return t.sent(),[2,this]}}))}))},e}(),hD=function e(t){var n;if(uE(t)===`object`)n=new mD(t);else if(typeof t==`string`){var r=document.querySelector(t);if(!r)throw Error(`There is no element with given selector.`);n=new mD(r)}else n=new mD(document.body);return e.instances[_E(n,`introjs-instance`)]=n,n};hD.version=`7.2.0`,hD.instances={};var gD=s(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),_D=s(((e,t)=>{var n=gD();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=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 s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),vD=s(((e,t)=>{t.exports=_D()()})),yD=s((e=>{var t=_();function n(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var r=Object.prototype.hasOwnProperty,i=/^[: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]*$/,a={},o={};function s(e){return r.call(o,e)?!0:r.call(a,e)?!1:i.test(e)?o[e]=!0:(a[e]=!0,!1)}function c(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var l={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){l[e]=new c(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];l[t]=new c(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){l[e]=new c(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){l[e]=new c(e,2,!1,e,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(e){l[e]=new c(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){l[e]=new c(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){l[e]=new c(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){l[e]=new c(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){l[e]=new c(e,5,!1,e.toLowerCase(),null,!1,!1)});var u=/[\-:]([a-z])/g;function d(e){return e[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(e){var t=e.replace(u,d);l[t]=new c(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(u,d);l[t]=new c(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(u,d);l[t]=new c(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){l[e]=new c(e,1,!1,e.toLowerCase(),null,!1,!1)}),l.xlinkHref=new c(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){l[e]=new c(e,1,!1,e.toLowerCase(),null,!0,!0)});var f={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},p=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(f).forEach(function(e){p.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),f[t]=f[e]})});var m=/["'&<>]/;function h(e){if(typeof e==`boolean`||typeof e==`number`)return``+e;e=``+e;var t=m.exec(e);if(t){var n=``,r,i=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t=`"`;break;case 38:t=`&`;break;case 39:t=`'`;break;case 60:t=`<`;break;case 62:t=`>`;break;default:continue}i!==r&&(n+=e.substring(i,r)),i=r+1,n+=t}e=i===r?n:n+e.substring(i,r)}return e}var g=/([A-Z])/g,v=/^ms-/,y=Array.isArray;function b(e,t){return{insertionMode:e,selectedValue:t}}function x(e,t,n){switch(t){case`select`:return b(1,n.value==null?n.defaultValue:n.value);case`svg`:return b(2,null);case`math`:return b(3,null);case`foreignObject`:return b(1,null);case`table`:return b(4,null);case`thead`:case`tbody`:case`tfoot`:return b(5,null);case`colgroup`:return b(7,null);case`tr`:return b(6,null)}return 4<=e.insertionMode||e.insertionMode===0?b(1,null):e}var S=new Map;function C(e,t,i){if(typeof i!=`object`)throw Error(n(62));for(var a in t=!0,i)if(r.call(i,a)){var o=i[a];if(o!=null&&typeof o!=`boolean`&&o!==``){if(a.indexOf(`--`)===0){var s=h(a);o=h((``+o).trim())}else{s=a;var c=S.get(s);c===void 0?(c=h(s.replace(g,`-$1`).toLowerCase().replace(v,`-ms-`)),S.set(s,c),s=c):s=c,o=typeof o==`number`?o===0||r.call(f,a)?``+o:o+`px`:h((``+o).trim())}t?(t=!1,e.push(` style="`,s,`:`,o)):e.push(`;`,s,`:`,o)}}t||e.push(`"`)}function w(e,t,n,r){switch(n){case`style`:C(e,t,r);return;case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:return}if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`){if(t=l.hasOwnProperty(n)?l[n]:null,t!==null){switch(typeof r){case`function`:case`symbol`:return;case`boolean`:if(!t.acceptsBooleans)return}switch(n=t.attributeName,t.type){case 3:r&&e.push(` `,n,`=""`);break;case 4:!0===r?e.push(` `,n,`=""`):!1!==r&&e.push(` `,n,`="`,h(r),`"`);break;case 5:isNaN(r)||e.push(` `,n,`="`,h(r),`"`);break;case 6:!isNaN(r)&&1<=r&&e.push(` `,n,`="`,h(r),`"`);break;default:t.sanitizeURL&&(r=``+r),e.push(` `,n,`="`,h(r),`"`)}}else if(s(n)){switch(typeof r){case`function`:case`symbol`:return;case`boolean`:if(t=n.toLowerCase().slice(0,5),t!==`data-`&&t!==`aria-`)return}e.push(` `,n,`="`,h(r),`"`)}}}function T(e,t,r){if(t!=null){if(r!=null)throw Error(n(60));if(typeof t!=`object`||!(`__html`in t))throw Error(n(61));t=t.__html,t!=null&&e.push(``+t)}}function E(e){var n=``;return t.Children.forEach(e,function(e){e!=null&&(n+=e)}),n}function D(e,t,n,i){e.push(A(n));var a=n=null,o;for(o in t)if(r.call(t,o)){var s=t[o];if(s!=null)switch(o){case`children`:n=s;break;case`dangerouslySetInnerHTML`:a=s;break;default:w(e,i,o,s)}}return e.push(`>`),T(e,a,n),typeof n==`string`?(e.push(h(n)),null):n}var O=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,k=new Map;function A(e){var t=k.get(e);if(t===void 0){if(!O.test(e))throw Error(n(65,e));t=`<`+e,k.set(e,t)}return t}function j(e,t,i,a,o){switch(t){case`select`:e.push(A(`select`));var c=null,l=null;for(p in i)if(r.call(i,p)){var u=i[p];if(u!=null)switch(p){case`children`:c=u;break;case`dangerouslySetInnerHTML`:l=u;break;case`defaultValue`:case`value`:break;default:w(e,a,p,u)}}return e.push(`>`),T(e,l,c),c;case`option`:l=o.selectedValue,e.push(A(`option`));var d=u=null,f=null,p=null;for(c in i)if(r.call(i,c)){var m=i[c];if(m!=null)switch(c){case`children`:u=m;break;case`selected`:f=m;break;case`dangerouslySetInnerHTML`:p=m;break;case`value`:d=m;default:w(e,a,c,m)}}if(l!=null)if(i=d===null?E(u):``+d,y(l)){for(a=0;a<l.length;a++)if(``+l[a]===i){e.push(` selected=""`);break}}else ``+l===i&&e.push(` selected=""`);else f&&e.push(` selected=""`);return e.push(`>`),T(e,p,u),u;case`textarea`:for(u in e.push(A(`textarea`)),p=l=c=null,i)if(r.call(i,u)&&(d=i[u],d!=null))switch(u){case`children`:p=d;break;case`value`:c=d;break;case`defaultValue`:l=d;break;case`dangerouslySetInnerHTML`:throw Error(n(91));default:w(e,a,u,d)}if(c===null&&l!==null&&(c=l),e.push(`>`),p!=null){if(c!=null)throw Error(n(92));if(y(p)&&1<p.length)throw Error(n(93));c=``+p}return typeof c==`string`&&c[0]===`
|
||
`&&e.push(`
|
||
`),c!==null&&e.push(h(``+c)),null;case`input`:for(l in e.push(A(`input`)),d=p=u=c=null,i)if(r.call(i,l)&&(f=i[l],f!=null))switch(l){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(399,`input`));case`defaultChecked`:d=f;break;case`defaultValue`:u=f;break;case`checked`:p=f;break;case`value`:c=f;break;default:w(e,a,l,f)}return p===null?d!==null&&w(e,a,`checked`,d):w(e,a,`checked`,p),c===null?u!==null&&w(e,a,`value`,u):w(e,a,`value`,c),e.push(`/>`),null;case`menuitem`:for(var g in e.push(A(`menuitem`)),i)if(r.call(i,g)&&(c=i[g],c!=null))switch(g){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(400));default:w(e,a,g,c)}return e.push(`>`),null;case`title`:for(m in e.push(A(`title`)),c=null,i)if(r.call(i,m)&&(l=i[m],l!=null))switch(m){case`children`:c=l;break;case`dangerouslySetInnerHTML`:throw Error(n(434));default:w(e,a,m,l)}return e.push(`>`),c;case`listing`:case`pre`:for(d in e.push(A(t)),l=c=null,i)if(r.call(i,d)&&(u=i[d],u!=null))switch(d){case`children`:c=u;break;case`dangerouslySetInnerHTML`:l=u;break;default:w(e,a,d,u)}if(e.push(`>`),l!=null){if(c!=null)throw Error(n(60));if(typeof l!=`object`||!(`__html`in l))throw Error(n(61));i=l.__html,i!=null&&(typeof i==`string`&&0<i.length&&i[0]===`
|
||
`?e.push(`
|
||
`,i):e.push(``+i))}return typeof c==`string`&&c[0]===`
|
||
`&&e.push(`
|
||
`),c;case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:for(var _ in e.push(A(t)),i)if(r.call(i,_)&&(c=i[_],c!=null))switch(_){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(399,t));default:w(e,a,_,c)}return e.push(`/>`),null;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 D(e,i,t,a);case`html`:return o.insertionMode===0&&e.push(`<!DOCTYPE html>`),D(e,i,t,a);default:if(t.indexOf(`-`)===-1&&typeof i.is!=`string`)return D(e,i,t,a);for(f in e.push(A(t)),l=c=null,i)if(r.call(i,f)&&(u=i[f],u!=null))switch(f){case`children`:c=u;break;case`dangerouslySetInnerHTML`:l=u;break;case`style`:C(e,a,u);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:break;default:s(f)&&typeof u!=`function`&&typeof u!=`symbol`&&e.push(` `,f,`="`,h(u),`"`)}return e.push(`>`),T(e,l,c),c}}function ee(e,t,r){if(e.push(`<!--$?--><template id="`),r===null)throw Error(n(395));return e.push(r),e.push(`"></template>`)}function te(e,t,r,i){switch(r.insertionMode){case 0:case 1:return e.push(`<div hidden id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 2:return e.push(`<svg aria-hidden="true" style="display:none" id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 3:return e.push(`<math aria-hidden="true" style="display:none" id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 4:return e.push(`<table hidden id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 5:return e.push(`<table hidden><tbody id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 6:return e.push(`<table hidden><tr id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);case 7:return e.push(`<table hidden><colgroup id="`),e.push(t.segmentPrefix),t=i.toString(16),e.push(t),e.push(`">`);default:throw Error(n(397))}}function ne(e,t){switch(t.insertionMode){case 0:case 1:return e.push(`</div>`);case 2:return e.push(`</svg>`);case 3:return e.push(`</math>`);case 4:return e.push(`</table>`);case 5:return e.push(`</tbody></table>`);case 6:return e.push(`</tr></table>`);case 7:return e.push(`</colgroup></table>`);default:throw Error(n(397))}}var re=/[<\u2028\u2029]/g;function ie(e){return JSON.stringify(e).replace(re,function(e){switch(e){case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}function ae(e,t){return t=t===void 0?``:t,{bootstrapChunks:[],startInlineScript:`<script>`,placeholderPrefix:t+`P:`,segmentPrefix:t+`S:`,boundaryPrefix:t+`B:`,idPrefix:t,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,generateStaticMarkup:e}}function oe(e,t,n,r){return n.generateStaticMarkup?(e.push(h(t)),!1):(t===``?e=r:(r&&e.push(`<!-- -->`),e.push(h(t)),e=!0),e)}var se=Object.assign,ce=Symbol.for(`react.element`),le=Symbol.for(`react.portal`),ue=Symbol.for(`react.fragment`),de=Symbol.for(`react.strict_mode`),fe=Symbol.for(`react.profiler`),pe=Symbol.for(`react.provider`),me=Symbol.for(`react.context`),he=Symbol.for(`react.forward_ref`),ge=Symbol.for(`react.suspense`),_e=Symbol.for(`react.suspense_list`),ve=Symbol.for(`react.memo`),ye=Symbol.for(`react.lazy`),be=Symbol.for(`react.scope`),xe=Symbol.for(`react.debug_trace_mode`),Se=Symbol.for(`react.legacy_hidden`),Ce=Symbol.for(`react.default_value`),we=Symbol.iterator;function Te(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ue:return`Fragment`;case le:return`Portal`;case fe:return`Profiler`;case de:return`StrictMode`;case ge:return`Suspense`;case _e:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case me:return(e.displayName||`Context`)+`.Consumer`;case pe:return(e._context.displayName||`Context`)+`.Provider`;case he:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ve:return t=e.displayName||null,t===null?Te(e.type)||`Memo`:t;case ye:t=e._payload,e=e._init;try{return Te(e(t))}catch{}}return null}var Ee={};function De(e,t){if(e=e.contextTypes,!e)return Ee;var n={},r;for(r in e)n[r]=t[r];return n}var Oe=null;function ke(e,t){if(e!==t){e.context._currentValue2=e.parentValue,e=e.parent;var r=t.parent;if(e===null){if(r!==null)throw Error(n(401))}else{if(r===null)throw Error(n(401));ke(e,r)}t.context._currentValue2=t.value}}function Ae(e){e.context._currentValue2=e.parentValue,e=e.parent,e!==null&&Ae(e)}function je(e){var t=e.parent;t!==null&&je(t),e.context._currentValue2=e.value}function Me(e,t){if(e.context._currentValue2=e.parentValue,e=e.parent,e===null)throw Error(n(402));e.depth===t.depth?ke(e,t):Me(e,t)}function Ne(e,t){var r=t.parent;if(r===null)throw Error(n(402));e.depth===r.depth?ke(e,r):Ne(e,r),t.context._currentValue2=t.value}function Pe(e){var t=Oe;t!==e&&(t===null?je(e):e===null?Ae(t):t.depth===e.depth?ke(t,e):t.depth>e.depth?Me(t,e):Ne(t,e),Oe=e)}var Fe={isMounted:function(){return!1},enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function Ie(e,t,n,r){var i=e.state===void 0?null:e.state;e.updater=Fe,e.props=n,e.state=i;var a={queue:[],replace:!1};e._reactInternals=a;var o=t.contextType;if(e.context=typeof o==`object`&&o?o._currentValue2:r,o=t.getDerivedStateFromProps,typeof o==`function`&&(o=o(n,i),i=o==null?i:se({},i,o),e.state=i),typeof t.getDerivedStateFromProps!=`function`&&typeof e.getSnapshotBeforeUpdate!=`function`&&(typeof e.UNSAFE_componentWillMount==`function`||typeof e.componentWillMount==`function`))if(t=e.state,typeof e.componentWillMount==`function`&&e.componentWillMount(),typeof e.UNSAFE_componentWillMount==`function`&&e.UNSAFE_componentWillMount(),t!==e.state&&Fe.enqueueReplaceState(e,e.state,null),a.queue!==null&&0<a.queue.length)if(t=a.queue,o=a.replace,a.queue=null,a.replace=!1,o&&t.length===1)e.state=t[0];else{for(a=o?t[0]:e.state,i=!0,o=o?1:0;o<t.length;o++){var s=t[o];s=typeof s==`function`?s.call(e,a,n,r):s,s!=null&&(i?(i=!1,a=se({},a,s)):se(a,s))}e.state=a}else a.queue=null}var Le={id:1,overflow:``};function Re(e,t,n){var r=e.id;e=e.overflow;var i=32-ze(r)-1;r&=~(1<<i),n+=1;var a=32-ze(t)+i;if(30<a){var o=i-i%5;return a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,{id:1<<32-ze(t)+i|n<<i|r,overflow:a+e}}return{id:1<<a|n<<i|r,overflow:e}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}function Ue(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var We=typeof Object.is==`function`?Object.is:Ue,Ge=null,Ke=null,qe=null,Je=null,Ye=!1,Xe=!1,Ze=0,Qe=null,$e=0;function et(){if(Ge===null)throw Error(n(321));return Ge}function tt(){if(0<$e)throw Error(n(312));return{memoizedState:null,queue:null,next:null}}function nt(){return Je===null?qe===null?(Ye=!1,qe=Je=tt()):(Ye=!0,Je=qe):Je.next===null?(Ye=!1,Je=Je.next=tt()):(Ye=!0,Je=Je.next),Je}function rt(){Ke=Ge=null,Xe=!1,qe=null,$e=0,Je=Qe=null}function it(e,t){return typeof t==`function`?t(e):t}function at(e,t,n){if(Ge=et(),Je=nt(),Ye){var r=Je.queue;if(t=r.dispatch,Qe!==null&&(n=Qe.get(r),n!==void 0)){Qe.delete(r),r=Je.memoizedState;do r=e(r,n.action),n=n.next;while(n!==null);return Je.memoizedState=r,[r,t]}return[Je.memoizedState,t]}return e=e===it?typeof t==`function`?t():t:n===void 0?t:n(t),Je.memoizedState=e,e=Je.queue={last:null,dispatch:null},e=e.dispatch=st.bind(null,Ge,e),[Je.memoizedState,e]}function ot(e,t){if(Ge=et(),Je=nt(),t=t===void 0?null:t,Je!==null){var n=Je.memoizedState;if(n!==null&&t!==null){var r=n[1];a:if(r===null)r=!1;else{for(var i=0;i<r.length&&i<t.length;i++)if(!We(t[i],r[i])){r=!1;break a}r=!0}if(r)return n[0]}}return e=e(),Je.memoizedState=[e,t],e}function st(e,t,r){if(25<=$e)throw Error(n(301));if(e===Ge)if(Xe=!0,e={action:r,next:null},Qe===null&&(Qe=new Map),r=Qe.get(t),r===void 0)Qe.set(t,e);else{for(t=r;t.next!==null;)t=t.next;t.next=e}}function ct(){throw Error(n(394))}function lt(){}var ut={readContext:function(e){return e._currentValue2},useContext:function(e){return et(),e._currentValue2},useMemo:ot,useReducer:at,useRef:function(e){Ge=et(),Je=nt();var t=Je.memoizedState;return t===null?(e={current:e},Je.memoizedState=e):t},useState:function(e){return at(it,e)},useInsertionEffect:lt,useLayoutEffect:function(){},useCallback:function(e,t){return ot(function(){return e},t)},useImperativeHandle:lt,useEffect:lt,useDebugValue:lt,useDeferredValue:function(e){return et(),e},useTransition:function(){return et(),[!1,ct]},useId:function(){var e=Ke.treeContext,t=e.overflow;e=e.id,e=(e&~(1<<32-ze(e)-1)).toString(32)+t;var r=dt;if(r===null)throw Error(n(404));return t=Ze++,e=`:`+r.idPrefix+`R`+e,0<t&&(e+=`H`+t.toString(32)),e+`:`},useMutableSource:function(e,t){return et(),t(e._source)},useSyncExternalStore:function(e,t,r){if(r===void 0)throw Error(n(407));return r()}},dt=null,ft=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function pt(e){return console.error(e),null}function mt(){}function ht(e,t,n,r,i,a,o,s,c){var l=[],u=new Set;return t={destination:null,responseState:t,progressiveChunkSize:r===void 0?12800:r,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:u,pingedTasks:l,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:i===void 0?pt:i,onAllReady:a===void 0?mt:a,onShellReady:o===void 0?mt:o,onShellError:s===void 0?mt:s,onFatalError:c===void 0?mt:c},n=_t(t,0,null,n,!1,!1),n.parentFlushed=!0,e=gt(t,e,null,n,u,Ee,null,Le),l.push(e),t}function gt(e,t,n,r,i,a,o,s){e.allPendingTasks++,n===null?e.pendingRootTasks++:n.pendingTasks++;var c={node:t,ping:function(){var t=e.pingedTasks;t.push(c),t.length===1&&jt(e)},blockedBoundary:n,blockedSegment:r,abortSet:i,legacyContext:a,context:o,treeContext:s};return i.add(c),c}function _t(e,t,n,r,i,a){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:r,boundary:n,lastPushedText:i,textEmbedded:a}}function vt(e,t){if(e=e.onError(t),e!=null&&typeof e!=`string`)throw Error(`onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "`+typeof e+`" instead`);return e}function yt(e,t){var n=e.onShellError;n(t),n=e.onFatalError,n(t),e.destination===null?(e.status=1,e.fatalError=t):(e.status=2,e.destination.destroy(t))}function bt(e,t,n,r,i){for(Ge={},Ke=t,Ze=0,e=n(r,i);Xe;)Xe=!1,Ze=0,$e+=1,Je=null,e=n(r,i);return rt(),e}function xt(e,t,r,i){var a=r.render(),o=i.childContextTypes;if(o!=null){var s=t.legacyContext;if(typeof r.getChildContext!=`function`)i=s;else{for(var c in r=r.getChildContext(),r)if(!(c in o))throw Error(n(108,Te(i)||`Unknown`,c));i=se({},s,r)}t.legacyContext=i,wt(e,t,a),t.legacyContext=s}else wt(e,t,a)}function St(e,t){if(e&&e.defaultProps){for(var n in t=se({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ct(e,t,r,i,a){if(typeof r==`function`)if(r.prototype&&r.prototype.isReactComponent){a=De(r,t.legacyContext);var o=r.contextType;o=new r(i,typeof o==`object`&&o?o._currentValue2:a),Ie(o,r,i,a),xt(e,t,o,r)}else{o=De(r,t.legacyContext),a=bt(e,t,r,i,o);var s=Ze!==0;if(typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0)Ie(a,r,i,o),xt(e,t,a,r);else if(s){i=t.treeContext,t.treeContext=Re(i,1,0);try{wt(e,t,a)}finally{t.treeContext=i}}else wt(e,t,a)}else if(typeof r==`string`){switch(a=t.blockedSegment,o=j(a.chunks,r,i,e.responseState,a.formatContext),a.lastPushedText=!1,s=a.formatContext,a.formatContext=x(s,r,i),Et(e,t,o),a.formatContext=s,r){case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`input`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:break;default:a.chunks.push(`</`,r,`>`)}a.lastPushedText=!1}else{switch(r){case Se:case xe:case de:case fe:case ue:wt(e,t,i.children);return;case _e:wt(e,t,i.children);return;case be:throw Error(n(343));case ge:a:{r=t.blockedBoundary,a=t.blockedSegment,o=i.fallback,i=i.children,s=new Set;var c={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:s,errorDigest:null},l=_t(e,a.chunks.length,c,a.formatContext,!1,!1);a.children.push(l),a.lastPushedText=!1;var u=_t(e,0,null,a.formatContext,!1,!1);u.parentFlushed=!0,t.blockedBoundary=c,t.blockedSegment=u;try{if(Et(e,t,i),e.responseState.generateStaticMarkup||u.lastPushedText&&u.textEmbedded&&u.chunks.push(`<!-- -->`),u.status=1,kt(c,u),c.pendingTasks===0)break a}catch(t){u.status=4,c.forceClientRender=!0,c.errorDigest=vt(e,t)}finally{t.blockedBoundary=r,t.blockedSegment=a}t=gt(e,o,r,l,s,t.legacyContext,t.context,t.treeContext),e.pingedTasks.push(t)}return}if(typeof r==`object`&&r)switch(r.$$typeof){case he:if(i=bt(e,t,r.render,i,a),Ze!==0){r=t.treeContext,t.treeContext=Re(r,1,0);try{wt(e,t,i)}finally{t.treeContext=r}}else wt(e,t,i);return;case ve:r=r.type,i=St(r,i),Ct(e,t,r,i,a);return;case pe:if(a=i.children,r=r._context,i=i.value,o=r._currentValue2,r._currentValue2=i,s=Oe,Oe=i={parent:s,depth:s===null?0:s.depth+1,context:r,parentValue:o,value:i},t.context=i,wt(e,t,a),e=Oe,e===null)throw Error(n(403));i=e.parentValue,e.context._currentValue2=i===Ce?e.context._defaultValue:i,e=Oe=e.parent,t.context=e;return;case me:i=i.children,i=i(r._currentValue2),wt(e,t,i);return;case ye:a=r._init,r=a(r._payload),i=St(r,i),Ct(e,t,r,i,void 0);return}throw Error(n(130,r==null?r:typeof r,``))}}function wt(e,t,r){if(t.node=r,typeof r==`object`&&r){switch(r.$$typeof){case ce:Ct(e,t,r.type,r.props,r.ref);return;case le:throw Error(n(257));case ye:var i=r._init;r=i(r._payload),wt(e,t,r);return}if(y(r)){Tt(e,t,r);return}if(typeof r!=`object`||!r?i=null:(i=we&&r[we]||r[`@@iterator`],i=typeof i==`function`?i:null),i&&=i.call(r)){if(r=i.next(),!r.done){var a=[];do a.push(r.value),r=i.next();while(!r.done);Tt(e,t,a)}return}throw e=Object.prototype.toString.call(r),Error(n(31,e===`[object Object]`?`object with keys {`+Object.keys(r).join(`, `)+`}`:e))}typeof r==`string`?(i=t.blockedSegment,i.lastPushedText=oe(t.blockedSegment.chunks,r,e.responseState,i.lastPushedText)):typeof r==`number`&&(i=t.blockedSegment,i.lastPushedText=oe(t.blockedSegment.chunks,``+r,e.responseState,i.lastPushedText))}function Tt(e,t,n){for(var r=n.length,i=0;i<r;i++){var a=t.treeContext;t.treeContext=Re(a,r,i);try{Et(e,t,n[i])}finally{t.treeContext=a}}}function Et(e,t,n){var r=t.blockedSegment.formatContext,i=t.legacyContext,a=t.context;try{return wt(e,t,n)}catch(c){if(rt(),typeof c==`object`&&c&&typeof c.then==`function`){n=c;var o=t.blockedSegment,s=_t(e,o.chunks.length,null,o.formatContext,o.lastPushedText,!0);o.children.push(s),o.lastPushedText=!1,e=gt(e,t.node,t.blockedBoundary,s,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,n.then(e,e),t.blockedSegment.formatContext=r,t.legacyContext=i,t.context=a,Pe(a)}else throw t.blockedSegment.formatContext=r,t.legacyContext=i,t.context=a,Pe(a),c}}function Dt(e){var t=e.blockedBoundary;e=e.blockedSegment,e.status=3,At(this,t,e)}function Ot(e,t,r){var i=e.blockedBoundary;e.blockedSegment.status=3,i===null?(t.allPendingTasks--,t.status!==2&&(t.status=2,t.destination!==null&&t.destination.push(null))):(i.pendingTasks--,i.forceClientRender||(i.forceClientRender=!0,e=r===void 0?Error(n(432)):r,i.errorDigest=t.onError(e),i.parentFlushed&&t.clientRenderedBoundaries.push(i)),i.fallbackAbortableTasks.forEach(function(e){return Ot(e,t,r)}),i.fallbackAbortableTasks.clear(),t.allPendingTasks--,t.allPendingTasks===0&&(i=t.onAllReady,i()))}function kt(e,t){if(t.chunks.length===0&&t.children.length===1&&t.children[0].boundary===null){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,n.status===1&&kt(e,n)}else e.completedSegments.push(t)}function At(e,t,r){if(t===null){if(r.parentFlushed){if(e.completedRootSegment!==null)throw Error(n(389));e.completedRootSegment=r}e.pendingRootTasks--,e.pendingRootTasks===0&&(e.onShellError=mt,t=e.onShellReady,t())}else t.pendingTasks--,t.forceClientRender||(t.pendingTasks===0?(r.parentFlushed&&r.status===1&&kt(t,r),t.parentFlushed&&e.completedBoundaries.push(t),t.fallbackAbortableTasks.forEach(Dt,e),t.fallbackAbortableTasks.clear()):r.parentFlushed&&r.status===1&&(kt(t,r),t.completedSegments.length===1&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--,e.allPendingTasks===0&&(e=e.onAllReady,e())}function jt(e){if(e.status!==2){var t=Oe,n=ft.current;ft.current=ut;var r=dt;dt=e.responseState;try{var i=e.pingedTasks,a;for(a=0;a<i.length;a++){var o=i[a],s=e,c=o.blockedSegment;if(c.status===0){Pe(o.context);try{wt(s,o,o.node),s.responseState.generateStaticMarkup||c.lastPushedText&&c.textEmbedded&&c.chunks.push(`<!-- -->`),o.abortSet.delete(o),c.status=1,At(s,o.blockedBoundary,c)}catch(e){if(rt(),typeof e==`object`&&e&&typeof e.then==`function`){var l=o.ping;e.then(l,l)}else{o.abortSet.delete(o),c.status=4;var u=o.blockedBoundary,d=e,f=vt(s,d);if(u===null?yt(s,d):(u.pendingTasks--,u.forceClientRender||(u.forceClientRender=!0,u.errorDigest=f,u.parentFlushed&&s.clientRenderedBoundaries.push(u))),s.allPendingTasks--,s.allPendingTasks===0){var p=s.onAllReady;p()}}}}}i.splice(0,a),e.destination!==null&&Lt(e,e.destination)}catch(t){vt(e,t),yt(e,t)}finally{dt=r,ft.current=n,n===ut&&Pe(t)}}}function Mt(e,t,r){switch(r.parentFlushed=!0,r.status){case 0:var i=r.id=e.nextSegmentId++;return r.lastPushedText=!1,r.textEmbedded=!1,e=e.responseState,t.push(`<template id="`),t.push(e.placeholderPrefix),e=i.toString(16),t.push(e),t.push(`"></template>`);case 1:r.status=2;var a=!0;i=r.chunks;var o=0;r=r.children;for(var s=0;s<r.length;s++){for(a=r[s];o<a.index;o++)t.push(i[o]);a=Nt(e,t,a)}for(;o<i.length-1;o++)t.push(i[o]);return o<i.length&&(a=t.push(i[o])),a;default:throw Error(n(390))}}function Nt(e,t,r){var i=r.boundary;if(i===null)return Mt(e,t,r);if(i.parentFlushed=!0,i.forceClientRender)return e.responseState.generateStaticMarkup||(i=i.errorDigest,t.push(`<!--$!-->`),t.push(`<template`),i&&(t.push(` data-dgst="`),i=h(i),t.push(i),t.push(`"`)),t.push(`></template>`)),Mt(e,t,r),e=e.responseState.generateStaticMarkup?!0:t.push(`<!--/$-->`),e;if(0<i.pendingTasks){i.rootSegmentID=e.nextSegmentId++,0<i.completedSegments.length&&e.partialBoundaries.push(i);var a=e.responseState,o=a.nextSuspenseID++;return a=a.boundaryPrefix+o.toString(16),i=i.id=a,ee(t,e.responseState,i),Mt(e,t,r),t.push(`<!--/$-->`)}if(i.byteSize>e.progressiveChunkSize)return i.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(i),ee(t,e.responseState,i.id),Mt(e,t,r),t.push(`<!--/$-->`);if(e.responseState.generateStaticMarkup||t.push(`<!--$-->`),r=i.completedSegments,r.length!==1)throw Error(n(391));return Nt(e,t,r[0]),e=e.responseState.generateStaticMarkup?!0:t.push(`<!--/$-->`),e}function Pt(e,t,n){return te(t,e.responseState,n.formatContext,n.id),Nt(e,t,n),ne(t,n.formatContext)}function Ft(e,t,r){for(var i=r.completedSegments,a=0;a<i.length;a++)It(e,t,r,i[a]);if(i.length=0,e=e.responseState,i=r.id,r=r.rootSegmentID,t.push(e.startInlineScript),e.sentCompleteBoundaryFunction?t.push(`$RC("`):(e.sentCompleteBoundaryFunction=!0,t.push(`function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("`)),i===null)throw Error(n(395));return r=r.toString(16),t.push(i),t.push(`","`),t.push(e.segmentPrefix),t.push(r),t.push(`")<\/script>`)}function It(e,t,r,i){if(i.status===2)return!0;var a=i.id;if(a===-1){if((i.id=r.rootSegmentID)===-1)throw Error(n(392));return Pt(e,t,i)}return Pt(e,t,i),e=e.responseState,t.push(e.startInlineScript),e.sentCompleteSegmentFunction?t.push(`$RS("`):(e.sentCompleteSegmentFunction=!0,t.push(`function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("`)),t.push(e.segmentPrefix),a=a.toString(16),t.push(a),t.push(`","`),t.push(e.placeholderPrefix),t.push(a),t.push(`")<\/script>`)}function Lt(e,t){try{var r=e.completedRootSegment;if(r!==null&&e.pendingRootTasks===0){Nt(e,t,r),e.completedRootSegment=null;var i=e.responseState.bootstrapChunks;for(r=0;r<i.length-1;r++)t.push(i[r]);r<i.length&&t.push(i[r])}var a=e.clientRenderedBoundaries,o;for(o=0;o<a.length;o++){var s=a[o];i=t;var c=e.responseState,l=s.id,u=s.errorDigest,d=s.errorMessage,f=s.errorComponentStack;if(i.push(c.startInlineScript),c.sentClientRenderFunction?i.push(`$RX("`):(c.sentClientRenderFunction=!0,i.push(`function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("`)),l===null)throw Error(n(395));if(i.push(l),i.push(`"`),u||d||f){i.push(`,`);var p=ie(u||``);i.push(p)}if(d||f){i.push(`,`);var m=ie(d||``);i.push(m)}if(f){i.push(`,`);var h=ie(f);i.push(h)}if(!i.push(`)<\/script>`)){e.destination=null,o++,a.splice(0,o);return}}a.splice(0,o);var g=e.completedBoundaries;for(o=0;o<g.length;o++)if(!Ft(e,t,g[o])){e.destination=null,o++,g.splice(0,o);return}g.splice(0,o);var _=e.partialBoundaries;for(o=0;o<_.length;o++){var v=_[o];a:{a=e,s=t;var y=v.completedSegments;for(c=0;c<y.length;c++)if(!It(a,s,v,y[c])){c++,y.splice(0,c);var b=!1;break a}y.splice(0,c),b=!0}if(!b){e.destination=null,o++,_.splice(0,o);return}}_.splice(0,o);var x=e.completedBoundaries;for(o=0;o<x.length;o++)if(!Ft(e,t,x[o])){e.destination=null,o++,x.splice(0,o);return}x.splice(0,o)}finally{e.allPendingTasks===0&&e.pingedTasks.length===0&&e.clientRenderedBoundaries.length===0&&e.completedBoundaries.length===0&&t.push(null)}}function Rt(e,t){try{var n=e.abortableTasks;n.forEach(function(n){return Ot(n,e,t)}),n.clear(),e.destination!==null&&Lt(e,e.destination)}catch(t){vt(e,t),yt(e,t)}}function zt(){}function Bt(e,t,r,i){var a=!1,o=null,s=``,c={push:function(e){return e!==null&&(s+=e),!0},destroy:function(e){a=!0,o=e}},l=!1;if(e=ht(e,ae(r,t?t.identifierPrefix:void 0),{insertionMode:1,selectedValue:null},1/0,zt,void 0,function(){l=!0},void 0,void 0),jt(e),Rt(e,i),e.status===1)e.status=2,c.destroy(e.fatalError);else if(e.status!==2&&e.destination===null){e.destination=c;try{Lt(e,c)}catch(t){vt(e,t),yt(e,t)}}if(a)throw o;if(!l)throw Error(n(426));return s}e.renderToNodeStream=function(){throw Error(n(207))},e.renderToStaticMarkup=function(e,t){return Bt(e,t,!0,`The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server`)},e.renderToStaticNodeStream=function(){throw Error(n(208))},e.renderToString=function(e,t){return Bt(e,t,!1,`The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server`)},e.version=`18.3.1`})),bD=s((e=>{var t=_();function n(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var r=null,i=0;function a(e,t){if(t.length!==0)if(512<t.length)0<i&&(e.enqueue(new Uint8Array(r.buffer,0,i)),r=new Uint8Array(512),i=0),e.enqueue(t);else{var n=r.length-i;n<t.length&&(n===0?e.enqueue(r):(r.set(t.subarray(0,n),i),e.enqueue(r),t=t.subarray(n)),r=new Uint8Array(512),i=0),r.set(t,i),i+=t.length}}function o(e,t){return a(e,t),!0}function s(e){r&&0<i&&(e.enqueue(new Uint8Array(r.buffer,0,i)),r=null,i=0)}var c=new TextEncoder;function l(e){return c.encode(e)}function u(e){return c.encode(e)}function d(e,t){typeof e.error==`function`?e.error(t):e.close()}var f=Object.prototype.hasOwnProperty,p=/^[: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]*$/,m={},h={};function g(e){return f.call(h,e)?!0:f.call(m,e)?!1:p.test(e)?h[e]=!0:(m[e]=!0,!1)}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,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(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[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(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});var S={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},C=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(S).forEach(function(e){C.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),S[t]=S[e]})});var w=/["'&<>]/;function T(e){if(typeof e==`boolean`||typeof e==`number`)return``+e;e=``+e;var t=w.exec(e);if(t){var n=``,r,i=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t=`"`;break;case 38:t=`&`;break;case 39:t=`'`;break;case 60:t=`<`;break;case 62:t=`>`;break;default:continue}i!==r&&(n+=e.substring(i,r)),i=r+1,n+=t}e=i===r?n:n+e.substring(i,r)}return e}var E=/([A-Z])/g,D=/^ms-/,O=Array.isArray,k=u(`<script>`),A=u(`<\/script>`),j=u(`<script src="`),ee=u(`<script type="module" src="`),te=u(`" async=""><\/script>`),ne=/(<\/|<)(s)(cript)/gi;function re(e,t,n,r){return``+t+(n===`s`?`\\u0073`:`\\u0053`)+r}function ie(e,t,n,r,i){e=e===void 0?``:e,t=t===void 0?k:u(`<script nonce="`+T(t)+`">`);var a=[];if(n!==void 0&&a.push(t,l((``+n).replace(ne,re)),A),r!==void 0)for(n=0;n<r.length;n++)a.push(j,l(T(r[n])),te);if(i!==void 0)for(r=0;r<i.length;r++)a.push(ee,l(T(i[r])),te);return{bootstrapChunks:a,startInlineScript:t,placeholderPrefix:u(e+`P:`),segmentPrefix:u(e+`S:`),boundaryPrefix:e+`B:`,idPrefix:e,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1}}function ae(e,t){return{insertionMode:e,selectedValue:t}}function oe(e){return ae(e===`http://www.w3.org/2000/svg`?2:e===`http://www.w3.org/1998/Math/MathML`?3:0,null)}function se(e,t,n){switch(t){case`select`:return ae(1,n.value==null?n.defaultValue:n.value);case`svg`:return ae(2,null);case`math`:return ae(3,null);case`foreignObject`:return ae(1,null);case`table`:return ae(4,null);case`thead`:case`tbody`:case`tfoot`:return ae(5,null);case`colgroup`:return ae(7,null);case`tr`:return ae(6,null)}return 4<=e.insertionMode||e.insertionMode===0?ae(1,null):e}var ce=u(`<!-- -->`);function le(e,t,n,r){return t===``?r:(r&&e.push(ce),e.push(l(T(t))),!0)}var ue=new Map,de=u(` style="`),fe=u(`:`),pe=u(`;`);function me(e,t,r){if(typeof r!=`object`)throw Error(n(62));for(var i in t=!0,r)if(f.call(r,i)){var a=r[i];if(a!=null&&typeof a!=`boolean`&&a!==``){if(i.indexOf(`--`)===0){var o=l(T(i));a=l(T((``+a).trim()))}else{o=i;var s=ue.get(o);s===void 0?(s=u(T(o.replace(E,`-$1`).toLowerCase().replace(D,`-ms-`))),ue.set(o,s),o=s):o=s,a=typeof a==`number`?a===0||f.call(S,i)?l(``+a):l(a+`px`):l(T((``+a).trim()))}t?(t=!1,e.push(de,o,fe,a)):e.push(pe,o,fe,a)}}t||e.push(_e)}var he=u(` `),ge=u(`="`),_e=u(`"`),ve=u(`=""`);function ye(e,t,n,r){switch(n){case`style`:me(e,t,r);return;case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`suppressContentEditableWarning`:case`suppressHydrationWarning`:return}if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`){if(t=y.hasOwnProperty(n)?y[n]:null,t!==null){switch(typeof r){case`function`:case`symbol`:return;case`boolean`:if(!t.acceptsBooleans)return}switch(n=l(t.attributeName),t.type){case 3:r&&e.push(he,n,ve);break;case 4:!0===r?e.push(he,n,ve):!1!==r&&e.push(he,n,ge,l(T(r)),_e);break;case 5:isNaN(r)||e.push(he,n,ge,l(T(r)),_e);break;case 6:!isNaN(r)&&1<=r&&e.push(he,n,ge,l(T(r)),_e);break;default:t.sanitizeURL&&(r=``+r),e.push(he,n,ge,l(T(r)),_e)}}else if(g(n)){switch(typeof r){case`function`:case`symbol`:return;case`boolean`:if(t=n.toLowerCase().slice(0,5),t!==`data-`&&t!==`aria-`)return}e.push(he,l(n),ge,l(T(r)),_e)}}}var be=u(`>`),xe=u(`/>`);function Se(e,t,r){if(t!=null){if(r!=null)throw Error(n(60));if(typeof t!=`object`||!(`__html`in t))throw Error(n(61));t=t.__html,t!=null&&e.push(l(``+t))}}function Ce(e){var n=``;return t.Children.forEach(e,function(e){e!=null&&(n+=e)}),n}var we=u(` selected=""`);function Te(e,t,n,r){e.push(ke(n));var i=n=null,a;for(a in t)if(f.call(t,a)){var o=t[a];if(o!=null)switch(a){case`children`:n=o;break;case`dangerouslySetInnerHTML`:i=o;break;default:ye(e,r,a,o)}}return e.push(be),Se(e,i,n),typeof n==`string`?(e.push(l(T(n))),null):n}var Ee=u(`
|
||
`),De=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Oe=new Map;function ke(e){var t=Oe.get(e);if(t===void 0){if(!De.test(e))throw Error(n(65,e));t=u(`<`+e),Oe.set(e,t)}return t}var Ae=u(`<!DOCTYPE html>`);function je(e,t,r,i,a){switch(t){case`select`:e.push(ke(`select`));var o=null,s=null;for(p in r)if(f.call(r,p)){var c=r[p];if(c!=null)switch(p){case`children`:o=c;break;case`dangerouslySetInnerHTML`:s=c;break;case`defaultValue`:case`value`:break;default:ye(e,i,p,c)}}return e.push(be),Se(e,s,o),o;case`option`:s=a.selectedValue,e.push(ke(`option`));var u=c=null,d=null,p=null;for(o in r)if(f.call(r,o)){var m=r[o];if(m!=null)switch(o){case`children`:c=m;break;case`selected`:d=m;break;case`dangerouslySetInnerHTML`:p=m;break;case`value`:u=m;default:ye(e,i,o,m)}}if(s!=null)if(r=u===null?Ce(c):``+u,O(s)){for(i=0;i<s.length;i++)if(``+s[i]===r){e.push(we);break}}else ``+s===r&&e.push(we);else d&&e.push(we);return e.push(be),Se(e,p,c),c;case`textarea`:for(c in e.push(ke(`textarea`)),p=s=o=null,r)if(f.call(r,c)&&(u=r[c],u!=null))switch(c){case`children`:p=u;break;case`value`:o=u;break;case`defaultValue`:s=u;break;case`dangerouslySetInnerHTML`:throw Error(n(91));default:ye(e,i,c,u)}if(o===null&&s!==null&&(o=s),e.push(be),p!=null){if(o!=null)throw Error(n(92));if(O(p)&&1<p.length)throw Error(n(93));o=``+p}return typeof o==`string`&&o[0]===`
|
||
`&&e.push(Ee),o!==null&&e.push(l(T(``+o))),null;case`input`:for(s in e.push(ke(`input`)),u=p=c=o=null,r)if(f.call(r,s)&&(d=r[s],d!=null))switch(s){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(399,`input`));case`defaultChecked`:u=d;break;case`defaultValue`:c=d;break;case`checked`:p=d;break;case`value`:o=d;break;default:ye(e,i,s,d)}return p===null?u!==null&&ye(e,i,`checked`,u):ye(e,i,`checked`,p),o===null?c!==null&&ye(e,i,`value`,c):ye(e,i,`value`,o),e.push(xe),null;case`menuitem`:for(var h in e.push(ke(`menuitem`)),r)if(f.call(r,h)&&(o=r[h],o!=null))switch(h){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(400));default:ye(e,i,h,o)}return e.push(be),null;case`title`:for(m in e.push(ke(`title`)),o=null,r)if(f.call(r,m)&&(s=r[m],s!=null))switch(m){case`children`:o=s;break;case`dangerouslySetInnerHTML`:throw Error(n(434));default:ye(e,i,m,s)}return e.push(be),o;case`listing`:case`pre`:for(u in e.push(ke(t)),s=o=null,r)if(f.call(r,u)&&(c=r[u],c!=null))switch(u){case`children`:o=c;break;case`dangerouslySetInnerHTML`:s=c;break;default:ye(e,i,u,c)}if(e.push(be),s!=null){if(o!=null)throw Error(n(60));if(typeof s!=`object`||!(`__html`in s))throw Error(n(61));r=s.__html,r!=null&&(typeof r==`string`&&0<r.length&&r[0]===`
|
||
`?e.push(Ee,l(r)):e.push(l(``+r)))}return typeof o==`string`&&o[0]===`
|
||
`&&e.push(Ee),o;case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:for(var _ in e.push(ke(t)),r)if(f.call(r,_)&&(o=r[_],o!=null))switch(_){case`children`:case`dangerouslySetInnerHTML`:throw Error(n(399,t));default:ye(e,i,_,o)}return e.push(xe),null;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 Te(e,r,t,i);case`html`:return a.insertionMode===0&&e.push(Ae),Te(e,r,t,i);default:if(t.indexOf(`-`)===-1&&typeof r.is!=`string`)return Te(e,r,t,i);for(d in e.push(ke(t)),s=o=null,r)if(f.call(r,d)&&(c=r[d],c!=null))switch(d){case`children`:o=c;break;case`dangerouslySetInnerHTML`:s=c;break;case`style`:me(e,i,c);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:break;default:g(d)&&typeof c!=`function`&&typeof c!=`symbol`&&e.push(he,l(d),ge,l(T(c)),_e)}return e.push(be),Se(e,s,o),o}}var Me=u(`</`),Ne=u(`>`),Pe=u(`<template id="`),Fe=u(`"></template>`),Ie=u(`<!--$-->`),Le=u(`<!--$?--><template id="`),Re=u(`"></template>`),ze=u(`<!--$!-->`),Be=u(`<!--/$-->`),Ve=u(`<template`),He=u(`"`),Ue=u(` data-dgst="`);u(` data-msg="`),u(` data-stck="`);var We=u(`></template>`);function Ge(e,t,r){if(a(e,Le),r===null)throw Error(n(395));return a(e,r),o(e,Re)}var Ke=u(`<div hidden id="`),qe=u(`">`),Je=u(`</div>`),Ye=u(`<svg aria-hidden="true" style="display:none" id="`),Xe=u(`">`),Ze=u(`</svg>`),Qe=u(`<math aria-hidden="true" style="display:none" id="`),$e=u(`">`),et=u(`</math>`),tt=u(`<table hidden id="`),nt=u(`">`),rt=u(`</table>`),it=u(`<table hidden><tbody id="`),at=u(`">`),ot=u(`</tbody></table>`),st=u(`<table hidden><tr id="`),ct=u(`">`),lt=u(`</tr></table>`),ut=u(`<table hidden><colgroup id="`),dt=u(`">`),ft=u(`</colgroup></table>`);function pt(e,t,r,i){switch(r.insertionMode){case 0:case 1:return a(e,Ke),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,qe);case 2:return a(e,Ye),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,Xe);case 3:return a(e,Qe),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,$e);case 4:return a(e,tt),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,nt);case 5:return a(e,it),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,at);case 6:return a(e,st),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,ct);case 7:return a(e,ut),a(e,t.segmentPrefix),a(e,l(i.toString(16))),o(e,dt);default:throw Error(n(397))}}function mt(e,t){switch(t.insertionMode){case 0:case 1:return o(e,Je);case 2:return o(e,Ze);case 3:return o(e,et);case 4:return o(e,rt);case 5:return o(e,ot);case 6:return o(e,lt);case 7:return o(e,ft);default:throw Error(n(397))}}var ht=u(`function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("`),gt=u(`$RS("`),_t=u(`","`),vt=u(`")<\/script>`),yt=u(`function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("`),bt=u(`$RC("`),xt=u(`","`),St=u(`")<\/script>`),Ct=u(`function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("`),wt=u(`$RX("`),Tt=u(`"`),Et=u(`)<\/script>`),Dt=u(`,`),Ot=/[<\u2028\u2029]/g;function kt(e){return JSON.stringify(e).replace(Ot,function(e){switch(e){case`<`:return`\\u003c`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`;default:throw Error(`escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React`)}})}var At=Object.assign,jt=Symbol.for(`react.element`),Mt=Symbol.for(`react.portal`),Nt=Symbol.for(`react.fragment`),Pt=Symbol.for(`react.strict_mode`),Ft=Symbol.for(`react.profiler`),It=Symbol.for(`react.provider`),Lt=Symbol.for(`react.context`),Rt=Symbol.for(`react.forward_ref`),zt=Symbol.for(`react.suspense`),Bt=Symbol.for(`react.suspense_list`),Vt=Symbol.for(`react.memo`),Ht=Symbol.for(`react.lazy`),Ut=Symbol.for(`react.scope`),Wt=Symbol.for(`react.debug_trace_mode`),Gt=Symbol.for(`react.legacy_hidden`),Kt=Symbol.for(`react.default_value`),qt=Symbol.iterator;function Jt(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case Nt:return`Fragment`;case Mt:return`Portal`;case Ft:return`Profiler`;case Pt:return`StrictMode`;case zt:return`Suspense`;case Bt:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case Lt:return(e.displayName||`Context`)+`.Consumer`;case It:return(e._context.displayName||`Context`)+`.Provider`;case Rt:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case Vt:return t=e.displayName||null,t===null?Jt(e.type)||`Memo`:t;case Ht:t=e._payload,e=e._init;try{return Jt(e(t))}catch{}}return null}var Yt={};function Xt(e,t){if(e=e.contextTypes,!e)return Yt;var n={},r;for(r in e)n[r]=t[r];return n}var Zt=null;function Qt(e,t){if(e!==t){e.context._currentValue=e.parentValue,e=e.parent;var r=t.parent;if(e===null){if(r!==null)throw Error(n(401))}else{if(r===null)throw Error(n(401));Qt(e,r)}t.context._currentValue=t.value}}function $t(e){e.context._currentValue=e.parentValue,e=e.parent,e!==null&&$t(e)}function en(e){var t=e.parent;t!==null&&en(t),e.context._currentValue=e.value}function tn(e,t){if(e.context._currentValue=e.parentValue,e=e.parent,e===null)throw Error(n(402));e.depth===t.depth?Qt(e,t):tn(e,t)}function nn(e,t){var r=t.parent;if(r===null)throw Error(n(402));e.depth===r.depth?Qt(e,r):nn(e,r),t.context._currentValue=t.value}function rn(e){var t=Zt;t!==e&&(t===null?en(e):e===null?$t(t):t.depth===e.depth?Qt(t,e):t.depth>e.depth?tn(t,e):nn(t,e),Zt=e)}var an={isMounted:function(){return!1},enqueueSetState:function(e,t){e=e._reactInternals,e.queue!==null&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals,e.replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function on(e,t,n,r){var i=e.state===void 0?null:e.state;e.updater=an,e.props=n,e.state=i;var a={queue:[],replace:!1};e._reactInternals=a;var o=t.contextType;if(e.context=typeof o==`object`&&o?o._currentValue:r,o=t.getDerivedStateFromProps,typeof o==`function`&&(o=o(n,i),i=o==null?i:At({},i,o),e.state=i),typeof t.getDerivedStateFromProps!=`function`&&typeof e.getSnapshotBeforeUpdate!=`function`&&(typeof e.UNSAFE_componentWillMount==`function`||typeof e.componentWillMount==`function`))if(t=e.state,typeof e.componentWillMount==`function`&&e.componentWillMount(),typeof e.UNSAFE_componentWillMount==`function`&&e.UNSAFE_componentWillMount(),t!==e.state&&an.enqueueReplaceState(e,e.state,null),a.queue!==null&&0<a.queue.length)if(t=a.queue,o=a.replace,a.queue=null,a.replace=!1,o&&t.length===1)e.state=t[0];else{for(a=o?t[0]:e.state,i=!0,o=o?1:0;o<t.length;o++){var s=t[o];s=typeof s==`function`?s.call(e,a,n,r):s,s!=null&&(i?(i=!1,a=At({},a,s)):At(a,s))}e.state=a}else a.queue=null}var sn={id:1,overflow:``};function cn(e,t,n){var r=e.id;e=e.overflow;var i=32-ln(r)-1;r&=~(1<<i),n+=1;var a=32-ln(t)+i;if(30<a){var o=i-i%5;return a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,{id:1<<32-ln(t)+i|n<<i|r,overflow:a+e}}return{id:1<<a|n<<i|r,overflow:e}}var ln=Math.clz32?Math.clz32:fn,un=Math.log,dn=Math.LN2;function fn(e){return e>>>=0,e===0?32:31-(un(e)/dn|0)|0}function pn(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var mn=typeof Object.is==`function`?Object.is:pn,hn=null,gn=null,_n=null,vn=null,yn=!1,bn=!1,xn=0,Sn=null,Cn=0;function wn(){if(hn===null)throw Error(n(321));return hn}function Tn(){if(0<Cn)throw Error(n(312));return{memoizedState:null,queue:null,next:null}}function En(){return vn===null?_n===null?(yn=!1,_n=vn=Tn()):(yn=!0,vn=_n):vn.next===null?(yn=!1,vn=vn.next=Tn()):(yn=!0,vn=vn.next),vn}function Dn(){gn=hn=null,bn=!1,_n=null,Cn=0,vn=Sn=null}function On(e,t){return typeof t==`function`?t(e):t}function kn(e,t,n){if(hn=wn(),vn=En(),yn){var r=vn.queue;if(t=r.dispatch,Sn!==null&&(n=Sn.get(r),n!==void 0)){Sn.delete(r),r=vn.memoizedState;do r=e(r,n.action),n=n.next;while(n!==null);return vn.memoizedState=r,[r,t]}return[vn.memoizedState,t]}return e=e===On?typeof t==`function`?t():t:n===void 0?t:n(t),vn.memoizedState=e,e=vn.queue={last:null,dispatch:null},e=e.dispatch=jn.bind(null,hn,e),[vn.memoizedState,e]}function An(e,t){if(hn=wn(),vn=En(),t=t===void 0?null:t,vn!==null){var n=vn.memoizedState;if(n!==null&&t!==null){var r=n[1];a:if(r===null)r=!1;else{for(var i=0;i<r.length&&i<t.length;i++)if(!mn(t[i],r[i])){r=!1;break a}r=!0}if(r)return n[0]}}return e=e(),vn.memoizedState=[e,t],e}function jn(e,t,r){if(25<=Cn)throw Error(n(301));if(e===hn)if(bn=!0,e={action:r,next:null},Sn===null&&(Sn=new Map),r=Sn.get(t),r===void 0)Sn.set(t,e);else{for(t=r;t.next!==null;)t=t.next;t.next=e}}function Mn(){throw Error(n(394))}function Nn(){}var Pn={readContext:function(e){return e._currentValue},useContext:function(e){return wn(),e._currentValue},useMemo:An,useReducer:kn,useRef:function(e){hn=wn(),vn=En();var t=vn.memoizedState;return t===null?(e={current:e},vn.memoizedState=e):t},useState:function(e){return kn(On,e)},useInsertionEffect:Nn,useLayoutEffect:function(){},useCallback:function(e,t){return An(function(){return e},t)},useImperativeHandle:Nn,useEffect:Nn,useDebugValue:Nn,useDeferredValue:function(e){return wn(),e},useTransition:function(){return wn(),[!1,Mn]},useId:function(){var e=gn.treeContext,t=e.overflow;e=e.id,e=(e&~(1<<32-ln(e)-1)).toString(32)+t;var r=Fn;if(r===null)throw Error(n(404));return t=xn++,e=`:`+r.idPrefix+`R`+e,0<t&&(e+=`H`+t.toString(32)),e+`:`},useMutableSource:function(e,t){return wn(),t(e._source)},useSyncExternalStore:function(e,t,r){if(r===void 0)throw Error(n(407));return r()}},Fn=null,In=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function Ln(e){return console.error(e),null}function Rn(){}function zn(e,t,n,r,i,a,o,s,c){var l=[],u=new Set;return t={destination:null,responseState:t,progressiveChunkSize:r===void 0?12800:r,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:u,pingedTasks:l,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:i===void 0?Ln:i,onAllReady:a===void 0?Rn:a,onShellReady:o===void 0?Rn:o,onShellError:s===void 0?Rn:s,onFatalError:c===void 0?Rn:c},n=Vn(t,0,null,n,!1,!1),n.parentFlushed=!0,e=Bn(t,e,null,n,u,Yt,null,sn),l.push(e),t}function Bn(e,t,n,r,i,a,o,s){e.allPendingTasks++,n===null?e.pendingRootTasks++:n.pendingTasks++;var c={node:t,ping:function(){var t=e.pingedTasks;t.push(c),t.length===1&&tr(e)},blockedBoundary:n,blockedSegment:r,abortSet:i,legacyContext:a,context:o,treeContext:s};return i.add(c),c}function Vn(e,t,n,r,i,a){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:r,boundary:n,lastPushedText:i,textEmbedded:a}}function Hn(e,t){if(e=e.onError(t),e!=null&&typeof e!=`string`)throw Error(`onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "`+typeof e+`" instead`);return e}function Un(e,t){var n=e.onShellError;n(t),n=e.onFatalError,n(t),e.destination===null?(e.status=1,e.fatalError=t):(e.status=2,d(e.destination,t))}function Wn(e,t,n,r,i){for(hn={},gn=t,xn=0,e=n(r,i);bn;)bn=!1,xn=0,Cn+=1,vn=null,e=n(r,i);return Dn(),e}function Gn(e,t,r,i){var a=r.render(),o=i.childContextTypes;if(o!=null){var s=t.legacyContext;if(typeof r.getChildContext!=`function`)i=s;else{for(var c in r=r.getChildContext(),r)if(!(c in o))throw Error(n(108,Jt(i)||`Unknown`,c));i=At({},s,r)}t.legacyContext=i,Jn(e,t,a),t.legacyContext=s}else Jn(e,t,a)}function Kn(e,t){if(e&&e.defaultProps){for(var n in t=At({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function qn(e,t,r,i,a){if(typeof r==`function`)if(r.prototype&&r.prototype.isReactComponent){a=Xt(r,t.legacyContext);var o=r.contextType;o=new r(i,typeof o==`object`&&o?o._currentValue:a),on(o,r,i,a),Gn(e,t,o,r)}else{o=Xt(r,t.legacyContext),a=Wn(e,t,r,i,o);var s=xn!==0;if(typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0)on(a,r,i,o),Gn(e,t,a,r);else if(s){i=t.treeContext,t.treeContext=cn(i,1,0);try{Jn(e,t,a)}finally{t.treeContext=i}}else Jn(e,t,a)}else if(typeof r==`string`){switch(a=t.blockedSegment,o=je(a.chunks,r,i,e.responseState,a.formatContext),a.lastPushedText=!1,s=a.formatContext,a.formatContext=se(s,r,i),Xn(e,t,o),a.formatContext=s,r){case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`img`:case`input`:case`keygen`:case`link`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:break;default:a.chunks.push(Me,l(r),Ne)}a.lastPushedText=!1}else{switch(r){case Gt:case Wt:case Pt:case Ft:case Nt:Jn(e,t,i.children);return;case Bt:Jn(e,t,i.children);return;case Ut:throw Error(n(343));case zt:a:{r=t.blockedBoundary,a=t.blockedSegment,o=i.fallback,i=i.children,s=new Set;var c={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:s,errorDigest:null},u=Vn(e,a.chunks.length,c,a.formatContext,!1,!1);a.children.push(u),a.lastPushedText=!1;var d=Vn(e,0,null,a.formatContext,!1,!1);d.parentFlushed=!0,t.blockedBoundary=c,t.blockedSegment=d;try{if(Xn(e,t,i),d.lastPushedText&&d.textEmbedded&&d.chunks.push(ce),d.status=1,$n(c,d),c.pendingTasks===0)break a}catch(t){d.status=4,c.forceClientRender=!0,c.errorDigest=Hn(e,t)}finally{t.blockedBoundary=r,t.blockedSegment=a}t=Bn(e,o,r,u,s,t.legacyContext,t.context,t.treeContext),e.pingedTasks.push(t)}return}if(typeof r==`object`&&r)switch(r.$$typeof){case Rt:if(i=Wn(e,t,r.render,i,a),xn!==0){r=t.treeContext,t.treeContext=cn(r,1,0);try{Jn(e,t,i)}finally{t.treeContext=r}}else Jn(e,t,i);return;case Vt:r=r.type,i=Kn(r,i),qn(e,t,r,i,a);return;case It:if(a=i.children,r=r._context,i=i.value,o=r._currentValue,r._currentValue=i,s=Zt,Zt=i={parent:s,depth:s===null?0:s.depth+1,context:r,parentValue:o,value:i},t.context=i,Jn(e,t,a),e=Zt,e===null)throw Error(n(403));i=e.parentValue,e.context._currentValue=i===Kt?e.context._defaultValue:i,e=Zt=e.parent,t.context=e;return;case Lt:i=i.children,i=i(r._currentValue),Jn(e,t,i);return;case Ht:a=r._init,r=a(r._payload),i=Kn(r,i),qn(e,t,r,i,void 0);return}throw Error(n(130,r==null?r:typeof r,``))}}function Jn(e,t,r){if(t.node=r,typeof r==`object`&&r){switch(r.$$typeof){case jt:qn(e,t,r.type,r.props,r.ref);return;case Mt:throw Error(n(257));case Ht:var i=r._init;r=i(r._payload),Jn(e,t,r);return}if(O(r)){Yn(e,t,r);return}if(typeof r!=`object`||!r?i=null:(i=qt&&r[qt]||r[`@@iterator`],i=typeof i==`function`?i:null),i&&=i.call(r)){if(r=i.next(),!r.done){var a=[];do a.push(r.value),r=i.next();while(!r.done);Yn(e,t,a)}return}throw e=Object.prototype.toString.call(r),Error(n(31,e===`[object Object]`?`object with keys {`+Object.keys(r).join(`, `)+`}`:e))}typeof r==`string`?(i=t.blockedSegment,i.lastPushedText=le(t.blockedSegment.chunks,r,e.responseState,i.lastPushedText)):typeof r==`number`&&(i=t.blockedSegment,i.lastPushedText=le(t.blockedSegment.chunks,``+r,e.responseState,i.lastPushedText))}function Yn(e,t,n){for(var r=n.length,i=0;i<r;i++){var a=t.treeContext;t.treeContext=cn(a,r,i);try{Xn(e,t,n[i])}finally{t.treeContext=a}}}function Xn(e,t,n){var r=t.blockedSegment.formatContext,i=t.legacyContext,a=t.context;try{return Jn(e,t,n)}catch(c){if(Dn(),typeof c==`object`&&c&&typeof c.then==`function`){n=c;var o=t.blockedSegment,s=Vn(e,o.chunks.length,null,o.formatContext,o.lastPushedText,!0);o.children.push(s),o.lastPushedText=!1,e=Bn(e,t.node,t.blockedBoundary,s,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,n.then(e,e),t.blockedSegment.formatContext=r,t.legacyContext=i,t.context=a,rn(a)}else throw t.blockedSegment.formatContext=r,t.legacyContext=i,t.context=a,rn(a),c}}function Zn(e){var t=e.blockedBoundary;e=e.blockedSegment,e.status=3,er(this,t,e)}function Qn(e,t,r){var i=e.blockedBoundary;e.blockedSegment.status=3,i===null?(t.allPendingTasks--,t.status!==2&&(t.status=2,t.destination!==null&&t.destination.close())):(i.pendingTasks--,i.forceClientRender||(i.forceClientRender=!0,e=r===void 0?Error(n(432)):r,i.errorDigest=t.onError(e),i.parentFlushed&&t.clientRenderedBoundaries.push(i)),i.fallbackAbortableTasks.forEach(function(e){return Qn(e,t,r)}),i.fallbackAbortableTasks.clear(),t.allPendingTasks--,t.allPendingTasks===0&&(i=t.onAllReady,i()))}function $n(e,t){if(t.chunks.length===0&&t.children.length===1&&t.children[0].boundary===null){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,n.status===1&&$n(e,n)}else e.completedSegments.push(t)}function er(e,t,r){if(t===null){if(r.parentFlushed){if(e.completedRootSegment!==null)throw Error(n(389));e.completedRootSegment=r}e.pendingRootTasks--,e.pendingRootTasks===0&&(e.onShellError=Rn,t=e.onShellReady,t())}else t.pendingTasks--,t.forceClientRender||(t.pendingTasks===0?(r.parentFlushed&&r.status===1&&$n(t,r),t.parentFlushed&&e.completedBoundaries.push(t),t.fallbackAbortableTasks.forEach(Zn,e),t.fallbackAbortableTasks.clear()):r.parentFlushed&&r.status===1&&($n(t,r),t.completedSegments.length===1&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--,e.allPendingTasks===0&&(e=e.onAllReady,e())}function tr(e){if(e.status!==2){var t=Zt,n=In.current;In.current=Pn;var r=Fn;Fn=e.responseState;try{var i=e.pingedTasks,a;for(a=0;a<i.length;a++){var o=i[a],s=e,c=o.blockedSegment;if(c.status===0){rn(o.context);try{Jn(s,o,o.node),c.lastPushedText&&c.textEmbedded&&c.chunks.push(ce),o.abortSet.delete(o),c.status=1,er(s,o.blockedBoundary,c)}catch(e){if(Dn(),typeof e==`object`&&e&&typeof e.then==`function`){var l=o.ping;e.then(l,l)}else{o.abortSet.delete(o),c.status=4;var u=o.blockedBoundary,d=e,f=Hn(s,d);if(u===null?Un(s,d):(u.pendingTasks--,u.forceClientRender||(u.forceClientRender=!0,u.errorDigest=f,u.parentFlushed&&s.clientRenderedBoundaries.push(u))),s.allPendingTasks--,s.allPendingTasks===0){var p=s.onAllReady;p()}}}}}i.splice(0,a),e.destination!==null&&or(e,e.destination)}catch(t){Hn(e,t),Un(e,t)}finally{Fn=r,In.current=n,n===Pn&&rn(t)}}}function nr(e,t,r){switch(r.parentFlushed=!0,r.status){case 0:var i=r.id=e.nextSegmentId++;return r.lastPushedText=!1,r.textEmbedded=!1,e=e.responseState,a(t,Pe),a(t,e.placeholderPrefix),e=l(i.toString(16)),a(t,e),o(t,Fe);case 1:r.status=2;var s=!0;i=r.chunks;var c=0;r=r.children;for(var u=0;u<r.length;u++){for(s=r[u];c<s.index;c++)a(t,i[c]);s=rr(e,t,s)}for(;c<i.length-1;c++)a(t,i[c]);return c<i.length&&(s=o(t,i[c])),s;default:throw Error(n(390))}}function rr(e,t,r){var i=r.boundary;if(i===null)return nr(e,t,r);if(i.parentFlushed=!0,i.forceClientRender)i=i.errorDigest,o(t,ze),a(t,Ve),i&&(a(t,Ue),a(t,l(T(i))),a(t,He)),o(t,We),nr(e,t,r);else if(0<i.pendingTasks){i.rootSegmentID=e.nextSegmentId++,0<i.completedSegments.length&&e.partialBoundaries.push(i);var s=e.responseState,c=s.nextSuspenseID++;s=u(s.boundaryPrefix+c.toString(16)),i=i.id=s,Ge(t,e.responseState,i),nr(e,t,r)}else if(i.byteSize>e.progressiveChunkSize)i.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(i),Ge(t,e.responseState,i.id),nr(e,t,r);else{if(o(t,Ie),r=i.completedSegments,r.length!==1)throw Error(n(391));rr(e,t,r[0])}return o(t,Be)}function ir(e,t,n){return pt(t,e.responseState,n.formatContext,n.id),rr(e,t,n),mt(t,n.formatContext)}function ar(e,t,r){for(var i=r.completedSegments,s=0;s<i.length;s++)M(e,t,r,i[s]);if(i.length=0,e=e.responseState,i=r.id,r=r.rootSegmentID,a(t,e.startInlineScript),e.sentCompleteBoundaryFunction?a(t,bt):(e.sentCompleteBoundaryFunction=!0,a(t,yt)),i===null)throw Error(n(395));return r=l(r.toString(16)),a(t,i),a(t,xt),a(t,e.segmentPrefix),a(t,r),o(t,St)}function M(e,t,r,i){if(i.status===2)return!0;var s=i.id;if(s===-1){if((i.id=r.rootSegmentID)===-1)throw Error(n(392));return ir(e,t,i)}return ir(e,t,i),e=e.responseState,a(t,e.startInlineScript),e.sentCompleteSegmentFunction?a(t,gt):(e.sentCompleteSegmentFunction=!0,a(t,ht)),a(t,e.segmentPrefix),s=l(s.toString(16)),a(t,s),a(t,_t),a(t,e.placeholderPrefix),a(t,s),o(t,vt)}function or(e,t){r=new Uint8Array(512),i=0;try{var c=e.completedRootSegment;if(c!==null&&e.pendingRootTasks===0){rr(e,t,c),e.completedRootSegment=null;var u=e.responseState.bootstrapChunks;for(c=0;c<u.length-1;c++)a(t,u[c]);c<u.length&&o(t,u[c])}var d=e.clientRenderedBoundaries,f;for(f=0;f<d.length;f++){var p=d[f];u=t;var m=e.responseState,h=p.id,g=p.errorDigest,_=p.errorMessage,v=p.errorComponentStack;if(a(u,m.startInlineScript),m.sentClientRenderFunction?a(u,wt):(m.sentClientRenderFunction=!0,a(u,Ct)),h===null)throw Error(n(395));if(a(u,h),a(u,Tt),(g||_||v)&&(a(u,Dt),a(u,l(kt(g||``)))),(_||v)&&(a(u,Dt),a(u,l(kt(_||``)))),v&&(a(u,Dt),a(u,l(kt(v)))),!o(u,Et)){e.destination=null,f++,d.splice(0,f);return}}d.splice(0,f);var y=e.completedBoundaries;for(f=0;f<y.length;f++)if(!ar(e,t,y[f])){e.destination=null,f++,y.splice(0,f);return}y.splice(0,f),s(t),r=new Uint8Array(512),i=0;var b=e.partialBoundaries;for(f=0;f<b.length;f++){var x=b[f];a:{d=e,p=t;var S=x.completedSegments;for(m=0;m<S.length;m++)if(!M(d,p,x,S[m])){m++,S.splice(0,m);var C=!1;break a}S.splice(0,m),C=!0}if(!C){e.destination=null,f++,b.splice(0,f);return}}b.splice(0,f);var w=e.completedBoundaries;for(f=0;f<w.length;f++)if(!ar(e,t,w[f])){e.destination=null,f++,w.splice(0,f);return}w.splice(0,f)}finally{s(t),e.allPendingTasks===0&&e.pingedTasks.length===0&&e.clientRenderedBoundaries.length===0&&e.completedBoundaries.length===0&&t.close()}}function N(e,t){try{var n=e.abortableTasks;n.forEach(function(n){return Qn(n,e,t)}),n.clear(),e.destination!==null&&or(e,e.destination)}catch(t){Hn(e,t),Un(e,t)}}e.renderToReadableStream=function(e,t){return new Promise(function(n,r){var i,a,o=new Promise(function(e,t){a=e,i=t}),s=zn(e,ie(t?t.identifierPrefix:void 0,t?t.nonce:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),oe(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,a,function(){var e=new ReadableStream({type:`bytes`,pull:function(e){if(s.status===1)s.status=2,d(e,s.fatalError);else if(s.status!==2&&s.destination===null){s.destination=e;try{or(s,e)}catch(e){Hn(s,e),Un(s,e)}}},cancel:function(){N(s)}},{highWaterMark:0});e.allReady=o,n(e)},function(e){o.catch(function(){}),r(e)},i);if(t&&t.signal){var c=t.signal,l=function(){N(s,c.reason),c.removeEventListener(`abort`,l)};c.addEventListener(`abort`,l)}tr(s)})},e.version=`18.3.1`})),xD=s((e=>{var t=yD(),n=bD();e.version=t.version,e.renderToString=t.renderToString,e.renderToStaticMarkup=t.renderToStaticMarkup,e.renderToNodeStream=t.renderToNodeStream,e.renderToStaticNodeStream=t.renderToStaticNodeStream,e.renderToReadableStream=n.renderToReadableStream}))(),K=u(vD(),1),SD=K.default.oneOf([`top`,`right`,`bottom`,`left`,`bottom-left-aligned`,`bottom-middle-aligned`,`bottom-right-aligned`,`top-left-aligned`,`top-middle-aligned`,`top-right-aligned`,`auto`]),CD=K.default.oneOf([`top-middle`,`top-left`,`top-right`,`bottom-left`,`bottom-right`,`bottom-middle`,`middle-left`,`middle-right`,`middle-middle`]),wD=K.default.shape({nextLabel:K.default.string,prevLabel:K.default.string,skipLabel:K.default.string,doneLabel:K.default.string,hidePrev:K.default.bool,hideNext:K.default.bool,tooltipPosition:SD,tooltipClass:K.default.string,highlightClass:K.default.string,exitOnEsc:K.default.bool,exitOnOverlayClick:K.default.bool,showStepNumbers:K.default.bool,keyboardNavigation:K.default.bool,showButtons:K.default.bool,showBullets:K.default.bool,showProgress:K.default.bool,scrollToElement:K.default.bool,overlayOpacity:K.default.number,scrollPadding:K.default.number,positionPrecedence:K.default.arrayOf(K.default.string),disableInteraction:K.default.bool,hintPosition:CD,hintButtonLabel:K.default.string,hintAnimation:K.default.bool}),TD={hidePrev:!0,hideNext:!0};function ED(){return typeof window>`u`}var DD=class extends U.Component{static propTypes={enabled:K.default.bool,initialStep:K.default.number.isRequired,steps:K.default.arrayOf(K.default.shape({element:K.default.oneOfType([K.default.string,typeof Element>`u`?K.default.any:K.default.instanceOf(Element)]),intro:K.default.node.isRequired,position:SD,tooltipClass:K.default.string,highlightClass:K.default.string})).isRequired,onStart:K.default.func,onExit:K.default.func.isRequired,onBeforeExit:K.default.func,onBeforeChange:K.default.func,onAfterChange:K.default.func,onChange:K.default.func,onPreventChange:K.default.func,onComplete:K.default.func,options:wD};static defaultProps={enabled:!1,onStart:null,onBeforeExit:null,onBeforeChange:null,onAfterChange:null,onChange:null,onPreventChange:null,onComplete:null,options:TD};constructor(e){super(e),this.introJs=null,this.isConfigured=!1,this.isVisible=!1,this.installIntroJs()}componentDidMount(){this.props.enabled&&(this.configureIntroJs(),this.renderSteps())}componentDidUpdate(e){let{enabled:t,steps:n,options:r}=this.props;(!this.isConfigured||e.steps!==n||e.options!==r)&&(this.configureIntroJs(),this.renderSteps()),e.enabled!==t&&this.renderSteps()}componentWillUnmount(){this.introJs.exit()}onExit=()=>{let{onExit:e}=this.props;this.isVisible=!1,e(this.introJs._currentStep)};onBeforeExit=()=>{let{onBeforeExit:e}=this.props;return e?e(this.introJs._currentStep):!0};onBeforeChange=e=>{if(!this.isVisible)return!0;let{onBeforeChange:t,onPreventChange:n}=this.props;if(t){let r=t(this.introJs._currentStep,e);return r===!1&&n&&setTimeout(()=>{n(this.introJs._currentStep)},0),r}return!0};onAfterChange=e=>{if(!this.isVisible)return;let{onAfterChange:t}=this.props;t&&t(this.introJs._currentStep,e)};onChange=e=>{if(!this.isVisible)return;let{onChange:t}=this.props;t&&t(this.introJs._currentStep,e)};onComplete=()=>{let{onComplete:e}=this.props;e&&e()};updateStepElement=e=>{let t=document.querySelector(this.introJs._options.steps[e].element);t&&(this.introJs._introItems[e].element=t,this.introJs._introItems[e].position=this.introJs._options.steps[e].position||`auto`)};installIntroJs(){ED()||(this.introJs=hD(),this.introJs.onexit(this.onExit),this.introJs.onbeforeexit(this.onBeforeExit),this.introJs.onbeforechange(this.onBeforeChange),this.introJs.onafterchange(this.onAfterChange),this.introJs.onchange(this.onChange),this.introJs.oncomplete(this.onComplete))}configureIntroJs(){let{options:e,steps:t}=this.props,n=t.map(e=>(0,U.isValidElement)(e.intro)?{...e,intro:(0,xD.renderToStaticMarkup)(e.intro)}:e);this.introJs.setOptions({...e,steps:n}),this.isConfigured=!0}renderSteps(){let{enabled:e,initialStep:t,steps:n,onStart:r}=this.props;e&&n.length>0&&!this.isVisible?(this.introJs.start(),this.isVisible=!0,this.introJs.goToStepNumber(t+1),r&&r(this.introJs._currentStep)):!e&&this.isVisible&&(this.isVisible=!1,this.introJs.exit())}render(){return null}};(class extends U.Component{static propTypes={enabled:K.default.bool,hints:K.default.arrayOf(K.default.shape({element:K.default.string.isRequired,hint:K.default.string.isRequired,hintPosition:CD})).isRequired,onClick:K.default.func,onClose:K.default.func,options:wD};static defaultProps={enabled:!1,onClick:null,onClose:null,options:TD};constructor(e){super(e),this.introJs=null,this.isConfigured=!1,this.installIntroJs()}componentDidMount(){this.props.enabled&&(this.configureIntroJs(),this.renderHints())}componentDidUpdate(e){let{enabled:t,hints:n,options:r}=this.props;(!this.isConfigured||e.hints!==n||e.options!==r)&&(this.configureIntroJs(),this.renderHints()),e.enabled!==t&&this.renderHints()}componentWillUnmount(){this.introJs.hideHints()}installIntroJs(){if(ED())return;this.introJs=hD();let{onClick:e,onClose:t}=this.props;e&&this.introJs.onhintclick(e),t&&this.introJs.onhintclose(t)}configureIntroJs(){let{options:e,hints:t}=this.props;this.introJs.removeHints(),this.introJs.setOptions({...e,hints:t}),this.isConfigured=!0}renderHints(){let{enabled:e,hints:t}=this.props;e&&t.length>0?this.introJs.showHints():e||this.introJs.hideHints()}render(){return null}}),N();var OD=[{element:`.left-sidebar`,intro:M(`This is Thino's sidebar. Navigate to different path or select query filter.`)},{element:`.user-banner-container`,intro:M(`Click here and go to settings page.`)},{element:`.path-entry-wrapper`,intro:M(`Click here and go to different path.`)},{element:`.queries-wrapper`,intro:M(`Select or create query filter here.`)},{element:`.status-text-container.sidebar`,intro:M(`See the status of Thinos here.`)+M(`It is not available on small view`)},{element:`.heatmap-default`,intro:M(`See your time status of thinos here.`)},{element:`.tags-wrapper`,intro:M(`See your tags here. Tags will be shown when thino contains tags.`)},{element:`.section-header-container.memos-header-container`,intro:M(`Search your thino quickly here.`)},{element:`.memo-editor-wrapper`,intro:M(`Edit or create your thino here.`)},{element:`.memolist-wrapper`,intro:M(`See your thinos here.`)}],kD=[{element:`.memos-sidebar-wrapper.left-sidebar`,intro:M(`This is Thino's sidebar. Navigate to different path or select query filter.`)},{element:`.user-banner-container`,intro:M(`Click here and go to settings page.`)},{element:`.heatmap-default`,intro:M(`See your time status of thinos here.`)},{element:`.path-entry-wrapper`,intro:M(`Click here and go to different path.`)},{element:`.queries-wrapper`,intro:M(`Select or create query filter here.`)},{element:`.tags-wrapper`,intro:M(`See your tags here. Tags will be shown when thino contains tags.`)},{element:`.section-header-container.memos-header-container`,intro:M(`Search your thino quickly here.`)},{element:`.memo-editor-wrapper`,intro:M(`Edit or create your thino here.`)},{element:`.memolist-wrapper`,intro:M(`See your thinos here.`)}],AD={nextLabel:M(`Next`),prevLabel:M(`Previous`),doneLabel:M(`Done`),hideNext:!1};H(),Mv(),vi();var jD=(e,t)=>{(0,U.useEffect)(()=>{if(!e.needVerify){R.setLocked(!1);return}R.setLocked(!0)},[e?.needVerify]),(0,U.useEffect)(()=>{(async()=>{let e=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Dv():e?.identifier||e?.uuid;!t||t?.appId!==n?document.body.toggleClass(`hide-pro`,!0):document.body.toggleClass(`hide-pro`,!1)})()},[t])},MD=({settings:e,exited:t,isMobileView:n})=>{let r=(0,U.useRef)(null);return(0,W.jsx)(DD,{ref:r,enabled:t,steps:e?.DefaultThemeForThino===`modern`?OD:kD,initialStep:0,onExit:()=>{R.setExitSteps(!1)},options:AD,onBeforeChange:t=>{n&&(e?.DefaultThemeForThino===`classic`&&t===6||e?.DefaultThemeForThino===`modern`&&t===7)&&R.setShowSiderbarInMobileView(!1)}})},ND=({settings:e,pathname:t,isMobileView:n,memoListView:r,sectionRef:i})=>{let a=e?.DefaultThemeForThino===`modern`,o=`memos-${t===`/`?r:`list`}-view`,s=!a||n?`classic`:`modern`;return(0,W.jsxs)(`section`,{ref:i,id:`page-wrapper`,"data-path":t,className:u_(o,s),children:[(0,W.jsx)(aE,{sidebarPosition:`left`,className:`left-sidebar`}),(0,W.jsx)(`main`,{className:`content-wrapper`,children:eW(t)}),a&&!n&&(0,W.jsx)(aE,{sidebarPosition:`right`,className:`right-sidebar`})]})};function PD(){let{settings:e,verifyState:t}=I(),{pathname:n}=di(),{isMobileView:r,memoListView:i,globalEditorShown:a,locked:o,exited:s,loaded:c}=si(),l=(0,U.useRef)(null),u=e?.FirstLoaded||app.plugins.getPlugin(`obsidian-memos`).settings?.FirstLoaded;return jD(e,t),u?(0,W.jsx)(lE,{}):!c&&!o&&!a?(0,W.jsxs)(`section`,{className:`memos-list-view`,children:[(0,W.jsx)(aE,{sidebarPosition:`left`,className:`left-sidebar`}),(0,W.jsx)(`main`,{className:`content-wrapper`,children:(0,W.jsx)(oE,{rows:5})})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(MD,{settings:e,exited:s,isMobileView:r}),o&&(0,W.jsx)(sE,{}),!o&&a&&(0,W.jsx)(Aw,{editorType:`block`}),!o&&!a&&(0,W.jsx)(ND,{settings:e,pathname:n,isMobileView:r,memoListView:i,sectionRef:l})]})}var FD={"*":(0,W.jsx)(PD,{})};H(),N(),vi();var ID=()=>{},LD=(0,U.memo)(({memo:e,index:t})=>{let n=t<50,[r,i]=(0,U.useState)(n),a=(0,U.useRef)(),o=(0,U.useRef)(null);return(0,U.useEffect)(()=>{if(!(n||r)&&o.current)return a.current=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&i(!0)})},{root:document.querySelector(`.memolist-wrapper`),rootMargin:`300px`,threshold:0}),a.current.observe(o.current),()=>{a.current?.disconnect()}},[n,r]),n?(0,W.jsx)(gT,{memo:e}):(0,W.jsx)(`div`,{ref:o,className:`lazy-memo-container`,children:r?(0,W.jsx)(gT,{memo:e}):(0,W.jsx)(`div`,{className:`memo-skeleton`,style:{minHeight:`80px`}})})},(e,t)=>e.memo.id===t.memo.id&&e.memo.updatedAt===t.memo.updatedAt&&e.memo.content===t.memo.content);LD.displayName=`LazyMemo`;var RD=({dayMark:e,isCollapsed:t,onToggle:n,onJumpToRange:r})=>{let i=(0,U.useRef)(null);(0,U.useEffect)(()=>{!i.current||!f.setTooltip||(0,f.setTooltip)(i.current,M(`Click to expand or fold, Cmd+Click to show all thinos of the day`))},[e]);let a=(0,U.useCallback)(e=>{if(f.Keymap.isModifier(e.nativeEvent,`Mod`)){e.preventDefault(),r&&r();return}n()},[r,n]);return(0,W.jsx)(`div`,{ref:i,className:u_(`day-mark`,e===`PINNED`&&`PINNED`,t&&`folded`),onClick:a,children:(0,W.jsx)(`span`,{className:`day-mark-text`,children:`${t?`▸`:`▾`} ${e===`PINNED`?`${e} 📌`:e}`})})},zD=(0,U.memo)(({item:e,index:t})=>e.type===`daymark`?(0,W.jsx)(RD,{dayMark:e.dayMark??``,isCollapsed:!!e.collapsed,onToggle:e.toggleCollapse??ID,onJumpToRange:e.jumpToRange}):(0,W.jsx)(LD,{memo:e.memo,index:t}));zD.displayName=`ItemRenderer`;var BD=({memos:e,listView:t,className:n=``,showDayMark:r=!1,dayMarkRange:i=`day`,sortConfig:a})=>{let o=I(e=>e.settings?.hidePinnedGroup??!1),s=si(e=>e.collapsedGroups),c=si(e=>e.toggleCollapsedGroup),l=si(e=>e.setCollapsedGroup),u=(0,U.useMemo)(()=>new Set(s),[s]);(0,U.useEffect)(()=>{o&&!u.has(`PINNED`)?l(`PINNED`,!0):!o&&u.has(`PINNED`)&&l(`PINNED`,!1)},[o]);let d=(0,U.useCallback)(e=>{e&&c(e)},[c]),p=(0,U.useCallback)(e=>{if(!i||e===`PINNED`)return;let t={day:`YYYY-MM-DD`,week:`YYYY-[W]WW`,month:`YYYY-MM`,quarter:`YYYY-[Q]Q`,year:`YYYY`}[i],n=(0,f.moment)(e,t);n.isValid()&&z.setFromAndToQuery(n.startOf(i).valueOf(),n.endOf(i).valueOf())},[i]),m=e.length>100,h=(0,U.useDeferredValue)(e),g=m?h:e,{displayedItems:_,hasMore:v,loadingMore:y,sentinelRef:b}=nx({allItems:(0,U.useMemo)(()=>{let e=[];if(r&&i){let t=GV(g,i);Object.keys(t).sort((e,t)=>e===`PINNED`?-1:t===`PINNED`?1:a?.sortOrder===`desc`?t.localeCompare(e):e.localeCompare(t)).forEach(n=>{let r=u.has(n);e.push({type:`daymark`,dayMark:n,id:`dm-${n}`,collapsed:r,toggleCollapse:()=>d(n),jumpToRange:()=>p(n)}),!r&&(t[n]||[]).forEach(t=>{e.push({type:`memo`,memo:t,id:t.id})})})}else g.forEach(t=>{e.push({type:`memo`,memo:t,id:t.id})});return e},[g,r,i,a?.sortOrder,u,d,p]),initialCount:50,loadMoreCount:50,enabled:!0});return(0,W.jsxs)(`div`,{className:u_(`simple-list`,n),children:[_.map((e,t)=>(0,W.jsx)(zD,{item:e,index:t},e.id)),v&&(0,W.jsx)(`div`,{ref:b,className:`infinite-scroll-sentinel`,style:{height:`1px`,margin:`20px 0`},children:y&&(0,W.jsx)(`div`,{className:`loading-indicator`,style:{textAlign:`center`,padding:`20px`,opacity:.6},children:M(`Fetching data...`)})}),!v&&_.length>0&&(0,W.jsx)(`div`,{className:`completion-message`,style:{textAlign:`center`,padding:`20px`,opacity:.6},children:M(`All Data is Loaded 🎉`)}),!v&&_.length===0&&(0,W.jsx)(`div`,{className:`empty-state`,style:{textAlign:`center`,padding:`40px`,opacity:.6},children:M(`Noooop!`)})]})};function VD(e){"@babel/helpers - typeof";return VD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},VD(e)}function HD(e,t){if(VD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(VD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function UD(e){var t=HD(e,`string`);return VD(t)==`symbol`?t:t+``}function WD(e,t,n){return(t=UD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function KD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?GD(Object(n),!0).forEach(function(t){WD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qD(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function JD(e,t){if(e==null)return{};var n,r,i=qD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function YD(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function XD(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,UD(r.key),r)}}function ZD(e,t,n){return t&&XD(e.prototype,t),n&&XD(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function QD(e){return QD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},QD(e)}function $D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($D=function(){return!!e})()}function eO(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function tO(e,t){if(t&&(VD(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return eO(e)}function nO(e,t,n){return t=QD(t),tO(e,$D()?Reflect.construct(t,n||[],QD(e).constructor):t.apply(e,n))}function rO(e,t){return rO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rO(e,t)}function iO(e,t){if(typeof t!=`function`&&t!==null)throw 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&&rO(e,t)}function aO(e){if(Array.isArray(e))return e}function oO(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function sO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cO(e,t){if(e){if(typeof e==`string`)return sO(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sO(e,t):void 0}}function lO(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uO(e,t){return aO(e)||oO(e,t)||cO(e,t)||lO()}function dO(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=dO(e[t]))&&(r&&(r+=` `),r+=n);else for(t in e)e[t]&&(r&&(r+=` `),r+=t);return r}function fO(){for(var e,t,n=0,r=``;n<arguments.length;)(e=arguments[n++])&&(t=dO(e))&&(r&&(r+=` `),r+=t);return r}function pO(){return pO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pO.apply(null,arguments)}var mO=u(s(((e,t)=>{t.exports=function(e,t,n,r,i,a,o,s){if(!e){var c;if(t===void 0)c=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var l=[n,r,i,a,o,s],u=0;c=Error(t.replace(/%s/g,function(){return l[u++]})),c.name=`Invariant Violation`}throw c.framesToPop=1,c}}}))()),hO=function(){};function gO(e,t){var n={};return Object.keys(e).forEach(function(e){n[vO(e)]=hO}),n}function _O(e,t){return e[t]!==void 0}function vO(e){return`default`+e.charAt(0).toUpperCase()+e.substr(1)}function yO(e){return!!e&&(typeof e!=`function`||e.prototype&&e.prototype.isReactComponent)}function bO(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,rO(e,t)}function xO(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function SO(e){function t(t){return this.constructor.getDerivedStateFromProps(e,t)??null}this.setState(t.bind(this))}function CO(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}}xO.__suppressDeprecationWarning=!0,SO.__suppressDeprecationWarning=!0,CO.__suppressDeprecationWarning=!0;function wO(e){var t=e.prototype;if(!t||!t.isReactComponent)throw Error(`Can only polyfill class components`);if(typeof e.getDerivedStateFromProps!=`function`&&typeof t.getSnapshotBeforeUpdate!=`function`)return e;var n=null,r=null,i=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`?i=`componentWillUpdate`:typeof t.UNSAFE_componentWillUpdate==`function`&&(i=`UNSAFE_componentWillUpdate`),n!==null||r!==null||i!==null){var a=e.displayName||e.name,o=typeof e.getDerivedStateFromProps==`function`?`getDerivedStateFromProps()`:`getSnapshotBeforeUpdate()`;throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
||
|
||
`+a+` uses `+o+` but also contains the following legacy lifecycles:`+(n===null?``:`
|
||
`+n)+(r===null?``:`
|
||
`+r)+(i===null?``:`
|
||
`+i)+`
|
||
|
||
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=xO,t.componentWillReceiveProps=SO),typeof t.getSnapshotBeforeUpdate==`function`){if(typeof t.componentDidUpdate!=`function`)throw Error(`Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype`);t.componentWillUpdate=CO;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}return e}var TO=`/Users/jquense/src/uncontrollable/src/uncontrollable.js`;function EO(e,t,n){n===void 0&&(n=[]);var r=e.displayName||e.name||`Component`,i=yO(e),a=Object.keys(t),o=a.map(vO);!(i||!n.length)&&(0,mO.default)(!1);var s=function(r){bO(i,r);function i(){for(var e,i=arguments.length,o=Array(i),s=0;s<i;s++)o[s]=arguments[s];e=r.call.apply(r,[this].concat(o))||this,e.handlers=Object.create(null),a.forEach(function(n){var r=t[n],i=function(t){if(e.props[r]){var i;e._notifying=!0;for(var a=arguments.length,o=Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];(i=e.props)[r].apply(i,[t].concat(o)),e._notifying=!1}e.unmounted||e.setState(function(e){var r,i=e.values;return{values:pO(Object.create(null),i,(r={},r[n]=t,r))}})};e.handlers[r]=i}),n.length&&(e.attachRef=function(t){e.inner=t});var c=Object.create(null);return a.forEach(function(t){c[t]=e.props[vO(t)]}),e.state={values:c,prevProps:{}},e}var s=i.prototype;return s.shouldComponentUpdate=function(){return!this._notifying},i.getDerivedStateFromProps=function(e,t){var n=t.values,r=t.prevProps,i={values:pO(Object.create(null),n),prevProps:{}};return a.forEach(function(t){i.prevProps[t]=e[t],!_O(e,t)&&_O(r,t)&&(i.values[t]=e[vO(t)])}),i},s.componentWillUnmount=function(){this.unmounted=!0},s.render=function(){var t=this,n=this.props,r=n.innerRef,i=qD(n,[`innerRef`]);o.forEach(function(e){delete i[e]});var s={};return a.forEach(function(e){var n=t.props[e];s[e]=n===void 0?t.state.values[e]:n}),U.createElement(e,pO({},i,s,this.handlers,{ref:r||this.attachRef}))},i}(U.Component);wO(s),s.displayName=`Uncontrolled(`+r+`)`,s.propTypes=pO({innerRef:function(){}},gO(t,r)),n.forEach(function(e){s.prototype[e]=function(){var t;return(t=this.inner)[e].apply(t,arguments)}});var c=s;return U.forwardRef&&(c=U.forwardRef(function(e,t){return U.createElement(s,pO({},e,{innerRef:t,__source:{fileName:TO,lineNumber:128},__self:this}))}),c.propTypes=s.propTypes),c.ControlledComponent=e,c.deferControlTo=function(e,n,r){return n===void 0&&(n={}),EO(e,pO({},t,n),r)},c}var DO=c({add:()=>HO,century:()=>pk,date:()=>lk,day:()=>ck,decade:()=>fk,diff:()=>hk,endOf:()=>JO,eq:()=>YO,gt:()=>ZO,gte:()=>QO,hours:()=>sk,inRange:()=>rk,lt:()=>$O,lte:()=>ek,max:()=>nk,milliseconds:()=>ik,min:()=>tk,minutes:()=>ok,month:()=>uk,neq:()=>XO,seconds:()=>ak,startOf:()=>qO,subtract:()=>KO,weekday:()=>mk,year:()=>dk}),OO=`milliseconds`,kO=`seconds`,AO=`minutes`,jO=`hours`,MO=`day`,NO=`week`,PO=`month`,FO=`year`,IO=`decade`,LO=`century`,RO={milliseconds:1,seconds:1e3,minutes:60*1e3,hours:3600*1e3,day:1440*60*1e3,week:10080*60*1e3},zO={month:1,year:12,decade:120,century:1200};function BO(e){return[31,VO(e),31,30,31,30,31,31,30,31,30,31]}function VO(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 OO:case kO:case AO:case jO:case MO:case NO:return UO(e,t*RO[n]);case PO:case FO:case IO:case LO:return WO(e,t*zO[n])}throw TypeError(`Invalid units: "`+n+`"`)}function UO(e,t){return GO(e,new Date(+e+t))}function WO(e,t){var n=e.getFullYear(),r=e.getMonth(),i=e.getDate(),a=n*12+r+t,o=Math.trunc(a/12),s=a%12,c=Math.min(i,BO(o)[s]),l=new Date(e);return l.setFullYear(o),l.setDate(1),l.setMonth(s),l.setDate(c),l}function GO(e,t){var n=e.getTimezoneOffset(),r=t.getTimezoneOffset()-n;return new Date(+t+r*RO.minutes)}function KO(e,t,n){return HO(e,-t,n)}function qO(e,t,n){switch(e=new Date(e),t){case LO:case IO:case FO:e=uk(e,0);case PO:e=lk(e,1);case NO:case MO:e=sk(e,0);case jO:e=ok(e,0);case AO:e=ak(e,0);case kO:e=ik(e,0)}return t===IO&&(e=KO(e,dk(e)%10,`year`)),t===LO&&(e=KO(e,dk(e)%100,`year`)),t===NO&&(e=mk(e,0,n)),e}function JO(e,t,n){switch(e=new Date(e),e=qO(e,t,n),t){case LO:case IO:case FO:case PO:case NO:e=HO(e,1,t),e=KO(e,1,MO),e.setHours(23,59,59,999);break;case MO:e.setHours(23,59,59,999);break;case jO:case AO:case kO:e=HO(e,1,t),e=KO(e,1,OO)}return e}var YO=_k(function(e,t){return e===t}),XO=_k(function(e,t){return e!==t}),ZO=_k(function(e,t){return e>t}),QO=_k(function(e,t){return e>=t}),$O=_k(function(e,t){return e<t}),ek=_k(function(e,t){return e<=t});function tk(){return new Date(Math.min.apply(Math,arguments))}function nk(){return new Date(Math.max.apply(Math,arguments))}function rk(e,t,n,r){return r||=`day`,(!t||QO(e,t,r))&&(!n||ek(e,n,r))}var ik=gk(`Milliseconds`),ak=gk(`Seconds`),ok=gk(`Minutes`),sk=gk(`Hours`),ck=gk(`Day`),lk=gk(`Date`),uk=gk(`Month`),dk=gk(`FullYear`);function fk(e,t){return t===void 0?dk(qO(e,IO)):HO(e,t+10,FO)}function pk(e,t){return t===void 0?dk(qO(e,LO)):HO(e,t+100,FO)}function mk(e,t,n){var r=(ck(e)+7-(n||0))%7;return t===void 0?r:HO(e,t-r,MO)}function hk(e,t,n,r){var i,a,o;switch(n){case OO:case kO:case AO:case jO:case MO:case NO:i=t.getTime()-e.getTime();break;case PO:case FO:case IO:case LO:i=(dk(t)-dk(e))*12+uk(t)-uk(e);break;default:throw TypeError(`Invalid units: "`+n+`"`)}switch(n){case OO:a=1;break;case kO:a=1e3;break;case AO:a=1e3*60;break;case jO:a=1e3*60*60;break;case MO:a=1e3*60*60*24;break;case NO:a=1e3*60*60*24*7;break;case PO:a=1;break;case FO:a=12;break;case IO:a=120;break;case LO:a=1200;break;default:throw TypeError(`Invalid units: "`+n+`"`)}return o=i/a,r?o:Math.round(o)}function gk(e){var t=(function(e){switch(e){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 i=new Date(n);return i[`set`+e](r),t&&i[`get`+e]()!=r&&(e===`Hours`||r>=t&&i.getHours()-n.getHours()<Math.floor(r/t))&&i[`set`+e](r+t),i}}function _k(e){return function(t,n,r){return e(+qO(t,r),+qO(n,r))}}function vk(e){if(Array.isArray(e))return sO(e)}function yk(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function bk(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xk(e){return vk(e)||yk(e)||cO(e)||bk()}var Sk=s(((e,t)=>{function n(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=n})),Ck=s(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),wk=s(((e,t)=>{t.exports=typeof globalThis==`object`&&globalThis&&globalThis.Object===Object&&globalThis})),Tk=s(((e,t)=>{var n=wk(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),Ek=s(((e,t)=>{t.exports=Tk().Symbol})),Dk=s(((e,t)=>{var n=Ek(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),Ok=s(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),kk=s(((e,t)=>{var n=Ek(),r=Dk(),i=Ok(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),Ak=s(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),jk=s(((e,t)=>{var n=kk(),r=Ak(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),Mk=s(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),Nk=s(((e,t)=>{var n=jk(),r=Mk();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),Pk=s(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),Fk=s(((e,t)=>{var n=Ck(),r=Nk(),i=Pk(),a=Ak();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),Ik=s(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),Lk=s(((e,t)=>{var n=Ik(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),Rk=s(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),zk=s(((e,t)=>{var n=kk(),r=Rk(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),Bk=s(((e,t)=>{var n=Lk(),r=Ak(),i=zk(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),Vk=s(((e,t)=>{var n=Bk(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),Hk=s(((e,t)=>{var n=Vk();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),Uk=u(s(((e,t)=>{var n=Sk(),r=Fk(),i=Hk(),a=Math.ceil,o=Math.max;function s(e,t,s){t=(s?r(e,t,s):t===void 0)?1:o(i(t),0);var c=e==null?0:e.length;if(!c||t<1)return[];for(var l=0,u=0,d=Array(a(c/t));l<c;)d[u++]=n(e,l,l+=t);return d}t.exports=s}))());function Wk(e){return e&&e.ownerDocument||document}function Gk(e){var t=Wk(e);return t&&t.defaultView||window}function Kk(e,t){return Gk(e).getComputedStyle(e,t)}var qk=/([A-Z])/g;function Jk(e){return e.replace(qk,`-$1`).toLowerCase()}var Yk=/^ms-/;function Xk(e){return Jk(e).replace(Yk,`-ms-`)}var Zk=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function Qk(e){return!!(e&&Zk.test(e))}function $k(e,t){var n=``,r=``;if(typeof t==`string`)return e.style.getPropertyValue(Xk(t))||Kk(e).getPropertyValue(Xk(t));Object.keys(t).forEach(function(i){var a=t[i];!a&&a!==0?e.style.removeProperty(Xk(i)):Qk(i)?r+=i+`(`+a+`) `:n+=Xk(i)+`: `+a+`;`}),r&&(n+=`transform: `+r+`;`),e.style.cssText+=`;`+n}function eA(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}function tA(e){return`nodeType`in e&&e.nodeType===document.DOCUMENT_NODE}function nA(e){return`window`in e&&e.window===e?e:tA(e)&&e.defaultView||!1}function rA(e){var t=e===`pageXOffset`?`scrollLeft`:`scrollTop`;function n(n,r){var i=nA(n);if(r===void 0)return i?i[e]:n[t];i?i.scrollTo(i[e],r):n[t]=r}return n}var iA=rA(`pageXOffset`),aA=rA(`pageYOffset`);function oA(e){var t=Wk(e),n={top:0,left:0,height:0,width:0},r=t&&t.documentElement;return!r||!eA(r,e)?n:(e.getBoundingClientRect!==void 0&&(n=e.getBoundingClientRect()),n={top:n.top+aA(r)-(r.clientTop||0),left:n.left+iA(r)-(r.clientLeft||0),width:n.width,height:n.height},n)}var sA=function(e){return!!e&&`offsetParent`in e};function cA(e){for(var t=Wk(e),n=e&&e.offsetParent;sA(n)&&n.nodeName!==`HTML`&&$k(n,`position`)===`static`;)n=n.offsetParent;return n||t.documentElement}var lA=function(e){return e.nodeName&&e.nodeName.toLowerCase()};function uA(e,t){var n={top:0,left:0},r;if($k(e,`position`)===`fixed`)r=e.getBoundingClientRect();else{var i=t||cA(e);r=oA(e),lA(i)!==`html`&&(n=oA(i));var a=String($k(i,`borderTopWidth`)||0);n.top+=parseInt(a,10)-aA(i)||0;var o=String($k(i,`borderLeftWidth`)||0);n.left+=parseInt(o,10)-iA(i)||0}var s=String($k(e,`marginTop`)||0),c=String($k(e,`marginLeft`)||0);return pO({},r,{top:r.top-n.top-(parseInt(s,10)||0),left:r.left-n.left-(parseInt(c,10)||0)})}var dA=!!(typeof window<`u`&&window.document&&window.document.createElement),fA=new Date().getTime();function pA(e){var t=new Date().getTime(),n=Math.max(0,16-(t-fA)),r=setTimeout(e,n);return fA=t,r}var mA=[``,`webkit`,`moz`,`o`,`ms`],hA=`clearTimeout`,gA=pA,_A=function(e,t){return e+(e?t[0].toUpperCase()+t.substr(1):t)+`AnimationFrame`};dA&&mA.some(function(e){var t=_A(e,`request`);return t in window&&(hA=_A(e,`cancel`),gA=function(e){return window[t](e)}),!!gA});var vA=function(e){typeof window[hA]==`function`&&window[hA](e)},yA=gA,bA;function xA(e,t){if(!bA){var n=document.body,r=n.matches||n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;bA=function(e,t){return r.call(e,t)}}return bA(e,t)}var SA=Function.prototype.bind.call(Function.prototype.call,[].slice);function CA(e,t){return SA(e.querySelectorAll(t))}var wA=!1,TA=!1;try{var EA={get passive(){return wA=!0},get once(){return TA=wA=!0}};dA&&(window.addEventListener(`test`,EA,EA),window.removeEventListener(`test`,EA,!0))}catch{}function DA(e,t,n,r){if(r&&typeof r!=`boolean`&&!TA){var i=r.once,a=r.capture,o=n;!TA&&i&&(o=n.__once||function e(r){this.removeEventListener(t,e,a),n.call(this,r)},n.__once=o),e.addEventListener(t,o,wA?r:a)}e.addEventListener(t,n,r)}function OA(e){let t=(0,U.useRef)(e);return(0,U.useEffect)(()=>{t.current=e},[e]),t}function kA(e){let t=OA(e);return(0,U.useCallback)(function(...e){return t.current&&t.current(...e)},[t])}function AA(){return(0,U.useState)(null)}function jA(){let e=(0,U.useRef)(!0),t=(0,U.useRef)(()=>e.current);return(0,U.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function MA(e){let t=jA();return[e[0],(0,U.useCallback)(n=>{if(t())return e[1](n)},[t,e[1]])]}var NA=Ab({defaultModifiers:[db,gb,Iy,zy,mb,sb,yb,Ay]}),PA=function(e){return{position:e,top:`0`,left:`0`,opacity:`0`,pointerEvents:`none`}},FA={name:`applyStyles`,enabled:!1},IA={name:`ariaDescribedBy`,enabled:!0,phase:`afterWrite`,effect:function(e){var t=e.state;return function(){var e=t.elements,n=e.reference,r=e.popper;if(`removeAttribute`in n){var i=(n.getAttribute(`aria-describedby`)||``).split(`,`).filter(function(e){return e.trim()!==r.id});i.length?n.setAttribute(`aria-describedby`,i.join(`,`)):n.removeAttribute(`aria-describedby`)}}},fn:function(e){var t=e.state.elements,n=t.popper,r=t.reference,i=n.getAttribute(`role`)?.toLowerCase();if(n.id&&i===`tooltip`&&`setAttribute`in r){var a=r.getAttribute(`aria-describedby`);if(a&&a.split(`,`).indexOf(n.id)!==-1)return;r.setAttribute(`aria-describedby`,a?a+`,`+n.id:n.id)}}},LA=[];function RA(e,t,n){var r=n===void 0?{}:n,i=r.enabled,a=i===void 0?!0:i,o=r.placement,s=o===void 0?`bottom`:o,c=r.strategy,l=c===void 0?`absolute`:c,u=r.modifiers,d=u===void 0?LA:u,f=qD(r,[`enabled`,`placement`,`strategy`,`modifiers`]),p=(0,U.useRef)(),m=(0,U.useCallback)(function(){var e;(e=p.current)==null||e.update()},[]),h=(0,U.useCallback)(function(){var e;(e=p.current)==null||e.forceUpdate()},[]),g=MA((0,U.useState)({placement:s,update:m,forceUpdate:h,attributes:{},styles:{popper:PA(l),arrow:{}}})),_=g[0],v=g[1],y=(0,U.useMemo)(function(){return{name:`updateStateModifier`,enabled:!0,phase:`write`,requires:[`computeStyles`],fn:function(e){var t=e.state,n={},r={};Object.keys(t.elements).forEach(function(e){n[e]=t.styles[e],r[e]=t.attributes[e]}),v({state:t,styles:n,attributes:r,update:m,forceUpdate:h,placement:t.placement})}}},[m,h,v]);return(0,U.useEffect)(function(){!p.current||!a||p.current.setOptions({placement:s,strategy:l,modifiers:[].concat(d,[y,FA])})},[l,s,y,a]),(0,U.useEffect)(function(){if(!(!a||e==null||t==null))return p.current=NA(e,t,pO({},f,{placement:s,strategy:l,modifiers:[].concat(d,[IA,y])})),function(){p.current!=null&&(p.current.destroy(),p.current=void 0,v(function(e){return pO({},e,{attributes:{},styles:{popper:PA(l)}})}))}},[a,e,t]),_}function zA(e,t,n,r){var i=r&&typeof r!=`boolean`?r.capture:r;e.removeEventListener(t,n,i),n.__once&&e.removeEventListener(t,n.__once,i)}function BA(e,t,n,r){return DA(e,t,n,r),function(){zA(e,t,n,r)}}function VA(e){return e&&`setState`in e?Nb.findDOMNode(e):e??null}var HA=(function(e){return Wk(VA(e))}),UA=u(Lb()),WA=27,GA=function(){};function KA(e){return e.button===0}function qA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var JA=function(e){return e&&(`current`in e?e.current:e)};function YA(e,t,n){var r=n===void 0?{}:n,i=r.disabled,a=r.clickTrigger,o=a===void 0?`click`:a,s=(0,U.useRef)(!1),c=t||GA,l=(0,U.useCallback)(function(t){var n=JA(e);(0,UA.default)(!!n,`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`),s.current=!n||qA(t)||!KA(t)||!!eA(n,(t.composedPath==null?void 0:t.composedPath()[0])??t.target)},[e]),u=kA(function(e){s.current||c(e)}),d=kA(function(e){e.keyCode===WA&&c(e)});(0,U.useEffect)(function(){if(!(i||e==null)){var t=window.event,n=HA(JA(e)),r=BA(n,o,l,!0),a=BA(n,o,function(e){if(e===t){t=void 0;return}u(e)}),s=BA(n,`keyup`,function(e){if(e===t){t=void 0;return}d(e)}),c=[];return`ontouchstart`in n.documentElement&&(c=[].slice.call(n.body.children).map(function(e){return BA(e,`mousemove`,GA)})),function(){r(),a(),s(),c.forEach(function(e){return e()})}}},[e,i,o,l,u,d])}function XA(e){var t={};return Array.isArray(e)?(e?.forEach(function(e){t[e.name]=e}),t):e||t}function ZA(e){return e===void 0&&(e={}),Array.isArray(e)?e:Object.keys(e).map(function(t){return e[t].name=t,e[t]})}function QA(e){var t=e.enabled,n=e.enableEvents,r=e.placement,i=e.flip,a=e.offset,o=e.fixed,s=e.containerPadding,c=e.arrowElement,l=e.popperConfig,u=l===void 0?{}:l,d=XA(u.modifiers);return pO({},u,{placement:r,enabled:t,strategy:o?`fixed`:u.strategy,modifiers:ZA(pO({},d,{eventListeners:{enabled:n},preventOverflow:pO({},d.preventOverflow,{options:s?pO({padding:s},d.preventOverflow?.options):d.preventOverflow?.options}),offset:{options:pO({offset:a},d.offset?.options)},arrow:pO({},d.arrow,{enabled:!!c,options:pO({},d.arrow?.options,{element:c})}),flip:pO({enabled:!!i},d.flip)}))})}function $A(e,t){return e.classList?!!t&&e.classList.contains(t):(` `+(e.className.baseVal||e.className)+` `).indexOf(` `+t+` `)!==-1}function ej(e,t){e.classList?e.classList.add(t):$A(e,t)||(typeof e.className==`string`?e.className=e.className+` `+t:e.setAttribute(`class`,(e.className&&e.className.baseVal||``)+` `+t))}function tj(e,t){return e.replace(RegExp(`(^|\\s)`+t+`(?:\\s|$)`,`g`),`$1`).replace(/\s+/g,` `).replace(/^\s*|\s*$/g,``)}function nj(e,t){e.classList?e.classList.remove(t):typeof e.className==`string`?e.className=tj(e.className,t):e.setAttribute(`class`,tj(e.className&&e.className.baseVal||``,t))}var rj;function ij(e){if((!rj&&rj!==0||e)&&dA){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),rj=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return rj}var aj=function(e){var t;return typeof document>`u`?null:e==null?Wk().body:(typeof e==`function`&&(e=e()),e&&`current`in e&&(e=e.current),(t=e)!=null&&t.nodeType&&e||null)};function oj(e,t){var n=(0,U.useState)(function(){return aj(e)}),r=n[0],i=n[1];if(!r){var a=aj(e);a&&i(a)}return(0,U.useEffect)(function(){t&&r&&t(r)},[t,r]),(0,U.useEffect)(function(){var t=aj(e);t!==r&&i(t)},[e,r]),r}var sj=e=>!e||typeof e==`function`?e:t=>{e.current=t};function cj(e,t){let n=sj(e),r=sj(t);return e=>{n&&n(e),r&&r(e)}}function lj(e,t){return(0,U.useMemo)(()=>cj(e,t),[e,t])}var uj=U.forwardRef(function(e,t){var n=e.flip,r=e.offset,i=e.placement,a=e.containerPadding,o=a===void 0?5:a,s=e.popperConfig,c=s===void 0?{}:s,l=e.transition,u=AA(),d=u[0],f=u[1],p=AA(),m=p[0],h=p[1],g=lj(f,t),_=oj(e.container),v=oj(e.target),y=(0,U.useState)(!e.show),b=y[0],x=y[1],S=RA(v,d,QA({placement:i,enableEvents:!!e.show,containerPadding:o||5,flip:n,offset:r,arrowElement:m,popperConfig:c})),C=S.styles,w=S.attributes,T=qD(S,[`styles`,`attributes`]);e.show?b&&x(!1):!e.transition&&!b&&x(!0);var E=function(){x(!0),e.onExited&&e.onExited.apply(e,arguments)},D=e.show||l&&!b;if(YA(d,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!D)return null;var O=e.children(pO({},T,{show:!!e.show,props:pO({},w.popper,{style:C.popper,ref:g}),arrowProps:pO({},w.arrow,{style:C.arrow,ref:h})}));if(l){var k=e.onExit,A=e.onExiting,j=e.onEnter,ee=e.onEntering,te=e.onEntered;O=U.createElement(l,{in:e.show,appear:!0,onExit:k,onExiting:A,onExited:E,onEnter:j,onEntering:ee,onEntered:te},O)}return _?Nb.createPortal(O,_):null});uj.displayName=`Overlay`,uj.propTypes={show:K.default.bool,placement:K.default.oneOf(Yv),target:K.default.any,container:K.default.any,flip:K.default.bool,children:K.default.func.isRequired,containerPadding:K.default.number,popperConfig:K.default.object,rootClose:K.default.bool,rootCloseEvent:K.default.oneOf([`click`,`mousedown`]),rootCloseDisabled:K.default.bool,onHide:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(e.rootClose){var i;return(i=K.default.func).isRequired.apply(i,[e].concat(n))}return K.default.func.apply(K.default,[e].concat(n))},transition:K.default.elementType,onEnter:K.default.func,onEntering:K.default.func,onEntered:K.default.func,onExit:K.default.func,onExiting:K.default.func,onExited:K.default.func};var dj=s(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),fj=s(((e,t)=>{var n=Ck();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),pj=s(((e,t)=>{var n=fj(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),mj=s(((e,t)=>{var n=fj();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),hj=s(((e,t)=>{var n=fj();function r(e){return n(this.__data__,e)>-1}t.exports=r})),gj=s(((e,t)=>{var n=fj();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),_j=s(((e,t)=>{var n=dj(),r=pj(),i=mj(),a=hj(),o=gj();function s(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])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),vj=s(((e,t)=>{var n=_j();function r(){this.__data__=new n,this.size=0}t.exports=r})),yj=s(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),bj=s(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),xj=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Sj=s(((e,t)=>{t.exports=Tk()[`__core-js_shared__`]})),Cj=s(((e,t)=>{var n=Sj(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),wj=s(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Tj=s(((e,t)=>{var n=jk(),r=Cj(),i=Ak(),a=wj(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Ej=s(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),Dj=s(((e,t)=>{var n=Tj(),r=Ej();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Oj=s(((e,t)=>{t.exports=Dj()(Tk(),`Map`)})),kj=s(((e,t)=>{t.exports=Dj()(Object,`create`)})),Aj=s(((e,t)=>{var n=kj();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),jj=s(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=n})),Mj=s(((e,t)=>{var n=kj(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Nj=s(((e,t)=>{var n=kj(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Pj=s(((e,t)=>{var n=kj(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&t===void 0?r:t,this}t.exports=i})),Fj=s(((e,t)=>{var n=Aj(),r=jj(),i=Mj(),a=Nj(),o=Pj();function s(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])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Ij=s(((e,t)=>{var n=Fj(),r=_j(),i=Oj();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Lj=s(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Rj=s(((e,t)=>{var n=Lj();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),zj=s(((e,t)=>{var n=Rj();function r(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}t.exports=r})),Bj=s(((e,t)=>{var n=Rj();function r(e){return n(this,e).get(e)}t.exports=r})),Vj=s(((e,t)=>{var n=Rj();function r(e){return n(this,e).has(e)}t.exports=r})),Hj=s(((e,t)=>{var n=Rj();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),Uj=s(((e,t)=>{var n=Ij(),r=zj(),i=Bj(),a=Vj(),o=Hj();function s(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])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Wj=s(((e,t)=>{var n=_j(),r=Oj(),i=Uj(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),Gj=s(((e,t)=>{var n=_j(),r=vj(),i=yj(),a=bj(),o=xj(),s=Wj();function c(e){this.size=(this.__data__=new n(e)).size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),Kj=s(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),qj=s(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Jj=s(((e,t)=>{var n=Uj(),r=Kj(),i=qj();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),Yj=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),Xj=s(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),Zj=s(((e,t)=>{var n=Jj(),r=Yj(),i=Xj(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),Qj=s(((e,t)=>{t.exports=Tk().Uint8Array})),$j=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),eM=s(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),tM=s(((e,t)=>{var n=Ek(),r=Qj(),i=Ck(),a=Zj(),o=$j(),s=eM(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),nM=s(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),rM=s(((e,t)=>{t.exports=Array.isArray})),iM=s(((e,t)=>{var n=nM(),r=rM();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),aM=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),oM=s(((e,t)=>{function n(){return[]}t.exports=n})),sM=s(((e,t)=>{var n=aM(),r=oM(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),cM=s(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),lM=s(((e,t)=>{var n=kk(),r=Rk(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),uM=s(((e,t)=>{var n=lM(),r=Rk(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),dM=s(((e,t)=>{function n(){return!1}t.exports=n})),fM=s(((e,t)=>{var n=Tk(),r=dM(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),pM=s(((e,t)=>{var n=kk(),r=Mk(),i=Rk(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),mM=s(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),hM=s(((e,t)=>{var n=wk(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),gM=s(((e,t)=>{var n=pM(),r=mM(),i=hM(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),_M=s(((e,t)=>{var n=cM(),r=uM(),i=rM(),a=fM(),o=Pk(),s=gM(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),vM=s(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),yM=s(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),bM=s(((e,t)=>{t.exports=yM()(Object.keys,Object)})),xM=s(((e,t)=>{var n=vM(),r=bM(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),SM=s(((e,t)=>{var n=_M(),r=xM(),i=Nk();function a(e){return i(e)?n(e):r(e)}t.exports=a})),CM=s(((e,t)=>{var n=iM(),r=sM(),i=SM();function a(e){return n(e,i,r)}t.exports=a})),wM=s(((e,t)=>{var n=CM(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),TM=s(((e,t)=>{t.exports=Dj()(Tk(),`DataView`)})),EM=s(((e,t)=>{t.exports=Dj()(Tk(),`Promise`)})),DM=s(((e,t)=>{t.exports=Dj()(Tk(),`Set`)})),OM=s(((e,t)=>{t.exports=Dj()(Tk(),`WeakMap`)})),kM=s(((e,t)=>{var n=TM(),r=Oj(),i=EM(),a=DM(),o=OM(),s=kk(),c=wj(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),AM=s(((e,t)=>{var n=Gj(),r=Zj(),i=tM(),a=wM(),o=kM(),s=rM(),c=fM(),l=gM(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),jM=s(((e,t)=>{var n=AM(),r=Rk();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),MM=u(s(((e,t)=>{var n=jM();function r(e,t){return n(e,t)}t.exports=r}))());function NM(e,t){var n=nA(e);return n?n.innerHeight:t?e.clientHeight:oA(e).height}function PM(e,t,n){e.closest&&!n&&e.closest(t);var r=e;do{if(xA(r,t))return r;r=r.parentElement}while(r&&r!==n&&r.nodeType===document.ELEMENT_NODE);return null}var FM=s(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),IM=s(((e,t)=>{var n=Gj(),r=jM(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),LM=s(((e,t)=>{var n=Ak();function r(e){return e===e&&!n(e)}t.exports=r})),RM=s(((e,t)=>{var n=LM(),r=SM();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),zM=s(((e,t)=>{function n(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),BM=s(((e,t)=>{var n=IM(),r=RM(),i=zM();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),VM=s(((e,t)=>{var n=rM(),r=zk(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),HM=s(((e,t)=>{var n=Uj(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),UM=s(((e,t)=>{var n=HM(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),WM=s(((e,t)=>{var n=UM(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),GM=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),KM=s(((e,t)=>{var n=Ek(),r=GM(),i=rM(),a=zk(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),qM=s(((e,t)=>{var n=KM();function r(e){return e==null?``:n(e)}t.exports=r})),JM=s(((e,t)=>{var n=rM(),r=VM(),i=WM(),a=qM();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),YM=s(((e,t)=>{var n=zk(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),XM=s(((e,t)=>{var n=JM(),r=YM();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),ZM=s(((e,t)=>{var n=XM();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),QM=s(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),$M=s(((e,t)=>{var n=JM(),r=uM(),i=rM(),a=Pk(),o=Mk(),s=YM();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),eN=s(((e,t)=>{var n=QM(),r=$M();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),tN=s(((e,t)=>{var n=jM(),r=ZM(),i=eN(),a=VM(),o=LM(),s=zM(),c=YM(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),nN=s(((e,t)=>{function n(e){return e}t.exports=n})),rN=s(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),iN=s(((e,t)=>{var n=XM();function r(e){return function(t){return n(t,e)}}t.exports=r})),aN=s(((e,t)=>{var n=rN(),r=iN(),i=VM(),a=YM();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),oN=s(((e,t)=>{var n=BM(),r=tN(),i=nN(),a=rM(),o=aN();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),sN=s(((e,t)=>{var n=FM(),r=oN(),i=Hk(),a=Math.max;function o(e,t,o){var s=e==null?0:e.length;if(!s)return-1;var c=o==null?0:i(o);return c<0&&(c=a(s+c,0)),n(e,r(t,3),c)}t.exports=o})),cN=s(((e,t)=>{var n=Math.ceil,r=Math.max;function i(e,t,i,a){for(var o=-1,s=r(n((t-e)/(i||1)),0),c=Array(s);s--;)c[a?s:++o]=e,e+=i;return c}t.exports=i})),lN=s(((e,t)=>{var n=cN(),r=Fk(),i=Vk();function a(e){return function(t,a,o){return o&&typeof o!=`number`&&r(t,a,o)&&(a=o=void 0),t=i(t),a===void 0?(a=t,t=0):a=i(a),o=o===void 0?t<a?1:-1:i(o),n(t,a,o,e)}}t.exports=a})),uN=u(s(((e,t)=>{t.exports=lN()()}))()),dN=u(sN()),fN=Number.isNaN||function(e){return typeof e==`number`&&e!==e};function pN(e,t){return!!(e===t||fN(e)&&fN(t))}function mN(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!pN(e[n],t[n]))return!1;return!0}function hN(e,t){t===void 0&&(t=mN);var n=null;function r(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var a=e.apply(this,r);return n={lastResult:a,lastArgs:r,lastThis:this},a}return r.clear=function(){n=null},r}function gN(e,t){var n=nA(e);return n?n.innerWidth:t?e.clientWidth:oA(e).width}var _N=s(((e,t)=>{var n=Ek(),r=uM(),i=rM(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),vN=s(((e,t)=>{var n=nM(),r=_N();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),yN=s(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),bN=s(((e,t)=>{t.exports=yN()()})),xN=s(((e,t)=>{var n=bN(),r=SM();function i(e,t){return e&&n(e,t,r)}t.exports=i})),SN=s(((e,t)=>{var n=Nk();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),CN=s(((e,t)=>{var n=xN();t.exports=SN()(n)})),wN=s(((e,t)=>{var n=CN(),r=Nk();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),TN=s(((e,t)=>{function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=n})),EN=s(((e,t)=>{var n=zk();function r(e,t){if(e!==t){var r=e!==void 0,i=e===null,a=e===e,o=n(e),s=t!==void 0,c=t===null,l=t===t,u=n(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}t.exports=r})),DN=s(((e,t)=>{var n=EN();function r(e,t,r){for(var i=-1,a=e.criteria,o=t.criteria,s=a.length,c=r.length;++i<s;){var l=n(a[i],o[i]);if(l)return i>=c?l:l*(r[i]==`desc`?-1:1)}return e.index-t.index}t.exports=r})),ON=s(((e,t)=>{var n=GM(),r=XM(),i=oN(),a=wN(),o=TN(),s=mM(),c=DN(),l=nN(),u=rM();function d(e,t,d){t=t.length?n(t,function(e){return u(e)?function(t){return r(t,e.length===1?e[0]:e)}:e}):[l];var f=-1;return t=n(t,s(i)),o(a(e,function(e,r,i){return{criteria:n(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,d)})}t.exports=d})),kN=s(((e,t)=>{function n(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)}t.exports=n})),AN=s(((e,t)=>{var n=kN(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o<s;)c[o]=a[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=a[o];return l[t]=i(c),n(e,this,l)}}t.exports=i})),jN=s(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),MN=s(((e,t)=>{var n=Dj();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),NN=s(((e,t)=>{var n=jN(),r=MN(),i=nN();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),PN=s(((e,t)=>{var n=800,r=16,i=Date.now;function a(e){var t=0,a=0;return function(){var o=i(),s=r-(o-a);if(a=o,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=a})),FN=s(((e,t)=>{var n=NN();t.exports=PN()(n)})),IN=s(((e,t)=>{var n=nN(),r=AN(),i=FN();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),LN=u(s(((e,t)=>{var n=vN(),r=ON(),i=IN(),a=Fk();t.exports=i(function(e,t){if(e==null)return[];var i=t.length;return i>1&&a(e,t[0],t[1])?t=[]:i>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])})}))());function RN(e){return aO(e)||yk(e)||cO(e)||lO()}var zN=s(((e,t)=>{function n(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}t.exports=n})),BN=s(((e,t)=>{var n=Ak(),r=vM(),i=zN(),a=Object.prototype.hasOwnProperty;function o(e){if(!n(e))return i(e);var t=r(e),o=[];for(var s in e)s==`constructor`&&(t||!a.call(e,s))||o.push(s);return o}t.exports=o})),VN=s(((e,t)=>{var n=_M(),r=BN(),i=Nk();function a(e){return i(e)?n(e,!0):r(e)}t.exports=a})),HN=s(((e,t)=>{var n=IN(),r=Ck(),i=Fk(),a=VN(),o=Object.prototype,s=o.hasOwnProperty;t.exports=n(function(e,t){e=Object(e);var n=-1,c=t.length,l=c>2?t[2]:void 0;for(l&&i(t[0],t[1],l)&&(c=1);++n<c;)for(var u=t[n],d=a(u),f=-1,p=d.length;++f<p;){var m=d[f],h=e[m];(h===void 0||r(h,o[m])&&!s.call(e,m))&&(e[m]=u[m])}return e})})),UN=s(((e,t)=>{var n=MN();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),WN=s(((e,t)=>{var n=UN(),r=xN(),i=oN();function a(e,t){var a={};return t=i(t,3),r(e,function(e,r,i){n(a,r,t(e,r,i))}),a}t.exports=a})),GN=s(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}t.exports=n})),KN=s(((e,t)=>{var n=UN(),r=Ck(),i=Object.prototype.hasOwnProperty;function a(e,t,a){var o=e[t];(!(i.call(e,t)&&r(o,a))||a===void 0&&!(t in e))&&n(e,t,a)}t.exports=a})),qN=s(((e,t)=>{var n=KN(),r=UN();function i(e,t,i,a){var o=!i;i||={};for(var s=-1,c=t.length;++s<c;){var l=t[s],u=a?a(i[l],e[l],l,i,e):void 0;u===void 0&&(u=e[l]),o?r(i,l,u):n(i,l,u)}return i}t.exports=i})),JN=s(((e,t)=>{var n=qN(),r=SM();function i(e,t){return e&&n(t,r(t),e)}t.exports=i})),YN=s(((e,t)=>{var n=qN(),r=VN();function i(e,t){return e&&n(t,r(t),e)}t.exports=i})),XN=s(((e,t)=>{var n=Tk(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;function s(e,t){if(t)return e.slice();var n=e.length,r=o?o(n):new e.constructor(n);return e.copy(r),r}t.exports=s})),ZN=s(((e,t)=>{function n(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}t.exports=n})),QN=s(((e,t)=>{var n=qN(),r=sM();function i(e,t){return n(e,r(e),t)}t.exports=i})),$N=s(((e,t)=>{t.exports=yM()(Object.getPrototypeOf,Object)})),eP=s(((e,t)=>{var n=nM(),r=$N(),i=sM(),a=oM();t.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,i(e)),e=r(e);return t}:a})),tP=s(((e,t)=>{var n=qN(),r=eP();function i(e,t){return n(e,r(e),t)}t.exports=i})),nP=s(((e,t)=>{var n=iM(),r=eP(),i=VN();function a(e){return n(e,i,r)}t.exports=a})),rP=s(((e,t)=>{var n=Object.prototype.hasOwnProperty;function r(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]==`string`&&n.call(e,`index`)&&(r.index=e.index,r.input=e.input),r}t.exports=r})),iP=s(((e,t)=>{var n=Qj();function r(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}t.exports=r})),aP=s(((e,t)=>{var n=iP();function r(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}t.exports=r})),oP=s(((e,t)=>{var n=/\w*$/;function r(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}t.exports=r})),sP=s(((e,t)=>{var n=Ek(),r=n?n.prototype:void 0,i=r?r.valueOf:void 0;function a(e){return i?Object(i.call(e)):{}}t.exports=a})),cP=s(((e,t)=>{var n=iP();function r(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}t.exports=r})),lP=s(((e,t)=>{var n=iP(),r=aP(),i=oP(),a=sP(),o=cP(),s=`[object Boolean]`,c=`[object Date]`,l=`[object Map]`,u=`[object Number]`,d=`[object RegExp]`,f=`[object Set]`,p=`[object String]`,m=`[object Symbol]`,h=`[object ArrayBuffer]`,g=`[object DataView]`,_=`[object Float32Array]`,v=`[object Float64Array]`,y=`[object Int8Array]`,b=`[object Int16Array]`,x=`[object Int32Array]`,S=`[object Uint8Array]`,C=`[object Uint8ClampedArray]`,w=`[object Uint16Array]`,T=`[object Uint32Array]`;function E(e,t,E){var D=e.constructor;switch(t){case h:return n(e);case s:case c:return new D(+e);case g:return r(e,E);case _:case v:case y:case b:case x:case S:case C:case w:case T:return o(e,E);case l:return new D;case u:case p:return new D(e);case d:return i(e);case f:return new D;case m:return a(e)}}t.exports=E})),uP=s(((e,t)=>{var n=Ak(),r=Object.create;t.exports=function(){function e(){}return function(t){if(!n(t))return{};if(r)return r(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}()})),dP=s(((e,t)=>{var n=uP(),r=$N(),i=vM();function a(e){return typeof e.constructor==`function`&&!i(e)?n(r(e)):{}}t.exports=a})),fP=s(((e,t)=>{var n=kM(),r=Rk(),i=`[object Map]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),pP=s(((e,t)=>{var n=fP(),r=mM(),i=hM(),a=i&&i.isMap;t.exports=a?r(a):n})),mP=s(((e,t)=>{var n=kM(),r=Rk(),i=`[object Set]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),hP=s(((e,t)=>{var n=mP(),r=mM(),i=hM(),a=i&&i.isSet;t.exports=a?r(a):n})),gP=s(((e,t)=>{var n=Gj(),r=GN(),i=KN(),a=JN(),o=YN(),s=XN(),c=ZN(),l=QN(),u=tP(),d=CM(),f=nP(),p=kM(),m=rP(),h=lP(),g=dP(),_=rM(),v=fM(),y=pP(),b=Ak(),x=hP(),S=SM(),C=VN(),w=1,T=2,E=4,D=`[object Arguments]`,O=`[object Array]`,k=`[object Boolean]`,A=`[object Date]`,j=`[object Error]`,ee=`[object Function]`,te=`[object GeneratorFunction]`,ne=`[object Map]`,re=`[object Number]`,ie=`[object Object]`,ae=`[object RegExp]`,oe=`[object Set]`,se=`[object String]`,ce=`[object Symbol]`,le=`[object WeakMap]`,ue=`[object ArrayBuffer]`,de=`[object DataView]`,fe=`[object Float32Array]`,pe=`[object Float64Array]`,me=`[object Int8Array]`,he=`[object Int16Array]`,ge=`[object Int32Array]`,_e=`[object Uint8Array]`,ve=`[object Uint8ClampedArray]`,ye=`[object Uint16Array]`,be=`[object Uint32Array]`,xe={};xe[D]=xe[O]=xe[ue]=xe[de]=xe[k]=xe[A]=xe[fe]=xe[pe]=xe[me]=xe[he]=xe[ge]=xe[ne]=xe[re]=xe[ie]=xe[ae]=xe[oe]=xe[se]=xe[ce]=xe[_e]=xe[ve]=xe[ye]=xe[be]=!0,xe[j]=xe[ee]=xe[le]=!1;function Se(e,t,O,k,A,j){var ne,re=t&w,ae=t&T,oe=t&E;if(O&&(ne=A?O(e,k,A,j):O(e)),ne!==void 0)return ne;if(!b(e))return e;var se=_(e);if(se){if(ne=m(e),!re)return c(e,ne)}else{var ce=p(e),le=ce==ee||ce==te;if(v(e))return s(e,re);if(ce==ie||ce==D||le&&!A){if(ne=ae||le?{}:g(e),!re)return ae?u(e,o(ne,e)):l(e,a(ne,e))}else{if(!xe[ce])return A?e:{};ne=h(e,ce,re)}}j||=new n;var ue=j.get(e);if(ue)return ue;j.set(e,ne),x(e)?e.forEach(function(n){ne.add(Se(n,t,O,n,e,j))}):y(e)&&e.forEach(function(n,r){ne.set(r,Se(n,t,O,r,e,j))});var de=se?void 0:(oe?ae?f:d:ae?C:S)(e);return r(de||e,function(n,r){de&&(r=n,n=e[r]),i(ne,r,Se(n,t,O,r,e,j))}),ne}t.exports=Se})),_P=s(((e,t)=>{function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}t.exports=n})),vP=s(((e,t)=>{var n=XM(),r=Sk();function i(e,t){return t.length<2?e:n(e,r(t,0,-1))}t.exports=i})),yP=s(((e,t)=>{var n=JM(),r=_P(),i=vP(),a=YM();function o(e,t){return t=n(t,e),e=i(e,t),e==null||delete e[a(r(t))]}t.exports=o})),bP=s(((e,t)=>{var n=kk(),r=$N(),i=Rk(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),xP=s(((e,t)=>{var n=bP();function r(e){return n(e)?void 0:e}t.exports=r})),SP=s(((e,t)=>{var n=vN();function r(e){return e!=null&&e.length?n(e,1):[]}t.exports=r})),CP=s(((e,t)=>{var n=SP(),r=AN(),i=FN();function a(e){return i(r(e,void 0,n),e+``)}t.exports=a})),wP=s(((e,t)=>{var n=GM(),r=gP(),i=yP(),a=JM(),o=qN(),s=xP(),c=CP(),l=nP(),u=1,d=2,f=4;t.exports=c(function(e,t){var c={};if(e==null)return c;var p=!1;t=n(t,function(t){return t=a(t,e),p||=t.length>1,t}),o(e,l(e),c),p&&(c=r(c,u|d|f,s));for(var m=t.length;m--;)i(c,t[m]);return c})})),TP=s(((e,t)=>{var n=GN(),r=uP(),i=xN(),a=oN(),o=$N(),s=rM(),c=fM(),l=jk(),u=Ak(),d=gM();function f(e,t,f){var p=s(e),m=p||c(e)||d(e);if(t=a(t,4),f==null){var h=e&&e.constructor;f=m?p?new h:[]:u(e)&&l(h)?r(o(e)):{}}return(m?n:i)(e,function(e,n,r){return t(f,e,n,r)}),f}t.exports=f})),EP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isBetween=r()})(e,(function(){"use strict";return function(e,t,n){t.prototype.isBetween=function(e,t,r,i){var a=n(e),o=n(t),s=(i||=`()`)[0]===`(`,c=i[1]===`)`;return(s?this.isAfter(a,r):!this.isBefore(a,r))&&(c?this.isBefore(o,r):!this.isAfter(o,r))||(s?this.isBefore(a,r):!this.isAfter(a,r))&&(c?this.isAfter(o,r):!this.isBefore(o,r))}}}))})),DP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isSameOrAfter=r()})(e,(function(){"use strict";return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)}}}))})),OP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isSameOrBefore=r()})(e,(function(){"use strict";return function(e,t){t.prototype.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)}}}))})),kP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localeData=r()})(e,(function(){"use strict";return function(e,t,n){var r=t.prototype,i=function(e){return e&&(e.indexOf?e:e.s)},a=function(e,t,n,r,a){var o=e.name?e:e.$locale(),s=i(o[t]),c=i(o[n]),l=s||c.map((function(e){return e.slice(0,r)}));if(!a)return l;var u=o.weekStart;return l.map((function(e,t){return l[(t+(u||0))%7]}))},o=function(){return n.Ls[n.locale()]},s=function(e,t){return e.formats[t]||function(e){return e.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}(e.formats[t.toUpperCase()])},c=function(){var e=this;return{months:function(t){return t?t.format(`MMMM`):a(e,`months`)},monthsShort:function(t){return t?t.format(`MMM`):a(e,`monthsShort`,`months`,3)},firstDayOfWeek:function(){return e.$locale().weekStart||0},weekdays:function(t){return t?t.format(`dddd`):a(e,`weekdays`)},weekdaysMin:function(t){return t?t.format(`dd`):a(e,`weekdaysMin`,`weekdays`,2)},weekdaysShort:function(t){return t?t.format(`ddd`):a(e,`weekdaysShort`,`weekdays`,3)},longDateFormat:function(t){return s(e.$locale(),t)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return c.bind(this)()},n.localeData=function(){var e=o();return{firstDayOfWeek:function(){return e.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(t){return s(e,t)},meridiem:e.meridiem,ordinal:e.ordinal}},n.months=function(){return a(o(),`months`)},n.monthsShort=function(){return a(o(),`monthsShort`,`months`,3)},n.weekdays=function(e){return a(o(),`weekdays`,null,null,e)},n.weekdaysShort=function(e){return a(o(),`weekdaysShort`,`weekdays`,3,e)},n.weekdaysMin=function(e){return a(o(),`weekdaysMin`,`weekdays`,2,e)}}}))})),AP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localizedFormat=r()})(e,(function(){"use strict";var e={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(t,n,r){var i=n.prototype,a=i.format;r.en.formats=e,i.format=function(t){t===void 0&&(t=`YYYY-MM-DDTHH:mm:ssZ`);var n=this.$locale().formats,r=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,i){var a=i&&i.toUpperCase();return r||n[i]||e[i]||n[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,n===void 0?{}:n);return a.call(this,r)}}}))})),jP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_minMax=r()})(e,(function(){"use strict";return function(e,t,n){var r=function(e,t){if(!t||!t.length||t.length===1&&!t[0]||t.length===1&&Array.isArray(t[0])&&!t[0].length)return null;var n;t.length===1&&t[0].length>0&&(t=t[0]),n=(t=t.filter((function(e){return e})))[0];for(var r=1;r<t.length;r+=1)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n};n.max=function(){return r(`isAfter`,[].slice.call(arguments,0))},n.min=function(){return r(`isBefore`,[].slice.call(arguments,0))}}}))})),MP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(e,(function(){"use strict";var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),NP=s(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isLeapYear=r()})(e,(function(){"use strict";return function(e,t){t.prototype.isLeapYear=function(){return this.$y%4==0&&this.$y%100!=0||this.$y%400==0}}}))})),PP=u(HN()),FP=u(WN()),IP=u(wP()),LP=u(TP());EP(),DP(),OP(),kP(),AP(),jP(),MP(),NP();function RP(e){return e.children}var zP={PREVIOUS:`PREV`,NEXT:`NEXT`,TODAY:`TODAY`,DATE:`DATE`},BP={MONTH:`month`,WEEK:`week`,WORK_WEEK:`work_week`,DAY:`day`,AGENDA:`agenda`},VP=Object.keys(BP).map(function(e){return BP[e]});K.default.oneOfType([K.default.string,K.default.func]),K.default.any,K.default.func,K.default.oneOfType([K.default.arrayOf(K.default.oneOf(VP)),K.default.objectOf(function(e,t){if(VP.indexOf(t)!==-1&&typeof e[t]==`boolean`)return null;for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return K.default.elementType.apply(K.default,[e,t].concat(r))})]),K.default.oneOfType([K.default.oneOf([`overlap`,`no-overlap`]),K.default.func]);var HP={seconds:1e3,minutes:1e3*60,hours:1e3*60*60,day:1e3*60*60*24};function UP(e,t){return qO(qO(e,`month`),`week`,t.startOfWeek())}function WP(e,t){return JO(JO(e,`month`),`week`,t.startOfWeek())}function GP(e,t){for(var n=UP(e,t),r=WP(e,t),i=[];ek(n,r,`day`);)i.push(n),n=HO(n,1,`day`);return i}function KP(e,t){var n=qO(e,t);return YO(n,e)?n:HO(n,1,t)}function qP(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`day`,r=e,i=[];ek(r,t,n);)i.push(r),r=HO(r,1,n);return i}function JP(e,t){return t==null&&e==null?null:(t??=new Date,e??=new Date,e=qO(e,`day`),e=sk(e,sk(t)),e=ok(e,ok(t)),e=ak(e,ak(t)),ik(e,ik(t)))}function YP(e){return sk(e)===0&&ok(e)===0&&ak(e)===0&&ik(e)===0}function XP(e,t,n,r){return n===`day`&&(n=`date`),Math.abs(DO[n](e,void 0,r)-DO[n](t,void 0,r))}function ZP(e,t,n){return!n||n===`milliseconds`?Math.abs(e-+t):Math.round(Math.abs(+qO(e,n)/HP[n]-+qO(t,n)/HP[n]))}var QP=K.default.oneOfType([K.default.string,K.default.func]);function $P(e,t,n,r,i){var a=typeof r==`function`?r(n,i,e):t.call(e,n,r,i);return(0,mO.default)(a==null||typeof a==`string`,"`localizer format(..)` must return a string, null, or undefined"),a}function eF(e,t,n){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,t+n,0,0)}function tF(e,t){return e.getTimezoneOffset()-t.getTimezoneOffset()}function nF(e,t){return ZP(e,t,`minutes`)+tF(e,t)}function rF(e){var t=qO(e,`day`);return ZP(t,e,`minutes`)+tF(t,e)}function iF(e,t){return $O(e,t,`day`)}function aF(e,t,n){return YO(e,t,`minutes`)?QO(t,n,`minutes`):ZO(t,n,`minutes`)}function oF(e,t){return XP(e,t,`day`)}function sF(e){var t=e.evtA,n=t.start,r=t.end,i=t.allDay,a=e.evtB,o=a.start,s=a.end,c=a.allDay,l=qO(n,`day`)-+qO(o,`day`),u=oF(n,r),d=oF(o,s);return l||d-u||!!c-!!i||n-+o||r-+s}function cF(e){var t=e.event,n=t.start,r=t.end,i=e.range,a=i.start,o=i.end,s=qO(n,`day`),c=ek(s,o,`day`),l=XO(s,r,`minutes`)?ZO(r,a,`minutes`):QO(r,a,`minutes`);return c&&l}function lF(e,t){return YO(e,t,`day`)}function uF(e,t){return YP(e)&&YP(t)}var dF=ZD(function e(t){var n=this;YD(this,e),(0,mO.default)(typeof t.format==`function`,"date localizer `format(..)` must be a function"),(0,mO.default)(typeof t.firstOfWeek==`function`,"date localizer `firstOfWeek(..)` must be a function"),this.propType=t.propType||QP,this.formats=t.formats,this.format=function(){for(var e=arguments.length,r=Array(e),i=0;i<e;i++)r[i]=arguments[i];return $P.apply(void 0,[n,t.format].concat(r))},this.startOfWeek=t.firstOfWeek,this.merge=t.merge||JP,this.inRange=t.inRange||rk,this.lt=t.lt||$O,this.lte=t.lte||ek,this.gt=t.gt||ZO,this.gte=t.gte||QO,this.eq=t.eq||YO,this.neq=t.neq||XO,this.startOf=t.startOf||qO,this.endOf=t.endOf||JO,this.add=t.add||HO,this.range=t.range||qP,this.diff=t.diff||ZP,this.ceil=t.ceil||KP,this.min=t.min||tk,this.max=t.max||nk,this.minutes=t.minutes||ok,this.daySpan=t.daySpan||oF,this.firstVisibleDay=t.firstVisibleDay||UP,this.lastVisibleDay=t.lastVisibleDay||WP,this.visibleDays=t.visibleDays||GP,this.getSlotDate=t.getSlotDate||eF,this.getTimezoneOffset=t.getTimezoneOffset||function(e){return e.getTimezoneOffset()},this.getDstOffset=t.getDstOffset||tF,this.getTotalMin=t.getTotalMin||nF,this.getMinutesFromMidnight=t.getMinutesFromMidnight||rF,this.continuesPrior=t.continuesPrior||iF,this.continuesAfter=t.continuesAfter||aF,this.sortEvents=t.sortEvents||sF,this.inEventRange=t.inEventRange||cF,this.isSameDate=t.isSameDate||lF,this.startAndEndAreDateOnly=t.startAndEndAreDateOnly||uF,this.segmentOffset=t.browserTZOffset?t.browserTZOffset():0});function fF(e,t,n,r){var i=KD(KD({},e.formats),n);return KD(KD({},e),{},{messages:r,startOfWeek:function(){return e.startOfWeek(t)},format:function(n,r){return e.format(n,i[r]||r,t)}})}var pF=function(e){function t(){var e;YD(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=nO(this,t,[].concat(r)),e.navigate=function(t){e.props.onNavigate(t)},e.view=function(t){e.props.onView(t)},e}return iO(t,e),ZD(t,[{key:`render`,value:function(){var e=this.props,t=e.localizer.messages,n=e.label;return U.createElement(`div`,{className:`rbc-toolbar`},U.createElement(`span`,{className:`rbc-btn-group`},U.createElement(`button`,{type:`button`,onClick:this.navigate.bind(null,zP.TODAY)},t.today),U.createElement(`button`,{type:`button`,onClick:this.navigate.bind(null,zP.PREVIOUS)},t.previous),U.createElement(`button`,{type:`button`,onClick:this.navigate.bind(null,zP.NEXT)},t.next)),U.createElement(`span`,{className:`rbc-toolbar-label`},n),U.createElement(`span`,{className:`rbc-btn-group`},this.viewNamesGroup(t)))}},{key:`viewNamesGroup`,value:function(e){var t=this,n=this.props.views,r=this.props.view;if(n.length>1)return n.map(function(n){return U.createElement(`button`,{type:`button`,key:n,className:fO({"rbc-active":r===n}),onClick:t.view.bind(null,n)},e[n])})}}])}(U.Component);function mF(e,t){e&&e.apply(null,[].concat(t))}var hF={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(e){return`+${e} more`}};function gF(e){return KD(KD({},hF),e)}function _F(e){var t=e.ref,n=e.callback;(0,U.useEffect)(function(){var e=function(e){t.current&&!t.current.contains(e.target)&&n()};return document.addEventListener(`mousedown`,e),function(){document.removeEventListener(`mousedown`,e)}},[t,n])}var vF=[`style`,`className`,`event`,`selected`,`isAllDay`,`onSelect`,`onDoubleClick`,`onKeyPress`,`localizer`,`continuesPrior`,`continuesAfter`,`accessors`,`getters`,`children`,`components`,`slotStart`,`slotEnd`],yF=function(e){function t(){return YD(this,t),nO(this,t,arguments)}return iO(t,e),ZD(t,[{key:`render`,value:function(){var e=this.props,t=e.style,n=e.className,r=e.event,i=e.selected,a=e.isAllDay,o=e.onSelect,s=e.onDoubleClick,c=e.onKeyPress,l=e.localizer,u=e.continuesPrior,d=e.continuesAfter,f=e.accessors,p=e.getters,m=e.children,h=e.components,g=h.event,_=h.eventWrapper,v=e.slotStart,y=e.slotEnd,b=JD(e,vF);delete b.resizable;var x=f.title(r),S=f.tooltip(r),C=f.end(r),w=f.start(r),T=f.allDay(r),E=a||T||l.diff(w,l.ceil(C,`day`),`day`)>1,D=p.eventProp(r,w,C,i),O=U.createElement(`div`,{className:`rbc-event-content`,title:S||void 0},g?U.createElement(g,{event:r,continuesPrior:u,continuesAfter:d,title:x,isAllDay:T,localizer:l,slotStart:v,slotEnd:y}):x);return U.createElement(_,Object.assign({},this.props,{type:`date`}),U.createElement(`div`,Object.assign({},b,{style:KD(KD({},D.style),t),className:fO(`rbc-event`,n,D.className,{"rbc-selected":i,"rbc-event-allday":E,"rbc-event-continues-prior":u,"rbc-event-continues-after":d}),onClick:function(e){return o&&o(r,e)},onDoubleClick:function(e){return s&&s(r,e)},onKeyDown:function(e){return c&&c(r,e)}}),typeof m==`function`?m(O):O))}}])}(U.Component);function bF(e,t){return!e||t==null?!1:(0,MM.default)(e,t)}function xF(e,t){return(e.right-e.left)/t}function SF(e,t,n,r){var i=xF(e,r);return n?r-1-Math.floor((t-e.left)/i):Math.floor((t-e.left)/i)}function CF(e,t){var n=t.x,r=t.y;return r>=e.top&&r<=e.bottom&&n>=e.left&&n<=e.right}function wF(e,t,n,r,i){var a=-1,o=-1,s=r-1,c=xF(t,r),l=SF(t,n.x,i,r),u=t.top<n.y&&t.bottom>n.y,d=t.top<e.y&&t.bottom>e.y,f=e.y>t.bottom,p=t.top>e.y;return n.top<t.top&&n.bottom>t.bottom&&(a=0,o=s),u&&(p?(a=0,o=l):f&&(a=l,o=s)),d&&(a=o=i?s-Math.floor((e.x-t.left)/c):Math.floor((e.x-t.left)/c),u?l<a?a=l:o=l:e.y<n.y?o=s:a=0),{startIdx:a,endIdx:o}}function TF(e){var t=e.target,n=e.offset,r=e.container,i=e.box,a=oA(t),o=a.top,s=a.left,c=a.width,l=a.height,u=oA(r),d=u.top,f=u.left,p=u.width,m=u.height,h=oA(i),g=h.width,_=h.height,v=d+m,y=f+p,b=o+_,x=s+g,S=n.x,C=n.y;return{topOffset:b>v?o-_-C:o+C+l,leftOffset:x>y?s+S-g+c:s+S}}function EF(e){var t=e.containerRef,n=e.accessors,r=e.getters,i=e.selected,a=e.components,o=e.localizer,s=e.position,c=e.show,l=e.events,u=e.slotStart,d=e.slotEnd,f=e.onSelect,p=e.onDoubleClick,m=e.onKeyPress,h=e.handleDragStart,g=e.popperRef,_=e.target,v=e.offset;_F({ref:g,callback:c}),(0,U.useLayoutEffect)(function(){var e=TF({target:_,offset:v,container:t.current,box:g.current}),n=e.topOffset,r=e.leftOffset;g.current.style.top=`${n}px`,g.current.style.left=`${r}px`},[v.x,v.y,_]);var y=s.width,b={minWidth:y+y/2};return U.createElement(`div`,{style:b,className:`rbc-overlay`,ref:g},U.createElement(`div`,{className:`rbc-overlay-header`},o.format(u,`dayHeaderFormat`)),l.map(function(e,t){return U.createElement(yF,{key:t,type:`popup`,localizer:o,event:e,getters:r,onSelect:f,accessors:n,components:a,onDoubleClick:p,onKeyPress:m,continuesPrior:o.lt(n.end(e),u,`day`),continuesAfter:o.gte(n.start(e),d,`day`),slotStart:u,slotEnd:d,selected:bF(e,i),draggable:!0,onDragStart:function(){return h(e)},onDragEnd:function(){return c()}})}))}var DF=U.forwardRef(function(e,t){return U.createElement(EF,Object.assign({},e,{popperRef:t}))});DF.propTypes={accessors:K.default.object.isRequired,getters:K.default.object.isRequired,selected:K.default.object,components:K.default.object.isRequired,localizer:K.default.object.isRequired,position:K.default.object.isRequired,show:K.default.func.isRequired,events:K.default.array.isRequired,slotStart:K.default.instanceOf(Date).isRequired,slotEnd:K.default.instanceOf(Date),onSelect:K.default.func,onDoubleClick:K.default.func,onKeyPress:K.default.func,handleDragStart:K.default.func,style:K.default.object,offset:K.default.shape({x:K.default.number,y:K.default.number})};function OF(e){var t=e.containerRef,n=e.popupOffset,r=n===void 0?5:n,i=e.overlay,a=e.accessors,o=e.localizer,s=e.components,c=e.getters,l=e.selected,u=e.handleSelectEvent,d=e.handleDoubleClickEvent,f=e.handleKeyPressEvent,p=e.handleDragStart,m=e.onHide,h=e.overlayDisplay,g=(0,U.useRef)(null);if(!i.position)return null;var _=r;isNaN(r)||(_={x:r,y:r});var v=i.position,y=i.events,b=i.date,x=i.end;return U.createElement(uj,{rootClose:!0,flip:!0,show:!0,placement:`bottom`,onHide:m,target:i.target},function(e){var n=e.props;return U.createElement(DF,Object.assign({},n,{containerRef:t,ref:g,target:i.target,offset:_,accessors:a,getters:c,selected:l,components:s,localizer:o,position:v,show:h,events:y,slotStart:b,slotEnd:x,onSelect:u,onDoubleClick:d,onKeyPress:f,handleDragStart:p}))})}var kF=U.forwardRef(function(e,t){return U.createElement(OF,Object.assign({},e,{containerRef:t}))});kF.propTypes={popupOffset:K.default.oneOfType([K.default.number,K.default.shape({x:K.default.number,y:K.default.number})]),overlay:K.default.shape({position:K.default.object,events:K.default.array,date:K.default.instanceOf(Date),end:K.default.instanceOf(Date)}),accessors:K.default.object.isRequired,localizer:K.default.object.isRequired,components:K.default.object.isRequired,getters:K.default.object.isRequired,selected:K.default.object,handleSelectEvent:K.default.func,handleDoubleClickEvent:K.default.func,handleKeyPressEvent:K.default.func,handleDragStart:K.default.func,onHide:K.default.func,overlayDisplay:K.default.func};function AF(e,t){return BA(arguments.length>2&&arguments[2]!==void 0?arguments[2]:document,e,t,{passive:!1})}function jF(e,t,n){return!e||eA(e,document.elementFromPoint(t,n))}function MF(e,t){var n=t.clientX,r=t.clientY;return PM(document.elementFromPoint(n,r),`.rbc-event`,e)}function NF(e,t){var n=t.clientX,r=t.clientY;return PM(document.elementFromPoint(n,r),`.rbc-show-more`,e)}function PF(e,t){return!!MF(e,t)}function FF(e,t){return!!NF(e,t)}function IF(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 LF=5,RF=250,zF=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.global,i=r===void 0?!1:r,a=n.longPressThreshold,o=a===void 0?250:a,s=n.validContainers,c=s===void 0?[]:s;YD(this,e),this._initialEvent=null,this.selecting=!1,this.isDetached=!1,this.container=t,this.globalMouse=!t||i,this.longPressThreshold=o,this.validContainers=c,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=AF(`touchmove`,function(){},window),this._removeKeyDownListener=AF(`keydown`,this._keyListener),this._removeKeyUpListener=AF(`keyup`,this._keyListener),this._removeDropFromOutsideListener=AF(`drop`,this._dropFromOutsideListener),this._removeDragOverFromOutsideListener=AF(`dragover`,this._dragOverFromOutsideListener),this._addInitialEventListener()}return ZD(e,[{key:`on`,value:function(e,t){var n=this._listeners[e]||(this._listeners[e]=[]);return n.push(t),{remove:function(){var e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}},{key:`emit`,value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i;return(this._listeners[e]||[]).forEach(function(e){i===void 0&&(i=e.apply(void 0,n))}),i}},{key:`teardown`,value:function(){this._initialEvent=null,this._initialEventData=null,this._selectRect=null,this.selecting=!1,this._lastClickData=null,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(e){var t=this._selectRect;return!t||!this.selecting?!1:VF(t,HF(e))}},{key:`filter`,value:function(e){return!this._selectRect||!this.selecting?[]:e.filter(this.isSelected,this)}},{key:`_addLongPressListener`,value:function(e,t){var n=this,r=null,i=null,a=null,o=function(t){r=setTimeout(function(){c(),e(t)},n.longPressThreshold),i=AF(`touchmove`,function(){return c()}),a=AF(`touchend`,function(){return c()})},s=AF(`touchstart`,o),c=function(){r&&clearTimeout(r),i&&i(),a&&a(),r=null,i=null,a=null};return t&&o(t),function(){c(),s()}}},{key:`_addInitialEventListener`,value:function(){var e=this,t=AF(`mousedown`,function(t){e._removeInitialEventListener(),e._handleInitialEvent(t),e._removeInitialEventListener=AF(`mousedown`,e._handleInitialEvent)}),n=AF(`touchstart`,function(t){e._removeInitialEventListener(),e._removeInitialEventListener=e._addLongPressListener(e._handleInitialEvent,t)});this._removeInitialEventListener=function(){t(),n()}}},{key:`_dropFromOutsideListener`,value:function(e){var t=IF(e),n=t.pageX,r=t.pageY,i=t.clientX,a=t.clientY;this.emit(`dropFromOutside`,{x:n,y:r,clientX:i,clientY:a}),e.preventDefault()}},{key:`_dragOverFromOutsideListener`,value:function(e){var t=IF(e),n=t.pageX,r=t.pageY,i=t.clientX,a=t.clientY;this.emit(`dragOverFromOutside`,{x:n,y:r,clientX:i,clientY:a}),e.preventDefault()}},{key:`_handleInitialEvent`,value:function(e){if(this._initialEvent=e,!this.isDetached){var t=IF(e),n=t.clientX,r=t.clientY,i=t.pageX,a=t.pageY,o=this.container(),s,c;if(!(e.which===3||e.button===2||!jF(o,n,r))){if(!this.globalMouse&&o&&!eA(o,e.target)){var l=BF(0),u=l.top,d=l.left,f=l.bottom,p=l.right;if(c=HF(o),s=VF({top:c.top-u,left:c.left-d,bottom:c.bottom+f,right:c.right+p},{top:a,left:i}),!s)return}if(this.emit(`beforeSelect`,this._initialEventData={isTouch:/^touch/.test(e.type),x:i,y:a,clientX:n,clientY:r})!==!1)switch(e.type){case`mousedown`:this._removeEndListener=AF(`mouseup`,this._handleTerminatingEvent),this._onEscListener=AF(`keydown`,this._handleTerminatingEvent),this._removeMoveListener=AF(`mousemove`,this._handleMoveEvent);break;case`touchstart`:this._handleMoveEvent(e),this._removeEndListener=AF(`touchend`,this._handleTerminatingEvent),this._removeMoveListener=AF(`touchmove`,this._handleMoveEvent);break}}}}},{key:`_isWithinValidContainer`,value:function(e){var t=e.target,n=this.validContainers;return!n||!n.length||!t?!0:n.some(function(e){return!!t.closest(e)})}},{key:`_handleTerminatingEvent`,value:function(e){var t=this.selecting,n=this._selectRect;if(!t&&e.type.includes(`key`)&&(e=this._initialEvent),this.selecting=!1,this._removeEndListener&&this._removeEndListener(),this._removeMoveListener&&this._removeMoveListener(),this._selectRect=null,this._initialEvent=null,this._initialEventData=null,e){var r=!this.container||eA(this.container(),e.target),i=this._isWithinValidContainer(e);return e.key===`Escape`||!i?this.emit(`reset`):!t&&r?this._handleClickEvent(e):t?this.emit(`select`,n):this.emit(`reset`)}}},{key:`_handleClickEvent`,value:function(e){var t=IF(e),n=t.pageX,r=t.pageY,i=t.clientX,a=t.clientY,o=new Date().getTime();return this._lastClickData&&o-this._lastClickData.timestamp<RF?(this._lastClickData=null,this.emit(`doubleClick`,{x:n,y:r,clientX:i,clientY:a})):(this._lastClickData={timestamp:o},this.emit(`click`,{x:n,y:r,clientX:i,clientY:a}))}},{key:`_handleMoveEvent`,value:function(e){if(!(this._initialEventData===null||this.isDetached)){var t=this._initialEventData,n=t.x,r=t.y,i=IF(e),a=i.pageX,o=i.pageY,s=Math.abs(n-a),c=Math.abs(r-o),l=Math.min(a,n),u=Math.min(o,r),d=this.selecting,f=this.isClick(a,o);f&&!d&&!(s||c)||(!d&&!f&&this.emit(`selectStart`,this._initialEventData),f||(this.selecting=!0,this._selectRect={top:u,left:l,x:a,y:o,right:l+s,bottom:u+c},this.emit(`selecting`,this._selectRect)),e.preventDefault())}}},{key:`_keyListener`,value:function(e){this.ctrl=e.metaKey||e.ctrlKey}},{key:`isClick`,value:function(e,t){var n=this._initialEventData,r=n.x,i=n.y;return!n.isTouch&&Math.abs(e-r)<=LF&&Math.abs(t-i)<=LF}}])}();function BF(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return VD(e)!==`object`&&(e={top:e,left:e,right:e,bottom:e}),e}function VF(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=HF(e),i=r.top,a=r.left,o=r.right,s=o===void 0?a:o,c=r.bottom,l=c===void 0?i:c,u=HF(t),d=u.top,f=u.left,p=u.right,m=p===void 0?f:p,h=u.bottom,g=h===void 0?d:h;return!(l-n<d||i+n>g||s-n<f||a+n>m)}function HF(e){if(!e.getBoundingClientRect)return e;var t=e.getBoundingClientRect(),n=t.left+UF(`left`),r=t.top+UF(`top`);return{top:r,left:n,right:(e.offsetWidth||0)+n,bottom:(e.offsetHeight||0)+r}}function UF(e){if(e===`left`)return window.pageXOffset||document.body.scrollLeft||0;if(e===`top`)return window.pageYOffset||document.body.scrollTop||0}var WF=function(e){function t(e,n){var r;return YD(this,t),r=nO(this,t,[e,n]),r.state={selecting:!1},r.containerRef=(0,U.createRef)(),r}return iO(t,e),ZD(t,[{key:`componentDidMount`,value:function(){this.props.selectable&&this._selectable()}},{key:`componentWillUnmount`,value:function(){this._teardownSelectable()}},{key:`componentDidUpdate`,value:function(e){!e.selectable&&this.props.selectable&&this._selectable(),e.selectable&&!this.props.selectable&&this._teardownSelectable()}},{key:`render`,value:function(){var e=this.props,t=e.range,n=e.getNow,r=e.getters,i=e.date,a=e.components.dateCellWrapper,o=e.localizer,s=this.state,c=s.selecting,l=s.startIdx,u=s.endIdx,d=n();return U.createElement(`div`,{className:`rbc-row-bg`,ref:this.containerRef},t.map(function(e,n){var s=c&&n>=l&&n<=u,f=r.dayProp(e),p=f.className,m=f.style;return U.createElement(a,{key:n,value:e,range:t},U.createElement(`div`,{style:m,className:fO(`rbc-day-bg`,p,s&&`rbc-selected-cell`,o.isSameDate(e,d)&&`rbc-today`,i&&o.neq(i,e,`month`)&&`rbc-off-range-bg`)}))}))}},{key:`_selectable`,value:function(){var e=this,t=this.containerRef.current,n=this._selector=new zF(this.props.container,{longPressThreshold:this.props.longPressThreshold}),r=function(n,r){if(!PF(t,n)&&!FF(t,n)){var i=HF(t),a=e.props,o=a.range,s=a.rtl;if(CF(i,n)){var c=SF(i,n.x,s,o.length);e._selectSlot({startIdx:c,endIdx:c,action:r,box:n})}}e._initial={},e.setState({selecting:!1})};n.on(`selecting`,function(r){var i=e.props,a=i.range,o=i.rtl,s=-1,c=-1;if(e.state.selecting||(mF(e.props.onSelectStart,[r]),e._initial={x:r.x,y:r.y}),n.isSelected(t)){var l=HF(t),u=wF(e._initial,l,r,a.length,o);s=u.startIdx,c=u.endIdx}e.setState({selecting:!0,startIdx:s,endIdx:c})}),n.on(`beforeSelect`,function(t){if(e.props.selectable===`ignoreEvents`)return!PF(e.containerRef.current,t)}),n.on(`click`,function(e){return r(e,`click`)}),n.on(`doubleClick`,function(e){return r(e,`doubleClick`)}),n.on(`select`,function(t){e._selectSlot(KD(KD({},e.state),{},{action:`select`,bounds:t})),e._initial={},e.setState({selecting:!1}),mF(e.props.onSelectEnd,[e.state])})}},{key:`_teardownSelectable`,value:function(){this._selector&&=(this._selector.teardown(),null)}},{key:`_selectSlot`,value:function(e){var t=e.endIdx,n=e.startIdx,r=e.action,i=e.bounds,a=e.box;t!==-1&&n!==-1&&this.props.onSelectSlot&&this.props.onSelectSlot({start:n,end:t,action:r,bounds:i,box:a,resourceId:this.props.resourceId})}}])}(U.Component),GF={propTypes:{slotMetrics:K.default.object.isRequired,selected:K.default.object,isAllDay:K.default.bool,accessors:K.default.object.isRequired,localizer:K.default.object.isRequired,components:K.default.object.isRequired,getters:K.default.object.isRequired,onSelect:K.default.func,onDoubleClick:K.default.func,onKeyPress:K.default.func},defaultProps:{segments:[],selected:{}},renderEvent:function(e,t){var n=e.selected;e.isAllDay;var r=e.accessors,i=e.getters,a=e.onSelect,o=e.onDoubleClick,s=e.onKeyPress,c=e.localizer,l=e.slotMetrics,u=e.components,d=e.resizable,f=l.continuesPrior(t),p=l.continuesAfter(t);return U.createElement(yF,{event:t,getters:i,localizer:c,accessors:r,components:u,onSelect:a,onDoubleClick:o,onKeyPress:s,continuesPrior:f,continuesAfter:p,slotStart:l.first,slotEnd:l.last,selected:bF(t,n),resizable:d})},renderSpan:function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:` `,i=Math.abs(t)/e*100+`%`;return U.createElement(`div`,{key:n,className:`rbc-row-segment`,style:{WebkitFlexBasis:i,flexBasis:i,maxWidth:i}},r)}},KF=function(e){function t(){return YD(this,t),nO(this,t,arguments)}return iO(t,e),ZD(t,[{key:`render`,value:function(){var e=this,t=this.props,n=t.segments,r=t.slotMetrics.slots,i=t.className,a=1;return U.createElement(`div`,{className:fO(i,`rbc-row`)},n.reduce(function(t,n,i){var o=n.event,s=n.left,c=n.right,l=n.span,u=`_lvl_`+i,d=s-a,f=GF.renderEvent(e.props,o);return d&&t.push(GF.renderSpan(r,d,`${u}_gap`)),t.push(GF.renderSpan(r,l,u,f)),a=c+1,t},[]))}}])}(U.Component);KF.defaultProps=KD({},GF.defaultProps);function qF(e){var t=e.dateRange,n=e.unit,r=n===void 0?`day`:n,i=e.localizer;return{first:t[0],last:i.add(t[t.length-1],1,r)}}function JF(e,t,n,r){var i=qF({dateRange:t,localizer:r}),a=i.first,o=i.last,s=r.diff(a,o,`day`),c=r.max(r.startOf(n.start(e),`day`),a),l=r.min(r.ceil(n.end(e),`day`),o),u=(0,dN.default)(t,function(e){return r.isSameDate(e,c)}),d=r.diff(c,l,`day`);return d=Math.min(d,s),d=Math.max(d-r.segmentOffset,1),{event:e,span:d,left:u+1,right:Math.max(u+d,1)}}function YF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0,n,r,i,a=[],o=[];for(n=0;n<e.length;n++){for(i=e[n],r=0;r<a.length&&ZF(i,a[r]);r++);r>=t?o.push(i):(a[r]||(a[r]=[])).push(i)}for(n=0;n<a.length;n++)a[n].sort(function(e,t){return e.left-t.left});return{levels:a,extra:o}}function XF(e,t,n,r,i){var a={start:r.start(e),end:r.end(e)},o={start:t,end:n};return i.inEventRange({event:a,range:o})}function ZF(e,t){return t.some(function(t){return t.left<=e.right&&t.right>=e.left})}function QF(e,t,n){var r=xk(e),i=[],a=[];r.forEach(function(e){var r=t.start(e),o=t.end(e);n.daySpan(r,o)>1?i.push(e):a.push(e)});var o=i.sort(function(e,r){return $F(e,r,t,n)}),s=a.sort(function(e,r){return $F(e,r,t,n)});return[].concat(xk(o),xk(s))}function $F(e,t,n,r){var i={start:n.start(e),end:n.end(e),allDay:n.allDay(e)},a={start:n.start(t),end:n.end(t),allDay:n.allDay(t)};return r.sortEvents({evtA:i,evtB:a})}var eI=function(e,t){return e.left<=t&&e.right>=t},tI=function(e,t){return e.filter(function(e){return eI(e,t)}).map(function(e){return e.event})},nI=function(e){function t(){return YD(this,t),nO(this,t,arguments)}return iO(t,e),ZD(t,[{key:`render`,value:function(){for(var e=this.props,t=e.segments,n=e.slotMetrics.slots,r=YF(t).levels[0],i=1,a=1,o=[];i<=n;){var s=`_lvl_`+i,c=r.filter(function(e){return eI(e,i)})[0]||{},l=c.event,u=c.left,d=c.right,f=c.span;if(!l){if(this.getHiddenEventsForSlot(t,i).length>0){var p=i-a;p&&o.push(GF.renderSpan(n,p,s+`_gap`)),o.push(GF.renderSpan(n,1,s,this.renderShowMore(t,i))),a=i+=1;continue}i++;continue}var m=Math.max(0,u-a);if(this.canRenderSlotEvent(u,f)){var h=GF.renderEvent(this.props,l);m&&o.push(GF.renderSpan(n,m,s+`_gap`)),o.push(GF.renderSpan(n,f,s,h)),a=i=d+1}else m&&o.push(GF.renderSpan(n,m,s+`_gap`)),o.push(GF.renderSpan(n,1,s,this.renderShowMore(t,i))),a=i+=1}return U.createElement(`div`,{className:`rbc-row`},o)}},{key:`getHiddenEventsForSlot`,value:function(e,t){var n=tI(e,t),r=YF(e).levels[0].filter(function(e){return eI(e,t)}).map(function(e){return e.event});return n.filter(function(e){return!r.some(function(t){return t===e})})}},{key:`canRenderSlotEvent`,value:function(e,t){var n=this.props.segments;return(0,uN.default)(e,e+t).every(function(e){return tI(n,e).length===1})}},{key:`renderShowMore`,value:function(e,t){var n=this,r=this.props,i=r.localizer,a=r.slotMetrics,o=r.components,s=a.getEventsForSlot(t),c=tI(e,t),l=c.length;if(o!=null&&o.showMore){var u=o.showMore,d=a.getDateForSlot(t-1);return l?U.createElement(u,{localizer:i,slotDate:d,slot:t,count:l,events:s,remainingEvents:c}):!1}return l?U.createElement(`button`,{type:`button`,key:`sm_`+t,className:fO(`rbc-button-link`,`rbc-show-more`),onClick:function(e){return n.showMore(t,e)}},i.messages.showMore(l,c,s)):!1}},{key:`showMore`,value:function(e,t){t.preventDefault(),t.stopPropagation(),this.props.onShowMore(e,t.target)}}])}(U.Component);nI.defaultProps=KD({},GF.defaultProps);var rI=function(e){var t=e.children;return U.createElement(`div`,{className:`rbc-row-content-scroll-container`},t)},iI=function(e,t){return e.left<=t&&e.right>=t},aI=function(e,t){return e[0].range===t[0].range&&e[0].events===t[0].events};function oI(){return hN(function(e){for(var t=e.range,n=e.events,r=e.maxRows,i=e.minRows,a=e.accessors,o=e.localizer,s=qF({dateRange:t,localizer:o}),c=s.first,l=s.last,u=n.map(function(e){return JF(e,t,a,o)}),d=YF(u,Math.max(r-1,1)),f=d.levels,p=d.extra,m=p.length>0?i-1:i;f.length<m;)f.push([]);return{first:c,last:l,levels:f,extra:p,range:t,slots:t.length,clone:function(t){return oI()(KD(KD({},e),t))},getDateForSlot:function(e){return t[e]},getSlotForDate:function(e){return t.find(function(t){return o.isSameDate(t,e)})},getEventsForSlot:function(e){return u.filter(function(t){return iI(t,e)}).map(function(e){return e.event})},continuesPrior:function(e){return o.continuesPrior(a.start(e),c)},continuesAfter:function(e){var t=a.start(e),n=a.end(e);return o.continuesAfter(t,n,l)}}},aI)}var sI=function(e){function t(){var e;YD(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=nO(this,t,[].concat(r)),e.handleSelectSlot=function(t){var n=e.props,r=n.range,i=n.onSelectSlot;i(r.slice(t.start,t.end+1),t)},e.handleShowMore=function(t,n){var r=e.props,i=r.range,a=r.onShowMore,o=e.slotMetrics(e.props),s=CA(e.containerRef.current,`.rbc-row-bg`)[0],c;s&&(c=s.children[t-1]),a(o.getEventsForSlot(t),i[t-1],c,t,n)},e.getContainer=function(){var t=e.props.container;return t?t():e.containerRef.current},e.renderHeadingCell=function(t,n){var r=e.props,i=r.renderHeader,a=r.getNow,o=r.localizer;return i({date:t,key:`header_${n}`,className:fO(`rbc-date-cell`,o.isSameDate(t,a())&&`rbc-now`)})},e.renderDummy=function(){var t=e.props,n=t.className,r=t.range,i=t.renderHeader,a=t.showAllEvents;return U.createElement(`div`,{className:n,ref:e.containerRef},U.createElement(`div`,{className:fO(`rbc-row-content`,a&&`rbc-row-content-scrollable`)},i&&U.createElement(`div`,{className:`rbc-row`,ref:e.headingRowRef},r.map(e.renderHeadingCell)),U.createElement(`div`,{className:`rbc-row`,ref:e.eventRowRef},U.createElement(`div`,{className:`rbc-row-segment`},U.createElement(`div`,{className:`rbc-event`},U.createElement(`div`,{className:`rbc-event-content`},`\xA0`))))))},e.containerRef=(0,U.createRef)(),e.headingRowRef=(0,U.createRef)(),e.eventRowRef=(0,U.createRef)(),e.slotMetrics=oI(),e}return iO(t,e),ZD(t,[{key:`getRowLimit`,value:function(){var e,t=NM(this.eventRowRef.current),n=(e=this.headingRowRef)!=null&&e.current?NM(this.headingRowRef.current):0,r=NM(this.containerRef.current)-n;return Math.max(Math.floor(r/t),1)}},{key:`render`,value:function(){var e=this.props,t=e.date,n=e.rtl,r=e.range,i=e.className,a=e.selected,o=e.selectable,s=e.renderForMeasure,c=e.accessors,l=e.getters,u=e.components,d=e.getNow,f=e.renderHeader,p=e.onSelect,m=e.localizer,h=e.onSelectStart,g=e.onSelectEnd,_=e.onDoubleClick,v=e.onKeyPress,y=e.resourceId,b=e.longPressThreshold,x=e.isAllDay,S=e.resizable,C=e.showAllEvents;if(s)return this.renderDummy();var w=this.slotMetrics(this.props),T=w.levels,E=w.extra,D=C?rI:RP,O=u.weekWrapper,k={selected:a,accessors:c,getters:l,localizer:m,components:u,onSelect:p,onDoubleClick:_,onKeyPress:v,resourceId:y,slotMetrics:w,resizable:S};return U.createElement(`div`,{className:i,role:`rowgroup`,ref:this.containerRef},U.createElement(WF,{localizer:m,date:t,getNow:d,rtl:n,range:r,selectable:o,container:this.getContainer,getters:l,onSelectStart:h,onSelectEnd:g,onSelectSlot:this.handleSelectSlot,components:u,longPressThreshold:b,resourceId:y}),U.createElement(`div`,{className:fO(`rbc-row-content`,C&&`rbc-row-content-scrollable`),role:`row`},f&&U.createElement(`div`,{className:`rbc-row `,ref:this.headingRowRef},r.map(this.renderHeadingCell)),U.createElement(D,null,U.createElement(O,Object.assign({isAllDay:x},k,{rtl:this.props.rtl}),T.map(function(e,t){return U.createElement(KF,Object.assign({key:t,segments:e},k))}),!!E.length&&U.createElement(nI,Object.assign({segments:E,onShowMore:this.handleShowMore},k))))))}}])}(U.Component);sI.defaultProps={minRows:0,maxRows:1/0};var cI=function(e){var t=e.label;return U.createElement(`span`,{role:`columnheader`,"aria-sort":`none`},t)},lI=function(e){var t=e.label,n=e.drilldownView,r=e.onDrillDown;return n?U.createElement(`button`,{type:`button`,className:`rbc-button-link`,onClick:r},t):U.createElement(`span`,null,t)},uI=[`date`,`className`],dI=function(e,t,n,r,i){return e.filter(function(e){return XF(e,t,n,r,i)})},fI=function(e){function t(){var e;YD(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=nO(this,t,[].concat(r)),e.getContainer=function(){return e.containerRef.current},e.renderWeek=function(t,n){var r=e.props,i=r.events,a=r.components,o=r.selectable,s=r.getNow,c=r.selected,l=r.date,u=r.localizer,d=r.longPressThreshold,f=r.accessors,p=r.getters,m=r.showAllEvents,h=e.state,g=h.needLimitMeasure,_=h.rowLimit,v=QF(dI(xk(i),t[0],t[t.length-1],f,u),f,u);return U.createElement(sI,{key:n,ref:n===0?e.slotRowRef:void 0,container:e.getContainer,className:`rbc-month-row`,getNow:s,date:l,range:t,events:v,maxRows:m?1/0:_,selected:c,selectable:o,components:a,accessors:f,getters:p,localizer:u,renderHeader:e.readerDateHeading,renderForMeasure:g,onShowMore:e.handleShowMore,onSelect:e.handleSelectEvent,onDoubleClick:e.handleDoubleClickEvent,onKeyPress:e.handleKeyPressEvent,onSelectSlot:e.handleSelectSlot,longPressThreshold:d,rtl:e.props.rtl,resizable:e.props.resizable,showAllEvents:m})},e.readerDateHeading=function(t){var n=t.date,r=t.className,i=JD(t,uI),a=e.props,o=a.date,s=a.getDrilldownView,c=a.localizer,l=c.neq(o,n,`month`),u=c.isSameDate(n,o),d=s(n),f=c.format(n,`dateFormat`),p=e.props.components.dateHeader||lI;return U.createElement(`div`,Object.assign({},i,{className:fO(r,l&&`rbc-off-range`,u&&`rbc-current`),role:`cell`}),U.createElement(p,{label:f,date:n,drilldownView:d,isOffRange:l,onDrillDown:function(t){return e.handleHeadingClick(n,d,t)}}))},e.handleSelectSlot=function(t,n){e._pendingSelection=e._pendingSelection.concat(t),clearTimeout(e._selectTimer),e._selectTimer=setTimeout(function(){return e.selectDates(n)})},e.handleHeadingClick=function(t,n,r){r.preventDefault(),e.clearSelection(),mF(e.props.onDrillDown,[t,n])},e.handleSelectEvent=function(){e.clearSelection();for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];mF(e.props.onSelectEvent,n)},e.handleDoubleClickEvent=function(){e.clearSelection();for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];mF(e.props.onDoubleClickEvent,n)},e.handleKeyPressEvent=function(){e.clearSelection();for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];mF(e.props.onKeyPressEvent,n)},e.handleShowMore=function(t,n,r,i,a){var o=e.props,s=o.popup,c=o.onDrillDown,l=o.onShowMore,u=o.getDrilldownView,d=o.doShowMoreDrillDown;if(e.clearSelection(),s){var f=uA(r,e.containerRef.current);e.setState({overlay:{date:n,events:t,position:f,target:a}})}else d&&mF(c,[n,u(n)||BP.DAY]);mF(l,[t,n,i])},e.overlayDisplay=function(){e.setState({overlay:null})},e.state={rowLimit:5,needLimitMeasure:!0,date:null},e.containerRef=(0,U.createRef)(),e.slotRowRef=(0,U.createRef)(),e._bgRows=[],e._pendingSelection=[],e}return iO(t,e),ZD(t,[{key:`componentDidMount`,value:function(){var e=this,t;this.state.needLimitMeasure&&this.measureRowLimit(this.props),window.addEventListener(`resize`,this._resizeListener=function(){t||yA(function(){t=!1,e.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 e=this.props,t=e.date,n=e.localizer,r=e.className,i=(0,Uk.default)(n.visibleDays(t,n),7);return this._weekCount=i.length,U.createElement(`div`,{className:fO(`rbc-month-view`,r),role:`table`,"aria-label":`Month View`,ref:this.containerRef},U.createElement(`div`,{className:`rbc-row rbc-month-header`,role:`row`},this.renderHeaders(i[0])),i.map(this.renderWeek),this.props.popup&&this.renderOverlay())}},{key:`renderHeaders`,value:function(e){var t=this.props,n=t.localizer,r=t.components,i=e[0],a=e[e.length-1],o=r.header||cI;return n.range(i,a,`day`).map(function(e,t){return U.createElement(`div`,{key:`header_`+t,className:`rbc-header`},U.createElement(o,{date:e,localizer:n,label:n.format(e,`weekdayFormat`)}))})}},{key:`renderOverlay`,value:function(){var e=this,t=this.state?.overlay??{},n=this.props,r=n.accessors,i=n.localizer,a=n.components,o=n.getters,s=n.selected,c=n.popupOffset,l=n.handleDragStart;return U.createElement(kF,{overlay:t,accessors:r,localizer:i,components:a,getters:o,selected:s,popupOffset:c,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:l,show:!!t.position,overlayDisplay:this.overlayDisplay,onHide:function(){return e.setState({overlay:null})}})}},{key:`measureRowLimit`,value:function(){this.setState({needLimitMeasure:!1,rowLimit:this.slotRowRef.current.getRowLimit()})}},{key:`selectDates`,value:function(e){var t=this._pendingSelection.slice();this._pendingSelection=[],t.sort(function(e,t){return e-+t});var n=new Date(t[0]),r=new Date(t[t.length-1]);r.setDate(t[t.length-1].getDate()+1),mF(this.props.onSelectSlot,{slots:t,start:n,end:r,action:e.action,bounds:e.bounds,box:e.box})}},{key:`clearSelection`,value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}}],[{key:`getDerivedStateFromProps`,value:function(e,t){var n=e.date;return{date:n,needLimitMeasure:e.localizer.neq(n,t.date,`month`)}}}])}(U.Component);fI.range=function(e,t){var n=t.localizer;return{start:n.firstVisibleDay(e,n),end:n.lastVisibleDay(e,n)}},fI.navigate=function(e,t,n){var r=n.localizer;switch(t){case zP.PREVIOUS:return r.add(e,-1,`month`);case zP.NEXT:return r.add(e,1,`month`);default:return e}},fI.title=function(e,t){return t.localizer.format(e,`monthHeaderFormat`)};var pI=function(e){var t=e.min,n=e.max,r=e.step,i=e.slots,a=e.localizer;return`${+a.startOf(t,`minutes`)}${+a.startOf(n,`minutes`)}${r}-${i}`};function mI(e){for(var t=e.min,n=e.max,r=e.step,i=e.timeslots,a=e.localizer,o=pI({start:t,end:n,step:r,timeslots:i,localizer:a}),s=1+a.getTotalMin(t,n),c=a.getMinutesFromMidnight(t),l=Math.ceil((s-1)/(r*i)),u=l*i,d=Array(l),f=Array(u),p=0;p<l;p++){d[p]=Array(i);for(var m=0;m<i;m++){var h=p*i+m,g=h*r;f[h]=d[p][m]=a.getSlotDate(t,c,g)}}var _=f.length*r;f.push(a.getSlotDate(t,c,_));function v(e){var n=a.diff(t,e,`minutes`)+a.getDstOffset(t,e);return Math.min(n,s)}return{groups:d,update:function(e){return pI(e)===o?this:mI(e)},dateIsInGroup:function(e,t){var r=d[t+1];return a.inRange(e,d[t][0],r?r[0]:n,`minutes`)},nextSlot:function(e){var t=f[Math.min(f.findIndex(function(t){return t===e||a.eq(t,e)})+1,f.length-1)];return a.eq(t,e)&&(t=a.add(e,r,`minutes`)),t},closestSlotToPosition:function(e){return f[Math.min(f.length-1,Math.max(0,Math.floor(e*u)))]},closestSlotFromPoint:function(e,t){var n=Math.abs(t.top-t.bottom);return this.closestSlotToPosition((e.y-t.top)/n)},closestSlotFromDate:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(a.lt(e,t,`minutes`))return f[0];if(a.gt(e,n,`minutes`))return f[f.length-1];var o=a.diff(t,e,`minutes`);return f[(o-o%r)/r+i]},startsBeforeDay:function(e){return a.lt(e,t,`day`)},startsAfterDay:function(e){return a.gt(e,n,`day`)},startsBefore:function(e){return a.lt(a.merge(t,e),t,`minutes`)},startsAfter:function(e){return a.gt(a.merge(n,e),n,`minutes`)},getRange:function(e,i,o,s){o||(e=a.min(n,a.max(t,e))),s||(i=a.min(n,a.max(t,i)));var c=v(e),l=v(i),d=l>r*u&&!a.eq(n,i)?(c-r)/(r*u)*100:c/(r*u)*100;return{top:d,height:l/(r*u)*100-d,start:v(e),startDate:e,end:v(i),endDate:i}},getCurrentTimePosition:function(e){return v(e)/(r*u)*100}}}var hI=function(){function e(t,n){var r=n.accessors,i=n.slotMetrics;YD(this,e);var a=i.getRange(r.start(t),r.end(t)),o=a.start,s=a.startDate,c=a.end,l=a.endDate,u=a.top,d=a.height;this.start=o,this.end=c,this.startMs=+s,this.endMs=+l,this.top=u,this.height=d,this.data=t}return ZD(e,[{key:`_width`,get:function(){return this.rows?100/(this.rows.reduce(function(e,t){return Math.max(e,t.leaves.length+1)},0)+1):this.leaves?(100-this.container._width)/(this.leaves.length+1):this.row._width}},{key:`width`,get:function(){var e=this._width,t=Math.min(100,this._width*1.7);if(this.rows)return t;if(this.leaves)return this.leaves.length>0?t:e;var n=this.row.leaves;return n.indexOf(this)===n.length-1?e:t}},{key:`xOffset`,get:function(){if(this.rows)return 0;if(this.leaves)return this.container._width;var e=this.row,t=e.leaves,n=e.xOffset,r=e._width;return n+(t.indexOf(this)+1)*r}}])}();function gI(e,t,n){return Math.abs(t.start-e.start)<n||t.start>e.start&&t.start<e.end}function _I(e){for(var t=(0,LN.default)(e,[`startMs`,function(e){return-e.endMs}]),n=[];t.length>0;){var r=t.shift();n.push(r);for(var i=0;i<t.length;i++){var a=t[i];if(!(r.endMs>a.startMs)){if(i>0){var o=t.splice(i,1)[0];n.push(o)}break}}}return n}function vI(e){for(var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,i=e.accessors,a=_I(t.map(function(e){return new hI(e,{slotMetrics:r,accessors:i})})),o=[],s=function(){var e=a[c],t=o.find(function(t){return t.end>e.start||Math.abs(e.start-t.start)<n});if(!t)return e.rows=[],o.push(e),1;e.container=t;for(var r=null,i=t.rows.length-1;!r&&i>=0;i--)gI(t.rows[i],e,n)&&(r=t.rows[i]);r?(r.leaves.push(e),e.row=r):(e.leaves=[],t.rows.push(e))},c=0;c<a.length;c++)if(s())continue;return a.map(function(e){return{event:e.data,style:{top:e.top,height:e.height,width:e.width,xOffset:Math.max(0,e.xOffset)}}})}function yI(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 i=yI(e.friends[r],t,n);t=t>i?t:i}return t}function bI(e){var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,i=e.accessors,a=vI({events:t,minimumStartDifference:n,slotMetrics:r,accessors:i});a.sort(function(e,t){return e=e.style,t=t.style,e.top===t.top?e.height===t.height?0:e.top+e.height<t.top+t.height?1:-1:e.top>t.top?1:-1});for(var o=0;o<a.length;++o)a[o].friends=[],delete a[o].style.left,delete a[o].style.left,delete a[o].idx,delete a[o].size;for(var s=0;s<a.length-1;++s)for(var c=a[s],l=c.style.top,u=c.style.top+c.style.height,d=s+1;d<a.length;++d){var f=a[d],p=f.style.top,m=f.style.top+f.style.height;(p>=l&&m<=u||m>l&&m<=u||p>=l&&p<u)&&(c.friends.push(f),f.friends.push(c))}for(var h=0;h<a.length;++h){for(var g=a[h],_=[],v=0;v<100;++v)_.push(1);for(var y=0;y<g.friends.length;++y)g.friends[y].idx!==void 0&&(_[g.friends[y].idx]=0);g.idx=_.indexOf(1)}for(var b=0;b<a.length;++b){var x=0;if(!a[b].size){var S=[];x=100/(yI(a[b],0,S)+1),a[b].size=x;for(var C=0;C<S.length;++C)S[C].size=x}}for(var w=0;w<a.length;++w){var T=a[w];T.style.left=T.idx*T.size;for(var E=0,D=0;D<T.friends.length;++D){var O=T.friends[D].idx;E=E>O?E:O}E<=T.idx&&(T.size=100-T.idx*T.size);var k=T.idx===0?0:3;T.style.width=`calc(${T.size}% - ${k}px)`,T.style.height=`calc(${T.style.height}% - 2px)`,T.style.xOffset=`calc(${T.style.left}% + ${k}px)`}return a}var xI={overlap:vI,"no-overlap":bI};function SI(e){return!!(e&&e.constructor&&e.call&&e.apply)}function CI(e){e.events,e.minimumStartDifference,e.slotMetrics,e.accessors;var t=e.dayLayoutAlgorithm,n=t;return t in xI&&(n=xI[t]),SI(n)?n.apply(this,arguments):[]}var wI=function(e){function t(){return YD(this,t),nO(this,t,arguments)}return iO(t,e),ZD(t,[{key:`render`,value:function(){var e=this.props,t=e.renderSlot,n=e.resource,r=e.group,i=e.getters,a=e.components,o=(a===void 0?{}:a).timeSlotWrapper,s=o===void 0?RP:o,c=i?i.slotGroupProp(r):{};return U.createElement(`div`,Object.assign({className:`rbc-timeslot-group`},c),r.map(function(e,r){var a=i?i.slotProp(e,n):{};return U.createElement(s,{key:r,value:e,resource:n},U.createElement(`div`,Object.assign({},a,{className:fO(`rbc-time-slot`,a.className)}),t&&t(e,r)))}))}}])}(U.Component);function TI(e){return typeof e==`string`?e:e+`%`}function EI(e){var t=e.style,n=e.className,r=e.event,i=e.accessors,a=e.rtl,o=e.selected,s=e.label,c=e.continuesPrior,l=e.continuesAfter,u=e.getters,d=e.onClick,f=e.onDoubleClick,p=e.isBackgroundEvent,m=e.onKeyPress,h=e.components,g=h.event,_=h.eventWrapper,v=i.title(r),y=i.tooltip(r),b=i.end(r),x=i.start(r),S=u.eventProp(r,x,b,o),C=[U.createElement(`div`,{key:`1`,className:`rbc-event-label`},s),U.createElement(`div`,{key:`2`,className:`rbc-event-content`},g?U.createElement(g,{event:r,title:v}):v)],w=t.height,T=t.top,E=t.width,D=t.xOffset,O=KD(KD({},S.style),{},WD({top:TI(T),height:TI(w),width:TI(E)},a?`right`:`left`,TI(D)));return U.createElement(_,Object.assign({type:`time`},e),U.createElement(`div`,{role:`button`,tabIndex:0,onClick:d,onDoubleClick:f,style:O,onKeyDown:m,title:y?(typeof s==`string`?s+`: `:``)+y:void 0,className:fO(p?`rbc-background-event`:`rbc-event`,n,S.className,{"rbc-selected":o,"rbc-event-continues-earlier":c,"rbc-event-continues-later":l})},C))}var DI=function(e){var t=e.children,n=e.className,r=e.style,i=e.innerRef;return U.createElement(`div`,{className:n,style:r,ref:i},t)},OI=U.forwardRef(function(e,t){return U.createElement(DI,Object.assign({},e,{innerRef:t}))}),kI=[`dayProp`],AI=[`eventContainerWrapper`,`timeIndicatorWrapper`],jI=function(e){function t(){var e;YD(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=nO(this,t,[].concat(r)),e.state={selecting:!1,timeIndicatorPosition:null},e.intervalTriggered=!1,e.renderEvents=function(t){var n=t.events,r=t.isBackgroundEvent,i=e.props,a=i.rtl,o=i.selected,s=i.accessors,c=i.localizer,l=i.getters,u=i.components,d=i.step,f=i.timeslots,p=i.dayLayoutAlgorithm,m=i.resizable,h=e.slotMetrics,g=c.messages;return CI({events:n,accessors:s,slotMetrics:h,minimumStartDifference:Math.ceil(d*f/2),dayLayoutAlgorithm:p}).map(function(t,n){var i=t.event,d=t.style,f=s.end(i),p=s.start(i),_=s.eventId(i)??`evt_`+n,v=`eventTimeRangeFormat`,y,b=h.startsBeforeDay(p),x=h.startsAfterDay(f);b?v=`eventTimeRangeEndFormat`:x&&(v=`eventTimeRangeStartFormat`),y=b&&x?g.allDay:c.format({start:p,end:f},v);var S=b||h.startsBefore(p),C=x||h.startsAfter(f);return U.createElement(EI,{style:d,event:i,label:y,key:_,getters:l,rtl:a,components:u,continuesPrior:S,continuesAfter:C,accessors:s,resource:e.props.resource,selected:bF(i,o),onClick:function(t){return e._select(KD(KD(KD({},i),e.props.resource&&{sourceResource:e.props.resource}),r&&{isBackgroundEvent:!0}),t)},onDoubleClick:function(t){return e._doubleClick(i,t)},isBackgroundEvent:r,onKeyPress:function(t){return e._keyPress(i,t)},resizable:m})})},e._selectable=function(){var t=e.containerRef.current,n=e.props,r=n.longPressThreshold,i=n.localizer,a=e._selector=new zF(function(){return t},{longPressThreshold:r}),o=function(t){var n=e.props.onSelecting,r=e.state||{},a=s(t),o=a.startDate,c=a.endDate;n&&(i.eq(r.startDate,o,`minutes`)&&i.eq(r.endDate,c,`minutes`)||n({start:o,end:c,resourceId:e.props.resource})===!1)||(e.state.start!==a.start||e.state.end!==a.end||e.state.selecting!==a.selecting)&&e.setState(a)},s=function(n){var r=e.slotMetrics.closestSlotFromPoint(n,HF(t));e.state.selecting||(e._initialSlot=r);var a=e._initialSlot;i.lte(a,r)?r=e.slotMetrics.nextSlot(r):i.gt(a,r)&&(a=e.slotMetrics.nextSlot(a));var o=e.slotMetrics.getRange(i.min(a,r),i.max(a,r));return KD(KD({},o),{},{selecting:!0,top:`${o.top}%`,height:`${o.height}%`})},c=function(t,n){if(!PF(e.containerRef.current,t)){var r=s(t),i=r.startDate,a=r.endDate;e._selectSlot({startDate:i,endDate:a,action:n,box:t})}e.setState({selecting:!1})};a.on(`selecting`,o),a.on(`selectStart`,o),a.on(`beforeSelect`,function(t){if(e.props.selectable===`ignoreEvents`)return!PF(e.containerRef.current,t)}),a.on(`click`,function(e){return c(e,`click`)}),a.on(`doubleClick`,function(e){return c(e,`doubleClick`)}),a.on(`select`,function(t){e.state.selecting&&(e._selectSlot(KD(KD({},e.state),{},{action:`select`,bounds:t})),e.setState({selecting:!1}))}),a.on(`reset`,function(){e.state.selecting&&e.setState({selecting:!1})})},e._teardownSelectable=function(){e._selector&&(e._selector.teardown(),e._selector=null)},e._selectSlot=function(t){for(var n=t.startDate,r=t.endDate,i=t.action,a=t.bounds,o=t.box,s=n,c=[];e.props.localizer.lte(s,r);)c.push(s),s=new Date(+s+e.props.step*60*1e3);mF(e.props.onSelectSlot,{slots:c,start:n,end:r,resourceId:e.props.resource,action:i,bounds:a,box:o})},e._select=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];mF(e.props.onSelectEvent,n)},e._doubleClick=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];mF(e.props.onDoubleClickEvent,n)},e._keyPress=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];mF(e.props.onKeyPressEvent,n)},e.slotMetrics=mI(e.props),e.containerRef=(0,U.createRef)(),e}return iO(t,e),ZD(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(e,t){this.props.selectable&&!e.selectable&&this._selectable(),!this.props.selectable&&e.selectable&&this._teardownSelectable();var n=this.props,r=n.getNow,i=n.isNow,a=n.localizer,o=n.date,s=n.min,c=n.max,l=a.neq(e.getNow(),r(),`minutes`);if(e.isNow!==i||l){if(this.clearTimeIndicatorInterval(),i){var u=!l&&a.eq(e.date,o,`minutes`)&&t.timeIndicatorPosition===this.state.timeIndicatorPosition;this.setTimeIndicatorPositionUpdateInterval(u)}}else i&&(a.neq(e.min,s,`minutes`)||a.neq(e.max,c,`minutes`))&&this.positionTimeIndicator()}},{key:`setTimeIndicatorPositionUpdateInterval`,value:function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;!this.intervalTriggered&&!t&&this.positionTimeIndicator(),this._timeIndicatorTimeout=window.setTimeout(function(){e.intervalTriggered=!0,e.positionTimeIndicator(),e.setTimeIndicatorPositionUpdateInterval()},6e4)}},{key:`clearTimeIndicatorInterval`,value:function(){this.intervalTriggered=!1,window.clearTimeout(this._timeIndicatorTimeout)}},{key:`positionTimeIndicator`,value:function(){var e=this.props,t=e.min,n=e.max,r=e.getNow,i=r();if(i>=t&&i<=n){var a=this.slotMetrics.getCurrentTimePosition(i);this.intervalTriggered=!0,this.setState({timeIndicatorPosition:a})}else this.clearTimeIndicatorInterval()}},{key:`render`,value:function(){var e=this.props,t=e.date,n=e.max,r=e.rtl,i=e.isNow,a=e.resource,o=e.accessors,s=e.localizer,c=e.getters,l=c.dayProp,u=JD(c,kI),d=e.components,f=d.eventContainerWrapper,p=d.timeIndicatorWrapper,m=JD(d,AI);this.slotMetrics=this.slotMetrics.update(this.props);var h=this.slotMetrics,g=this.state,_=g.selecting,v=g.top,y=g.height,b={start:g.startDate,end:g.endDate},x=l(n,a),S=x.className,C=x.style,w={className:`rbc-current-time-indicator`,style:{top:`${this.state.timeIndicatorPosition}%`}},T=m.dayColumnWrapper||OI;return U.createElement(T,{ref:this.containerRef,date:t,style:C,className:fO(S,`rbc-day-slot`,`rbc-time-column`,i&&`rbc-now`,i&&`rbc-today`,_&&`rbc-slot-selecting`),slotMetrics:h,resource:a},h.groups.map(function(e,t){return U.createElement(wI,{key:t,group:e,resource:a,getters:u,components:m})}),U.createElement(f,{localizer:s,resource:a,accessors:o,getters:u,components:m,slotMetrics:h},U.createElement(`div`,{className:fO(`rbc-events-container`,r&&`rtl`)},this.renderEvents({events:this.props.backgroundEvents,isBackgroundEvent:!0}),this.renderEvents({events:this.props.events}))),_&&U.createElement(`div`,{className:`rbc-slot-selection`,style:{top:v,height:y}},U.createElement(`span`,null,s.format(b,`selectRangeFormat`))),i&&this.intervalTriggered&&U.createElement(p,w,U.createElement(`div`,w)))}}])}(U.Component);jI.defaultProps={dragThroughEvents:!0,timeslots:2};var MI=function(e){var t=e.label;return U.createElement(U.Fragment,null,t)},NI=function(e){function t(){var e;YD(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=nO(this,t,[].concat(r)),e.handleHeaderClick=function(t,n,r){r.preventDefault(),mF(e.props.onDrillDown,[t,n])},e.renderRow=function(t){var n=e.props,r=n.events,i=n.rtl,a=n.selectable,o=n.getNow,s=n.range,c=n.getters,l=n.localizer,u=n.accessors,d=n.components,f=n.resizable,p=u.resourceId(t),m=t?r.filter(function(e){return u.resource(e)===p}):r;return U.createElement(sI,{isAllDay:!0,rtl:i,getNow:o,minRows:2,maxRows:e.props.allDayMaxRows+1,range:s,events:m,resourceId:p,className:`rbc-allday-cell`,selectable:a,selected:e.props.selected,components:d,accessors:u,getters:c,localizer:l,onSelect:e.props.onSelectEvent,onShowMore:e.props.onShowMore,onDoubleClick:e.props.onDoubleClickEvent,onKeyPress:e.props.onKeyPressEvent,onSelectSlot:e.props.onSelectSlot,longPressThreshold:e.props.longPressThreshold,resizable:f})},e}return iO(t,e),ZD(t,[{key:`renderHeaderCells`,value:function(e){var t=this,n=this.props,r=n.localizer,i=n.getDrilldownView,a=n.getNow,o=n.getters.dayProp,s=n.components.header,c=s===void 0?cI:s,l=a();return e.map(function(e,n){var a=i(e),s=r.format(e,`dayFormat`),u=o(e),d=u.className,f=u.style,p=U.createElement(c,{date:e,label:s,localizer:r});return U.createElement(`div`,{key:n,style:f,className:fO(`rbc-header`,d,r.isSameDate(e,l)&&`rbc-today`)},a?U.createElement(`button`,{type:`button`,className:`rbc-button-link`,onClick:function(n){return t.handleHeaderClick(e,a,n)}},p):U.createElement(`span`,null,p))})}},{key:`render`,value:function(){var e=this,t=this.props,n=t.width,r=t.rtl,i=t.resources,a=t.range,o=t.events,s=t.getNow,c=t.accessors,l=t.selectable,u=t.components,d=t.getters,f=t.scrollRef,p=t.localizer,m=t.isOverflowing,h=t.components,g=h.timeGutterHeader,_=h.resourceHeader,v=_===void 0?MI:_,y=t.resizable,b={};m&&(b[r?`marginLeft`:`marginRight`]=`${ij()-1}px`);var x=i.groupEvents(o);return U.createElement(`div`,{style:b,ref:f,className:fO(`rbc-time-header`,m&&`rbc-overflowing`)},U.createElement(`div`,{className:`rbc-label rbc-time-header-gutter`,style:{width:n,minWidth:n,maxWidth:n}},g&&U.createElement(g,null)),i.map(function(t,n){var i=uO(t,2),o=i[0],f=i[1];return U.createElement(`div`,{className:`rbc-time-header-content`,key:o||n},f&&U.createElement(`div`,{className:`rbc-row rbc-row-resource`,key:`resource_${n}`},U.createElement(`div`,{className:`rbc-header`},U.createElement(v,{index:n,label:c.resourceTitle(f),resource:f}))),U.createElement(`div`,{className:`rbc-row rbc-time-header-cell${a.length<=1?` rbc-time-header-cell-single-day`:``}`},e.renderHeaderCells(a)),U.createElement(sI,{isAllDay:!0,rtl:r,getNow:s,minRows:2,maxRows:e.props.allDayMaxRows+1,range:a,events:x.get(o)||[],resourceId:f&&o,className:`rbc-allday-cell`,selectable:l,selected:e.props.selected,components:u,accessors:c,getters:d,localizer:p,onSelect:e.props.onSelectEvent,onShowMore:e.props.onShowMore,onDoubleClick:e.props.onDoubleClickEvent,onKeyDown:e.props.onKeyPressEvent,onSelectSlot:e.props.onSelectSlot,longPressThreshold:e.props.longPressThreshold,resizable:y}))}))}}])}(U.Component),PI=function(e){function t(){var e;YD(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=nO(this,t,[].concat(r)),e.handleHeaderClick=function(t,n,r){r.preventDefault(),mF(e.props.onDrillDown,[t,n])},e}return iO(t,e),ZD(t,[{key:`renderHeaderCells`,value:function(e){var t=this,n=this.props,r=n.localizer,i=n.getDrilldownView,a=n.getNow,o=n.getters.dayProp,s=n.components,c=s.header,l=c===void 0?cI:c,u=s.resourceHeader,d=u===void 0?MI:u,f=n.resources,p=n.accessors,m=n.events,h=n.rtl,g=n.selectable,_=n.components,v=n.getters,y=n.resizable,b=a(),x=f.groupEvents(m);return e.map(function(n,s){var c=i(n),u=r.format(n,`dayFormat`),m=o(n),S=m.className,C=m.style,w=U.createElement(l,{date:n,label:u,localizer:r});return U.createElement(`div`,{key:s,className:`rbc-time-header-content rbc-resource-grouping`},U.createElement(`div`,{className:`rbc-row rbc-time-header-cell${e.length<=1?` rbc-time-header-cell-single-day`:``}`},U.createElement(`div`,{style:C,className:fO(`rbc-header`,S,r.isSameDate(n,b)&&`rbc-today`)},c?U.createElement(`button`,{type:`button`,className:`rbc-button-link`,onClick:function(e){return t.handleHeaderClick(n,c,e)}},w):U.createElement(`span`,null,w))),U.createElement(`div`,{className:`rbc-row`},f.map(function(e,t){var i=uO(e,2),a=i[0],o=i[1];return U.createElement(`div`,{key:`resource_${a}_${t}`,className:fO(`rbc-header`,S,r.isSameDate(n,b)&&`rbc-today`)},U.createElement(d,{index:t,label:p.resourceTitle(o),resource:o}))})),U.createElement(`div`,{className:`rbc-row rbc-m-b-negative-3 rbc-h-full`},f.map(function(e,i){var o=uO(e,2),s=o[0],c=o[1],l=(x.get(s)||[]).filter(function(e){return r.isSameDate(e.start,n)||r.isSameDate(e.end,n)});return U.createElement(sI,{key:`resource_${s}_${i}`,isAllDay:!0,rtl:h,getNow:a,minRows:2,maxRows:t.props.allDayMaxRows+1,range:[n],events:l,resourceId:c&&s,className:`rbc-allday-cell`,selectable:g,selected:t.props.selected,components:_,accessors:p,getters:v,localizer:r,onSelect:t.props.onSelectEvent,onShowMore:t.props.onShowMore,onDoubleClick:t.props.onDoubleClickEvent,onKeyDown:t.props.onKeyPressEvent,onSelectSlot:t.props.onSelectSlot,longPressThreshold:t.props.longPressThreshold,resizable:y})})))})}},{key:`render`,value:function(){var e=this.props,t=e.width,n=e.rtl,r=e.range,i=e.scrollRef,a=e.isOverflowing,o=e.components.timeGutterHeader,s={};return a&&(s[n?`marginLeft`:`marginRight`]=`${ij()-1}px`),U.createElement(`div`,{style:s,ref:i,className:fO(`rbc-time-header`,a&&`rbc-overflowing`)},U.createElement(`div`,{className:`rbc-label rbc-time-header-gutter`,style:{width:t,minWidth:t,maxWidth:t}},o&&U.createElement(o,null)),this.renderHeaderCells(r))}}])}(U.Component);function FI(e){var t=e.min,n=e.max,r=e.localizer;return r.getTimezoneOffset(t)===r.getTimezoneOffset(n)?{start:t,end:n}:{start:r.add(t,-1,`day`),end:r.add(n,-1,`day`)}}var II=function(e){var t=e.min,n=e.max,r=e.timeslots,i=e.step,a=e.localizer,o=e.getNow,s=e.resource,c=e.components,l=e.getters,u=e.gutterRef,d=c.timeGutterWrapper,f=(0,U.useMemo)(function(){return FI({min:t,max:n,localizer:a})},[t?.toISOString(),n?.toISOString(),a]),p=f.start,m=f.end,h=uO((0,U.useState)(mI({min:p,max:m,timeslots:r,step:i,localizer:a})),2),g=h[0],_=h[1];(0,U.useEffect)(function(){g&&_(g.update({min:p,max:m,timeslots:r,step:i,localizer:a}))},[p?.toISOString(),m?.toISOString(),r,i]);var v=(0,U.useCallback)(function(e,t){if(t)return null;var n=g.dateIsInGroup(o(),t);return U.createElement(`span`,{className:fO(`rbc-label`,n&&`rbc-now`)},a.format(e,`timeGutterFormat`))},[g,a,o]);return U.createElement(d,{slotMetrics:g},U.createElement(`div`,{className:`rbc-time-gutter rbc-time-column`,ref:u},g.groups.map(function(e,t){return U.createElement(wI,{key:t,group:e,resource:s,components:c,renderSlot:v,getters:l})})))},LI=U.forwardRef(function(e,t){return U.createElement(II,Object.assign({gutterRef:t},e))}),RI={};function zI(e,t){return{map:function(n){return e?e.map(function(e,r){return n([t.resourceId(e),e],r)}):[n([RI,null],0)]},groupEvents:function(n){var r=new Map;return e?(n.forEach(function(e){var n=t.resource(e)||RI;if(Array.isArray(n))n.forEach(function(t){var n=r.get(t)||[];n.push(e),r.set(t,n)});else{var i=r.get(n)||[];i.push(e),r.set(n,i)}}),r):(r.set(RI,n),r)}}}var BI=function(e){function t(e){var n;return YD(this,t),n=nO(this,t,[e]),n.handleScroll=function(e){n.scrollRef.current&&(n.scrollRef.current.scrollLeft=e.target.scrollLeft)},n.handleResize=function(){vA(n.rafHandle),n.rafHandle=yA(n.checkOverflow)},n.handleKeyPressEvent=function(){n.clearSelection();for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];mF(n.props.onKeyPressEvent,t)},n.handleSelectEvent=function(){n.clearSelection();for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];mF(n.props.onSelectEvent,t)},n.handleDoubleClickEvent=function(){n.clearSelection();for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];mF(n.props.onDoubleClickEvent,t)},n.handleShowMore=function(e,t,r,i,a){var o=n.props,s=o.popup,c=o.onDrillDown,l=o.onShowMore,u=o.getDrilldownView,d=o.doShowMoreDrillDown;if(n.clearSelection(),s){var f=uA(r,n.containerRef.current);n.setState({overlay:{date:t,events:e,position:KD(KD({},f),{},{width:`200px`}),target:a}})}else d&&mF(c,[t,u(t)||BP.DAY]);mF(l,[e,t,i])},n.handleSelectAllDaySlot=function(e,t){var r=n.props.onSelectSlot,i=new Date(e[0]),a=new Date(e[e.length-1]);a.setDate(e[e.length-1].getDate()+1),mF(r,{slots:e,start:i,end:a,action:t.action,resourceId:t.resourceId})},n.overlayDisplay=function(){n.setState({overlay:null})},n.checkOverflow=function(){if(!n._updatingOverflow){var e=n.contentRef.current;if(e!=null&&e.scrollHeight){var t=e.scrollHeight>e.clientHeight;n.state.isOverflowing!==t&&(n._updatingOverflow=!0,n.setState({isOverflowing:t},function(){n._updatingOverflow=!1}))}}},n.memoizedResources=hN(function(e,t){return zI(e,t)}),n.state={gutterWidth:void 0,isOverflowing:null},n.scrollRef=U.createRef(),n.contentRef=U.createRef(),n.containerRef=U.createRef(),n._scrollRatio=null,n.gutterRef=(0,U.createRef)(),n}return iO(t,e),ZD(t,[{key:`getSnapshotBeforeUpdate`,value:function(){return this.checkOverflow(),null}},{key:`componentDidMount`,value:function(){this.props.width??this.measureGutter(),this.calculateScroll(),this.applyScroll(),window.addEventListener(`resize`,this.handleResize)}},{key:`componentWillUnmount`,value:function(){window.removeEventListener(`resize`,this.handleResize),vA(this.rafHandle),this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest)}},{key:`componentDidUpdate`,value:function(){this.applyScroll()}},{key:`renderDayColumn`,value:function(e,t,n,r,i,a,o,s,c,l){var u=this.props,d=u.min,f=u.max,p=(r.get(t)||[]).filter(function(t){return a.inRange(e,o.start(t),o.end(t),`day`)}),m=(i.get(t)||[]).filter(function(t){return a.inRange(e,o.start(t),o.end(t),`day`)});return U.createElement(jI,Object.assign({},this.props,{localizer:a,min:a.merge(e,d),max:a.merge(e,f),resource:n&&t,components:s,isNow:a.isSameDate(e,l),key:`${t}-${e}`,date:e,events:p,backgroundEvents:m,dayLayoutAlgorithm:c}))}},{key:`renderResourcesFirst`,value:function(e,t,n,r,i,a,o,s,c){var l=this;return t.map(function(t){var u=uO(t,2),d=u[0],f=u[1];return e.map(function(e){return l.renderDayColumn(e,d,f,n,r,i,a,s,c,o)})})}},{key:`renderRangeFirst`,value:function(e,t,n,r,i,a,o,s,c){var l=this;return e.map(function(e){return U.createElement(`div`,{style:{display:`flex`,minHeight:`100%`,flex:1},key:e},t.map(function(t){var u=uO(t,2),d=u[0],f=u[1];return U.createElement(`div`,{style:{flex:1},key:a.resourceId(f)},l.renderDayColumn(e,d,f,n,r,i,a,s,c,o))}))})}},{key:`renderEvents`,value:function(e,t,n,r){var i=this.props,a=i.accessors,o=i.localizer,s=i.resourceGroupingLayout,c=i.components,l=i.dayLayoutAlgorithm,u=this.memoizedResources(this.props.resources,a),d=u.groupEvents(t),f=u.groupEvents(n);return s?this.renderRangeFirst(e,u,d,f,o,a,r,c,l):this.renderResourcesFirst(e,u,d,f,o,a,r,c,l)}},{key:`render`,value:function(){var e=this.props,t=e.events,n=e.backgroundEvents,r=e.range,i=e.width,a=e.rtl,o=e.selected,s=e.getNow,c=e.resources,l=e.components,u=e.accessors,d=e.getters,f=e.localizer,p=e.min,m=e.max,h=e.showMultiDayTimes,g=e.longPressThreshold,_=e.resizable,v=e.resourceGroupingLayout;i||=this.state.gutterWidth;var y=r[0],b=r[r.length-1];this.slots=r.length;var x=[],S=[],C=[];t.forEach(function(e){if(XF(e,y,b,u,f)){var t=u.start(e),n=u.end(e);u.allDay(e)||f.startAndEndAreDateOnly(t,n)||!h&&!f.isSameDate(t,n)?x.push(e):S.push(e)}}),n.forEach(function(e){XF(e,y,b,u,f)&&C.push(e)}),x.sort(function(e,t){return $F(e,t,u,f)});var w={range:r,events:x,width:i,rtl:a,getNow:s,localizer:f,selected:o,allDayMaxRows:this.props.showAllEvents?1/0:this.props.allDayMaxRows??1/0,resources:this.memoizedResources(c,u),selectable:this.props.selectable,accessors:u,getters:d,components:l,scrollRef:this.scrollRef,isOverflowing:this.state.isOverflowing,longPressThreshold:g,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:_};return U.createElement(`div`,{className:fO(`rbc-time-view`,c&&`rbc-time-view-resources`),ref:this.containerRef},c&&c.length>1&&v?U.createElement(PI,w):U.createElement(NI,w),this.props.popup&&this.renderOverlay(),U.createElement(`div`,{ref:this.contentRef,className:`rbc-time-content`,onScroll:this.handleScroll},U.createElement(LI,{date:y,ref:this.gutterRef,localizer:f,min:f.merge(y,p),max:f.merge(y,m),step:this.props.step,getNow:this.props.getNow,timeslots:this.props.timeslots,components:l,className:`rbc-time-gutter`,getters:d}),this.renderEvents(r,S,C,s())))}},{key:`renderOverlay`,value:function(){var e=this,t=this.state?.overlay??{},n=this.props,r=n.accessors,i=n.localizer,a=n.components,o=n.getters,s=n.selected,c=n.popupOffset,l=n.handleDragStart;return U.createElement(kF,{overlay:t,accessors:r,localizer:i,components:a,getters:o,selected:s,popupOffset:c,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:l,show:!!t.position,overlayDisplay:this.overlayDisplay,onHide:function(){return e.setState({overlay:null})}})}},{key:`clearSelection`,value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}},{key:`measureGutter`,value:function(){var e=this;this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest),this.measureGutterAnimationFrameRequest=window.requestAnimationFrame(function(){var t,n=(t=e.gutterRef)!=null&&t.current?gN(e.gutterRef.current):void 0;n&&e.state.gutterWidth!==n&&e.setState({gutterWidth:n})})}},{key:`applyScroll`,value:function(){if(this._scrollRatio!=null&&this.props.enableAutoScroll===!0){var e=this.contentRef.current;e.scrollTop=e.scrollHeight*this._scrollRatio,this._scrollRatio=null}}},{key:`calculateScroll`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,t=e.min,n=e.max,r=e.scrollToTime,i=e.localizer;this._scrollRatio=i.diff(i.merge(r,t),r,`milliseconds`)/i.diff(t,n,`milliseconds`)}}])}(U.Component);BI.defaultProps={step:30,timeslots:2,resourceGroupingLayout:!1};var VI=[`date`,`localizer`,`min`,`max`,`scrollToTime`,`enableAutoScroll`],HI=function(e){function t(){return YD(this,t),nO(this,t,arguments)}return iO(t,e),ZD(t,[{key:`render`,value:function(){var e=this.props,n=e.date,r=e.localizer,i=e.min,a=i===void 0?r.startOf(new Date,`day`):i,o=e.max,s=o===void 0?r.endOf(new Date,`day`):o,c=e.scrollToTime,l=c===void 0?r.startOf(new Date,`day`):c,u=e.enableAutoScroll,d=u===void 0?!0:u,f=JD(e,VI),p=t.range(n,{localizer:r});return U.createElement(BI,Object.assign({},f,{range:p,eventOffset:10,localizer:r,min:a,max:s,scrollToTime:l,enableAutoScroll:d}))}}])}(U.Component);HI.range=function(e,t){return[t.localizer.startOf(e,`day`)]},HI.navigate=function(e,t,n){var r=n.localizer;switch(t){case zP.PREVIOUS:return r.add(e,-1,`day`);case zP.NEXT:return r.add(e,1,`day`);default:return e}},HI.title=function(e,t){return t.localizer.format(e,`dayHeaderFormat`)};var UI=[`date`,`localizer`,`min`,`max`,`scrollToTime`,`enableAutoScroll`],WI=function(e){function t(){return YD(this,t),nO(this,t,arguments)}return iO(t,e),ZD(t,[{key:`render`,value:function(){var e=this.props,n=e.date,r=e.localizer,i=e.min,a=i===void 0?r.startOf(new Date,`day`):i,o=e.max,s=o===void 0?r.endOf(new Date,`day`):o,c=e.scrollToTime,l=c===void 0?r.startOf(new Date,`day`):c,u=e.enableAutoScroll,d=u===void 0?!0:u,f=JD(e,UI),p=t.range(n,this.props);return U.createElement(BI,Object.assign({},f,{range:p,eventOffset:15,localizer:r,min:a,max:s,scrollToTime:l,enableAutoScroll:d}))}}])}(U.Component);WI.defaultProps=BI.defaultProps,WI.navigate=function(e,t,n){var r=n.localizer;switch(t){case zP.PREVIOUS:return r.add(e,-1,`week`);case zP.NEXT:return r.add(e,1,`week`);default:return e}},WI.range=function(e,t){var n=t.localizer,r=n.startOfWeek(),i=n.startOf(e,`week`,r),a=n.endOf(e,`week`,r);return n.range(i,a)},WI.title=function(e,t){var n=t.localizer,r=RN(WI.range(e,{localizer:n})),i=r[0],a=r.slice(1);return n.format({start:i,end:a.pop()},`dayRangeHeaderFormat`)};var GI=[`date`,`localizer`,`min`,`max`,`scrollToTime`,`enableAutoScroll`];function KI(e,t){return WI.range(e,t).filter(function(e){return[6,0].indexOf(e.getDay())===-1})}var qI=function(e){function t(){return YD(this,t),nO(this,t,arguments)}return iO(t,e),ZD(t,[{key:`render`,value:function(){var e=this.props,t=e.date,n=e.localizer,r=e.min,i=r===void 0?n.startOf(new Date,`day`):r,a=e.max,o=a===void 0?n.endOf(new Date,`day`):a,s=e.scrollToTime,c=s===void 0?n.startOf(new Date,`day`):s,l=e.enableAutoScroll,u=l===void 0?!0:l,d=JD(e,GI),f=KI(t,this.props);return U.createElement(BI,Object.assign({},d,{range:f,eventOffset:15,localizer:n,min:i,max:o,scrollToTime:c,enableAutoScroll:u}))}}])}(U.Component);qI.defaultProps=BI.defaultProps,qI.range=KI,qI.navigate=WI.navigate,qI.title=function(e,t){var n=t.localizer,r=RN(KI(e,{localizer:n})),i=r[0],a=r.slice(1);return n.format({start:i,end:a.pop()},`dayRangeHeaderFormat`)};var JI=30;function YI(e){var t=e.accessors,n=e.components,r=e.date,i=e.events,a=e.getters,o=e.length,s=o===void 0?JI:o,c=e.localizer,l=e.onDoubleClickEvent,u=e.onSelectEvent,d=e.selected,f=(0,U.useRef)(null),p=(0,U.useRef)(null),m=(0,U.useRef)(null),h=(0,U.useRef)(null),g=(0,U.useRef)(null);(0,U.useEffect)(function(){y()});var _=function(e,r,i){var o=n.event,s=n.date;return r=r.filter(function(n){return XF(n,c.startOf(e,`day`),c.endOf(e,`day`),t,c)}),r.map(function(n,f){var p=t.title(n),m=t.end(n),h=t.start(n),g=a.eventProp(n,h,m,bF(n,d)),_=f===0&&c.format(e,`agendaDateFormat`),y=f===0?U.createElement(`td`,{rowSpan:r.length,className:`rbc-agenda-date-cell`},s?U.createElement(s,{day:e,label:_}):_):!1;return U.createElement(`tr`,{key:i+`_`+f,className:g.className,style:g.style},y,U.createElement(`td`,{className:`rbc-agenda-time-cell`},v(e,n)),U.createElement(`td`,{className:`rbc-agenda-event-cell`,onClick:function(e){return u&&u(n,e)},onDoubleClick:function(e){return l&&l(n,e)}},o?U.createElement(o,{event:n,title:p}):p))},[])},v=function(e,r){var i=``,a=n.time,o=c.messages.allDay,s=t.end(r),l=t.start(r);return t.allDay(r)||(c.eq(l,s)?o=c.format(l,`agendaTimeFormat`):c.isSameDate(l,s)?o=c.format({start:l,end:s},`agendaTimeRangeFormat`):c.isSameDate(e,l)?o=c.format(l,`agendaTimeFormat`):c.isSameDate(e,s)&&(o=c.format(s,`agendaTimeFormat`))),c.gt(e,l,`day`)&&(i=`rbc-continues-prior`),c.lt(e,s,`day`)&&(i+=` rbc-continues-after`),U.createElement(`span`,{className:i.trim()},a?U.createElement(a,{event:r,day:e,label:o}):o)},y=function(){if(g.current){var e=f.current,t=g.current.firstChild;if(t){var n=h.current.scrollHeight>h.current.clientHeight,r=[],i=r;r=[gN(t.children[0]),gN(t.children[1])],(i[0]!==r[0]||i[1]!==r[1])&&(p.current.style.width=r[0]+`px`,m.current.style.width=r[1]+`px`),n?(ej(e,`rbc-header-overflowing`),e.style.marginRight=ij()+`px`):nj(e,`rbc-header-overflowing`)}}},b=c.messages,x=c.add(r,s,`day`),S=c.range(r,x,`day`);return i=i.filter(function(e){return XF(e,c.startOf(r,`day`),c.endOf(x,`day`),t,c)}),i.sort(function(e,n){return t.start(e)-+t.start(n)}),U.createElement(`div`,{className:`rbc-agenda-view`},i.length===0?U.createElement(`span`,{className:`rbc-agenda-empty`},b.noEventsInRange):U.createElement(U.Fragment,null,U.createElement(`table`,{ref:f,className:`rbc-agenda-table`},U.createElement(`thead`,null,U.createElement(`tr`,null,U.createElement(`th`,{className:`rbc-header`,ref:p},b.date),U.createElement(`th`,{className:`rbc-header`,ref:m},b.time),U.createElement(`th`,{className:`rbc-header`},b.event)))),U.createElement(`div`,{className:`rbc-agenda-content`,ref:h},U.createElement(`table`,{className:`rbc-agenda-table`},U.createElement(`tbody`,{ref:g},S.map(function(e,t){return _(e,i,t)}))))))}YI.range=function(e,t){var n=t.length,r=n===void 0?JI:n;return{start:e,end:t.localizer.add(e,r,`day`)}},YI.navigate=function(e,t,n){var r=n.length,i=r===void 0?JI:r,a=n.localizer;switch(t){case zP.PREVIOUS:return a.add(e,-i,`day`);case zP.NEXT:return a.add(e,i,`day`);default:return e}},YI.title=function(e,t){var n=t.length,r=n===void 0?JI:n,i=t.localizer,a=i.add(e,r,`day`);return i.format({start:e,end:a},`agendaHeaderFormat`)};var XI=WD(WD(WD(WD(WD({},BP.MONTH,fI),BP.WEEK,WI),BP.WORK_WEEK,qI),BP.DAY,HI),BP.AGENDA,YI),ZI=[`action`,`date`,`today`];function QI(e,t){var n=t.action,r=t.date,i=t.today,a=JD(t,ZI);switch(e=typeof e==`string`?XI[e]:e,n){case zP.TODAY:r=i||new Date;break;case zP.DATE:break;default:(0,mO.default)(e&&typeof e.navigate==`function`,"Calendar View components must implement a static `.navigate(date, action)` method.s"),r=e.navigate(r,n,a)}return r}function $I(e,t){var n=null;return typeof t==`function`?n=t(e):typeof t==`string`&&VD(e)===`object`&&e!=null&&t in e&&(n=e[t]),n}var eL=function(e){return function(t){return $I(t,e)}},tL=[`view`,`date`,`getNow`,`onNavigate`],nL=[`view`,`toolbar`,`events`,`backgroundEvents`,`resourceGroupingLayout`,`style`,`className`,`elementProps`,`date`,`getNow`,`length`,`showMultiDayTimes`,`onShowMore`,`doShowMoreDrillDown`,`components`,`formats`,`messages`,`culture`];function rL(e){if(Array.isArray(e))return e;for(var t=[],n=0,r=Object.entries(e);n<r.length;n++){var i=uO(r[n],2),a=i[0];i[1]&&t.push(a)}return t}function iL(e,t){var n=t.views;return rL(n).indexOf(e)!==-1}var aL=function(e){function t(){var e;YD(this,t);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return e=nO(this,t,[].concat(r)),e.getViews=function(){var t=e.props.views;return Array.isArray(t)?(0,LP.default)(t,function(e,t){return e[t]=XI[t]},{}):VD(t)===`object`?(0,FP.default)(t,function(e,t){return e===!0?XI[t]:e}):XI},e.getView=function(){return e.getViews()[e.props.view]},e.getDrilldownView=function(t){var n=e.props,r=n.view,i=n.drilldownView,a=n.getDrilldownView;return a?a(t,r,Object.keys(e.getViews())):i},e.handleRangeChange=function(t,n,r){var i=e.props,a=i.onRangeChange,o=i.localizer;a&&n.range&&a(n.range(t,{localizer:o}),r)},e.handleNavigate=function(t,n){var r=e.props,i=r.view,a=r.date,o=r.getNow,s=r.onNavigate,c=JD(r,tL),l=e.getView(),u=o();a=QI(l,KD(KD({},c),{},{action:t,date:n||a||u,today:u})),s(a,i,t),e.handleRangeChange(a,l)},e.handleViewChange=function(t){t!==e.props.view&&iL(t,e.props)&&e.props.onView(t);var n=e.getViews();e.handleRangeChange(e.props.date||e.props.getNow(),n[t],t)},e.handleSelectEvent=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];mF(e.props.onSelectEvent,n)},e.handleDoubleClickEvent=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];mF(e.props.onDoubleClickEvent,n)},e.handleKeyPressEvent=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];mF(e.props.onKeyPressEvent,n)},e.handleSelectSlot=function(t){mF(e.props.onSelectSlot,t)},e.handleDrillDown=function(t,n){var r=e.props.onDrillDown;if(r){r(t,n,e.drilldownView);return}n&&e.handleViewChange(n),e.handleNavigate(zP.DATE,t)},e.state={context:t.getContext(e.props)},e}return iO(t,e),ZD(t,[{key:`render`,value:function(){var e=this.props,t=e.view,n=e.toolbar,r=e.events,i=e.backgroundEvents,a=e.resourceGroupingLayout,o=e.style,s=e.className,c=e.elementProps,l=e.date,u=e.getNow,d=e.length,f=e.showMultiDayTimes,p=e.onShowMore,m=e.doShowMoreDrillDown;e.components,e.formats,e.messages,e.culture;var h=JD(e,nL);l||=u();var g=this.getView(),_=this.state.context,v=_.accessors,y=_.components,b=_.getters,x=_.localizer,S=_.viewNames,C=y.toolbar||pF,w=g.title(l,{localizer:x,length:d});return U.createElement(`div`,Object.assign({},c,{className:fO(s,`rbc-calendar`,h.rtl&&`rbc-rtl`),style:o}),n&&U.createElement(C,{date:l,view:t,views:S,label:w,onView:this.handleViewChange,onNavigate:this.handleNavigate,localizer:x}),U.createElement(g,Object.assign({},h,{events:r,backgroundEvents:i,date:l,getNow:u,length:d,localizer:x,getters:b,components:y,accessors:v,showMultiDayTimes:f,getDrilldownView:this.getDrilldownView,onNavigate:this.handleNavigate,onDrillDown:this.handleDrillDown,onSelectEvent:this.handleSelectEvent,onDoubleClickEvent:this.handleDoubleClickEvent,onKeyPressEvent:this.handleKeyPressEvent,onSelectSlot:this.handleSelectSlot,onShowMore:p,doShowMoreDrillDown:m,resourceGroupingLayout:a})))}}],[{key:`getDerivedStateFromProps`,value:function(e){return{context:t.getContext(e)}}},{key:`getContext`,value:function(e){var t=e.startAccessor,n=e.endAccessor,r=e.allDayAccessor,i=e.tooltipAccessor,a=e.titleAccessor,o=e.resourceAccessor,s=e.resourceIdAccessor,c=e.resourceTitleAccessor,l=e.eventIdAccessor,u=e.eventPropGetter,d=e.backgroundEventPropGetter,f=e.slotPropGetter,p=e.slotGroupPropGetter,m=e.dayPropGetter,h=e.view,g=e.views,_=e.localizer,v=e.culture,y=e.messages,b=y===void 0?{}:y,x=e.components,S=x===void 0?{}:x,C=e.formats,w=C===void 0?{}:C,T=rL(g);return{viewNames:T,localizer:fF(_,v,w,gF(b)),getters:{eventProp:function(){return u&&u.apply(void 0,arguments)||{}},backgroundEventProp:function(){return d&&d.apply(void 0,arguments)||{}},slotProp:function(){return f&&f.apply(void 0,arguments)||{}},slotGroupProp:function(){return p&&p.apply(void 0,arguments)||{}},dayProp:function(){return m&&m.apply(void 0,arguments)||{}}},components:(0,PP.default)(S[h]||{},(0,IP.default)(S,T),{eventWrapper:RP,backgroundEventWrapper:RP,eventContainerWrapper:RP,dateCellWrapper:RP,weekWrapper:RP,timeSlotWrapper:RP,timeGutterWrapper:RP,timeIndicatorWrapper:RP}),accessors:{start:eL(t),end:eL(n),allDay:eL(r),tooltip:eL(i),title:eL(a),resource:eL(o),resourceId:eL(s),resourceTitle:eL(c),eventId:eL(l)}}}}])}(U.Component);aL.defaultProps={events:[],backgroundEvents:[],elementProps:{},popup:!1,toolbar:!0,view:BP.MONTH,views:[BP.MONTH,BP.WEEK,BP.DAY,BP.AGENDA],step:30,length:30,allDayMaxRows:1/0,doShowMoreDrillDown:!0,drilldownView:BP.DAY,titleAccessor:`title`,tooltipAccessor:`title`,allDayAccessor:`allDay`,startAccessor:`start`,endAccessor:`end`,resourceAccessor:`resourceId`,resourceIdAccessor:`id`,resourceTitleAccessor:`title`,eventIdAccessor:`id`,longPressThreshold:250,getNow:function(){return new Date},dayLayoutAlgorithm:`overlap`};var oL=EO(aL,{view:`onView`,date:`onNavigate`,selected:`onSelectEvent`}),sL=function(e,t,n){var r=e.start,i=e.end;return n.format(r,`MMMM DD`,t)+` – `+n.format(i,n.eq(r,i,`month`)?`DD`:`MMMM DD`,t)},cL=function(e,t,n){var r=e.start,i=e.end;return n.format(r,`L`,t)+` – `+n.format(i,`L`,t)},lL=function(e,t,n){var r=e.start,i=e.end;return n.format(r,`LT`,t)+` – `+n.format(i,`LT`,t)},uL={dateFormat:`DD`,dayFormat:`DD ddd`,weekdayFormat:`ddd`,selectRangeFormat:lL,eventTimeRangeFormat:lL,eventTimeRangeStartFormat:function(e,t,n){var r=e.start;return n.format(r,`LT`,t)+` – `},eventTimeRangeEndFormat:function(e,t,n){var r=e.end;return` – `+n.format(r,`LT`,t)},timeGutterFormat:`LT`,monthHeaderFormat:`MMMM YYYY`,dayHeaderFormat:`dddd MMM DD`,dayRangeHeaderFormat:sL,agendaHeaderFormat:cL,agendaDateFormat:`ddd MMM DD`,agendaTimeFormat:`LT`,agendaTimeRangeFormat:lL};function dL(e){var t=e&&e.toLowerCase();return t===`FullYear`?t=`year`:t||=void 0,t}function fL(e){var t=function(e,t){return t?e.locale(t):e};function n(t){return e(t).toDate().getTimezoneOffset()}function r(t,n){var r=e(t).local(),i=e(n).local();if(!e.tz)return r.toDate().getTimezoneOffset()-i.toDate().getTimezoneOffset();var a=r?._z?.name??e.tz.guess();return e.tz.zone(a).utcOffset(+r)-e.tz.zone(a).utcOffset(+i)}function i(t){return r(e(t).startOf(`day`),t)}function a(t,n,r){var i=dL(r);return[i?e(t).startOf(i):e(t),i?e(n).startOf(i):e(n),i]}function o(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=dL(arguments.length>1?arguments[1]:void 0);return n?e(t).startOf(n).toDate():e(t).toDate()}function s(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=dL(arguments.length>1?arguments[1]:void 0);return n?e(t).endOf(n).toDate():e(t).toDate()}function c(e,t,n){var r=uO(a(e,t,n),3),i=r[0],o=r[1],s=r[2];return i.isSame(o,s)}function l(e,t,n){return!c(e,t,n)}function u(e,t,n){var r=uO(a(e,t,n),3),i=r[0],o=r[1],s=r[2];return i.isAfter(o,s)}function d(e,t,n){var r=uO(a(e,t,n),3),i=r[0],o=r[1],s=r[2];return i.isBefore(o,s)}function f(e,t,n){var r=uO(a(e,t,n),3),i=r[0],o=r[1],s=r[2];return i.isSameOrBefore(o,s)}function p(e,t,n){var r=uO(a(e,t,n),3),i=r[0],o=r[1],s=r[2];return i.isSameOrBefore(o,s)}function m(t,n,r){var i=dL(arguments.length>3&&arguments[3]!==void 0?arguments[3]:`day`),a=e(t),o=e(n),s=e(r);return a.isBetween(o,s,i,`[]`)}function h(t,n){var r=e(t),i=e(n);return e.min(r,i).toDate()}function g(t,n){var r=e(t),i=e(n);return e.max(r,i).toDate()}function _(t,n){if(!t&&!n)return null;var r=e(n).format(`HH:mm:ss`);return e(`${e(t).startOf(`day`).format(`MM/DD/YYYY`)} ${r}`,`MM/DD/YYYY HH:mm:ss`).toDate()}function v(t,n,r){var i=dL(r);return e(t).add(n,i).toDate()}function y(t,n){for(var r=dL(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`day`),i=e(t).toDate(),a=[];p(i,n);)a.push(i),i=v(i,1,r);return a}function b(e,t){var n=dL(t),r=o(e,n);return c(r,e)?r:v(r,1,n)}function x(t,n){var r=dL(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`day`),i=e(t);return e(n).diff(i,r)}function S(t){return e(t).minutes()}function C(t){var n=t?e.localeData(t):e.localeData();return n?n.firstDayOfWeek():0}function w(t){return e(t).startOf(`month`).startOf(`week`).toDate()}function T(t){return e(t).endOf(`month`).endOf(`week`).toDate()}function E(e){for(var t=w(e),n=T(e),r=[];p(t,n);)r.push(t),t=v(t,1,`d`);return r}function D(t,n,r){return e(t).startOf(`day`).minute(n+r).toDate()}function O(e,t){return x(e,t,`minutes`)}function k(t){var n=e(t).startOf(`day`);return e(t).diff(n,`minutes`)+i(t)}function A(t,n){var r=e(t),i=e(n);return r.isBefore(i,`day`)}function j(t,n,r){var i=e(n),a=e(r);return i.isSameOrAfter(a,`minutes`)}function ee(t,n){var r=e(t),i=e(n);return e.duration(i.diff(r)).days()}function te(e){var t=e.evtA,n=t.start,r=t.end,i=t.allDay,a=e.evtB,s=a.start,c=a.end,l=a.allDay,u=o(n,`day`)-+o(s,`day`),d=ee(n,r),f=ee(s,c);return u||f-d||!!l-!!i||n-+s||r-+c}function ne(t){var n=t.event,r=n.start,i=n.end,a=t.range,o=a.start,s=a.end,c=e(r).startOf(`day`),l=e(i),u=e(o),d=e(s),f=c.isSameOrBefore(d,`day`),p=c.isSame(l,`minutes`)?l.isSameOrAfter(u,`minutes`):l.isAfter(u,`minutes`);return f&&p}function re(t,n){var r=e(t),i=e(n);return r.isSame(i,`day`)}function ie(){var t=new Date,n=/-/.test(t.toString())?`-`:``,r=t.getTimezoneOffset(),i=Number(`${n}${Math.abs(r)}`);return e().utcOffset()>i?1:0}return new dF({formats:uL,firstOfWeek:C,firstVisibleDay:w,lastVisibleDay:T,visibleDays:E,format:function(n,r,i){return t(e(n),i).format(r)},lt:d,lte:p,gt:u,gte:f,eq:c,neq:l,merge:_,inRange:m,startOf:o,endOf:s,range:y,add:v,diff:x,ceil:b,min:h,max:g,minutes:S,getSlotDate:D,getTimezoneOffset:n,getDstOffset:r,getTotalMin:O,getMinutesFromMidnight:k,continuesPrior:A,continuesAfter:j,sortEvents:te,inEventRange:ne,isSameDate:re,daySpan:ee,browserTZOffset:ie})}Bi(),Ce(),Qr(),H(),N();function pL(e,t,n,r,i){let a={start:r.start(e),end:r.end(e)},o={start:t,end:n};return i.inEventRange({event:a,range:o})}function mL(e,t){return!e||t==null?!1:Ri(e,t)}var hL={PREVIOUS:`PREV`,NEXT:`NEXT`,TODAY:`TODAY`,DATE:`DATE`};function gL({accessors:e,components:t,date:n,events:r,getters:i,length:a,localizer:o,onDoubleClickEvent:s,onSelectEvent:c,selected:l}){(0,U.useRef)(null);let u=(0,U.useRef)(null),d=(0,U.useRef)(null),p=(0,U.useRef)(null),m=(0,U.useRef)(null),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)(!1),y=(n,r,a)=>{let{event:u,date:d}=t;return r=r.filter(t=>pL(t,o.startOf(n,`day`),o.endOf(n,`day`),e,o)),r.map((t,f)=>{let p=e.title(t),m=e.end(t),h=e.start(t),g=i.eventProp(t,h,m,mL(t,l)),_=f===0&&o.format(n,`agendaDateFormat`),v=f===0?(0,W.jsx)(`td`,{rowSpan:r.length,className:`rbc-agenda-date-cell`,children:d?(0,W.jsx)(d,{day:n,label:_}):_}):!1;return(0,W.jsxs)(`tr`,{className:g.className,style:g.style,children:[v,(0,W.jsx)(`td`,{className:`rbc-agenda-time-cell`,children:b(n,t)}),(0,W.jsx)(`td`,{className:`rbc-agenda-event-cell`,onClick:e=>c&&c(t,e),onDoubleClick:e=>s&&s(t,e),children:u?(0,W.jsx)(u,{event:t,title:p}):p})]},a+`_`+f)},[])},b=(n,r)=>{let i=t.time,a=``,s=o.messages.allDay,c=e.end(r),l=e.start(r);return e.allDay(r)||(o.eq(l,c)?s=o.format(l,`agendaTimeFormat`):o.isSameDate(l,c)?s=o.format({start:l,end:c},`agendaTimeRangeFormat`):o.isSameDate(n,l)?s=o.format(l,`agendaTimeFormat`):o.isSameDate(n,c)&&(s=o.format(c,`agendaTimeFormat`))),o.gt(n,l,`day`)&&(a=`rbc-continues-prior`),o.lt(n,c,`day`)&&(a+=` rbc-continues-after`),(0,W.jsx)(`span`,{className:a.trim(),children:i?(0,W.jsx)(i,{event:r,day:n,label:s}):s})},{messages:x}=o,S=o.add(n,-(a/2),`day`),C=o.add(n,a/2,`day`),w=o.range(S,C,`day`);h&&w.reverse(),r=r.filter(t=>pL(t,o.startOf(S,`day`),o.endOf(C,`day`),e,o)),r.sort((t,n)=>e.start(t)-+e.start(n)),_&&r.reverse();let T=(0,U.useCallback)(()=>setTimeout(()=>{m.current&&xS(m.current,{backgroundColor:`#ffffff`,pixelRatio:window.devicePixelRatio*2}).then(e=>{new f.Notice(M(`Image is generating...`));let t=L.getState().settings.AutoSaveWhenOnMobile,n=L.getState().app.vault;if(t&&f.Platform.isMobile){let t=e.split(`base64,`)[1];Zr(t,`image/png`).arrayBuffer().then(async e=>{let t,r=ce();for(let e in r)if(r[e]instanceof f.TFile){t=r[e];break}t!==void 0&&await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,`png`,t),e)})}KS({imgUrl:e})}).catch(e=>{console.error(e)})},0),[m.current,w]),E=(0,U.useCallback)(e=>{let t=new f.Menu;console.log(m.current),t.addItem(e=>{e.setIcon(`share-2`).setTitle(M(`Share`)).onClick(()=>{T()})}),t.showAtMouseEvent(e.nativeEvent)},[m.current,w,T]);return(0,W.jsx)(`div`,{className:`rbc-agenda-view`,children:r.length===0?(0,W.jsx)(`span`,{className:`rbc-agenda-empty`,children:x.noEventsInRange}):(0,W.jsx)(U.Fragment,{children:(0,W.jsxs)(`table`,{ref:m,className:`rbc-agenda-table`,children:[(0,W.jsx)(`thead`,{onContextMenu:E,children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{className:`rbc-header`,ref:u,onClick:()=>{g(!h)},children:x.date+(h?` 🔼`:` 🔽`)}),(0,W.jsx)(`th`,{className:`rbc-header`,ref:d,onClick:()=>{v(!_)},children:x.time+(_?` 🔼`:` 🔽`)}),(0,W.jsx)(`th`,{className:`rbc-header`,children:x.event})]})}),(0,W.jsx)(`tbody`,{ref:p,children:w.map((e,t)=>y(e,r,t))})]})})})}gL.propTypes={accessors:K.default.object.isRequired,components:K.default.object.isRequired,date:K.default.instanceOf(Date),events:K.default.array,getters:K.default.object.isRequired,length:K.default.number.isRequired,localizer:K.default.object.isRequired,onSelectEvent:K.default.func,onDoubleClickEvent:K.default.func,selected:K.default.object},gL.defaultProps={length:30},gL.range=(e,{length:t=gL.defaultProps.length,localizer:n})=>({customStart:n.add(e,-(t/2),`day`),customEnd:n.add(e,t/2,`day`)}),gL.navigate=(e,t,{length:n=gL.defaultProps.length,localizer:r})=>{switch(t){case hL.PREVIOUS:return r.add(e,-n,`day`);case hL.NEXT:return r.add(e,n,`day`);default:return e}},gL.title=(e,{length:t=gL.defaultProps.length,localizer:n})=>{let r=n.add(e,-(t/2),`day`),i=n.add(e,t/2,`day`);return n.format({start:r,end:i},`agendaHeaderFormat`)},H();function _L(e,t){e.hoverEl.toggleClass(`thino-hover-popover`,!0);let n=(0,$g.createRoot)(e.hoverEl);return n.render((0,W.jsx)(gT,{memo:t})),n}function vL({event:e}){let t=e.resource,n=t.content.split(`
|
||
`)[0].slice(0,20),r=U.useRef(null),i=U.useRef(null),a=U.useRef(null);(0,U.useEffect)(()=>{if(i.current)return(0,f.setIcon)(i.current,`calendar`),()=>{r.current&&=null}},[r]);let o=(0,U.useCallback)(e=>{a.current&&=(console.log(`unmounting`,a.current),a.current.unmount(),null),a.current=e},[]),s=(0,U.useCallback)(e=>{console.log(`hovering`),r.current&&f.Keymap.isModifier(e.nativeEvent,`Mod`)&&o(_L(new f.HoverPopover(L.getState().view,r.current,100),t))},[r.current]);return(0,W.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:s,children:[(0,W.jsx)(yL,{event:e}),(0,W.jsx)(`span`,{children:n})]})}var yL=({event:e})=>{let t=U.useRef(null),n=e.resource;return(0,U.useEffect)(()=>{t.current&&(0,f.setIcon)(t.current,n.thinoType===`JOURNAL`?`calendar`:n.thinoType===`TASK-TODO`?`square`:`check-square`)},[n?.thinoType,t]),(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`span`,{className:`rbc-event-icon-group`,children:[(0,W.jsx)(`span`,{className:`rbc-event-icon`,ref:t,onClick:(0,U.useCallback)(async e=>{e.stopPropagation(),e.preventDefault(),await(async()=>{let e=await V.updateMemo(n.id,n.content,n.thinoType===`TASK-TODO`?`TASK-DONE`:`TASK-TODO`);e&&V.editMemo(e)})()},[n?.thinoType,n?.id,n?.content])}),(0,W.jsx)(`span`,{className:u_(`rbc-event-time`,`thino-hidden`),children:(0,W.jsx)(`span`,{className:`rbc-event-time-text`,children:(0,f.moment)(e.start).format(`HH:mm`)})})]})})};function bL({views:e,view:t,messages:n,onView:r}){return e.map(e=>(0,W.jsx)(`button`,{type:`button`,className:u_({"rbc-active":t===e}),onClick:()=>r(e),children:n[e]},e))}bL.propTypes={messages:K.default.object,onView:K.default.func,view:K.default.string,views:K.default.array};function xL({date:e,label:t,localizer:{messages:n},onNavigate:r,onView:i,view:a,views:o}){let s={previous:(0,U.useRef)(null),today:(0,U.useRef)(null),next:(0,U.useRef)(null)};(0,U.useEffect)(()=>{s&&((0,f.setIcon)(s.previous.current,`chevron-left`),(0,f.setIcon)(s.today.current,`dot`),(0,f.setIcon)(s.next.current,`chevron-right`))},[s]);let c=(0,U.useMemo)(()=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{ref:s.previous,type:`button`,onClick:()=>r(hL.PREVIOUS),"aria-label":n.previous,children:`<`}),(0,W.jsx)(`button`,{ref:s.today,type:`button`,onClick:()=>r(hL.TODAY),"aria-label":n.today,children:`•`}),(0,W.jsx)(`button`,{ref:s.next,type:`button`,onClick:()=>r(hL.NEXT),"aria-label":n.next,children:`>`})]}),[n]);return(0,W.jsxs)(`div`,{className:`rbc-toolbar`,children:[(0,W.jsx)(`span`,{className:u_(`rbc-btn-group`,`thino-view-custom-toolbar`),children:c}),(0,W.jsx)(`span`,{className:`rbc-toolbar-label`,children:(0,W.jsx)(Yb,{type:`text`,handleValueChange:e=>{r(hL.DATE,(0,f.moment)(e,`YYYY-MM-DD`).format(`YYYY-MM-DDTHH:mm:ssZ`))},defaultText:t+(a===`week`?(0,f.moment)(e.valueOf(),`x`).format(` [W]WW`):``),defaultValue:(0,f.moment)(e.valueOf(),`x`).valueOf()})}),(0,W.jsx)(`span`,{className:`rbc-btn-group`,children:(0,W.jsx)(bL,{view:a,views:o,messages:n,onView:i})})]})}xL.propTypes={date:K.default.instanceOf(Date),label:K.default.string,localizer:K.default.object,messages:K.default.object,onNavigate:K.default.func,onView:K.default.func,view:K.default.string,views:K.default.array};function SL({event:e,children:t,showPopup:n,callRender:r,...i}){let a=(0,U.useRef)(null),o=(0,U.useRef)(null),s=(0,U.useCallback)(t=>{if(!t.isTrusted){r();return}o.current=t.nativeEvent.target,o.current&&(o.current.hasClass(`rbc-event`)||(o.current=o.current.closest(`.rbc-event`)),a.current===null?a.current=window.setTimeout(()=>{n(e,o.current),a.current=null},250):(window.clearTimeout(a.current),a.current=null))},[e,n]);return(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:`rbc-event-wrapper`,"aria-describedby":`thino`,onClick:s,children:t})})}N(),H();var CL=fL(f.moment),wL=({event:e})=>{let t=e.resource;return(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(gT,{memo:t})})},TL=e=>{let{thinos:t}=e,[n,r]=U.useState([]),[i,a]=U.useState(app?.loadLocalStorage(`thino-calendar-view`)||`month`),[o,s]=U.useState(null),c=U.useRef(null),l=U.useRef(null),[u,d]=U.useState(!1),p=(0,U.useRef)(null),[m,h]=(0,U.useState)(new Date);(0,U.useEffect)(()=>()=>{c.current&&=null,l.current&&=null,p.current&&=null},[]),(0,U.useEffect)(()=>{r(t.map(e=>{let t=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`),n=t.clone().add(1,`minute`);return{title:e.content,start:new Date(t.format(`YYYY-MM-DDTHH:mm:ss`)),end:new Date(n.format(`YYYY-MM-DDTHH:mm:ss`)),resource:e}}))},[t]),(0,U.useEffect)(()=>{app?.saveLocalStorage(`thino-calendar-view`,i)},[i]),(0,U.useEffect)(()=>{o&&u&&s(t.find(e=>e.id===o.id))},[t,o,u]),(0,U.useEffect)(()=>{o&&p.current.update()},[o]),p.current=Ib(c.current,l.current,{placement:`bottom-start`,modifiers:[{name:`offset`,options:{offset:[0,4]}}]});let g=(0,U.useCallback)(()=>{p.current.update(),p.current.update()},[]),_=(0,U.useCallback)((e,t)=>{s(null),x(),p.current.state.elements.reference=t,s(e.resource),S()},[]),v=(0,U.useCallback)(()=>{x(),s(null)},[]),y=(0,U.useCallback)((e,t,n)=>{if(b(e),t===`week`||t===`day`){let e=c.current.find(`.rbc-event-wrapper`);if(c.current.closest(`.memolist-wrapper`),e){e.children[0]?.click();return}else{setTimeout(()=>{(c.current.find(`.rbc-event-wrapper`)?.children?.[0])?.click()},0);return}}},[]),b=(0,U.useCallback)(e=>{h(e)},[h]);hv(l,v);let x=(0,U.useCallback)(()=>{d(!1)},[d]),S=(0,U.useCallback)(()=>{p.current.update(),d(!0)},[d]),C=(0,U.useCallback)(e=>{let t=e.resource;R.setEditMemoId(t.id)},[]),w=(0,U.useCallback)(e=>{a(e)},[a]),{components:T,views:E,messages:D}=(0,U.useMemo)(()=>({components:{toolbar:xL,eventWrapper:e=>(0,W.jsx)(SL,{...e,callRender:g,showPopup:_}),agenda:{event:wL},event:vL},views:{month:!0,agenda:gL,week:!0,day:!0},messages:{month:M(`Month`),day:M(`Day`),next:M(`Next`),previous:M(`Previous`),today:M(`Today`),agenda:M(`Agenda`),week:M(`Week`),yesterday:M(`Yesterday`),tomorrow:M(`Tomorrow`),noEventsInRange:M(`No thinos in range`),date:M(`date`),time:M(`time`),event:M(`event`)}}),[]);return(0,W.jsxs)(`div`,{ref:c,className:`calendar-view`,children:[(0,W.jsx)(oL,{date:m,messages:D,components:T,localizer:CL,events:n,views:E,onView:w,onDoubleClickEvent:C,onNavigate:y,formats:(0,U.useMemo)(()=>({timeGutterFormat:(e,t,n)=>n.format(e,`HH:mm`,t),agendaTimeRangeFormat:({start:e,end:t},n,r)=>r.format(e,`HH:mm`,n)+` — `+r.format(t,`HH:mm`,n),agendaHeaderFormat:({start:e,end:t},n,r)=>r.format(e,`YYYY-MM-DD`)+` — `+r.format(t,`YYYY-MM-DD`)}),[]),defaultView:i,tooltipAccessor:null,startAccessor:`start`,endAccessor:`end`}),(0,W.jsx)(`div`,{ref:l,style:p.current?.styles.popper,className:u_(`thino-popup-container`,u?``:`thino-hidden`),children:o&&(0,W.jsx)(gT,{memo:o})})]})};function EL(e,t){return typeof e==`function`?e(t):e}function DL(e,t){return n=>{t.setState(t=>({...t,[e]:EL(n,t[e])}))}}function OL(e){return e instanceof Function}function kL(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function AL(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i!=null&&i.length&&r(i)})};return r(e),n}function jL(e,t,n){let r=[],i;return a=>{let o;n.key&&n.debug&&(o=Date.now());let s=e(a);if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
||
font-size: .6rem;
|
||
font-weight: bold;
|
||
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return i}}function ML(e,t,n,r){return{debug:()=>e?.debugAll??e[t],key:!1,onChange:r}}function NL(e,t,n,r){let i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>i.getValue()??e.options.renderFallbackValue,getContext:jL(()=>[e,n,t,i],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),ML(e.options,`debugCells`,`cell.getContext`))};return e._features.forEach(r=>{r.createCell==null||r.createCell(i,n,t,e)},{}),i}function PL(e,t,n,r){let i={...e._getDefaultColumnDef(),...t},a=i.accessorKey,o=i.id??(a?typeof String.prototype.replaceAll==`function`?a.replaceAll(`.`,`_`):a.replace(/\./g,`_`):void 0)??(typeof i.header==`string`?i.header:void 0),s;if(i.accessorFn?s=i.accessorFn:a&&(s=a.includes(`.`)?e=>{let t=e;for(let e of a.split(`.`))t=t?.[e];return t}:e=>e[i.accessorKey]),!o)throw Error();let c={id:`${String(o)}`,accessorFn:s,parent:r,depth:n,columnDef:i,columns:[],getFlatColumns:jL(()=>[!0],()=>[c,...c.columns?.flatMap(e=>e.getFlatColumns())],ML(e.options,`debugColumns`,`column.getFlatColumns`)),getLeafColumns:jL(()=>[e._getOrderColumnsFn()],e=>{var t;return(t=c.columns)!=null&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},ML(e.options,`debugColumns`,`column.getLeafColumns`))};for(let t of e._features)t.createColumn==null||t.createColumn(c,e);return c}var FL=`debugHeaders`;function IL(e,t,n){let r={id:n.id??t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{t.createHeader==null||t.createHeader(r,e)}),r}var LL={createTable:e=>{e.getHeaderGroups=jL(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{let a=r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],o=i?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],s=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id)));return RL(t,[...a,...s,...o],e)},ML(e.options,FL,`getHeaderGroups`)),e.getCenterHeaderGroups=jL(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id))),RL(t,n,e,`center`)),ML(e.options,FL,`getCenterHeaderGroups`)),e.getLeftHeaderGroups=jL(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>RL(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`left`),ML(e.options,FL,`getLeftHeaderGroups`)),e.getRightHeaderGroups=jL(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>RL(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`right`),ML(e.options,FL,`getRightHeaderGroups`)),e.getFooterGroups=jL(()=>[e.getHeaderGroups()],e=>[...e].reverse(),ML(e.options,FL,`getFooterGroups`)),e.getLeftFooterGroups=jL(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),ML(e.options,FL,`getLeftFooterGroups`)),e.getCenterFooterGroups=jL(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),ML(e.options,FL,`getCenterFooterGroups`)),e.getRightFooterGroups=jL(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),ML(e.options,FL,`getRightFooterGroups`)),e.getFlatHeaders=jL(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),ML(e.options,FL,`getFlatHeaders`)),e.getLeftFlatHeaders=jL(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),ML(e.options,FL,`getLeftFlatHeaders`)),e.getCenterFlatHeaders=jL(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),ML(e.options,FL,`getCenterFlatHeaders`)),e.getRightFlatHeaders=jL(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),ML(e.options,FL,`getRightFlatHeaders`)),e.getCenterLeafHeaders=jL(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),ML(e.options,FL,`getCenterLeafHeaders`)),e.getLeftLeafHeaders=jL(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),ML(e.options,FL,`getLeftLeafHeaders`)),e.getRightLeafHeaders=jL(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),ML(e.options,FL,`getRightLeafHeaders`)),e.getLeafHeaders=jL(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>[...e[0]?.headers??[],...t[0]?.headers??[],...n[0]?.headers??[]].map(e=>e.getLeafHeaders()).flat(),ML(e.options,FL,`getLeafHeaders`))}};function RL(e,t,n,r){let i=0,a=function(e,t){t===void 0&&(t=1),i=Math.max(i,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;(n=e.columns)!=null&&n.length&&a(e.columns,t+1)},0)};a(e);let o=[],s=(e,t)=>{let i={depth:t,id:[r,`${t}`].filter(Boolean).join(`_`),headers:[]},a=[];e.forEach(e=>{let o=[...a].reverse()[0],s=e.column.depth===i.depth,c,l=!1;if(s&&e.column.parent?c=e.column.parent:(c=e.column,l=!0),o&&o?.column===c)o.subHeaders.push(e);else{let i=IL(n,c,{id:[r,t,c.id,e?.id].filter(Boolean).join(`_`),isPlaceholder:l,placeholderId:l?`${a.filter(e=>e.column===c).length}`:void 0,depth:t,index:a.length});i.subHeaders.push(e),a.push(i)}i.headers.push(e),e.headerGroup=i}),o.push(i),t>0&&s(a,t-1)};s(t.map((e,t)=>IL(n,e,{depth:i,index:t})),i-1),o.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];e.subHeaders&&e.subHeaders.length?(r=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,r.push(i)})):t=1;let i=Math.min(...r);return n+=i,e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(o[0]?.headers??[]),o}var zL=(e,t,n,r,i,a,o)=>{let s={id:t,index:r,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return s._valuesCache[t]=n.accessorFn(s.original,r),s._valuesCache[t]},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return n.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t])},renderValue:t=>s.getValue(t)??e.options.renderFallbackValue,subRows:a??[],getLeafRows:()=>AL(s.subRows,e=>e.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:jL(()=>[e.getAllLeafColumns()],t=>t.map(t=>NL(e,s,t,t.id)),ML(e.options,`debugRows`,`getAllCells`)),_getAllCellsByColumnId:jL(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),ML(e.options,`debugRows`,`getAllCellsByColumnId`))};for(let t=0;t<e._features.length;t++){let n=e._features[t];n==null||n.createRow==null||n.createRow(s,e)}return s},BL={createColumn:(e,t)=>{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()}}},VL=(e,t,n)=>{var r,i;let a=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(a))};VL.autoRemove=e=>ZL(e);var HL=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};HL.autoRemove=e=>ZL(e);var UL=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};UL.autoRemove=e=>ZL(e);var WL=(e,t,n)=>e.getValue(t)?.includes(n);WL.autoRemove=e=>ZL(e);var GL=(e,t,n)=>!n.some(n=>{var r;return!((r=e.getValue(t))!=null&&r.includes(n))});GL.autoRemove=e=>ZL(e)||!(e!=null&&e.length);var KL=(e,t,n)=>n.some(n=>e.getValue(t)?.includes(n));KL.autoRemove=e=>ZL(e)||!(e!=null&&e.length);var qL=(e,t,n)=>e.getValue(t)===n;qL.autoRemove=e=>ZL(e);var JL=(e,t,n)=>e.getValue(t)==n;JL.autoRemove=e=>ZL(e);var YL=(e,t,n)=>{let[r,i]=n,a=e.getValue(t);return a>=r&&a<=i};YL.resolveFilterValue=e=>{let[t,n]=e,r=typeof t==`number`?t:parseFloat(t),i=typeof n==`number`?n:parseFloat(n),a=t===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(i)?1/0:i;if(a>o){let e=a;a=o,o=e}return[a,o]},YL.autoRemove=e=>ZL(e)||ZL(e[0])&&ZL(e[1]);var XL={includesString:VL,includesStringSensitive:HL,equalsString:UL,arrIncludes:WL,arrIncludesAll:GL,arrIncludesSome:KL,equals:qL,weakEquals:JL,inNumberRange:YL};function ZL(e){return e==null||e===``}var QL={getDefaultColumnDef:()=>({filterFn:`auto`}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:DL(`columnFilters`,e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);return typeof n==`string`?XL.includesString:typeof n==`number`?XL.inNumberRange:typeof n==`boolean`||typeof n==`object`&&n?XL.equals:Array.isArray(n)?XL.arrIncludes:XL.weakEquals},e.getFilterFn=()=>OL(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn===`auto`?e.getAutoFilterFn():t.options.filterFns?.[e.columnDef.filterFn]??XL[e.columnDef.filterFn],e.getCanFilter=()=>(e.columnDef.enableColumnFilter??!0)&&(t.options.enableColumnFilters??!0)&&(t.options.enableFilters??!0)&&!!e.accessorFn,e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(t=>t.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>t.getState().columnFilters?.findIndex(t=>t.id===e.id)??-1,e.setFilterValue=n=>{t.setColumnFilters(t=>{let r=e.getFilterFn(),i=t?.find(t=>t.id===e.id),a=EL(n,i?i.value:void 0);if($L(r,a,e))return t?.filter(t=>t.id!==e.id)??[];let o={id:e.id,value:a};return i?t?.map(t=>t.id===e.id?o:t)??[]:t!=null&&t.length?[...t,o]:[o]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(e=>EL(t,e)?.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&$L(t.getFilterFn(),e.value,t))}))},e.resetColumnFilters=t=>{e.setColumnFilters(t?[]:e.initialState?.columnFilters??[])},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())}};function $L(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||t===void 0||typeof t==`string`&&!t}var eR={sum:(e,t,n)=>n.reduce((t,n)=>{let r=n.getValue(e);return t+(typeof r==`number`?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r>n||r===void 0&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r<n||r===void 0&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r===void 0?n>=n&&(r=i=n):(r>n&&(r=n),i<n&&(i=n)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let i=t.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!kL(n))return;if(n.length===1)return n[0];let r=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2==0?(i[r-1]+i[r])/2:i[r]},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},tR={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return((t=e.getValue())==null||t.toString==null?void 0:t.toString())??null},aggregationFn:`auto`}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:DL(`grouping`,e),groupedColumnMode:`reorder`}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(t=>t!==e.id):[...t??[],e.id])},e.getCanGroup=()=>(e.columnDef.enableGrouping??!0)&&(t.options.enableGrouping??!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue),e.getIsGrouped=()=>t.getState().grouping?.includes(e.id),e.getGroupedIndex=()=>t.getState().grouping?.indexOf(e.id),e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);if(typeof n==`number`)return eR.sum;if(Object.prototype.toString.call(n)===`[object Date]`)return eR.extent},e.getAggregationFn=()=>{if(!e)throw Error();return OL(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn===`auto`?e.getAutoAggregationFn():t.options.aggregationFns?.[e.columnDef.aggregationFn]??eR[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{e.setGrouping(t?[]:e.initialState?.grouping??[])},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];let 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 t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((t=n.subRows)!=null&&t.length)}}};function nR(e,t,n){if(!(t!=null&&t.length)||!n)return e;let r=e.filter(e=>!t.includes(e.id));return n===`remove`?r:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...r]}var rR={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:DL(`columnOrder`,e)}),createColumn:(e,t)=>{e.getIndex=jL(e=>[mR(t,e)],t=>t.findIndex(t=>t.id===e.id),ML(t.options,`debugColumns`,`getIndex`)),e.getIsFirstColumn=n=>mR(t,n)[0]?.id===e.id,e.getIsLastColumn=n=>{let r=mR(t,n);return r[r.length-1]?.id===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},e._getOrderColumnsFn=jL(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let i=[];if(!(e!=null&&e.length))i=r;else{let t=[...e],n=[...r];for(;n.length&&t.length;){let e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&i.push(n.splice(r,1)[0])}i=[...i,...n]}return nR(i,t,n)},ML(e.options,`debugTable`,`_getOrderColumnsFn`))}},iR=()=>({left:[],right:[]}),aR={getInitialState:e=>({columnPinning:iR(),...e}),getDefaultOptions:e=>({onColumnPinningChange:DL(`columnPinning`,e)}),createColumn:(e,t)=>{e.pin=n=>{let r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>n===`right`?{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:[...(e?.right??[]).filter(e=>!(r!=null&&r.includes(e))),...r]}:n===`left`?{left:[...(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),...r],right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))}:{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))})},e.getCanPin=()=>e.getLeafColumns().some(e=>(e.columnDef.enablePinning??!0)&&(t.options.enableColumnPinning??t.options.enablePinning??!0)),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:r,right:i}=t.getState().columnPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`left`:o?`right`:!1},e.getPinnedIndex=()=>{var n;let r=e.getIsPinned();return r?((n=t.getState().columnPinning)==null||(n=n[r])==null?void 0:n.indexOf(e.id))??-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=jL(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.column.id))},ML(t.options,`debugRows`,`getCenterVisibleCells`)),e.getLeftVisibleCells=jL(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`left`})),ML(t.options,`debugRows`,`getLeftVisibleCells`)),e.getRightVisibleCells=jL(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`right`})),ML(t.options,`debugRows`,`getRightVisibleCells`))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>e.setColumnPinning(t?iR():e.initialState?.columnPinning??iR()),e.getIsSomeColumnsPinned=t=>{let n=e.getState().columnPinning;return t?!!n[t]?.length:!!(n.left?.length||n.right?.length)},e.getLeftLeafColumns=jL(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),ML(e.options,`debugColumns`,`getLeftLeafColumns`)),e.getRightLeafColumns=jL(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),ML(e.options,`debugColumns`,`getRightLeafColumns`)),e.getCenterLeafColumns=jL(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.id))},ML(e.options,`debugColumns`,`getCenterLeafColumns`))}};function oR(e){return e||(typeof document<`u`?document:null)}var sR={size:150,minSize:20,maxSize:2**53-1},cR=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),lR={getDefaultColumnDef:()=>sR,getInitialState:e=>({columnSizing:{},columnSizingInfo:cR(),...e}),getDefaultOptions:e=>({columnResizeMode:`onEnd`,columnResizeDirection:`ltr`,onColumnSizingChange:DL(`columnSizing`,e),onColumnSizingInfoChange:DL(`columnSizingInfo`,e)}),createColumn:(e,t)=>{e.getSize=()=>{let n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??sR.minSize,n??e.columnDef.size??sR.size),e.columnDef.maxSize??sR.maxSize)},e.getStart=jL(e=>[e,mR(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),ML(t.options,`debugColumns`,`getStart`)),e.getAfter=jL(e=>[e,mR(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),ML(t.options,`debugColumns`,`getAfter`)),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let r=t.getColumn(e.column.id),i=r?.getCanResize();return a=>{if(!r||!i||(a.persist==null||a.persist(),fR(a)&&a.touches&&a.touches.length>1))return;let o=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],c=fR(a)?Math.round(a.touches[0].clientX):a.clientX,l={},u=(e,n)=>{typeof n==`number`&&(t.setColumnSizingInfo(e=>{let r=t.options.columnResizeDirection===`rtl`?-1:1,i=(n-(e?.startOffset??0))*r,a=Math.max(i/(e?.startSize??0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;l[t]=Math.round(Math.max(n+n*a,0)*100)/100}),{...e,deltaOffset:i,deltaPercentage:a}}),(t.options.columnResizeMode===`onChange`||e===`end`)&&t.setColumnSizing(e=>({...e,...l})))},d=e=>u(`move`,e),f=e=>{u(`end`,e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=oR(n),m={moveHandler:e=>d(e.clientX),upHandler:e=>{p?.removeEventListener(`mousemove`,m.moveHandler),p?.removeEventListener(`mouseup`,m.upHandler),f(e.clientX)}},h={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{p?.removeEventListener(`touchmove`,h.moveHandler),p?.removeEventListener(`touchend`,h.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0]?.clientX)}},g=dR()?{passive:!1}:!1;fR(a)?(p?.addEventListener(`touchmove`,h.moveHandler,g),p?.addEventListener(`touchend`,h.upHandler,g)):(p?.addEventListener(`mousemove`,m.moveHandler,g),p?.addEventListener(`mouseup`,m.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,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=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},e.resetHeaderSizeInfo=t=>{e.setColumnSizingInfo(t?cR():e.initialState.columnSizingInfo??cR())},e.getTotalSize=()=>e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getLeftTotalSize=()=>e.getLeftHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getCenterTotalSize=()=>e.getCenterHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getRightTotalSize=()=>e.getRightHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0}},uR=null;function dR(){if(typeof uR==`boolean`)return uR;let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener(`test`,n,t),window.removeEventListener(`test`,n)}catch{e=!1}return uR=e,uR}function fR(e){return e.type===`touchstart`}var pR={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:DL(`columnVisibility`,e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{let n=e.columns;return(n.length?n.some(e=>e.getIsVisible()):t.getState().columnVisibility?.[e.id])??!0},e.getCanHide=()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=jL(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),ML(t.options,`debugRows`,`_getAllVisibleCells`)),e.getVisibleCells=jL(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],ML(t.options,`debugRows`,`getVisibleCells`))},createTable:e=>{let t=(t,n)=>jL(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join(`_`)],e=>e.filter(e=>e.getIsVisible==null?void 0:e.getIsVisible()),ML(e.options,`debugColumns`,t));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=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},e.toggleAllColumnsVisible=t=>{t??=!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(n.getCanHide!=null&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(e.getIsVisible!=null&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>e.getIsVisible==null?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{e.toggleAllColumnsVisible(t.target?.checked)}}};function mR(e,t){return t?t===`center`?e.getCenterVisibleLeafColumns():t===`left`?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}var hR={createTable:e=>{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()}}},gR={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:DL(`globalFilter`,e),globalFilterFn:`auto`,getColumnCanGlobalFilter:t=>{var n;let 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.getCanGlobalFilter=()=>(e.columnDef.enableGlobalFilter??!0)&&(t.options.enableGlobalFilter??!0)&&(t.options.enableFilters??!0)&&((t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn},createTable:e=>{e.getGlobalAutoFilterFn=()=>XL.includesString,e.getGlobalFilterFn=()=>{let{globalFilterFn:t}=e.options;return OL(t)?t:t===`auto`?e.getGlobalAutoFilterFn():e.options.filterFns?.[t]??XL[t]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},_R={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:DL(`expanded`,e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{e.setExpanded(t?{}:e.initialState?.expanded??{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{t.persist==null||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return t===!0||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return typeof t==`boolean`?t===!0:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(`.`);t=Math.max(t,n.length)}),t},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=>{let i=r===!0?!0:!!(r!=null&&r[e.id]),a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=r,n??=!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){let{[e.id]:t,...n}=a;return n}return r})},e.getIsExpanded=()=>{let n=t.getState().expanded;return!!((t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))??(n===!0||n?.[e.id]))},e.getCanExpand=()=>{var n;return(t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!!((n=e.subRows)!=null&&n.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=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},vR=0,yR=10,bR=()=>({pageIndex:vR,pageSize:yR}),xR={getInitialState:e=>({...e,pagination:{...bR(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:DL(`pagination`,e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(e=>EL(t,e)),e.resetPagination=t=>{e.setPagination(t?bR():e.initialState.pagination??bR())},e.setPageIndex=t=>{e.setPagination(n=>{let r=EL(t,n.pageIndex),i=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n;e.setPageIndex(t?vR:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageIndex)??vR)},e.resetPageSize=t=>{var n;e.setPageSize(t?yR:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageSize)??yR)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,EL(t,e.pageSize)),r=e.pageSize*e.pageIndex,i=Math.floor(r/n);return{...e,pageIndex:i,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{let r=EL(t,e.options.pageCount??-1);return typeof r==`number`&&(r=Math.max(-1,r)),{...n,pageCount:r}}),e.getPageOptions=jL(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},ML(e.options,`debugTable`,`getPageOptions`)),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return n===-1?!0:n===0?!1:t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+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=()=>e.options.pageCount??Math.ceil(e.getRowCount()/e.getState().pagination.pageSize),e.getRowCount=()=>e.options.rowCount??e.getPrePaginationRowModel().rows.length}},SR=()=>({top:[],bottom:[]}),CR={getInitialState:e=>({rowPinning:SR(),...e}),getDefaultOptions:e=>({onRowPinningChange:DL(`rowPinning`,e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{let a=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],o=i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...o,e.id,...a]);t.setRowPinning(e=>n===`bottom`?{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:[...(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)]}:n===`top`?{top:[...(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)],bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))}:{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))})},e.getCanPin=()=>{let{enableRowPinning:n,enablePinning:r}=t.options;return typeof n==`function`?n(e):n??r??!0},e.getIsPinned=()=>{let n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`top`:o?`bottom`:!1},e.getPinnedIndex=()=>{let n=e.getIsPinned();return n?((n===`top`?t.getTopRows():t.getBottomRows())?.map(e=>{let{id:t}=e;return t}))?.indexOf(e.id)??-1:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>e.setRowPinning(t?SR():e.initialState?.rowPinning??SR()),e.getIsSomeRowsPinned=t=>{let n=e.getState().rowPinning;return t?!!n[t]?.length:!!(n.top?.length||n.bottom?.length)},e._getPinnedRows=(t,n,r)=>(e.options.keepPinnedRows??!0?(n??[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(n??[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r})),e.getTopRows=jL(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,`top`),ML(e.options,`debugRows`,`getTopRows`)),e.getBottomRows=jL(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,`bottom`),ML(e.options,`debugRows`,`getBottomRows`)),e.getCenterRows=jL(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let r=new Set([...t??[],...n??[]]);return e.filter(e=>!r.has(e.id))},ML(e.options,`debugRows`,`getCenterRows`))}},wR={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:DL(`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=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=t===void 0?!e.getIsAllRowsSelected():t;let r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):i.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let r=t===void 0?!e.getIsAllPageRowsSelected():t,i={...n};return e.getRowModel().rows.forEach(t=>{TR(i,t.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=jL(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?ER(e,n):{rows:[],flatRows:[],rowsById:{}},ML(e.options,`debugTable`,`getSelectedRowModel`)),e.getFilteredSelectedRowModel=jL(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?ER(e,n):{rows:[],flatRows:[],rowsById:{}},ML(e.options,`debugTable`,`getFilteredSelectedRowModel`)),e.getGroupedSelectedRowModel=jL(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?ER(e,n):{rows:[],flatRows:[],rowsById:{}},ML(e.options,`debugTable`,`getGroupedSelectedRowModel`)),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),r=!!(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{let t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{let i=e.getIsSelected();t.setRowSelection(a=>{if(n=n===void 0?!i:n,e.getCanSelect()&&i===n)return a;let o={...a};return TR(o,e.id,n,r?.selectChildren??!0,t),o})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return DR(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return OR(e,n)===`some`},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return OR(e,n)===`all`},e.getCanSelect=()=>typeof t.options.enableRowSelection==`function`?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,e.getCanSelectSubRows=()=>typeof t.options.enableSubRowSelection==`function`?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,e.getCanMultiSelect=()=>typeof t.options.enableMultiRowSelection==`function`?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{t&&e.toggleSelected(n.target?.checked)}}}},TR=(e,t,n,r,i)=>{var a;let o=i.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(a=o.subRows)!=null&&a.length&&o.getCanSelectSubRows()&&o.subRows.forEach(t=>TR(e,t.id,n,r,i))};function ER(e,t){let n=e.getState().rowSelection,r=[],i={},a=function(e,t){return e.map(e=>{var t;let o=DR(e,n);if(o&&(r.push(e),i[e.id]=e),(t=e.subRows)!=null&&t.length&&(e={...e,subRows:a(e.subRows)}),o)return e}).filter(Boolean)};return{rows:a(t.rows),flatRows:r,rowsById:i}}function DR(e,t){return t[e.id]??!1}function OR(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,a=!1;return e.subRows.forEach(e=>{if(!(a&&!i)&&(e.getCanSelect()&&(DR(e,t)?a=!0:i=!1),e.subRows&&e.subRows.length)){let n=OR(e,t);n===`all`?a=!0:(n===`some`&&(a=!0),i=!1)}}),i?`all`:a?`some`:!1}var kR=/([0-9]+)/gm,AR=(e,t,n)=>RR(LR(e.getValue(n)).toLowerCase(),LR(t.getValue(n)).toLowerCase()),jR=(e,t,n)=>RR(LR(e.getValue(n)),LR(t.getValue(n))),MR=(e,t,n)=>IR(LR(e.getValue(n)).toLowerCase(),LR(t.getValue(n)).toLowerCase()),NR=(e,t,n)=>IR(LR(e.getValue(n)),LR(t.getValue(n))),PR=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},FR=(e,t,n)=>IR(e.getValue(n),t.getValue(n));function IR(e,t){return e===t?0:e>t?1:-1}function LR(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function RR(e,t){let n=e.split(kR).filter(Boolean),r=t.split(kR).filter(Boolean);for(;n.length&&r.length;){let e=n.shift(),t=r.shift(),i=parseInt(e,10),a=parseInt(t,10),o=[i,a].sort();if(isNaN(o[0])){if(e>t)return 1;if(t>e)return-1;continue}if(isNaN(o[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}var zR={alphanumeric:AR,alphanumericCaseSensitive:jR,text:MR,textCaseSensitive:NR,datetime:PR,basic:FR},BR=[LL,pR,rR,aR,BL,QL,hR,gR,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:`auto`,sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:DL(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),r=!1;for(let t of n){let n=t?.getValue(e.id);if(Object.prototype.toString.call(n)===`[object Date]`)return zR.datetime;if(typeof n==`string`&&(r=!0,n.split(kR).length>1))return zR.alphanumeric}return r?zR.text:zR.basic},e.getAutoSortDir=()=>typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id)==`string`?`asc`:`desc`,e.getSortingFn=()=>{if(!e)throw Error();return OL(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn===`auto`?e.getAutoSortingFn():t.options.sortingFns?.[e.columnDef.sortingFn]??zR[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{let i=e.getNextSortingOrder(),a=n!=null;t.setSorting(o=>{let s=o?.find(t=>t.id===e.id),c=o?.findIndex(t=>t.id===e.id),l=[],u,d=a?n:i===`desc`;return u=o!=null&&o.length&&e.getCanMultiSort()&&r?s?`toggle`:`add`:o!=null&&o.length&&c!==o.length-1?`replace`:s?`toggle`:`replace`,u===`toggle`&&(a||i||(u=`remove`)),u===`add`?(l=[...o,{id:e.id,desc:d}],l.splice(0,l.length-(t.options.maxMultiSortColCount??2**53-1))):l=u===`toggle`?o.map(t=>t.id===e.id?{...t,desc:d}:t):u===`remove`?o.filter(t=>t.id!==e.id):[{id:e.id,desc:d}],l})},e.getFirstSortDir=()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??e.getAutoSortDir()===`desc`?`desc`:`asc`,e.getNextSortingOrder=n=>{let r=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==r&&(t.options.enableSortingRemoval??!0)&&(!n||(t.options.enableMultiRemove??!0))?!1:i===`desc`?`asc`:`desc`:r},e.getCanSort=()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,e.getCanMultiSort=()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,e.getIsSorted=()=>{let n=t.getState().sorting?.find(t=>t.id===e.id);return n?n.desc?`desc`:`asc`:!1},e.getSortIndex=()=>t.getState().sorting?.findIndex(t=>t.id===e.id)??-1,e.clearSorting=()=>{t.setSorting(t=>t!=null&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let 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=>{e.setSorting(t?[]:e.initialState?.sorting??[])},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())}},tR,_R,xR,CR,wR,lR];function VR(e){let t=[...BR,...e._features??[]],n={_features:t},r=n._features.reduce((e,t)=>Object.assign(e,t.getDefaultOptions==null?void 0:t.getDefaultOptions(n)),{}),i=e=>n.options.mergeOptions?n.options.mergeOptions(r,e):{...r,...e},a={...e.initialState??{}};n._features.forEach(e=>{a=(e.getInitialState==null?void 0:e.getInitialState(a))??a});let o=[],s=!1,c={_features:t,options:{...r,...e},initialState:a,_queue:e=>{o.push(e),s||(s=!0,Promise.resolve().then(()=>{for(;o.length;)o.shift()();s=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{n.options=i(EL(e,n.options))},getState:()=>n.options.state,setState:e=>{n.options.onStateChange==null||n.options.onStateChange(e)},_getRowId:(e,t,r)=>(n.options.getRowId==null?void 0:n.options.getRowId(e,t,r))??`${r?[r.id,t].join(`.`):t}`,getCoreRowModel:()=>(n._getCoreRowModel||=n.options.getCoreRowModel(n),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?n.getPrePaginationRowModel():n.getRowModel()).rowsById[e];if(!r&&(r=n.getCoreRowModel().rowsById[e],!r))throw Error();return r},_getDefaultColumnDef:jL(()=>[n.options.defaultColumn],e=>(e??={},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return((t=e.renderValue())==null||t.toString==null?void 0:t.toString())??null},...n._features.reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef==null?void 0:t.getDefaultColumnDef()),{}),...e}),ML(e,`debugColumns`,`_getDefaultColumnDef`)),_getColumnDefs:()=>n.options.columns,getAllColumns:jL(()=>[n._getColumnDefs()],e=>{let t=function(e,r,i){return i===void 0&&(i=0),e.map(e=>{let a=PL(n,e,i,r),o=e;return a.columns=o.columns?t(o.columns,a,i+1):[],a})};return t(e)},ML(e,`debugColumns`,`getAllColumns`)),getAllFlatColumns:jL(()=>[n.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),ML(e,`debugColumns`,`getAllFlatColumns`)),_getAllFlatColumnsById:jL(()=>[n.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),ML(e,`debugColumns`,`getAllFlatColumnsById`)),getAllLeafColumns:jL(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),ML(e,`debugColumns`,`getAllLeafColumns`)),getColumn:e=>n._getAllFlatColumnsById()[e]};Object.assign(n,c);for(let e=0;e<n._features.length;e++){let t=n._features[e];t==null||t.createTable==null||t.createTable(n)}return n}function HR(){return e=>jL(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},r=function(t,i,a){i===void 0&&(i=0);let o=[];for(let c=0;c<t.length;c++){let l=zL(e,e._getRowId(t[c],c,a),t[c],c,i,void 0,a?.id);if(n.flatRows.push(l),n.rowsById[l.id]=l,o.push(l),e.options.getSubRows){var s;l.originalSubRows=e.options.getSubRows(t[c],c),(s=l.originalSubRows)!=null&&s.length&&(l.subRows=r(l.originalSubRows,i+1,l))}}return o};return n.rows=r(t),n},ML(e.options,`debugTable`,`getRowModel`,()=>e._autoResetPageIndex()))}function UR(e){let t=[],n=e=>{var r;t.push(e),(r=e.subRows)!=null&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function WR(){return(e,t)=>jL(()=>[e.getColumn(t)?.getFacetedRowModel()],e=>{if(!e)return;let n=e.flatRows.flatMap(e=>e.getUniqueValues(t)??[]).map(Number).filter(e=>!Number.isNaN(e));if(!n.length)return;let r=n[0],i=n[n.length-1];for(let e of n)e<r?r=e:e>i&&(i=e);return[r,i]},ML(e.options,`debugTable`,`getFacetedMinMaxValues`))}function GR(e,t,n){return n.options.filterFromLeafRows?KR(e,t,n):qR(e,t,n)}function KR(e,t,n){let r=[],i={},a=n.options.maxLeafRowFilterDepth??100,o=function(e,s){s===void 0&&(s=0);let c=[];for(let u=0;u<e.length;u++){var l;let d=e[u],f=zL(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(f.columnFilters=d.columnFilters,(l=d.subRows)!=null&&l.length&&s<a){if(f.subRows=o(d.subRows,s+1),d=f,t(d)&&!f.subRows.length){c.push(d),i[d.id]=d,r.push(d);continue}if(t(d)||f.subRows.length){c.push(d),i[d.id]=d,r.push(d);continue}}else d=f,t(d)&&(c.push(d),i[d.id]=d,r.push(d))}return c};return{rows:o(e),flatRows:r,rowsById:i}}function qR(e,t,n){let r=[],i={},a=n.options.maxLeafRowFilterDepth??100,o=function(e,s){s===void 0&&(s=0);let c=[];for(let u=0;u<e.length;u++){let d=e[u];if(t(d)){var l;if((l=d.subRows)!=null&&l.length&&s<a){let e=zL(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);e.subRows=o(d.subRows,s+1),d=e}c.push(d),r.push(d),i[d.id]=d}}return c};return{rows:o(e),flatRows:r,rowsById:i}}function JR(){return(e,t)=>jL(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,i)=>{if(!n.rows.length||!(r!=null&&r.length)&&!i)return n;let a=[...r.map(e=>e.id).filter(e=>e!==t),i?`__global__`:void 0].filter(Boolean);return GR(n.rows,e=>{for(let t=0;t<a.length;t++)if(e.columnFilters[a[t]]===!1)return!1;return!0},e)},ML(e.options,`debugTable`,`getFacetedRowModel`))}function YR(){return(e,t)=>jL(()=>[e.getColumn(t)?.getFacetedRowModel()],e=>{if(!e)return new Map;let n=new Map;for(let r=0;r<e.flatRows.length;r++){let i=e.flatRows[r].getUniqueValues(t);for(let e=0;e<i.length;e++){let t=i[e];n.has(t)?n.set(t,(n.get(t)??0)+1):n.set(t,1)}}return n},ML(e.options,`debugTable`,`getFacetedUniqueValues_${t}`))}function XR(){return e=>jL(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}let i=[],a=[];(n??[]).forEach(t=>{let n=e.getColumn(t.id);if(!n)return;let r=n.getFilterFn();r&&i.push({id:t.id,filterFn:r,resolvedValue:(r.resolveFilterValue==null?void 0:r.resolveFilterValue(t.value))??t.value})});let o=(n??[]).map(e=>e.id),s=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());r&&s&&c.length&&(o.push(`__global__`),c.forEach(e=>{a.push({id:e.id,filterFn:s,resolvedValue:(s.resolveFilterValue==null?void 0:s.resolveFilterValue(r))??r})}));let l,u;for(let e=0;e<t.flatRows.length;e++){let n=t.flatRows[e];if(n.columnFilters={},i.length)for(let e=0;e<i.length;e++){l=i[e];let t=l.id;n.columnFilters[t]=l.filterFn(n,t,l.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(a.length){for(let e=0;e<a.length;e++){u=a[e];let t=u.id;if(u.filterFn(n,t,u.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}n.columnFilters.__global__!==!0&&(n.columnFilters.__global__=!1)}}return GR(t.rows,e=>{for(let t=0;t<o.length;t++)if(e.columnFilters[o[t]]===!1)return!1;return!0},e)},ML(e.options,`debugTable`,`getFilteredRowModel`,()=>e._autoResetPageIndex()))}function ZR(e){return e=>jL(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{if(!n.rows.length)return n;let{pageSize:r,pageIndex:i}=t,{rows:a,flatRows:o,rowsById:s}=n,c=r*i,l=c+r;a=a.slice(c,l);let u;u=e.options.paginateExpandedRows?{rows:a,flatRows:o,rowsById:s}:UR({rows:a,flatRows:o,rowsById:s}),u.flatRows=[];let d=e=>{u.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return u.rows.forEach(d),u},ML(e.options,`debugTable`,`getPaginationRowModel`))}function QR(){return e=>jL(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;let r=e.getState().sorting,i=[],a=r.filter(t=>e.getColumn(t.id)?.getCanSort()),o={};a.forEach(t=>{let n=e.getColumn(t.id);n&&(o[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let s=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let n=0;n<a.length;n+=1){let r=a[n],i=o[r.id],s=i.sortUndefined,c=r?.desc??!1,l=0;if(s){let n=e.getValue(r.id),i=t.getValue(r.id),a=n===void 0,o=i===void 0;if(a||o){if(s===`first`)return a?-1:1;if(s===`last`)return a?1:-1;l=a&&o?0:a?s:-s}}if(l===0&&(l=i.sortingFn(e,t,r.id)),l!==0)return c&&(l*=-1),i.invertSorting&&(l*=-1),l}return e.index-t.index}),t.forEach(e=>{var t;i.push(e),(t=e.subRows)!=null&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},ML(e.options,`debugTable`,`getSortedRowModel`,()=>e._autoResetPageIndex()))}function $R(e,t){return e?ez(e)?U.createElement(e,t):e:null}function ez(e){return tz(e)||typeof e==`function`||nz(e)}function tz(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function nz(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function rz(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=U.useState(()=>({current:VR(t)})),[r,i]=U.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),e.onStateChange==null||e.onStateChange(t)}})),n.current}var iz={À:`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`},az=Object.keys(iz).join(`|`),oz=new RegExp(az,`g`);function sz(e){return e.replace(oz,e=>iz[e])}var cz={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function lz(e,t,n){if(n||={},n.threshold=n.threshold??cz.MATCHES,!n.accessors){let r=uz(e,t,n);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:n.threshold,passed:r>=n.threshold}}let r=gz(e,n.accessors),i={rankedValue:e,rank:cz.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let e=0;e<r.length;e++){let a=r[e],o=uz(a.itemValue,t,n),{minRanking:s,maxRanking:c,threshold:l=n.threshold}=a.attributes;o<s&&o>=cz.MATCHES?o=s:o>c&&(o=c),o=Math.min(o,c),o>=l&&o>i.rank&&(i.rank=o,i.passed=!0,i.accessorIndex=e,i.accessorThreshold=l,i.rankedValue=a.itemValue)}return i}function uz(e,t,n){return e=mz(e,n),t=mz(t,n),t.length>e.length?cz.NO_MATCH:e===t?cz.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?cz.EQUAL:e.startsWith(t)?cz.STARTS_WITH:e.includes(` ${t}`)?cz.WORD_STARTS_WITH:e.includes(t)?cz.CONTAINS:t.length===1?cz.NO_MATCH:dz(e).includes(t)?cz.ACRONYM:fz(e,t))}function dz(e){let t=``;return e.split(` `).forEach(e=>{e.split(`-`).forEach(e=>{t+=e.substr(0,1)})}),t}function fz(e,t){let n=0,r=0;function i(e,t,r){for(let i=r,a=t.length;i<a;i++)if(t[i]===e)return n+=1,i+1;return-1}function a(e){let r=1/e,i=n/t.length;return cz.MATCHES+i*r}let o=i(t[0],e,0);if(o<0)return cz.NO_MATCH;r=o;for(let n=1,a=t.length;n<a;n++){let a=t[n];if(r=i(a,e,r),!(r>-1))return cz.NO_MATCH}return a(r-o)}function pz(e,t){return e.rank===t.rank?0:e.rank>t.rank?-1:1}function mz(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=sz(e)),e}function hz(e,t){let n=t;typeof t==`object`&&(n=t.accessor);let r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function gz(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r],a=vz(i),o=hz(e,i);for(let e=0,t=o.length;e<t;e++)n.push({itemValue:o[e],attributes:a})}return n}var _z={maxRanking:1/0,minRanking:-1/0};function vz(e){return typeof e==`function`?_z:{..._z,...e}}var yz;(function(e){e.csv=`text/csv`,e.tsv=`text/tab-separated-values`,e.plain=`text/plain`})(yz||={});var bz=e=>e,xz=e=>e,Sz=bz,Cz=bz,wz=bz,Tz=bz,Ez=bz,Dz={fieldSeparator:`,`,decimalSeparator:`.`,quoteStrings:!0,quoteCharacter:`"`,showTitle:!1,title:`My Generated Report`,filename:`generated`,showColumnHeaders:!0,useTextFile:!1,fileExtension:`csv`,mediaType:yz.csv,useBom:!0,columnHeaders:[],useKeysAsHeaders:!1,boolDisplay:{true:`TRUE`,false:`FALSE`},replaceUndefinedWith:``},Oz=`\r
|
||
`,kz=``,Az=e=>Object.assign({},Dz,e),jz=class extends Error{constructor(e){super(e),this.name=`CsvGenerationError`}},Mz=class extends Error{constructor(e){super(e),this.name=`EmptyHeadersError`}},Nz=class extends Error{constructor(e){super(e),this.name=`UnsupportedDataFormatError`}},Pz=function(e,t){return t==`"`&&e.indexOf(`"`)>-1?e.replace(/"/g,`""`):e},Fz=e=>Tz(typeof e==`object`?e.key:e),Iz=e=>Ez(typeof e==`object`?e.displayLabel:e),Lz=(e,...t)=>t.reduce((e,t)=>t(e),e),Rz=e=>t=>e.useBom?Cz(xz(t)+kz):t,zz=e=>t=>e.showTitle?Bz(Cz(xz(t)+e.title))(wz(``)):t,Bz=e=>t=>Cz(xz(e)+xz(t)+Oz),Vz=e=>(t,n)=>Hz(e)(wz(xz(t)+xz(n))),Hz=e=>t=>bz(xz(t)+e.fieldSeparator),Uz=(e,t)=>n=>{if(!e.showColumnHeaders)return n;if(t.length<1)throw new Mz(`Option to show headers but none supplied. Make sure there are keys in your collection or that you've supplied headers through the config options.`);let r=wz(``);for(let n=0;n<t.length;n++){let i=Iz(t[n]);r=Vz(e)(r,Zz(e,xz(i)))}return r=wz(xz(r).slice(0,-1)),Bz(n)(r)},Wz=(e,t,n)=>r=>{let i=r;for(var a=0;a<n.length;a++){let r=wz(``);for(let i=0;i<t.length;i++){let o=Fz(t[i]),s=n[a][xz(o)];r=Vz(e)(r,Zz(e,s))}r=wz(xz(r).slice(0,-1)),i=Bz(i)(r)}return i},Gz=xz,Kz=e=>+e===e&&(!isFinite(e)||!!(e%1)),qz=(e,t)=>{if(Kz(t)){if(e.decimalSeparator===`locale`)return Sz(t.toLocaleString());if(e.decimalSeparator)return Sz(t.toString().replace(`.`,e.decimalSeparator))}return Sz(t.toString())},Jz=(e,t)=>{let n=t;return(e.quoteStrings||e.fieldSeparator&&t.indexOf(e.fieldSeparator)>-1||e.quoteCharacter&&t.indexOf(e.quoteCharacter)>-1||t.indexOf(`
|
||
`)>-1||t.indexOf(`\r`)>-1)&&(n=e.quoteCharacter+Pz(t,e.quoteCharacter)+e.quoteCharacter),Sz(n)},Yz=(e,t)=>{let n=t?`true`:`false`;return Sz(e.boolDisplay[n])},Xz=(e,t)=>t===void 0&&e.replaceUndefinedWith!==void 0?Jz(e,e.replaceUndefinedWith+``):t===null?Jz(e,`null`):Jz(e,``),Zz=(e,t)=>{if(typeof t==`number`)return qz(e,t);if(typeof t==`string`)return Jz(e,t);if(typeof t==`boolean`&&e.boolDisplay)return Yz(e,t);if(t==null)return Xz(e,t);throw new Nz(`
|
||
typeof ${typeof t} isn't supported. Only number, string, boolean, null and undefined are supported.
|
||
Please convert the data in your object to one of those before generating the CSV.
|
||
`)},Qz=e=>t=>{let n=Az(e),r=n.useKeysAsHeaders?Object.keys(t[0]):n.columnHeaders,i=Lz(Cz(``),Rz(n),zz(n),Uz(n,r),Wz(n,r,t));if(xz(i).length<1)throw new jz(`Output is empty. Is your data formatted correctly?`);return i};N(),H(),Wr(),Qr();var $z=({thino:e})=>{let t=(0,U.useRef)(null);(0,U.useEffect)(()=>(t.current&&(0,f.setIcon)(t.current,`pin`),()=>{t.current&&=null}),[t]);let n=(0,U.useCallback)(async()=>{e.pinned?await V.unpinMemoById(e.id):await V.pinMemoById(e.id)},[e]);return(0,W.jsx)(`span`,{ref:t,className:u_(`pinned-status`,e.pinned?`pinned`:`not-pinned`),onClick:n})},eB=({thino:e})=>{let t=(0,U.useRef)(null);(0,U.useEffect)(()=>(t.current&&(0,f.setIcon)(t.current,e.thinoType===`JOURNAL`?`calendar`:`check-square`),()=>{t.current&&=null}),[t,e?.thinoType]);let n=(0,U.useCallback)(async()=>{if(e.thinoType===`JOURNAL`)return;let t=await V.updateMemo(e.id,e.content,e.thinoType===`TASK-TODO`?`TASK-DONE`:`TASK-TODO`);t&&V.editMemo(t)},[e]);return(0,W.jsx)(W.Fragment,{children:e.thinoType===`JOURNAL`?(0,W.jsx)(`span`,{ref:t,className:`thino-type-status`}):(0,W.jsx)(`input`,{className:u_(`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})})},tB=({id:e,path:t})=>{let n=(0,U.useRef)(null);return(0,U.useEffect)(()=>(n.current&&(0,f.setIcon)(n.current,`link`),()=>{n.current&&=null}),[]),(0,W.jsxs)(`span`,{className:`source-thino`,onClick:(0,U.useCallback)(()=>{!e||!t||V.openThinoByID(e)},[e,t]),children:[(0,W.jsx)(`span`,{children:t}),(0,W.jsx)(`span`,{ref:n,className:`source-thino-icon`})]})},nB=({id:e,sourceType:t})=>{let n=(0,U.useRef)(null);return(0,U.useEffect)(()=>(n.current&&(0,f.setIcon)(n.current,Ur.find(e=>e.title===t)?.icon||`list`),()=>{n.current&&=null}),[]),(0,W.jsx)(`span`,{ref:n,className:`source-type-icon`,onClick:(0,U.useCallback)(async()=>{e&&await V.openThinoByID(e)},[e])})},rB=(e,t,n,r)=>{let i=lz(e.getValue(t),n);return r({itemRank:i}),i.passed},iB=(e,t,n)=>{let r=0;return e.columnFiltersMeta[n]&&(r=pz(e.columnFiltersMeta[n]?.itemRank,t.columnFiltersMeta[n]?.itemRank)),r===0?zR.alphanumeric(e,t,n):r},aB=Az({fieldSeparator:`,`,decimalSeparator:`.`,useKeysAsHeaders:!0}),oB=e=>e+`
|
||
`;function sB({thinos:e,isFiltering:t}){U.useReducer(()=>({}),{})[1];let[n,r]=U.useState([]),[i,a]=U.useState(``),o=U.useMemo(()=>[{header:M(`Basic Info`),footer:e=>e.column.id,columns:[{accessorKey:`createdAt`,header:()=>(0,W.jsx)(`span`,{className:`create-at-header-cell`,children:M(`Created At`)}),cell:e=>e.getValue(),footer:e=>e.column.id,enableColumnFilter:!1},{accessorFn:e=>e.content,id:`content`,header:()=>(0,W.jsx)(`span`,{className:`thino-header-cell`,children:M(`Thino`)}),cell:e=>(0,W.jsx)(gT,{memo:e.row.original,type:`table`}),footer:e=>e.column.id,filterFn:`fuzzy`,sortingFn:iB},{accessorFn:e=>e.thinoType,id:`thinoType`,cell:e=>(0,W.jsx)(eB,{thino:e.row.original}),header:()=>(0,W.jsx)(`span`,{children:M(`Thino Type`)}),footer:e=>e.column.id},{accessorFn:e=>e.sourceType,id:`sourceType`,cell:e=>(0,W.jsx)(nB,{id:e.row.original.id,sourceType:e.getValue()}),header:()=>(0,W.jsx)(`span`,{children:M(`Source Type`)}),footer:e=>e.column.id}]},{header:M(`Additional Info`),footer:e=>e.column.id,columns:[{accessorKey:`pinned`,header:()=>(0,W.jsx)(`span`,{children:M(`Pinned Status`)}),cell:e=>(0,W.jsx)($z,{thino:e.row.original}),footer:e=>e.column.id,filterFn:`fuzzy`,sortingFn:iB},{accessorKey:`rowStatus`,header:()=>(0,W.jsx)(`span`,{children:M(`Row status`)}),cell:e=>(0,W.jsx)(`span`,{children:e.getValue()===`NORMAL`?``:e.getValue()}),footer:e=>e.column.id},{accessorKey:`path`,header:()=>M(`Path`),cell:e=>(0,W.jsx)(tB,{id:e.row.original.id,path:e.getValue()}),footer:e=>e.column.id}]}],[]),[s,c]=U.useState(()=>e),l=()=>c(t=>e);(0,U.useEffect)(()=>{l()},[e]);let u=rz({data:s,columns:o,filterFns:{fuzzy:rB},initialState:{pagination:{pageSize:20}},state:{columnFilters:n,globalFilter:i},onColumnFiltersChange:r,onGlobalFilterChange:a,globalFilterFn:rB,getCoreRowModel:HR(),getFilteredRowModel:XR(),getSortedRowModel:QR(),getPaginationRowModel:ZR(),getFacetedRowModel:JR(),getFacetedUniqueValues:YR(),getFacetedMinMaxValues:WR(),debugTable:!1,debugHeaders:!1,debugColumns:!1});U.useEffect(()=>{u.getState().columnFilters[0]?.id===`createdAt`&&u.getState().sorting[0]?.id!==`createdAt`&&u.setSorting([{id:`createdAt`,desc:!1}])},[u.getState().columnFilters[0]?.id]);async function d(e,t){let n=M(`Created At`),r=M(`Updated At`),i=M(`Content`),a=M(`Path`),o=e.map(e=>({[n]:e.createdAt,[r]:e.updatedAt,[i]:e.content,Thino:`=hyperlink("obsidian://thino?openId=${e.id}","${e.id}")`,[a]:`=hyperlink("obsidian://open?path=${(0,f.normalizePath)(e.path)},"${e.path}")`})),s=Qz(aB)(o),c=L.getState().app||window.app,l=oB(Gz(s));return{file:await c.vault.create(`${t}-${P.randomId(6)}.csv`,l),app:c}}async function p(e){let{file:t,app:n}=await d(e.map(e=>e.original),`thino-export`),r=document.createDocumentFragment(),i=r.createEl(`div`,{cls:`export-file-btn-group`});r.createEl(`div`,{cls:`open-file-button`}),new f.Setting(i).setName(M(`Exported CSV file`)).addButton(e=>{e.setButtonText(M(`Open File`)).onClick(()=>{let e=(0,f.normalizePath)(t.path);n.openWithDefaultApp(e)})}),new f.Notice(r)}return(0,W.jsxs)(`div`,{className:`table-view`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(uB,{value:i||``,onChange:e=>a(String(e)),className:`table-search-bar`,placeholder:M(`Search all columns...`)}),f.Platform.isDesktop&&(i||n.length>0||t)&&(0,W.jsx)(`button`,{className:`mod-cta`,disabled:u.getPrePaginationRowModel().rows.length===0,onClick:()=>p(u.getPrePaginationRowModel().rows),children:M(`Export to CSV`)})]}),(0,W.jsxs)(`table`,{className:`thino-table`,children:[(0,W.jsx)(`thead`,{children:u.getHeaderGroups().map(e=>(0,W.jsx)(`tr`,{children:e.headers.map(e=>(0,W.jsx)(`th`,{colSpan:e.colSpan,children:e.isPlaceholder?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:u_(e.column.getCanSort()?`filter-header`:``,`table-header`,e.column.id===`content`?`content-header`:``),onClick:e.column.getToggleSortingHandler(),children:[$R(e.column.columnDef.header,e.getContext()),{asc:` 🔼`,desc:` 🔽`}[e.column.getIsSorted()]??null]}),e.column.getCanFilter()?(0,W.jsx)(lB,{column:e.column,table:u}):null]})},e.id))},e.id))}),(0,W.jsx)(`tbody`,{children:u.getRowModel().rows.map(e=>(0,W.jsx)(`tr`,{className:u_(e.getValue(`pinned`)?`pinned`:``),children:e.getVisibleCells().map(e=>(0,W.jsx)(`td`,{children:$R(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]}),(0,W.jsxs)(`div`,{className:`table-nav-bar`,children:[(0,W.jsx)(`button`,{className:`prev-start-btn`,onClick:()=>u.setPageIndex(0),disabled:!u.getCanPreviousPage(),children:`<<`}),(0,W.jsx)(`button`,{className:`prev-btn`,onClick:()=>u.previousPage(),disabled:!u.getCanPreviousPage(),children:`<`}),(0,W.jsx)(`button`,{className:`next-btn`,onClick:()=>u.nextPage(),disabled:!u.getCanNextPage(),children:`>`}),(0,W.jsx)(`button`,{className:`next-end-btn`,onClick:()=>u.setPageIndex(u.getPageCount()-1),disabled:!u.getCanNextPage(),children:`>>`}),(0,W.jsxs)(`span`,{className:`table-page-info`,children:[(0,W.jsx)(`div`,{children:M(`Page`)}),(0,W.jsxs)(`strong`,{children:[u.getState().pagination.pageIndex+1,` of `,u.getPageCount()]})]}),(0,W.jsxs)(`span`,{className:`table-page-jump`,children:[`| `,M(`Go to page`),`:`,(0,W.jsx)(`input`,{type:`number`,defaultValue:u.getState().pagination.pageIndex+1,onChange:e=>{let t=e.target.value?Number(e.target.value)-1:0;u.setPageIndex(t)},className:`jump-inputer`})]}),(0,W.jsx)(`select`,{value:u.getState().pagination.pageSize,onChange:e=>{u.setPageSize(Number(e.target.value))},children:[10,20,30,40,50].map(e=>(0,W.jsxs)(`option`,{value:e,children:[M(`Show`),` `,e,` `,M(`rows`)]},e))})]})]})}var cB=e=>e===`sourceType`?[`ALL`]:[`ALL`,`ALL-TASK`];function lB({column:e,table:t}){let n=t.getPreFilteredRowModel().flatRows[0]?.getValue(e.id),r=e.getFilterValue(),i=U.useMemo(()=>typeof n==`number`?[]:Array.from(e.getFacetedUniqueValues().keys()).sort(),[e.getFacetedUniqueValues()]);return typeof n==`number`?(0,W.jsx)(`div`,{children:(0,W.jsxs)(`div`,{className:`filter-input-group`,children:[(0,W.jsx)(uB,{type:`number`,min:Number(e.getFacetedMinMaxValues()?.[0]??``),max:Number(e.getFacetedMinMaxValues()?.[1]??``),value:r?.[0]??``,onChange:t=>e.setFilterValue(e=>[t,e?.[1]]),placeholder:`Min ${e.getFacetedMinMaxValues()?.[0]?`(${e.getFacetedMinMaxValues()?.[0]})`:``}`,className:`filter-input-short`}),(0,W.jsx)(uB,{type:`number`,min:Number(e.getFacetedMinMaxValues()?.[0]??``),max:Number(e.getFacetedMinMaxValues()?.[1]??``),value:r?.[1]??``,onChange:t=>e.setFilterValue(e=>[e?.[0],t]),placeholder:`Max ${e.getFacetedMinMaxValues()?.[1]?`(${e.getFacetedMinMaxValues()?.[1]})`:``}`,className:`filter-input-short`})]})}):(0,W.jsx)(W.Fragment,{children:i.length>1?(0,W.jsxs)(W.Fragment,{children:[e.id!==`path`&&e.id!==`content`&&e.id!==`thinoType`&&e.id!==`sourceType`&&(0,W.jsx)(`datalist`,{id:e.id+`list`,children:i.slice(0,5e3).map(e=>(0,W.jsx)(`option`,{value:e},e))}),e.id===`thinoType`||e.id===`sourceType`?(0,W.jsx)(`select`,{id:e.id,onChange:t=>e.setFilterValue(t.target.value===`ALL`?``:t.target.value===`ALL-TASK`?`TASK`:t.target.value),children:[...cB(e.id),...i].map(e=>(0,W.jsx)(`option`,{value:e,children:M(e)||e},e))}):``,e.id!==`thinoType`&&e.id!==`sourceType`?(0,W.jsx)(uB,{type:`text`,value:r??``,onChange:t=>e.setFilterValue(t),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,className:`filter-input-long`,list:e.id+`list`}):``]}):``})}function uB({value:e,onChange:t,debounce:n=500,...r}){let[i,a]=U.useState(e);return U.useEffect(()=>{a(e)},[e]),U.useEffect(()=>{let e=setTimeout(()=>{t(i)},n);return()=>clearTimeout(e)},[i]),(0,W.jsx)(`input`,{...r,value:i,onChange:e=>a(e.target.value)})}var dB=(0,U.createContext)(null),fB=()=>{let e=(0,U.useContext)(dB);if(!e)throw Error(`useScroll must be used within ScrollProvider`);return e},pB=({children:e,scrollRef:t})=>{let n=(0,U.useMemo)(()=>({scrollToTop:e=>{t.current?.scrollToTop(e)},scrollToBottom:e=>{t.current?.scrollToBottom(e)},scrollToPosition:(e,n)=>{t.current?.scrollToPosition(e,n)}}),[t]),r=(0,U.useRef)(n),i=(0,U.useCallback)(e=>(r.current={scrollToTop:e.scrollToTop||n.scrollToTop,scrollToBottom:e.scrollToBottom||n.scrollToBottom,scrollToPosition:e.scrollToPosition||n.scrollToPosition},()=>{r.current=n}),[n]),a=(0,U.useCallback)(e=>{r.current.scrollToTop(e)},[]),o=(0,U.useCallback)(e=>{r.current.scrollToBottom(e)},[]),s=(0,U.useCallback)((e,t)=>{r.current.scrollToPosition(e,t)},[]),c=(0,U.useCallback)(()=>t.current?.getScrollElement()||null,[t]),l=(0,U.useMemo)(()=>({scrollRef:t,scrollToTop:a,scrollToBottom:o,scrollToPosition:s,getScrollElement:c,registerScrollController:i}),[t,a,o,s,c,i]);return(0,W.jsx)(dB.Provider,{value:l,children:e})};H(),N();var mB=()=>{let e=Ew(e=>e.selectedMessageIds),t=Ew(e=>e.conversations),n=(0,U.useMemo)(()=>t.flatMap(e=>e.messages).filter(t=>e.includes(t.id)).sort((e,t)=>e.timestamp-t.timestamp),[e,t]),r=(0,U.useCallback)(async()=>{if(n.length===0)return;let e=n.map(e=>e.content).join(`
|
||
|
||
---
|
||
|
||
`);try{let t=await V.createMemoDaily(e,!0);t&&(V.pushMemo(t),Ew.getState().clearMessageSelection(),new f.Notice(M(`Thino created from Super messages`)))}catch(e){new f.Notice(`Failed to create thino: ${e.message}`)}},[n]),i=(0,U.useCallback)(()=>{Ew.getState().clearMessageSelection()},[]);return e.length===0?null:(0,W.jsxs)(`div`,{className:`super-selection-toolbar`,children:[(0,W.jsxs)(`span`,{className:`super-selection-count`,children:[e.length,` message`,e.length>1?`s`:``,` selected`]}),(0,W.jsxs)(`div`,{className:`super-selection-actions`,children:[(0,W.jsx)(`button`,{className:`super-create-thino-btn clickable-icon`,onClick:r,children:`Create Thino`}),(0,W.jsx)(`button`,{className:`super-cancel-btn clickable-icon`,onClick:i,children:`Cancel`})]})]})},hB=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),gB=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),_B={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},vB=(0,U.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,U.createElement)(`svg`,{ref:c,..._B,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:gB(`lucide`,i),...s},[...o.map(([e,t])=>(0,U.createElement)(e,t)),...Array.isArray(a)?a:[a]])),yB=(e,t)=>{let n=(0,U.forwardRef)(({className:n,...r},i)=>(0,U.createElement)(vB,{ref:i,iconNode:t,className:gB(`lucide-${hB(e)}`,n),...r}));return n.displayName=`${e}`,n},bB=yB(`Brain`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`,key:`ep3f8r`}],[`path`,{d:`M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4`,key:`1p4c4q`}],[`path`,{d:`M17.599 6.5a3 3 0 0 0 .399-1.375`,key:`tmeiqw`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M19.938 10.5a4 4 0 0 1 .585.396`,key:`1qfode`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M19.967 17.484A4 4 0 0 1 18 18`,key:`159ez6`}]]),xB=yB(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),SB=yB(`SquarePen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),CB=yB(`TrendingUp`,[[`polyline`,{points:`22 7 13.5 15.5 8.5 10.5 2 17`,key:`126l90`}],[`polyline`,{points:`16 7 22 7 22 13`,key:`kwv8wd`}]]),wB={search_memos:`Searched memos`,filter_memos:`Filtered memos`,get_memo:`Read memo`,get_related_memos:`Found related memos`,generate_image:`Generated image`,summarize_text:`Summarized text`,summarize_url:`Summarized URL`,delegate_fast:`Delegated task`},TB={search_memos:`Searching memos`,filter_memos:`Filtering memos`,get_memo:`Reading memo`,get_related_memos:`Finding related memos`,generate_image:`Generating image`,summarize_text:`Summarizing text`,summarize_url:`Summarizing URL`,delegate_fast:`Delegating task`};function EB(e){let t=[];for(let n of e.matchAll(/!\[([^\]]*)\]\((https?:\/\/[^)]+)\)/g))t.push({url:n[2],alt:n[1]||void 0});if(t.length===0)for(let n of e.matchAll(/(https?:\/\/[^\s"'<>]+\.(?:png|jpe?g|gif|webp|svg|bmp)(?:\?[^\s"'<>]*)?)/gi))t.push({url:n[1]});return t}var DB=({toolCall:e})=>{let[t,n]=(0,U.useState)(e.name===`generate_image`&&e.status===`completed`),r=e.status===`running`||e.status===`pending`,i=r?TB[e.name]||e.name:wB[e.name]||e.name,a=e.parsedArgs?.query?`${e.parsedArgs.query}`:e.parsedArgs?.tag?`${e.parsedArgs.tag}`:e.parsedArgs?.memo_id?`#${e.parsedArgs.memo_id}`:e.parsedArgs?.prompt?`${e.parsedArgs.prompt.slice(0,60)}`:e.parsedArgs?.url?`${e.parsedArgs.url}`:e.parsedArgs?.task?`${e.parsedArgs.task.slice(0,60)}`:null,o=(0,U.useMemo)(()=>e.name!==`generate_image`||!e.result?[]:EB(e.result),[e.name,e.result]),s=e.name===`generate_image`&&o.length>0;(0,U.useEffect)(()=>{s&&!t&&n(!0)},[s]);let c=async(e,t)=>{t.stopPropagation();try{let t=document.createElement(`a`);t.href=e,t.download=`generated-image-${Date.now()}.jpg`,t.target=`_blank`,document.body.appendChild(t),t.click(),document.body.removeChild(t)}catch(e){console.warn(`[ToolCallCard] Download failed:`,e)}};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`super-tool-inline ${e.status}`,onClick:()=>!r&&e.result&&n(!t),children:[(0,W.jsx)(SB,{size:16,className:`super-tool-icon`}),(0,W.jsx)(`span`,{className:u_(`super-tool-label`,r&&`running`),children:i}),a&&(0,W.jsx)(`span`,{className:`super-tool-query`,children:a})]}),t&&e.result&&(s?(0,W.jsx)(`div`,{className:`super-tool-image-result`,children:o.map((e,t)=>(0,W.jsxs)(`div`,{className:`super-tool-image-wrapper`,children:[(0,W.jsx)(`img`,{src:e.url,alt:e.alt||`Generated image`,loading:`lazy`}),(0,W.jsx)(`button`,{className:`super-tool-image-download`,onClick:t=>c(e.url,t),title:`Download image`,children:(0,W.jsx)(xB,{size:16})})]},t))}):(0,W.jsx)(`pre`,{className:`super-tool-result`,children:e.result}))]})},OB=({reasoning:e,isStreaming:t})=>{let[n,r]=(0,U.useState)(!1);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`super-tool-inline ${t?`running`:`completed`}`,onClick:()=>!t&&r(!n),children:[(0,W.jsx)(bB,{size:16,className:`super-tool-icon`}),(0,W.jsx)(`span`,{className:u_(`super-tool-label`,t&&`running`),children:t?`Thinking...`:`Thought`})]}),n&&!t&&(0,W.jsx)(`pre`,{className:`super-tool-result`,children:e})]})};Dg();var kB=()=>{let e=B(e=>e.searchResults),t=B(e=>e.searchQuery),n=B(e=>e.isSearching);return!t.trim()||n?null:e.length===0?(0,W.jsx)(`div`,{className:`super-results super-results-empty`,children:(0,W.jsx)(`span`,{children:`No matching thinos found.`})}):(0,W.jsxs)(`div`,{className:`super-results`,children:[(0,W.jsx)(`div`,{className:`super-results-header`,children:(0,W.jsxs)(`span`,{className:`super-results-count`,children:[e.length,` results`]})}),(0,W.jsx)(`div`,{className:`super-results-list`,children:e.map(e=>(0,W.jsxs)(`div`,{className:`super-result-item`,children:[(0,W.jsx)(`div`,{className:`super-result-score`,children:e.score<0?`text`:`${(e.score*100).toFixed(0)}%`}),(0,W.jsx)(`div`,{className:`super-result-content`,children:e.memo?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`super-result-date`,children:e.memo.createdAt}),(0,W.jsx)(`div`,{className:`super-result-text`,children:e.memo.content.length>200?e.memo.content.slice(0,200)+`...`:e.memo.content})]}):(0,W.jsx)(`div`,{className:`super-result-text`,children:e.entry.content})})]},e.entry.id))})]})};Dg();var AB=()=>{let e=(0,U.useCallback)(()=>{B.getState().setEnabled(!0)},[]);return(0,W.jsxs)(`div`,{className:`super-panel super-enable-prompt`,children:[(0,W.jsx)(`div`,{className:`super-enable-icon`,children:(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,W.jsx)(`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`})})}),(0,W.jsx)(`h3`,{className:`super-enable-title`,children:`Thino Super`}),(0,W.jsx)(`p`,{className:`super-enable-desc`,children:`AI-powered semantic search and chat for your thinos. Find memos by meaning, not just keywords.`}),(0,W.jsxs)(`ul`,{className:`super-enable-features`,children:[(0,W.jsx)(`li`,{children:`Semantic search across all your thinos`}),(0,W.jsx)(`li`,{children:`AI chat with context from your notes`}),f.Platform.isDesktop&&(0,W.jsx)(`li`,{children:`Local AI model with WebGPU acceleration`}),(0,W.jsx)(`li`,{children:`API support for OpenAI and Anthropic`})]}),(0,W.jsx)(`button`,{className:`super-enable-btn mod-cta`,onClick:e,children:`Enable Super`})]})};Dg();var jB=({onDownload:e})=>{let t=B(e=>e.assetDownloading),n=B(e=>e.assetDownloadProgress),r=B(e=>e.assetDownloadStatus),i=B(e=>e.assetDownloadError),a=(0,U.useCallback)(()=>{e()},[e]);return(0,W.jsxs)(`div`,{className:`super-panel super-download-prompt`,children:[(0,W.jsx)(`div`,{className:`super-download-icon`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`40`,height:`40`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,W.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,W.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})}),(0,W.jsx)(`h3`,{className:`super-download-title`,children:`Download AI Engine`}),(0,W.jsx)(`p`,{className:`super-download-desc`,children:`Super requires a local AI model to work offline. The following files will be downloaded and stored in the plugin directory (~50 MB total).`}),(0,W.jsxs)(`ul`,{className:`super-download-list`,children:[(0,W.jsx)(`li`,{children:`WASM inference runtime (~22 MB)`}),(0,W.jsx)(`li`,{children:`Embedding model (~25 MB)`})]}),!t&&!i&&(0,W.jsx)(`button`,{className:`super-download-btn mod-cta`,onClick:a,children:`Download to Local`}),t&&(0,W.jsxs)(`div`,{className:`super-download-progress`,children:[(0,W.jsx)(`div`,{className:`super-download-bar-wrapper`,children:(0,W.jsx)(`div`,{className:`super-download-bar`,style:{width:`${n}%`}})}),(0,W.jsxs)(`span`,{className:`super-download-status`,children:[r||`Downloading...`,` (`,n,`%)`]})]}),i&&(0,W.jsxs)(`div`,{className:`super-download-error`,children:[(0,W.jsxs)(`p`,{children:[`Download failed: `,i]}),(0,W.jsx)(`button`,{className:`super-download-btn`,onClick:a,children:`Retry`})]})]})};Dg();function MB(e){let t=e.find(e=>e.role===`user`);return t?t.content.length>40?t.content.slice(0,40)+`...`:t.content:`Inline Chat`}var NB=()=>{let e=B(e=>e.conversations),t=B(e=>e.activeConversationId),n=Ew(e=>e.conversations),r=(0,U.useMemo)(()=>{let t=e.map(e=>({id:e.id,title:e.title,updatedAt:e.updatedAt,source:`super`})),r=n.filter(e=>e.messages.length>0).map(e=>({id:e.id,title:MB(e.messages),updatedAt:e.updatedAt,source:`inline`}));return[...t,...r].sort((e,t)=>t.updatedAt-e.updatedAt)},[e,n]),i=(0,U.useCallback)(e=>{if(e.source===`super`)B.getState().setActiveConversation(e.id);else{let t=Ew.getState().conversations.find(t=>t.id===e.id);if(!t)return;let n=t.messages.map(e=>({id:e.id,role:e.role,content:e.content,timestamp:e.timestamp,isStreaming:!1,toolCalls:e.toolCalls}));B.getState().loadExternalMessages(n)}},[]),a=(0,U.useCallback)((e,t)=>{t.stopPropagation(),e.source===`super`?B.getState().deleteConversation(e.id):Ew.getState().removeConversation(e.id)},[]);return r.length===0?(0,W.jsx)(`div`,{className:`super-conversation-list`,children:(0,W.jsx)(`div`,{className:`super-conversation-empty`,children:`No conversations yet`})}):(0,W.jsx)(`div`,{className:`super-conversation-list`,children:(0,W.jsx)(`div`,{className:`super-conversation-items`,children:r.map(e=>(0,W.jsxs)(`div`,{className:`super-conversation-item ${e.source===`super`&&e.id===t?`active`:``}`,onClick:()=>i(e),children:[(0,W.jsxs)(`span`,{className:`super-conversation-title`,children:[e.source===`inline`&&(0,W.jsx)(`span`,{className:`super-conversation-badge`,children:`Inline`}),e.title]}),(0,W.jsx)(`span`,{className:`super-conversation-date`,children:new Date(e.updatedAt).toLocaleDateString()}),(0,W.jsx)(`button`,{className:`super-conversation-delete clickable-icon`,onClick:t=>a(e,t),"aria-label":`Delete conversation`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M18 6 6 18`}),(0,W.jsx)(`path`,{d:`m6 6 12 12`})]})})]},e.id))})})};Dg(),vi(),Mv(),N();var PB=({plugin:e})=>{let t=B(e=>e.enabled),n=B(e=>e.wasmReady),r=B(e=>e.modelReady),i=B(e=>e.embeddingReady),a=B(e=>e.activeEmbeddingProvider),o=I(e=>e.verifyState),[s,c]=(0,U.useState)(!1);(0,U.useEffect)(()=>{(async()=>{let e=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),t=f.Platform.isDesktop?await Dv():e?.identifier||e?.uuid;c(!!(o&&o?.appId===t))})()},[o]);let l=(0,U.useCallback)(()=>{av.downloadAssets().catch(console.warn)},[]),[u,d]=(0,U.useState)(!1),p=(0,U.useCallback)(()=>{e.settingTab.openSettingsModal(`super`)},[e]),m=(0,U.useCallback)(()=>{B.getState().createConversation(),d(!1)},[]);return s?t?f.Platform.isDesktop&&a===`local`&&(!n||!r)?(0,W.jsx)(jB,{onDownload:l}):(0,W.jsxs)(`div`,{className:`super-panel`,children:[(0,W.jsxs)(`div`,{className:`super-header`,children:[(0,W.jsx)(`h4`,{className:`super-title`,children:`Super`}),(0,W.jsxs)(`div`,{className:`super-header-actions`,children:[(0,W.jsx)(`button`,{className:`super-chat-history-btn clickable-icon`,onClick:()=>d(!u),"aria-label":`Chat history`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,W.jsx)(`path`,{d:`M3 3v5h5`}),(0,W.jsx)(`path`,{d:`M12 7v5l4 2`})]})}),(0,W.jsx)(`button`,{className:`super-chat-new clickable-icon`,onClick:m,"aria-label":`New chat`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M12 5v14`}),(0,W.jsx)(`path`,{d:`M5 12h14`})]})}),(0,W.jsx)(`button`,{className:`super-settings-btn clickable-icon`,onClick:p,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]})})]})]}),u&&(0,W.jsx)(NB,{}),!i&&(0,W.jsx)(FB,{}),(0,W.jsx)(kB,{}),(0,W.jsx)(`div`,{className:`super-divider`}),(0,W.jsx)(uV,{plugin:e,showHistory:u})]}):(0,W.jsx)(AB,{}):(0,W.jsxs)(`div`,{className:`super-panel super-enable-prompt`,children:[(0,W.jsx)(`div`,{className:`super-enable-icon`,children:(0,W.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,W.jsx)(`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`})})}),(0,W.jsx)(`h3`,{className:`super-enable-title`,children:`Thino Super`}),(0,W.jsx)(`p`,{className:`super-enable-desc`,children:M(`This is a pro feature, please upgrade to pro version to use it.`)})]})},FB=()=>{let e=B(e=>e.loadingStatus),t=B(e=>e.loadingProgress);return(0,W.jsxs)(`div`,{className:`super-model-loading`,children:[(0,W.jsxs)(`div`,{className:`super-model-loading-header`,children:[(0,W.jsx)(`div`,{className:`super-loading-spinner`,style:{width:14,height:14,borderWidth:2}}),(0,W.jsx)(`span`,{children:e||`Loading model...`})]}),t>0&&t<100&&(0,W.jsx)(`div`,{className:`super-loading-bar-wrapper`,children:(0,W.jsx)(`div`,{className:`super-loading-bar`,style:{width:`${t}%`}})})]})},IB=`thino-super-view`,LB=class extends f.ItemView{root=null;plugin;constructor(e,t){super(e),this.plugin=t}getDisplayText(){return`Thino Super`}getIcon(){return`sparkles`}getViewType(){return IB}async onOpen(){let e=this.containerEl.children[1];e.empty(),e.addClass(`thino-super-view`),this.root=$g.createRoot(e),this.root.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(PB,{plugin:this.plugin})}))}async onClose(){this.root?.unmount(),this.root=null}},RB=[IB,`thino_view`],zB=300,BB=({content:e,isStreaming:t,app:n,className:r})=>{let i=(0,U.useRef)(null),a=(0,U.useRef)(null),o=(0,U.useRef)(``);return(0,U.useEffect)(()=>{if(!i.current||!e)return;let r=()=>{if(!i.current||e===o.current)return;let t=null;for(let e of RB)if(t=n.workspace.getLeavesOfType(e)[0]?.view,t)break;if(!t){i.current.textContent=e;return}i.current.empty(),f.MarkdownRenderer.render(n,e,i.current,``,t),i.current.querySelectorAll(`.internal-link`).forEach(e=>{let r=e,i=r.getAttribute(`data-href`);i&&(n.metadataCache.getFirstLinkpathDest(i,``)||e.classList.add(`is-unresolved`),r.addEventListener(`mouseover`,e=>{e.stopPropagation(),n.workspace.trigger(`hover-link`,{event:e,source:`thino-super`,hoverParent:t.containerEl,targetEl:r,linktext:i,sourcePath:``})}))}),i.current.classList.add(`markdown-rendered`),o.current=e};return t?(a.current&&clearTimeout(a.current),a.current=setTimeout(r,zB)):(a.current&&clearTimeout(a.current),r()),()=>{a.current&&clearTimeout(a.current)}},[e,t,n]),(0,W.jsx)(`div`,{ref:i,className:r||`super-chat-message-content`})};nn();var VB=Jt(`thino-image-cache`,`generated-images`),HB=720*60*60*1e3,UB={async put(e){let t=`img-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return await Zt(t,{...e,id:t,createdAt:Date.now()},VB),t},async get(e){return Xt(e,VB)},async remove(e){await Qt(e,VB)},createObjectUrl(e){let t=atob(e.base64),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);let r=new Blob([n],{type:e.mimeType});return URL.createObjectURL(r)},toDataUrl(e){return`data:${e.mimeType};base64,${e.base64}`},async evictOld(){let e=Date.now()-HB,t=await en(VB),n=0;for(let r of t){let t=await Xt(r,VB);t&&t.createdAt<e&&(await Qt(r,VB),n++)}return n}},WB=/data:(image\/(?:png|jpe?g|gif|webp|svg\+xml));base64,([A-Za-z0-9+/=\s]+)/g,GB=/!\[([^\]]*)\]\((data:image\/(?:png|jpe?g|gif|webp|svg\+xml);base64,[A-Za-z0-9+/=\s]+)\)/g,KB=/!\[([^\]]*)\]\((https?:\/\/[^\s)]+\.(?:png|jpe?g|gif|webp|svg)(?:\?[^\s)]*)?)\)/g;function qB(e){let t=[],n=e;for(let n of e.matchAll(GB)){let e=n[2].match(/^data:(image\/[^;]+);base64,(.+)$/s);e&&t.push({match:n[0],mimeType:e[1],base64:e[2].replace(/\s/g,``),alt:n[1]||void 0})}if(t.length===0)for(let n of e.matchAll(WB))t.some(e=>e.match.includes(n[0]))||t.push({match:n[0],mimeType:n[1],base64:n[2].replace(/\s/g,``)});for(let e=0;e<t.length;e++)n=n.replace(t[e].match,`[generated-image:${e}]`);return{images:t,cleanContent:n}}function JB(e){let t=[];for(let n of e.matchAll(KB))t.push({url:n[2],alt:n[1]||``});return t}var YB=({images:e})=>{let[t,n]=(0,U.useState)(new Map),[r,i]=(0,U.useState)(null);(0,U.useEffect)(()=>{let t=!1,r=new Map;return(async()=>{for(let n of e){let e=await UB.get(n.cacheId);if(t)break;if(e){let t=UB.createObjectUrl(e);r.set(n.cacheId,t)}}t||n(new Map(r))})(),()=>{t=!0;for(let e of r.values())URL.revokeObjectURL(e)}},[e]);let a=(0,U.useCallback)(e=>{i(e)},[]),o=(0,U.useCallback)(()=>{i(null)},[]),s=(0,U.useCallback)(async e=>{let t=await UB.get(e);if(!t)return;let n=`generated-${e}.${t.mimeType.split(`/`)[1]?.replace(`jpeg`,`jpg`)||`png`}`,r=atob(t.base64),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);let a=new Blob([i],{type:t.mimeType}),o=document.createElement(`a`),s=URL.createObjectURL(a);o.href=s,o.download=n,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(s)},[]);return e.length===0?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`super-generated-images ${e.length===1?`single`:`grid`}`,children:e.map(e=>{let n=t.get(e.cacheId);return(0,W.jsx)(`div`,{className:`super-generated-image-wrap`,children:n?(0,W.jsx)(`img`,{src:n,alt:e.alt||`Generated image`,className:`super-generated-image`,onClick:()=>a(e.cacheId),loading:`lazy`}):(0,W.jsx)(`div`,{className:`super-generated-image-loading`,children:(0,W.jsx)(`span`,{children:`Loading...`})})},e.cacheId)})}),r&&t.get(r)&&(0,W.jsx)(`div`,{className:`super-image-lightbox`,onClick:o,children:(0,W.jsxs)(`div`,{className:`super-image-lightbox-content`,onClick:e=>e.stopPropagation(),children:[(0,W.jsx)(`img`,{src:t.get(r),alt:`Generated image preview`,className:`super-image-lightbox-img`}),(0,W.jsxs)(`div`,{className:`super-image-lightbox-actions`,children:[(0,W.jsx)(`button`,{className:`clickable-icon super-image-lightbox-btn`,onClick:()=>s(r),"aria-label":`Save image`,children:(0,W.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,W.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,W.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})}),(0,W.jsx)(`button`,{className:`clickable-icon super-image-lightbox-btn`,onClick:o,"aria-label":`Close`,children:(0,W.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,W.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})]})})]})},XB=({images:e})=>{let[t,n]=(0,U.useState)(null);return e.length===0?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`super-generated-images ${e.length===1?`single`:`grid`}`,children:e.map((e,t)=>(0,W.jsx)(`div`,{className:`super-generated-image-wrap`,children:(0,W.jsx)(`img`,{src:e.url,alt:e.alt||`Generated image`,className:`super-generated-image`,onClick:()=>n(e.url),loading:`lazy`})},t))}),t&&(0,W.jsx)(`div`,{className:`super-image-lightbox`,onClick:()=>n(null),children:(0,W.jsxs)(`div`,{className:`super-image-lightbox-content`,onClick:e=>e.stopPropagation(),children:[(0,W.jsx)(`img`,{src:t,alt:`Image preview`,className:`super-image-lightbox-img`}),(0,W.jsx)(`div`,{className:`super-image-lightbox-actions`,children:(0,W.jsx)(`button`,{className:`clickable-icon super-image-lightbox-btn`,onClick:()=>n(null),"aria-label":`Close`,children:(0,W.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,W.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})})]})})]})};vi();var ZB=12;function QB(e,t){let n=e.slice(0,t);for(let e=n.length-1;e>=0;e--){let t=n[e];if(t===`
|
||
`)break;if(t===`@`||t===`#`){if(e===0||/\s/.test(n[e-1])){let r=n.slice(e+1);return r.length>60?null:{kind:t===`@`?`thino`:`file`,triggerIndex:e,query:r}}break}}return null}var $B=class extends $b{app;detection=null;onMentionSelect;constructor(e,t,n){super(t),this.app=e,this.onMentionSelect=n,this.placement=`top-start`}getSuggestions(e){let t=this.inputEl.selectionStart??this.inputEl.value.length;return this.detection=QB(this.inputEl.value,t),this.detection?this.detection.kind===`thino`?eV(this.detection.query):nV(this.app,this.detection.query):[]}renderSuggestion(e,t){t.addClass(`super-suggest-item`);let n=t.createSpan({cls:`super-suggest-icon`});n.textContent=e.kind===`thino`?`@`:`#`;let r=t.createDiv({cls:`super-suggest-body`});r.createSpan({cls:`super-suggest-label`,text:e.label}),r.createSpan({cls:`super-suggest-secondary`,text:e.secondary})}selectSuggestion(e){if(!this.detection)return;let t=this.inputEl.value,n=t.slice(0,this.detection.triggerIndex),r=n+t.slice(this.detection.triggerIndex+1+this.detection.query.length),i=n.length;this.onMentionSelect({kind:e.kind,id:e.id,label:e.label,content:e.content},r,i),this.close()}updateOnSelect(e){this.onMentionSelect=e}};function eV(e){let t=F.getState().memos.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`);if(!e)return t.slice(0,ZB).map(tV);let n=(0,f.prepareFuzzySearch)(e),r=[];for(let e of t){let t=n(e.content);t&&r.push({item:e,score:t.score})}return r.sort((e,t)=>t.score-e.score),r.slice(0,ZB).map(e=>tV(e.item))}function tV(e){let t=e.content.replace(/\n/g,` `).slice(0,60);return{kind:`thino`,id:e.id,label:t,secondary:e.createdAt,content:e.content}}function nV(e,t){let n=e.vault.getAllLoadedFiles().filter(e=>e instanceof f.TFile&&(e.extension===`md`||e.extension===`canvas`));if(!t)return n.slice(0,ZB).map(rV);let r=(0,f.prepareFuzzySearch)(t),i=[];for(let e of n){let t=r(e.path);t&&i.push({item:e,score:t.score})}return i.sort((e,t)=>t.score-e.score),i.slice(0,ZB).map(e=>rV(e.item))}function rV(e){return{kind:`file`,id:e.path,label:e.basename,secondary:e.parent?.path||`/`,content:e.path}}Dg(),i_();function iV(e){if(e)try{return JSON.parse(e)}catch{return}}var aV=({msg:e,app:t})=>{let n=e.toolCalls&&e.toolCalls.length>0,r=e.toolCallOffset??0,i=n?e.content.slice(0,r):``,a=n?e.content.slice(r):e.content,o=(0,U.useMemo)(()=>e.isStreaming?[]:JB(a),[a,e.isStreaming]),s=(0,U.useMemo)(()=>{if(o.length===0)return a;let e=a;for(let t of o)e=e.replace(``,``);return e.trim()},[a,o]);return(0,W.jsxs)(W.Fragment,{children:[i&&(0,W.jsx)(BB,{content:i,isStreaming:!1,app:t}),n&&(0,W.jsx)(`div`,{className:`super-tool-calls`,children:e.toolCalls.map(e=>(0,W.jsx)(DB,{toolCall:e},e.id))}),e.reasoning&&(0,W.jsx)(OB,{reasoning:e.reasoning,isStreaming:e.isStreaming}),e.generatedImages&&e.generatedImages.length>0&&(0,W.jsx)(YB,{images:e.generatedImages}),o.length>0&&(0,W.jsx)(XB,{images:o}),(s||e.isStreaming)&&(0,W.jsx)(BB,{content:s||`...`,isStreaming:e.isStreaming,app:t})]})},oV=({attachments:e})=>!e||e.length===0?null:(0,W.jsx)(`div`,{className:`super-chat-attachments`,children:e.map(e=>(0,W.jsxs)(`span`,{className:`super-attachment-chip super-attachment-${e.kind}`,children:[(0,W.jsx)(`span`,{className:`super-attachment-icon`,children:e.kind===`thino`?`@`:`#`}),(0,W.jsx)(`span`,{className:`super-attachment-label`,children:e.label})]},e.id))}),sV={openai:`OpenAI`,anthropic:`Anthropic`,pkmer:`PKMer AI`},cV={openai:`gpt-5.2`,anthropic:`claude-sonnet-4-6`,pkmer:`03-agent`},lV=()=>{let e=B(e=>e.activeCompletionProvider),t=B(e=>e.providers),[n,r]=(0,U.useState)(!1),i=(0,U.useRef)(null),a=e===`pkmer`?`PKMer AI`:t[e]?.completionModel||cV[e]||e;(0,U.useEffect)(()=>{if(!n)return;let e=e=>{i.current&&!i.current.contains(e.target)&&r(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]);let o=(0,U.useMemo)(()=>{let e=[`openai`,`anthropic`];return r_()&&t.pkmer?.apiKey&&e.push(`pkmer`),e},[t]),s=(0,U.useCallback)((e,t)=>{let n=B.getState();e!==n.activeCompletionProvider&&n.setActiveCompletionProvider(e),n.updateProvider(e,{completionModel:t}),r(!1)},[]);return(0,W.jsxs)(`div`,{className:`super-model-pill-wrap`,ref:i,children:[(0,W.jsxs)(`button`,{className:`clickable-icon super-pill-btn`,onClick:()=>r(!n),children:[(0,W.jsx)(`span`,{className:`super-pill-label`,children:a}),(0,W.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,W.jsx)(`path`,{d:`M2.5 4 5 6.5 7.5 4`})})]}),n&&(0,W.jsx)(`div`,{className:`super-model-dropdown`,children:o.map(n=>{let r=n===e,i=t[n]?.completionModel||cV[n]||``;return(0,W.jsxs)(`button`,{className:`clickable-icon super-model-option ${r?`is-active`:``}`,onClick:()=>s(n,i),children:[(0,W.jsx)(`span`,{className:`super-model-option-name`,children:sV[n]||n}),n!==`pkmer`&&(0,W.jsx)(`span`,{className:`super-model-option-model`,children:i})]},n)})})]})},uV=({plugin:e,showHistory:t})=>{let n=B(e=>e.messages),r=B(e=>e.isProcessing),i=B(e=>e.activeCompletionProvider),a=B(e=>e.providers.pkmer?.quotaInfo),[o,s]=(0,U.useState)(``),[c,l]=(0,U.useState)([]),u=(0,U.useRef)(null),d=(0,U.useRef)(null),p=(0,U.useRef)(null),m=(0,U.useRef)(null);(0,U.useEffect)(()=>{u.current?.scrollIntoView({behavior:`smooth`})},[n]),(0,U.useEffect)(()=>{let t=d.current;if(!t)return;let n=new $B(e.app,t,(e,n,r)=>{s(n),l(t=>t.some(t=>t.id===e.id)?t:[...t,e]),requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(r,r)})});return m.current=n,()=>{n.destroy(),m.current=null}},[e.app]);let h=(0,U.useCallback)(e=>{s(e.target.value)},[]),g=(0,U.useCallback)(e=>{l(t=>t.filter(t=>t.id!==e))},[]),_=(0,U.useCallback)(e=>{let t=d.current;if(!t)return;let n=t.selectionStart??o.length,r=(n>0&&!/\s/.test(o[n-1])?` `:``)+e;s(o.slice(0,n)+r+o.slice(n));let i=n+r.length;requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(i,i),t.dispatchEvent(new Event(`input`,{bubbles:!0}))})},[o]),v=(0,U.useCallback)(async t=>{if(t.length===0)return``;let n=[];for(let r of t)if(r.kind===`thino`)n.push(`[Referenced Thino] ${r.content}`);else{let t=e.app.vault.getAbstractFileByPath(r.content);if(t instanceof f.TFile)try{let i=await e.app.vault.cachedRead(t),a=i.slice(0,2e3);n.push(`[Referenced File: ${r.label}]\n${a}${i.length>2e3?`
|
||
...(truncated)`:``}`)}catch{n.push(`[Referenced File: ${r.label}] (could not read)`)}}return n.join(`
|
||
|
||
`)},[e.app]),y=(0,U.useCallback)(async()=>{let e=o.trim();if(!e&&c.length===0||r)return;let t=B.getState();t.activeConversationId||t.createConversation();let i=await v(c),a=i?`${i}\n\n---\n\n${e}`:e,u=c.map(e=>({kind:e.kind,id:e.id,label:e.label,content:e.content})),d={id:`msg-${Date.now()}`,role:`user`,content:e,timestamp:Date.now(),attachments:u.length>0?u:void 0};t.addMessage(d),s(``),l([]),t.setIsProcessing(!0);let f=`msg-${Date.now()}-a`,p={id:f,role:`assistant`,content:``,timestamp:Date.now(),isStreaming:!0};t.addMessage(p);try{let e=``,r=``,i,o=[],s=[],c=0;console.log(`[SuperChat] streaming started`);for await(let l of av.chat(a,n)){if(c++,l.toolEvent){let{toolEvent:n}=l;if(n.type===`tool_start`)o.length===0&&(i=e.length),console.log(`[SuperChat] seq=${c} TOOL_START name=${n.name} id=${n.toolCallId} contentLenAtStart=${i} reasoningLen=${r.length}`),o.push({id:n.toolCallId,name:n.name,arguments:n.arguments||``,parsedArgs:iV(n.arguments),status:`running`}),t.updateMessage(f,{toolCalls:[...o],toolCallOffset:i});else if(n.type===`tool_result`){console.log(`[SuperChat] seq=${c} TOOL_RESULT name=${n.name} id=${n.toolCallId} resultLen=${n.result?.length??0}`);let e=o.findIndex(e=>e.id===n.toolCallId);e!==-1&&(o[e]={...o[e],result:n.result,status:`completed`},t.updateMessage(f,{toolCalls:[...o]}))}}l.reasoning&&(r+=l.reasoning,console.log(`[SuperChat] seq=${c} REASONING totalLen=${r.length} preview="${l.reasoning.slice(0,40)}"`),t.updateMessage(f,{reasoning:r})),l.content&&(e+=l.content,console.log(`[SuperChat] seq=${c} CONTENT totalLen=${e.length} preview="${l.content.slice(0,40)}"`),t.updateMessage(f,{content:e})),l.subagentImages&&l.subagentImages.length>0&&(console.log(`[SuperChat] seq=${c} SUBAGENT_IMAGES count=${l.subagentImages.length}`),s.push(...l.subagentImages),t.updateMessage(f,{generatedImages:[...s]}))}console.log(`[SuperChat] streaming done. contentLen=${e.length} reasoningLen=${r.length} toolCallsCount=${o.length} toolCallOffset=${i} toolStatuses=${o.map(e=>e.status).join(`,`)}`);let l=e,u=s.length>0?[...s]:void 0,{images:d,cleanContent:p}=qB(e);if(d.length>0){console.log(`[SuperChat] Found ${d.length} generated image(s), caching to IndexedDB`);let e=[];for(let t of d)try{let n=await UB.put({messageId:f,mimeType:t.mimeType,base64:t.base64});e.push({cacheId:n,mimeType:t.mimeType,alt:t.alt})}catch(e){console.warn(`[SuperChat] Failed to cache generated image:`,e)}e.length>0&&(u=[...u??[],...e],l=p)}t.updateMessage(f,{content:l,isStreaming:!1,toolCalls:[...o],reasoning:r||void 0,toolCallOffset:i,generatedImages:u});let m=B.getState();if(m.activeConversationId){let e=m.conversations.find(e=>e.id===m.activeConversationId);if(e&&e.title===`New Chat`&&e.messages.length>=2){let t=e.messages.find(e=>e.role===`user`);if(t){let n=t.content.slice(0,50)+(t.content.length>50?`...`:``);m.renameConversation(e.id,n)}}}}catch(e){t.updateMessage(f,{content:`Error: ${e.message||`Failed to get response`}`,isStreaming:!1})}finally{t.setIsProcessing(!1)}},[o,r,n,c,v]),b=(0,U.useCallback)(e=>{m.current?.isOpen||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y())},[y]),x=(o.trim()||c.length>0)&&!r;return(0,W.jsxs)(`div`,{className:`super-chat`,children:[(0,W.jsxs)(`div`,{className:`super-chat-messages`,children:[n.length===0&&!t&&(0,W.jsx)(`div`,{className:`super-chat-empty`,children:`Ask questions about your thinos. The AI will search for relevant thinos and provide answers based on your notes.`}),n.map(t=>(0,W.jsxs)(`div`,{className:`super-chat-message super-chat-${t.role}`,children:[(0,W.jsx)(`div`,{className:`super-chat-message-role`,children:t.role===`user`?`You`:`Super`}),t.role===`user`&&t.attachments&&(0,W.jsx)(oV,{attachments:t.attachments}),t.role===`assistant`?(0,W.jsx)(aV,{msg:t,app:e.app}):(0,W.jsx)(`div`,{className:`super-chat-message-content`,children:t.content})]},t.id)),(0,W.jsx)(`div`,{ref:u})]}),(0,W.jsxs)(`div`,{className:`super-input-card`,ref:p,children:[c.length>0&&(0,W.jsx)(`div`,{className:`super-input-attachments`,children:c.map(e=>(0,W.jsxs)(`span`,{className:`super-attachment-chip super-attachment-${e.kind}`,children:[(0,W.jsx)(`span`,{className:`super-attachment-icon`,children:e.kind===`thino`?`@`:`#`}),(0,W.jsx)(`span`,{className:`super-attachment-label`,children:e.label}),(0,W.jsx)(`button`,{className:`clickable-icon super-attachment-remove`,onClick:()=>g(e.id),"aria-label":`Remove`,children:`×`})]},e.id))}),(0,W.jsx)(`textarea`,{ref:d,className:`super-card-textarea`,placeholder:`Ask about your thinos, @ for context, # for files`,value:o,onChange:h,onKeyDown:b,rows:3,disabled:r}),(0,W.jsxs)(`div`,{className:`super-input-toolbar`,children:[(0,W.jsxs)(`div`,{className:`super-toolbar-left`,children:[(0,W.jsx)(lV,{}),i===`pkmer`&&a&&(0,W.jsxs)(`span`,{className:`super-toolbar-quota`,children:[a.remaining,`/`,a.total]})]}),(0,W.jsxs)(`div`,{className:`super-toolbar-right`,children:[(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-icon`,onClick:()=>_(`@`),"aria-label":`Reference thino`,title:`@ Reference thino`,children:`@`}),(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-icon`,onClick:()=>_(`#`),"aria-label":`Reference file`,title:`# Reference file`,children:`#`}),(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-send ${x?`is-active`:``}`,onClick:y,disabled:!x,"aria-label":`Send`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,W.jsx)(`path`,{d:`M22 2 11 13`})]})})]})]})]})]})};vi();var dV=(0,U.memo)(({message:e,isSelected:t,onSelect:n})=>{let{app:r}=I(),i=e.role===`user`;return(0,W.jsxs)(`div`,{className:u_(`thino-super-message`,i?`user`:`assistant`,t&&`selected`,e.isStreaming&&`streaming`),onClick:t=>n(e,t),children:[!i&&(0,W.jsx)(`div`,{className:`super-avatar`,ref:e=>{e&&(0,f.setIcon)(e,`sparkles`)}}),(0,W.jsxs)(`div`,{className:`super-message-content`,children:[(0,W.jsx)(`div`,{className:`super-message-role`,children:i?`You`:`Super`}),i?(0,W.jsx)(`div`,{className:`super-message-text`,children:e.content}):r?(0,W.jsx)(aV,{msg:e,app:r}):(0,W.jsx)(`div`,{className:`super-message-text`,children:e.content||(e.isStreaming?`...`:``)})]})]})},(e,t)=>e.message.id===t.message.id&&e.message.content===t.message.content&&e.message.isStreaming===t.message.isStreaming&&e.isSelected===t.isSelected&&e.message.toolCalls===t.message.toolCalls&&e.message.toolCallOffset===t.message.toolCallOffset&&e.message.reasoning===t.message.reasoning);dV.displayName=`SuperMessageBubble`;function fV(e){if(e)try{return JSON.parse(e)}catch{return}}var pV=({conversationId:e})=>{let{app:t}=I(),n=Ew(e=>e.isProcessing),[r,i]=(0,U.useState)(``),[a,o]=(0,U.useState)([]),s=(0,U.useRef)(null),c=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=s.current;if(!e||!t)return;let n=new $B(t,e,(t,n,r)=>{i(n),o(e=>e.some(e=>e.id===t.id)?e:[...e,t]),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(r,r)})});return c.current=n,()=>{n.destroy(),c.current=null}},[t]);let l=(0,U.useCallback)(e=>{i(e.target.value)},[]),u=(0,U.useCallback)(e=>{o(t=>t.filter(t=>t.id!==e))},[]),d=(0,U.useCallback)(e=>{let t=s.current;if(!t)return;let n=t.selectionStart??r.length,a=(n>0&&!/\s/.test(r[n-1])?` `:``)+e;i(r.slice(0,n)+a+r.slice(n));let o=n+a.length;requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(o,o),t.dispatchEvent(new Event(`input`,{bubbles:!0}))})},[r]),f=(0,U.useCallback)(async()=>{let s=r.trim();if(!s&&a.length===0||n)return;let c=Ew.getState(),l=``;if(a.length>0&&t){let e=[];for(let n of a)if(n.kind===`thino`)e.push(`[Referenced Thino] ${n.content}`);else{let r=t.vault.getAbstractFileByPath(n.content);if(r&&`extension`in r)try{let i=await t.vault.cachedRead(r),a=i.slice(0,2e3);e.push(`[Referenced File: ${n.label}]\n${a}${i.length>2e3?`
|
||
...(truncated)`:``}`)}catch{e.push(`[Referenced File: ${n.label}] (could not read)`)}}l=e.join(`
|
||
|
||
`)}let u=l?`${l}\n\n---\n\n${s}`:s,d={id:`inline-msg-${Date.now()}`,role:`user`,content:s,timestamp:Date.now()};c.addMessage(e,d),i(``),o([]),c.setIsProcessing(!0);let f=`inline-msg-${Date.now()}-a`,p={id:f,role:`assistant`,content:``,timestamp:Date.now(),isStreaming:!0};c.addMessage(e,p);try{let t=(Ew.getState().conversations.find(t=>t.id===e)?.messages??[]).map(e=>({id:e.id,role:e.role,content:e.content,timestamp:e.timestamp})),n=``,r=``,i,a=[];for await(let o of av.chat(u,t)){if(o.toolEvent){let{toolEvent:t}=o;if(t.type===`tool_start`)a.length===0&&(i=n.length),a.push({id:t.toolCallId,name:t.name,arguments:t.arguments||``,parsedArgs:fV(t.arguments),status:`running`}),Ew.getState().updateMessage(e,f,{toolCalls:[...a],toolCallOffset:i});else if(t.type===`tool_result`){let n=a.findIndex(e=>e.id===t.toolCallId);n!==-1&&(a[n]={...a[n],result:t.result,status:`completed`},Ew.getState().updateMessage(e,f,{toolCalls:[...a]}))}}o.reasoning&&(r+=o.reasoning,Ew.getState().updateMessage(e,f,{reasoning:r})),o.content&&(n+=o.content,Ew.getState().updateMessage(e,f,{content:n}))}Ew.getState().updateMessage(e,f,{isStreaming:!1,toolCalls:[...a],reasoning:r||void 0,toolCallOffset:i})}catch(t){Ew.getState().updateMessage(e,f,{content:`Error: ${t.message||`Failed to get response`}`,isStreaming:!1})}finally{Ew.getState().setIsProcessing(!1)}},[r,n,a,e,t]),p=(0,U.useCallback)(e=>{c.current?.isOpen||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),f())},[f]),m=(r.trim()||a.length>0)&&!n;return(0,W.jsxs)(`div`,{className:`super-inline-input`,children:[a.length>0&&(0,W.jsx)(`div`,{className:`super-input-attachments`,children:a.map(e=>(0,W.jsxs)(`span`,{className:`super-attachment-chip super-attachment-${e.kind}`,children:[(0,W.jsx)(`span`,{className:`super-attachment-icon`,children:e.kind===`thino`?`@`:`#`}),(0,W.jsx)(`span`,{className:`super-attachment-label`,children:e.label}),(0,W.jsx)(`button`,{className:`clickable-icon super-attachment-remove`,onClick:()=>u(e.id),"aria-label":`Remove`,children:`×`})]},e.id))}),(0,W.jsxs)(`div`,{className:`super-inline-input-row`,children:[(0,W.jsx)(`textarea`,{ref:s,className:`super-inline-textarea`,placeholder:`Continue the conversation...`,value:r,onChange:l,onKeyDown:p,rows:1,disabled:n}),(0,W.jsxs)(`div`,{className:`super-inline-actions`,children:[(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-icon`,onClick:()=>d(`@`),"aria-label":`Reference thino`,children:`@`}),(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-icon`,onClick:()=>d(`#`),"aria-label":`Reference file`,children:`#`}),(0,W.jsx)(`button`,{className:`clickable-icon super-toolbar-send ${m?`is-active`:``}`,onClick:f,disabled:!m,"aria-label":`Send`,children:(0,W.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,W.jsx)(`path`,{d:`m22 2-7 20-4-9-9-4Z`}),(0,W.jsx)(`path`,{d:`M22 2 11 13`})]})})]})]})]})},mV=(0,U.memo)(({conversation:e})=>{let t=Ew(e=>e.selectedMessageIds),n=Ew,r=(0,U.useCallback)((e,t)=>{let r=n.getState();t.ctrlKey||t.metaKey?r.toggleMessageSelection(e.id):r.selectSingleMessage(e.id)},[]),i=(0,U.useCallback)(()=>{let t=n.getState();t.deactivateConversation(e.id),t.activeConversationId===e.id&&t.setActiveConversation(null)},[e.id]),a=(0,U.useCallback)(()=>{let t=n.getState(),r=t.conversations.find(t=>t.isActive&&t.id!==e.id);r&&t.deactivateConversation(r.id),t.reactivateConversation(e.id),t.setActiveConversation(e.id)},[e.id]),o=(0,U.useCallback)(()=>{n.getState().toggleCollapseConversation(e.id)},[e.id]),s=(0,U.useCallback)(t=>{t.preventDefault();let r=new f.Menu;r.addItem(t=>{t.setIcon(`trash-2`).setTitle(`Delete conversation`).setWarning(!0).onClick(()=>{n.getState().removeConversation(e.id)})}),r.showAtMouseEvent(t.nativeEvent)},[e.id]),c=(0,U.useMemo)(()=>t.some(t=>e.messages.some(e=>e.id===t)),[t,e.messages]),l=!e.isActive&&e.isCollapsed!==!1,u=e.messages.length;return(0,W.jsxs)(`div`,{className:u_(`thino-super-conversation`,e.isActive&&`active`,l&&`collapsed`),onContextMenu:s,children:[(0,W.jsxs)(`div`,{className:`super-conversation-header`,children:[(0,W.jsx)(`span`,{className:`super-badge`,ref:e=>{e&&(0,f.setIcon)(e,`sparkles`)}}),(0,W.jsx)(`span`,{className:`super-badge-text`,children:`Super`}),l&&(0,W.jsxs)(`span`,{className:`super-collapsed-hint`,children:[u,` message`,u===1?``:`s`]}),(0,W.jsxs)(`div`,{className:`super-conversation-header-right`,children:[e.isActive&&(0,W.jsx)(`button`,{className:`super-end-btn clickable-icon`,onClick:i,children:`End`}),!e.isActive&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{className:`super-resume-btn clickable-icon`,onClick:a,"aria-label":`Resume conversation`,ref:e=>{e&&(0,f.setIcon)(e,`message-square-plus`)}}),(0,W.jsx)(`button`,{className:`super-collapse-btn clickable-icon`,onClick:o,"aria-label":l?`Expand conversation`:`Collapse conversation`,ref:e=>{e&&(0,f.setIcon)(e,l?`chevron-right`:`chevron-down`)}})]})]})]}),!l&&(0,W.jsx)(`div`,{className:`super-conversation-messages`,children:e.messages.map(e=>(0,W.jsx)(dV,{message:e,isSelected:t.includes(e.id),onSelect:r},e.id))}),e.isActive&&(0,W.jsx)(pV,{conversationId:e.id}),!l&&c&&(0,W.jsx)(mB,{})]})});mV.displayName=`ChatSuperConversation`,vi(),H(),Dg();var hV=(0,U.memo)(({memo:e,onDoubleClick:t})=>{let[n,r]=(0,U.useState)(!1),i=(0,U.useRef)(),a=(0,U.useRef)(null);return(0,U.useEffect)(()=>{if(!n&&a.current)return i.current=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&r(!0)})},{rootMargin:`200px`,threshold:.01}),i.current.observe(a.current),()=>{i.current?.disconnect()}},[n]),(0,W.jsx)(`div`,{ref:a,className:`chat-memo-wrapper`,onDoubleClick:t,children:n?(0,W.jsx)(gT,{memo:e,type:`inline`}):(0,W.jsx)(`div`,{className:`memo-placeholder`,style:{minHeight:`60px`,padding:`8px`},children:(0,W.jsxs)(`div`,{style:{opacity:.6},children:[e.content.substring(0,100),`...`]})})})},(e,t)=>e.memo.id===t.memo.id&&e.memo.content===t.memo.content);hV.displayName=`ChatMemo`;var gV=(0,U.memo)(({item:e,iconString:t,handleClickTimeStamp:n,handleToggleCheckBox:r,handleDayMarkClick:i})=>{if(e.type===`daymark`)return(0,W.jsx)(`div`,{className:`thino-chat-day-mark day-mark`,onClick:t=>i(e.dayMark,t),children:(0,W.jsx)(`div`,{className:`day-mark-bubble`,children:e.dayMark===`PINNED`?e.dayMark+` 📌`:e.dayMark})});if(e.type===`super`&&e.conversation)return(0,W.jsx)(mV,{conversation:e.conversation});let a=e.memo,o=a.thinoType!==`JOURNAL`,s=(0,U.useMemo)(()=>a.createdAt.substring(11,19),[a.createdAt]),c=(0,U.useCallback)(()=>{Fx(a)},[a]);return(0,W.jsxs)(`div`,{className:`thino-bubble right`,children:[(0,W.jsx)(`div`,{className:`icon-img`,style:{backgroundImage:t?`url("${t}")`:void 0},ref:e=>{e&&!t&&(0,f.setIcon)(e,`Memos`)}}),(0,W.jsx)(`div`,{className:`wrap`,children:(0,W.jsxs)(`div`,{className:o?`content task`:`content`,children:[o&&(0,W.jsx)(`div`,{className:`task-inputer`,children:(0,W.jsx)(`input`,{className:u_(`thino-type-status`,`task-list-item-checkbox`),type:`checkbox`,checked:a.thinoType!==`TASK-TODO`,onClick:()=>r(a)})}),(0,W.jsx)(`div`,{className:`time-stamp`,onClick:()=>n(a),children:s}),(0,W.jsx)(hV,{memo:a,onDoubleClick:c})]})})]})});gV.displayName=`ChatItemRenderer`;var _V=({thinos:e})=>{let{query:t}=di(),{manifest:n}=si(),{app:r,settings:i}=I(),[a,o]=(0,U.useState)(i?.MomentsIcon||``),s=(0,U.useRef)(null),c=(0,U.useRef)(null),{registerScrollController:l}=fB(),u=B(e=>e.enabled),d=Ew(e=>e.conversations),p=(0,U.useMemo)(()=>{let t=[],n=GV(e,`day`);if(Object.keys(n).sort((e,t)=>e===`PINNED`?1:t===`PINNED`?-1:e.localeCompare(t)).forEach(e=>{t.push({type:`daymark`,dayMark:e,id:`dm-${e}`}),n[e].forEach((n,r)=>{t.push({type:`thino`,memo:n,dayMark:e,thinoIndex:r,id:`t-${n.id}`})})}),u&&d.length>0){let e=[...d].filter(e=>e.messages.length>0).sort((e,t)=>e.createdAt-t.createdAt);for(let n of e){let e=t.length,r=t.findIndex(e=>e.type===`daymark`&&e.dayMark===`PINNED`),i=r>=0?r:t.length;for(let r=i-1;r>=0;r--){let i=t[r];if(i.type===`thino`&&i.memo&&(i.memo.createdAtTs||new Date(i.memo.createdAt).getTime())<=n.createdAt){e=r+1;break}r===0&&(e=0)}r>=0&&e>r&&(e=r),t.splice(e,0,{type:`super`,dayMark:``,id:`super-${n.id}`,conversation:n})}}return t},[e,u,d]);(0,U.useEffect)(()=>{if(!i?.MomentsIcon||!r)return;let e=r.vault.adapter.getResourcePath((0,f.normalizePath)(i.MomentsIcon));o(e&&!i.MomentsIcon.startsWith(`http`)?e:i.MomentsIcon)},[i?.MomentsIcon,r]),(0,U.useEffect)(()=>{s.current=document.querySelector(`.memolist-wrapper`)},[]);let{displayedItems:m,hasMore:h,sentinelRef:g}=nx({allItems:(0,U.useMemo)(()=>[...p].reverse(),[p]),initialCount:100,loadMoreCount:50,enabled:!0}),_=(0,U.useMemo)(()=>[...m].reverse(),[m]),v=(0,U.useCallback)(e=>{Fx(e)},[]),y=(0,U.useCallback)(async e=>{if(e.thinoType===`JOURNAL`)return;let t=await V.updateMemo(e.id,e.content,e.thinoType===`TASK-TODO`?`TASK-DONE`:`TASK-TODO`);t&&V.editMemo(t)},[]),b=(0,U.useCallback)((e,t)=>{if(f.Keymap.isModifier(t.nativeEvent,`Mod`)){let t=(0,f.moment)(e,`YYYY-MM-DD`);z.setFromAndToQuery(t.startOf(`day`).valueOf(),t.endOf(`day`).valueOf())}},[]),x=(0,U.useCallback)((e=`auto`)=>{let t=s.current;t&&requestAnimationFrame(()=>{t.scrollTo({top:t.scrollHeight,behavior:e})})},[]);(0,U.useEffect)(()=>l({scrollToTop:e=>{let t=s.current;t&&t.scrollTo({top:0,behavior:e?`smooth`:`auto`})},scrollToBottom:e=>{x(e?`smooth`:`auto`)},scrollToPosition:(e,t)=>{let n=s.current;n&&n.scrollTo({top:e,behavior:t?`smooth`:`auto`})}}),[l,x]);let S=(0,U.useRef)(!1);(0,U.useEffect)(()=>{!S.current&&m.length>0&&(S.current=!0,setTimeout(()=>x(`auto`),100))},[m.length,x]);let C=(0,U.useRef)(0),w=(0,U.useRef)(0);return(0,U.useEffect)(()=>{let e=s.current;if(!e||!S.current)return;let t=_.length,n=C.current;if(t===n)return;let r=e.scrollHeight-e.scrollTop-e.clientHeight<200;if(t>n)if(r)requestAnimationFrame(()=>x(`smooth`));else{let t=w.current,n=e.scrollHeight-t;n>0&&t>0&&(e.scrollTop+=n)}C.current=t,w.current=e.scrollHeight},[_.length,x]),(0,W.jsxs)(`div`,{ref:c,className:u_(`chat-view`,`simple-chat-view`,`${i?.chatViewStyle}-style`),children:[h&&(0,W.jsx)(`div`,{ref:g,className:`chat-load-more-sentinel`,style:{height:`1px`,margin:`10px 0`}}),_.map(e=>(0,W.jsx)(gV,{item:e,iconString:a,handleClickTimeStamp:v,handleToggleCheckBox:y,handleDayMarkClick:b},e.id))]})};vi();var vV=({icon:e})=>{let t=(0,U.useRef)(null);return(0,U.useEffect)(()=>{t.current&&(e?(t.current.style.backgroundImage=`url("${e}")`,t.current.empty()):(0,f.setIcon)(t.current,`Memos`))},[e]),(0,W.jsx)(`div`,{ref:t,className:`thino-moment-icon`,style:e?{backgroundImage:`url("${e}")`}:void 0})},yV=(0,U.memo)(({memo:e})=>{let[t,n]=(0,U.useState)(!1),r=(0,U.useRef)(),i=(0,U.useRef)(null),{settings:a,app:o}=I(),[s,c]=(0,U.useState)(``);return(0,U.useEffect)(()=>{if(!t&&i.current)return r.current=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&n(!0)})},{rootMargin:`300px`,threshold:.01}),r.current.observe(i.current),()=>{r.current?.disconnect()}},[t]),(0,U.useEffect)(()=>{if(!a?.MomentsIcon||!o)return;let e=o.vault.adapter.getResourcePath((0,f.normalizePath)(a.MomentsIcon));e&&!a?.MomentsIcon.startsWith(`http`)?c(e):c(a?.MomentsIcon)},[a?.MomentsIcon,o]),(0,W.jsxs)(`div`,{ref:i,className:`thino-moment-wrapper`,children:[(0,W.jsx)(vV,{icon:s}),(0,W.jsxs)(`div`,{className:`thino-moment-container`,children:[(0,W.jsx)(`div`,{className:`thino-moment-user-name`,children:a?.UserName||`Thino`}),(0,W.jsx)(`div`,{className:`thino-moment-user-content`,children:t?(0,W.jsx)(gT,{memo:e}):(0,W.jsx)(`div`,{className:`memo-wrapper`,style:{minHeight:`80px`,paddingTop:`var(--size-2-2)`,opacity:.7},children:(0,W.jsxs)(`div`,{className:`memo-content-text`,style:{fontSize:`0.9em`,color:`var(--thino-modern-text-faint)`},children:[e.content.substring(0,120),`...`]})})})]})]})},(e,t)=>e.memo.id===t.memo.id&&e.memo.content===t.memo.content);yV.displayName=`MomentMemo`;var bV=()=>{let{settings:e,app:t}=I(),[n,r]=(0,U.useState)(``);return(0,U.useEffect)(()=>{if(!e?.MomentsBackgroundImage||!t){r(``);return}let n=t.vault.adapter.getResourcePath((0,f.normalizePath)(e.MomentsBackgroundImage));n&&!e?.MomentsBackgroundImage.startsWith(`http`)?r(n):r(e?.MomentsBackgroundImage)},[e?.MomentsBackgroundImage,t]),(0,W.jsx)(`div`,{className:`moments-view-background`,style:{backgroundImage:n?`url("${n}")`:void 0}})},xV=({userIcon:e})=>{let t=(0,U.useRef)(null);return(0,U.useEffect)(()=>{t.current&&(e?(t.current.style.backgroundImage=`url("${e}")`,t.current.empty()):(0,f.setIcon)(t.current,`Memos`))},[e]),(0,W.jsx)(`div`,{ref:t,className:`moments-view-user-icon`,style:e?{backgroundImage:`url("${e}")`}:void 0})},SV=({thinos:e})=>{let t=(0,U.useRef)(null),n=(0,U.useRef)(null),{registerScrollController:r}=fB(),{settings:i,app:a}=I(),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(``);(0,U.useEffect)(()=>{t.current=document.querySelector(`.memolist-wrapper`)},[]),(0,U.useEffect)(()=>{if(!i?.MomentsIcon||!a)return;let e=a.vault.adapter.getResourcePath((0,f.normalizePath)(i.MomentsIcon));e&&!i?.MomentsIcon.startsWith(`http`)?l(e):l(i?.MomentsIcon)},[i?.MomentsIcon,a]);let{displayedItems:u,hasMore:d,sentinelRef:p,loadingMore:m}=nx({allItems:e,initialCount:50,loadMoreCount:30,enabled:!0});return(0,U.useEffect)(()=>r({scrollToTop:e=>{let n=t.current;n&&n.scrollTo({top:0,behavior:e?`smooth`:`auto`})},scrollToBottom:e=>{let n=t.current;n&&n.scrollTo({top:n.scrollHeight,behavior:e?`smooth`:`auto`})},scrollToPosition:(e,n)=>{let r=t.current;r&&r.scrollTo({top:e,behavior:n?`smooth`:`auto`})}}),[r]),(0,W.jsxs)(`div`,{ref:n,className:u_(`moments-view`,`simple-moments`,o?`show-editor`:``),style:{width:`100%`,height:`100%`,position:`relative`},children:[(0,W.jsxs)(`div`,{className:`moments-view-background-wrapper`,children:[(0,W.jsx)(bV,{}),(0,W.jsx)(`div`,{className:`moments-show-editor-btn`,ref:e=>{e&&(0,f.setIcon)(e,`camera`)},onClick:()=>{s(!o)}}),(0,W.jsxs)(`div`,{className:`moments-view-background-overlay`,children:[(0,W.jsxs)(`div`,{className:`moments-view-user-info`,children:[(0,W.jsx)(`div`,{className:`moments-view-user-name`,children:i?.UserName||`Thino`}),(0,W.jsx)(xV,{userIcon:c})]}),(0,W.jsx)(`div`,{className:`moments-view-user-idea`,children:i?.MomentsQuote||` `})]})]}),(0,W.jsxs)(`div`,{className:`moments-list`,children:[u.map(e=>(0,W.jsx)(yV,{memo:e},e.id)),d&&(0,W.jsx)(`div`,{ref:p,className:`moments-sentinel`,style:{height:`1px`,margin:`20px 0`},children:m&&(0,W.jsx)(`div`,{style:{textAlign:`center`,padding:`20px`,opacity:.6},children:`Loading more...`})})]})]})},CV=(0,U.memo)(({memo:e})=>{let[t,n]=(0,U.useState)(!1),r=(0,U.useRef)(),i=(0,U.useRef)(null);return(0,U.useEffect)(()=>{if(!t&&i.current)return r.current=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&n(!0)})},{rootMargin:`300px`,threshold:.01}),r.current.observe(i.current),()=>{r.current?.disconnect()}},[t]),(0,W.jsx)(`div`,{ref:i,className:`waterfall-memo-container`,style:{width:`100%`,maxWidth:`100%`,minWidth:0,overflow:`hidden`},children:t?(0,W.jsx)(gT,{memo:e}):(0,W.jsx)(`div`,{className:`memo-skeleton`,style:{minHeight:`100px`,padding:`12px`,backgroundColor:`var(--background-secondary)`,borderRadius:`8px`,opacity:.7},children:(0,W.jsxs)(`div`,{style:{fontSize:`0.9em`,opacity:.8,overflowWrap:`anywhere`,wordBreak:`break-word`},children:[e.content.substring(0,150),`...`]})})})},(e,t)=>e.memo.id===t.memo.id&&e.memo.content===t.memo.content);CV.displayName=`WaterfallMemo`;var wV=({memos:e,className:t=``,columns:n=3,gap:r=10})=>{let{displayedItems:i,hasMore:a,sentinelRef:o,loadingMore:s}=nx({allItems:e,initialCount:50,loadMoreCount:30,enabled:!0}),c=(0,U.useMemo)(()=>{let e=Array.from({length:n},()=>[]);return i.forEach((t,r)=>{e[r%n].push(t)}),e},[i,n]);return(0,W.jsxs)(`div`,{className:u_(`simple-waterfall-list`,t),style:{width:`100%`,maxWidth:`100%`,minWidth:0,overflowX:`hidden`},children:[(0,W.jsx)(`div`,{className:`waterfall-columns`,style:{display:`grid`,gridTemplateColumns:`repeat(${n}, 1fr)`,gap:`${r}px`,width:`100%`,maxWidth:`100%`,minWidth:0,overflow:`hidden`},children:c.map((e,t)=>(0,W.jsx)(`div`,{className:`waterfall-column`,style:{display:`flex`,flexDirection:`column`,gap:`${r}px`,minWidth:0,maxWidth:`100%`},children:e.map(e=>(0,W.jsx)(CV,{memo:e},e.id))},`col-${t}`))}),a&&(0,W.jsx)(`div`,{ref:o,className:`waterfall-sentinel`,style:{height:`1px`,margin:`20px 0`},children:s&&(0,W.jsx)(`div`,{style:{textAlign:`center`,padding:`20px`,opacity:.6},children:`Loading more...`})})]})},TV=(0,U.forwardRef)(({children:e,className:t,mode:n=`top`,onScroll:r,style:i},a)=>{let o=(0,U.useRef)(null),s=(0,U.useCallback)((e=!1)=>{o.current&&o.current.scrollTo({top:0,behavior:e?`smooth`:`auto`})},[]),c=(0,U.useCallback)((e=!1)=>{o.current&&o.current.scrollTo({top:o.current.scrollHeight,behavior:e?`smooth`:`auto`})},[]),l=(0,U.useCallback)((e,t=!1)=>{o.current&&o.current.scrollTo({top:e,behavior:t?`smooth`:`auto`})},[]),u=(0,U.useCallback)(()=>o.current,[]),d=(0,U.useCallback)(()=>o.current?{top:o.current.scrollTop,height:o.current.clientHeight,scrollHeight:o.current.scrollHeight}:{top:0,height:0,scrollHeight:0},[]);return(0,U.useImperativeHandle)(a,()=>({scrollToTop:s,scrollToBottom:c,scrollToPosition:l,getScrollElement:u,getScrollPosition:d}),[s,c,l,u,d]),U.useLayoutEffect(()=>{n===`bottom`&&c(!1)},[n,c]),(0,W.jsx)(`div`,{ref:o,className:t,onScroll:r,style:{overflowY:`auto`,overflowX:`hidden`,WebkitOverflowScrolling:`touch`,...i},children:e})});TV.displayName=`ScrollContainer`;var EV=({itemId:e,initialContent:t,placeholder:n=``,onContentChange:r,onSubmit:i,onCancel:a})=>{let[o,s]=(0,U.useState)(null),c=(0,U.useRef)(null),l=(0,U.useRef)(!1),u=(0,U.useRef)(t??``),d=(0,U.useRef)(null),{instance:f,value:p,setFullContent:m,get:h,editorView:g}=mw(o,!0),_=(0,U.useCallback)(e=>{s(e)},[]),v=(0,U.useCallback)(()=>{let e=h?.(),t=typeof e==`string`?e:u.current;u.current=t,d.current!==t&&(r(t),d.current=t)},[h,r]);return(0,U.useEffect)(()=>{f&&c.current!==e&&(c.current=e,l.current=!0,u.current=t??``,d.current=null,m(t||``,!0))},[f,e,t,m]),(0,U.useEffect)(()=>{if(f){if(l.current){l.current=!1,u.current=p;return}u.current=p}},[p,f]),(0,U.useEffect)(()=>{let e=g;if(e)return n&&(e.dom.dataset.placeholder=n),e.focus(),()=>{n&&delete e.dom.dataset.placeholder}},[g,n]),(0,U.useEffect)(()=>{g||f?.editor&&f.editor.focus()},[g,f]),(0,U.useEffect)(()=>{let e=g?.dom||o;if(!e)return;let t=e=>{if(e.key===`Escape`&&(e.preventDefault(),a()),e.key===`Enter`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),v(),i();return}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),v(),a())};return e.addEventListener(`keydown`,t,!0),()=>{e.removeEventListener(`keydown`,t,!0)}},[g,o,v,a,i]),(0,W.jsx)(`div`,{ref:_,className:`temp-editor`})};vi(),N(),H(),Cv(),Mv(),Wr(),Aa(),Qr(),fa();var DV=class extends f.SuggestModal{constructor(e,t){super(e),this.thino=t}sanitisedFileName(e){let t=Vr;return e.replace(t,``).trim().slice(0,255)}ensureUniqueFileNames(e){let t=[];return e.map(e=>{let n=this.sanitisedFileName(e[0]),r=t.filter(e=>e==n);return t.push(n),r.length>=1?`${n}${r.length+1}`:n})}contentSplitByHeading(e,t){let n=e.split(`
|
||
`),r=Array(t).join(`#`)+` `,i=Array(t+1).join(`#`)+` `,a=[],o=[];return n.forEach((e,t)=>{e.startsWith(i)?o.length>0?(a.push(o),o=[],o.push(e)):o.push(e):o.length>0&&!e.startsWith(r)?o.push(e):o.length>0&&(a.push(o),o=[]),t===n.length-1&&o.length>0&&a.push(o)}),a}onChooseSuggestion(e,t){this.selectSuggestion(e,t)}renderSuggestion(e,t){t.setText(e.title)}getSuggestions(){return[{id:`splitByHeading1`,title:M(`Split by Heading 1`)},{id:`splitByHeading2`,title:M(`Split by Heading 2`)},{id:`splitByHeading3`,title:M(`Split by Heading 3`)}]}async selectSuggestion(e,t){let n=[];if(e.id===`splitByHeading1`?n=this.contentSplitByHeading(this.thino.content,1):e.id===`splitByHeading2`?n=this.contentSplitByHeading(this.thino.content,2):e.id===`splitByHeading3`&&(n=this.contentSplitByHeading(this.thino.content,3)),n.length===0){new f.Notice(`No headings found`),this.close();return}let r=this.ensureUniqueFileNames(n);for(let e of n){let t=n.indexOf(e),i=await V.createThino({content:e.join(`
|
||
`),name:r[t],type:`MULTI`,isList:!0});V.pushMemo(i)}let i=this.thino.content;n.forEach((e,t)=>{i=i.replace(e.join(`
|
||
`),`[[${r[t]}]]`)});let a=await V.updateMemo(this.thino.id,i);a&&V.editMemo(a),this.close()}},OV=async(e,t,n)=>{let r=n.getAttribute(`href`),i=n.className;if(i.contains(`tag`))kV(n.innerText.slice(1));else if(i.contains(`internal-link`)){let r=n.getAttribute(`data-href`),i=V.getMemoById(r??``);i?Fx(i):await e.workspace.openLinkText(r,r,!f.Platform.isMobile&&t.navigation!==!0)}else r&&window.open(r,`_blank`)},kV=e=>{let t=z.getState().query.tag;z.setTagQuery(t.contains(`,`)?t.split(`,`).includes(e)?t.split(`,`).filter(t=>t!==e).join(`,`):t+`,`+e:t===e?``:e)},AV=(e,t)=>{let n=t?.getAttribute(`src`),r=t?.parentElement.getAttribute(`src`),i=[...e?.querySelectorAll(`img`)||[]],a=i.indexOf(t);KS({imgUrl:n,filepath:n.startsWith(`app`)?r:void 0,otherIMGEls:i,currentIndex:a})},jV=e=>{let t=e.dataset?.value,n=V.getMemoById(t??``);n?Fx(n):(new f.Notice(`Thino Not Found`),e.classList.remove(`memo-link-text`))},MV=async(e,t,n,r)=>{let i=e?.AppendDateWhenTaskDone?` ✅ `+(0,f.moment)().format(`YYYY-MM-DD`):``,a=r.parentElement.dataset?.task===`x`?`DONE`:`TODO`,o=[...n?.querySelectorAll(`li.task-list-item`)||[]];for(let n of o)if(n===r||n===r.closest(`li.task-list-item`)){let r=o.indexOf(n),s=t.content.split(/\n/),c=[];for(let e=0;e<s.length;e++)/^\s*(-|\*|\d+\.)\s\[.\]\s/.test(s[e])&&c.push(e);let l=c[r],u=s[l],d=u.match(/^\s*(-|\*|\d+\.)\s\[.\]\s/)[0],f=u.replace(/^\s*(-|\*|\d+\.)\s\[.\]\s/,d.replace(/\[.\]/,a===`TODO`?`[x]`:`[ ]`))+(a===`TODO`?i:``);e.AppendDateWhenTaskDone&&a!==`TODO`&&(f=f.replace(/ ✅ \d{4}-\d{2}-\d{2}/g,``)),s[l]=f;let p=s.join(`
|
||
`).trim();if(t&&t.content!==p){let e=await V.updateMemo(t.id,p);V.editMemo(e)}}},NV=({item:e,index:t,isFocused:n,isEditing:r,onFocus:i,onEdit:a,onExitEdit:o,onContentChange:s,onCreateNext:c,onDelete:l,itemRef:u})=>{let{app:d,view:p,settings:m,verifyState:h}=I(),g=(0,U.useRef)(null),_=(0,U.useRef)(null),v=(0,U.useRef)(null),y=(0,U.useRef)(null);(0,U.useRef)(null);let b=(0,U.useRef)(null),[x,S]=(0,U.useState)(!1),{isSelected:C,handleClick:w}=Nw(e.id);(0,U.useEffect)(()=>(u(g.current,e.id),()=>u(null,e.id)),[e.id,u]),(0,U.useEffect)(()=>{if(!r&&_.current&&d&&p){let t=e.optimisticContent??e.content??``;_.current.empty(),f.MarkdownRenderer.render(d,t,_.current,e.isPending?``:e.path,p),_.current.classList.add(`markdown-rendered`)}},[e.content,e.optimisticContent,r,d,p,e.isPending]);let T=new Date(e.createdAt),E=!Number.isNaN(T.getTime()),D=E?T.toLocaleString():String(e.createdAt),O=E?(0,f.moment)(T).format(`HH:mm`):D,k=(0,U.useCallback)(t=>{if(!e.isPending){if(t.ctrlKey||t.metaKey){let t=(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`);z.setFromAndToQuery(t.startOf(`day`).valueOf(),t.endOf(`day`).valueOf());return}Fx(e)}},[e]),A=(0,U.useCallback)(()=>{if(!e.isPending){if(m?.UseButtonToShowEditor&&m?.DefaultEditorLocation===`Bottom`){let e=document.querySelector(`div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.thino-hidden)`);e&&e.trigger(`click`)}R.setMarkMemoId(e.id)}},[e,m]),j=(0,U.useCallback)(async()=>{if(e.isPending)return;let t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),n=f.Platform.isDesktop?await Dv():t.identifier||t.uuid;if(!h||h?.appId!==n){Sv();return}let r=e;r.pinned?await V.unpinMemoById(r.id):await V.pinMemoById(r.id)},[e,h]),ee=(0,U.useCallback)(()=>{a(t)},[t,a]),te=(0,U.useCallback)(async()=>{e.isPending||await V.openThinoByID(e.id)},[e]),ne=(0,U.useCallback)(async()=>{if(!e.isPending)try{let t=await V.archiveMemo(e);t&&V.editMemo(t)}catch(e){console.error(e),new f.Notice(e.message)}},[e]),re=(0,U.useCallback)(async()=>{l(e.id)},[e.id,l]),ie=(0,U.useCallback)(()=>{e.isPending||RS(e)},[e]),ae=(0,U.useCallback)(async()=>{navigator.clipboard.writeText(e.content).then(()=>{new f.Notice(M(`COPY SUCCEED`))}).catch(()=>{new f.Notice(M(`COPY FAILED`))})},[e.content]),oe=(0,U.useCallback)(async t=>{if(e.isPending)return;let n=await Sa(e,t);navigator.clipboard.writeText(n),new f.Notice(M(`COPY SUCCEED`))},[e]);(0,U.useCallback)(async()=>{e.isPending||new DV(d,e).open()},[e,d]),(0,U.useCallback)(async()=>{if(e.isPending)return;let t=e;t.sourceType===`MULTI`&&t.id.trim()===``&&await V.updateMemoProperty(t)},[e]);let se=(0,U.useCallback)(async t=>{if(e.isPending)return;t.preventDefault(),t.stopPropagation();let n=t.target;if(t.ctrlKey||t.metaKey){await te();return}if(n.tagName===`A`){await OV(d,p,n);return}if(n.tagName===`IMG`){AV(g.current,n);return}if(n.tagName===`A`&&n.getAttribute(`href`)){let e=n.getAttribute(`href`);window.open(e,`_blank`);return}if(n.className===`memo-link-text`){jV(n);return}if(n.tagName===`INPUT`&&n.hasClass(`task-list-item-checkbox`)){await MV(m,e,g.current,n);return}},[e,d,p,m,te]),ce=(0,U.useCallback)(t=>{if(e.isPending)return;t.stopPropagation(),t.preventDefault();let n=new f.Menu;(async()=>{try{let r=[],i=[],a=[...e.content.matchAll(Br)];for(let e of a)if(e&&e.length===3){let t=e[2],n=V.getMemoById(t);n&&r.push({...n,createdAtStr:P.getDateTimeString(n.createdAt),dateStr:P.getDateString(n.createdAt)})}let o=va(e.content);for(let e of o){let[t,n]=e.split(`#^`),i=n;if(t&&i){let e=await V.getLinkedMemoByBlockId(i,t);e&&!r.some(t=>t.id===e.id)&&r.push({...e,createdAtStr:P.getDateTimeString(e.createdAt),dateStr:P.getDateString(e.createdAt)})}}let s=e,c=await V.getLinkedMemos(s.id),l=[];s.hasId&&s.path&&(l=await V.getLinkedMemosByLinkId(s.hasId,s.path));let u=[...c,...l];Array.from(new Map(u.map(e=>[e.id,e])).values()).sort((e,t)=>P.getTimeStampByDate(t.createdAt)-P.getTimeStampByDate(e.createdAt)).forEach(e=>{i.push({...e,createdAtStr:P.getDateTimeString(e.createdAt),dateStr:P.getDateString(e.createdAt)})}),n.addSections([`Outgoing`,`Incoming`]),r.length>0&&r.forEach(e=>{n.addItem(t=>{let n=e.content.length>10?e.content.substring(0,10)+`...`:e.content;t.setTitle(n).setIcon(`arrow-right`).onClick(()=>{Fx(e)})})}),i.length>0&&i.forEach(e=>{n.addItem(t=>{let n=e.content.length>10?e.content.substring(0,10)+`...`:e.content;t.setTitle(n).setSection(`Incoming`).setIcon(`arrow-left`).onClick(()=>{Fx(e)})})}),r.length===0&&i.length===0&&n.addItem(e=>{e.setDisabled(!0).setTitle(M(`No reference links found`))}),n.showAtMouseEvent(t.nativeEvent)}catch(e){console.error(`Error fetching linked memos:`,e),new f.Notice(M(`Error fetching reference links`))}})()},[e]),le=(0,U.useCallback)(t=>{t.preventDefault(),t.stopPropagation();let n=new f.Menu;n.dom.toggleClass(`memo-context-menu`,!0);let r=window.getSelection();r?.toString().length>0&&n.addItem(e=>{e.setIcon(`copy`).setTitle(M(`Copy selected text`)).onClick(()=>{navigator.clipboard.writeText(r.toString()).then(()=>{new f.Notice(M(`COPY SUCCEED`))}).catch(()=>{new f.Notice(M(`COPY FAILED`))})})}).addSeparator(),!e.isPending&&e.sourceType===`DAILY`&&(n.addItem(e=>{e.setIcon(`link`).setTitle(M(`Copy embed link`)).onClick(()=>{oe(!0)})}),n.addItem(e=>{e.setIcon(`link`).setTitle(M(`Copy link`)).onClick(()=>{oe(!1)})}),n.addSeparator()),m?.enableReferenceLinksGroup&&!e.isPending&&n.addItem(e=>{e.setIcon(`link`).setTitle(M(`Reference links group`)).onClick(()=>ce(t))}),n.addItem(e=>{e.setIcon(`copy`).setTitle(M(`Copy thino`).toLocaleUpperCase()).onClick(async()=>{await ae(),n.close()})}),n.addItem(e=>{e.setIcon(`book-open`).setTitle(M(`READ`)).onClick(()=>k(t))}),e.isPending||n.addItem(t=>{let n=e.pinned;t.setIcon(n?`pin-off`:`pin`).setTitle(M(n?`UNPIN`:`PIN`)).onClick(j)}),n.addItem(e=>{e.setIcon(`bookmark`).setTitle(M(`MARK`)).onClick(A)}),e.isPending||n.addItem(e=>{e.setIcon(`share-2`).setTitle(M(`SHARE`)).onClick(ie)}),n.addItem(e=>{e.setIcon(`pencil`).setTitle(M(`EDIT`)).onClick(ee)}),e.isPending||n.addItem(e=>{e.setIcon(`home`).setTitle(M(`SOURCE`)).onClick(()=>te())}),n.addSeparator(),e.isPending||n.addItem(e=>{e.setIcon(`archive`).setWarning(!0).setTitle(M(`ARCHIVE`).toLocaleUpperCase()).onClick(()=>ne())}),n.addItem(e=>{e.setIcon(`trash`).setWarning(!0).setTitle(M(`DELETE`)).onClick(async()=>{await re()})}),n.showAtMouseEvent(t.nativeEvent)},[e,m,oe,ce,ae,k,j,A,ie,ee,te,ne,re]),ue=(0,U.useCallback)(t=>{if(e.isPending||!t.shiftKey||!p||!d)return;t.stopPropagation();let n=e;d.workspace.trigger(`hover-link`,{event:t,source:`thino`,hoverParent:p.containerEl,targetEl:g.current,linktext:n.path,sourcePath:n.path,state:{scroll:n.sourceType===`DAILY`?parseInt(n.id.slice(14)):0}})},[e,d,p]),de=()=>{let t=new f.Menu;if(t.dom.toggleClass([`more-action-btns-wrapper`],!0),t.useNativeMenu){if(t.setNoIcon(),r||t.addItem(e=>{e.setTitle(M(`EDIT`)).onClick(ee)}),!e.isPending){t.addItem(e=>{e.setTitle(M(`COPY`)).onClick(ae)});let n=e;t.addItem(e=>{e.setTitle(n.pinned?M(`UNPIN`):M(`PIN`)).onClick(j)}),t.addItem(e=>{e.setTitle(M(`SHARE`)).onClick(ie)}),t.addItem(e=>{e.setTitle(M(`SOURCE`)).onClick(te)}),t.addSeparator(),t.addItem(e=>{e.setTitle(M(`MARK`)).onClick(A)}),t.addItem(e=>{e.setTitle(M(`ARCHIVE`)).onClick(ne)})}t.addSeparator(),t.addItem(e=>{e.setWarning(!0).setTitle(M(`DELETE`)).onClick(re)})}else{if(t.addItem(n=>{let i=n.dom;if(n.dom.empty(),n.dom.toggleClass([`more-action-btn-group`,`more-action-menu-item`],!0),!r){let e=i.createEl(`span`);e.toggleClass([`menu-item-icon`,`more-action-item-icon`],!0),e.onclick=e=>{e.stopPropagation(),e.preventDefault(),ee(),t.close()},new f.ExtraButtonComponent(e).setIcon(`pencil`)}if(!e.isPending){let e=i.createEl(`span`);e.toggleClass([`menu-item-icon`,`more-action-item-icon`],!0),e.onclick=e=>{e.stopPropagation(),e.preventDefault(),ae(),t.close()},new f.ExtraButtonComponent(e).setIcon(`copy`)}}),!e.isPending){t.addSeparator();let n=e;t.addItem(e=>{e.setIcon(n.pinned?`pin-off`:`pin`).setTitle(n.pinned?M(`UNPIN`):M(`PIN`)).onClick(j)}),t.addItem(e=>{e.setIcon(`share-2`).setTitle(M(`SHARE`)).onClick(ie)}),t.addItem(e=>{e.setIcon(`home`).setTitle(M(`SOURCE`)).onClick(te)}),t.addSeparator(),t.addItem(e=>{e.setIcon(`bookmark`).setTitle(M(`MARK`)).onClick(A)}),t.addItem(e=>{e.setIcon(`archive`).setTitle(M(`ARCHIVE`)).onClick(ne)})}t.addSeparator(),t.addItem(e=>{e.setWarning(!0).setIcon(`trash`).setTitle(M(`DELETE`)).onClick(e=>{e.stopPropagation(),e.preventDefault(),re(),t.close()})})}return t.onHide(()=>{y.current=null}),y.current=t,t},fe=e=>{if(e.stopPropagation(),y.current){y.current.close();return}de().showAtMouseEvent(e.nativeEvent)},pe=e=>{w(e)||n||i(t)},me=(0,U.useCallback)(n=>{if(n&&n.target.tagName!==`INPUT`)switch(m?.doubleClickBehavior||`edit-thino`){case`open-thino`:e.isPending||Fx(e);break;case`edit-thino`:r||a(t);break;case`go-to-source`:e.isPending||te();break;case`do-nothing`:break;default:r||a(t);break}},[e,t,m,r,a,te]);return(0,U.useEffect)(()=>{e.isPending||!b.current||x||!g.current||(d.dragManager.handleDrag(b.current,t=>{d.dragManager.updateSource([g.current],`is-dragging`);let n=e;if(t.dataTransfer.setData(`text/plain`,e.content),t.dataTransfer.setData(`text/uri-list`,e.content),t.dataTransfer.setData(`Text`,e.content),m?.DraggingBehavior===`block-link`)if(n?.sourceType===`DAILY`){let e=d.vault.getFileByPath(n.path),t=n.hasId;return n.hasId||(t=P.randomId(6),sa(n,{id:n.id,hasId:t})),{type:`link`,icon:`lucide-link`,title:e.basename,linktext:`${n.path}#^${t}`,sourcePath:n.path,file:e,memo:n,blockId:t,source:`thino-plugin`}}else return null;else if(m?.DraggingBehavior===`text`)return null}),S(!0))},[e,b.current,g.current,m?.DraggingBehavior,x]),(0,W.jsxs)(`div`,{ref:g,className:u_(`flow-item`,{focused:n,editing:r,pending:e.isPending,pinned:!e.isPending&&e.pinned,selected:C}),"data-source-type":e.isPending?void 0:e.sourceType,"data-thino-type":e.isPending?void 0:e.thinoType,"data-thino-id":e.id,onClick:pe,onDoubleClick:me,onContextMenu:le,onMouseOver:ue,tabIndex:-1,children:[(0,W.jsx)(`div`,{ref:b,className:`flow-item-header`,draggable:!e.isPending,children:(0,W.jsx)(`span`,{ref:v,className:`flow-item-time`,onClick:fe,"aria-label":D,children:O})}),(0,W.jsx)(`div`,{className:`flow-item-content`,onClick:se,children:r?(0,W.jsx)(`div`,{className:`flow-item-editor-placeholder`,children:(0,W.jsx)(EV,{itemId:e.id,initialContent:e.content,placeholder:`Write your note here... (Shift+Enter for new line, Enter to save, Ctrl+Enter for new note)`,onContentChange:t=>s(e.id,t),onSubmit:()=>c(t),onCancel:o})}):(0,W.jsx)(`div`,{ref:_,className:`flow-item-preview`,children:(e.optimisticContent??e.content)||(0,W.jsx)(`em`,{className:`empty-content`,children:`Empty note`})})})]})};H(),Sg(),bg();var PV=()=>`pending-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,FV=e=>{let[t,n]=(0,U.useState)([]),[r,i]=(0,U.useState)(new Map),a=(0,U.useRef)(new Map),o=(0,U.useRef)(new Map);(0,U.useEffect)(()=>{a.current=r},[r]);let s=xg(e=>e.sort),c=(0,U.useMemo)(()=>t.slice().sort((e,t)=>t.createdAt-e.createdAt),[t]),l=(0,U.useMemo)(()=>_g(e,s).map(e=>({...e,isPending:!1})),[e,s]),u=(0,U.useMemo)(()=>{let e=new Set(l.map(e=>e.id)),t=c.filter(t=>{let n=o.current.get(t.id);return!(n&&e.has(n))}),n=l.filter(e=>e.pinned),i=l.filter(e=>!e.pinned);return[...n,...t,...i].map(e=>{let t=r.get(e.id);return t===void 0?e:{...e,optimisticContent:t}})},[c,l,r]);(0,U.useEffect)(()=>{r.size!==0&&r.forEach((t,n)=>{if(n.startsWith(`pending-`))return;let r=e.find(e=>e.id===n);r&&r.content===t&&i(e=>{let t=new Map(e);return t.delete(n),t})})},[e,r]);let d=(0,U.useCallback)(e=>{let t=PV(),r={id:t,content:``,isPending:!0,createdAt:Date.now()};return n(t=>{if(e!==void 0&&e>=0){let n=[...t];return n.splice(e,0,r),n}else return[...t,r]}),t},[]),p=(0,U.useCallback)((e,t)=>{o.current.set(e,t.id)},[]);(0,U.useEffect)(()=>{if(t.length===0)return;let r=new Set(e.map(e=>e.id)),a=[];for(let e of t){let t=o.current.get(e.id);t&&r.has(t)&&a.push(e.id)}a.length>0&&(n(e=>e.filter(e=>!a.includes(e.id))),i(e=>{let t=new Map(e);return a.forEach(e=>t.delete(e)),t}),a.forEach(e=>o.current.delete(e)))},[e,t]);let m=(0,U.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e)),i(t=>{let n=new Map(t);return n.delete(e),n})},[]),h=(0,U.useMemo)(()=>(0,f.debounce)(async(e,t)=>{let n=a.current.get(e);if(!n||n!==t)return;let r=e.startsWith(`pending-`);if(!t.trim()){r&&m(e);return}try{if(r){let n=await V.createMemoDaily(t,!0);n&&(o.current.set(e,n.id),p(e,n))}else await V.updateMemo(e,t)}catch(e){console.error(`Failed to save content:`,e)}},1e3),[m,p]),g=(0,U.useCallback)(async e=>{let t=a.current.get(e)??``;if(e.startsWith(`pending-`)&&t.trim())try{let n=await V.createMemoDaily(t,!0);n&&(o.current.set(e,n.id),p(e,n))}catch(e){console.error(`Immediate save failed:`,e)}},[p]);return{allItems:u,addPendingItem:d,confirmPendingItem:p,removePendingItem:m,updateItemContent:(0,U.useCallback)((e,t)=>{i(n=>{let r=new Map(n);return r.set(e,t),r}),n(n=>n.map(n=>n.id===e?{...n,content:t}:n)),h(e,t)},[h]),savePendingImmediately:g}},IV=e=>{let[t,n]=(0,U.useState)(0),[r,i]=(0,U.useState)(null),a=(0,U.useRef)(new Map),o=(0,U.useCallback)(t=>{if(t<0||t>=e.length)return;n(t);let r=e[t].id,i=a.current.get(r);i&&(typeof i.focus==`function`&&i.focus({preventScroll:!0}),i.scrollIntoView({block:`nearest`,behavior:`smooth`}))},[e]);return{focusedIndex:t,editingIndex:r,itemRefs:a,setFocusedIndex:n,setEditingIndex:i,focusItem:o,handleKeyDown:(0,U.useCallback)(e=>{if(r===null)switch(e.key){case`ArrowUp`:e.preventDefault(),o(t-1);break;case`ArrowDown`:e.preventDefault(),o(t+1);break;case`Enter`:e.preventDefault(),i(t);break;case`Escape`:break;default:break}},[r,t,o])}},LV=60,RV=40,zV=({thinos:e})=>{let t=(0,U.useRef)(null),n=(0,U.useRef)(null),r=(0,U.useRef)([]),i=(0,U.useRef)(`top-composer-${Date.now()}`),[a,o]=(0,U.useState)(``),[s,c]=(0,U.useState)((0,f.moment)().format(`HH:mm`)),[l,u]=(0,U.useState)(new Date().toLocaleString()),[d,p]=(0,U.useState)(()=>Math.min(LV,e.length)),{getScrollElement:m}=fB(),[h,g]=(0,U.useState)(!1),_=(0,U.useRef)(null),v=(0,U.useRef)(!1);U.useEffect(()=>{let e=window.setInterval(()=>{c((0,f.moment)().format(`HH:mm`)),u(new Date().toLocaleString())},3e4);return()=>window.clearInterval(e)},[]);let{allItems:y,addPendingItem:b,removePendingItem:x,updateItemContent:S,savePendingImmediately:C}=FV(e),{focusedIndex:w,editingIndex:T,itemRefs:E,setEditingIndex:D,focusItem:O,handleKeyDown:k}=IV(y);U.useEffect(()=>{r.current=y},[y]);let A=U.useMemo(()=>d>=y.length?y:y.slice(0,d),[y,d]),j=d<y.length;U.useEffect(()=>{p(e=>{if(y.length===0)return 0;let t=Math.min(LV,y.length);if(e===0)return t;let n=Math.min(e,y.length);return n<t?t:n})},[y.length]),U.useEffect(()=>{let e=T??w;e>=d&&e<y.length&&p(t=>{let n=Math.max(t,e+1);return Math.min(y.length,n+RV)})},[w,T,d,y.length]),U.useEffect(()=>{if(y.length!==0){if(v.current){v.current=!1;return}O(w)}},[d,y.length,w,O]),U.useEffect(()=>{let e=n.current,t=m()??null;if(!e||!j)return;let r=new IntersectionObserver(e=>{let t=e.some(e=>e.isIntersecting);g(e=>e===t?e:t)},{root:t,rootMargin:`200px`});return r.observe(e),()=>r.disconnect()},[m,j]);let ee=(0,U.useCallback)(()=>{let e=m();e?_.current={prevScrollTop:e.scrollTop,prevScrollHeight:e.scrollHeight}:_.current=null,v.current=!0,p(e=>Math.min(y.length,e+RV))},[y.length,m]);(0,U.useLayoutEffect)(()=>{let e=_.current;if(!e)return;let t=m();if(_.current=null,!t)return;let n=t.scrollHeight-e.prevScrollHeight;n!==0&&t.scrollTo({top:e.prevScrollTop+n,behavior:`auto`})},[d,m]);let te=(0,U.useCallback)(e=>{O(e)},[O]),ne=(0,U.useCallback)(e=>{o(e)},[]),re=(0,U.useCallback)(()=>{let e=a.trim();if(!e)return;let t=b(0);S(t,e),C?.(t),o(``),i.current=`top-composer-${Date.now()}`,setTimeout(()=>{let e=r.current.findIndex(e=>e.id===t);e!==-1&&O(e)},0)},[a,b,S,O]),ie=(0,U.useCallback)(()=>{re()},[re]),ae=(0,U.useCallback)(e=>{D(e)},[D]),oe=(0,U.useCallback)(()=>{D(null),O(w)},[D,O,w]),se=(0,U.useCallback)((e,t)=>{S(e,t)},[S]),ce=(0,U.useCallback)(e=>{let t=b(e+1);setTimeout(()=>{let e=r.current.findIndex(e=>e.id===t);if(e===-1){D(null);return}D(e),O(e)},0)},[b,D,O]),le=(0,U.useCallback)(e=>{y.find(t=>t.id===e)?.isPending?x(e):console.log(`Delete real memo:`,e)},[y,x]),ue=(0,U.useCallback)((e,t)=>{e?E.current.set(t,e):E.current.delete(t)},[E]);return U.useEffect(()=>{let e=t.current;if(!e)return;let n=e=>{let t=e.target;if(!(t&&t.closest(`.temp-editor`))){if(y.length===0&&e.key===`Enter`){e.preventDefault(),e.stopPropagation();let t=b(0);setTimeout(()=>{let e=r.current.findIndex(e=>e.id===t);e!==-1&&(D(e),O(e))},0);return}T===null&&([`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&e.stopPropagation(),k(e))}};return e.addEventListener(`keydown`,n,{capture:!0}),()=>{e.removeEventListener(`keydown`,n,{capture:!0})}},[T,k]),(0,W.jsxs)(`div`,{ref:t,className:`flow-view`,tabIndex:-1,children:[(0,W.jsxs)(`div`,{className:`flow-list`,children:[(0,W.jsxs)(`div`,{className:`flow-top-composer flow-item`,children:[(0,W.jsx)(`div`,{className:`flow-item-header`,children:(0,W.jsx)(`span`,{className:`flow-item-time`,"aria-label":l,children:s})}),(0,W.jsx)(`div`,{className:`flow-item-content`,children:(0,W.jsx)(`div`,{className:`flow-item-editor-placeholder`,children:(0,W.jsx)(EV,{itemId:i.current,initialContent:a,placeholder:`Start a new note at the top...`,onContentChange:ne,onSubmit:re,onCancel:ie})})})]}),A.map((e,t)=>(0,W.jsx)(NV,{item:e,index:t,isFocused:w===t,isEditing:T===t,onFocus:te,onEdit:ae,onExitEdit:oe,onContentChange:se,onCreateNext:ce,onDelete:le,itemRef:ue},e.id)),j&&(0,W.jsxs)(`div`,{className:`flow-load-more-region`,children:[(0,W.jsx)(`div`,{ref:n,className:`flow-load-more-sentinel`,"aria-hidden":`true`}),h&&(0,W.jsx)(`button`,{type:`button`,className:`flow-load-more-button`,onClick:ee,children:`加载更多`})]})]}),y.length===0&&(0,W.jsx)(`div`,{className:`flow-empty-state`,children:(0,W.jsx)(`p`,{children:`Press Enter to create your first note`})})]})};vi(),H(),N();var BV=class extends f.Modal{message;onConfirm;onCancel;constructor(e,t,n,r){super(e),this.message=t,this.onConfirm=n,this.onCancel=r}onOpen(){let{contentEl:e}=this;e.empty(),e.addClass(`thino-confirm-modal`),e.createEl(`h2`,{text:M(`Confirm`)}),e.createEl(`p`,{text:this.message});let t=e.createDiv({cls:`modal-button-container`});t.createEl(`button`,{text:M(`Cancel`)}).addEventListener(`click`,()=>{this.onCancel(),this.close()}),t.createEl(`button`,{text:M(`Confirm`),cls:`mod-warning`}).addEventListener(`click`,()=>{this.onConfirm(),this.close()})}onClose(){let{contentEl:e}=this;e.empty()}},VV=({app:e})=>{let t=gi(e=>e.getSelectedCount()),n=gi(e=>e.getSelectedIds),r=gi(e=>e.clearSelection),i=F(e=>e.memos),[a,o]=(0,U.useState)(!1),s=(0,U.useCallback)(()=>{let e=n();return i.filter(t=>e.includes(t.id))},[n,i]),c=(0,U.useCallback)(t=>new Promise(n=>{new BV(e,t,()=>n(!0),()=>n(!1)).open()}),[e]),l=(0,U.useCallback)(async()=>{let e=s();if(e.length===0||!await c(`Are you sure you want to delete ${e.length} ${M(`Thinos`)}? This action cannot be undone.`))return;o(!0);let t=new f.Notice(M(`Deleting...`),0),n=0,i=0;for(let t of e)try{await V.deleteMemoById(t.id),n++}catch(e){console.error(`Failed to delete memo:`,t.id,e),i++}o(!1),t.hide(),r(),i===0?new f.Notice(`${M(`Successfully deleted`)} ${n} ${M(`Thinos`)}`):new f.Notice(`${M(`Successfully deleted`)} ${n} ${M(`Thinos`)}, ${M(`failed`)} ${i}`)},[s,c,r]),u=(0,U.useCallback)(async()=>{let e=s();if(e.length===0||!await c(`Are you sure you want to archive ${e.length} ${M(`Thinos`)}?`))return;o(!0);let t=new f.Notice(M(`Archiving...`),0),n=0,i=0;for(let t of e)try{await V.archiveMemo(t)?n++:i++}catch(e){console.error(`Failed to archive memo:`,t.id,e),i++}o(!1),t.hide(),r(),i===0?new f.Notice(`${M(`Successfully archived`)} ${n} ${M(`Thinos`)}`):new f.Notice(`${M(`Successfully archived`)} ${n} ${M(`Thinos`)}, ${M(`failed`)} ${i}`)},[s,c,r]),d=(0,U.useCallback)(async()=>{let e=s();if(e.length===0)return;let t=e.every(e=>e.pinned)?`unpin`:`pin`;if(!await c(t===`pin`?`Are you sure you want to pin ${e.length} ${M(`Thinos`)}?`:`Are you sure you want to unpin ${e.length} ${M(`Thinos`)}?`))return;o(!0);let n=new f.Notice(M(t===`pin`?`Pinning...`:`Unpinning...`),0),i=0,a=0;for(let n of e)try{t===`pin`?await V.pinMemoById(n.id):await V.unpinMemoById(n.id),i++}catch(e){console.error(`Failed to ${t} memo:`,n.id,e),a++}o(!1),n.hide(),r(),a===0?new f.Notice(t===`pin`?`${M(`Successfully pinned`)} ${i} ${M(`Thinos`)}`:`${M(`Successfully unpinned`)} ${i} ${M(`Thinos`)}`):new f.Notice(`${M(`Processed`)} ${i} ${M(`Thinos`)}, ${M(`failed`)} ${a}`)},[s,c,r]),p=(0,U.useCallback)(async()=>{let e=s();if(e.length===0)return;o(!0);let t=e.map(e=>`${`## ${e.createdAt}${e.pinned?` 📌`:``}`}\n\n${e.content}`).join(`
|
||
|
||
---
|
||
|
||
`);try{await navigator.clipboard.writeText(t),new f.Notice(`${M(`Successfully copied`)} ${e.length} ${M(`Thinos`)} to clipboard`),r()}catch(e){console.error(`Failed to copy to clipboard:`,e),new f.Notice(M(`Copy to clipboard failed`))}finally{o(!1)}},[s,r]),m=(0,U.useCallback)(()=>{r()},[r]);return t===0?null:(0,W.jsx)(`div`,{className:u_(`selection-toolbar`,{loading:a}),children:(0,W.jsxs)(`div`,{className:`selection-toolbar-content`,children:[(0,W.jsx)(`span`,{className:`selection-toolbar-count`,children:`${t} ${M(`items`)}`}),(0,W.jsxs)(`div`,{className:`selection-toolbar-actions`,children:[(0,W.jsxs)(`div`,{className:`clickable-icon selection-toolbar-btn`,onClick:d,title:M(`Pin/Unpin selected`),children:[(0,W.jsx)(`span`,{ref:e=>e&&(0,f.setIcon)(e,`pin`)}),M(`Pin/Unpin`)]}),(0,W.jsxs)(`div`,{className:`clickable-icon selection-toolbar-btn`,onClick:u,"aria-label":M(`Archive selected`),children:[(0,W.jsx)(`span`,{ref:e=>e&&(0,f.setIcon)(e,`archive`)}),M(`Archive`)]}),(0,W.jsxs)(`div`,{className:`clickable-icon selection-toolbar-btn`,onClick:p,"aria-label":M(`Copy to clipboard`),children:[(0,W.jsx)(`span`,{ref:e=>e&&(0,f.setIcon)(e,`copy`)}),M(`Copy`)]}),(0,W.jsxs)(`div`,{className:`clickable-icon selection-toolbar-btn danger`,onClick:l,"aria-label":M(`Delete selected`),children:[(0,W.jsx)(`span`,{ref:e=>e&&(0,f.setIcon)(e,`trash`)}),M(`Delete`)]}),(0,W.jsx)(`div`,{className:`clickable-icon selection-toolbar-btn selection-toolbar-clear`,onClick:m,title:M(`Clear selection`),children:(0,W.jsx)(`span`,{ref:e=>e&&(0,f.setIcon)(e,`x`)})})]})]})})};vi(),jg(),H(),Kh(),N(),Si();var HV=new Map,UV=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function WV(e,t){let n=e.replaceAll(`-`,`/`),r=n.substring(0,4),i=n.substring(5,7),a=n.substring(8,10);switch(t){case`year`:return r;case`month`:return`${r}-${i}`;case`quarter`:return`${r}-Q${Math.ceil(parseInt(i)/3)}`;case`week`:{let e=new Date(parseInt(r),parseInt(i)-1,parseInt(a)),t=Bs(e),n=gu(e);return`${t}-W${String(n).padStart(2,`0`)}`}case`day`:return`${r}-${i}-${a} ${UV[new Date(parseInt(r),parseInt(i)-1,parseInt(a)).getDay()]}`;default:return e.substring(0,10)}}function GV(e,t){let n={};return e.forEach(e=>{let r;if(e.pinned)r=`PINNED`;else{let n=`${e.createdAt}-${t}`,i=HV.get(n);i||(i=WV(e.createdAt,t),HV.set(n,i),HV.size>1e3&&Array.from(HV.keys()).slice(0,500).forEach(e=>HV.delete(e))),r=i}n[r]||(n[r]=[]),n[r].push(e)}),n}function KV(e){let{tag:t,duration:n,type:r,text:i,filter:a,path:o,metadata:s}=e,c=Bg.getQueryById(a),l=!s||Object.keys(s).length===0;return!(t||n&&n.from<n.to||r||i||!l||o||c?.id||c)}var qV=({updateThinos:e,listView:t,sortConfig:n})=>{let r=di(e=>e.query),i=F(e=>e.memos),a=i?.length||0,o=I(e=>e.app),s=I(e=>e.settings?.showDayMark),c=I(e=>e.settings?.dayMarkRange),l=I(e=>e.settings?.ShowScrollToTopButton),u=gi(e=>e.getSelectedCount()),[d,p]=(0,U.useState)([]),m=(0,U.useRef)([]),h=(0,U.useMemo)(()=>{if(n)return{sortBy:n.field,sortOrder:n.direction}},[n]),g=(0,U.useRef)(null),[_,v]=(0,U.useState)({showDayMark:o?.loadLocalStorage(`showDayMark`)||!1,dayMarkRange:o?.loadLocalStorage(`dayMarkRange`)||`day`,dayMarkThinos:{}}),y=(0,U.useRef)(null),b=(0,U.useCallback)(()=>{y.current?.scrollToTop()},[]),x=(0,U.useCallback)(()=>{y.current?.scrollToTop()},[]),S=(0,U.useRef)(!1),C=(0,U.useRef)(!1);(0,U.useRef)(!1),(0,U.useEffect)(()=>{t!==`chat`&&x()},[t]),(0,U.useLayoutEffect)(()=>{if(i.length!==0&&S.current===!0)return;let e=YV(o||window.app);if(!e||e.length===0)return;let t=e.slice(0,200);C.current=!0,m.current=t,p(t);let n=o?.loadLocalStorage(`showDayMark`)||!1;v(t=>({...t,showDayMark:n,dayMarkThinos:n?GV(e,o?.loadLocalStorage(`dayMarkRange`)||`day`):t.dayMarkThinos}))},[]);let w=Ag(e=>e.filteredMemos),T=Ag(e=>e.version),E=Ag(e=>e.isCalculating);(0,U.useEffect)(()=>{if(T===0||E)return;let t=a>0,n=!KV(r),i=T===1&&w.length===0&&t&&!n?m.current:w;i!==d&&(0,U.startTransition)(()=>{p(i)}),m.current=i,e?.(i)},[w,T,E,e,a,r,d]),(0,U.useEffect)(()=>{T>0&&XV(d||[],o);let e=s||!1,t=c||`day`;o?.saveLocalStorage(`showDayMark`,e),o?.saveLocalStorage(`dayMarkRange`,t),v(n=>({showDayMark:e,dayMarkRange:t,dayMarkThinos:e?GV(d,t):n.dayMarkThinos}))},[d,s,c,T,o]),(0,U.useEffect)(()=>{E||t!==`chat`&&b()},[r,E,t,b]);let D=()=>V.fetchAllMemos().then(()=>{}).catch(e=>{console.error(`Failed to refresh memos:`,e)}),O=(0,U.useCallback)((0,f.debounce)(async()=>{try{await D(),setTimeout(()=>{t!==`chat`&&b()},100)}catch(e){console.error(`Pull-to-refresh failed:`,e),new f.Notice(`Failed to refresh data`)}},800),[D,b]);(0,U.useMemo)(()=>(0,W.jsx)(`div`,{className:u_(`status-text-container`,`completed`,t===`calendar`||t===`table`?`visually-hidden`:``),children:(0,W.jsx)(`p`,{className:`status-text`,children:d.length===0?M(`Noooop!`):(0,W.jsxs)(W.Fragment,{children:[M(`All Data is Loaded 🎉`),(0,W.jsx)(`span`,{className:`cursor-pointer hover:text-green-600 ml-2`,onClick:O,title:`Refresh to check for new memos`,children:`↻`})]})})}),[t,d,O]);let k=e=>{let{showDayMark:t,dayMarkRange:n}=_;switch(e){case`list`:return(0,W.jsx)(BD,{memos:d,listView:e,className:`${e}-view`,sortConfig:h,showDayMark:t,dayMarkRange:n});case`waterfall`:return(0,W.jsx)(wV,{memos:d,className:`${e}-view waterfall-virtual`,columns:3,gap:10});case`chat`:return(0,W.jsx)(_V,{thinos:d});case`calendar`:return(0,W.jsx)(TL,{thinos:d});case`table`:return(0,W.jsx)(sB,{thinos:d,isFiltering:!KV(r)});case`moments`:return(0,W.jsx)(SV,{thinos:d});case`flow`:return(0,W.jsx)(zV,{thinos:d});default:return(0,W.jsx)(BD,{memos:d,listView:e,className:`${e}-view`,sortConfig:h,showDayMark:_.showDayMark,dayMarkRange:_.dayMarkRange})}};return(0,W.jsxs)(pB,{scrollRef:y,children:[u>0&&o&&(0,W.jsx)(VV,{app:o}),(0,W.jsx)(TV,{ref:y,className:`memolist-wrapper completed`,mode:t===`chat`?`bottom`:`top`,style:{height:`100%`},children:(0,W.jsx)(`div`,{ref:g,className:`memolist-container`,"data-list-view":t,"data-count":d?.length||0,children:k(t)})}),l&&(0,W.jsx)(`button`,{className:u_(`scroll-to-bottom-button`,t===`chat`?`to-bottom`:`to-top`,t===`flow`&&`thino-hidden`,(t===`table`||t===`calendar`)&&`thino-hidden`),onClick:()=>{t===`chat`?y.current?.scrollToBottom(!0):y.current?.scrollToTop(!0)},children:`↑`})]})};function JV(e){return`memosListCache:${e}`}function YV(e){try{if(!e?.appId)return[];let t=JV(e.appId),n=xi.get([t])[t];return n&&JSON.parse(n)?.memos||[]}catch(e){return console.error(e),[]}}function XV(e,t){try{if(!e)return;let n=(t||window?.app)?.appId;if(!n)return;let r=e?.slice(0,100),i=JV(n);xi.set({[i]:JSON.stringify({memos:r})})}catch(e){console.error(e)}}vi(),bg(),_o();function ZV(){let{settings:e,app:t,view:n}=I(),{loaded:r,memoListView:i}=si(),a=f.Platform.isMobile&&e?.DefaultEditorLocation===`Bottom`,[o,s]=U.useState([]),[c,l]=U.useState((window.app||t).loadLocalStorage(`thinoListView`)||`list`),[u,d]=(0,U.useState)(()=>yg(t||window.app)),p=e=>{d(e)};(0,U.useEffect)(()=>{i===c||!i||(l(i),t&&t?.saveLocalStorage(`thinoListView`,i))},[i]),(0,U.useEffect)(()=>{if(!(!n||!t||!r))return go.startPolling(n),()=>go.stopPolling()},[n,t,r,e.startSync]);let m=[(0,W.jsx)(oC,{thinosCount:o.length,thinos:o},`filter`),(0,W.jsx)(qV,{listView:c,sortConfig:u,updateThinos:e=>{s(e)}},`list`)];return(0,W.jsx)(W.Fragment,{children:i===`chat`?(0,W.jsx)(W.Fragment,{children:[(0,W.jsx)(TT,{onSortChange:p,currentSort:u},`header`),...m.reverse(),(0,W.jsx)(Aw,{className:`mod-editor-bottom`,editorType:`inline`},`editor`)]}):(0,W.jsx)(W.Fragment,{children:a?[(0,W.jsx)(TT,{onSortChange:p,currentSort:u},`header`),...m,(0,W.jsx)(Aw,{className:`mod-editor-bottom`,editorType:`block`},`editor`)]:[(0,W.jsx)(TT,{onSortChange:p,currentSort:u},`header`),(0,W.jsx)(Aw,{editorType:`block`},`editor`),...m]})})}Qr(),H(),N(),os(),vi(),_o();var QV=e=>{let{memo:t,handleDeletedMemoAction:n}=e,r=I(),i={...t,createdAtStr:P.getDateTimeString(t.createdAt),deletedAtStr:P.getDateTimeString(t.deletedAt||t.createdAt)},a=U.useRef(null),o=U.useRef(null),[s,c]=U.useState(``),l=(0,U.useRef)(null);(0,U.useEffect)(()=>{!o||!l.current||(0,f.setIcon)(l.current,`more-horizontal`)},[o]),(0,U.useEffect)(()=>{if(!a.current||!o.current||a.current.hasChildNodes()&&t.content===s)return;let{view:e}=r;if(!e)return;c(t.content),a.current.hasChildNodes()&&a.current.empty();async function n(){await f.MarkdownRenderer.render(r.app,t.content+`
|
||
`,a.current,t.path,e),(a.current?.querySelectorAll(`.internal-link`))?.forEach(n=>{let i=n,a=i.getAttribute(`data-href`);a&&(r.app.metadataCache.getFirstLinkpathDest(a,t.path)||n.classList.add(`is-unresolved`),i.addEventListener(`mouseover`,t=>{t.stopPropagation(),r.app.workspace.trigger(`hover-link`,{event:t,source:`thino`,hoverParent:e.containerEl,targetEl:i,linktext:a,sourcePath:i.href})}))})}n()},[t.content,o]);let u=async()=>{try{await V.deleteMemoById(i.id),n(i.id)}catch(e){new f.Notice(e.message)}},d=async()=>{switch(i.sourceType){case`DAILY`:await rs(i.id,i.path);break;case`CANVAS`:await as(i.id,i.path);break;case`MULTI`:await ns(i.path);break;case`FILE`:await is(i.id,i.path);break;case`JOURNAL`:await rs(i.id,i.path);break}},p=async()=>{try{let e=await V.restoreMemoById(i.id);e?.webId&&await go.syncRecover(e.webId),e&&V.editMemo(e),n(i.id),new f.Notice(M(`RESTORE SUCCEED`))}catch(e){new f.Notice(e.message)}};return(0,W.jsxs)(`div`,{ref:o,className:`memo-wrapper ${`memos-`+i.id}`,children:[(0,W.jsxs)(`div`,{className:`memo-top-wrapper`,children:[(0,W.jsxs)(`span`,{className:`time-text`,children:[M(`DELETE AT`),` `,i.deletedAtStr]}),(0,W.jsx)(`div`,{className:`btns-container`,children:(0,W.jsx)(`span`,{ref:l,className:`btn more-action-btn`,onClick:e=>{e.stopPropagation();let t=new f.Menu;t.addItem(e=>{e.setTitle(M(`RESTORE`)).setIcon(`archive-restore`).onClick(p)}),t.addItem(e=>{e.setTitle(M(`SOURCE`)).setIcon(`home`).onClick(d)}),t.addItem(t=>{t.setTitle(M(`DELETE`)).setIcon(`trash`).setWarning(!0).onClick(()=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(M(`CONFIRM!`)).setIcon(`trash`).setWarning(!0).onClick(u)}),t.addItem(e=>{e.setTitle(M(`Cancel`)).setIcon(`x`).onClick(()=>{})}),t.showAtMouseEvent(e.nativeEvent)})}),t.showAtMouseEvent(e.nativeEvent)}})})]}),(0,W.jsx)(`div`,{ref:a,className:`memo-content-text`,onContextMenu:e=>{e.preventDefault(),e.stopPropagation()}})]})};N();var $V=({isLoading:e,isEmpty:t,emptyMessage:n=M(`Here is No Memos.`)})=>e?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`span`,{className:`tip-text`,children:M(`Fetching data...`)})}):t?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`span`,{className:`tip-text`,children:n})}):null;vi(),H(),mg(),N(),Cv(),_o();var eH=()=>{let{query:e}=di(),{isMobileView:t}=si(),{memos:n}=F(),{app:r,plugin:i}=I(),a=Rb(),[o,s]=(0,U.useState)([]),c=U.useRef(null),l=U.useRef(null);(0,U.useEffect)(()=>{l.current&&(0,f.setIcon)(l.current,`more-horizontal`)},[l]),(0,U.useEffect)(()=>{pg({memos:n,query:e,filterOptions:{filterDoneTasks:!1,onlyFilterType:`deleted`},plugin:i}).then(e=>{s(e)}),a.setFinish()},[n,c.current,e]);let u=(0,U.useCallback)(e=>{s(t=>t.filter(t=>t.id!==e))},[]),d=async()=>{if(!(o?.length>0))return;if(!await nC()){Sv();return}let e=[...o];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`);for(let e of n){let t=await V.restoreMemoById(e.id);t?.webId&&await go.syncRecover(t.webId),t&&V.editMemo(t)}let r=lC(t);for(let{path:e,thinos:t}of r){let n=await V.dealWithDailyThinoBulk(e,t,`restoreFromDelete`);for(let e of n)e?.webId&&await go.syncRecover(e.webId)}z.clearQuery(),new f.Notice(M(`RESTORE SUCCEED`))}catch(e){new f.Notice(e.message)}},p=async()=>{if(!(o?.length>0))return;if(!await nC()){Sv();return}let e=[...o];try{let t=e.filter(e=>e.sourceType===`DAILY`),n=e.filter(e=>e.sourceType!==`DAILY`);for(let e of n)await V.deleteMemoById(e.id);let r=lC(t);for(let{path:e,thinos:t}of r){let n=await V.dealWithDailyThinoBulk(e,t,`deleteForever`);for(let e of n)e?.webId&&await go.syncDelete(e.webId)}z.clearQuery(),new f.Notice(M(`DELETE SUCCEED`))}catch(e){console.error(`error`,e),new f.Notice(e.message)}};return(0,W.jsxs)(`div`,{className:`memo-trash-wrapper`,ref:c,children:[(0,W.jsx)(cC,{showSidebar:t,rightContent:(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:`header-right-section`,children:(0,W.jsx)(bv,{disableSuper:!0})})}),children:(0,W.jsx)(`span`,{ref:l,className:`menu-popup-btn`,onClick:e=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(M(`Bulk restore`)).setIcon(`archive-restore`).onClick(async()=>{new iC(r,M(`RESTORE`),async e=>{e===`confirm`&&await d()}).open()})}).addItem(e=>{e.setTitle(M(`Bulk delete`)).setIcon(`trash`).onClick(async()=>{new iC(r,M(`DELETE`),async e=>{e===`confirm`&&await p()}).open()})}),t.showAtMouseEvent(e.nativeEvent)}})}),(0,W.jsx)(oC,{thinosCount:o.length,thinos:o}),(0,W.jsx)($V,{isLoading:a.isLoading,isEmpty:o.length===0}),!a.isLoading&&o.length>0&&(0,W.jsx)(`div`,{className:`deleted-memos-container`,children:o.map(e=>(0,W.jsx)(QV,{memo:e,handleDeletedMemoAction:u},`${e.id}-${e.updatedAt}`))})]})};vi(),H(),mg();var tH=()=>{let{app:e,plugin:t,settings:n}=I(),{query:r}=di(),{isMobileView:i,changedByMemos:a}=si(),{memos:o}=F(),s=Rb(),[c,l]=(0,U.useState)([]),[u,d]=(0,U.useState)([]),p=U.useRef(null),m=U.useRef(null),[h,g]=(0,U.useState)(!1),[_,v]=(0,U.useState)([]),y=U.useRef([]);(0,U.useEffect)(()=>{m.current&&((0,f.setIcon)(m.current,`refresh-cw`),e.workspace.on(`refresh-review-memos`,b))},[m]),(0,U.useEffect)(()=>{if(h){if(r){pg({memos:o,query:r,filterOptions:{filterDoneTasks:!1,filterArchived:!n.ViewArchiveInRandomReview},plugin:t}).then(e=>{l([...e].sort(()=>Math.random()-Math.random()).slice(0,10)),g(!1)});return}l([..._].sort(()=>Math.random()-Math.random()).slice(0,10)),g(!1)}},[h,n.ViewArchiveInRandomReview]),(0,U.useEffect)(()=>{_.length>0&&(l([..._].sort(()=>Math.random()-Math.random()).slice(0,10)),g(!1))},[_]),(0,U.useEffect)(()=>{p.current&&(pg({memos:o,query:r,filterOptions:{filterDoneTasks:!1,filterArchived:!n.ViewArchiveInRandomReview},plugin:t}).then(e=>{v(e.filter(e=>e.rowStatus!==`ARCHIVED`&&!(e.deletedAt!==``&&e.deletedAt)))}),s.setFinish())},[o,p.current,n.ViewArchiveInRandomReview]),(0,U.useEffect)(()=>{if(a&&y.current.length>0){let e=_.filter(e=>y.current.includes(e.id));d(y.current.map(t=>e.find(e=>e.id===t)).filter(e=>e!==void 0));return}y.current=c.map(e=>e.id),d(c)},[c]),(0,U.useEffect)(()=>{o.length!==0&&pg({memos:o,query:r,filterOptions:{filterDoneTasks:!1,filterArchived:!n.ViewArchiveInRandomReview},plugin:t}).then(e=>{let t=[...(Array.isArray(e)?e:[]).filter(e=>e.rowStatus!==`ARCHIVED`&&!(e.deletedAt!==``&&e.deletedAt))].sort(()=>Math.random()-.5).slice(0,10);l(t),d(t)})},[r]),(0,U.useEffect)(()=>()=>z.clearQuery(),[]);let b=()=>{g(!0)};return(0,W.jsxs)(`div`,{className:`memo-review-wrapper`,ref:p,children:[(0,W.jsx)(cC,{showSidebar:i,children:(0,W.jsx)(`span`,{ref:m,onClick:b,className:`refresh-icon`})}),(0,W.jsx)(oC,{}),(0,W.jsx)($V,{isLoading:s.isLoading,isEmpty:o.length===0}),!s.isLoading&&o.length>0&&(0,W.jsx)(`div`,{className:`review-memos-container`,children:u.map(e=>(0,W.jsx)(gT,{memo:e},`${e?.id}-${e.createdAt}`))})]})},nH=({data:e,dataKey:t=`date`,width:n=400,height:r=200,color:i=`var(--chart-1)`,responsive:a=!0,minLabelGap:o=70})=>{if(!e||e.length===0)return null;let s=(0,U.useRef)(null),[c,l]=(0,U.useState)(null);(0,U.useEffect)(()=>{if(!a)return;let e=s.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e){let e=Math.floor(t.contentRect.width);e>0&&l(e)}});return t.observe(e),()=>t.disconnect()},[a]);let u=a&&c?c:n,d={top:20,right:20,bottom:40,left:40},f=u-d.left-d.right,p=r-d.top-d.bottom,m=e.map(e=>Number(e.count)||0),h=Math.max(...m),g=t=>e.length<=1?f/2:t/(e.length-1)*f,_=e=>h===0?p/2:p-(e-0)/(h-0)*p,v=e.map((e,t)=>{let n=g(t),r=_(Number(e.count)||0);return`${t===0?`M`:`L`} ${n} ${r}`}).join(` `);return(0,W.jsx)(`div`,{ref:s,style:{width:`100%`},children:(0,W.jsx)(`svg`,{width:u,height:r,className:`simple-line-chart`,children:(0,W.jsxs)(`g`,{transform:`translate(${d.left}, ${d.top})`,children:[[0,.25,.5,.75,1].map(e=>(0,W.jsx)(`line`,{x1:0,y1:p*(1-e),x2:f,y2:p*(1-e),stroke:`var(--background-modifier-border)`,strokeDasharray:`2,2`,opacity:.3},e)),(0,W.jsx)(`path`,{d:v,fill:`none`,stroke:i,strokeWidth:2}),e.map((n,r)=>{let i=Math.max(1,Math.floor(f/o));return r%Math.max(1,Math.ceil(e.length/i))!==0&&r!==e.length-1?null:(0,W.jsx)(`text`,{x:g(r),y:p+20,textAnchor:`middle`,fontSize:`12`,fill:`var(--text-muted)`,children:n[t]||``},r)}),[0,.5,1].map(e=>(0,W.jsx)(`text`,{x:-10,y:p*(1-e)+5,textAnchor:`end`,fontSize:`12`,fill:`var(--text-muted)`,children:Math.round(0+(h-0)*e)},e)),e.map((e,n)=>(0,W.jsx)(`circle`,{cx:g(n),cy:_(Number(e.count)||0),r:3,fill:i,opacity:0,className:`hover-point`,children:(0,W.jsx)(`title`,{children:`${e[t]}: ${e.count}`})},n))]})})})},rH=({data:e,dataKey:t,valueKey:n,width:r=400,height:i=200,color:a=`var(--chart-2)`,responsive:o=!0,minLabelGap:s=70})=>{if(!e||e.length===0)return null;let c=(0,U.useRef)(null),[l,u]=(0,U.useState)(null);(0,U.useEffect)(()=>{if(!o)return;let e=c.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e){let e=Math.floor(t.contentRect.width);e>0&&u(e)}});return t.observe(e),()=>t.disconnect()},[o]);let d=o&&l?l:r,f={top:20,right:20,bottom:40,left:40},p=d-f.left-f.right,m=i-f.top-f.bottom,h=Math.max(...e.map(e=>Number(e[n])||0)),g=p/e.length,_=g*.7,v=g*.3,y=e=>e*g+v/2,b=e=>h<=0?m:m-e/h*m,x=Math.max(1,Math.floor(p/s)),S=Math.max(1,Math.ceil(e.length/x));return(0,W.jsx)(`div`,{ref:c,style:{width:`100%`},children:(0,W.jsx)(`svg`,{width:d,height:i,className:`simple-bar-chart`,children:(0,W.jsxs)(`g`,{transform:`translate(${f.left}, ${f.top})`,children:[[0,.25,.5,.75,1].map(e=>(0,W.jsx)(`line`,{x1:0,y1:m*(1-e),x2:p,y2:m*(1-e),stroke:`var(--background-modifier-border)`,strokeDasharray:`2,2`,opacity:.3},e)),e.map((e,r)=>{let i=Number(e[n])||0,o=i/h*m;return(0,W.jsx)(`rect`,{x:y(r),y:b(i),width:_,height:o,fill:a,rx:4,ry:4,className:`bar`,children:(0,W.jsx)(`title`,{children:`${e[t]}: ${i}`})},r)}),e.map((n,r)=>r%S!==0&&r!==e.length-1?null:(0,W.jsx)(`text`,{x:y(r)+_/2,y:m+20,textAnchor:`middle`,fontSize:`12`,fill:`var(--text-muted)`,children:String(n[t]||``)},r)),[0,.5,1].map(e=>(0,W.jsx)(`text`,{x:-10,y:m*(1-e)+5,textAnchor:`end`,fontSize:`12`,fill:`var(--text-muted)`,children:Math.round(h*e)},e))]})})})};N();function iH({memos:e}){let[t,n]=(0,U.useState)([]);return(0,U.useEffect)(()=>{let t=[{period:`00-03`,count:0},{period:`03-06`,count:0},{period:`06-09`,count:0},{period:`09-12`,count:0},{period:`12-15`,count:0},{period:`15-18`,count:0},{period:`18-21`,count:0},{period:`21-24`,count:0}];e.forEach(e=>{let n=new Date(e.createdAt).getHours();n<3?t[0].count++:n<6?t[1].count++:n<9?t[2].count++:n<12?t[3].count++:n<15?t[4].count++:n<18?t[5].count++:n<21?t[6].count++:t[7].count++}),n(t)},[e]),(0,W.jsx)(`div`,{className:`time-distribution-chart`,children:(0,W.jsxs)(`div`,{className:`chart-card`,children:[(0,W.jsxs)(`div`,{className:`chart-header`,children:[(0,W.jsx)(`h3`,{className:`chart-title`,children:M(`Time Distribution`)}),(0,W.jsx)(`p`,{className:`chart-description`,children:M(`When do you write thinos`)})]}),(0,W.jsx)(`div`,{className:`chart-content`,children:(0,W.jsx)(rH,{data:t,dataKey:`period`,valueKey:`count`,width:400,height:200,color:`var(--chart-2)`})})]})})}Wr(),Qr(),vi(),N(),Ce(),mg();var aH=async e=>{let t=e.querySelectorAll(`img`);for(let e of t)e.src.startsWith(`http://localhost`)?e.src=await Lx(e.getAttribute(`path`)||(0,f.normalizePath)(e?.parentElement?.getAttribute(`src`)||``)):e.src=await Lx(e.src)},oH=(0,U.forwardRef)((e,t)=>{let{currentDate:n,setCurrentDateStamp:r,showTimeDistributionChart:i}=e,[a,o]=(0,U.useState)(!1),s=P.getDateStampByDate(P.getDateString(n)),c=(0,U.useRef)(null);return(0,U.useEffect)(()=>{c.current&&(0,f.setIcon)(c.current,`more-horizontal`)},[c.current]),(0,U.useImperativeHandle)(t,()=>({closeDatePicker:()=>{o(!1)}})),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`date-card-container`,children:[(0,W.jsxs)(`div`,{className:`date-container-details`,children:[(0,W.jsxs)(`div`,{className:`details-text`,children:[(0,f.moment)(s,`x`).format(`dddd`),(0,W.jsx)(`div`,{className:`date-text`,children:(0,f.moment)(s,`x`).format(`MMM`)+(0,f.moment)(s,`x`).format(`DD`)})]}),(0,W.jsx)(`div`,{className:`details-logo-text`,children:M(`Daily Memos`)})]}),(0,W.jsxs)(`div`,{className:`date-container-info`,children:[(0,W.jsxs)(`div`,{className:`date-container-info-text`,children:[`Week `,(0,W.jsx)(`div`,{className:`week-text`,children:(0,f.moment)(s,`x`).format(`ww`)}),`of `,(0,W.jsx)(`div`,{className:`year-text`,children:(0,f.moment)(s,`x`).format(`YYYY`)})]}),(0,W.jsx)(`div`,{ref:c,onClick:e=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(M(`Show Time Distribution`)),e.setIcon(`chart-bar`),e.onClick(()=>{i()})}),t.addItem(e=>{e.setTitle(M(a?`Hide date picker`:`Show date picker`)),e.setIcon(`calendar`),e.onClick(()=>{o(!a)})}),t.showAtMouseEvent(e.nativeEvent)}})]})]}),(0,W.jsx)(Wb,{className:`date-picker ${a?``:`thino-hidden`}`,datestamp:s,handleDateStampChange:e=>{r(e)}})]})}),sH=({thino:e})=>(0,W.jsxs)(`div`,{className:`daily-thino-wrapper`,children:[(0,W.jsx)(`div`,{className:`time-wrapper`,onClick:(0,U.useCallback)(()=>{Fx(e)},[]),children:(0,W.jsx)(`span`,{className:`normal-text`,children:(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).format(`HH:mm`)})}),(0,W.jsx)(`div`,{className:`daily-thino-container`,children:(0,W.jsx)(gT,{memo:e})})]}),cH=()=>{let{query:e}=di(),{memos:t}=F(),{settings:n,app:r,plugin:i}=I(),a=Rb(),[o,s]=(0,U.useState)([]),[c,l]=(0,U.useState)(P.getDateStampByDate(P.getDateString((0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`)))),[u,d]=(0,U.useState)(!1),p=(0,U.useRef)(),m=(0,U.useRef)(null),h=U.useRef(null),g=(0,U.useRef)(null),[_,v]=(0,U.useState)(!1);return(0,U.useEffect)(()=>{e.duration&&e.duration.from&&e.duration.to&&l(e.duration.from)},[e.duration]),(0,U.useEffect)(()=>{g.current&&(f.setIcon&&g&&!_&&(0,f.setIcon)(g.current,`share`),f.setIcon&&g&&_&&(0,f.setIcon)(g.current,`chrome`))},[g.current,_]),(0,U.useEffect)(()=>{pg({memos:t,query:e,filterOptions:{filterDoneTasks:!1},plugin:i}).then(e=>{s(e.filter(e=>P.getTimeStampByDate(e.createdAt)>=c&&P.getTimeStampByDate(e.createdAt)<c+864e5).filter(e=>e.deletedAt===``).sort((e,t)=>P.getTimeStampByDate(e.createdAt)-P.getTimeStampByDate(t.createdAt)).slice(0,40)),a.setFinish()})},[t,c,h.current,e]),(0,W.jsxs)(`div`,{className:`daily-thinos-list-wrapper`,ref:h,children:[(0,W.jsx)(cC,{rightContent:(0,W.jsxs)(`div`,{className:`header-right-section`,children:[(0,W.jsxs)(`div`,{className:`btns-container`,children:[(0,W.jsx)(`span`,{ref:e=>{f.setIcon&&e&&(0,f.setIcon)(e,`chevron-left`)},className:`btn btn-text`,onClick:()=>l(e=>e-Ar)}),(0,W.jsx)(`span`,{ref:e=>{f.setIcon&&e&&(0,f.setIcon)(e,`chevron-right`)},className:`btn btn-text`,onClick:()=>l(e=>e+Ar)}),(0,W.jsx)(`span`,{ref:g,className:u_(`btn btn-text share-btn`,_?`generating`:``),onClick:async()=>{p.current&&p?.current?.closeDatePicker(),v(!0),document.body.toggleClass(`thino-share-page`,!0),setTimeout(async()=>{if(!m.current){v(!1);return}await aH(m.current),xS(m.current,{pixelRatio:window.devicePixelRatio*2}).then(e=>{if(n?.AutoSaveWhenOnMobile&&f.Platform.isMobile){let t=e.split(`base64,`)[1];Zr(t,`image/png`).arrayBuffer().then(async e=>{let t,n=ce();for(let e in n)if(n[e]instanceof f.TFile){t=n[e];break}t!==void 0&&await r.vault.createBinary(await vault.getAvailablePathForAttachments(`Pasted Image ${(0,f.moment)().format(`YYYYMMDDHHmmss`)}`,`png`,t),e)})}document.body.toggleClass(`thino-share-page`,!1),KS({imgUrl:e}),v(!1)}).catch(()=>{document.body.toggleClass(`thino-share-page`,!1),v(!1)})},0)}})]}),(0,W.jsx)(bT,{}),(0,W.jsx)(bv,{})]})}),(0,W.jsx)(oC,{thinosCount:o.length,thinos:o}),(0,W.jsx)(`div`,{className:`daily-thinos-view-wrapper thino-stat`,children:(0,W.jsxs)(`div`,{ref:m,className:`daily-thinos-view-container`,children:[(0,W.jsx)(oH,{ref:p,currentDate:new Date(c),setCurrentDateStamp:l,showTimeDistributionChart:()=>d(!u)}),u&&(0,W.jsx)(iH,{memos:o}),(0,W.jsx)($V,{isLoading:a.isLoading,isEmpty:o.length===0,emptyMessage:M(`Noooop!`)}),!a.isLoading&&o.length>0&&(0,W.jsx)(`div`,{className:`daily-thinos-list-container`,children:o.map(e=>(0,W.jsx)(sH,{thino:e},`${e.id}-${e.updatedAt}`))})]})})]})};function lH(e,t,n){return new Date(n?CH.time(e).getTime()+t*24*60*60*1e3:CH.time(e).getTime()+t*60*1e3)}function uH(e,t,n){if(!e||!t)throw Error(`Invalid date`);let r=CH.time(e).getTime()-CH.time(t).getTime(),i=0;switch(n){case`days`:i=Math.floor(r/(1440*60*1e3));break;case`minutes`:i=Math.floor(r/(60*1e3));break}return i}function dH(e){let t=CH.time(e),n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate(),a=t.getHours(),o=t.getMinutes(),s=t.getSeconds();return`${n}-${fH(r)}-${fH(i)} ${fH(a)}:${fH(o)}:${fH(s)}`}function fH(e){return e<10?`0${e}`:`${e}`}function pH(e,t,n,r=TH){e=CH.time(e),t=CH.time(t),r.length!==TH.length&&(r=TH);let i=e.getTime()-t.getTime(),a=0;for(i/=1e3,a=0;a<wH.length&&!(i<wH[a]);a++)i/=wH[a];return`${Math.floor(i)}${n?r[a]:``}`}function mH(e,t,n){let r=1;for(let t of DH)r+=t.factor*Math.max(Math.min(e,t.end)-t.start,0);e=Math.min(e,n);let i=Math.max(2,Math.round(e-r)),a=Math.min(Math.round(e+r),n);return e>t&&(i=Math.max(i,t+1)),i=Math.min(i,a),{min_ivl:i,max_ivl:a}}function hH(e,t,n){return Math.min(Math.max(e,t),n)}function gH(e,t){let n=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),r=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.floor((r-n)/864e5)}function _H(){return`${this.review_time.getTime()}_${this.current.reps}_${this.current.difficulty*this.current.stability}`}function vH(){let e=4022871197;return function(t){t=String(t);for(let n=0;n<t.length;n++){e+=t.charCodeAt(n);let r=.02519603282416938*e;e=r>>>0,r-=e,r*=e,e=r>>>0,r-=e,e+=r*4294967296}return(e>>>0)*23283064365386963e-26}}function yH(e){let t=new MH(e),n=()=>t.next();return n.int32=()=>t.next()*4294967296|0,n.double=()=>n()+(n()*2097152|0)*11102230246251565e-32,n.state=()=>t.state,n.importState=e=>(t.state=e,n),n}function bH(e,t){let n={due:e?CH.time(e):new Date,stability:0,difficulty:0,elapsed_days:0,scheduled_days:0,reps:0,lapses:0,learning_steps:0,state:SH.New,last_review:void 0};return t&&typeof t==`function`?t(n):n}function xH(e,t,n){let{decay:r,factor:i}=WH(e);return+((1+i*t/n)**+r).toFixed(8)}var SH,q,CH,wH,TH,EH,DH,OH,kH,AH,jH,MH,NH,PH,FH,IH,LH,RH,zH,BH,VH,HH,UH,WH,GH,KH,qH,JH,YH,XH,ZH=o((()=>{SH=(e=>(e[e.New=0]=`New`,e[e.Learning=1]=`Learning`,e[e.Review=2]=`Review`,e[e.Relearning=3]=`Relearning`,e))(SH||{}),q=(e=>(e[e.Manual=0]=`Manual`,e[e.Again=1]=`Again`,e[e.Hard=2]=`Hard`,e[e.Good=3]=`Good`,e[e.Easy=4]=`Easy`,e))(q||{}),CH=class e{static card(t){return{...t,state:e.state(t.state),due:e.time(t.due),last_review:t.last_review?e.time(t.last_review):void 0}}static rating(e){if(typeof e==`string`){let t=q[`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`];if(t===void 0)throw Error(`Invalid rating:[${e}]`);return t}else if(typeof e==`number`)return e;throw Error(`Invalid rating:[${e}]`)}static state(e){if(typeof e==`string`){let t=SH[`${e.charAt(0).toUpperCase()}${e.slice(1).toLowerCase()}`];if(t===void 0)throw Error(`Invalid state:[${e}]`);return t}else if(typeof e==`number`)return e;throw Error(`Invalid state:[${e}]`)}static time(e){let t=new Date(e);if(typeof e==`object`&&e&&!Number.isNaN(Date.parse(e)||+t))return t;if(typeof e==`string`){let t=Date.parse(e);if(Number.isNaN(t))throw Error(`Invalid date:[${e}]`);return new Date(t)}else if(typeof e==`number`)return new Date(e);throw Error(`Invalid date:[${e}]`)}static review_log(t){return{...t,due:e.time(t.due),rating:e.rating(t.rating),state:e.state(t.state),review:e.time(t.review)}}},Date.prototype.scheduler=function(e,t){return lH(this,e,t)},Date.prototype.diff=function(e,t){return uH(this,e,t)},Date.prototype.format=function(){return dH(this)},Date.prototype.dueFormat=function(e,t,n){return pH(this,e,t,n)},wH=[60,60,24,31,12],TH=[`second`,`min`,`hour`,`day`,`month`,`year`],EH=Object.freeze([q.Again,q.Hard,q.Good,q.Easy]),DH=[{start:2.5,end:7,factor:.15},{start:7,end:20,factor:.1},{start:20,end:1/0,factor:.05}],OH=e=>{let t=e.slice(-1),n=parseInt(e.slice(0,-1),10);if(Number.isNaN(n)||!Number.isFinite(n)||n<0)throw Error(`Invalid step value: ${e}`);switch(t){case`m`:return n;case`h`:return n*60;case`d`:return n*1440;default:throw Error(`Invalid step unit: ${e}, expected m/h/d`)}},kH=(e,t,n)=>{let r=t===SH.Relearning||t===SH.Review?e.relearning_steps:e.learning_steps,i=r.length;if(i===0||n>=i)return{};let a=r[0],o=OH,s=()=>o(a),c=()=>{if(i===1)return Math.round(o(a)*1.5);let e=r[1];return Math.round((o(a)+o(e))/2)},l=e=>e<0||e>=i?null:r[e],u=e=>o(e),d={},f=l(Math.max(0,n));if(t===SH.Review)return d[q.Again]={scheduled_minutes:o(f),next_step:0},d;{d[q.Again]={scheduled_minutes:s(),next_step:0},d[q.Hard]={scheduled_minutes:c(),next_step:n};let e=l(n+1);if(e){let t=u(e);t&&(d[q.Good]={scheduled_minutes:Math.round(t),next_step:n+1})}}return d},AH=(e=>(e.SCHEDULER=`Scheduler`,e.LEARNING_STEPS=`LearningSteps`,e.SEED=`Seed`,e))(AH||{}),jH=class{last;current;review_time;next=new Map;algorithm;strategies;elapsed_days=0;constructor(e,t,n,r){this.algorithm=n,this.last=CH.card(e),this.current=CH.card(e),this.review_time=CH.time(t),this.strategies=r,this.init()}checkGrade(e){if(!Number.isFinite(e)||e<0||e>4)throw Error(`Invalid grade "${e}",expected 1-4`)}init(){let{state:e,last_review:t}=this.current,n=0;e!==SH.New&&t&&(n=gH(t,this.review_time)),this.current.last_review=this.review_time,this.elapsed_days=n,this.current.elapsed_days=n,this.current.reps+=1;let r=_H;if(this.strategies){let e=this.strategies.get(AH.SEED);e&&(r=e)}this.algorithm.seed=r.call(this)}preview(){return{[q.Again]:this.review(q.Again),[q.Hard]:this.review(q.Hard),[q.Good]:this.review(q.Good),[q.Easy]:this.review(q.Easy),[Symbol.iterator]:this.previewIterator.bind(this)}}*previewIterator(){for(let e of EH)yield this.review(e)}review(e){let{state:t}=this.last,n;switch(this.checkGrade(e),t){case SH.New:n=this.newState(e);break;case SH.Learning:case SH.Relearning:n=this.learningState(e);break;case SH.Review:n=this.reviewState(e);break}return n}buildLog(e){let{last_review:t,due:n,elapsed_days:r}=this.last;return{rating:e,state:this.current.state,due:t||n,stability:this.current.stability,difficulty:this.current.difficulty,elapsed_days:this.elapsed_days,last_elapsed_days:r,scheduled_days:this.current.scheduled_days,learning_steps:this.current.learning_steps,review:this.review_time}}},MH=class{c;s0;s1;s2;constructor(e){let t=vH();this.c=1,this.s0=t(` `),this.s1=t(` `),this.s2=t(` `),e??=Date.now(),this.s0-=t(e),this.s0<0&&(this.s0+=1),this.s1-=t(e),this.s1<0&&(this.s1+=1),this.s2-=t(e),this.s2<0&&(this.s2+=1)}next(){let e=2091639*this.s0+this.c*23283064365386963e-26;return this.s0=this.s1,this.s1=this.s2,this.c=e|0,this.s2=e-this.c,this.s2}set state(e){this.c=e.c,this.s0=e.s0,this.s1=e.s1,this.s2=e.s2}get state(){return{c:this.c,s0:this.s0,s1:this.s1,s2:this.s2}}},NH=`5.2.3`,PH=Object.freeze([`1m`,`10m`]),FH=Object.freeze([`10m`]),`${NH}`,IH=.001,LH=.5,RH=.1542,zH=Object.freeze([.212,1.2931,2.3065,8.2956,6.4133,.8334,3.0194,.001,1.8722,.1666,.796,1.4835,.0614,.2629,1.6483,.6014,1.8729,.5425,.0912,.0658,RH]),BH=(e,t=!0)=>[[IH,100],[IH,100],[IH,100],[IH,100],[1,10],[.001,4],[.001,4],[.001,.75],[0,4.5],[0,.8],[.001,3.5],[.001,5],[.001,.25],[.001,.9],[0,4],[0,1],[1,6],[0,e],[0,e],[t?.01:0,.8],[.1,.8]],VH=(e,t,n=!0)=>{let r=2;return Math.max(0,t)>1&&(r=hH(+(-(Math.log(e[11])+Math.log(2**e[13]-1)+e[14]*.3)/t).toFixed(8),.01,2)),BH(r,n).slice(0,e.length).map(([t,n],r)=>hH(e[r]||0,t,n))},HH=(e,t=0,n=!0)=>{if(e===void 0)return[...zH];switch(e.length){case 21:return VH(Array.from(e),t,n);case 19:return console.debug(`[FSRS-6]auto fill w from 19 to 21 length`),VH(Array.from(e),t,n).concat([0,LH]);case 17:{let r=VH(Array.from(e),t,n);return r[4]=+(r[5]*2+r[4]).toFixed(8),r[5]=+(Math.log(r[5]*3+1)/3).toFixed(8),r[6]=+(r[6]+.5).toFixed(8),console.debug(`[FSRS-6]auto fill w from 17 to 21 length`),r.concat([0,0,0,LH])}default:return console.warn(`[FSRS]Invalid parameters length, using default parameters`),[...zH]}},UH=e=>{let t=Array.isArray(e?.learning_steps)?e.learning_steps:PH,n=Array.isArray(e?.relearning_steps)?e.relearning_steps:FH,r=e?.enable_short_term??!0,i=HH(e?.w,n.length,r);return{request_retention:e?.request_retention||.9,maximum_interval:e?.maximum_interval||36500,w:i,enable_fuzz:e?.enable_fuzz??!1,enable_short_term:r,learning_steps:t,relearning_steps:n}},WH=e=>{let t=typeof e==`number`?-e:-e[20];return{decay:t,factor:+(Math.exp(t**-1*Math.log(.9))-1).toFixed(8)}},GH=class{param;intervalModifier;_seed;constructor(e){this.param=new Proxy(UH(e),this.params_handler_proxy()),this.intervalModifier=this.calculate_interval_modifier(this.param.request_retention),this.forgetting_curve=xH.bind(this,this.param.w)}get interval_modifier(){return this.intervalModifier}set seed(e){this._seed=e}calculate_interval_modifier(e){if(e<=0||e>1)throw Error(`Requested retention rate should be in the range (0,1]`);let{decay:t,factor:n}=WH(this.param.w);return+((e**(1/t)-1)/n).toFixed(8)}get parameters(){return this.param}set parameters(e){this.update_parameters(e)}params_handler_proxy(){let e=this;return{set:function(t,n,r){return n===`request_retention`&&Number.isFinite(r)?e.intervalModifier=e.calculate_interval_modifier(Number(r)):n===`w`&&(r=HH(r,t.relearning_steps.length,t.enable_short_term),e.forgetting_curve=xH.bind(this,r),e.intervalModifier=e.calculate_interval_modifier(Number(t.request_retention))),Reflect.set(t,n,r),!0}}}update_parameters(e){let t=UH(e);for(let e in t){let n=e;this.param[n]=t[n]}}init_stability(e){return Math.max(this.param.w[e-1],.1)}init_difficulty(e){return+(this.param.w[4]-Math.exp((e-1)*this.param.w[5])+1).toFixed(8)}apply_fuzz(e,t){if(!this.param.enable_fuzz||e<2.5)return Math.round(e);let n=yH(this._seed)(),{min_ivl:r,max_ivl:i}=mH(e,t,this.param.maximum_interval);return Math.floor(n*(i-r+1)+r)}next_interval(e,t){let n=Math.min(Math.max(1,Math.round(e*this.intervalModifier)),this.param.maximum_interval);return this.apply_fuzz(n,t)}linear_damping(e,t){return+(e*(10-t)/9).toFixed(8)}next_difficulty(e,t){let n=-this.param.w[6]*(t-3),r=e+this.linear_damping(n,e);return hH(this.mean_reversion(this.init_difficulty(q.Easy),r),1,10)}mean_reversion(e,t){return+(this.param.w[7]*e+(1-this.param.w[7])*t).toFixed(8)}next_recall_stability(e,t,n,r){let i=q.Hard===r?this.param.w[15]:1,a=q.Easy===r?this.param.w[16]:1;return+hH(t*(1+Math.exp(this.param.w[8])*(11-e)*t**+-this.param.w[9]*(Math.exp((1-n)*this.param.w[10])-1)*i*a),IH,36500).toFixed(8)}next_forget_stability(e,t,n){return+hH(this.param.w[11]*e**+-this.param.w[12]*((t+1)**+this.param.w[13]-1)*Math.exp((1-n)*this.param.w[14]),IH,36500).toFixed(8)}next_short_term_stability(e,t){let n=e**+-this.param.w[19]*Math.exp(this.param.w[17]*(t-3+this.param.w[18]));return+hH(e*(t>=3?Math.max(n,1):n),IH,36500).toFixed(8)}forgetting_curve;next_state(e,t,n){let{difficulty:r,stability:i}=e??{difficulty:0,stability:0};if(t<0)throw Error(`Invalid delta_t "${t}"`);if(n<0||n>4)throw Error(`Invalid grade "${n}"`);if(r===0&&i===0)return{difficulty:hH(this.init_difficulty(n),1,10),stability:this.init_stability(n)};if(n===0)return{difficulty:r,stability:i};if(r<1||i<.001)throw Error(`Invalid memory state { difficulty: ${r}, stability: ${i} }`);let a=this.forgetting_curve(t,i),o=this.next_recall_stability(r,i,a,n),s=this.next_forget_stability(r,i,a),c=this.next_short_term_stability(i,n),l=o;if(n===1){let[e,t]=[0,0];this.param.enable_short_term&&(e=this.param.w[17],t=this.param.w[18]),l=hH(+(i/Math.exp(e*t)).toFixed(8),IH,s)}return t===0&&this.param.enable_short_term&&(l=c),{difficulty:this.next_difficulty(r,n),stability:l}}},KH=class extends jH{learningStepsStrategy;constructor(e,t,n,r){super(e,t,n,r);let i=kH;if(this.strategies){let e=this.strategies.get(AH.LEARNING_STEPS);e&&(i=e)}this.learningStepsStrategy=i}getLearningInfo(e,t){let n=this.algorithm.parameters;e.learning_steps=e.learning_steps||0;let r=this.learningStepsStrategy(n,e.state,this.current.state===SH.Learning&&t!==q.Again&&t!==q.Hard?e.learning_steps+1:e.learning_steps);return{scheduled_minutes:Math.max(0,r[t]?.scheduled_minutes??0),next_steps:Math.max(0,r[t]?.next_step??0)}}applyLearningSteps(e,t,n){let{scheduled_minutes:r,next_steps:i}=this.getLearningInfo(this.current,t);if(r>0&&r<1440)e.learning_steps=i,e.scheduled_days=0,e.state=n,e.due=lH(this.review_time,Math.round(r),!1);else if(e.state=SH.Review,r>=1440)e.learning_steps=i,e.due=lH(this.review_time,Math.round(r),!1),e.scheduled_days=Math.floor(r/1440);else{e.learning_steps=0;let t=this.algorithm.next_interval(e.stability,this.elapsed_days);e.scheduled_days=t,e.due=lH(this.review_time,t,!0)}}newState(e){let t=this.next.get(e);if(t)return t;let n=CH.card(this.current);n.difficulty=hH(this.algorithm.init_difficulty(e),1,10),n.stability=this.algorithm.init_stability(e),this.applyLearningSteps(n,e,SH.Learning);let r={card:n,log:this.buildLog(e)};return this.next.set(e,r),r}learningState(e){let t=this.next.get(e);if(t)return t;let{state:n,difficulty:r,stability:i}=this.last,a=CH.card(this.current);a.difficulty=this.algorithm.next_difficulty(r,e),a.stability=this.algorithm.next_short_term_stability(i,e),this.applyLearningSteps(a,e,n);let o={card:a,log:this.buildLog(e)};return this.next.set(e,o),o}reviewState(e){let t=this.next.get(e);if(t)return t;let n=this.elapsed_days,{difficulty:r,stability:i}=this.last,a=this.algorithm.forgetting_curve(n,i),o=CH.card(this.current),s=CH.card(this.current),c=CH.card(this.current),l=CH.card(this.current);this.next_ds(o,s,c,l,r,i,a),this.next_interval(s,c,l,n),this.next_state(s,c,l),this.applyLearningSteps(o,q.Again,SH.Relearning),o.lapses+=1;let u={card:o,log:this.buildLog(q.Again)},d={card:s,log:super.buildLog(q.Hard)},f={card:c,log:super.buildLog(q.Good)},p={card:l,log:super.buildLog(q.Easy)};return this.next.set(q.Again,u),this.next.set(q.Hard,d),this.next.set(q.Good,f),this.next.set(q.Easy,p),this.next.get(e)}next_ds(e,t,n,r,i,a,o){e.difficulty=this.algorithm.next_difficulty(i,q.Again);let s=a/Math.exp(this.algorithm.parameters.w[17]*this.algorithm.parameters.w[18]),c=this.algorithm.next_forget_stability(i,a,o);e.stability=hH(+s.toFixed(8),IH,c),t.difficulty=this.algorithm.next_difficulty(i,q.Hard),t.stability=this.algorithm.next_recall_stability(i,a,o,q.Hard),n.difficulty=this.algorithm.next_difficulty(i,q.Good),n.stability=this.algorithm.next_recall_stability(i,a,o,q.Good),r.difficulty=this.algorithm.next_difficulty(i,q.Easy),r.stability=this.algorithm.next_recall_stability(i,a,o,q.Easy)}next_interval(e,t,n,r){let i,a;i=this.algorithm.next_interval(e.stability,r),a=this.algorithm.next_interval(t.stability,r),i=Math.min(i,a),a=Math.max(a,i+1);let o=Math.max(this.algorithm.next_interval(n.stability,r),a+1);e.scheduled_days=i,e.due=lH(this.review_time,i,!0),t.scheduled_days=a,t.due=lH(this.review_time,a,!0),n.scheduled_days=o,n.due=lH(this.review_time,o,!0)}next_state(e,t,n){e.state=SH.Review,e.learning_steps=0,t.state=SH.Review,t.learning_steps=0,n.state=SH.Review,n.learning_steps=0}},qH=class extends jH{newState(e){let t=this.next.get(e);if(t)return t;this.current.scheduled_days=0,this.current.elapsed_days=0;let n=CH.card(this.current),r=CH.card(this.current),i=CH.card(this.current),a=CH.card(this.current);return this.init_ds(n,r,i,a),this.next_interval(n,r,i,a,0),this.next_state(n,r,i,a),this.update_next(n,r,i,a),this.next.get(e)}init_ds(e,t,n,r){e.difficulty=hH(this.algorithm.init_difficulty(q.Again),1,10),e.stability=this.algorithm.init_stability(q.Again),t.difficulty=hH(this.algorithm.init_difficulty(q.Hard),1,10),t.stability=this.algorithm.init_stability(q.Hard),n.difficulty=hH(this.algorithm.init_difficulty(q.Good),1,10),n.stability=this.algorithm.init_stability(q.Good),r.difficulty=hH(this.algorithm.init_difficulty(q.Easy),1,10),r.stability=this.algorithm.init_stability(q.Easy)}learningState(e){return this.reviewState(e)}reviewState(e){let t=this.next.get(e);if(t)return t;let n=this.elapsed_days,{difficulty:r,stability:i}=this.last,a=this.algorithm.forgetting_curve(n,i),o=CH.card(this.current),s=CH.card(this.current),c=CH.card(this.current),l=CH.card(this.current);return this.next_ds(o,s,c,l,r,i,a),this.next_interval(o,s,c,l,n),this.next_state(o,s,c,l),o.lapses+=1,this.update_next(o,s,c,l),this.next.get(e)}next_ds(e,t,n,r,i,a,o){e.difficulty=this.algorithm.next_difficulty(i,q.Again),e.stability=hH(a,IH,this.algorithm.next_forget_stability(i,a,o)),t.difficulty=this.algorithm.next_difficulty(i,q.Hard),t.stability=this.algorithm.next_recall_stability(i,a,o,q.Hard),n.difficulty=this.algorithm.next_difficulty(i,q.Good),n.stability=this.algorithm.next_recall_stability(i,a,o,q.Good),r.difficulty=this.algorithm.next_difficulty(i,q.Easy),r.stability=this.algorithm.next_recall_stability(i,a,o,q.Easy)}next_interval(e,t,n,r,i){let a,o,s,c;a=this.algorithm.next_interval(e.stability,i),o=this.algorithm.next_interval(t.stability,i),s=this.algorithm.next_interval(n.stability,i),c=this.algorithm.next_interval(r.stability,i),a=Math.min(a,o),o=Math.max(o,a+1),s=Math.max(s,o+1),c=Math.max(c,s+1),e.scheduled_days=a,e.due=lH(this.review_time,a,!0),t.scheduled_days=o,t.due=lH(this.review_time,o,!0),n.scheduled_days=s,n.due=lH(this.review_time,s,!0),r.scheduled_days=c,r.due=lH(this.review_time,c,!0)}next_state(e,t,n,r){e.state=SH.Review,e.learning_steps=0,t.state=SH.Review,t.learning_steps=0,n.state=SH.Review,n.learning_steps=0,r.state=SH.Review,r.learning_steps=0}update_next(e,t,n,r){let i={card:e,log:this.buildLog(q.Again)},a={card:t,log:super.buildLog(q.Hard)},o={card:n,log:super.buildLog(q.Good)},s={card:r,log:super.buildLog(q.Easy)};this.next.set(q.Again,i),this.next.set(q.Hard,a),this.next.set(q.Good,o),this.next.set(q.Easy,s)}},JH=class{fsrs;constructor(e){this.fsrs=e}replay(e,t,n){return this.fsrs.next(e,t,n)}handleManualRating(e,t,n,r,i,a,o){if(t===void 0)throw Error(`reschedule: state is required for manual rating`);let s,c;if(t===SH.New)s={rating:q.Manual,state:t,due:o??n,stability:e.stability,difficulty:e.difficulty,elapsed_days:r,last_elapsed_days:e.elapsed_days,scheduled_days:e.scheduled_days,learning_steps:e.learning_steps,review:n},c=bH(n),c.last_review=n;else{if(o===void 0)throw Error(`reschedule: due is required for manual rating`);let l=uH(o,n,`days`);s={rating:q.Manual,state:e.state,due:e.last_review||e.due,stability:e.stability,difficulty:e.difficulty,elapsed_days:r,last_elapsed_days:e.elapsed_days,scheduled_days:e.scheduled_days,learning_steps:e.learning_steps,review:n},c={...e,state:t,due:o,last_review:n,stability:i||e.stability,difficulty:a||e.difficulty,elapsed_days:r,scheduled_days:l,reps:e.reps+1}}return{card:c,log:s}}reschedule(e,t){let n=[],r=bH(e.due);for(let e of t){let t;if(e.review=CH.time(e.review),e.rating===q.Manual){let n=0;r.state!==SH.New&&r.last_review&&(n=uH(e.review,r.last_review,`days`)),t=this.handleManualRating(r,e.state,e.review,n,e.stability,e.difficulty,e.due?CH.time(e.due):void 0)}else t=this.replay(r,e.review,e.rating);n.push(t),r=t.card}return n}calculateManualRecord(e,t,n,r){if(!n)return null;let{card:i,log:a}=n,o=CH.card(e);return o.due.getTime()===i.due.getTime()?null:(o.scheduled_days=uH(i.due,o.due,`days`),this.handleManualRating(o,i.state,CH.time(t),a.elapsed_days,r?i.stability:void 0,r?i.difficulty:void 0,i.due))}},YH=class extends GH{strategyHandler=new Map;Scheduler;constructor(e){super(e);let{enable_short_term:t}=this.parameters;this.Scheduler=t?KH:qH}params_handler_proxy(){let e=this;return{set:function(t,n,r){return n===`request_retention`&&Number.isFinite(r)?e.intervalModifier=e.calculate_interval_modifier(Number(r)):n===`enable_short_term`?e.Scheduler=r===!0?KH:qH:n===`w`&&(r=HH(r,t.relearning_steps.length,t.enable_short_term),e.forgetting_curve=xH.bind(this,r),e.intervalModifier=e.calculate_interval_modifier(Number(t.request_retention))),Reflect.set(t,n,r),!0}}}useStrategy(e,t){return this.strategyHandler.set(e,t),this}clearStrategy(e){return e?this.strategyHandler.delete(e):this.strategyHandler.clear(),this}getScheduler(e,t){return new((this.strategyHandler.get(AH.SCHEDULER))||this.Scheduler)(e,t,this,this.strategyHandler)}repeat(e,t,n){let r=this.getScheduler(e,t).preview();return n&&typeof n==`function`?n(r):r}next(e,t,n,r){let i=this.getScheduler(e,t),a=CH.rating(n);if(a===q.Manual)throw Error(`Cannot review a manual rating`);let o=i.review(a);return r&&typeof r==`function`?r(o):o}get_retrievability(e,t,n=!0){let r=CH.card(e);t=t?CH.time(t):new Date;let i=r.state===SH.New?0:Math.max(uH(t,r.last_review,`days`),0),a=r.state===SH.New?0:this.forgetting_curve(i,+r.stability.toFixed(8));return n?`${(a*100).toFixed(2)}%`:a}rollback(e,t,n){let r=CH.card(e),i=CH.review_log(t);if(i.rating===q.Manual)throw Error(`Cannot rollback a manual rating`);let a,o,s;switch(i.state){case SH.New:a=i.due,o=void 0,s=0;break;case SH.Learning:case SH.Relearning:case SH.Review:a=i.review,o=i.due,s=r.lapses-(i.rating===q.Again&&i.state===SH.Review?1:0);break}let c={...r,due:a,stability:i.stability,difficulty:i.difficulty,elapsed_days:i.last_elapsed_days,scheduled_days:i.scheduled_days,reps:Math.max(0,r.reps-1),lapses:Math.max(0,s),learning_steps:i.learning_steps,state:i.state,last_review:o};return n&&typeof n==`function`?n(c):c}forget(e,t,n=!1,r){let i=CH.card(e);t=CH.time(t);let a=i.state===SH.New?0:uH(t,i.due,`days`),o={rating:q.Manual,state:i.state,due:i.due,stability:i.stability,difficulty:i.difficulty,elapsed_days:0,last_elapsed_days:i.elapsed_days,scheduled_days:a,learning_steps:i.learning_steps,review:t},s={card:{...i,due:t,stability:0,difficulty:0,elapsed_days:0,scheduled_days:0,reps:n?0:i.reps,lapses:n?0:i.lapses,learning_steps:0,state:SH.New,last_review:i.last_review},log:o};return r&&typeof r==`function`?r(s):s}reschedule(e,t=[],n={}){let{recordLogHandler:r,reviewsOrderBy:i,skipManual:a=!0,now:o=new Date,update_memory_state:s=!1}=n;i&&typeof i==`function`&&t.sort(i),a&&(t=t.filter(e=>e.rating!==q.Manual));let c=new JH(this),l=c.reschedule(n.first_card||bH(),t),u=l.length,d=CH.card(e),f=c.calculateManualRecord(d,o,u?l[u-1]:void 0,s);return r&&typeof r==`function`?{collections:l.map(r),reschedule_item:f?r(f):null}:{collections:l,reschedule_item:f}}},XH=e=>new YH(e||{})})),QH=c({DEFAULT_FSRS_PARAMS:()=>$H,Rating:()=>q,State:()=>SH,createEmptyFSRSCard:()=>iU,defaultFSRSStats:()=>rU,deserializeCard:()=>oU,getFSRSInstance:()=>nU,getNextCardState:()=>sU,getRetrievability:()=>lU,getSchedulingCards:()=>cU,serializeCard:()=>aU,updateFSRSInstance:()=>tU}),$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU=o((()=>{ZH(),$H={request_retention:.9,maximum_interval:36500,enable_fuzz:!0,enable_short_term:!0},eU=XH(UH($H)),tU=e=>{eU=XH(UH(e))},nU=()=>eU,rU=()=>({totalReviews:0,hardCount:0,goodCount:0,easyCount:0,againCount:0,lastReviewDate:Date.now(),reviewHistory:[]}),iU=e=>bH(e),aU=e=>({due:e.due instanceof Date?e.due.toISOString():String(e.due),stability:e.stability,difficulty:e.difficulty,elapsed_days:e.elapsed_days,scheduled_days:e.scheduled_days,learning_steps:e.learning_steps,reps:e.reps,lapses:e.lapses,state:e.state,last_review:e.last_review instanceof Date?e.last_review.toISOString():void 0}),oU=e=>({due:new Date(e.due),stability:e.stability,difficulty:e.difficulty,elapsed_days:e.elapsed_days,scheduled_days:e.scheduled_days,learning_steps:e.learning_steps??0,reps:e.reps,lapses:e.lapses,state:e.state,last_review:e.last_review?new Date(e.last_review):void 0}),sU=(e,t)=>{let n=oU(e);return aU(eU.next(n,new Date,t).card)},cU=e=>{let t=oU(e),n=eU.repeat(t,new Date);return{[q.Again]:{card:aU(n[q.Again].card),log:n[q.Again].log},[q.Hard]:{card:aU(n[q.Hard].card),log:n[q.Hard].log},[q.Good]:{card:aU(n[q.Good].card),log:n[q.Good].log},[q.Easy]:{card:aU(n[q.Easy].card),log:n[q.Easy].log}}},lU=e=>{let t=oU(e);return eU.get_retrievability(t,new Date,!1)}}));ZH(),uU(),vi();var dU=`thino-review-`,fU=`thino-review-historical-stats`,pU=`thino-review-daily-limit`;function mU(){return I.getState().app}function hU(e){let t=mU();if(!t)return null;try{let n=t.loadLocalStorage(e);return n?JSON.parse(n):null}catch{return null}}function gU(e,t){let n=mU();if(n)try{n.saveLocalStorage(e,JSON.stringify(t))}catch(t){console.error(`Error saving to localStorage:`,e,t)}}function _U(e){let t=mU();t&&t.saveLocalStorage(e,``)}var vU=()=>hU(fU)||{totalReviews:0,againCount:0,hardCount:0,goodCount:0,easyCount:0,lastReviewDate:0,reviewHistory:[]},yU=e=>{let t=vU();switch(t.totalReviews++,t.lastReviewDate=Date.now(),e){case q.Again:t.againCount++;break;case q.Hard:t.hardCount++;break;case q.Good:t.goodCount++;break;case q.Easy:t.easyCount++;break}t.reviewHistory.push({date:Date.now(),rating:e}),t.reviewHistory.length>1e3&&(t.reviewHistory=t.reviewHistory.slice(-1e3)),gU(fU,t)},bU=()=>{let e=new Date().toISOString().split(`T`)[0],t=hU(pU);if(!t||t.date!==e){let t={date:e,reviewed:0,totalCards:0};return gU(pU,t),t}return t},xU=e=>{let t=bU();t.reviewed+=1,e!==void 0&&(t.totalCards=e),gU(pU,t)},SU=e=>{let t=bU();t.totalCards=e,gU(pU,t)},CU=e=>hU(`${dU}${e}`)??void 0,wU=(e,t)=>{gU(`${dU}${e}`,t)},TU=e=>{_U(`${dU}${e}`)},EU=e=>{let t={memoId:e,card:aU(iU()),stats:rU()};return wU(e,t),t},DU=(e,t)=>{let n=CU(e);n||=EU(e);let r=sU(n.card,t),i={...n.stats,totalReviews:n.stats.totalReviews+1,lastReviewDate:Date.now(),reviewHistory:[...n.stats.reviewHistory,{date:Date.now(),rating:t}]};switch(i.reviewHistory.length>200&&(i.reviewHistory=i.reviewHistory.slice(-200)),t){case q.Again:i.againCount++;break;case q.Hard:i.hardCount++;break;case q.Good:i.goodCount++;break;case q.Easy:i.easyCount++;break}let a={...n,card:r,stats:i};return wU(e,a),xU(),yU(t),a},OU=()=>{mU()&&(_U(fU),_U(pU))},kU=e=>{if(!e)return!0;let t=Date.now();return new Date(e.card.due).getTime()<=t};vi(),H(),mg(),uU(),N();function AU(e){let t=Date.now(),n=new Date(e.due).getTime()-t;if(n<0)return M(`now`);let r=Math.round(n/6e4);if(r<1)return`<1m`;if(r<60)return`${r}m`;let i=Math.round(r/60);if(i<24)return`${i}h`;let a=Math.round(i/24);if(a<30)return`${a}d`;let o=Math.round(a/30);return o<12?`${o}mo`:`${(a/365).toFixed(1)}y`}var jU=()=>{let{plugin:e,settings:t}=I(),{memos:n}=F(),{isMobileView:r}=si(),{query:i}=di(),a=t?.fsrsDailyLimit??100,o=Rb(),[s,c]=(0,U.useState)(0),[l,u]=(0,U.useState)([]),[d,f]=(0,U.useState)(!1),[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(``),_=(0,U.useRef)(null),[v,y]=(0,U.useState)({total:0,reviewed:0,remaining:0,againCount:0,hardCount:0,goodCount:0,easyCount:0,dailyLimit:100,dailyReviewed:0}),[b]=(0,U.useState)(new Map),[x,S]=(0,U.useState)({totalReviews:0,againCount:0,hardCount:0,goodCount:0,easyCount:0,reviewHistory:[]}),C=(0,U.useMemo)(()=>new Set(n.map(e=>e.id)),[n]),w=(0,U.useMemo)(()=>{let e=l[s];if(!e||!d)return null;let t=b.get(e.id)?.card??aU(iU());try{let e=cU(t);return{again:AU(e[q.Again].card),hard:AU(e[q.Hard].card),good:AU(e[q.Good].card),easy:AU(e[q.Easy].card)}}catch{return null}},[l,s,d]);(0,U.useEffect)(()=>{(async()=>{try{let t=bU();if(t.reviewed>=a){u([]),y(e=>({...e,dailyReviewed:t.reviewed,remaining:0,total:t.totalCards})),f(!1),o.setFinish();return}let r=n.filter(e=>e.rowStatus!==`ARCHIVED`&&!(e.deletedAt!==``&&e.deletedAt)),s=r;if(i&&(i.tag||i.text||i.type||i.duration||i.filter||i.path)){let t=await pg({memos:r,query:i,filterOptions:{filterDoneTasks:!1,filterArchived:!0},plugin:e});s=Array.isArray(t)?t:r}let l=[],d=0,p=0,m=0,h=0;b.clear();for(let e of s)try{let t=CU(e.id);if(t){if(!C.has(t.memoId)){TU(t.memoId);continue}b.set(e.id,t)}kU(t)&&(l.push(e),t?.stats&&(d+=t.stats.againCount||0,p+=t.stats.hardCount||0,m+=t.stats.goodCount||0,h+=t.stats.easyCount||0))}catch(t){console.error(`Error fetching review data for memo:`,e.id,t);continue}l.sort((e,t)=>{let n=b.get(e.id),r=b.get(t.id);return(n?new Date(n.card.due).getTime():0)-(r?new Date(r.card.due).getTime():0)});let g=Math.min(l.length,a-t.reviewed);u(l.slice(0,g)),SU(s.length),f(!1),c(0),y({total:s.length,reviewed:0,remaining:g,againCount:d,hardCount:p,goodCount:m,easyCount:h,dailyLimit:a,dailyReviewed:t.reviewed})}catch(e){console.error(`Error in fetchReviewableMemos:`,e)}finally{o.setFinish()}})()},[n,i]),(0,U.useEffect)(()=>{e&&e.addCommand({id:`clear-review-data`,name:M(`Clear all review data`),callback:()=>{OU(),y({total:0,reviewed:0,remaining:0,againCount:0,hardCount:0,goodCount:0,easyCount:0,dailyLimit:a,dailyReviewed:0}),u([]),f(!1),c(0),b.clear()}})},[]),(0,U.useEffect)(()=>{S(vU())},[]),(0,U.useEffect)(()=>()=>z.clearQuery(),[]),(0,U.useCallback)(()=>{R.setShowSiderbarInMobileView(!0)},[]);let T=e=>{let t=l[s];if(!t)return;if(!C.has(t.id)){TU(t.id);let e=l.filter((e,t)=>t!==s);u(e),e.length===0?f(!1):s>=e.length&&c(0);return}let n=DU(t.id,e);b.set(t.id,n),S(vU());let r=bU(),i=l.filter((e,t)=>t!==s);if(e===q.Again||e===q.Hard){let e=i.findIndex(e=>{let t=b.get(e.id);return(t?new Date(t.card.due).getTime():0)>new Date(n.card.due).getTime()});e===-1?i.push(t):i.splice(e,0,t)}u(i),y(t=>({...t,reviewed:t.reviewed+1,remaining:i.length,dailyReviewed:r.reviewed,total:r.totalCards,...e===q.Again?{againCount:t.againCount+1}:e===q.Hard?{hardCount:t.hardCount+1}:e===q.Good?{goodCount:t.goodCount+1}:{easyCount:t.easyCount+1}})),i.length>0?s>=i.length&&c(0):f(!1)},E=e=>{g({[q.Again]:`swipe-left`,[q.Hard]:`swipe-down`,[q.Good]:`swipe-up`,[q.Easy]:`swipe-right`}[e]||``),setTimeout(()=>{T(e),g(``)},250)},D=()=>{l.length>0&&(f(!0),c(0))},O=l[s],k=v.reviewed+v.dailyReviewed,A=k+v.remaining,j=A>0?Math.round(k/A*100):0;return(0,W.jsxs)(`div`,{className:`daily-review-wrapper`,children:[(0,W.jsx)(cC,{showSidebar:r,rightContent:(0,W.jsx)(`div`,{className:`header-right-section`,children:(0,W.jsx)(`button`,{className:`show-stats-btn`,onClick:()=>m(!p),children:M(p?`Hide stats`:`Show stats`)})})}),(0,W.jsx)(oC,{}),d&&(0,W.jsxs)(`div`,{className:`review-progress-bar`,children:[(0,W.jsx)(`div`,{className:`review-progress-track`,children:(0,W.jsx)(`div`,{className:`review-progress-fill`,style:{width:`${j}%`}})}),(0,W.jsxs)(`span`,{className:`review-progress-text`,children:[k,` / `,A]})]}),p&&(0,W.jsxs)(`div`,{className:`review-stats-banner`,children:[(0,W.jsxs)(`div`,{className:`stats-grid`,children:[(0,W.jsxs)(`div`,{className:`stats-item`,children:[(0,W.jsx)(`span`,{className:`stats-number`,children:k}),(0,W.jsx)(`span`,{className:`stats-label`,children:M(`Daily Progress`)})]}),(0,W.jsxs)(`div`,{className:`stats-item`,children:[(0,W.jsx)(`span`,{className:`stats-number`,children:v.remaining}),(0,W.jsx)(`span`,{className:`stats-label`,children:M(`Today Remaining`)})]}),(0,W.jsxs)(`div`,{className:`stats-item`,children:[(0,W.jsx)(`span`,{className:`stats-number`,children:v.total}),(0,W.jsx)(`span`,{className:`stats-label`,children:M(`Today Total`)})]})]}),(0,W.jsxs)(`div`,{className:`stats-breakdown-row`,children:[(0,W.jsxs)(`span`,{className:`breakdown-item again`,children:[M(`Again`),`: `,x.againCount]}),(0,W.jsxs)(`span`,{className:`breakdown-item hard`,children:[M(`Hard`),`: `,x.hardCount]}),(0,W.jsxs)(`span`,{className:`breakdown-item good`,children:[M(`Good`),`: `,x.goodCount]}),(0,W.jsxs)(`span`,{className:`breakdown-item easy`,children:[M(`Easy`),`: `,x.easyCount]})]}),(0,W.jsxs)(`div`,{className:`stats-total-row`,children:[M(`Total Reviews`),`: `,x.totalReviews]})]}),(0,W.jsx)(`div`,{className:`review-container`,children:o.isLoading?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`span`,{className:`tip-text`,children:M(`Fetching data...`)})}):l.length===0?(0,W.jsxs)(`div`,{className:`review-done-container`,children:[(0,W.jsx)(`div`,{className:`review-done-icon`,children:`✓`}),(0,W.jsx)(`span`,{className:`review-done-text`,children:M(`Today, you have reviewed all your thinos!`)}),v.dailyReviewed>0&&(0,W.jsxs)(`span`,{className:`review-done-count`,children:[M(`Total Reviews`),`: `,v.dailyReviewed]})]}):d?(0,W.jsxs)(`div`,{className:`review-card-stack`,children:[l.length>2&&(0,W.jsx)(`div`,{className:`review-card stacked-card stack-2`}),l.length>1&&(0,W.jsx)(`div`,{className:`review-card stacked-card stack-1`}),(0,W.jsxs)(`div`,{ref:_,className:`review-card active-card ${h}`,children:[(0,W.jsx)(`div`,{className:`review-card-content`,children:(0,W.jsx)(gT,{memo:O})}),(0,W.jsxs)(`div`,{className:`review-buttons`,children:[(0,W.jsxs)(`button`,{className:`review-btn clickable-icon again`,onClick:()=>E(q.Again),children:[(0,W.jsx)(`span`,{className:`review-btn-label`,children:M(`Again`)}),w&&(0,W.jsx)(`span`,{className:`review-btn-interval`,children:w.again})]}),(0,W.jsxs)(`button`,{className:`review-btn clickable-icon hard`,onClick:()=>E(q.Hard),children:[(0,W.jsx)(`span`,{className:`review-btn-label`,children:M(`Hard`)}),w&&(0,W.jsx)(`span`,{className:`review-btn-interval`,children:w.hard})]}),(0,W.jsxs)(`button`,{className:`review-btn clickable-icon good`,onClick:()=>E(q.Good),children:[(0,W.jsx)(`span`,{className:`review-btn-label`,children:M(`Good`)}),w&&(0,W.jsx)(`span`,{className:`review-btn-interval`,children:w.good})]}),(0,W.jsxs)(`button`,{className:`review-btn clickable-icon easy`,onClick:()=>E(q.Easy),children:[(0,W.jsx)(`span`,{className:`review-btn-label`,children:M(`Easy`)}),w&&(0,W.jsx)(`span`,{className:`review-btn-interval`,children:w.easy})]})]})]})]}):(0,W.jsxs)(`div`,{className:`review-start-container`,children:[(0,W.jsx)(`div`,{className:`review-start-count`,children:v.remaining}),(0,W.jsx)(`span`,{className:`review-start-label`,children:M(`Thinos to review`)}),(0,W.jsx)(`button`,{className:`start-review-btn`,onClick:D,children:M(`Start Review`)})]})})]})};vi(),N(),H();var MU=()=>{let{tags:e,tagsNum:t,memos:n}=F(),r=si(e=>e.isMobileView),i=I(e=>e.plugin),a=Rb(),[o,s]=(0,U.useState)([]),[c,l]=(0,U.useState)([]),[u,d]=(0,U.useState)([]),[p,m]=(0,U.useState)([]),[h,g]=(0,U.useState)([]),[_,v]=(0,U.useState)([]),[y,b]=(0,U.useState)(`30days`),[x,S]=(0,U.useState)([]),C=e=>Math.max(r?320:600,e*(r?40:70));(0,U.useEffect)(()=>{!n||n.length===0||(async()=>{a.setLoading();try{let e=await i.thinoWorkerManager.calculateStats(n),r=e=>{let t=parseInt(String(e).replace(/[^0-9]/g,``),10);return isNaN(t)?0:t},a=(e,t)=>(e||[]).slice().sort((e,n)=>{let i=new Date(e[t]),a=new Date(n[t]);return(isNaN(i.getTime())?r(e[t]):i.getTime())-(isNaN(a.getTime())?r(n[t]):a.getTime())}),o=(e,t)=>(e||[]).slice().sort((e,n)=>r(e[t])-r(n[t]));s(a(e.dailyData,`date`)),l(o(e.monthlyData,`date`)),d(a(e.yearlyData,`date`)),m(o(e.hourlyData,`hour`)),g((e=>{let t=[`00-03`,`03-06`,`06-09`,`09-12`,`12-15`,`15-18`,`18-21`,`21-24`];return(e||[]).slice().sort((e,n)=>t.indexOf(e.period)-t.indexOf(n.period))})(e.timeDistData)),v((e=>(e||[]).slice().sort((e,t)=>r(e?.range?.split?.(`-`)?.[0])-r(t?.range?.split?.(`-`)?.[0])))(e.lengthData)),S(Object.entries(t).map(([e,t])=>({tag:e,count:t})).sort((e,t)=>t.count-e.count).slice(0,10))}catch(e){console.error(`Error loading stats:`,e)}finally{a.setFinish()}})()},[n]);let w=(0,U.useMemo)(()=>{switch(y){case`day`:return p;case`month`:return c;case`year`:return u;default:return o}},[y,p,c,u,o]);(0,U.useCallback)(()=>{R.setShowSiderbarInMobileView(!0)},[]);let T=(0,U.useCallback)(e=>{let t=new f.Menu;t.addItem(e=>{e.setTitle(M(`Hourly distribution`)).setChecked(y===`day`).onClick(()=>b(`day`))}),t.addItem(e=>{e.setTitle(M(`Month`)).setChecked(y===`month`).onClick(()=>b(`month`))}),t.addItem(e=>{e.setTitle(M(`30 Days`)).setChecked(y===`30days`).onClick(()=>b(`30days`))}),t.addItem(e=>{e.setTitle(M(`Year`)).setChecked(y===`year`).onClick(()=>b(`year`))}),t.showAtMouseEvent(e.nativeEvent)},[M,y]);return(0,W.jsxs)(`div`,{className:`thino-stat`,children:[(0,W.jsx)(cC,{showSidebar:r,title:M(`Statistics`)}),a.isLoading?(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`span`,{className:`tip-text`,children:M(`Fetching data...`)})}):(0,W.jsxs)(`div`,{className:`stats-container`,children:[(0,W.jsxs)(`div`,{className:`stat-card`,children:[(0,W.jsxs)(`div`,{className:`card-header`,children:[(0,W.jsxs)(`div`,{className:`card-title-section`,children:[(0,W.jsx)(`h3`,{className:`card-title`,children:M(`Thino Count`)}),(0,W.jsxs)(`p`,{className:`card-description`,children:[y===`day`&&M(`Hourly distribution`),y===`month`&&M(`Current month`),y===`30days`&&M(`Last 30 days`),y===`year`&&M(`Monthly distribution`)]})]}),(0,W.jsx)(`button`,{className:`view-mode-btn`,onClick:e=>T(e),children:M(`Switch view`)})]}),(0,W.jsx)(`div`,{className:`card-content`,children:(0,W.jsx)(nH,{data:w,dataKey:y===`day`?`hour`:`date`,width:C(w?.length||0),height:200,color:`var(--text-accent)`})}),(0,W.jsx)(`div`,{className:`card-footer`,children:(0,W.jsxs)(`div`,{className:`total-count`,children:[M(`Total`),`: `,n.length,` `,M(`thinos`),(0,W.jsx)(CB,{className:`trend-icon`})]})})]}),(0,W.jsxs)(`div`,{className:`stat-card`,children:[(0,W.jsx)(`div`,{className:`card-header`,children:(0,W.jsxs)(`div`,{className:`card-title-section`,children:[(0,W.jsx)(`h3`,{className:`card-title`,children:M(`Time Distribution`)}),(0,W.jsx)(`p`,{className:`card-description`,children:M(`When do you write thinos`)})]})}),(0,W.jsx)(`div`,{className:`card-content`,children:(0,W.jsx)(rH,{data:h,dataKey:`period`,valueKey:`count`,width:C(h?.length||0),height:200,color:`var(--interactive-accent)`})})]}),(0,W.jsxs)(`div`,{className:`stat-card`,children:[(0,W.jsx)(`div`,{className:`card-header`,children:(0,W.jsxs)(`div`,{className:`card-title-section`,children:[(0,W.jsx)(`h3`,{className:`card-title`,children:M(`Content Length`)}),(0,W.jsx)(`p`,{className:`card-description`,children:M(`Distribution of thino lengths`)})]})}),(0,W.jsx)(`div`,{className:`card-content`,children:(0,W.jsx)(rH,{data:_,dataKey:`range`,valueKey:`count`,width:C(_?.length||0),height:200,color:`var(--text-normal)`})})]}),(0,W.jsxs)(`div`,{className:`stat-card`,children:[(0,W.jsx)(`div`,{className:`card-header`,children:(0,W.jsxs)(`div`,{className:`card-title-section`,children:[(0,W.jsx)(`h3`,{className:`card-title`,children:M(`Popular Tags`)}),(0,W.jsx)(`p`,{className:`card-description`,children:M(`Top 10 most used tags`)})]})}),(0,W.jsx)(`div`,{className:`card-content`,children:(0,W.jsx)(rH,{data:x,dataKey:`tag`,valueKey:`count`,width:C(x?.length||0),height:200,color:`var(--text-selection)`})})]})]})]})};function NU(e,t){if(e==null)return{};var n=PU(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function PU(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function FU(){return FU=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},FU.apply(this,arguments)}function IU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?IU(Object(n),!0).forEach(function(t){RU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function RU(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zU={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0},BU=2,VU=class extends U.Component{constructor(e){super(e),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this);let t;t=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||BU,this.state={columnCount:t}}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(){let e=window&&window.innerWidth||1/0,t=this.props.breakpointCols;typeof t!=`object`&&(t={default:parseInt(t)||BU});let n=1/0,r=t.default||BU;for(let i in t){let a=parseInt(i);a>0&&e<=a&&a<n&&(n=a,r=t[i])}r=Math.max(1,parseInt(r)||1),this.state.columnCount!==r&&this.setState({columnCount:r})}itemsInColumns(){let e=this.state.columnCount,t=Array(e),n=U.Children.toArray(this.props.children);for(let r=0;r<n.length;r++){let i=r%e;t[i]||(t[i]=[]),t[i].push(n[r])}return t}renderColumns(){let{column:e,columnAttrs:t={},columnClassName:n}=this.props,r=this.itemsInColumns(),i=`${100/r.length}%`,a=n;a&&typeof a!=`string`&&(this.logDeprecated(`The property "columnClassName" requires a string`),a===void 0&&(a=`my-masonry-grid_column`));let o=LU(LU(LU({},e),t),{},{style:LU(LU({},t.style),{},{width:i}),className:a});return r.map((e,t)=>U.createElement(`div`,FU({},o,{key:t}),e))}logDeprecated(e){console.error(`[Masonry]`,e)}render(){let e=this.props,{children:t,breakpointCols:n,columnClassName:r,columnAttrs:i,column:a,className:o}=e,s=NU(e,[`children`,`breakpointCols`,`columnClassName`,`columnAttrs`,`column`,`className`]),c=o;return typeof o!=`string`&&(this.logDeprecated(`The property "className" requires a string`),o===void 0&&(c=`my-masonry-grid`)),U.createElement(`div`,FU({},s,{className:c}),this.renderColumns())}};VU.defaultProps=zU;var HU=[{name:`All`,value:null,color:`transparent`,border:!0},{name:`Red`,value:`red`,color:`#ef4444`},{name:`Orange`,value:`orange`,color:`#f97316`},{name:`Yellow`,value:`yellow`,color:`#eab308`},{name:`Green`,value:`green`,color:`#22c55e`},{name:`Blue`,value:`blue`,color:`#3b82f6`},{name:`Purple`,value:`purple`,color:`#a855f7`},{name:`Pink`,value:`pink`,color:`#ec4899`},{name:`Brown`,value:`brown`,color:`#a3a3a3`},{name:`Gray`,value:`gray`,color:`#6b7280`},{name:`Black`,value:`black`,color:`#1f2937`},{name:`White`,value:`white`,color:`#f9fafb`}],UU=e=>new Promise(t=>{let n=document.createElement(`canvas`),r=n.getContext(`2d`);if(!r){t(`gray`);return}n.width=50,n.height=50,r.drawImage(e,0,0,50,50);try{let e=r.getImageData(0,0,50,50).data,n={};for(let t=0;t<e.length;t+=4){let r=e[t],i=e[t+1],a=e[t+2];if(e[t+3]<128)continue;let o=WU(r,i,a);n[o]=(n[o]||0)+1}let i=0,a=`gray`;for(let[e,t]of Object.entries(n))t>i&&(i=t,a=e);t(a)}catch(e){console.warn(`Failed to extract color from image:`,e),t(`gray`)}}),WU=(e,t,n)=>{let r=(e*299+t*587+n*114)/1e3;if(r<50)return`black`;if(r>200&&Math.abs(e-t)<30&&Math.abs(t-n)<30&&Math.abs(e-n)<30)return`white`;if(Math.abs(e-t)<30&&Math.abs(t-n)<30&&Math.abs(e-n)<30)return`gray`;let i=Math.max(e,t,n);return i-Math.min(e,t,n)<50?`gray`:e===i?t>n?t-n>50?`yellow`:`orange`:n-t>50?`purple`:`red`:t===i?e>n?`yellow`:n-e>50?`blue`:`green`:e>t&&e-t>50?`purple`:`blue`},GU=({onColorSelect:e,selectedColor:t})=>{let[n,r]=(0,U.useState)(!1),i=(0,U.useRef)(null);(0,U.useEffect)(()=>{let e=e=>{i.current&&!i.current.contains(e.target)&&r(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let a=HU.find(e=>e.value===t)||HU[0];return(0,W.jsxs)(`div`,{className:`color-picker-container`,ref:i,children:[(0,W.jsxs)(`button`,{className:`color-picker-trigger`,onClick:()=>r(!n),"aria-label":`Select color filter`,children:[(0,W.jsxs)(`div`,{className:`color-picker-preview`,children:[(0,W.jsx)(`div`,{className:`color-preview-swatch`,style:{backgroundColor:a.color,border:a.border?`2px solid var(--text-muted)`:`none`}}),(0,W.jsx)(`span`,{className:`color-picker-label`,children:a.name})]}),(0,W.jsx)(`svg`,{className:`color-picker-arrow ${n?`open`:``}`,width:`12`,height:`12`,viewBox:`0 0 12 12`,children:(0,W.jsx)(`path`,{d:`M3 4.5L6 7.5L9 4.5`,stroke:`currentColor`,strokeWidth:`1.5`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})})]}),n&&(0,W.jsx)(`div`,{className:`color-picker-dropdown`,children:HU.map(n=>(0,W.jsxs)(`button`,{className:`color-picker-option ${t===n.value?`selected`:``}`,onClick:()=>{e(n.value),r(!1)},children:[(0,W.jsx)(`div`,{className:`color-option-swatch`,style:{backgroundColor:n.color,border:n.border?`2px solid var(--text-muted)`:`none`}}),(0,W.jsx)(`span`,{className:`color-option-label`,children:n.name})]},n.value||`all`))})]})};vi(),os();var KU=/\.(png|jpg|jpeg|gif|bmp|svg|webp)$/i,qU=({link:e,type:t,imagePath:n,altText:r,thinoId:i,sourceType:a,onColorExtracted:o})=>{let{app:s}=I(),[c,l]=(0,U.useState)(null),[u,d]=(0,U.useState)(null),[p,m]=(0,U.useState)(!0),h=e?.startsWith(`http://`)||e?.startsWith(`https://`);(0,U.useEffect)(()=>{if(!s||!e){d(`App context or image link is missing.`),m(!1);return}let r=!0;return m(!0),d(null),l(null),(async()=>{try{let i=null;if(h)i=e;else{let a=n||``,o=decodeURIComponent(e),c=s.metadataCache.getFirstLinkpathDest(o,a);if(!c&&a&&(c=s.metadataCache.getFirstLinkpathDest(o,``)),c instanceof f.TFile&&KU.test(c.path))i=s.vault.getResourcePath(c);else{let a=(0,f.normalizePath)(o),l=s.vault.getAbstractFileByPath(a);if(l instanceof f.TFile&&KU.test(l.path))i=s.vault.getResourcePath(l);else if(r){let r=`Could not resolve ${t} link: "${e}"`;n&&(r+=` (context: "${n}")`),c?r+=` - resolved to "${c.path}" but it's not a valid image.`:l&&(r+=` - resolved to "${l.path}" but it's not a valid image.`),d(r)}}}if(i&&r)l(i);else if(!i&&r&&!u){let r=`Image source for "${e}" (type: ${t}) could not be determined.`;n&&(r+=` Relative to "${n}"`),d(r)}}catch(i){console.error(`Error resolving image path for link "${e}" (type: ${t}, source: ${n||`N/A`}):`,i),r&&d(`Failed to resolve image "${e}": ${i.message}`)}finally{r&&m(!1)}})(),()=>{r=!1}},[s,e,t,n]);let g=()=>{KS(n?{imgUrl:c,filepath:n}:{imgUrl:c})},_=async()=>{if(!(!i||!n))switch(a){case`DAILY`:await rs(i,n);break;case`CANVAS`:await as(i,n);break;case`MULTI`:await ns(n);break;case`FILE`:await is(i,n);break;case`JOURNAL`:await rs(i,n);break}};return p?(0,W.jsx)(`div`,{className:`image-loading-placeholder`,children:`Loading...`}):u?(0,W.jsxs)(`div`,{className:`image-error-placeholder image-error-clickable`,onClick:_,title:`Click to open source location`,children:[`Error: `,u]}):c?(0,W.jsx)(`img`,{src:c,alt:r||e,crossOrigin:h?`anonymous`:void 0,onClick:g,onLoad:e=>{let t=e.currentTarget;o&&t.complete&&!h&&UU(t).then(e=>{o(e)}).catch(e=>{console.warn(`Failed to extract color:`,e)})},onError:()=>{u||d(`Failed to load image from src: ${c||e}`)},loading:`lazy`}):(0,W.jsx)(`div`,{className:`image-error-placeholder image-error-clickable`,onClick:_,title:`Click to open source location`,children:`Image not available`})};vi(),H(),Wr();var JU=20,YU=10,XU=()=>{let{app:e}=I(),{isMobileView:t}=si(),[n,r]=(0,U.useState)([]),[i,a]=(0,U.useState)([]),[o,s]=(0,U.useState)(JU),[c,l]=(0,U.useState)(!0),[u,d]=(0,U.useState)(null),[f,p]=(0,U.useState)(null),[m,h]=(0,U.useState)([]);(0,U.useEffect)(()=>{(async()=>{if(!e){l(!1);return}l(!0);try{let e=await V.fetchAllMemos(),t=new Map,n=0;for(let r of e)if(r.content){for(let e of r.content.matchAll(Rr)){let i=e[1],a=e[5];if(i){let e=`wiki-${r.path}-${i}`;t.has(e)||t.set(e,{link:i,type:`wiki`,thinoId:r.id,sourceType:r.sourceType,memoPath:r.path,altText:a||i,key:`img-${n++}`})}}for(let e of r.content.matchAll(zr)){let i=e[3],a=e[2];if(i&&!i.startsWith(`http`)&&/\.(png|jpg|jpeg|gif|bmp|svg|webp)$/i.test(i)){let e=`md-${i}`;t.has(e)||t.set(e,{link:i,type:`markdown`,thinoId:r.id,sourceType:r.sourceType,memoPath:r.path,altText:a||i,key:`img-${n++}`})}}for(let e of r.content.matchAll(Lr)){let i=e[2]+e[3]+e[4]+e[5],a=`http-${i}`;t.has(a)||t.set(a,{link:i,type:`markdown`,thinoId:r.id,sourceType:r.sourceType,memoPath:r.path,altText:i,key:`img-${n++}`})}}r(Array.from(t.values()))}catch(e){console.error(`Failed to fetch image references for gallery:`,e)}finally{l(!1)}})()},[e]),(0,U.useEffect)(()=>{h(f===null?n:n.filter(e=>e.dominantColor===f))},[f,n]),(0,U.useEffect)(()=>{m.length>0?a(m.slice(0,o)):a([])},[o,m]),(0,U.useEffect)(()=>{let e=document.querySelector(`.content-wrapper`);e?d(e):(console.warn(`'.content-wrapper' not found, falling back to window for scroll events. For optimal performance, ensure '.content-wrapper' exists or pass a ref to the scrollable element.`),d(document.documentElement))},[e]);let g=(0,U.useCallback)(()=>{!u||c||o>=m.length||u.scrollTop+u.clientHeight>=u.scrollHeight-300&&s(e=>Math.min(e+YU,m.length))},[c,m,o,u]);(0,U.useEffect)(()=>{if(!u)return;let e=u===document.documentElement?window:u;return e.addEventListener(`scroll`,g),()=>e.removeEventListener(`scroll`,g)},[g,u]);let _=(0,U.useCallback)((e,t)=>{r(n=>n.map(n=>n.key===e?{...n,dominantColor:t}:n))},[]),v=(0,U.useCallback)(e=>{p(e),s(JU)},[]);return c?(0,W.jsxs)(`div`,{className:`gallery-wrapper`,children:[(0,W.jsx)(cC,{showSidebar:t,children:(0,W.jsx)(`div`,{className:`gallery-header`,children:(0,W.jsx)(GU,{onColorSelect:v,selectedColor:f})})}),(0,W.jsx)(`div`,{className:`loading-indicator`,children:`Loading images...`})]}):i.length===0&&f===null?(0,W.jsx)(`div`,{className:`empty-gallery-message`,children:`Try add a image to thino`}):i.length===0&&f!==null?(0,W.jsxs)(`div`,{className:`gallery-wrapper`,children:[(0,W.jsx)(cC,{showSidebar:t,children:(0,W.jsx)(`div`,{className:`gallery-header`,children:(0,W.jsx)(GU,{onColorSelect:v,selectedColor:f})})}),(0,W.jsx)(`div`,{className:`empty-gallery-message`,children:`No images found with the selected color`})]}):(0,W.jsxs)(`div`,{className:`gallery-wrapper`,children:[(0,W.jsx)(cC,{showSidebar:t,children:(0,W.jsxs)(`div`,{className:`gallery-header`,children:[(0,W.jsx)(GU,{onColorSelect:v,selectedColor:f}),(0,W.jsx)(`div`,{className:`gallery-stats`,children:f?(0,W.jsxs)(`span`,{className:`gallery-stats-text`,children:[`Showing `,i.length,` of `,m.length,` `,f,` images`]}):(0,W.jsxs)(`span`,{className:`gallery-stats-text`,children:[`Showing `,i.length,` of `,n.length,` images`]})})]})}),(0,W.jsx)(VU,{breakpointCols:{default:3,1100:2,700:1},className:`gallery-masonry-grid`,columnClassName:`gallery-masonry-grid_column`,children:i.map(e=>(0,W.jsx)(`div`,{className:`gallery-image-item`,children:(0,W.jsx)(qU,{link:e.link,type:e.type,imagePath:e.memoPath,altText:e.altText,thinoId:e.thinoId,sourceType:e.sourceType,onColorExtracted:t=>_(e.key,t)})},e.key))})]})},ZU={"/recycle":(0,W.jsx)(eH,{}),"/archive":(0,W.jsx)(uC,{}),"/review":(0,W.jsx)(tH,{}),"/stat":(0,W.jsx)(MU,{}),"/daily-review":(0,W.jsx)(jU,{}),"/daily":(0,W.jsx)(cH,{}),"/gallery":(0,W.jsx)(XU,{}),"*":(0,W.jsx)(ZV,{})},QU=e=>t=>{for(let n of Object.keys(e))if(n===t)return e[n];return e[`*`]},$U=QU(FD),eW=QU(ZU);ii(),fi(),mi(),jg(),Sg(),Dg();var tW=!1,nW=``,rW=``,iW=``,aW=void 0;function oW(){(0,U.startTransition)(()=>{try{Ag.getState().recompute()}catch{}})}var sW=(0,f.debounce)(()=>{console.log(`ThinoDebug quick recompute triggered`),oW()},20,!0),cW=(0,f.debounce)(()=>{console.log(`ThinoDebug normal recompute triggered`),oW()},100,!0);function lW(){let{query:e}=di.getState(),{settings:t}=I.getState();e?.tag&&!e.text&&!e.type&&!e.filter&&!e.path&&(!e.metadata||Object.keys(e.metadata).length===0)&&(!e.duration||e.duration.from===0&&e.duration.to===0)&&!t?.HideDoneTasks?(console.log(`ThinoDebug: Using quick recompute for simple tag query`),sW()):cW()}function uW(){console.log(`ThinoDebug initMemoFilterAutoRecompute`),!tW&&(tW=!0,F.subscribe(e=>e.memosHash,e=>{if(e){if(e===nW){console.log(`ThinoDebug memoFilterInit: memos unchanged, skipping recompute`);return}nW=e,lW()}}),di.subscribe(e=>e.query,(e,t)=>{let n=JSON.stringify({tag:e?.tag||``,dur:e?.duration?[e.duration.from,e.duration.to]:null,type:e?.type||``,text:e?.text||``,filter:e?.filter||``,path:e?.path||``,metadata:e?.metadata||{}});if(n===rW){console.log(`ThinoDebug memoFilterInit: query unchanged, skipping recompute`);return}console.log(`ThinoDebug locationStore.query changed`,{prev:t,next:e}),rW=n,lW()}),I.subscribe(e=>e.settings?.HideDoneTasks,e=>{e!==aW&&(aW=e,lW())}),I.subscribe(e=>e.plugin,()=>lW()),xg.subscribe(e=>e.sort,e=>{let t=JSON.stringify(e||null);t!==iW&&(iW=t,lW())}),B.subscribe(e=>e.searchResults,e=>{let{query:t}=di.getState();B.getState().enabled&&t?.text&&cW()}),(F.getState().memos?.length||0)>0&&lW())}Ce(),N(),H(),Pa(),Qr(),vi();function dW({app:e}){let{pathname:t}=di(),{settings:n}=I();return(0,U.useEffect)(()=>{uW();let e=()=>{Na.start(`startup:fetchAllMemos`),V.fetchAllMemos().finally(()=>Na.end(`startup:fetchAllMemos`))};!f.Platform.isSafari&&typeof window.requestIdleCallback==`function`?window.requestIdleCallback(e,{timeout:100}):window.setTimeout(e,0)},[]),(0,U.useEffect)(()=>{!k()&&!e?.plugins?.getPlugin(`periodic-notes`)&&n?.EnabledLocationList?.find(e=>e.value===`DAILY`)&&new f.Notice(M(`Check if you opened Daily Notes Plugin Or Periodic Notes Plugin`)),!k()&&n?.EnabledLocationList?.find(e=>e.value===`DAILY`)&&!qr()&&new f.Notice(M(`Your daily note folder is not set correctly, please check your settings`))},[e,n]),(0,W.jsx)(W.Fragment,{children:$U(t)})}vi(),mg(),H();function fW(e){let t=e.view.canvas,n=L.getState().settings.EnabledLocationList.find(e=>e.value===`CANVAS`);if(!t||!e.view.file.path.endsWith(`.thino.canvas`)||t.thinoBtn||!n)return;let r=(0,$g.createRoot)(t.wrapperEl.createDiv({cls:`thino-canvas-menu-btn`}));r.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(pW,{leaf:e})})),t.thinoBtn=r,L.getState().view.appendRoot({root:r,canvas:t})}function pW({leaf:e}){let{memos:t}=F(),{query:n}=di(),{plugin:r}=I(),i=U.useRef(null),a=U.useRef(null),[o,s]=U.useState(!1),[c,l]=U.useState([]),[u,d]=U.useState([]),{tag:p,duration:m,type:h,text:g,filter:_}=n,v=Bg.getQueryById(_),y=!!(p||m&&m.from<m.to||h||g||v);return(0,U.useEffect)(()=>{a.current&&(0,f.setIcon)(a.current,`eraser`)},[a.current]),(0,U.useEffect)(()=>{i.current&&(0,f.setIcon)(i.current,`Memos`)},[i.current]),(0,U.useEffect)(()=>{let n=e.view.file.path;l(t.filter(e=>e.sourceType===`CANVAS`&&e.path===n))},[t,o]),(0,U.useEffect)(()=>{if(c.length!==0){if(!n||!y){d(c);return}pg({memos:c,query:n,filterOptions:{filterDoneTasks:!1},plugin:r}).then(e=>{d(e)})}},[n,c]),(0,U.useEffect)(()=>{if(!n||!y&&u.length===0)return;let t=new Set(u.map(e=>e.id)),r=Array.from(e.view.canvas.nodes.values());r.forEach(t=>{t.nodeEl.toggleVisibility(!0),e.view.canvas.getEdgesForNode(t).forEach(e=>{e.lineGroupEl?.toggleClass(`thino-hidden`,!1),e.lineStartGroupEl?.toggleClass(`thino-hidden`,!1),e.lineEndGroupEl?.toggleClass(`thino-hidden`,!1)})}),r.filter(e=>!t.has(e.id)).forEach(t=>{t.nodeEl.toggleVisibility(!1),e.view.canvas.getEdgesForNode(t).forEach(e=>{e.lineGroupEl?.toggleClass(`thino-hidden`,!0),e.lineStartGroupEl?.toggleClass(`thino-hidden`,!0),e.lineEndGroupEl?.toggleClass(`thino-hidden`,!0)})})},[u]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{ref:i,className:`btn-container`,onClick:()=>s(!o)}),o&&(0,W.jsxs)(`div`,{className:`thino-canvas-menu`,children:[(0,W.jsxs)(`div`,{className:`thino-canvas-filter-group`,children:[(0,W.jsx)(bT,{}),(0,W.jsx)(bv,{}),y&&(0,W.jsx)(`div`,{ref:a,className:`clear-query`,onClick:()=>{z.clearQuery()}})]}),(0,W.jsx)($T,{initThinos:u})]})]})}function mW(e,t){let n=Object.keys(t).map(n=>hW(e,n,t[n]));return n.length===1?n[0]:function(){n.forEach(e=>e())}}function hW(e,t,n){let r=e[t],i=e.hasOwnProperty(t),a=n(r);return r&&Object.setPrototypeOf(a,r),Object.setPrototypeOf(o,a),e[t]=o,s;function o(...n){return a===r&&e[t]===o&&s(),a.apply(this,n)}function s(){e[t]===o&&(i?e[t]=r:delete e[t]),a!==r&&(a=r,Object.setPrototypeOf(o,r||Function))}}H(),Ce(),wg();var gW=`thino_view`,_W=class{static[Symbol.hasInstance](e){return e instanceof f.TFile}path=`/fake-file-that-generated-for-thino.png`;basename=`fake-file-that-generated-for-thino`;extension=`png`;deleted=!1;name=`fake-file-that-generated-for-thino.png`;parent=null;stat;vault=null;constructor(){}setPath(e){}getNewPathAfterRename(e){}getShortName(){}cache(e){}updateCacheLimit(){}},vW=class e extends f.ItemView{scope=new f.Scope(this.app.scope);root;mobileHeaderRoot;plugin;memosComponent;rootList=[];pendingModifyHandlers=new Map;editor=null;navigation=!1;file=this.app.vault.getMarkdownFiles()[0]||new _W;constructor(e,t){super(e),this.plugin=t,this.registerScope()}getDisplayText(){return`Thino`}getIcon(){return`Memos`}getViewType(){return gW}getMode(){return`source`}canToggleBacklinks(){return!1}registerScope(){let{scope:e}=this;e.register([`Mod`],`Enter`,()=>{}),e.register([],`i`,e=>{let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.hasClass(`cm-line`)||t.hasClass(`cm-content`)||(e.preventDefault(),this.plugin.app.workspace.trigger(`focus-on-textarea`))}),e.register([`Mod`],`f`,e=>{let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.hasClass(`cm-line`)||t.hasClass(`cm-content`)||(e.preventDefault(),this.plugin.app.workspace.trigger(`focus-on-searchBar`))}),e.register([],`o`,e=>{let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.hasClass(`cm-line`)||t.hasClass(`cm-content`)||(e.preventDefault(),this.plugin.app.workspace.trigger(`focus-on-searchBar`))}),e.register([],`Escape`,()=>{this.plugin.app.vault.config?.vimMode!==!0&&setTimeout(()=>{this.plugin.app.workspace.trigger(`blur-on-memos`)},20)})}handleUpdateInstance=e=>{this.editor=e.editor};handleFileModify(e){let t=this.pendingModifyHandlers.get(e.path);t&&t();let n;this.pendingModifyHandlers.set(e.path,()=>{n&&clearTimeout(n)}),n=setTimeout(async()=>{this.pendingModifyHandlers.delete(e.path),await this.onFileModified(e)},2e3)}async onFileDeleted(e){let t=this.pendingModifyHandlers.get(e.path);t&&(console.log(`ThinoDebug: Cancelling pending modify event for deleted file`,e.path),t(),this.pendingModifyHandlers.delete(e.path));let n=re(e,`day`),r=e.path.contains(`.thino`)&&e.path.contains(`.canvas`),i=e.path.contains(`.thino`)&&e.path.contains(`.md`),a=this.plugin.settings?.MemoOtherSaveLocation.MemoDefaultMultiFilePath||`Thino`,o=(e.parent?.path||e.path)?.contains(a?.trim());(n||r&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`CANVAS`))&&(await V.removeMemosInFile(e),V.updateTagsState()),o&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`MULTI`)&&(await V.removeMemosInFile(e,a),V.updateTagsState()),i&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`FILE`)&&(await V.removeMemosInFile(e),V.updateTagsState());let s=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForMultiTypeFiles),c=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForFileTypeFiles);!o&&s&&(await V.removeMemosInFile(e,a),V.updateTagsState()),!i&&c&&(await V.removeMemosInFile(e),V.updateTagsState())}async onFileModified(e){if(V.isPathPending(e.path)){console.log(`[Thino:Perf] onFileModified SKIPPED (locked) ${e.path}`);return}if(!await this.app.vault.adapter.exists(e.path)){console.log(`ThinoDebug onFileModified: file no longer exists, ignoring modify event for`,e.path);return}let t=re(e,`day`),n=e.path.contains(`.thino`)&&e.path.contains(`.canvas`),r=e.path.contains(`.thino`)&&e.path.contains(`.md`),i=this.plugin.settings?.MemoOtherSaveLocation.MemoDefaultMultiFilePath||`Thino`,a=e.parent.path.contains(i?.trim()),o=V.getState().preparingUpdateMemo&&V.getState().preparingUpdateMemo.length>0;if(Cg.getState().clearCache(),(t||n&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`CANVAS`))&&!o){await V.updateMemosInFile(e),V.updateTagsState();return}a&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`MULTI`)&&(await V.updateMemosInFile(e,i),V.updateTagsState()),r&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`FILE`)&&(await V.updateMemosInFile(e),V.updateTagsState());let s=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForMultiTypeFiles),c=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForFileTypeFiles);!a&&s&&(await V.updateMemosInFile(e,i),V.updateTagsState()),!r&&c&&(await V.updateMemosInFile(e),V.updateTagsState())}async onFileCreated(e){if(this.app.workspace.layoutReady&&this.root){let t=re(e,`day`),n=e.path.contains(`.thino`)&&e.path.contains(`.canvas`),r=e.path.contains(`.thino`)&&e.path.contains(`.md`),i=this.plugin.settings?.MemoOtherSaveLocation.MemoDefaultMultiFilePath||`Thino`,a=e.parent.path.contains(i?.trim()),o=V.getState().preparingUpdateMemo&&V.getState().preparingUpdateMemo.length>0;if(t&&!o){if(R.getState().changedByMemos||V.isPathPending(e.path)){console.log(`[Thino:Perf] onFileCreated SKIPPED (locked) ${e.path}`),await L.updateDailyNotes(e,!1);return}console.log(`[Thino:Perf] onFileCreated PROCESSING ${e.path}`),await L.updateDailyNotes(e,!1),await V.updateMemosInFile(e),V.updateTagsState();return}if(n&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`CANVAS`)){await V.updateMemosInFile(e),V.updateTagsState();return}a&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`MULTI`)&&(await V.updateMemosInFile(e,i),V.updateTagsState()),r&&this.plugin.settings.EnabledLocationList.find(e=>e.value===`FILE`)&&(await V.updateMemosInFile(e),V.updateTagsState());let s=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForMultiTypeFiles),c=(0,f.getAllTags)(this.app.metadataCache.getFileCache(e))?.contains(this.plugin.settings.TagForFileTypeFiles);!a&&s&&(await V.updateMemosInFile(e,i),V.updateTagsState()),!r&&c&&(await V.updateMemosInFile(e),V.updateTagsState())}}async onFileRenamed(e,t){if(e instanceof f.TFile){let n=this.pendingModifyHandlers.get(t);n&&(console.log(`ThinoDebug: Cancelling pending modify event for renamed file`,t),n(),this.pendingModifyHandlers.delete(t)),await V.removeThinosByPath(t),await this.onFileCreated(e)}}checkWidth(){let e=this.leaf;if(e&&e.height!==0){if(e.view.containerEl.toggleClass(`tiny-view`,e.width<600),e.view.containerEl.toggleClass(`waterfall-small-group`,e.width<1300),e.width>1100){e.view.containerEl.classList.toggle(`mobile-view`,!1),R.setIsMobileView(e.width<=1100);return}if(this.plugin.settings?.ShowLeftSideBar&&!f.Platform.isMobile)return;e.view.containerEl.classList.toggle(`mobile-view`,!0),R.setIsMobileView(e.width<=1100)}}async onResize(){super.onResize(),this.checkWidth()}appendToHeader(){if(this.plugin.settings.useMobileViewDefaultHeader){this.containerEl.toggleClass(`using-default-header`,!0);return}let e=this.leaf.view.titleContainerEl;e&&(this.mobileHeaderRoot=$g.createRoot(e),this.mobileHeaderRoot.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(TT,{})})))}appendRoot({root:e,canvas:t}){this.rootList.push({root:e,canvas:t})}updateCacheDebounced=(0,f.debounce)(async e=>{this.app.vault.getFileByPath(e.path)&&await V.updateMemosInFile(e)},1e3);registerPatchWorkspaceLeaf(){let t=this;this.register(mW(f.Workspace.prototype,{getActiveViewOfType:t=>function(n){let r=t.call(this,n);if(!r&&n?.VIEW_TYPE===`markdown`){let t=this.activeLeaf;if(t?.view instanceof e)return t.view}return r},setActiveLeaf:n=>function(r,i){if(dw(r)&&(n.call(this,r,i),r.activeTime=17e11),n.call(this,r,i),r.view instanceof e){let e=R.getState().instances?.[r.id];if(!e)return;t.app.workspace.activeEditor=e.owner,r.view.editor=e.editor}},getActiveFile:n=>function(){let r=n.call(this);return this.activeLeaf?.view instanceof e&&t.file||r}}))}debounceTemplateExecution=(0,f.debounce)(async()=>{console.log(`debounceTemplateExecution`),this.app.workspace.trigger(`templater:all-templates-executed`)},1e3);async registerEventList(){await this.onResize(),this.onFileCreated=this.onFileCreated.bind(this),this.onFileDeleted=this.onFileDeleted.bind(this),this.onFileModified=this.onFileModified.bind(this),this.registerEvent(this.app.vault.on(`create`,this.onFileCreated)),this.registerEvent(this.app.vault.on(`delete`,this.onFileDeleted.bind(this))),this.registerEvent(this.app.vault.on(`modify`,e=>{e instanceof f.TFile&&this.handleFileModify(e)})),this.registerEvent(this.app.vault.on(`rename`,this.onFileRenamed.bind(this))),this.registerEvent(this.app.workspace.on(`active-leaf-change`,e=>{e?.view?.getViewType()===`canvas`&&fW(e)})),this.registerEvent(this.app.metadataCache.on(`changed`,(e,t,n)=>{if(V.getState().preparingUpdateMemo&&V.getState().preparingUpdateMemo.length>0){this.debounceTemplateExecution(),console.log(`templater update`);return}if(!V.initialized)return;let r=re(e,`day`);if(r&&V.isPathPending(e.path)){console.log(`[Thino:Perf] metadataCache SKIPPED (locked) ${e.path}`);return}r&&this.updateCacheDebounced(e)})),this.registerEvent(this.app.workspace.on(`templater:all-templates-executed`,async()=>{await V.finishWaitingForTemplaterThinos()}))}async onOpen(){this.checkWidth(),this.navigation=this.plugin.settings.navigation,f.Platform.isTablet&&document.body.toggleClass(`is-tablet`,!0);try{this.root=$g.createRoot(f.Platform.isDesktop?this.containerEl:this.contentEl),L.setView(this),this.root.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(dW,{app:this.plugin.app})}))}catch(e){console.error(e)}requestAnimationFrame(async()=>{f.Platform.isMobile&&!f.Platform.isTablet&&this.appendToHeader(),await this.registerEventList(),this.registerPatchWorkspaceLeaf()})}onunload(){super.onunload(),this.root.unmount(),this.mobileHeaderRoot?.unmount(),this.rootList.forEach(e=>{e?.root?.unmount(),e?.canvas?.thinoBtn&&(e.canvas.thinoBtn=void 0),e?.canvas?.wrapperEl.find(`.thino-canvas-menu-btn`)&&e.canvas.wrapperEl.find(`.thino-canvas-menu-btn`).detach()})}},yW=class e{app;filePath;leaf=null;canvas=null;file=null;container=null;isReadonly;destroyed=!1;listeners=new Map;originalUnload=null;resizeObserver=null;constructor(e){this.app=e.app,this.filePath=e.filePath,this.container=e.container??null,this.isReadonly=e.readonly??!1}async open(){if(this.destroyed)throw Error(`ManagedCanvas has been destroyed`);await this.ensureFile(),await this.openLeaf(),await this.waitForCanvas(),this.container&&this.embedInContainer(),this.isReadonly&&this.canvas&&this.canvas.setReadonly?.(!0),this.emit(`canvas-ready`)}destroy(){if(!this.destroyed){if(this.destroyed=!0,this.resizeObserver&&=(this.resizeObserver.disconnect(),null),this.originalUnload){try{this.originalUnload()}catch{}this.originalUnload=null}this.leaf&&=(this.leaf.detach(),null),this.canvas=null,this.file=null,this.emit(`canvas-destroyed`),this.listeners.clear()}}get isReady(){return!this.destroyed&&this.canvas!==null}getCanvas(){return this.canvas}getLeaf(){return this.leaf}getWrapperEl(){return this.canvas?.wrapperEl??null}getData(){return this.canvas?.getData()??null}setData(e){this.requireCanvas(),this.canvas.setData(e),this.emit(`data-changed`,e)}importData(e,t=!1){this.requireCanvas(),this.canvas.importData(e,t),this.emit(`data-changed`,this.getData())}save(e=!0){this.requireCanvas(),this.canvas.requestSave(e)}createTextNode(e){this.requireCanvas();let t=this.canvas.createTextNode({pos:e.pos,size:e.size,position:e.position,text:e.text??``,save:e.save??!0,focus:e.focus??!1}).id;return this.emit(`node-added`,t),t}createFileNode(e){this.requireCanvas();let t=this.canvas.createFileNode({pos:e.pos,size:e.size,position:e.position,file:e.file,subpath:e.subpath,save:e.save??!0,focus:e.focus??!1}).id;return this.emit(`node-added`,t),t}createLinkNode(e){this.requireCanvas();let t=this.canvas.createLinkNode({pos:e.pos,size:e.size,position:e.position,url:e.url,save:e.save??!0,focus:e.focus??!1}).id;return this.emit(`node-added`,t),t}createGroupNode(e){this.requireCanvas();let t=this.canvas.createGroupNode({pos:e.pos,size:e.size,position:e.position,label:e.label,save:e.save??!0,focus:e.focus??!1}).id;return this.emit(`node-added`,t),t}removeNode(e){this.requireCanvas();let t=this.canvas.nodes.get(e);return t?(this.canvas.removeNode(t),this.save(),this.emit(`node-removed`,e),!0):!1}getNode(e){return this.canvas?.nodes.get(e)}getNodeIds(){return this.canvas?Array.from(this.canvas.nodes.keys()):[]}selectAndZoom(e){this.requireCanvas();let t=this.canvas.nodes.get(e);return t?(this.canvas.selectOnly(t),this.canvas.zoomToSelection(),!0):!1}selectNode(e){this.requireCanvas();let t=this.canvas.nodes.get(e);return t?(this.canvas.select(t),!0):!1}deselectAll(){this.requireCanvas(),this.canvas.deselectAll()}createEdge(e){this.requireCanvas();let t=this.canvas.nodes.get(e.fromNodeId),n=this.canvas.nodes.get(e.toNodeId);if(!t||!n)return null;let r=this.generateId(),i={id:r,fromNode:e.fromNodeId,fromSide:e.fromSide??`right`,toNode:e.toNodeId,toSide:e.toSide??`left`,label:e.label},a=this.getData();return a?(a.edges=[...a.edges??[],i],this.canvas.importData(a,!0),this.save(),this.emit(`edge-added`,r),r):null}removeEdge(e){this.requireCanvas();let t=this.canvas.edges.get(e);return t?(this.canvas.removeEdge(t),this.save(),this.emit(`edge-removed`,e),!0):!1}getEdgeIds(){return this.canvas?Array.from(this.canvas.edges.keys()):[]}zoomToFit(){this.requireCanvas(),this.canvas.zoomToFit?.()}setViewport(e,t,n){this.requireCanvas(),this.canvas.setViewport?.(e,t,n)}screenToCanvas(e,t){if(!this.canvas)return null;let n=this.canvas.wrapperEl;if(!n)return null;let r=n.getBoundingClientRect(),i=this.canvas.scale??1,a=this.canvas.x??0,o=this.canvas.y??0;return{x:(e-r.left-r.width/2)/i+a,y:(t-r.top-r.height/2)/i+o}}async saveJson(e){let t=this.getData();t&&await this.app.vault.adapter.write(e,JSON.stringify(t,null,2))}static async loadJson(e,t){try{let n=await e.read(t);return JSON.parse(n)}catch{return null}}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set);let n=t;return this.listeners.get(e).add(n),()=>this.listeners.get(e)?.delete(n)}emit(e,...t){this.listeners.get(e)?.forEach(n=>{try{n(...t)}catch(t){console.error(`[ManagedCanvas] Error in "${e}" listener:`,t)}})}async ensureFile(){let e=this.app.vault.getAbstractFileByPath(this.filePath);if(e instanceof f.TFile){this.file=e;return}let t=this.filePath.substring(0,this.filePath.lastIndexOf(`/`));t&&(this.app.vault.getAbstractFileByPath(t)||await this.app.vault.createFolder(t)),this.file=await this.app.vault.create(this.filePath,JSON.stringify({nodes:[],edges:[]},null,2))}async openLeaf(){if(!this.file)throw Error(`Canvas file not initialised`);this.leaf=this.app.workspace.getLeaf(`split`),await this.leaf.openFile(this.file)}waitForCanvas(){return new Promise((e,t)=>{let n=0,r=()=>{n++;let i=this.leaf?.view;if(i?.canvas){this.canvas=i.canvas,e();return}if(n>=50){t(Error(`Timed out waiting for canvas instance`));return}requestAnimationFrame(r)};requestAnimationFrame(r)})}embedInContainer(){if(!this.container||!this.canvas)return;let e=this.canvas.wrapperEl;if(!e)return;this.container.appendChild(e),this.originalUnload=this.canvas.unload.bind(this.canvas),this.canvas.unload=()=>{};let t=this.canvas;t.requestSave=e=>{e===void 0&&(e=!0),t.data=t.getData(),e&&t.requestPushHistory?.(t.data),this.emit(`save-requested`)};let n=t.view,r=n?.file;n&&(n.requestSave=()=>{},n.clear=()=>{},r&&Object.defineProperty(n,`file`,{get:()=>r,set:()=>{},configurable:!0})),this.leaf&&=(this.leaf.detach(),null);let i=this.canvas;this.resizeObserver=new ResizeObserver(()=>{i.onResize?.()}),this.resizeObserver.observe(this.container),requestAnimationFrame(()=>{i.onResize?.(),i.requestFrame?.()})}requireCanvas(){if(!this.canvas||this.destroyed)throw Error(`ManagedCanvas is not ready or has been destroyed`)}generateId(){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}static async create(t){let n=new e(t);return await n.open(),n}static fromLeaf(t,n,r){let i=n.view;if(!i?.canvas||!i?.file)return null;let a=new e({app:t,filePath:i.file.path,container:r});return a.leaf=n,a.canvas=i.canvas,a.file=i.file,r&&a.embedInContainer(),a.emit(`canvas-ready`),a}};vi();var bW=100,xW=8;function SW({existingNodeIds:e}){let t=F(e=>e.memos),[n,r]=(0,U.useState)(``),[i,a]=(0,U.useState)(``);(0,U.useEffect)(()=>{let e=window.setTimeout(()=>a(n),250);return()=>clearTimeout(e)},[n]);let o=(0,U.useMemo)(()=>{let e=i.trim().toLowerCase(),n=t.filter(e=>e.rowStatus!==`ARCHIVED`&&!e.deletedAt);return e&&(n=n.filter(t=>t.content.toLowerCase().includes(e))),n},[t,i]),s=(0,U.useRef)(null),[c,l]=(0,U.useState)(0),[u,d]=(0,U.useState)(600),f=(0,U.useCallback)(()=>{let e=s.current;e&&l(e.scrollTop)},[]);(0,U.useEffect)(()=>{let e=s.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e)d(t.contentRect.height)});return t.observe(e),()=>t.disconnect()},[]);let p=o.length*bW,m=Math.max(0,Math.floor(c/bW)-xW),h=Math.min(o.length,Math.ceil((c+u)/bW)+xW),g=o.slice(m,h);return(0,W.jsxs)(`div`,{className:`thino-list-panel`,children:[(0,W.jsx)(`div`,{className:`thino-list-search`,children:(0,W.jsx)(`input`,{type:`text`,placeholder:`Search thinos...`,value:n,onChange:e=>r(e.target.value),spellCheck:!1})}),(0,W.jsxs)(`div`,{className:`thino-list-count`,children:[o.length,` thino`,o.length===1?``:`s`]}),(0,W.jsx)(`div`,{className:`thino-list-items`,ref:s,onScroll:f,children:o.length>0?(0,W.jsx)(`div`,{style:{height:p,position:`relative`},children:(0,W.jsx)(`div`,{style:{position:`absolute`,top:m*bW,left:0,right:0},children:g.map(t=>(0,W.jsx)(CW,{memo:t,isOnCanvas:e.has(t.id)},t.id))})}):(0,W.jsx)(`div`,{className:`thino-list-empty`,children:`No thinos found`})})]})}var CW=U.memo(function({memo:e,isOnCanvas:t}){let n=(0,U.useRef)(null),r=t=>{t.dataTransfer.setData(`text/thino-id`,e.id),t.dataTransfer.setData(`text/thino-content`,e.content),t.dataTransfer.effectAllowed=`copy`,n.current&&t.dataTransfer.setDragImage(n.current,10,10)},i=e.content.length>140?e.content.slice(0,140)+`…`:e.content;return(0,W.jsxs)(`div`,{ref:n,className:`thino-list-item ${t?`is-on-canvas`:``}`,style:{height:bW,boxSizing:`border-box`},draggable:!0,onDragStart:r,children:[(0,W.jsx)(`div`,{className:`thino-list-item-content`,children:i}),(0,W.jsxs)(`div`,{className:`thino-list-item-meta`,children:[(0,W.jsx)(`span`,{className:`thino-list-item-date`,children:wW(e.createdAt)}),e.sourceType&&(0,W.jsx)(`span`,{className:`thino-list-item-source`,children:e.sourceType}),t&&(0,W.jsx)(`span`,{className:`thino-list-item-badge`,children:`on canvas`})]})]})});function wW(e){if(!e)return``;let t=new Date(e.replace(/\//g,`-`));return isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function TW({app:e,plugin:t,canvasFilePath:n,onCanvasReady:r}){let i=(0,U.useRef)(null),a=(0,U.useRef)(null),[o,s]=(0,U.useState)(!1),[c,l]=(0,U.useState)(0),[u,d]=(0,U.useState)(0),[f,p]=(0,U.useState)(!1),[m,h]=(0,U.useState)(!1);(0,U.useEffect)(()=>{if(!i.current)return;let t=!1;return yW.create({app:e,filePath:n,container:i.current}).then(e=>{if(t){e.destroy();return}a.current=e,s(!0),g(e),e.on(`node-added`,()=>g(e)),e.on(`node-removed`,()=>g(e)),e.on(`edge-added`,()=>g(e)),e.on(`edge-removed`,()=>g(e)),r?.(e)}).catch(e=>{console.error(`[ThinoCanvasOrganizer] Canvas init failed:`,e)}),()=>{t=!0}},[n]);let g=(0,U.useCallback)(e=>{l(e.getNodeIds().length),d(e.getEdgeIds().length)},[]),_=(0,U.useCallback)(e=>{e.dataTransfer.types.includes(`text/thino-id`)&&p(!0)},[]),v=(0,U.useCallback)(e=>{let t=e.relatedTarget;e.currentTarget.contains(t)||p(!1)},[]),y=(0,U.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),p(!1);let t=a.current;if(!t)return;let n=e.dataTransfer.getData(`text/thino-id`),r=e.dataTransfer.getData(`text/thino-content`);if(!n||!r)return;let i=t.screenToCanvas(e.clientX,e.clientY);if(!i)return;let o=t.createTextNode({pos:i,size:{width:300,height:120},text:r,focus:!1,save:!1});try{let e=t.getData();if(e){let r=e.nodes.find(e=>e.id===o);r&&(r.thinoId=n),t.setData(e)}}catch{}t.save()},[]),b=(0,U.useCallback)(()=>{let e=a.current;e&&e.createTextNode({pos:{x:Math.random()*200-100,y:Math.random()*200-100},text:``,focus:!0})},[]),x=(0,U.useCallback)(()=>{a.current?.zoomToFit()},[]),S=(0,U.useCallback)(()=>{a.current?.save()},[]);return(0,W.jsxs)(`div`,{className:`thino-organizer-root`,children:[(0,W.jsxs)(`div`,{className:`thino-organizer-toolbar`,children:[(0,W.jsxs)(`div`,{className:`thino-organizer-toolbar-left`,children:[(0,W.jsx)(DW,{icon:`plus`,label:`Add text node`,onClick:b}),(0,W.jsx)(DW,{icon:`maximize`,label:`Zoom to fit`,onClick:x}),(0,W.jsx)(DW,{icon:`save`,label:`Save`,onClick:S})]}),(0,W.jsxs)(`div`,{className:`thino-organizer-toolbar-right`,children:[(0,W.jsx)(`span`,{className:`thino-organizer-status`,children:o?`${c} node${c===1?``:`s`} \u00b7 ${u} edge${u===1?``:`s`}`:`Loading…`}),(0,W.jsx)(DW,{icon:m?`panel-right-open`:`panel-right-close`,label:m?`Show thino list`:`Hide thino list`,onClick:()=>h(e=>!e)})]})]}),(0,W.jsxs)(`div`,{className:`thino-organizer-body`,children:[(0,W.jsxs)(`div`,{className:`thino-organizer-canvas ${f?`is-drag-over`:``}`,onDragEnter:_,onDragLeave:v,onDragOver:e=>{e.dataTransfer.types.includes(`text/thino-id`)&&e.preventDefault()},children:[(0,W.jsx)(`div`,{ref:i,className:`thino-organizer-canvas-host`}),f&&(0,W.jsx)(`div`,{className:`thino-organizer-drop-overlay`,onDrop:y,onDragOver:e=>e.preventDefault(),children:(0,W.jsx)(`span`,{children:`Drop thino here`})})]}),!m&&(0,W.jsx)(SW,{existingNodeIds:o?EW(a.current):new Set})]})]})}function EW(e){if(!e)return new Set;let t=e.getData();if(!t)return new Set;let n=new Set;for(let e of t.nodes){let t=e.thinoId;t&&n.add(t)}return n}function DW({icon:e,label:t,onClick:n}){let r=(0,U.useRef)(null);return(0,U.useEffect)(()=>{r.current&&(0,f.setIcon)(r.current,e)},[e]),(0,W.jsx)(`button`,{ref:r,className:`thino-organizer-toolbar-btn clickable-icon`,"aria-label":t,title:t,onClick:n})}Rg(),H(),vi(),Mv(),N();var OW=`thino-canvas-organizer`,kW=`thino-organizer-workspace.canvas`,AW=2e3,jW=class extends f.ItemView{plugin;root=null;managedCanvas=null;autoSaveTimer=null;saveDebounceTimer=null;unsubSaveRequested=null;unsubMemoStore=null;constructor(e,t){super(e),this.plugin=t}getViewType(){return OW}getDisplayText(){return`Thino Canvas`}getIcon(){return`layout-dashboard`}get jsonPath(){return`${this.plugin.manifest.dir}/thino-canvas.json`}async isVerified(){let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Dv():t?.identifier||t?.uuid;return!!(e&&e?.appId===n)}renderProGate(e){e.empty(),e.addClass(`thino-canvas-organizer-view`);let t=e.createDiv({cls:`super-panel super-enable-prompt`});t.createDiv({cls:`super-enable-icon`}).innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z" /></svg>`,t.createEl(`h3`,{cls:`super-enable-title`,text:`Thino Canvas`}),t.createEl(`p`,{cls:`super-enable-desc`,text:M(`This is a pro feature, please upgrade to pro version to use it.`)})}async onOpen(){let{containerEl:e}=this;if(e.empty(),e.addClass(`thino-canvas-organizer-view`),!f.Platform.isDesktop){this.renderProGate(e);return}if(!await this.isVerified()){this.renderProGate(e);return}let t=await yW.loadJson(this.app.vault.adapter,this.jsonPath),n=JSON.stringify(t??{nodes:[],edges:[]},null,2),r=this.app.vault.getAbstractFileByPath(kW);r instanceof f.TFile?await this.app.vault.modify(r,n):await this.app.vault.create(kW,n),this.root=$g.createRoot(e),this.root.render(U.createElement(TW,{app:this.app,plugin:this.plugin,canvasFilePath:kW,onCanvasReady:e=>{this.managedCanvas=e,this.hookCanvasEvents(e)}})),this.autoSaveTimer=window.setInterval(()=>this.persistToJson(),3e4)}async onClose(){this.autoSaveTimer!==null&&(clearInterval(this.autoSaveTimer),this.autoSaveTimer=null),this.saveDebounceTimer!==null&&(clearTimeout(this.saveDebounceTimer),this.saveDebounceTimer=null),this.unsubSaveRequested?.(),this.unsubSaveRequested=null,this.unsubMemoStore?.(),this.unsubMemoStore=null,this.syncThinoChanges(),await this.persistToJson(),this.managedCanvas&&=(this.managedCanvas.destroy(),null),this.root?.unmount(),this.root=null;try{let e=this.app.vault.getAbstractFileByPath(kW);e&&await this.app.vault.delete(e)}catch(e){console.warn(`[ThinoCanvasOrganizer] Could not delete working file:`,e)}}hookCanvasEvents(e){this.unsubSaveRequested=e.on(`save-requested`,()=>{this.saveDebounceTimer!==null&&clearTimeout(this.saveDebounceTimer),this.saveDebounceTimer=window.setTimeout(()=>{this.saveDebounceTimer=null,this.syncThinoChanges(),this.persistToJson()},AW)}),this.unsubMemoStore=F.subscribe(e=>e.memos,t=>{this.syncStoreToCanvas(e,t)})}syncThinoChanges(){let e=this.managedCanvas;if(!e?.isReady)return;let t=e.getData();if(!t)return;let n=F.getState().memos;for(let e of t.nodes){let t=e.thinoId;if(!t||typeof e.text!=`string`)continue;let r=n.find(e=>e.id===t);if(!r)continue;let i=e.text.trim();i!==r.content.trim()&&V.updateMemo(t,i).catch(e=>{console.error(`[ThinoCanvasOrganizer] Failed to sync thino ${t}:`,e)})}}syncStoreToCanvas(e,t){if(!e.isReady)return;let n=e.getData();if(!n)return;let r=!1;for(let e of n.nodes){let n=e.thinoId;if(!n||typeof e.text!=`string`)continue;let i=t.find(e=>e.id===n);i&&e.text.trim()!==i.content.trim()&&(e.text=i.content,r=!0)}r&&(e.setData(n),this.persistToJson())}async persistToJson(){if(this.managedCanvas?.isReady)try{await this.managedCanvas.saveJson(this.jsonPath)}catch(e){console.error(`[ThinoCanvasOrganizer] Failed to persist JSON:`,e)}}static async cleanupWorkingFile(e){try{let t=e.vault.getAbstractFileByPath(kW);t&&await e.vault.delete(t)}catch{}}};H(),Qr(),fa();var MW=class extends f.EditorSuggest{root;editor;cursor;plugin;memos=[];constructor(e,t){super(e),this.plugin=t,this.memos=V.getState().memos.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`)}checkInMemosView(e){let t=e.containerEl;return t&&(t.parentElement?.parentElement)?.classList.contains(`common-editor-inputer`)||!1}fuzzySearchItemsOptimized(e,t){let n=(0,f.prepareFuzzySearch)(e);return t.map(e=>{let t=n(e.content);return t?{item:e,match:t}:null}).filter(Boolean)}onTrigger(e,t){if(!this.checkInMemosView(t))return null;let n=t.getLine(e.line).slice(0,e.ch);if(n.lastIndexOf(`~`)===-1)return null;let r=n.slice(n.lastIndexOf(`~`)+1,e.ch);if(n[n.lastIndexOf(`~`)-1]!==` `&&n.lastIndexOf(`~`)!==0)return null;let i=r.trim();return this.memos=V.getState().memos.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`),{start:{line:e.line,ch:e.ch-i.length},end:e,query:i}}getSuggestions(e){return e.query?this.fuzzySearchItemsOptimized(e.query,this.memos).sort((e,t)=>t.match.score-e.match.score).map(e=>e.item).map(e=>({time:e.createdAt,id:e.id,content:e.content})):this.memos.map(e=>({time:e.createdAt,id:e.id,content:e.content}))}renderSuggestion(e,t){t.toggleClass(`thino-suggestion`,!0),t.createEl(`div`,{cls:`thino-suggestion-time`,text:e.time}),t.createEl(`div`,{cls:`thino-suggestion-container`}).createEl(`div`,{cls:`thino-suggestion-content`,text:e.content})}async addBlockRefToMemo(e,t){await sa(e,{id:e.id,hasId:t})}selectSuggestion(e){let t=V.getMemoById(e.id);if(!t){this.context.editor.replaceRange(`MARK: [@THINO](`+e.id+`)`,{line:this.context.end.line,ch:this.context.start.ch-1},this.context.end);return}t.sourceType===`DAILY`&&t.path?(this.context.editor.replaceRange(`MARK: [@THINO](`+e.id+`)`,{line:this.context.end.line,ch:this.context.start.ch-1},this.context.end),this.handleDailyNoteMemo(t,e)):this.context.editor.replaceRange(`MARK: [@THINO](`+e.id+`)`,{line:this.context.end.line,ch:this.context.start.ch-1},this.context.end)}async handleDailyNoteMemo(e,t){if(!e.path)return;let n=this.app,r=n.vault.getAbstractFileByPath(e.path);if(!(r instanceof f.TFile))return;let i=e.hasId;i||(i=P.randomId(6),await this.addBlockRefToMemo(e,i));let a=this.context.editor,o=a.getLine(this.context.end.line),s=`MARK: [@THINO](${t.id})`;if(o.includes(s)){let e=o.indexOf(s),c=n.fileManager.generateMarkdownLink(r,``,`#^`+i,t.id);a.replaceRange(`MARK: ${c}`,{line:this.context.end.line,ch:e},{line:this.context.end.line,ch:e+s.length})}}},NW=class extends f.EditorSuggest{root=null;editor=null;cursor=null;plugin;suppressCursor=null;committedSelection=!1;constructor(e,t){super(e),this.plugin=t,this.suggestEl.toggleClass(`thino-date-selector`,!0)}checkInMemosView(e){let t=e.containerEl;return t&&(t.parentElement?.parentElement)?.classList.contains(`common-editor-inputer`)||!1}onTrigger(e,t){if(!this.checkInMemosView(t))return null;if(this.suppressCursor){if(this.isSamePosition(e,this.suppressCursor))return null;this.suppressCursor=null}return t.getLine(e.line)[e.ch-1]===`@`?(this.cursor={...e},this.editor=t,{start:{line:e.line,ch:e.ch-1},end:e,query:``}):null}getSuggestions(){return[parseInt((0,f.moment)().startOf(`day`).format(`x`))]}renderSuggestion(e,t){t.empty();let n=$g.createRoot(t);this.root=n,n.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(Wb,{className:`editor-date-picker`,datestamp:e,handleDateStampChange:this.selectSuggestion.bind(this)})}))}selectSuggestion(e,t){if(t instanceof KeyboardEvent||t instanceof PointerEvent&&!t.target.closest(`.day-item`))return;this.committedSelection=!0,(this.app.workspace.getLeavesOfType(`thino_view`)[0]?.view)?.contentEl.find(`.action-btn.list-or-task.list`)?.click();let n=``,r=``;switch(this.plugin.settings.InsertDateFormat){case`Dataview`:n=`[due:: `,r=`]`;break;case`Tasks`:n=`📅 `;break}if(!this.editor||!this.cursor)return;let i=this.editor,a=this.cursor;i.replaceRange(n+(0,f.moment)(e).format(`YYYY-MM-DD`)+r,{line:a.line,ch:a.ch-1},a),this.close()}onClose(){!this.committedSelection&&this.cursor?this.suppressCursor={...this.cursor}:this.suppressCursor=null,this.committedSelection=!1,this.root?.unmount(),this.root=null,this.cursor=null,this.editor=null}isSamePosition(e,t){return e.line===t.line&&e.ch===t.ch}},PW={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 FW(){Object.keys(PW).forEach(e=>{(0,f.addIcon)(e,PW[e])})}var IW=typeof Buffer==`function`,LW=typeof TextDecoder==`function`?new TextDecoder:void 0,RW=typeof TextEncoder==`function`?new TextEncoder:void 0,zW=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),BW=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(zW),VW=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,HW=String.fromCharCode.bind(String),UW=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),WW=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),GW=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),KW=typeof btoa==`function`?e=>btoa(e):IW?e=>Buffer.from(e,`binary`).toString(`base64`):e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=zW[t>>18&63]+zW[t>>12&63]+zW[t>>6&63]+zW[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},qW=IW?e=>Buffer.from(e).toString(`base64`):e=>{let t=4096,n=[];for(let r=0,i=e.length;r<i;r+=t)n.push(HW.apply(null,e.subarray(r,r+t)));return KW(n.join(``))},JW=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?HW(192|t>>>6)+HW(128|t&63):HW(224|t>>>12&15)+HW(128|t>>>6&63)+HW(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return HW(240|t>>>18&7)+HW(128|t>>>12&63)+HW(128|t>>>6&63)+HW(128|t&63)}},YW=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,XW=e=>e.replace(YW,JW),ZW=IW?e=>Buffer.from(e,`utf8`).toString(`base64`):RW?e=>qW(RW.encode(e)):e=>KW(XW(e)),QW=(e,t=!1)=>t?WW(ZW(e)):ZW(e),$W=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,eG=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return HW((t>>>10)+55296)+HW((t&1023)+56320);case 3:return HW((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return HW((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},tG=e=>e.replace($W,eG),nG=typeof atob==`function`?e=>atob(GW(e)):IW?e=>Buffer.from(e,`base64`).toString(`binary`):e=>{if(e=e.replace(/\s+/g,``),!VW.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=BW[e.charAt(a++)]<<18|BW[e.charAt(a++)]<<12|(n=BW[e.charAt(a++)])<<6|(r=BW[e.charAt(a++)]),n===64?i.push(HW(t>>16&255)):r===64?i.push(HW(t>>16&255,t>>8&255)):i.push(HW(t>>16&255,t>>8&255,t&255));return i.join(``)},rG=IW?e=>UW(Buffer.from(e,`base64`)):e=>UW(nG(e).split(``).map(e=>e.charCodeAt(0))),iG=IW?e=>Buffer.from(e,`base64`).toString(`utf8`):LW?e=>LW.decode(rG(e)):e=>tG(nG(e)),aG=e=>GW(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),oG=e=>iG(aG(e));Cv(),Qr(),Mv(),H(),N();var sG=class extends f.Modal{plugin;settingTab;LocationList;target=``;insertTarget=``;verified;_forceCustomHeading=!1;constructor(e,t,n,r,i){if(super(e),this.verified=i,this.app=e,this.settingTab=t,this.plugin=n,this.LocationList=r,r.target===`ProcessEntriesBelow`)this.target=n.settings[r.target];else if(r.target===`JournalFolder`){let e=n.settings.JournalSettings;this.target={day:e?.daily,week:e?.weekly,month:e?.monthly,year:e?.yearly}[e?.granularity||`day`]?.folder||``}else this.target=n.settings.MemoOtherSaveLocation[r.target];this.insertTarget=n.settings.InsertAfter}updateValue=(0,f.debounce)(e=>{this.LocationList.value!==`DAILY`&&this.LocationList.value!==`MULTI`?this.target=e.trim()===``?`basic`:e.trim():this.target=e.trim()===``&&this.LocationList.value===`MULTI`?`Memos`:e.trim()},400,!0);onOpen(){this.display()}debounceDisplay=(0,f.debounce)(()=>this.display(),400,!0);async display(){let{contentEl:e}=this;this.contentEl.empty(),e.parentElement?.classList.add(`memo-save-location-modal`),this.titleEl.toggleClass(`modal-title`,!0),this.titleEl.setText(M(`Save type for Thino`)+` [${M(this.LocationList.value)}]`),(this.LocationList.value===`FILE`||this.LocationList.value===`CANVAS`)&&e.createDiv(`modal-desc`,e=>{e.setText(M(`You can set folder name with file name like "folder/file"`))}),this.LocationList.value===`MULTI`&&e.createDiv(`modal-desc`,e=>{e.setText(M(`You can set folder name like "folder1/folder2/folder3" to create sub-folder`))}),this.LocationList.value===`DAILY`&&e.createDiv(`modal-desc`,e=>{e.setText(M(`You can set target heading like "# Heading" to control data location`))}),this.LocationList.value===`JOURNAL`&&e.createDiv(`modal-desc`,e=>{e.setText(M(`Journal mode saves memos into periodic note files (daily/weekly/monthly/yearly)`))});let t=e.createDiv(`modal-setting`),n=this.LocationList.value===`DAILY`?M(`Process Memos below`):this.LocationList.value===`MULTI`?M(`Set the folder name`):M(`Set the filename`);if(this.LocationList.value===`DAILY`&&(new G(t,this.settingTab).setName(M(`Set thino insert place`)).setDesc(M(`Set where to insert thino content`)).addDropdown(async e=>{e.addOption(`end`,M(`End of the diary`)),e.addOption(`custom`,M(`Custom location`)),e.setValue(this.plugin.settings.InsertType).onChange(async e=>{this.plugin.settings.InsertType=e,this.settingTab.applySettingsUpdate(),this.debounceDisplay()})}),this.plugin.settings.InsertType===`custom`&&await this.addDailySettings(t),new G(t,this.settingTab).setName(M(`Set process target`)).setDesc(M(`You can set whole diary or only part of it`)).addDropdown(async e=>{e.addOption(`custom`,M(`Custom`)),e.addOption(`whole`,M(`Whole diary`)),e.setValue(this.plugin.settings.ProcessContentTarget).onChange(async e=>{this.plugin.settings.ProcessContentTarget=e,this.settingTab.applySettingsUpdate(),this.debounceDisplay()})})),this.LocationList.value===`JOURNAL`&&await this.addJournalSettings(t),this.LocationList.value!==`DAILY`&&this.LocationList.value!==`JOURNAL`||this.LocationList.value===`DAILY`&&this.plugin.settings.ProcessContentTarget!==`whole`){let e=new G(t,this.settingTab).setName(n).addText(e=>e.setPlaceholder(this.LocationList.value===`DAILY`?M(`# Heading`):M(`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 e=>{let t=this.LocationList.value===`CANVAS`?`.thino.canvas`:this.LocationList.value===`FILE`?`.thino.md`:``;this.updateValue(e.replace(/\.thino\.(canvas|md)/g,``)+t)}));this.LocationList.value===`DAILY`&&e.setDesc(M(`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`&&e.controlEl.createEl(`span`,{text:`${this.LocationList.value===`FILE`?`.thino.md`:`.thino.canvas`}`})}this.LocationList.value===`MULTI`&&new G(t,this.settingTab).setName(M(`Set file name after create thino`)).setDesc(M(`You can set file name after create thino. A input box will show when you create thino.`)).addToggle(e=>{e.setValue(this.plugin.settings.SetFileNameAfterCreate).onChange(async e=>{this.plugin.settings.SetFileNameAfterCreate=e,this.settingTab.debounceApplySettingsUpdate()})}),this.LocationList.value===`FILE`&&new G(t,this.settingTab).setName(M(`Set tag for file type file`)).setDesc(M("When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.")).addText(e=>{new tx(e.inputEl,e=>{this.plugin.settings.TagForFileTypeFiles=e.trim(),this.settingTab.debounceApplySettingsUpdate()}),e.setPlaceholder(M(`Please input the tag`)).setValue(this.plugin.settings.TagForFileTypeFiles).onChange(async e=>{this.plugin.settings.TagForFileTypeFiles=e.trim(),this.settingTab.debounceApplySettingsUpdate(),console.log(this.plugin.settings)})}),this.LocationList.value===`MULTI`&&(new G(t,this.settingTab).setName(M(`Set tag for multi type file`)).setDesc(M("When you set a tag here, Thino will index this file contains this tag and show it in the list. Don't need to add `#`.")).addText(e=>{new tx(e.inputEl,e=>{this.plugin.settings.TagForMultiTypeFiles=e.trim(),this.settingTab.debounceApplySettingsUpdate()}),e.setPlaceholder(M(`Please input the tag`)).setValue(this.plugin.settings.TagForMultiTypeFiles).onChange(async e=>{this.plugin.settings.TagForMultiTypeFiles=e.trim(),this.settingTab.debounceApplySettingsUpdate()})}),new G(t,this.settingTab).setName(M(`Ignore folders for multi type`)).setDesc(M(`Set folders to ignore when using multi type. Separate multiple folders with comma (,).`)).addText(e=>{e.setPlaceholder(M(`folder1,folder2/subfolder`)).setValue(this.plugin.settings.IgnoreFolderForMultiType.join(`,`)).onChange(async e=>{this.plugin.settings.IgnoreFolderForMultiType=e.split(`,`).map(e=>e.trim()).filter(e=>e!==``),this.settingTab.debounceApplySettingsUpdate()})}));let r=e.createDiv(`button-group`),i=r.createEl(`button`,{text:M(`Cancel`)}),a=r.createEl(`button`,{text:M(`Save`)});a.onclick=async()=>{if(!this.verified&&this.LocationList.value!==`DAILY`&&this.LocationList.value!==`JOURNAL`){this.close(),Sv();return}this.LocationList.target===`JournalFolder`||(this.LocationList.target===`ProcessEntriesBelow`?this.plugin.settings[this.LocationList.target]=this.target:this.plugin.settings.MemoOtherSaveLocation={...this.plugin.settings.MemoOtherSaveLocation,[this.LocationList.target]:this.target}),this.LocationList.value===`MULTI`&&P.checkDailyInMulti(this.plugin.settings),this.LocationList.target===`ProcessEntriesBelow`&&(this.plugin.settings.InsertAfter=this.insertTarget),this.settingTab.applySettingsUpdate(),setTimeout(()=>{V.updateTypeMemos(this.LocationList.value)},1e3),this.close()},i.onclick=async()=>{this.close()}}async addDailySettings(e){let t=L.getState().verifyState,n=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),r=f.Platform.isDesktop?await Dv():n.identifier||n.uuid,i=t&&t?.appId===r,a=(this.plugin.settings?.DifferentInsertTarget?`[${M(`List`)}] `:``)+M(`Insert after heading`);new G(e,this.settingTab).setName(a).setDesc(M(`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(e=>e.setPlaceholder(M(`# Heading`)).setValue(this.insertTarget).onChange(async e=>{this.insertTarget=e})),this.plugin.settings?.DifferentInsertTarget&&new G(e,this.settingTab).setName((this.plugin.settings?.DifferentInsertTarget?`[${M(`Task`)}] `:``)+M(`Insert after heading`)).setDesc(M(`Set the heading for the task type of thino, by default 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(e=>{e.setPlaceholder(M(`# Heading`)).setValue(this.plugin.settings.InsertAfterForTask).onChange(async e=>{this.plugin.settings.InsertAfterForTask=e,this.settingTab.applySettingsUpdate()})}),new G(e,this.settingTab).setName(M(`Different insert target for different type`)).setDesc(M(`Toggle this to set different insert target for different type of thino, like task or list type of thino`)).addToggle(e=>e.setValue(this.plugin.settings.DifferentInsertTarget).onChange(async e=>{if(!i){Sv();return}this.plugin.settings.DifferentInsertTarget=e,this.settingTab.applySettingsUpdate(),this.debounceDisplay()}))}updateJournalSettings(e){let t=JSON.parse(JSON.stringify(this.plugin.settings.JournalSettings));e(t),this.plugin.settings={...this.plugin.settings,JournalSettings:t}}async addJournalSettings(e){let t=this.plugin.settings.JournalSettings,n=t?.granularity||`day`;new G(e,this.settingTab).setName(M(`Journal granularity`)).setDesc(M(`Choose the period type for journal files`)).addDropdown(e=>{e.addOption(`day`,M(`Daily`)),e.addOption(`week`,M(`Weekly`)),e.addOption(`month`,M(`Monthly`)),e.addOption(`year`,M(`Yearly`)),e.setValue(n).onChange(async e=>{this.updateJournalSettings(t=>{t.granularity=e}),this.settingTab.applySettingsUpdate(),this.debounceDisplay()})});let r=[{value:`YYYY-MM-DD`,label:`2025-04-03`},{value:`YYYY-MM-DD dddd`,label:`2025-04-03 Thursday`},{value:`YYYY-MM-DD ddd`,label:`2025-04-03 Thu`},{value:`YYYY/MM/DD dddd`,label:`2025/04/03 Thursday`},{value:`MM-DD dddd`,label:`04-03 Thursday`},{value:`custom`,label:M(`Custom`)}],i=t?.headingDateFormat||`YYYY-MM-DD`,a=this._forceCustomHeading||!r.some(e=>e.value!==`custom`&&e.value===i),o=a?`custom`:i;if(new G(e,this.settingTab).setName(M(`Heading date format`)).setDesc(M(`Format for date headings in journal files`)).addDropdown(e=>{for(let t of r)e.addOption(t.value,t.label);e.setValue(o).onChange(async e=>{e===`custom`?(this._forceCustomHeading=!0,this.settingTab.applySettingsUpdate(),this.debounceDisplay()):(this._forceCustomHeading=!1,this.updateJournalSettings(t=>{t.headingDateFormat=e}),this.settingTab.applySettingsUpdate(),this.debounceDisplay())})}),a){let t=new G(e,this.settingTab).setName(M(`Custom heading format`)),n=t.descEl;n.addClass(`moment-format-sample`),t.addMomentFormat(e=>{e.setDefaultFormat(`YYYY-MM-DD`).setSampleEl(n).setValue(i).onChange(async e=>{this.updateJournalSettings(t=>{t.headingDateFormat=e.trim()||`YYYY-MM-DD`}),this.settingTab.debounceApplySettingsUpdate()})})}if(new G(e,this.settingTab).setName(M(`Use independent settings`)).setDesc(M(`When enabled, use custom folder/format/template instead of inheriting from daily notes plugin`)).addToggle(e=>{e.setValue(t?.useIndependentSettings||!1).onChange(async e=>{this.updateJournalSettings(t=>{t.useIndependentSettings=e}),this.settingTab.applySettingsUpdate(),this.debounceDisplay()})}),t?.useIndependentSettings){let r={day:{key:`daily`,label:`Daily`,defaultFormat:`YYYY-MM-DD`},week:{key:`weekly`,label:`Weekly`,defaultFormat:`gggg-[W]ww`},month:{key:`monthly`,label:`Monthly`,defaultFormat:`YYYY-MM`},year:{key:`yearly`,label:`Yearly`,defaultFormat:`YYYY`}}[n],i=t[r.key];new G(e,this.settingTab).setName(M(`Folder`)).setDesc(M(`Folder path for`)+` ${M(r.label)} `+M(`notes`)).addText(e=>{e.setPlaceholder(M(`e.g.`)+` Journal/`+r.label).setValue(i?.folder||``).onChange(async e=>{this.updateJournalSettings(t=>{t[r.key].folder=e.trim()}),this.settingTab.debounceApplySettingsUpdate()})}),new G(e,this.settingTab).setName(M(`Date format`)).setDesc(M(`Moment.js format for file names`)+` (${M(`default`)}: ${r.defaultFormat})`).addText(e=>{e.setPlaceholder(r.defaultFormat).setValue(i?.format||``).onChange(async e=>{this.updateJournalSettings(t=>{t[r.key].format=e.trim()}),this.settingTab.debounceApplySettingsUpdate()})}),new G(e,this.settingTab).setName(M(`Template`)).setDesc(M(`Template file path for new notes`)).addText(e=>{e.setPlaceholder(M(`e.g.`)+` Templates/Weekly`).setValue(i?.template||``).onChange(async e=>{this.updateJournalSettings(t=>{t[r.key].template=e.trim()}),this.settingTab.debounceApplySettingsUpdate()})})}}onClose(){let{contentEl:e}=this;e.empty()}};N();var cG=class extends f.Modal{plugin;settingTab;activeTabId=`general`;initialTabId=null;sidebarEl;modalContentEl;mobileTitleEl=null;debouncedSave;tabs=[{id:`general`,name:`General`,icon:`chef-hat`,category:`core`},{id:`thino`,name:`Thino`,icon:`Memos`,category:`core`},{id:`editor`,name:`Editor`,icon:`edit`,category:`core`},{id:`interface`,name:`Interface`,icon:`brush`,category:`appearance`},{id:`share`,name:`Share`,icon:`share-2`,category:`appearance`},{id:`tasks`,name:`Tasks`,icon:`check-square`,category:`features`},{id:`review`,name:`Review`,icon:`brain`,category:`features`},{id:`super`,name:`Super`,icon:`sparkles`,category:`features`},{id:`wechat`,name:`WeChat`,icon:`message-circle`,category:`features`},{id:`pro`,name:`Pro`,icon:`diamond`,category:`pro`},{id:`advanced`,name:`Advanced`,icon:`cog`,category:`pro`},{id:`about`,name:`About`,icon:`info`,category:`info`}];categories=[{id:`core`,name:M(`Core`)},{id:`appearance`,name:M(`Appearance`)},{id:`features`,name:M(`Features`)},{id:`pro`,name:`Pro`},{id:`info`,name:M(`Info`)}];constructor(e,t,n,r){super(e),this.plugin=t,this.settingTab=n,this.initialTabId=r??null,this.debouncedSave=(0,f.debounce)(async()=>{await this.plugin.saveSettings()},100,!0)}saveSettings(){this.debouncedSave()}onOpen(){let{contentEl:e,modalEl:t}=this;t.toggleClass(`mod-settings`,!0),t.toggleClass(`mod-sidebar-layout`,!0),t.toggleClass(`thino-settings-modal`,!0),e.empty(),e.addClass(`vertical-tabs-container`),this.mobileTitleEl=t.querySelector(`.modal-title`),f.Platform.isMobile&&(this.activeTabId=``),this.sidebarEl=e.createDiv({cls:`vertical-tab-header`}),this.modalContentEl=e.createDiv({cls:`vertical-tab-content-container`}),this.renderSidebar(),this.initializeView()}initializeView(){f.Platform.isMobile?this.initialTabId?this.openTab(this.initialTabId):this.updateMobileView():(this.activeTabId=this.initialTabId||`general`,this.renderSidebar(),this.renderContent())}onClose(){this.modalContentEl?.empty(),this.settingTab?.onModalClose()}renderSidebar(){this.sidebarEl.empty(),this.categories.forEach(e=>{let t=!!this.plugin.wechatService,n=this.tabs.filter(n=>n.category===e.id&&(n.id!==`wechat`||t));if(n.length===0)return;let r=this.sidebarEl.createDiv({cls:`vertical-tab-header-group`});r.createDiv({cls:`vertical-tab-header-group-title`,text:e.name});let i=r.createDiv({cls:`vertical-tab-header-group-items`});n.forEach(e=>{let t=i.createDiv({cls:`vertical-tab-nav-item tappable ${this.activeTabId===e.id?`is-active`:``}`});t.setAttribute(`data-tab-id`,e.id),(0,f.setIcon)(t.createDiv({cls:`vertical-tab-nav-item-icon`}),e.icon),t.createDiv({cls:`vertical-tab-nav-item-title`,text:M(e.name)}),(0,f.setIcon)(t.createDiv({cls:`vertical-tab-nav-item-chevron`}),`chevron-right`),t.addEventListener(`click`,()=>{this.openTab(e.id)})})})}openTab(e){this.activeTabId=e,this.sidebarEl.querySelectorAll(`.vertical-tab-nav-item`).forEach(t=>{t.getAttribute(`data-tab-id`)===e?t.addClass(`is-active`):t.removeClass(`is-active`)}),this.renderContent(),f.Platform.isMobile&&this.updateMobileView()}goBackToNavigation(){this.activeTabId=``,this.sidebarEl.querySelectorAll(`.vertical-tab-nav-item`).forEach(e=>{e.removeClass(`is-active`)}),this.modalContentEl.empty(),this.updateMobileView()}updateMobileView(){if(!f.Platform.isMobile)return;let e=this.activeTabId!==``;if(this.sidebarEl.toggleClass(`is-mobile-hidden`,e),this.modalContentEl.toggleClass(`is-mobile-hidden`,!e),this.mobileTitleEl)if(this.mobileTitleEl.empty(),e){let e=this.mobileTitleEl.createDiv({cls:`clickable-icon modal-setting-back-button mod-raised`});(0,f.setIcon)(e,`arrow-left`),e.addEventListener(`click`,()=>{this.goBackToNavigation()});let t=this.tabs.find(e=>e.id===this.activeTabId);this.mobileTitleEl.createSpan({text:t?M(t.name):`Thino`})}else this.mobileTitleEl.createSpan({text:`Thino`})}renderContent(){this.modalContentEl.empty();let e=this.tabs.find(e=>e.id===this.activeTabId);if(!e)return;let t=this.modalContentEl.createDiv({cls:`vertical-tab-content`}),n=t.createDiv({cls:`vertical-tab-content-header`}).createEl(`h2`,{cls:`vertical-tab-content-header-title`});(0,f.setIcon)(n.createSpan({cls:`vertical-tab-content-header-icon`}),e.icon),n.createSpan({text:M(e.name)});let r=t.createDiv({cls:`vertical-tab-content-body memos-settings`});this.settingTab.renderTabInModal(e.id,r)}},lG={tokenExpiresAt:0,userInfo:null},uG={accessToken:`pkmer-oauth-access-token`,refreshToken:`pkmer-oauth-refresh-token`,aiToken:`pkmer-oauth-ai-token`},dG={authorizationUrl:`https://api.pkmer.cn/api/v1/oauth/authorize`,tokenUrl:`https://api.pkmer.cn/api/v1/oauth/token`,userinfoUrl:`https://api.pkmer.cn/api/v1/oauth/userinfo`,clientId:`pkmer_832ebb0ff9264f7b3019262b47f625ed`,scopes:`openid profile email ai:token thino`,desktopRedirectUri:`http://localhost:10889/thino/callback`,mobileRedirectUri:`obsidian://thino`,callbackPort:10889};N(),i_(),H();var fG=class{constructor(e){this.props=e}display(){this.renderUserInfo(),this.renderSyncService()}renderUserInfo(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setHeading().setName(`👤 `+M(`User info`)).setTab(r),new G(e,t).setName(M(`User name`)).setDesc(M(`Set your user name here. 'Memos 😏' By default`)).setTab(r).addText(e=>e.setPlaceholder(`THINO 😉`).setValue(n.settings.UserName).onChange(async e=>{n.settings.UserName=e,t.applySettingsUpdate()})),new G(e,t).setTab(r).setName(M(`User icon`)).setDesc(M(`Set user icon for thino. You can input http/https link or file path in vault.`)).addText(e=>{new cE(e.inputEl),e.setPlaceholder(`URL`).setValue(n.settings.MomentsIcon).onChange(async e=>{n.settings.MomentsIcon=e,t.applySettingsUpdate()})}),new G(e,t).setTab(r).setName(M(`User quote`)).setDesc(M(`Set user quote for thino`)).addText(e=>e.setPlaceholder(`Input anything here`).setValue(n.settings.MomentsQuote).onChange(async e=>{n.settings.MomentsQuote=e,t.applySettingsUpdate()}))}renderSyncService(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;if(!r_())return;let i=!1,a=document.createDocumentFragment();a.createEl(`span`,{text:M(`Connect to PKMer Sync, you can check it in `)});let o=r_()?`https://pkmer.cn/products/UserProfile/#tab-21&activateSync`:`https://thino.pkmer.net/en/`;a.createEl(`a`,{text:M(`PKMer Sync`),attr:{href:o}}),new G(e,t).setHeading().setName(`☁ `+M(`Sync service`)).setTab(r),new G(e,t).setName(M(`Sync Thino via PKMer`)).setDesc(a).setTab(r).addButton(e=>{let r=n.app?.loadLocalStorage(`tokenForSync`);e.setButtonText(M(r?`Unlink`:`Link`)).onClick(async()=>{if(!r){r_()?window.open(`https://pkmer.cn/products/UserProfile/#tab-21&activateSync`,`_blank`):window.open(`https://thino.pkmer.net/en/`,`_blank`);return}if(!i){e.setButtonText(M(`Confirm?`)),i=!0;return}i=!1,r&&(n.app?.saveLocalStorage(`tokenForSync`,``),new f.Notice(M(`Remove successfully`))),R.setRefresh(!0),setTimeout(()=>{t.display()},20)})}),this.showSyncStatus()}showSyncStatus(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;n.app?.loadLocalStorage(`tokenForSync`)&&(new G(e,t).setName(M(`Save thino type when sync local`)).setDesc(M(`Set the default save thino type when sync local, FILE by default.`)).setTab(r).addDropdown(async e=>{e.addOption(`DAILY`,M(`DAILY`)),e.addOption(`FILE`,M(`FILE`)),e.addOption(`JOURNAL`,M(`JOURNAL`)),e.setValue(n.settings.saveThinoType).onChange(async e=>{n.settings.saveThinoType=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Sync Status`)).setDesc(M(`Start or stop sync`)).setTab(r).addButton(e=>{e.setButtonText(n.settings.startSync?M(`Stop`):M(`Start`)).onClick(async()=>{n.settings.startSync=!n.settings.startSync,await n.saveSettings(),R.setRefresh(!0),new f.Notice(n.settings.startSync?M(`Start sync successfully`):M(`Stop sync successfully`)),setTimeout(()=>{t.display()},200)})}),new G(e,t).setName(M(`Sync manually`)).setTab(r).addToggle(e=>{e.setValue(n.settings.SyncManually).onChange(async e=>{n.settings.SyncManually=e,t.applySettingsUpdate()})}))}};N(),Wr(),Rg();var pG=class{constructor(e){this.props=e}async display(){await this.renderDailyNotes(),this.renderFixedStrings(),await this.renderFileNameSettings(),this.renderViewArchiveSettings()}async renderDailyNotes(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props,i;new G(e,t).setHeading().setTab(r).setName(`📅 `+M(`Daily notes`)),new G(e,t).setName(M(`Default prefix when save thino`)).setDesc(M(`Set the default prefix when create memo, 'List' by default.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`List`,M(`List`)),i.addOption(`Task`,M(`Task`)),i.setValue(n.settings.DefaultPrefix).onChange(async e=>{n.settings.DefaultPrefix=e,t.applySettingsUpdate()})}),n.settings.EnabledLocationList.some(e=>e.value===`DAILY`)&&new G(e,t).setName(M(`Default time prefix for thino in daily notes`)).setDesc(M(`Set default time prefix for thino in daily notes.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`HH:mm`,`HH:mm`),i.addOption(`HH:mm:ss`,`HH:mm:ss`),i.setValue(n.settings.DefaultTimePrefix).onChange(async e=>{n.settings.DefaultTimePrefix=e,t.applySettingsUpdate()})})}renderFixedStrings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setHeading().setTab(r).setName(`🔗 `+M(`Fixed strings for thinos`)),new G(e,t).setName(M(`Use fixed strings for thinos`)).setDesc(M(`Enable to add fixed strings at the beginning or end of thinos.`)).setTab(r).addToggle(e=>e.setValue(n.settings.UseMemoFixedStrings).onChange(async e=>{n.settings.UseMemoFixedStrings=e,t.applySettingsUpdate(),setTimeout(()=>{t.display()},200)})),n.settings.UseMemoFixedStrings&&(new G(e,t).setName(M(`Fixed prefix for thinos`)).setDesc(M(`Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`)).setTab(r).addText(e=>e.setValue(n.settings.MemoFixedPrefix).onChange(async e=>{n.settings.MemoFixedPrefix=e,t.applySettingsUpdate()})),new G(e,t).setName(M(`Fixed suffix for thinos`)).setDesc(M(`Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`)).setTab(r).addText(e=>e.setValue(n.settings.MemoFixedSuffix).onChange(async e=>{n.settings.MemoFixedSuffix=e,t.applySettingsUpdate()})))}async renderFileNameSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props,a=[{value:`DAILY`,target:`ProcessEntriesBelow`,insert:`InsertAfter`},{value:`CANVAS`,target:`MemoDefaultCanvasPath`},{value:`MULTI`,target:`MemoDefaultMultiFilePath`},{value:`FILE`,target:`MemoDefaultSingleFilePath`},{value:`JOURNAL`,target:`JournalFolder`}],o=document.createDocumentFragment(),s=o.createEl(`div`,{cls:`memo-save-location-desc`});for(let e of a){let r=s.createEl(`div`,{cls:`memo-save-location-desc-item ${e.value}`});(0,f.setIcon)(r.createEl(`span`,{cls:`memo-save-location-desc-item-icon`}),Ur.find(t=>t.title===e.value)?.icon||``);let a=e.value===`DAILY`?`${M(e.value)} (Deprecated)`:`${M(e.value)}`;r.createEl(`span`,{cls:`memo-save-location-desc-item-desc`,text:a});let o=r.createEl(`span`,{cls:`memo-save-location-desc-item-toggle`}),c=r.createEl(`span`,{cls:`memo-save-location-desc-item-setting`}),l=e.value===`DAILY`||e.value===`JOURNAL`;l||r.createEl(`span`,{cls:[`memo-save-location-desc-item-pro`,`user-pro-badge`],text:`PRO`}),new f.ToggleComponent(o).setValue(this.checkInList(e.value)).onChange(async r=>{if(!i&&!l){new f.Notice(M(`Pro feature, please activate Pro`));return}r?(await V.updateTypeMemos(e.value),n.settings.EnabledLocationList=[...n.settings.EnabledLocationList,e]):(await V.removeTypeMemos(e.value),n.settings.EnabledLocationList=n.settings.EnabledLocationList.filter(t=>t.value!==e.value)),n.settings.EnabledLocationList.length===1&&(n.settings.MemoSaveLocation=e.value),t.applySettingsUpdate(),setTimeout(()=>{t.display()},500)}).setDisabled(n.settings.EnabledLocationList.length===1&&this.checkInList(e.value)),new f.ExtraButtonComponent(c).setIcon(`settings`).onClick(()=>{new sG(t.app,t,n,e,i).open()})}let c=new G(e,t).setName(M(`Save type for Thino`)).setDesc(o).setTab(r);c.settingEl.toggleClass(`memo-save-location-setting`,!0),c.nameEl.toggleClass(`memo-save-location-title`,!0)}renderViewArchiveSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(M(`View archive in random review`)).setDesc(M(`View archived thinos in random review. True by default`)).setTab(r).addToggle(e=>{e.setValue(n.settings.ViewArchiveInRandomReview).onChange(async e=>{n.settings.ViewArchiveInRandomReview=e,t.applySettingsUpdate()})})}checkInList(e){return this.props.plugin.settings.EnabledLocationList.find(t=>t.value===e)!==void 0}};N();var mG=class{constructor(e){this.props=e}async display(){await this.renderThemeSettings(),this.renderInterfaceDetails(),this.renderHeightSettings(),await this.renderEditorLocation()}async renderThemeSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(M(`Theme for Thino`)).setDesc(M(`Set the theme for Thino`)).setTab(r).addDropdown(async e=>{e.addOption(`modern`,`Modern`),e.addOption(`classic`,`Classic`),e.setValue(n.settings.DefaultThemeForThino).onChange(async e=>{n.settings.DefaultThemeForThino=e,t.applySettingsUpdate()})})}renderInterfaceDetails(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setTab(r).setHeading().setName(`🎨 `+M(`Interface Details`));let i;new G(e,t).setName(M(`Heatmap Color Scheme`)).setDesc(M(`Set different color scheme for heatmap.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`default`,M(`Default`)),i.addOption(`gray`,M(`Gray`)),i.addOption(`grass`,M(`Grass`)),i.addOption(`flame`,M(`Flame`)),i.addOption(`olive`,M(`Olive`)),i.addOption(`ice`,M(`Ice`)),i.addOption(`magenta`,M(`Magenta`)),i.setValue(n.settings.HeatmapColorScheme).onChange(async e=>{n.settings.HeatmapColorScheme=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Save Memo button label`)).setDesc(M(`The text shown on the save Memo button in the UI. 'NOTEIT' by default.`)).setTab(r).addText(e=>e.setPlaceholder(W3.SaveMemoButtonLabel).setValue(n.settings.SaveMemoButtonLabel).onChange(async e=>{n.settings.SaveMemoButtonLabel=e,t.applySettingsUpdate()})),!f.Platform.isMobile&&new G(e,t).setName(M(`Always Show Leaf Sidebar on PC`)).setDesc(M(`Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.`)).setTab(r).addToggle(e=>e.setValue(n.settings.ShowLeftSideBar).onChange(async e=>{n.settings.ShowLeftSideBar=e,t.applySettingsUpdate()})),this.renderUseMobileViewDefaultHeader(),this.renderRememberImageSettings(),this.renderScrollToTopSettings()}renderUseMobileViewDefaultHeader(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(M(`Use default header in mobile view`)).setDesc(M(`Use default header in mobile view of thino rather than custom header.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.useMobileViewDefaultHeader).onChange(async e=>{n.settings.useMobileViewDefaultHeader=e,t.applySettingsUpdate()})})}renderRememberImageSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(M(`Zoom image by default`)).setDesc(M(`Zoom image by default when viewing image.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.ZoomImageWhenViewing).onChange(async e=>{n.settings.ZoomImageWhenViewing=e,t.applySettingsUpdate()})})}renderScrollToTopSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(M(`Show scroll to top button`)).setDesc(M(`Show scroll to top button. True by default`)).setTab(r).addToggle(e=>{e.setValue(n.settings.ShowScrollToTopButton).onChange(async e=>{n.settings.ShowScrollToTopButton=e,t.applySettingsUpdate()})})}renderHeightSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(M(`Max height for collapse`)).setDesc(M(`The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)`)).setTab(r).addText(e=>e.setPlaceholder(W3.ThinoMaxHeight.toString()).setValue(n.settings.ThinoMaxHeight.toString()).onChange(async e=>{if(Number(e)<80&&Number(e)!==0){new f.Notice(M(`The value should be greater than`)+`80`);return}n.settings.ThinoMaxHeight=Number(e),t.debounceApplySettingsUpdate()})),new G(e,t).setName(M(`Thino height when collapsed`)).setDesc(M(`The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)`)).setTab(r).addText(e=>e.setPlaceholder(W3.ThinoCollapsedHeight.toString()).setValue(n.settings.ThinoCollapsedHeight.toString()).onChange(async e=>{if(Number(e)<40&&Number(e)!==0){new f.Notice(M(`The value should be greater than`)+`40`);return}n.settings.ThinoCollapsedHeight=Number(e),t.debounceApplySettingsUpdate()}))}async renderEditorLocation(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props,i;f.Platform.isMobile&&(new G(e,t).setName(M(`Default editor position on mobile`)).setDesc(M(`Set the default editor position on Mobile, 'Top' by default.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`Top`,M(`Top`)),i.addOption(`Bottom`,M(`Bottom`)),i.setValue(n.settings.DefaultEditorLocation).onChange(async e=>{n.settings.DefaultEditorLocation=e,t.applySettingsUpdate(),setTimeout(()=>{t.display()},200)})}),n.settings.DefaultEditorLocation!==`Top`&&new G(e,t).setName(M(`Use button to show editor on mobile`)).setDesc(M(`Set a float button to call editor on mobile. Only when editor located at the bottom works.`)).setTab(r).addToggle(e=>e.setValue(n.settings.UseButtonToShowEditor).onChange(async e=>{n.settings.UseButtonToShowEditor=e,t.applySettingsUpdate()})))}};N();var hG=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setHeading().setTab(r).setName(`📝 `+M(`Editor`)),new G(e,t).setName(M(`Use Tags In Vault`)).setDesc(M(`Use tags in vault rather than only in Memos. False by default.`)).setTab(r).addToggle(e=>e.setValue(n.settings.UseVaultTags).onChange(async e=>{n.settings.UseVaultTags=e,t.applySettingsUpdate()}));let i;new G(e,t).setName(M(`Default insert date format`)).setDesc(M(`Set the default date format when insert date by @, 'Tasks' by default.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`Tasks`,`Tasks`),i.addOption(`Dataview`,`Dataview`),i.setValue(n.settings.InsertDateFormat).onChange(async e=>{n.settings.InsertDateFormat=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Focus on editor when open`)).setDesc(M(`Focus on editor when open. True by default.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.FocusOnEditor).onChange(async e=>{n.settings.FocusOnEditor=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Show clipboard paste button on focus`)).setDesc(M(`When focusing on the editor, detect clipboard content and show a "Paste as Thino" button. True by default.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.ShowClipboardOnFocus).onChange(async e=>{n.settings.ShowClipboardOnFocus=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Default Editor Mode`)).setDesc(M(`Live-Preview Mode OR Source Mode.`)).setTab(r).addDropdown(async e=>{i=e,i.addOption(`obsidian`,M(`Live-preview`)),i.addOption(`memos`,M(`Source`)),i.setValue(n.settings.EditorType).onChange(async e=>{n.settings.EditorType=e,t.applySettingsUpdate()})})}};N();var gG=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(M(`Show Tasks Label`)).setDesc(M(`Show tasks label near the time text. False by default`)).setTab(r).addToggle(e=>e.setValue(n.settings.ShowTaskLabel).onChange(async e=>{n.settings.ShowTaskLabel=e,t.applySettingsUpdate()})),new G(e,t).setName(M(`Append completed date when task done in thino`)).setDesc(M(`Append completed date when task done in thino. False by default`)).setTab(r).addToggle(e=>e.setValue(n.settings.AppendDateWhenTaskDone).onChange(async e=>{n.settings.AppendDateWhenTaskDone=e,t.applySettingsUpdate()}))}};N(),Cv();var _G=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,tabName:n}=this.props;new G(e,t).setHeading().setTab(n).setName(`📄 `+M(`Copy filtered results`)),this.renderCopyMemosSettings(),new G(e,t).setHeading().setTab(n).setName(`🖼 `+M(`Share image`)),this.renderShareMemosSettings(),f.Platform.isMobile&&this.renderShareToThinosSettings()}renderCopyMemosSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setTab(r).setName(M(`Show Time When Copy Results`)).setDesc(M(`Show time when you copy results, like 12:00. Copy time by default.`)).addToggle(e=>e.setValue(n.settings.ShowTime).onChange(async e=>{n.settings.ShowTime=e,t.applySettingsUpdate()})),new G(e,t).setTab(r).setName(M(`Show Date When Copy Results`)).setDesc(M(`Show date when you copy results, like [[2022-01-01]]. Copy date by default.`)).addToggle(e=>e.setValue(n.settings.ShowDate).onChange(async e=>{n.settings.ShowDate=e,t.applySettingsUpdate(),t.debounceDisplay()})),n.settings.ShowDate&&new G(e,t).setTab(r).setName(M(`Add Blank Line Between Different Date`)).setDesc(M(`Add blank line when copy result with date. No blank line by default.`)).addToggle(e=>e.setValue(n.settings.AddBlankLineWhenDate).onChange(async e=>{n.settings.AddBlankLineWhenDate=e,t.applySettingsUpdate()}))}renderShareMemosSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setTab(r).setName(M(`Custom height for Thino content`)).setDesc(M(`Set custom height for Thino content. Like 200px or 20rem`)).addText(e=>e.setPlaceholder(M(`Input height`)).setValue(n.settings.MinHeightForShare).onChange(async e=>{n.settings.MinHeightForShare=e,t.debounceApplySettingsUpdate()})),this.renderCustomMemoFooter(),new G(e,t).setName(M(`Custom Background Image`)).setDesc(M(`Set custom background image.`)).setTab(r).addToggle(e=>e.setValue(n.settings.SetCustomBackgroundImage).onChange(async e=>{n.settings.SetCustomBackgroundImage=e,t.applySettingsUpdate(),setTimeout(()=>{t.display()},100)})),n.settings.SetCustomBackgroundImage&&(new G(e,t).setName(M(`Background Image in Light Theme`)+` [${M(`Modern`)}]`).setDesc(M(`Set background image in light theme. Set something like "Daily/one.png"`)).setTab(r).addText(e=>{new cE(e.inputEl),e.setPlaceholder(W3.DefaultLightBackgroundImage).setValue(n.settings.DefaultLightBackgroundImage).onChange(async e=>{n.settings.DefaultLightBackgroundImage=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Background Image in Dark Theme`)+` [${M(`Modern`)}]`).setDesc(M(`Set background image in dark theme. Set something like "Daily/one.png"`)).setTab(r).addText(e=>{new cE(e.inputEl),e.setPlaceholder(W3.DefaultDarkBackgroundImage).setValue(n.settings.DefaultDarkBackgroundImage).onChange(async e=>{n.settings.DefaultDarkBackgroundImage=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Background Image in Light Theme`)+` [${M(`Clean`)}]`).setDesc(M(`Set background image in light theme. Set something like "Daily/one.png"`)).setTab(r).addText(e=>{new cE(e.inputEl),e.setPlaceholder(W3.DefaultLightBackgroundImageForClean).setValue(n.settings.DefaultLightBackgroundImageForClean).onChange(async e=>{n.settings.DefaultLightBackgroundImageForClean=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Background Image in Dark Theme`)+` [${M(`Clean`)}]`).setDesc(M(`Set background image in dark theme. Set something like "Daily/one.png"`)).setTab(r).addText(e=>{new cE(e.inputEl),e.setPlaceholder(W3.DefaultDarkBackgroundImageForClean).setValue(n.settings.DefaultDarkBackgroundImageForClean).onChange(async e=>{n.settings.DefaultDarkBackgroundImageForClean=e,t.applySettingsUpdate()})}))}renderCustomMemoFooter(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(M(`Custom Memo Footer`)).setDesc(M(`Set custom memo footer.`)).setTab(r).addToggle(e=>e.setValue(n.settings.SetCustomMemoFooter).onChange(async e=>{n.settings.SetCustomMemoFooter=e,t.applySettingsUpdate(),setTimeout(()=>{t.display()},100)})),n.settings.SetCustomMemoFooter&&new G(e,t).setName(M(`Share Memos Image Footer Start`)).setDesc(M(`Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default`)).setTab(r).addText(e=>e.setPlaceholder(W3.ShareFooterStart).setValue(n.settings.ShareFooterStart).onChange(async e=>{n.settings.ShareFooterStart=e,t.applySettingsUpdate()}))}renderShareToThinosSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props;new G(e,t).setHeading().setTab(r).setName(`💎 `+M(`Pro features`)),new G(e,t).setTab(r).setName(M(`Append/prepend text when share to Thino`)).addToggle(e=>{e.setValue(n.settings.ShareToThinoWithText).onChange(async e=>{if(!i){Sv();return}n.settings.ShareToThinoWithText=e,t.applySettingsUpdate(),t.debounceDisplay()})}),n.settings.ShareToThinoWithText&&(new G(e,t).setTab(r).setName(M(`Prepend Text Action`)).addDropdown(e=>{e.addOption(`none`,M(`None`)),e.addOption(`preset`,M(`Preset`)),e.addOption(`input`,M(`Input`)),e.addOption(`selectTags`,M(`Select Tags`)),e.setValue(n.settings.SharePrependType).onChange(async e=>{n.settings.SharePrependType=e,t.applySettingsUpdate(),t.debounceDisplay()})}),n.settings.SharePrependType===`preset`&&new G(e,t).setTab(r).setName(M(`Prepend text when share to Thino`)).addText(e=>{e.setPlaceholder(M(`Input anything here`)).setValue(n.settings.ShareToThinoWithTextPrepend).onChange(async e=>{n.settings.ShareToThinoWithTextPrepend=e,t.applySettingsUpdate()})}),new G(e,t).setTab(r).setName(M(`Append Text Action`)).addDropdown(e=>{e.addOption(`none`,M(`None`)),e.addOption(`preset`,M(`Preset`)),e.addOption(`input`,M(`Input`)),e.addOption(`selectTags`,M(`Select Tags`)),e.setValue(n.settings.ShareAppendType).onChange(async e=>{n.settings.ShareAppendType=e,t.applySettingsUpdate(),t.debounceDisplay()})}),n.settings.ShareAppendType===`preset`&&new G(e,t).setTab(r).setName(M(`Append text when share to Thino`)).addText(e=>{e.setPlaceholder(M(`Input anything here`)).setValue(n.settings.ShareToThinoWithTextAppend).onChange(async e=>{n.settings.ShareToThinoWithTextAppend=e,t.applySettingsUpdate()})}),new G(e,t).setTab(r).setName(M(`Add newline when append/prepend text`)).addDropdown(async e=>{e.addOption(`prepend`,M(`Prepend`)),e.addOption(`append`,M(`Append`)),e.addOption(`both`,M(`Both`)),e.addOption(`none`,M(`None`)),e.setValue(n.settings.ShareToThinoWithTextNewline).onChange(async e=>{n.settings.ShareToThinoWithTextNewline=e,t.applySettingsUpdate()})}))}};N();var vG=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setTab(r).setName(M(`About`)+` Thino`).setHeading(),new G(e,t).setTab(r).setName(M(`Version`)).setDesc(`Thino v${n.manifest.version}`),new G(e,t).setTab(r).setName(M(`Documentation`)).setDesc(M(`View the documentation for this plugin`)).addButton(e=>{e.setButtonText(M(`Open Documentation`)).onClick(()=>{window.open(`https://github.com/quorafind/obsidian-thino/`)})}),new G(e,t).setTab(r).setName(M(`Change log`)).setDesc(M(`View the change log for this plugin`)).addButton(e=>{e.setButtonText(M(`Open change log`)).onClick(()=>{o_(t.app)})}),this.renderUpdateMessageSettings()}renderUpdateMessageSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props;new G(e,t).setName(M(`Show release notes`)).setDesc(M(`Show release notes when Thino is updated. True by default`)).setTab(r).addToggle(e=>e.setValue(n.settings.ShowUpdateMessage).onChange(async e=>{n.settings.ShowUpdateMessage=e,t.applySettingsUpdate()}))}};ZH(),uU(),N();var yG=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props,i=UH();new G(e,t).setHeading().setName(M(`FSRS Algorithm`)).setTab(r),new G(e,t).setName(M(`Request retention`)).setDesc(M(`Target probability of recall (0.7-0.99). Higher = more reviews, better retention.`)).setTab(r).addText(e=>{e.setPlaceholder(String(i.request_retention)).setValue(String(n.settings.fsrsRequestRetention)),e.inputEl.type=`number`,e.inputEl.step=`0.01`,e.inputEl.min=`0.7`,e.inputEl.max=`0.99`,e.inputEl.addEventListener(`blur`,()=>{let r=parseFloat(e.inputEl.value);!isNaN(r)&&r>=.7&&r<=.99?(n.settings.fsrsRequestRetention=r,t.applySettingsUpdate(),this.rebuildFSRS()):e.setValue(String(n.settings.fsrsRequestRetention))})}),new G(e,t).setName(M(`Maximum interval (days)`)).setDesc(M(`The maximum number of days between reviews. Default: 36500 (100 years).`)).setTab(r).addText(e=>{e.setPlaceholder(String(i.maximum_interval)).setValue(String(n.settings.fsrsMaximumInterval)),e.inputEl.type=`number`,e.inputEl.min=`1`,e.inputEl.max=`36500`,e.inputEl.addEventListener(`blur`,()=>{let r=parseInt(e.inputEl.value);!isNaN(r)&&r>=1&&r<=36500?(n.settings.fsrsMaximumInterval=r,t.applySettingsUpdate(),this.rebuildFSRS()):e.setValue(String(n.settings.fsrsMaximumInterval))})}),new G(e,t).setName(M(`Enable fuzz`)).setDesc(M(`Add small random variation to review intervals to prevent clustering.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.fsrsEnableFuzz).onChange(async e=>{n.settings.fsrsEnableFuzz=e,t.applySettingsUpdate(),this.rebuildFSRS()})}),new G(e,t).setName(M(`Enable short-term scheduling`)).setDesc(M(`Use (re)learning steps for short-term review intervals.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.fsrsEnableShortTerm).onChange(async e=>{n.settings.fsrsEnableShortTerm=e,t.applySettingsUpdate(),this.rebuildFSRS()})}),new G(e,t).setHeading().setName(M(`Review Limits`)).setTab(r),new G(e,t).setName(M(`Daily review limit`)).setDesc(M(`Maximum number of cards to review per day. Default: 100.`)).setTab(r).addText(e=>{e.setPlaceholder(`100`).setValue(String(n.settings.fsrsDailyLimit)),e.inputEl.type=`number`,e.inputEl.min=`1`,e.inputEl.max=`9999`,e.inputEl.addEventListener(`blur`,()=>{let r=parseInt(e.inputEl.value);!isNaN(r)&&r>=1?(n.settings.fsrsDailyLimit=r,t.applySettingsUpdate()):e.setValue(String(n.settings.fsrsDailyLimit))})}),new G(e,t).setHeading().setName(M(`Model Weights`)).setTab(r),new G(e,t).setName(M(`FSRS weights (w)`)).setDesc(M(`Custom FSRS-6 model weights (21 numbers, comma-separated). Leave empty to use defaults.`)).setTab(r).addText(e=>{let r=n.settings.fsrsWeights;e.setPlaceholder(M(`Default FSRS-6 weights`)).setValue(r.length>0?r.join(`, `):``),e.inputEl.style.width=`100%`,e.inputEl.addEventListener(`blur`,()=>{let i=e.inputEl.value.trim();if(!i){n.settings.fsrsWeights=[],t.applySettingsUpdate(),this.rebuildFSRS();return}let a=i.split(`,`).map(e=>parseFloat(e.trim()));a.length===21&&a.every(e=>!isNaN(e))?(n.settings.fsrsWeights=a,t.applySettingsUpdate(),this.rebuildFSRS()):(new f.Notice(M(`Weights must be exactly 21 comma-separated numbers`)),e.setValue(r.length>0?r.join(`, `):``))})}),new G(e,t).setName(M(`Reset to defaults`)).setDesc(M(`Reset all FSRS parameters to their default values`)).setTab(r).addButton(e=>{e.setButtonText(M(`Reset`)).onClick(async()=>{n.settings.fsrsRequestRetention=i.request_retention,n.settings.fsrsMaximumInterval=i.maximum_interval,n.settings.fsrsEnableFuzz=i.enable_fuzz,n.settings.fsrsEnableShortTerm=i.enable_short_term,n.settings.fsrsWeights=[],n.settings.fsrsDailyLimit=100,t.applySettingsUpdate(),this.rebuildFSRS(),t.debounceDisplay()})})}rebuildFSRS(){let{plugin:e}=this.props,t={request_retention:e.settings.fsrsRequestRetention,maximum_interval:e.settings.fsrsMaximumInterval,enable_fuzz:e.settings.fsrsEnableFuzz,enable_short_term:e.settings.fsrsEnableShortTerm};e.settings.fsrsWeights.length===21&&(t.w=e.settings.fsrsWeights),tU(t)}};P_(),N(),Cv(),Dg(),i_();var bG=class{constructor(e){this.props=e}async display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props,a=B.getState();if(new G(e,t).setName(M(`Enable Super`)).setDesc(M(`AI-powered semantic search and chat for your thinos`)).setTab(r).addToggle(e=>e.setValue(n.settings.superEnabled).onChange(async r=>{if(r&&!i){Sv(),e.setValue(!1);return}n.settings.superEnabled=r,B.getState().setEnabled(r),await n.saveSettings(),t.debounceDisplay()})),n.settings.superEnabled){if(new G(e,t).setHeading().setName(M(`Embedding`)).setTab(r),new G(e,t).setName(M(`Embedding provider`)).setTab(r).addDropdown(e=>{f.Platform.isDesktop&&e.addOption(`local`,`Local (Transformers.js)`),e.addOption(`openai`,`OpenAI`),e.setValue(a.activeEmbeddingProvider).onChange(e=>{B.getState().setActiveEmbeddingProvider(e)})}),a.activeEmbeddingProvider===`local`){new G(e,t).setName(M(`Embedding model`)).setDesc(M(`HuggingFace model name for local embeddings`)).setTab(r).addText(e=>e.setPlaceholder(`Xenova/paraphrase-multilingual-MiniLM-L12-v2`).setValue(a.embeddingModel).onChange(e=>{B.getState().setEmbeddingModel(e)}));let n=`https://huggingface.co/${a.embeddingModel||`Xenova/paraphrase-multilingual-MiniLM-L12-v2`}/tree/main`,i=a.modelReady,o=new G(e,t).setName(M(`Import embedding model`)).setTab(r).addButton(e=>{e.setButtonText(M(`Select folder`)).onClick(async()=>{let n=await this.selectLocalModelFolder();if(n)try{e.setDisabled(!0),e.setButtonText(M(`Importing...`));let r=await av.importLocalModel(n);r.missing.length===0?new f.Notice(M(`Successfully imported model files`)+` (${r.imported.length} files)`):new f.Notice(M(`Missing model files`)+`: ${r.missing.join(`, `)}`),t.debounceDisplay()}catch(e){new f.Notice(M(`Import failed`)+`: ${e?.message||`Unknown error`}`)}finally{e.setDisabled(!1),e.setButtonText(M(`Select folder`))}})}).descEl;o.empty(),o.createSpan({text:i?`✅ `+M(`Model installed`):`⚠️ `+M(`Model not installed`)}),o.createEl(`br`),o.createSpan({text:M(`Required files`)+`: config.json, tokenizer.json, tokenizer_config.json, onnx/model_quantized.onnx`}),o.createEl(`br`),o.createSpan({text:M(`Download from`)+`: `}),o.createEl(`a`,{text:n,href:n,cls:`external-link`});let s=a.wasmReady,c=`https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.8.1/dist/`,l=new G(e,t).setName(M(`Import WASM runtime`)).setTab(r).addButton(e=>{e.setButtonText(M(`Select folder`)).onClick(async()=>{let n=await this.selectLocalModelFolder();if(n)try{e.setDisabled(!0),e.setButtonText(M(`Importing...`));let r=await av.importLocalWasm(n);r.missing.length===0?new f.Notice(M(`Successfully imported WASM runtime`)+` (${r.imported.length} files)`):new f.Notice(M(`Missing WASM files`)+`: ${r.missing.join(`, `)}`),t.debounceDisplay()}catch(e){new f.Notice(M(`Import failed`)+`: ${e?.message||`Unknown error`}`)}finally{e.setDisabled(!1),e.setButtonText(M(`Select folder`))}})}).descEl;l.empty(),l.createSpan({text:s?`✅ `+M(`WASM runtime installed`):`⚠️ `+M(`WASM runtime not installed`)}),l.createEl(`br`),l.createSpan({text:M(`Required files`)+`: ort-wasm-simd-threaded.jsep.mjs, ort-wasm-simd-threaded.jsep.wasm, transformers.min.js`}),l.createEl(`br`),l.createSpan({text:M(`Download from`)+`: `}),l.createEl(`a`,{text:c,href:c,cls:`external-link`})}if(new G(e,t).setHeading().setName(M(`Chat Completion`)).setTab(r),new G(e,t).setName(M(`Chat completion provider`)).setTab(r).addDropdown(e=>{e.addOption(`openai`,`OpenAI / Compatible`),e.addOption(`anthropic`,`Anthropic`),r_()&&e.addOption(`pkmer`,`PKMer AI`),e.setValue(a.activeCompletionProvider).onChange(e=>{B.getState().setActiveCompletionProvider(e),t.debounceDisplay()})}),a.activeCompletionProvider===`pkmer`){let i=!!n.settings.general?.userInfo?.sub;!i&&a.providers.pkmer?.apiKey&&B.getState().updateProvider(`pkmer`,{type:`pkmer`,enabled:!1,apiKey:``,quotaInfo:void 0}),new G(e,t).setHeading().setName(`PKMer AI`).setTab(r);let o=B.getState().providers.pkmer||{},s=i&&!!o.apiKey;s?o.quotaInfo&&new G(e,t).setName(M(`Quota`)).setDesc(`${o.quotaInfo.remaining} / ${o.quotaInfo.total} calls`).setTab(r):new G(e,t).setName(M(`Quota`)).setDesc(M(`Login with PKMer account to activate PKMer AI features`)).setTab(r).addButton(e=>{e.setButtonText(M(`Login with PKMer`)).onClick(async()=>{e.setDisabled(!0);try{if(await n.pkmerAuth.login(),await n.verify()){let e=n.pkmerAuth.aiToken;if(e){let t=5e5,r=n.settings.general?.userInfo?.ai_quota,i=B.getState();i.updateProvider(`pkmer`,{type:`pkmer`,enabled:!0,apiKey:e,baseUrl:`https://newapi.pkmer.cn`,completionModel:i.providers.pkmer?.completionModel||`03-agent`,quotaInfo:r?{remaining:Math.floor(r.remainingQuota/t),total:Math.floor(r.quota/t)}:void 0})}t.debounceDisplay()}}catch(e){new f.Notice(`${e?.message||`Login failed`}`)}finally{e.setDisabled(!1)}})}),new G(e,t).setName(M(`Model`)).setTab(r).addDropdown(e=>{for(let t of ev)e.addOption(t.id,`${t.displayName} \u2014 ${t.description} (${t.price}/call)`);e.setValue(o.completionModel||`03-agent`).onChange(e=>{B.getState().updateProvider(`pkmer`,{completionModel:e})}),s&&tv(o.apiKey,!0).then(t=>{let n=e.getValue();e.selectEl.empty();for(let n of t)e.addOption(n.id,`${n.displayName} \u2014 ${n.description} (${n.price}/call)`);e.setValue(n)})})}else{new G(e,t).setHeading().setName(`OpenAI / Compatible`).setTab(r);let n=a.providers.openai||{};new G(e,t).setName(`API Key`).setTab(r).addText(e=>{e.inputEl.type=`password`,e.setPlaceholder(`sk-...`).setValue(n.apiKey||``).onChange(e=>{B.getState().updateProvider(`openai`,{type:`openai`,enabled:!0,apiKey:e})})}),new G(e,t).setName(`Base URL`).setTab(r).addText(e=>e.setPlaceholder(`https://api.openai.com`).setValue(n.baseUrl||``).onChange(e=>{B.getState().updateProvider(`openai`,{baseUrl:e})})),new G(e,t).setName(M(`Completion model`)).setTab(r).addText(e=>e.setPlaceholder(`gpt-4o-mini`).setValue(n.completionModel||``).onChange(e=>{B.getState().updateProvider(`openai`,{completionModel:e})})),new G(e,t).setHeading().setName(`Anthropic`).setTab(r);let i=a.providers.anthropic||{};new G(e,t).setName(`API Key`).setTab(r).addText(e=>{e.inputEl.type=`password`,e.setPlaceholder(`sk-ant-...`).setValue(i.apiKey||``).onChange(e=>{B.getState().updateProvider(`anthropic`,{type:`anthropic`,enabled:!0,apiKey:e})})}),new G(e,t).setName(M(`Model`)).setTab(r).addText(e=>e.setPlaceholder(`claude-sonnet-4-20250514`).setValue(i.completionModel||``).onChange(e=>{B.getState().updateProvider(`anthropic`,{completionModel:e})}))}}}async selectLocalModelFolder(){try{let e=N_(`electron`)?.remote;if(e?.dialog){let t=await e.dialog.showOpenDialog({properties:[`openDirectory`],title:`Select folder containing model files`});return t.canceled||!t.filePaths?.length?null:t.filePaths[0]}}catch{}return new Promise(e=>{let t=document.createElement(`input`);t.type=`file`,t.setAttribute(`webkitdirectory`,``),t.style.display=`none`,document.body.appendChild(t),t.addEventListener(`change`,()=>{document.body.removeChild(t),t.files&&t.files.length>0?e(t.files[0].path.replace(/[/\\][^/\\]+$/,``)):e(null)}),t.addEventListener(`cancel`,()=>{document.body.removeChild(t),e(null)}),t.click()})}};Mv(),P_();var xG=N_(`os`),SG=class{plugin;secretKey;constructor(e){this.plugin=e,this.secretKey=this.generateSecretKey()}async getDeviceId(){let e=``;if(f.Platform.isDesktop)e=await Dv();else{let t=await window.Capacitor?.Plugins.Device.getId();e=t.identifier||t.uuid}return e}async getSystemInfo(){let e=await this.getDeviceId(),t;if(xG)t=JSON.stringify({hostname:xG.hostname(),platform:xG.platform(),machineid:e});else{let n=await window.Capacitor?.Plugins.Device.getInfo(),r=n?.model,i=n?.platform;t=JSON.stringify({hostname:r||(`mobile`+f.Platform.isMobile?Math.random().toString(36).substring(7):``),platform:i||`mobile`,machineid:e})}return QW(t)}generateSecretKey(){let e=this.plugin.manifest.version;return QW(`thino-api-secret-${e}`)}generateSignature(e,t){let n=`${e}-${t}-${this.secretKey}`,r=0;for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);r=(r<<5)-r+t,r&=r}return QW(Math.abs(r).toString(36))}async generateToken(e=1){try{let t=await this.getDeviceId(),n=Date.now(),r=await this.getSystemInfo(),i={appId:t,timestamp:n,signature:this.generateSignature(r,n),version:this.plugin.manifest.version,expiryHours:e};return QW(JSON.stringify(i))}catch(e){throw console.error(`Failed to generate token:`,e),Error(`Token generation failed`)}}async validateToken(e){try{if(!e)return!1;let t=JSON.parse(oG(e)),n=await this.getDeviceId();if(t.appId!==n)return console.warn(`Token validation failed: Invalid app ID`),!1;if(Date.now()-t.timestamp>(t.expiryHours||1)*60*60*1e3)return console.warn(`Token validation failed: Token expired`),!1;if(t.version!==this.plugin.manifest.version)return console.warn(`Token validation failed: Version mismatch`),!1;let r=await this.getSystemInfo(),i=this.generateSignature(r,t.timestamp);return t.signature===i?!0:(console.warn(`Token validation failed: Invalid signature`),!1)}catch(e){return console.error(`Token validation error:`,e),!1}}async isUserVerified(){try{let e=await this.getDeviceId();return!!this.plugin.settings.tokenForVerify[e]}catch(e){return console.error(`User verification check failed:`,e),!1}}async getTokenInfo(e){try{return JSON.parse(oG(e))}catch(e){return console.error(`Failed to parse token info:`,e),null}}async generateAuthHeader(e=1){return`Bearer ${await this.generateToken(e)}`}extractTokenFromHeader(e){return!e||!e.startsWith(`Bearer `)?null:e.substring(7)}};N(),Cv(),H(),Mv();var CG=class{constructor(e){this.props=e}display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props;new G(e,t).setHeading().setTab(r).setName(`💎 Thino`),new G(e,t).setName(M(`Default save type`)).setDesc(M(`Set the default save type for thino. "DAILY" by default`)).setTab(r).addDropdown(async e=>{for(let t of n.settings.EnabledLocationList)e.addOption(t.value,M(t.value));e.setValue(n.settings.MemoSaveLocation||n.settings.EnabledLocationList[0].value).onChange(async e=>{if(!i){Sv();return}n.settings.MemoSaveLocation=e,t.applySettingsUpdate()})}),new G(e,t).setTab(r).setName(M(`Support filter by metadata from file`)).setDesc(M(`When enable this, you can filter via metadata from file, like tags in file. But thinos from canvas is not supported. False by default.`)).addToggle(e=>{e.setValue(n.settings.FilterByMetadata).onChange(async e=>{if(!i){Sv();return}n.settings.FilterByMetadata=e,t.applySettingsUpdate()})}),new G(e,t).setTab(r).setName(M(`Show source near timestamp in thino`)).setDesc(M(`When enable this, you can see the source near timestamp in thino. You can set title in metadata to overwrite this. False by default.`)).addToggle(e=>{e.setValue(n.settings.ShowSourcePath).onChange(async e=>{if(!i){Sv();return}n.settings.ShowSourcePath=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Add tag automatically`)).setDesc(M(`Add tag to the end or beginning of the thino content when creating a thino and filtering tags`)).setTab(r).addToggle(e=>e.setValue(n.settings.addTagAutomatically).onChange(async e=>{if(!i){Sv();return}n.settings.addTagAutomatically=e,t.applySettingsUpdate(),t.debounceDisplay()})),n.settings.addTagAutomatically&&(new G(e,t).setName(M(`Add tag position`)).setDesc(M(`Set the position of the tag when adding tag automatically`)).setTab(r).addDropdown(async e=>{e.addOption(`End`,M(`End`)),e.addOption(`Beginning`,M(`Beginning`)),e.setValue(n.settings.addTagPosition).onChange(async e=>{n.settings.addTagPosition=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Add tag with new line`)).setDesc(M(`Add tag with new line when adding tag automatically`)).setTab(r).addToggle(e=>e.setValue(n.settings.addTagWithNewline).onChange(async e=>{n.settings.addTagWithNewline=e,t.applySettingsUpdate()}))),new G(e,t).setHeading().setTab(r).setName(`💎 `+M(`Interface`)),new G(e,t).setName(M(`Reference links group`)).setDesc(M(`Enable reference links group in thino.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.enableReferenceLinksGroup).onChange(async e=>{if(!i){Sv();return}n.settings.enableReferenceLinksGroup=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Word count feature`)).setTab(r).setDesc(M(`Enable real-time word count display in the editor`)).addToggle(e=>{e.setValue(n.settings.enableWordCount).onChange(async e=>{if(!i){Sv();return}n.settings.enableWordCount=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Maximum word count`)).setTab(r).setDesc(M(`Set a maximum word count for thino. Editor will display a warning when exceeded. Set to 0 for unlimited.`)).setDisabled(!i||!n.settings.enableWordCount).addText(e=>{e.inputEl.type=`number`,e.setValue(n.settings.maxWordCount.toString()).onChange(async e=>{let r=parseInt(e);!isNaN(r)&&r>=0&&(n.settings.maxWordCount=r,t.applySettingsUpdate())})}),new G(e,t).setTab(r).setName(M(`Always show status text`)).addToggle(e=>e.setValue(n.settings.AlwaysShowStatusText).onChange(async e=>{n.settings.AlwaysShowStatusText=e,document.body.toggleClass(`thino-show-status`,e),t.applySettingsUpdate()})),f.Platform.isMobile&&new G(e,t).setName(M(`Quick add button on mobile navbar`)).setTab(r).addToggle(e=>{e.setValue(n.settings.NavbarButton).onChange(async e=>{if(!i){Sv();return}n.settings.NavbarButton=e,t.applySettingsUpdate()})}),this.addDailyMarkSettings();let a;new G(e,t).setName(M(`Chat view style`)).setDesc(M(`Set the style of chat view`)).setTab(r).addDropdown(async e=>{a=e,a.addOption(`default`,`Default`),a.addOption(`fluent`,`Fluent`),a.addOption(`inline`,`Inline`),a.setValue(n.settings.chatViewStyle).onChange(async e=>{if(!i){Sv();return}n.settings.chatViewStyle=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Can select other views when leaf width is not enough`)).setDesc(M(`This option will allow you use other views when leaf width is not enough. False by default.`)).setTab(r).addToggle(e=>{e.setValue(n.settings.SupportSelectOtherView).onChange(async e=>{if(!i){Sv();return}n.settings.SupportSelectOtherView=e,t.applySettingsUpdate()})}),this.addMomentsSettings(),new G(e,t).setHeading().setTab(r).setName(`💎 `+M(`Advanced`)),this.addGlobalSettings()}addDailyMarkSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props,a;new G(e,t).setName(M(`Show day mark in thino list`)).setDesc(M(`Show day mark on the top of daily range thino. False by default.`)).setTab(r).addToggle(e=>e.setValue(n.settings.showDayMark).onChange(async e=>{if(!i){Sv();return}n.settings.showDayMark=e,t.applySettingsUpdate(),t.debounceDisplay()})),n.settings.showDayMark&&(new G(e,t).setName(M(`Day mark range`)).setDesc(M(`Set the range of day mark. Day by default.`)).setTab(r).addDropdown(async e=>{a=e,a.addOption(`day`,`day`),a.addOption(`week`,`week`),a.addOption(`month`,`month`),a.addOption(`quarter`,`quarter`),a.addOption(`year`,`year`),a.setValue(n.settings.dayMarkRange).onChange(async e=>{n.settings.dayMarkRange=e,t.applySettingsUpdate()})}),new G(e,t).setName(M(`Hide pinned group`)).setDesc(M(`Hide pinned group in thino list. False by default.`)).setTab(r).addToggle(e=>e.setValue(n.settings.hidePinnedGroup).onChange(async e=>{if(!i){Sv();return}n.settings.hidePinnedGroup=e,t.applySettingsUpdate()})))}addMomentsSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props;new G(e,t).setTab(r).setName(M(`Background image for moments view`)).setDesc(M(`Set the background image for moments view`)).addText(e=>{new cE(e.inputEl),e.setPlaceholder(`URL`).setValue(n.settings.MomentsBackgroundImage).onChange(async e=>{i&&(n.settings.MomentsBackgroundImage=e,t.applySettingsUpdate())})})}addGlobalSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props;this.addHttpServerSettings(),new G(e,t).setName(M(`Enable opening thino globally`)).setDesc(M(`Enable opening thino globally. False by default.`)).setTab(r).addToggle(e=>e.setValue(n.settings.CaptureKey.EnableCaptureKey).onChange(async e=>{if(!i){Sv();return}n.settings.CaptureKey={...n.settings.CaptureKey,EnableCaptureKey:e},t.applySettingsUpdate(),setTimeout(()=>{t.display()},100)})),n.settings.CaptureKey.EnableCaptureKey&&(new G(e,t).setName(M(`Key for opening thino globally`)).setDesc(M(`Set key for opening thino globally. CTRL + SHIFT + T by default.`)).setTab(r).addText(e=>e.setPlaceholder(W3.CaptureKey.OpenThinoGlobally).setValue(n.settings.CaptureKey.OpenThinoGlobally).onChange(async e=>{if(!i){Sv();return}n.settings.CaptureKey={...n.settings.CaptureKey,OpenThinoGlobally:e},t.applySettingsUpdate()})),new G(e,t).setName(M(`Show thino near mouse`)).setTab(r).addToggle(e=>e.setValue(n.settings.CaptureKey.ShowNearMouse).onChange(async e=>{if(!i){Sv();return}n.settings.CaptureKey={...n.settings.CaptureKey,ShowNearMouse:e},t.applySettingsUpdate()})))}async addHttpServerSettings(){let{containerEl:e,settingTab:t,plugin:n,tabName:r}=this.props,i=L.getState().verifyState,a=f.Platform.isDesktop?void 0:await window.Capacitor?.Plugins?.Device?.getId(),o=a?a.identifier||a.uuid:await Dv(),s=i&&i?.appId===o;new G(e,t).setName(M(`Enable Local Http Server`)).setTab(r).setDisabled(!s).addToggle(e=>e.setValue(n.settings.EnabledHttpApi).onChange(async e=>{if(!s){Sv();return}n.settings.EnabledHttpApi=e,t.applySettingsUpdate(),setTimeout(()=>{n.settings.EnabledHttpApi?n.initServer():n.stopServer(),t.display()},100)})),n.settings.EnabledHttpApi&&(new G(e,t).setName(`API Token Management`).setDesc(`Generate and manage API tokens for external applications`).setTab(r).addButton(e=>{e.setButtonText(`Generate Token`).setTooltip(`Generate a new API token for external access`).onClick(async()=>{if(!s){Sv();return}new wG(t.app,n,async e=>{try{let r=new SG(n);if(!await r.isUserVerified()){new f.Notice(`Pro license required to generate API token`);return}let i=await r.generateToken(e),a=await r.generateAuthHeader(e),o=e*3600;new TG(t.app,i,a,o,e).open()}catch(e){console.error(`Token generation error:`,e),new f.Notice(`Failed to generate token: `+e.message)}}).open()})}).addButton(e=>{e.setButtonText(`Test API`).setTooltip(`Test API connection`).onClick(async()=>{if(!s){Sv();return}try{let e=new SG(n);if(!await e.isUserVerified()){new f.Notice(`Pro license required for API access`);return}let t=await e.generateAuthHeader(1),r=await fetch(`http://${n.settings.HttpApiIpType}:${n.settings.HttpApiPort}/list?count=1`,{headers:{Authorization:t}});if(r.ok)new f.Notice(`API test successful! Found `+((await r.json()).thinos?.length||0)+` thinos.`);else throw Error(`API test failed: ${r.status}`)}catch(e){console.error(`API test error:`,e),new f.Notice(`API test failed: `+e.message)}})}).addButton(e=>{e.setButtonText(`API Documentation`).setTooltip(`View API documentation and examples`).onClick(async()=>{new EG(t.app,n).open()})}),new G(e,t).setName(M(`Get thino capture extension`)).setDesc(M(`You can capture idea/text from chrome now.`)).setTab(r).addButton(e=>{e.setButtonText(`GitHub`).onClick(()=>{window.open(`https://github.com/quorafind/thino-capture-releases`,`_blank`)})}).addButton(e=>{e.setButtonText(`Chrome Web Store`).onClick(()=>{window.open(`https://chromewebstore.google.com/detail/thino-capture/oppagjehiimpjpjmgbfmanlnbpbcecff`,`_blank`)})}),new G(e,t).setName(M(`Memos Http Server Port`)).setDesc(M(`Set memos http server port to listen. '43999' by default`)).setTab(r).addText(e=>e.setPlaceholder(W3.HttpApiPort).setValue(n.settings.HttpApiPort).onChange(async e=>{if(!s){Sv();return}n.settings.HttpApiPort=e,t.applySettingsUpdate(),setTimeout(()=>{n.stopServer(),n.initServer()},1e3)})),new G(e,t).setName(M(`Auto Download Image`)).setDesc(M(`Auto download image when save to thino. 'false' by default`)).setTab(r).setDisabled(!s).addToggle(e=>{e.setValue(n.settings.AutoDownloadImage).onChange(async e=>{if(!s){Sv();return}n.settings.AutoDownloadImage=e,t.applySettingsUpdate(),setTimeout(()=>{n.stopServer(),n.initServer()},1e3)})}),new G(e,t).setName(M(`Thino Http IP Type`)).setDesc(M(`Set Thino http server ip to listen. 'localhost' by default`)).setTab(r).addDropdown(e=>{e.addOption(`localhost`,`localhost`),e.addOption(`127.0.0.1`,`127.0.0.1`),e.setValue(n.settings.HttpApiIpType).onChange(async e=>{if(!i||i?.appId!==o){Sv();return}n.settings.HttpApiIpType=e,t.applySettingsUpdate(),setTimeout(()=>{n.stopServer(),n.initServer()},1e3)})}),this.addAppendPrependSettings(s))}addAppendPrependSettings(e){let{containerEl:t,settingTab:n,plugin:r,tabName:i}=this.props;new G(t,n).setTab(i).setName(M(`Append/prepend text when share to Thino`)).addToggle(t=>{t.setValue(r.settings.AppendOrPrependTextViaServer).onChange(async t=>{if(!e){Sv();return}r.settings.AppendOrPrependTextViaServer=t,n.applySettingsUpdate(),n.debounceDisplay()})}),r.settings.AppendOrPrependTextViaServer&&(new G(t,n).setName(M(`Prepend Text`)).setTab(i).addText(e=>{e.setPlaceholder(M(`Input anything here`)).setValue(r.settings.PrependViaServer).onChange(async e=>{r.settings.PrependViaServer=e,n.applySettingsUpdate()})}),new G(t,n).setName(M(`Append Text`)).setTab(i).addText(e=>{e.setPlaceholder(M(`Input anything here`)).setValue(r.settings.AppendViaServer).onChange(async e=>{r.settings.AppendViaServer=e,n.applySettingsUpdate()})}),new G(t,n).setName(M(`Add newline when append/prepend text`)).addDropdown(async e=>{e.addOption(`prepend`,M(`Prepend`)),e.addOption(`append`,M(`Append`)),e.addOption(`both`,M(`Both`)),e.addOption(`none`,M(`None`)),e.setValue(r.settings.WithNewLineViaServer).onChange(async e=>{r.settings.WithNewLineViaServer=e,n.applySettingsUpdate()})}))}},wG=class extends f.Modal{plugin;onGenerate;constructor(e,t,n){super(e),this.plugin=t,this.onGenerate=n}onOpen(){let{contentEl:e}=this;e.parentElement?.classList.add(`token-generation-modal`),this.titleEl.setText(`Generate API Token`),e.createDiv(`modal-desc`,e=>{e.setText(`Choose the expiration time for your API token. Longer expiration times are less secure but more convenient.`)});let t=e.createDiv(`token-form-container`),n=t.createDiv(`expiry-section`);n.createEl(`h3`,{text:`Token Expiration Time:`});let r=[{value:1,label:`1 Hour (Recommended)`},{value:6,label:`6 Hours`},{value:12,label:`12 Hours`},{value:24,label:`1 Day`},{value:72,label:`3 Days`},{value:168,label:`1 Week`},{value:720,label:`30 Days (Maximum)`}],i=1,a=n.createDiv(`radio-container`);r.forEach(e=>{let t=a.createDiv(`radio-item`),n=t.createEl(`input`,{type:`radio`,attr:{name:`expiry`,value:e.value.toString()}});e.value===1&&(n.checked=!0),n.addEventListener(`change`,()=>{n.checked&&(i=e.value)}),t.createEl(`label`,{text:e.label}).addEventListener(`click`,()=>{n.checked=!0,i=e.value})});let o=t.createDiv(`custom-section`);o.createEl(`h4`,{text:`Or enter custom hours (1-720):`});let s=o.createEl(`input`,{type:`number`,attr:{min:`1`,max:`720`,placeholder:`Custom hours...`}});s.addEventListener(`input`,()=>{let e=parseInt(s.value);e>=1&&e<=720&&(i=e,a.querySelectorAll(`input[type="radio"]`).forEach(e=>{e.checked=!1}))}),t.createDiv(`warning-section`).createEl(`p`,{text:`⚠️ Security Note: Longer expiration times increase security risk. Only use extended periods if necessary.`,cls:`security-warning`});let c=e.createDiv(`button-group`),l=c.createEl(`button`,{text:`Cancel`});l.onclick=()=>this.close();let u=c.createEl(`button`,{text:`Generate Token`,cls:`mod-cta`});u.onclick=()=>{this.onGenerate(i),this.close()}}onClose(){let{contentEl:e}=this;e.empty()}},TG=class extends f.Modal{token;authHeader;expiresIn;expiryHours;constructor(e,t,n,r,i){super(e),this.token=t,this.authHeader=n,this.expiresIn=r,this.expiryHours=i}onOpen(){let{contentEl:e}=this;e.parentElement?.classList.add(`token-display-modal`),this.titleEl.setText(`API Token Generated`),e.createDiv(`modal-desc`,e=>{e.setText(`Your API token has been generated successfully. Copy and save it securely as it will expire in 1 hour.`)});let t=e.createDiv(`token-container`),n=t.createDiv(`token-section`);n.createEl(`h3`,{text:`Token:`});let r=n.createEl(`textarea`,{cls:`token-display`,attr:{readonly:`true`,rows:`3`}});r.value=this.token;let i=t.createDiv(`token-section`);i.createEl(`h3`,{text:`Authorization Header:`});let a=i.createEl(`textarea`,{cls:`token-display`,attr:{readonly:`true`,rows:`2`}});a.value=this.authHeader;let o=t.createDiv(`token-section`);o.createEl(`h3`,{text:`Usage Example:`});let s=o.createEl(`textarea`,{cls:`token-display`,attr:{readonly:`true`,rows:`4`}});s.value=`curl -X POST http://127.0.0.1:43999/create \\
|
||
-H "Authorization: ${this.authHeader}" \\
|
||
-H "Content-Type: application/json" \\
|
||
-d '{"text": "Hello from API", "type": "DAILY"}'`;let c=e.createDiv(`expiry-info`),l=this.expiryHours>=24?`\u23F0 This token will expire in ${Math.floor(this.expiryHours/24)} day(s).`:`\u23F0 This token will expire in ${this.expiryHours} hour(s).`;c.createEl(`p`,{text:l,cls:`expiry-warning`});let u=e.createDiv(`button-group`),d=u.createEl(`button`,{text:`Copy Token`});d.onclick=async()=>{await navigator.clipboard.writeText(this.token),new f.Notice(`Token copied to clipboard`)};let p=u.createEl(`button`,{text:`Copy Auth Header`});p.onclick=async()=>{await navigator.clipboard.writeText(this.authHeader),new f.Notice(`Authorization header copied to clipboard`)};let m=u.createEl(`button`,{text:`Close`});m.onclick=()=>this.close()}onClose(){let{contentEl:e}=this;e.empty()}},EG=class extends f.Modal{plugin;constructor(e,t){super(e),this.plugin=t}onOpen(){let{contentEl:e}=this;e.parentElement?.classList.add(`api-documentation-modal`),this.titleEl.setText(`Thino API Documentation`);let t=e.createDiv(`api-doc-container`),n=t.createDiv(`api-section`);n.createEl(`h2`,{text:`Overview`}),n.createEl(`p`,{text:`The Thino HTTP API allows you to interact with your thinos programmatically. All endpoints require authentication using a Bearer token.`});let r=n.createDiv(`server-info`);r.createEl(`strong`,{text:`Server Address: `}),r.createSpan({text:`http://${this.plugin.settings.HttpApiIpType}:${this.plugin.settings.HttpApiPort}`});let i=t.createDiv(`api-section`);i.createEl(`h2`,{text:`Authentication`}),i.createEl(`p`,{text:`All API requests require a Bearer token in the Authorization header. Generate a token using the "Generate Token" button above.`});let a=i.createDiv(`code-example`);a.createEl(`h4`,{text:`Authorization Header Format:`}),a.createEl(`pre`).createEl(`code`,{text:`Authorization: Bearer <your-token-here>`});let o=t.createDiv(`api-section`);o.createEl(`h2`,{text:`API Endpoints`}),this.createEndpointSection(o,{title:`Create Thino`,method:`POST`,endpoint:`/create`,description:`Create a new thino with text content and optional images`,parameters:[{name:`text`,type:`string`,required:!0,description:`The content of the thino`},{name:`isList`,type:`boolean`,required:!1,description:`Whether to format as list item (default: false)`},{name:`type`,type:`string`,required:!1,description:`Save location type (DAILY, CANVAS, MULTI, FILE)`},{name:`imageList`,type:`array`,required:!1,description:`Array of base64 encoded images`},{name:`sourceLink`,type:`string`,required:!1,description:`Source URL to append to the thino`}],examples:{curl:this.generateCurlExample(`POST`,`/create`,{text:`This is my new thino`,isList:!1,type:`DAILY`}),python:this.generatePythonExample(`POST`,`/create`,{text:`This is my new thino`,isList:!1,type:`DAILY`}),nodejs:this.generateNodeExample(`POST`,`/create`,{text:`This is my new thino`,isList:!1,type:`DAILY`})}}),this.createEndpointSection(o,{title:`Search Thinos`,method:`GET`,endpoint:`/search`,description:`Search for thinos containing specific keywords`,parameters:[{name:`keyword`,type:`string`,required:!0,description:`Search keyword`}],examples:{curl:this.generateCurlExample(`GET`,`/search?keyword=meeting`),python:this.generatePythonExample(`GET`,`/search?keyword=meeting`),nodejs:this.generateNodeExample(`GET`,`/search?keyword=meeting`)}}),this.createEndpointSection(o,{title:`List Thinos`,method:`GET`,endpoint:`/list`,description:`Get a list of recent thinos`,parameters:[{name:`count`,type:`number`,required:!1,description:`Number of thinos to return (1-100, default: 10)`}],examples:{curl:this.generateCurlExample(`GET`,`/list?count=20`),python:this.generatePythonExample(`GET`,`/list?count=20`),nodejs:this.generateNodeExample(`GET`,`/list?count=20`)}}),this.createEndpointSection(o,{title:`Get Settings Info`,method:`GET`,endpoint:`/info`,description:`Get current plugin settings information`,parameters:[{name:`getSettings`,type:`boolean`,required:!0,description:`Must be true to retrieve settings`}],examples:{curl:this.generateCurlExample(`GET`,`/info?getSettings=true`),python:this.generatePythonExample(`GET`,`/info?getSettings=true`),nodejs:this.generateNodeExample(`GET`,`/info?getSettings=true`)}});let s=t.createDiv(`api-section`);s.createEl(`h2`,{text:`Response Format`}),s.createEl(`p`,{text:`All API responses return JSON in the following format:`});let c=s.createDiv(`code-example`),l=c.createDiv();l.createEl(`h4`,{text:`Success Response:`}),l.createEl(`pre`).createEl(`code`,{text:JSON.stringify({status:`success`,data:`...`},null,2)});let u=c.createDiv();u.createEl(`h4`,{text:`Error Response:`}),u.createEl(`pre`).createEl(`code`,{text:JSON.stringify({status:`error`,message:`Error description`},null,2)});let d=t.createDiv(`api-section`);d.createEl(`h2`,{text:`Common Error Codes`});let f=d.createEl(`ul`);f.createEl(`li`,{text:`401 Unauthorized - Missing or invalid token`}),f.createEl(`li`,{text:`403 Forbidden - Pro license required`}),f.createEl(`li`,{text:`404 Not Found - Endpoint not found`}),f.createEl(`li`,{text:`405 Method Not Allowed - Wrong HTTP method`}),f.createEl(`li`,{text:`413 Request Too Large - Request body too large`}),f.createEl(`li`,{text:`429 Too Many Requests - Rate limit exceeded`});let p=e.createDiv(`button-group`).createEl(`button`,{text:`Close`});p.onclick=()=>this.close()}createEndpointSection(e,t){let n=e.createDiv(`endpoint-section`),r=n.createDiv(`endpoint-header`);if(r.createEl(`h3`,{text:t.title}),r.createEl(`span`,{cls:`method-badge method-${t.method.toLowerCase()}`,text:t.method}),r.createEl(`code`,{cls:`endpoint-path`,text:t.endpoint}),n.createEl(`p`,{text:t.description}),t.parameters.length>0){n.createEl(`h4`,{text:`Parameters:`});let e=n.createEl(`table`,{cls:`param-table`}),r=e.createEl(`tr`);r.createEl(`th`,{text:`Name`}),r.createEl(`th`,{text:`Type`}),r.createEl(`th`,{text:`Required`}),r.createEl(`th`,{text:`Description`}),t.parameters.forEach(t=>{let n=e.createEl(`tr`);n.createEl(`td`,{text:t.name}),n.createEl(`td`,{text:t.type}),n.createEl(`td`,{text:t.required?`Yes`:`No`}),n.createEl(`td`,{text:t.description})})}n.createEl(`h4`,{text:`Examples:`});let i=n.createDiv(`example-tabs`),a=i.createDiv(`tab-buttons`),o=a.createEl(`button`,{text:`cURL`,cls:`tab-btn active`}),s=a.createEl(`button`,{text:`Python`,cls:`tab-btn`}),c=a.createEl(`button`,{text:`Node.js`,cls:`tab-btn`}),l=i.createDiv(`tab-contents`),u=l.createDiv(`tab-content active`);u.createEl(`pre`).createEl(`code`,{text:t.examples.curl}),this.addCopyButton(u,t.examples.curl);let d=l.createDiv(`tab-content`);d.createEl(`pre`).createEl(`code`,{text:t.examples.python}),this.addCopyButton(d,t.examples.python);let f=l.createDiv(`tab-content`);f.createEl(`pre`).createEl(`code`,{text:t.examples.nodejs}),this.addCopyButton(f,t.examples.nodejs);let p=(e,t)=>{a.querySelectorAll(`.tab-btn`).forEach(e=>e.removeClass(`active`)),l.querySelectorAll(`.tab-content`).forEach(e=>e.removeClass(`active`)),e.addClass(`active`),t.addClass(`active`)};o.onclick=()=>p(o,u),s.onclick=()=>p(s,d),c.onclick=()=>p(c,f)}addCopyButton(e,t){let n=e.createEl(`button`,{text:`Copy`,cls:`copy-btn`});n.onclick=async()=>{await navigator.clipboard.writeText(t),n.setText(`Copied!`),setTimeout(()=>n.setText(`Copy`),2e3)}}generateCurlExample(e,t,n){let r=`curl -X ${e} ${`http://${this.plugin.settings.HttpApiIpType}:${this.plugin.settings.HttpApiPort}`}${t} \\\n -H "Authorization: Bearer <your-token>"`;return n&&e!==`GET`&&(r+=` \\\n -H "Content-Type: application/json" \\\n -d '${JSON.stringify(n,null,2)}'`),r}generatePythonExample(e,t,n){let r=`import requests
|
||
import json
|
||
|
||
url = "${`http://${this.plugin.settings.HttpApiIpType}:${this.plugin.settings.HttpApiPort}`}${t}"
|
||
headers = {
|
||
"Authorization": "Bearer <your-token>"`;return n&&e!==`GET`&&(r+=`,
|
||
"Content-Type": "application/json"`),r+=`
|
||
}`,n&&e!==`GET`?r+=`
|
||
|
||
data = ${JSON.stringify(n,null,4)}
|
||
|
||
response = requests.${e.toLowerCase()}(url, headers=headers, json=data)`:r+=`
|
||
|
||
response = requests.${e.toLowerCase()}(url, headers=headers)`,r+=`
|
||
print(response.json())`,r}generateNodeExample(e,t,n){let r=`const fetch = require('node-fetch');
|
||
|
||
const url = '${`http://${this.plugin.settings.HttpApiIpType}:${this.plugin.settings.HttpApiPort}`}${t}';
|
||
const options = {
|
||
method: '${e}',
|
||
headers: {
|
||
'Authorization': 'Bearer <your-token>'`;return n&&e!==`GET`&&(r+=`,
|
||
'Content-Type': 'application/json'`),r+=`
|
||
}`,n&&e!==`GET`&&(r+=`,
|
||
body: JSON.stringify(${JSON.stringify(n,null,8)})`),r+=`
|
||
};
|
||
|
||
fetch(url, options)
|
||
.then(response => response.json())
|
||
.then(data => console.log(data))
|
||
.catch(error => console.error('Error:', error));`,r}onClose(){let{contentEl:e}=this;e.empty()}},DG,OG,kG,AG,jG=o((()=>{DG={none:`None`,low:`Low`,medium:`Medium`,high:`High`,xhigh:`Extra High`},OG={default:`Default`,"accept-edits":`Accept Edits`,"plan-mode":`Plan Mode`,"dont-ask":`Don't Ask`,"bypass-permissions":`Bypass Permissions`},kG=`You are responding via a WeChat bot. Follow these rules for file/media output:
|
||
|
||
1. To send a local file to the user, output its ABSOLUTE path on a single line by itself (e.g. /home/user/project/report.pdf). The bot will automatically upload and send it.
|
||
2. IMPORTANT: Files can only be sent if they are located within the current working directory (cwd) or the vault directory. If a file is outside these directories, COPY or MOVE it into the cwd first, then output the new path.
|
||
3. To send an image, use markdown image syntax: . The bot will download and send it as an image message.
|
||
4. Supported file types for auto-sending: pdf, doc/docx, xls/xlsx, ppt/pptx, zip, txt, csv, png, jpg, gif, webp, mp4, mov.
|
||
5. For text responses, use plain language. Markdown formatting (headers, bold, lists) will be converted to plain text for WeChat display.`,AG={enabled:!1,defaultAgent:`claude`,agents:{claude:{type:`cli`,command:`claude`,aliases:[`cc`]},codex:{type:`cli`,command:`codex`,aliases:[`cx`]},gemini:{type:`cli`,command:`gemini`,aliases:[`gm`]}}}}));async function MG(e,t=4e4){let n=await(0,f.requestUrl)({url:e,throw:!1});if(n.status>=400)throw Error(`HTTP ${n.status}: ${n.text}`);return n.json}function NG(e,t){return new Promise((n,r)=>{if(t.aborted){r(Error(`Aborted`));return}let i=()=>r(Error(`Aborted`));t.addEventListener(`abort`,i,{once:!0}),e.then(e=>{t.removeEventListener(`abort`,i),n(e)},e=>{t.removeEventListener(`abort`,i),r(e)})})}function PG(){let e=FG.randomBytes(4).readUInt32LE();return Buffer.from(e.toString()).toString(`base64`)}var FG,IG,LG,RG,zG,BG=o((()=>{P_(),FG=N_(`crypto`),IG=`https://ilinkai.weixin.qq.com`,LG=4e4,RG=15e3,zG=class{baseURL;botToken;botId;wechatUIN;constructor(e){this.baseURL=e.baseurl||IG,this.botToken=e.bot_token,this.botId=e.ilink_bot_id,this.wechatUIN=PG()}async getUpdates(e,t){let n={get_updates_buf:e,base_info:{channel_version:`1.0.0`}};return this.post(`/ilink/bot/getupdates`,n,LG,t)}async sendMessage(e){return this.post(`/ilink/bot/sendmessage`,e,RG)}async getConfig(e,t){let n={ilink_user_id:e,context_token:t,base_info:{}};return this.post(`/ilink/bot/getconfig`,n,1e4)}async sendTyping(e,t,n){let r={ilink_user_id:e,typing_ticket:t,status:n,base_info:{}};return this.post(`/ilink/bot/sendtyping`,r,1e4)}async getUploadURL(e){return this.post(`/ilink/bot/getuploadurl`,e,RG)}async post(e,t,n,r){if(r?.aborted)throw Error(`Aborted`);let i=(0,f.requestUrl)({url:this.baseURL+e,method:`POST`,headers:this.headers(),body:JSON.stringify(t),throw:!1}),a=r?await NG(i,r):await i;if(a.status>=400)throw Error(`HTTP ${a.status}: ${a.text}`);return a.json}headers(){return{"Content-Type":`application/json`,AuthorizationType:`ilink_bot_token`,Authorization:`Bearer ${this.botToken}`,"X-WECHAT-UIN":this.wechatUIN}}}}));async function VG(){return MG(WG)}async function HG(e,t,n){let r=GG+encodeURIComponent(e);for(;;){if(n?.aborted)throw Error(`Login cancelled`);let e;try{e=await MG(r,4e4)}catch{if(n?.aborted)throw Error(`Login cancelled`);continue}switch(e.status){case JG:{let n={bot_token:e.bot_token,ilink_bot_id:e.ilink_bot_id,baseurl:e.baseurl,ilink_user_id:e.ilink_user_id};return t?.onConfirmed?.(n),n}case YG:throw Error(`QR code expired`);case qG:t?.onScanned?.();break;case KG:default:break}}}async function UG(e,t){let n=await VG();return e?.onQRCode?.(n.qrcode,n.qrcode_img_content),HG(n.qrcode,e,t)}var WG,GG,KG,qG,JG,YG,XG=o((()=>{BG(),WG=`https://ilinkai.weixin.qq.com/ilink/bot/get_bot_qrcode?bot_type=3`,GG=`https://ilinkai.weixin.qq.com/ilink/bot/get_qrcode_status?qrcode=`,KG=`wait`,qG=`scaned`,JG=`confirmed`,YG=`expired`}));function ZG(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=setTimeout(n,e);t?.addEventListener(`abort`,()=>{clearTimeout(r),n()},{once:!0})})}var QG,$G,eK,tK,nK,rK,iK=o((()=>{QG=5,$G=3e3,eK=6e4,tK=5e3,nK=-14,rK=class{client;handler;getUpdatesBuf;failures=0;abortController=null;running=!1;log;loadBuf;saveBuf;constructor(e,t,n){this.client=e,this.handler=t,this.loadBuf=n.loadBuf,this.saveBuf=n.saveBuf,this.log=n.logger,this.getUpdatesBuf=this.loadBuf()}get isRunning(){return this.running}async run(){if(this.running)return;this.running=!0,this.abortController=new AbortController;let{signal:e}=this.abortController;this.log.info(`[monitor] starting long-poll loop`);try{for(;!e.aborted;)try{let t=await this.client.getUpdates(this.getUpdatesBuf,e);if(this.failures=0,t.errcode===nK){this.log.warn(`[monitor] session expired, resetting sync buf`),this.getUpdatesBuf=``,this.saveBuf(``),await ZG(tK,e);continue}if(t.ret!==0&&t.errcode){this.log.warn(`[monitor] server error: ret=${t.ret} errcode=${t.errcode} errmsg=${t.errmsg}`);continue}if(t.get_updates_buf&&(this.getUpdatesBuf=t.get_updates_buf,this.saveBuf(this.getUpdatesBuf)),t.msgs)for(let e of t.msgs)try{this.handler(this.client,e)}catch(e){this.log.error(`[monitor] handler error:`,e)}}catch(t){if(e.aborted)break;this.failures++;let n=this.calcBackoff();this.log.warn(`[monitor] GetUpdates error (${this.failures}/${QG}, backoff=${n}ms):`,t instanceof Error?t.message:t),await ZG(n,e)}}finally{this.running=!1,this.log.info(`[monitor] stopped`)}}stop(){this.abortController?.abort()}calcBackoff(){let e=$G;for(let t=1;t<this.failures;t++)if(e*=2,e>eK)return eK;return e}}}));async function aK(e,t,n,r){let i=fK.randomBytes(16),a=fK.randomBytes(16),o=i.toString(`hex`),s=a.toString(`hex`),c=fK.createHash(`md5`).update(t).digest(`hex`),l=dK(t.length),u={filekey:o,media_type:r,to_user_id:n,rawsize:t.length,rawfilemd5:c,filesize:l,no_need_thumb:!0,aeskey:s,base_info:{}},d=await e.getUploadURL(u);if(d.ret!=null&&d.ret!==0)throw Error(`getUploadURL failed: ret=${d.ret} errmsg=${d.errmsg}`);let f=lK(t,a);return{downloadParam:await sK(f,d.upload_param,o),aesKeyHex:s,fileSize:t.length,cipherSize:f.length}}function oK(e){return Buffer.from(e).toString(`base64`)}async function sK(e,t,n){let r=await(0,f.requestUrl)({url:`${pK}/upload?encrypted_query_param=${encodeURIComponent(t)}&filekey=${encodeURIComponent(n)}`,method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),throw:!1});if(r.status>=400)throw Error(`CDN upload HTTP ${r.status}: ${r.text}`);let i=r.headers[`x-encrypted-param`]||r.headers[`X-Encrypted-Param`];if(!i)throw Error(`CDN upload: missing X-Encrypted-Param header`);return i}async function cK(e,t){let n=await(0,f.requestUrl)({url:`${pK}/download?encrypted_query_param=${encodeURIComponent(e)}`,method:`GET`,throw:!1});if(n.status>=400)throw Error(`CDN download HTTP ${n.status}`);let r=Buffer.from(n.arrayBuffer),i=Buffer.from(t,`base64`).toString(`utf-8`);return uK(r,Buffer.from(i,`hex`))}function lK(e,t){let n=16-e.length%16,r=Buffer.alloc(e.length+n);e.copy(r),r.fill(n,e.length);let i=fK.createCipheriv(`aes-128-ecb`,t,null);return i.setAutoPadding(!1),Buffer.concat([i.update(r),i.final()])}function uK(e,t){let n=fK.createDecipheriv(`aes-128-ecb`,t,null);n.setAutoPadding(!1);let r=Buffer.concat([n.update(e),n.final()]);if(r.length===0)return r;let i=r[r.length-1];return i>0&&i<=16?r.subarray(0,r.length-i):r}function dK(e){return(Math.floor((e+1)/16)+1)*16}var fK,pK,mK=o((()=>{P_(),fK=N_(`crypto`),pK=`https://novac2c.cdn.weixin.qq.com/c2c`})),hK,gK=o((()=>{hK=class{handlers=new Map;on(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),this}off(e,t){return this.handlers.get(e)?.delete(t),this}emit(e,t){for(let n of this.handlers.get(e)??[])try{n(t)}catch(t){console.error(`[Emitter] handler error on "${e}":`,t)}}removeAllListeners(){this.handlers.clear()}}})),_K,vK,yK,bK,xK,SK=o((()=>{_K={None:0,User:1,Bot:2},vK={New:0,Generating:1,Finish:2},yK={None:0,Text:1,Image:2,Voice:3,File:4,Video:5},bK={Image:1,Video:2,File:3,Voice:4},xK={Typing:1,Cancel:2}}));function CK(e){for(let t of e.item_list||[])if(t.type===yK.Text&&t.text_item)return t.text_item.text;return``}function wK(e,t){let n=e.trim();if(!n.startsWith(`/`))return{command:null,text:n};let r=n.slice(1),i=r.indexOf(` `);if(i<=0){let e=r;return{command:t.get(e)||e,text:``}}let a=r.slice(0,i);return{command:t.get(a)||a,text:r.slice(i+1).trim()}}function TK(e,t){return e.length<=t?e:e.slice(0,t)+`...`}var EK,DK,OK,kK=o((()=>{P_(),BG(),XG(),iK(),mK(),gK(),SK(),EK=N_(`crypto`),DK={info(){},warn(){},error(){}},OK=class extends hK{options;log;storage;client=null;monitor=null;credentials=null;syncBuf=``;commands=new Map;aliases=new Map;defaultHandler=null;contextTokens=new Map;constructor(e,t){super(),this.options={defaultReply:!1,...t},this.log=t?.logger===!1?DK:t?.logger||console,this.storage=e,t?.credentials&&(this.credentials=t.credentials)}command(e,t){let n=Array.isArray(e)?e:[e],r=n[0];this.commands.set(r,t);for(let e of n)this.aliases.set(e,r);return this}onDefault(e){return this.defaultHandler=e,this}async login(e){let t=await UG({onQRCode:(e,t)=>this.emit(`qrcode`,{url:e,imageBase64:t}),onScanned:()=>this.emit(`scanned`,void 0),onConfirmed:e=>{this.storage.saveCredentials(e),this.emit(`login`,e)}},e);return this.credentials=t,t}async start(){this.credentials||=this.storage.loadCredentials(),this.credentials||(this.log.info(`[weclaw] no credentials found, starting login...`),await this.login());let e=this.credentials;this.client=new zG(e),this.syncBuf=await this.storage.loadSyncBuf(),this.monitor=new rK(this.client,this.handleRawMessage.bind(this),{loadBuf:()=>this.syncBuf,saveBuf:e=>{this.syncBuf=e,this.storage.saveSyncBuf(e).catch(e=>this.log.error(`[weclaw] save sync buf error:`,e))},logger:this.log}),this.emit(`ready`,void 0),this.log.info(`[weclaw] ready, monitoring messages...`);try{await this.monitor.run()}catch(e){this.emit(`error`,e)}finally{this.emit(`stopped`,void 0)}}stop(){this.monitor?.stop()}get running(){return this.monitor?.isRunning??!1}getCredentials(){return this.credentials}getClient(){return this.client}logout(){this.stop(),this.credentials=null,this.client=null,this.syncBuf=``,this.storage.clearCredentials()}async sendText(e,t,n){let r=this.requireClient(),i=n||this.contextTokens.get(e)||``;await this.doSendText(r,e,t,i)}async sendMedia(e,t,n,r){let i=this.requireClient(),a=r?.contextToken||this.contextTokens.get(e)||``,o=await aK(i,t,e,n),s={encrypt_query_param:o.downloadParam,aes_key:oK(o.aesKeyHex),encrypt_type:1},c;switch(n){case bK.Image:c={type:yK.Image,image_item:{media:s,mid_size:o.cipherSize}};break;case bK.Video:c={type:yK.Video,video_item:{media:s,video_size:o.cipherSize}};break;default:c={type:yK.File,file_item:{media:s,file_name:r?.fileName||`file`,len:String(o.fileSize)}}}let l={msg:{from_user_id:i.botId,to_user_id:e,client_id:EK.randomUUID(),message_type:_K.Bot,message_state:vK.Finish,item_list:[c],context_token:a},base_info:{}},u=await i.sendMessage(l);if(u.ret!=null&&u.ret!==0)throw Error(`sendMedia failed: ret=${u.ret} errmsg=${u.errmsg}`)}handleRawMessage(e,t){if(t.message_type!==_K.User||t.message_state!==vK.Finish)return;if(this.options.allowedUsers?.length&&!this.options.allowedUsers.includes(t.from_user_id)){this.log.warn(`[weclaw] ignored message from unauthorized user: ${t.from_user_id}`);return}let n=CK(t);this.contextTokens.set(t.from_user_id,t.context_token),this.log.info(`[weclaw] message from ${t.from_user_id}: ${TK(n,80)}`);let{command:r,text:i}=wK(n,this.aliases),a={fromUserId:t.from_user_id,text:i,command:r,fullText:n,contextToken:t.context_token,rawMessage:t,items:t.item_list||[],reply:async n=>{await this.doSendText(e,t.from_user_id,n,t.context_token)}};this.emit(`message`,a),this.routeMessage(e,a).catch(e=>{this.log.error(`[weclaw] handler error:`,e),this.emit(`error`,e)})}async routeMessage(e,t){this.sendTypingIndicator(e,t.fromUserId,t.contextToken);let n;if(t.command){let e=this.commands.get(t.command);n=e?await e(t):await this.runDefaultHandler(t)}else n=await this.runDefaultHandler(t);typeof n==`string`&&n.length>0&&(await this.doSendText(e,t.fromUserId,n,t.contextToken),this.emit(`reply`,{toUserId:t.fromUserId,text:n}))}async runDefaultHandler(e){if(this.defaultHandler)return this.defaultHandler(e);if(this.options.defaultReply!==!1)return this.options.defaultReply;this.emit(`message:unhandled`,e)}async doSendText(e,t,n,r){let i={msg:{from_user_id:e.botId,to_user_id:t,client_id:EK.randomUUID(),message_type:_K.Bot,message_state:vK.Finish,item_list:[{type:yK.Text,text_item:{text:n}}],context_token:r},base_info:{}},a=await e.sendMessage(i);if(a.ret!=null&&a.ret!==0)throw Error(`sendMessage failed: ret=${a.ret} errmsg=${a.errmsg}`);this.log.info(`[weclaw] replied to ${t}: ${TK(n,50)}`)}sendTypingIndicator(e,t,n){(async()=>{try{let r=await e.getConfig(t,n);r.typing_ticket&&await e.sendTyping(t,r.typing_ticket,xK.Typing)}catch{}})()}requireClient(){if(!this.client)throw Error(`WeClaw not started. Call start() first.`);return this.client}}})),AK,jK,MK=o((()=>{AK={botToken:`wechat-bot-token`,botId:`wechat-bot-id`,baseUrl:`wechat-base-url`,userId:`wechat-user-id`},jK=class{app;basePath;adapter;memBotToken=null;memBotId=null;memBaseUrl=null;memUserId=null;constructor(e,t){this.app=e,this.adapter=e.vault.adapter,this.basePath=(0,f.normalizePath)(`${e.vault.configDir}/plugins/${t}/wechat`)}get secrets(){return this.app.secretStorage}loadSecrets(){this.memBotToken=this.secrets.getSecret(AK.botToken)??null,this.memBotId=this.secrets.getSecret(AK.botId)??null,this.memBaseUrl=this.secrets.getSecret(AK.baseUrl)??null,this.memUserId=this.secrets.getSecret(AK.userId)??null}setBotToken(e){this.memBotToken=e,this.secrets.setSecret(AK.botToken,e)}setBotId(e){this.memBotId=e,this.secrets.setSecret(AK.botId,e)}setBaseUrl(e){this.memBaseUrl=e,this.secrets.setSecret(AK.baseUrl,e)}setUserId(e){this.memUserId=e,this.secrets.setSecret(AK.userId,e)}saveCredentials(e){this.setBotToken(e.bot_token),this.setBotId(e.ilink_bot_id),this.setBaseUrl(e.baseurl),this.setUserId(e.ilink_user_id)}loadCredentials(){return this.memBotToken?{bot_token:this.memBotToken,ilink_bot_id:this.memBotId||``,baseurl:this.memBaseUrl||``,ilink_user_id:this.memUserId||``}:null}clearCredentials(){this.memBotToken=null,this.memBotId=null,this.memBaseUrl=null,this.memUserId=null,this.secrets.setSecret(AK.botToken,``),this.secrets.setSecret(AK.botId,``),this.secrets.setSecret(AK.baseUrl,``),this.secrets.setSecret(AK.userId,``)}async ensureDir(){await this.adapter.exists(this.basePath)||await this.adapter.mkdir(this.basePath)}async saveSyncBuf(e){await this.ensureDir();let t=(0,f.normalizePath)(`${this.basePath}/sync.json`);await this.adapter.write(t,JSON.stringify({get_updates_buf:e}))}async loadSyncBuf(){let e=(0,f.normalizePath)(`${this.basePath}/sync.json`);try{if(!await this.adapter.exists(e))return``;let t=await this.adapter.read(e);return JSON.parse(t).get_updates_buf||``}catch{return``}}}})),NK=s(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),PK=s((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),FK=s((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),IK=s(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),LK=s(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),RK=s((e=>{var t=PK().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),zK=s((e=>{var t=PK().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),BK=s((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),VK=s((e=>{var t=FK(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),HK=s((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),UK=s((e=>{var t=HK();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),WK=s(((e,t)=>{var n=UK();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),GK=s((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),KK=s((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
|
||
]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),qK=s((e=>{var t=GK(),n=KK();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),JK=s((e=>{var t=PK(),n=VK(),r=FK(),i=qK(),a=GK(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),YK=s((e=>{var t=PK(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),XK=s(((e,t)=>{var n=qK();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),ZK=s(((e,t)=>{var n=qK(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),QK=s(((e,t)=>{var n=qK();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),$K=s(((e,t)=>{var n=qK(),r=PK();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
|
||
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),eq=s(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),tq=s((e=>{var t=qK(),n=XK(),r=ZK(),i=QK(),a=$K(),o=KK(),s=PK(),c=eq();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
|
||
Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),nq=s((e=>{var t=PK(),n=FK(),r=IK(),i=LK(),a=RK(),o=zK(),s=BK(),c=VK(),l=WK(),u=JK(),d=YK(),f=qK(),p=tq();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
|
||
The chosen QR Code version cannot contain this amount of data.
|
||
Minimum version required to store current data is: `+c+`.
|
||
`);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),rq=s((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||={};let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[a[t*i+r]?1:0]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),iq=s((e=>{var t=rq();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),aq=s((e=>{var t=rq();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
|
||
`;return typeof a==`function`&&a(null,p),p}})),oq=s((e=>{var t=NK(),n=nq(),r=iq(),i=aq();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})})),sq,cq,lq=o((()=>{sq=u(oq()),N(),cq=class extends f.Modal{statusEl;imgEl;onCancel;constructor(e,t){super(e),this.onCancel=t}onOpen(){let{contentEl:e,modalEl:t}=this;t.addClass(`wechat-qr-modal`);let n=e.createDiv({cls:`wechat-qr-header`});(0,f.setIcon)(n.createSpan({cls:`wechat-qr-icon`}),`message-circle`),n.createEl(`h2`,{text:M(`WeChat Login`)}),n.createEl(`p`,{text:M(`Scan the QR code with WeChat to connect`),cls:`wechat-qr-subtitle`}),this.imgEl=e.createDiv({cls:`wechat-qr-img-container`}).createEl(`img`,{cls:`wechat-qr-img`,attr:{alt:`WeChat QR Code`}}),this.statusEl=e.createDiv({cls:`wechat-qr-status`}),this.setStatus(`loading`,M(`Fetching QR code...`))}onClose(){this.onCancel(),this.contentEl.empty()}async setQRCode(e){if(e){try{let t=await sq.toDataURL(e,{width:280,margin:2,color:{dark:`#000000`,light:`#ffffff`}});this.imgEl.src=t}catch(e){console.error(`[WeChatQRModal] QR generation failed:`,e),this.setStatus(`error`,M(`Failed to generate QR code`));return}this.setStatus(`waiting`,M(`Waiting for scan...`))}}setStatus(e,t){this.statusEl.empty(),this.statusEl.className=`wechat-qr-status wechat-qr-status--${e}`,(0,f.setIcon)(this.statusEl.createSpan({cls:`wechat-qr-status-icon`}),{loading:`loader`,waiting:`scan`,scanned:`check-circle`,confirmed:`check-circle-2`,expired:`alert-circle`,error:`alert-triangle`}[e]||`info`),this.statusEl.createSpan({text:t})}}})),uq=c({SILK_SAMPLE_RATE:()=>pq,SilkCodec:()=>vq});function dq(e,t){let n=e.byteLength,r=44+n,i=Buffer.allocUnsafe(r),a=0;return i.write(`RIFF`,a),a+=4,i.writeUInt32LE(r-8,a),a+=4,i.write(`WAVE`,a),a+=4,i.write(`fmt `,a),a+=4,i.writeUInt32LE(16,a),a+=4,i.writeUInt16LE(1,a),a+=2,i.writeUInt16LE(1,a),a+=2,i.writeUInt32LE(t,a),a+=4,i.writeUInt32LE(t*2,a),a+=4,i.writeUInt16LE(2,a),a+=2,i.writeUInt16LE(16,a),a+=2,i.write(`data`,a),a+=4,i.writeUInt32LE(n,a),a+=4,Buffer.from(e.buffer,e.byteOffset,e.byteLength).copy(i,a),i}var fq,pq,mq,hq,gq,_q,vq,yq=o((()=>{P_(),fq=N_(`path`),pq=24e3,mq=`https://cdn.jsdelivr.net/npm/silk-wasm@3.7.1/lib`,hq=[`index.cjs`,`silk.wasm`],gq=null,_q=Function(`return require`)(),vq=class{dir;absDir;adapter;constructor(e,t){this.adapter=e.vault.adapter,this.dir=(0,f.normalizePath)(`${e.vault.configDir}/plugins/${t}/silk-wasm`);let n=this.adapter.getBasePath();this.absDir=fq.join(n,this.dir)}async isInstalled(){for(let e of hq)if(!await this.adapter.exists((0,f.normalizePath)(`${this.dir}/${e}`)))return!1;return!0}async download(){await this.adapter.exists(this.dir)||await this.adapter.mkdir(this.dir);try{for(let e of hq){let t=await(0,f.requestUrl)({url:`${mq}/${e}`}),n=(0,f.normalizePath)(`${this.dir}/${e}`);e.endsWith(`.wasm`)?await this.adapter.writeBinary(n,t.arrayBuffer):await this.adapter.write(n,t.text)}}catch(e){throw await this.remove(),e}gq=null}async remove(){gq=null;for(let e of hq){let t=(0,f.normalizePath)(`${this.dir}/${e}`);try{await this.adapter.exists(t)&&await this.adapter.remove(t)}catch{}}try{await this.adapter.rmdir(this.dir,!1)}catch{}}async decodeToWav(e){try{let{data:t}=await(await this.loadModule()).decode(e,pq);return dq(t,pq)}catch{return null}}async loadModule(){if(gq)return gq;let e=fq.join(this.absDir,`index.cjs`);return _q.cache?.[e]&&delete _q.cache[e],gq=_q(e),gq}}}));function J(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}function bq(e){return e&&Object.assign(Cq,e),Cq}var xq,Sq,Cq,wq=o((()=>{Object.freeze({status:`aborted`}),xq=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Sq=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},Cq={}}));function Tq(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Eq(e,t=`|`){return e.map(e=>Uq(e)).join(t)}function Dq(e,t){return typeof t==`bigint`?t.toString():t}function Oq(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function kq(e){return e==null}function Aq(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function jq(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}function Mq(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==aJ)return r===void 0&&(r=aJ,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Nq(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Pq(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Fq(e){return JSON.stringify(e)}function Iq(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}function Lq(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Rq(e){if(Lq(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Lq(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function zq(e){return Rq(e)?{...e}:Array.isArray(e)?[...e]:e}function Bq(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Vq(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Hq(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Uq(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Wq(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function Gq(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Vq(e,Pq(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Nq(this,`shape`,e),e},checks:[]}))}function Kq(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Vq(e,Pq(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Nq(this,`shape`,r),r},checks:[]}))}function qq(e,t){if(!Rq(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Vq(e,Pq(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Nq(this,`shape`,n),n}}))}function Jq(e,t){if(!Rq(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Vq(e,Pq(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Nq(this,`shape`,n),n}}))}function Yq(e,t){return Vq(e,Pq(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Nq(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Xq(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Vq(t,Pq(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Nq(this,`shape`,i),i},checks:[]}))}function Zq(e,t,n){return Vq(t,Pq(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Nq(this,`shape`,i),i}}))}function Qq(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function $q(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function eJ(e){return typeof e==`string`?e:e?.message}function tJ(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=eJ(e.inst?._zod.def?.error?.(e))??eJ(t?.error?.(e))??eJ(n.customError?.(e))??eJ(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function nJ(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function rJ(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function iJ(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var aJ,oJ,sJ,cJ,lJ,uJ=o((()=>{aJ=Symbol(`evaluating`),oJ=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},sJ=Oq(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),cJ=new Set([`string`,`number`,`symbol`]),lJ={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}}));function dJ(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function fJ(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var pJ,mJ,hJ,gJ=o((()=>{wq(),uJ(),pJ=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Dq,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},mJ=J(`$ZodError`,pJ),hJ=J(`$ZodError`,pJ,{Parent:Error})})),_J,vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,DJ,OJ,kJ,AJ,jJ=o((()=>{wq(),gJ(),uJ(),_J=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new xq;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>tJ(e,a,bq())));throw oJ(t,i?.callee),t}return o.value},vJ=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>tJ(e,a,bq())));throw oJ(t,i?.callee),t}return o.value},yJ=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new xq;return a.issues.length?{success:!1,error:new(e??mJ)(a.issues.map(e=>tJ(e,i,bq())))}:{success:!0,data:a.value}},bJ=yJ(hJ),xJ=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>tJ(e,i,bq())))}:{success:!0,data:a.value}},SJ=xJ(hJ),CJ=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return _J(e)(t,n,i)},wJ=e=>(t,n,r)=>_J(e)(t,n,r),TJ=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return vJ(e)(t,n,i)},EJ=e=>async(t,n,r)=>vJ(e)(t,n,r),DJ=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return yJ(e)(t,n,i)},OJ=e=>(t,n,r)=>yJ(e)(t,n,r),kJ=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return xJ(e)(t,n,i)},AJ=e=>async(t,n,r)=>xJ(e)(t,n,r)}));function MJ(){return new RegExp(KJ,`u`)}function NJ(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function PJ(e){return RegExp(`^${NJ(e)}$`)}function FJ(e){let t=NJ({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${eY}T(?:${r})$`)}var IJ,LJ,RJ,zJ,BJ,VJ,HJ,UJ,WJ,GJ,KJ,qJ,JJ,YJ,XJ,ZJ,QJ,$J,eY,tY,nY,rY,iY,aY,oY,sY,cY=o((()=>{IJ=/^[cC][^\s-]{8,}$/,LJ=/^[0-9a-z]+$/,RJ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zJ=/^[0-9a-vA-V]{20}$/,BJ=/^[A-Za-z0-9]{27}$/,VJ=/^[a-zA-Z0-9_-]{21}$/,HJ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,UJ=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,WJ=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,GJ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,KJ=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,qJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,JJ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,YJ=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,XJ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ZJ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,QJ=/^[A-Za-z0-9_-]*$/,$J=/^\+[1-9]\d{6,14}$/,eY=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,tY=RegExp(`^${eY}$`),nY=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},rY=/^-?\d+$/,iY=/^-?\d+(?:\.\d+)?$/,aY=/^(?:true|false)$/i,oY=/^[^A-Z]*$/,sY=/^[^a-z]*$/})),lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY,bY,xY,SY,CY,wY,TY,EY=o((()=>{wq(),cY(),uJ(),lY=J(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),uY={number:`number`,bigint:`bigint`,object:`date`},dY=J(`$ZodCheckLessThan`,(e,t)=>{lY.init(e,t);let n=uY[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fY=J(`$ZodCheckGreaterThan`,(e,t)=>{lY.init(e,t);let n=uY[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pY=J(`$ZodCheckMultipleOf`,(e,t)=>{lY.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):jq(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),mY=J(`$ZodCheckNumberFormat`,(e,t)=>{lY.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=lJ[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=rY)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),hY=J(`$ZodCheckMaxLength`,(e,t)=>{var n;lY.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!kq(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=nJ(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gY=J(`$ZodCheckMinLength`,(e,t)=>{var n;lY.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!kq(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=nJ(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_Y=J(`$ZodCheckLengthEquals`,(e,t)=>{var n;lY.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!kq(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=nJ(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),vY=J(`$ZodCheckStringFormat`,(e,t)=>{var n,r;lY.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),yY=J(`$ZodCheckRegex`,(e,t)=>{vY.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),bY=J(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=oY,vY.init(e,t)}),xY=J(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=sY,vY.init(e,t)}),SY=J(`$ZodCheckIncludes`,(e,t)=>{lY.init(e,t);let n=Bq(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),CY=J(`$ZodCheckStartsWith`,(e,t)=>{lY.init(e,t);let n=RegExp(`^${Bq(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),wY=J(`$ZodCheckEndsWith`,(e,t)=>{lY.init(e,t);let n=RegExp(`.*${Bq(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),TY=J(`$ZodCheckOverwrite`,(e,t)=>{lY.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),DY,OY=o((()=>{DY=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
||
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
||
`))}}})),kY,AY=o((()=>{kY={major:4,minor:3,patch:6}}));function jY(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function MY(e){if(!QJ.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return jY(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function NY(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function PY(e,t,n){e.issues.length&&t.issues.push(...$q(n,e.issues)),t.value[n]=e.value}function FY(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...$q(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function IY(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Wq(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function LY(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>FY(e,n,i,t,u))):FY(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}function RY(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Qq(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>tJ(e,r,bq())))}),t)}function zY(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Rq(e)&&Rq(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=zY(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=zY(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function BY(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Qq(e))return e;let o=zY(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}function VY(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}function HY(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function UY(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function WY(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}function GY(e){return e.value=Object.freeze(e.value),e}function KY(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(iJ(e))}}var qY,JY,YY,XY,ZY,QY,$Y,eX,tX,nX,rX,iX,aX,oX,sX,cX,lX,uX,dX,fX,pX,mX,hX,gX,_X,vX,yX,bX,xX,SX,CX,wX,TX,EX,DX,OX,kX,AX,jX,MX,NX,PX,FX,IX,LX,RX,zX,BX,VX,HX,UX=o((()=>{EY(),wq(),OY(),jJ(),cY(),uJ(),AY(),qY=J(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=kY;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Qq(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new xq;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Qq(e,t))});else{if(e.issues.length===t)continue;r||=Qq(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Qq(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new xq;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new xq;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Mq(e,`~standard`,()=>({validate:t=>{try{let n=bJ(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return SJ(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),JY=J(`$ZodString`,(e,t)=>{qY.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??nY(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),YY=J(`$ZodStringFormat`,(e,t)=>{vY.init(e,t),JY.init(e,t)}),XY=J(`$ZodGUID`,(e,t)=>{t.pattern??=UJ,YY.init(e,t)}),ZY=J(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=WJ(e)}else t.pattern??=WJ();YY.init(e,t)}),QY=J(`$ZodEmail`,(e,t)=>{t.pattern??=GJ,YY.init(e,t)}),$Y=J(`$ZodURL`,(e,t)=>{YY.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),eX=J(`$ZodEmoji`,(e,t)=>{t.pattern??=MJ(),YY.init(e,t)}),tX=J(`$ZodNanoID`,(e,t)=>{t.pattern??=VJ,YY.init(e,t)}),nX=J(`$ZodCUID`,(e,t)=>{t.pattern??=IJ,YY.init(e,t)}),rX=J(`$ZodCUID2`,(e,t)=>{t.pattern??=LJ,YY.init(e,t)}),iX=J(`$ZodULID`,(e,t)=>{t.pattern??=RJ,YY.init(e,t)}),aX=J(`$ZodXID`,(e,t)=>{t.pattern??=zJ,YY.init(e,t)}),oX=J(`$ZodKSUID`,(e,t)=>{t.pattern??=BJ,YY.init(e,t)}),sX=J(`$ZodISODateTime`,(e,t)=>{t.pattern??=FJ(t),YY.init(e,t)}),cX=J(`$ZodISODate`,(e,t)=>{t.pattern??=tY,YY.init(e,t)}),lX=J(`$ZodISOTime`,(e,t)=>{t.pattern??=PJ(t),YY.init(e,t)}),uX=J(`$ZodISODuration`,(e,t)=>{t.pattern??=HJ,YY.init(e,t)}),dX=J(`$ZodIPv4`,(e,t)=>{t.pattern??=qJ,YY.init(e,t),e._zod.bag.format=`ipv4`}),fX=J(`$ZodIPv6`,(e,t)=>{t.pattern??=JJ,YY.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),pX=J(`$ZodCIDRv4`,(e,t)=>{t.pattern??=YJ,YY.init(e,t)}),mX=J(`$ZodCIDRv6`,(e,t)=>{t.pattern??=XJ,YY.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}}),hX=J(`$ZodBase64`,(e,t)=>{t.pattern??=ZJ,YY.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{jY(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),gX=J(`$ZodBase64URL`,(e,t)=>{t.pattern??=QJ,YY.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{MY(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),_X=J(`$ZodE164`,(e,t)=>{t.pattern??=$J,YY.init(e,t)}),vX=J(`$ZodJWT`,(e,t)=>{YY.init(e,t),e._zod.check=n=>{NY(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),yX=J(`$ZodNumber`,(e,t)=>{qY.init(e,t),e._zod.pattern=e._zod.bag.pattern??iY,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),bX=J(`$ZodNumberFormat`,(e,t)=>{mY.init(e,t),yX.init(e,t)}),xX=J(`$ZodBoolean`,(e,t)=>{qY.init(e,t),e._zod.pattern=aY,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),SX=J(`$ZodUnknown`,(e,t)=>{qY.init(e,t),e._zod.parse=e=>e}),CX=J(`$ZodNever`,(e,t)=>{qY.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),wX=J(`$ZodArray`,(e,t)=>{qY.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>PY(t,n,e))):PY(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}}),TX=J(`$ZodObject`,(e,t)=>{if(qY.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Oq(()=>IY(t));Mq(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Lq,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>FY(n,t,e,s,r))):FY(i,t,e,s,r)}return i?LY(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),EX=J(`$ZodObjectJIT`,(e,t)=>{TX.init(e,t);let n=e._zod.parse,r=Oq(()=>IY(t)),i=e=>{let t=new DY([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Fq(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Fq(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
||
if (${n}.issues.length) {
|
||
if (${o} in input) {
|
||
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
||
...iss,
|
||
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
||
})));
|
||
}
|
||
}
|
||
|
||
if (${n}.value === undefined) {
|
||
if (${o} in input) {
|
||
newResult[${o}] = undefined;
|
||
}
|
||
} else {
|
||
newResult[${o}] = ${n}.value;
|
||
}
|
||
|
||
`):t.write(`
|
||
if (${n}.issues.length) {
|
||
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
||
...iss,
|
||
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
||
})));
|
||
}
|
||
|
||
if (${n}.value === undefined) {
|
||
if (${o} in input) {
|
||
newResult[${o}] = undefined;
|
||
}
|
||
} else {
|
||
newResult[${o}] = ${n}.value;
|
||
}
|
||
|
||
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Lq,s=!Cq.jitless,c=s&&sJ.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?LY([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}}),DX=J(`$ZodUnion`,(e,t)=>{qY.init(e,t),Mq(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Mq(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Mq(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Mq(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Aq(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>RY(t,i,e,a)):RY(s,i,e,a)}}),OX=J(`$ZodIntersection`,(e,t)=>{qY.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>BY(e,t,n)):BY(e,i,a)}}),kX=J(`$ZodRecord`,(e,t)=>{qY.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Rq(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...$q(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...$q(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&iY.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>tJ(e,r,bq())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...$q(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...$q(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),AX=J(`$ZodEnum`,(e,t)=>{qY.init(e,t);let n=Tq(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>cJ.has(typeof e)).map(e=>typeof e==`string`?Bq(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),jX=J(`$ZodLiteral`,(e,t)=>{if(qY.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Bq(e):e?Bq(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),MX=J(`$ZodTransform`,(e,t)=>{qY.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Sq(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new xq;return n.value=i,n}}),NX=J(`$ZodOptional`,(e,t)=>{qY.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Mq(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Mq(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Aq(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>VY(t,e.value)):VY(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),PX=J(`$ZodExactOptional`,(e,t)=>{NX.init(e,t),Mq(e._zod,`values`,()=>t.innerType._zod.values),Mq(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),FX=J(`$ZodNullable`,(e,t)=>{qY.init(e,t),Mq(e._zod,`optin`,()=>t.innerType._zod.optin),Mq(e._zod,`optout`,()=>t.innerType._zod.optout),Mq(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Aq(e.source)}|null)$`):void 0}),Mq(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),IX=J(`$ZodDefault`,(e,t)=>{qY.init(e,t),e._zod.optin=`optional`,Mq(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>HY(e,t)):HY(r,t)}}),LX=J(`$ZodPrefault`,(e,t)=>{qY.init(e,t),e._zod.optin=`optional`,Mq(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),RX=J(`$ZodNonOptional`,(e,t)=>{qY.init(e,t),Mq(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>UY(t,e)):UY(i,e)}}),zX=J(`$ZodCatch`,(e,t)=>{qY.init(e,t),Mq(e._zod,`optin`,()=>t.innerType._zod.optin),Mq(e._zod,`optout`,()=>t.innerType._zod.optout),Mq(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>tJ(e,n,bq()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>tJ(e,n,bq()))},input:e.value}),e.issues=[]),e)}}),BX=J(`$ZodPipe`,(e,t)=>{qY.init(e,t),Mq(e._zod,`values`,()=>t.in._zod.values),Mq(e._zod,`optin`,()=>t.in._zod.optin),Mq(e._zod,`optout`,()=>t.out._zod.optout),Mq(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>WY(e,t.in,n)):WY(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>WY(e,t.out,n)):WY(r,t.out,n)}}),VX=J(`$ZodReadonly`,(e,t)=>{qY.init(e,t),Mq(e._zod,`propValues`,()=>t.innerType._zod.propValues),Mq(e._zod,`values`,()=>t.innerType._zod.values),Mq(e._zod,`optin`,()=>t.innerType?._zod?.optin),Mq(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(GY):GY(r)}}),HX=J(`$ZodCustom`,(e,t)=>{lY.init(e,t),qY.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>KY(t,n,r,e));KY(i,n,r,e)}})}));function WX(){return{localeError:GX()}}var GX,KX=o((()=>{uJ(),GX=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=rJ(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Uq(e.values[0])}`:`Invalid option: expected one of ${Eq(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Eq(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}}}));function qX(){return new YX}var JX,YX,XX,ZX=o((()=>{YX=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}},(JX=globalThis).__zod_globalRegistry??(JX.__zod_globalRegistry=qX()),XX=globalThis.__zod_globalRegistry}));function QX(e,t){return new e({type:`string`,...Hq(t)})}function $X(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Hq(t)})}function eZ(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Hq(t)})}function tZ(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Hq(t)})}function nZ(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Hq(t)})}function rZ(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Hq(t)})}function iZ(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Hq(t)})}function aZ(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Hq(t)})}function oZ(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Hq(t)})}function sZ(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Hq(t)})}function cZ(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Hq(t)})}function lZ(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Hq(t)})}function uZ(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Hq(t)})}function dZ(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Hq(t)})}function fZ(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Hq(t)})}function pZ(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Hq(t)})}function mZ(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Hq(t)})}function hZ(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Hq(t)})}function gZ(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Hq(t)})}function _Z(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Hq(t)})}function vZ(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Hq(t)})}function yZ(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Hq(t)})}function bZ(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Hq(t)})}function xZ(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Hq(t)})}function SZ(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Hq(t)})}function CZ(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Hq(t)})}function wZ(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Hq(t)})}function TZ(e,t){return new e({type:`number`,checks:[],...Hq(t)})}function EZ(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...Hq(t)})}function DZ(e,t){return new e({type:`boolean`,...Hq(t)})}function OZ(e){return new e({type:`unknown`})}function kZ(e,t){return new e({type:`never`,...Hq(t)})}function AZ(e,t){return new dY({check:`less_than`,...Hq(t),value:e,inclusive:!1})}function jZ(e,t){return new dY({check:`less_than`,...Hq(t),value:e,inclusive:!0})}function MZ(e,t){return new fY({check:`greater_than`,...Hq(t),value:e,inclusive:!1})}function NZ(e,t){return new fY({check:`greater_than`,...Hq(t),value:e,inclusive:!0})}function PZ(e,t){return new pY({check:`multiple_of`,...Hq(t),value:e})}function FZ(e,t){return new hY({check:`max_length`,...Hq(t),maximum:e})}function IZ(e,t){return new gY({check:`min_length`,...Hq(t),minimum:e})}function LZ(e,t){return new _Y({check:`length_equals`,...Hq(t),length:e})}function RZ(e,t){return new yY({check:`string_format`,format:`regex`,...Hq(t),pattern:e})}function zZ(e){return new bY({check:`string_format`,format:`lowercase`,...Hq(e)})}function BZ(e){return new xY({check:`string_format`,format:`uppercase`,...Hq(e)})}function VZ(e,t){return new SY({check:`string_format`,format:`includes`,...Hq(t),includes:e})}function HZ(e,t){return new CY({check:`string_format`,format:`starts_with`,...Hq(t),prefix:e})}function UZ(e,t){return new wY({check:`string_format`,format:`ends_with`,...Hq(t),suffix:e})}function WZ(e){return new TY({check:`overwrite`,tx:e})}function GZ(e){return WZ(t=>t.normalize(e))}function KZ(){return WZ(e=>e.trim())}function qZ(){return WZ(e=>e.toLowerCase())}function JZ(){return WZ(e=>e.toUpperCase())}function YZ(){return WZ(e=>Iq(e))}function XZ(e,t,n){return new e({type:`array`,element:t,...Hq(n)})}function ZZ(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Hq(n)})}function QZ(e){let t=$Z(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(iJ(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(iJ(r))}},e(n.value,n)));return t}function $Z(e,t){let n=new lY({check:`custom`,...Hq(t)});return n._zod.check=e,n}var eQ=o((()=>{EY(),ZX(),uJ()}));function tQ(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??XX,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function nQ(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,nQ(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&aQ(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function rQ(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
||
|
||
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function iQ(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:sQ(t,`input`,e.processors),output:sQ(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function aQ(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return aQ(r.element,n);if(r.type===`set`)return aQ(r.valueType,n);if(r.type===`lazy`)return aQ(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return aQ(r.innerType,n);if(r.type===`intersection`)return aQ(r.left,n)||aQ(r.right,n);if(r.type===`record`||r.type===`map`)return aQ(r.keyType,n)||aQ(r.valueType,n);if(r.type===`pipe`)return aQ(r.in,n)||aQ(r.out,n);if(r.type===`object`){for(let e in r.shape)if(aQ(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(aQ(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(aQ(e,n))return!0;return!!(r.rest&&aQ(r.rest,n))}return!1}var oQ,sQ,cQ=o((()=>{ZX(),oQ=(e,t={})=>n=>{let r=tQ({...n,processors:t});return nQ(e,r),rQ(r,e),iQ(r,e)},sQ=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=tQ({...i??{},target:a,io:t,processors:n});return nQ(e,o),rQ(o,e),iQ(o,e)}})),lQ,uQ,dQ,fQ,pQ,mQ,hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ,CQ,wQ,TQ,EQ,DQ,OQ,kQ,AQ,jQ,MQ=o((()=>{cQ(),uJ(),lQ={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},uQ=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=lQ[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},dQ=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},fQ=(e,t,n,r)=>{n.type=`boolean`},pQ=(e,t,n,r)=>{n.not={}},mQ=(e,t,n,r)=>{},hQ=(e,t,n,r)=>{let i=e._zod.def,a=Tq(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},gQ=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},_Q=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},vQ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},yQ=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=nQ(a.element,t,{...r,path:[...r.path,`items`]})},bQ=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=nQ(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=nQ(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},xQ=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>nQ(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},SQ=(e,t,n,r)=>{let i=e._zod.def,a=nQ(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=nQ(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},CQ=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=nQ(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=nQ(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=nQ(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},wQ=(e,t,n,r)=>{let i=e._zod.def,a=nQ(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},TQ=(e,t,n,r)=>{let i=e._zod.def;nQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},EQ=(e,t,n,r)=>{let i=e._zod.def;nQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},DQ=(e,t,n,r)=>{let i=e._zod.def;nQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},OQ=(e,t,n,r)=>{let i=e._zod.def;nQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},kQ=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;nQ(a,t,r);let o=t.seen.get(e);o.ref=a},AQ=(e,t,n,r)=>{let i=e._zod.def;nQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},jQ=(e,t,n,r)=>{let i=e._zod.def;nQ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType}})),NQ=o((()=>{wq(),jJ(),gJ(),UX(),EY(),AY(),uJ(),ZX(),OY(),eQ(),cQ()})),PQ=o((()=>{NQ()}));function FQ(e){return xZ(zQ,e)}function IQ(e){return SZ(BQ,e)}function LQ(e){return CZ(VQ,e)}function RQ(e){return wZ(HQ,e)}var zQ,BQ,VQ,HQ,UQ=o((()=>{NQ(),y1(),zQ=J(`ZodISODateTime`,(e,t)=>{sX.init(e,t),A$.init(e,t)}),BQ=J(`ZodISODate`,(e,t)=>{cX.init(e,t),A$.init(e,t)}),VQ=J(`ZodISOTime`,(e,t)=>{lX.init(e,t),A$.init(e,t)}),HQ=J(`ZodISODuration`,(e,t)=>{uX.init(e,t),A$.init(e,t)})})),WQ,GQ,KQ,qQ=o((()=>{NQ(),uJ(),WQ=(e,t)=>{mJ.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>fJ(e,t)},flatten:{value:t=>dJ(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Dq,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Dq,2)}},isEmpty:{get(){return e.issues.length===0}}})},GQ=J(`ZodError`,WQ),KQ=J(`ZodError`,WQ,{Parent:Error})})),JQ,YQ,XQ,ZQ,QQ,$Q,e$,t$,n$,r$,i$,a$,o$=o((()=>{NQ(),qQ(),JQ=_J(KQ),YQ=vJ(KQ),XQ=yJ(KQ),ZQ=xJ(KQ),QQ=CJ(KQ),$Q=wJ(KQ),e$=TJ(KQ),t$=EJ(KQ),n$=DJ(KQ),r$=OJ(KQ),i$=kJ(KQ),a$=AJ(KQ)}));function Y(e){return QX(k$,e)}function s$(e){return TZ(X$,e)}function c$(e){return EZ(Z$,e)}function l$(e){return DZ(Q$,e)}function X(){return OZ($$)}function u$(e){return kZ(e1,e)}function d$(e,t){return XZ(t1,e,t)}function Z(e,t){return new n1({type:`object`,shape:e,catchall:X(),...Hq(t)})}function f$(e,t){return new r1({type:`union`,options:e,...Hq(t)})}function p$(e,t){return new i1({type:`intersection`,left:e,right:t})}function Q(e,t,n){return new a1({type:`record`,keyType:e,valueType:t,...Hq(n)})}function m$(e,t){return new o1({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Hq(t)})}function $(e,t){return new s1({type:`literal`,values:Array.isArray(e)?e:[e],...Hq(t)})}function h$(e){return new c1({type:`transform`,transform:e})}function g$(e){return new l1({type:`optional`,innerType:e})}function _$(e){return new u1({type:`optional`,innerType:e})}function v$(e){return new d1({type:`nullable`,innerType:e})}function y$(e,t){return new f1({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():zq(t)}})}function b$(e,t){return new p1({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():zq(t)}})}function x$(e,t){return new m1({type:`nonoptional`,innerType:e,...Hq(t)})}function S$(e,t){return new h1({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}function C$(e,t){return new g1({type:`pipe`,in:e,out:t})}function w$(e){return new _1({type:`readonly`,innerType:e})}function T$(e,t={}){return ZZ(v1,e,t)}function E$(e){return QZ(e)}var D$,O$,k$,A$,j$,M$,N$,P$,F$,I$,L$,R$,z$,B$,V$,H$,U$,W$,G$,K$,q$,J$,Y$,X$,Z$,Q$,$$,e1,t1,n1,r1,i1,a1,o1,s1,c1,l1,u1,d1,f1,p1,m1,h1,g1,_1,v1,y1=o((()=>{NQ(),MQ(),cQ(),PQ(),UQ(),o$(),D$=J(`ZodType`,(e,t)=>(qY.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:sQ(e,`input`),output:sQ(e,`output`)}}),e.toJSONSchema=oQ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(Pq(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Vq(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>JQ(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>XQ(e,t,n),e.parseAsync=async(t,n)=>YQ(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ZQ(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>QQ(e,t,n),e.decode=(t,n)=>$Q(e,t,n),e.encodeAsync=async(t,n)=>e$(e,t,n),e.decodeAsync=async(t,n)=>t$(e,t,n),e.safeEncode=(t,n)=>n$(e,t,n),e.safeDecode=(t,n)=>r$(e,t,n),e.safeEncodeAsync=async(t,n)=>i$(e,t,n),e.safeDecodeAsync=async(t,n)=>a$(e,t,n),e.refine=(t,n)=>e.check(T$(t,n)),e.superRefine=t=>e.check(E$(t)),e.overwrite=t=>e.check(WZ(t)),e.optional=()=>g$(e),e.exactOptional=()=>_$(e),e.nullable=()=>v$(e),e.nullish=()=>g$(v$(e)),e.nonoptional=t=>x$(e,t),e.array=()=>d$(e),e.or=t=>f$([e,t]),e.and=t=>p$(e,t),e.transform=t=>C$(e,h$(t)),e.default=t=>y$(e,t),e.prefault=t=>b$(e,t),e.catch=t=>S$(e,t),e.pipe=t=>C$(e,t),e.readonly=()=>w$(e),e.describe=t=>{let n=e.clone();return XX.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return XX.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return XX.get(e);let n=e.clone();return XX.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),O$=J(`_ZodString`,(e,t)=>{JY.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uQ(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(RZ(...t)),e.includes=(...t)=>e.check(VZ(...t)),e.startsWith=(...t)=>e.check(HZ(...t)),e.endsWith=(...t)=>e.check(UZ(...t)),e.min=(...t)=>e.check(IZ(...t)),e.max=(...t)=>e.check(FZ(...t)),e.length=(...t)=>e.check(LZ(...t)),e.nonempty=(...t)=>e.check(IZ(1,...t)),e.lowercase=t=>e.check(zZ(t)),e.uppercase=t=>e.check(BZ(t)),e.trim=()=>e.check(KZ()),e.normalize=(...t)=>e.check(GZ(...t)),e.toLowerCase=()=>e.check(qZ()),e.toUpperCase=()=>e.check(JZ()),e.slugify=()=>e.check(YZ())}),k$=J(`ZodString`,(e,t)=>{JY.init(e,t),O$.init(e,t),e.email=t=>e.check($X(j$,t)),e.url=t=>e.check(aZ(P$,t)),e.jwt=t=>e.check(bZ(Y$,t)),e.emoji=t=>e.check(oZ(F$,t)),e.guid=t=>e.check(eZ(M$,t)),e.uuid=t=>e.check(tZ(N$,t)),e.uuidv4=t=>e.check(nZ(N$,t)),e.uuidv6=t=>e.check(rZ(N$,t)),e.uuidv7=t=>e.check(iZ(N$,t)),e.nanoid=t=>e.check(sZ(I$,t)),e.guid=t=>e.check(eZ(M$,t)),e.cuid=t=>e.check(cZ(L$,t)),e.cuid2=t=>e.check(lZ(R$,t)),e.ulid=t=>e.check(uZ(z$,t)),e.base64=t=>e.check(_Z(K$,t)),e.base64url=t=>e.check(vZ(q$,t)),e.xid=t=>e.check(dZ(B$,t)),e.ksuid=t=>e.check(fZ(V$,t)),e.ipv4=t=>e.check(pZ(H$,t)),e.ipv6=t=>e.check(mZ(U$,t)),e.cidrv4=t=>e.check(hZ(W$,t)),e.cidrv6=t=>e.check(gZ(G$,t)),e.e164=t=>e.check(yZ(J$,t)),e.datetime=t=>e.check(FQ(t)),e.date=t=>e.check(IQ(t)),e.time=t=>e.check(LQ(t)),e.duration=t=>e.check(RQ(t))}),A$=J(`ZodStringFormat`,(e,t)=>{YY.init(e,t),O$.init(e,t)}),j$=J(`ZodEmail`,(e,t)=>{QY.init(e,t),A$.init(e,t)}),M$=J(`ZodGUID`,(e,t)=>{XY.init(e,t),A$.init(e,t)}),N$=J(`ZodUUID`,(e,t)=>{ZY.init(e,t),A$.init(e,t)}),P$=J(`ZodURL`,(e,t)=>{$Y.init(e,t),A$.init(e,t)}),F$=J(`ZodEmoji`,(e,t)=>{eX.init(e,t),A$.init(e,t)}),I$=J(`ZodNanoID`,(e,t)=>{tX.init(e,t),A$.init(e,t)}),L$=J(`ZodCUID`,(e,t)=>{nX.init(e,t),A$.init(e,t)}),R$=J(`ZodCUID2`,(e,t)=>{rX.init(e,t),A$.init(e,t)}),z$=J(`ZodULID`,(e,t)=>{iX.init(e,t),A$.init(e,t)}),B$=J(`ZodXID`,(e,t)=>{aX.init(e,t),A$.init(e,t)}),V$=J(`ZodKSUID`,(e,t)=>{oX.init(e,t),A$.init(e,t)}),H$=J(`ZodIPv4`,(e,t)=>{dX.init(e,t),A$.init(e,t)}),U$=J(`ZodIPv6`,(e,t)=>{fX.init(e,t),A$.init(e,t)}),W$=J(`ZodCIDRv4`,(e,t)=>{pX.init(e,t),A$.init(e,t)}),G$=J(`ZodCIDRv6`,(e,t)=>{mX.init(e,t),A$.init(e,t)}),K$=J(`ZodBase64`,(e,t)=>{hX.init(e,t),A$.init(e,t)}),q$=J(`ZodBase64URL`,(e,t)=>{gX.init(e,t),A$.init(e,t)}),J$=J(`ZodE164`,(e,t)=>{_X.init(e,t),A$.init(e,t)}),Y$=J(`ZodJWT`,(e,t)=>{vX.init(e,t),A$.init(e,t)}),X$=J(`ZodNumber`,(e,t)=>{yX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dQ(e,t,n,r),e.gt=(t,n)=>e.check(MZ(t,n)),e.gte=(t,n)=>e.check(NZ(t,n)),e.min=(t,n)=>e.check(NZ(t,n)),e.lt=(t,n)=>e.check(AZ(t,n)),e.lte=(t,n)=>e.check(jZ(t,n)),e.max=(t,n)=>e.check(jZ(t,n)),e.int=t=>e.check(c$(t)),e.safe=t=>e.check(c$(t)),e.positive=t=>e.check(MZ(0,t)),e.nonnegative=t=>e.check(NZ(0,t)),e.negative=t=>e.check(AZ(0,t)),e.nonpositive=t=>e.check(jZ(0,t)),e.multipleOf=(t,n)=>e.check(PZ(t,n)),e.step=(t,n)=>e.check(PZ(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),Z$=J(`ZodNumberFormat`,(e,t)=>{bX.init(e,t),X$.init(e,t)}),Q$=J(`ZodBoolean`,(e,t)=>{xX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fQ(e,t,n,r)}),$$=J(`ZodUnknown`,(e,t)=>{SX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mQ(e,t,n,r)}),e1=J(`ZodNever`,(e,t)=>{CX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pQ(e,t,n,r)}),t1=J(`ZodArray`,(e,t)=>{wX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yQ(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(IZ(t,n)),e.nonempty=t=>e.check(IZ(1,t)),e.max=(t,n)=>e.check(FZ(t,n)),e.length=(t,n)=>e.check(LZ(t,n)),e.unwrap=()=>e.element}),n1=J(`ZodObject`,(e,t)=>{EX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bQ(e,t,n,r),Mq(e,`shape`,()=>t.shape),e.keyof=()=>m$(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:X()}),e.loose=()=>e.clone({...e._zod.def,catchall:X()}),e.strict=()=>e.clone({...e._zod.def,catchall:u$()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>qq(e,t),e.safeExtend=t=>Jq(e,t),e.merge=t=>Yq(e,t),e.pick=t=>Gq(e,t),e.omit=t=>Kq(e,t),e.partial=(...t)=>Xq(l1,e,t[0]),e.required=(...t)=>Zq(m1,e,t[0])}),r1=J(`ZodUnion`,(e,t)=>{DX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xQ(e,t,n,r),e.options=t.options}),i1=J(`ZodIntersection`,(e,t)=>{OX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>SQ(e,t,n,r)}),a1=J(`ZodRecord`,(e,t)=>{kX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CQ(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType}),o1=J(`ZodEnum`,(e,t)=>{AX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hQ(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new o1({...t,checks:[],...Hq(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new o1({...t,checks:[],...Hq(r),entries:i})}}),s1=J(`ZodLiteral`,(e,t)=>{jX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gQ(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}),c1=J(`ZodTransform`,(e,t)=>{MX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vQ(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Sq(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(iJ(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(iJ(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),l1=J(`ZodOptional`,(e,t)=>{NX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),u1=J(`ZodExactOptional`,(e,t)=>{PX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),d1=J(`ZodNullable`,(e,t)=>{FX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),f1=J(`ZodDefault`,(e,t)=>{IX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>EQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),p1=J(`ZodPrefault`,(e,t)=>{LX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),m1=J(`ZodNonOptional`,(e,t)=>{RX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>TQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),h1=J(`ZodCatch`,(e,t)=>{zX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>OQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),g1=J(`ZodPipe`,(e,t)=>{BX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kQ(e,t,n,r),e.in=t.in,e.out=t.out}),_1=J(`ZodReadonly`,(e,t)=>{VX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),v1=J(`ZodCustom`,(e,t)=>{HX.init(e,t),D$.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_Q(e,t,n,r)})})),b1,x1=o((()=>{(function(e){})(b1||={})})),S1=o((()=>{y1(),PQ(),qQ(),o$(),x1(),NQ(),KX(),bq(WX())})),C1=o((()=>{S1(),S1()})),w1=o((()=>{C1()})),T1,E1,D1=o((()=>{T1={authenticate:`authenticate`,initialize:`initialize`,logout:`logout`,session_cancel:`session/cancel`,session_close:`session/close`,session_fork:`session/fork`,session_list:`session/list`,session_load:`session/load`,session_new:`session/new`,session_prompt:`session/prompt`,session_resume:`session/resume`,session_set_config_option:`session/set_config_option`,session_set_mode:`session/set_mode`,session_set_model:`session/set_model`},E1={fs_read_text_file:`fs/read_text_file`,fs_write_text_file:`fs/write_text_file`,session_elicitation:`session/elicitation`,session_elicitation_complete:`session/elicitation/complete`,session_request_permission:`session/request_permission`,session_update:`session/update`,terminal_create:`terminal/create`,terminal_kill:`terminal/kill`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`}})),O1,k1,A1,j1,M1,N1,P1,F1,I1,L1,R1,z1,B1,V1,H1,U1,W1,G1,K1,q1,J1,Y1,X1,Z1,Q1,$1,e0,t0,n0,r0,i0,a0,o0,s0,c0,l0,u0,d0,f0,p0,m0,h0,g0,_0,v0,y0,b0,x0,S0,C0,w0,T0,E0,D0,O0,k0,A0,j0,M0,N0,P0,F0,I0,L0,R0,z0,B0,V0,H0,U0,W0,G0,K0,q0,J0,Y0,X0,Z0,Q0,$0,e2,t2,n2,r2,i2,a2,o2,s2,c2,l2,u2,d2,f2,p2,m2,h2,g2,_2,v2,y2,b2,x2,S2,C2,w2,T2,E2,D2,O2,k2,A2,j2,M2,N2,P2,F2,I2,L2,R2,z2,B2,V2,H2,U2,W2,G2,K2,q2,J2,Y2,X2,Z2,Q2,$2,e4,t4,n4,r4,i4,a4,o4,s4,c4,l4,u4,d4,f4,p4,m4,h4,g4,_4,v4,y4,b4,x4,S4,C4,w4,T4,E4,D4,O4,k4,A4=o((()=>{w1(),O1=Z({_meta:Q(Y(),X()).nullish(),terminal:l$().optional().default(!1)}),k1=Z({_meta:Q(Y(),X()).nullish(),label:Y().nullish(),name:Y(),optional:l$().optional().default(!1),secret:l$().optional().default(!0)}),A1=Z({_meta:Q(Y(),X()).nullish(),description:Y().nullish(),id:Y(),name:Y()}),j1=Z({_meta:Q(Y(),X()).nullish(),description:Y().nullish(),id:Y(),link:Y().nullish(),name:Y(),vars:d$(k1)}),M1=Z({_meta:Q(Y(),X()).nullish(),args:d$(Y()).optional(),description:Y().nullish(),env:Q(Y(),Y()).optional(),id:Y(),name:Y()}),N1=f$([j1.and(Z({type:$(`env_var`)})),M1.and(Z({type:$(`terminal`)})),A1]),P1=Z({_meta:Q(Y(),X()).nullish(),methodId:Y()}),F1=Z({_meta:Q(Y(),X()).nullish()}),I1=Z({_meta:Q(Y(),X()).nullish(),blob:Y(),mimeType:Y().nullish(),uri:Y()}),L1=Z({default:l$().nullish(),description:Y().nullish(),title:Y().nullish()}),R1=Z({_meta:Q(Y(),X()).nullish()}),z1=Z({amount:s$(),currency:Y()}),B1=Z({_meta:Q(Y(),X()).nullish(),terminalId:Y()}),V1=Z({_meta:Q(Y(),X()).nullish(),newText:Y(),oldText:Y().nullish(),path:Y()}),H1=f$([Y(),s$(),s$(),l$(),d$(Y())]),U1=Z({content:Q(Y(),H1).nullish()}),W1=f$([U1.and(Z({action:$(`accept`)})),Z({action:$(`decline`)}),Z({action:$(`cancel`)})]),G1=Z({_meta:Q(Y(),X()).nullish()}),K1=Y(),q1=Z({_meta:Q(Y(),X()).nullish(),elicitationId:K1}),J1=Z({_meta:Q(Y(),X()).nullish(),action:W1}),Y1=$(`object`),X1=$(`string`),Z1=Z({_meta:Q(Y(),X()).nullish()}),Q1=Z({_meta:Q(Y(),X()).nullish(),form:G1.nullish(),url:Z1.nullish()}),$1=Z({elicitationId:K1,url:Y().url()}),e0=Z({const:Y(),title:Y()}),t0=Z({_meta:Q(Y(),X()).nullish(),name:Y(),value:Y()}),n0=f$([$(-32700),$(-32600),$(-32601),$(-32602),$(-32603),$(-32800),$(-32e3),$(-32002),$(-32042),s$().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),r0=Z({code:n0,data:X().optional(),message:Y()}),i0=X(),a0=X(),o0=X(),s0=Z({_meta:Q(Y(),X()).nullish(),readTextFile:l$().optional().default(!1),writeTextFile:l$().optional().default(!1)}),c0=Z({_meta:Q(Y(),X()).nullish(),auth:O1.optional().default({terminal:!1}),elicitation:Q1.nullish(),fs:s0.optional().default({readTextFile:!1,writeTextFile:!1}),terminal:l$().optional().default(!1)}),l0=Z({_meta:Q(Y(),X()).nullish(),name:Y(),value:Y()}),u0=Z({_meta:Q(Y(),X()).nullish(),name:Y(),title:Y().nullish(),version:Y()}),d0=Z({default:s$().nullish(),description:Y().nullish(),maximum:s$().nullish(),minimum:s$().nullish(),title:Y().nullish()}),f0=Z({_meta:Q(Y(),X()).nullish()}),p0=Z({_meta:Q(Y(),X()).nullish(),cursor:Y().nullish(),cwd:Y().nullish()}),m0=Z({_meta:Q(Y(),X()).nullish()}),h0=Z({_meta:Q(Y(),X()).nullish(),logout:m0.nullish()}),g0=Z({_meta:Q(Y(),X()).nullish()}),_0=Z({_meta:Q(Y(),X()).nullish()}),v0=Z({_meta:Q(Y(),X()).nullish(),http:l$().optional().default(!1),sse:l$().optional().default(!1)}),y0=Z({_meta:Q(Y(),X()).nullish(),headers:d$(l0),name:Y(),url:Y()}),b0=Z({_meta:Q(Y(),X()).nullish(),headers:d$(l0),name:Y(),url:Y()}),x0=Z({_meta:Q(Y(),X()).nullish(),args:d$(Y()),command:Y(),env:d$(t0),name:Y()}),S0=f$([y0.and(Z({type:$(`http`)})),b0.and(Z({type:$(`sse`)})),x0]),C0=Y(),w0=Z({_meta:Q(Y(),X()).nullish(),description:Y().nullish(),modelId:C0,name:Y()}),T0=Z({_meta:Q(Y(),X()).nullish(),cwd:Y(),mcpServers:d$(S0)}),E0=Z({default:s$().nullish(),description:Y().nullish(),maximum:s$().nullish(),minimum:s$().nullish(),title:Y().nullish()}),D0=Y(),O0=f$([$(`allow_once`),$(`allow_always`),$(`reject_once`),$(`reject_always`)]),k0=Z({_meta:Q(Y(),X()).nullish(),kind:O0,name:Y(),optionId:D0}),A0=f$([$(`high`),$(`medium`),$(`low`)]),j0=f$([$(`pending`),$(`in_progress`),$(`completed`)]),M0=Z({_meta:Q(Y(),X()).nullish(),content:Y(),priority:A0,status:j0}),N0=Z({_meta:Q(Y(),X()).nullish(),entries:d$(M0)}),P0=Z({_meta:Q(Y(),X()).nullish(),audio:l$().optional().default(!1),embeddedContext:l$().optional().default(!1),image:l$().optional().default(!1)}),F0=s$().int().gte(0).lte(65535),I0=Z({_meta:Q(Y(),X()).nullish(),clientCapabilities:c0.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:u0.nullish(),protocolVersion:F0}),L0=Z({_meta:Q(Y(),X()).nullish(),content:Y()}),R0=Z({_meta:Q(Y(),X()).nullish()}),z0=f$([s$(),Y()]).nullable(),Z({_meta:Q(Y(),X()).nullish(),requestId:z0}),B0=m$([`assistant`,`user`]),V0=Z({_meta:Q(Y(),X()).nullish(),audience:d$(B0).nullish(),lastModified:Y().nullish(),priority:s$().nullish()}),H0=Z({_meta:Q(Y(),X()).nullish(),annotations:V0.nullish(),data:Y(),mimeType:Y()}),U0=Z({_meta:Q(Y(),X()).nullish(),annotations:V0.nullish(),data:Y(),mimeType:Y(),uri:Y().nullish()}),W0=Z({_meta:Q(Y(),X()).nullish(),annotations:V0.nullish(),description:Y().nullish(),mimeType:Y().nullish(),name:Y(),size:s$().nullish(),title:Y().nullish(),uri:Y()}),G0=Z({_meta:Q(Y(),X()).nullish(),optionId:D0}),K0=f$([Z({outcome:$(`cancelled`)}),G0.and(Z({outcome:$(`selected`)}))]),q0=Z({_meta:Q(Y(),X()).nullish(),outcome:K0}),J0=Z({_meta:Q(Y(),X()).nullish()}),Y0=Z({currentValue:l$()}),X0=Y(),Z0=Y(),Q0=f$([$(`mode`),$(`model`),$(`thought_level`),Y()]),$0=Y(),e2=Z({_meta:Q(Y(),X()).nullish(),description:Y().nullish(),name:Y(),value:$0}),t2=Z({_meta:Q(Y(),X()).nullish(),group:X0,name:Y(),options:d$(e2)}),n2=f$([d$(e2),d$(t2)]),r2=Z({currentValue:$0,options:n2}),i2=p$(f$([r2.and(Z({type:$(`select`)})),Y0.and(Z({type:$(`boolean`)}))]),Z({_meta:Q(Y(),X()).nullish(),category:Q0.nullish(),description:Y().nullish(),id:Z0,name:Y()})),a2=Z({_meta:Q(Y(),X()).nullish(),configOptions:d$(i2)}),o2=Z({_meta:Q(Y(),X()).nullish()}),s2=Y(),c2=Z({_meta:Q(Y(),X()).nullish(),sessionId:s2}),Z({method:Y(),params:f$([c2,i0]).nullish()}),l2=Z({_meta:Q(Y(),X()).nullish(),sessionId:s2}),u2=Z({_meta:Q(Y(),X()).nullish(),args:d$(Y()).optional(),command:Y(),cwd:Y().nullish(),env:d$(t0).optional(),outputByteLimit:s$().nullish(),sessionId:s2}),d2=Z({_meta:Q(Y(),X()).nullish(),cwd:Y(),mcpServers:d$(S0).optional(),sessionId:s2}),f2=Z({_meta:Q(Y(),X()).nullish(),sessionId:s2,terminalId:Y()}),p2=Z({_meta:Q(Y(),X()).nullish(),cwd:Y(),mcpServers:d$(S0),sessionId:s2}),m2=Z({_meta:Q(Y(),X()).nullish(),limit:s$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:s$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:Y(),sessionId:s2}),h2=Z({_meta:Q(Y(),X()).nullish(),sessionId:s2,terminalId:Y()}),g2=Z({_meta:Q(Y(),X()).nullish(),cwd:Y(),mcpServers:d$(S0).optional(),sessionId:s2}),_2=Z({_meta:Q(Y(),X()).nullish(),cwd:Y(),sessionId:s2,title:Y().nullish(),updatedAt:Y().nullish()}),v2=Z({_meta:Q(Y(),X()).nullish(),nextCursor:Y().nullish(),sessions:d$(_2)}),y2=Z({_meta:Q(Y(),X()).nullish(),title:Y().nullish(),updatedAt:Y().nullish()}),b2=Z({_meta:Q(Y(),X()).nullish()}),x2=Y(),S2=Z({_meta:Q(Y(),X()).nullish(),currentModeId:x2}),C2=Z({_meta:Q(Y(),X()).nullish(),description:Y().nullish(),id:x2,name:Y()}),w2=Z({_meta:Q(Y(),X()).nullish(),availableModes:d$(C2),currentModeId:x2}),T2=Z({_meta:Q(Y(),X()).nullish(),availableModels:d$(w0),currentModelId:C0}),E2=Z({_meta:Q(Y(),X()).nullish(),configOptions:d$(i2).nullish(),models:T2.nullish(),modes:w2.nullish(),sessionId:s2}),D2=Z({_meta:Q(Y(),X()).nullish(),configOptions:d$(i2).nullish(),models:T2.nullish(),modes:w2.nullish()}),O2=Z({_meta:Q(Y(),X()).nullish(),configOptions:d$(i2).nullish(),models:T2.nullish(),modes:w2.nullish(),sessionId:s2}),k2=Z({_meta:Q(Y(),X()).nullish(),configOptions:d$(i2).nullish(),models:T2.nullish(),modes:w2.nullish()}),A2=Z({_meta:Q(Y(),X()).nullish()}),j2=Z({_meta:Q(Y(),X()).nullish(),close:J0.nullish(),fork:o2.nullish(),list:b2.nullish(),resume:A2.nullish()}),M2=Z({_meta:Q(Y(),X()).nullish(),auth:h0.optional().default({}),loadSession:l$().optional().default(!1),mcpCapabilities:v0.optional().default({http:!1,sse:!1}),promptCapabilities:P0.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:j2.optional().default({})}),N2=Z({_meta:Q(Y(),X()).nullish(),agentCapabilities:M2.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:u0.nullish(),authMethods:d$(N1).optional().default([]),protocolVersion:F0}),P2=p$(f$([Z({type:$(`boolean`),value:l$()}),Z({value:$0})]),Z({_meta:Q(Y(),X()).nullish(),configId:Z0,sessionId:s2})),F2=Z({_meta:Q(Y(),X()).nullish(),configOptions:d$(i2)}),I2=Z({_meta:Q(Y(),X()).nullish(),modeId:x2,sessionId:s2}),L2=Z({_meta:Q(Y(),X()).nullish()}),R2=Z({_meta:Q(Y(),X()).nullish(),modelId:C0,sessionId:s2}),z2=Z({_meta:Q(Y(),X()).nullish()}),B2=f$([$(`end_turn`),$(`max_tokens`),$(`max_turn_requests`),$(`refusal`),$(`cancelled`)]),V2=f$([$(`email`),$(`uri`),$(`date`),$(`date-time`)]),H2=Z({default:Y().nullish(),description:Y().nullish(),enum:d$(Y()).nullish(),format:V2.nullish(),maxLength:s$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:s$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:d$(e0).nullish(),pattern:Y().nullish(),title:Y().nullish()}),U2=Z({_meta:Q(Y(),X()).nullish(),terminalId:Y()}),W2=Z({_meta:Q(Y(),X()).nullish(),exitCode:s$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:Y().nullish()}),G2=Z({_meta:Q(Y(),X()).nullish(),sessionId:s2,terminalId:Y()}),K2=Z({_meta:Q(Y(),X()).nullish(),exitStatus:W2.nullish(),output:Y(),truncated:l$()}),q2=Z({_meta:Q(Y(),X()).nullish(),annotations:V0.nullish(),text:Y()}),J2=Z({_meta:Q(Y(),X()).nullish(),mimeType:Y().nullish(),text:Y(),uri:Y()}),Y2=f$([J2,I1]),X2=Z({_meta:Q(Y(),X()).nullish(),annotations:V0.nullish(),resource:Y2}),Z2=f$([q2.and(Z({type:$(`text`)})),U0.and(Z({type:$(`image`)})),H0.and(Z({type:$(`audio`)})),W0.and(Z({type:$(`resource_link`)})),X2.and(Z({type:$(`resource`)}))]),Q2=Z({_meta:Q(Y(),X()).nullish(),content:Z2}),$2=Z({_meta:Q(Y(),X()).nullish(),content:Z2,messageId:Y().nullish()}),e4=Z({_meta:Q(Y(),X()).nullish(),messageId:Y().nullish(),prompt:d$(Z2),sessionId:s2}),Z({id:z0,method:Y(),params:f$([I0,P1,g0,T0,p2,p0,d2,g2,l2,I2,P2,e4,R2,a0]).nullish()}),t4=Z({anyOf:d$(e0)}),n4=f$([Q2.and(Z({type:$(`content`)})),V1.and(Z({type:$(`diff`)})),U2.and(Z({type:$(`terminal`)}))]),r4=Y(),i4=Z({_meta:Q(Y(),X()).nullish(),line:s$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:Y()}),a4=f$([$(`pending`),$(`in_progress`),$(`completed`),$(`failed`)]),o4=f$([$(`read`),$(`edit`),$(`delete`),$(`move`),$(`search`),$(`execute`),$(`think`),$(`fetch`),$(`switch_mode`),$(`other`)]),s4=Z({_meta:Q(Y(),X()).nullish(),content:d$(n4).optional(),kind:o4.optional(),locations:d$(i4).optional(),rawInput:X().optional(),rawOutput:X().optional(),status:a4.optional(),title:Y(),toolCallId:r4}),c4=Z({_meta:Q(Y(),X()).nullish(),content:d$(n4).nullish(),kind:o4.nullish(),locations:d$(i4).nullish(),rawInput:X().optional(),rawOutput:X().optional(),status:a4.nullish(),title:Y().nullish(),toolCallId:r4}),l4=Z({_meta:Q(Y(),X()).nullish(),options:d$(k0),sessionId:s2,toolCall:c4}),u4=Z({_meta:Q(Y(),X()).nullish(),hint:Y()}),d4=u4,f4=Z({_meta:Q(Y(),X()).nullish(),description:Y(),input:d4.nullish(),name:Y()}),p4=Z({_meta:Q(Y(),X()).nullish(),availableCommands:d$(f4)}),m4=Z({enum:d$(Y()),type:X1}),h4=f$([m4,t4]),g4=Z({default:d$(Y()).nullish(),description:Y().nullish(),items:h4,maxItems:s$().nullish(),minItems:s$().nullish(),title:Y().nullish()}),_4=f$([H2.and(Z({type:$(`string`)})),E0.and(Z({type:$(`number`)})),d0.and(Z({type:$(`integer`)})),L1.and(Z({type:$(`boolean`)})),g4.and(Z({type:$(`array`)}))]),v4=Z({description:Y().nullish(),properties:Q(Y(),_4).optional().default({}),required:d$(Y()).nullish(),title:Y().nullish(),type:Y1.optional().default(`object`)}),y4=Z({requestedSchema:v4}),b4=p$(f$([y4.and(Z({mode:$(`form`)})),$1.and(Z({mode:$(`url`)}))]),Z({_meta:Q(Y(),X()).nullish(),message:Y(),sessionId:s2})),x4=Z({cachedReadTokens:s$().nullish(),cachedWriteTokens:s$().nullish(),inputTokens:s$(),outputTokens:s$(),thoughtTokens:s$().nullish(),totalTokens:s$()}),S4=Z({_meta:Q(Y(),X()).nullish(),stopReason:B2,usage:x4.nullish(),userMessageId:Y().nullish()}),f$([Z({id:z0,result:f$([N2,F1,_0,O2,D2,v2,E2,k2,R1,L2,F2,S4,z2,o0])}),Z({error:r0,id:z0})]),C4=Z({_meta:Q(Y(),X()).nullish(),cost:z1.nullish(),size:s$(),used:s$()}),w4=f$([$2.and(Z({sessionUpdate:$(`user_message_chunk`)})),$2.and(Z({sessionUpdate:$(`agent_message_chunk`)})),$2.and(Z({sessionUpdate:$(`agent_thought_chunk`)})),s4.and(Z({sessionUpdate:$(`tool_call`)})),c4.and(Z({sessionUpdate:$(`tool_call_update`)})),N0.and(Z({sessionUpdate:$(`plan`)})),p4.and(Z({sessionUpdate:$(`available_commands_update`)})),S2.and(Z({sessionUpdate:$(`current_mode_update`)})),a2.and(Z({sessionUpdate:$(`config_option_update`)})),y2.and(Z({sessionUpdate:$(`session_info_update`)})),C4.and(Z({sessionUpdate:$(`usage_update`)}))]),T4=Z({_meta:Q(Y(),X()).nullish(),sessionId:s2,update:w4}),Z({method:Y(),params:f$([T4,q1,i0]).nullish()}),E4=Z({_meta:Q(Y(),X()).nullish(),sessionId:s2,terminalId:Y()}),D4=Z({_meta:Q(Y(),X()).nullish(),exitCode:s$().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:Y().nullish()}),O4=Z({_meta:Q(Y(),X()).nullish(),content:Y(),path:Y(),sessionId:s2}),Z({id:z0,method:Y(),params:f$([O4,m2,l4,u2,G2,h2,E4,f2,b4,a0]).nullish()}),k4=Z({_meta:Q(Y(),X()).nullish()}),f$([Z({id:z0,result:f$([k4,L0,q0,B1,K2,R0,D4,f0,J1,o0])}),Z({error:r0,id:z0})])}));function j4(e,t){let n=new TextEncoder,r=new TextDecoder;return{readable:new ReadableStream({async start(e){let n=``,i=t.getReader();try{for(;;){let{value:t,done:a}=await i.read();if(a)break;if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
|
||
`);n=o.pop()||``;for(let t of o){let n=t.trim();if(n)try{let t=JSON.parse(n);e.enqueue(t)}catch(e){console.error(`Failed to parse JSON message:`,n,e)}}}}finally{i.releaseLock(),e.close()}}}),writable:new WritableStream({async write(t){let r=JSON.stringify(t)+`
|
||
`,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}var M4=o((()=>{})),N4,P4,F4,I4=o((()=>{w1(),D1(),A4(),D1(),M4(),N4=class{#e;constructor(e,t){let n=e(this);this.#e=new P4(async(e,t)=>{switch(e){case E1.fs_write_text_file:{let e=O4.parse(t);return n.writeTextFile?.(e)}case E1.fs_read_text_file:{let e=m2.parse(t);return n.readTextFile?.(e)}case E1.session_request_permission:{let e=l4.parse(t);return n.requestPermission(e)}case E1.terminal_create:{let e=u2.parse(t);return n.createTerminal?.(e)}case E1.terminal_output:{let e=G2.parse(t);return n.terminalOutput?.(e)}case E1.terminal_release:{let e=h2.parse(t);return await n.releaseTerminal?.(e)??{}}case E1.terminal_wait_for_exit:{let e=E4.parse(t);return n.waitForTerminalExit?.(e)}case E1.terminal_kill:{let e=f2.parse(t);return await n.killTerminal?.(e)??{}}default:if(n.extMethod)return n.extMethod(e,t);throw F4.methodNotFound(e)}},async(e,t)=>{switch(e){case E1.session_update:{let e=T4.parse(t);return n.sessionUpdate(e)}default:if(n.extNotification)return n.extNotification(e,t);throw F4.methodNotFound(e)}},t)}async initialize(e){return await this.#e.sendRequest(T1.initialize,e)}async newSession(e){return await this.#e.sendRequest(T1.session_new,e)}async loadSession(e){return await this.#e.sendRequest(T1.session_load,e)??{}}async unstable_forkSession(e){return await this.#e.sendRequest(T1.session_fork,e)}async listSessions(e){return await this.#e.sendRequest(T1.session_list,e)}async unstable_resumeSession(e){return await this.#e.sendRequest(T1.session_resume,e)}async unstable_closeSession(e){return await this.#e.sendRequest(T1.session_close,e)}async setSessionMode(e){return await this.#e.sendRequest(T1.session_set_mode,e)??{}}async unstable_setSessionModel(e){return await this.#e.sendRequest(T1.session_set_model,e)??{}}async setSessionConfigOption(e){return await this.#e.sendRequest(T1.session_set_config_option,e)}async authenticate(e){return await this.#e.sendRequest(T1.authenticate,e)??{}}async unstable_logout(e){return await this.#e.sendRequest(T1.logout,e)??{}}async prompt(e){return await this.#e.sendRequest(T1.session_prompt,e)}async cancel(e){return await this.#e.sendNotification(T1.session_cancel,e)}async extMethod(e,t){return await this.#e.sendRequest(e,t)}async extNotification(e,t){return await this.#e.sendNotification(e,t)}get signal(){return this.#e.signal}get closed(){return this.#e.closed}},P4=class{#e=new Map;#t=0;#n;#r;#i;#a=Promise.resolve();#o=new AbortController;#s;constructor(e,t,n){this.#n=e,this.#r=t,this.#i=n,this.#s=new Promise(e=>{this.#o.signal.addEventListener(`abort`,()=>e())}),this.#c()}get signal(){return this.#o.signal}get closed(){return this.#s}async#c(){let e=this.#i.readable.getReader();try{for(;;){let{value:t,done:n}=await e.read();if(n)break;if(t)try{this.#l(t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&this.#p({jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock(),this.#o.abort()}}async#l(e){if(`method`in e&&`id`in e){let t=await this.#u(e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await this.#p({jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await this.#d(e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else `id`in e?this.#f(e):console.error(`Invalid message`,{message:e})}async#u(e,t){try{return{result:await this.#n(e,t)??null}}catch(e){if(e instanceof F4)return e.toResult();if(e instanceof GQ)return F4.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return F4.internalError(t?JSON.parse(t):{}).toResult()}catch{return F4.internalError({details:t}).toResult()}}}async#d(e,t){try{return await this.#r(e,t),{result:null}}catch(e){if(e instanceof F4)return e.toResult();if(e instanceof GQ)return F4.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return F4.internalError(t?JSON.parse(t):{}).toResult()}catch{return F4.internalError({details:t}).toResult()}}}#f(e){let t=this.#e.get(e.id);t?(`result`in e?t.resolve(e.result):`error`in e&&t.reject(e.error),this.#e.delete(e.id)):console.error(`Got response to unknown request`,e.id)}async sendRequest(e,t){let n=this.#t++,r=new Promise((e,t)=>{this.#e.set(n,{resolve:e,reject:t})});return await this.#p({jsonrpc:`2.0`,id:n,method:e,params:t}),r}async sendNotification(e,t){await this.#p({jsonrpc:`2.0`,method:e,params:t})}async#p(e){return this.#a=this.#a.then(async()=>{let t=this.#i.writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{console.error(`ACP write error:`,e)}),this.#a}},F4=class e extends Error{code;data;constructor(e,t,n){super(t),this.code=e,this.name=`RequestError`,this.data=n}static parseError(t,n){return new e(-32700,`Parse error${n?`: ${n}`:``}`,t)}static invalidRequest(t,n){return new e(-32600,`Invalid request${n?`: ${n}`:``}`,t)}static methodNotFound(t){return new e(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,n){return new e(-32602,`Invalid params${n?`: ${n}`:``}`,t)}static internalError(t,n){return new e(-32603,`Internal error${n?`: ${n}`:``}`,t)}static authRequired(t,n){return new e(-32e3,`Authentication required${n?`: ${n}`:``}`,t)}static resourceNotFound(t){return new e(-32002,`Resource not found${t?`: ${t}`:``}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}}})),L4,R4,z4,B4,V4,H4=o((()=>{P_(),I4(),{spawn:L4}=N_(`child_process`),{Writable:R4,Readable:z4}=N_(`stream`),B4={info(){},warn(){},error(){}},V4=class{name;config;cwd;log;proc=null;connection=null;sessions=new Map;sessionMetas=new Map;agentTitle=``;started=!1;chunkCollector=null;constructor(e,t,n,r){this.name=e,this.config=t,this.cwd=n,this.log=r??B4}async start(){if(this.started)return;let e=this.config.command||`claude-agent-acp`,t=this.config.args??[];this.log.info(`[acp] starting subprocess: ${e} ${t.join(` `)}`),this.proc=L4(e,t,{cwd:this.cwd,stdio:[`pipe`,`pipe`,`pipe`],env:{...process.env,...this.config.env}}),this.proc.stderr?.on(`data`,e=>{let t=e.toString().trim();t&&this.log.warn(`[acp-stderr] ${t}`)}),this.proc.on(`exit`,e=>{this.log.info(`[acp] subprocess exited (code=${e})`),this.started=!1});let n=j4(R4.toWeb(this.proc.stdin),z4.toWeb(this.proc.stdout));this.connection=new N4(()=>({requestPermission:async e=>{let t=e.options.find(e=>e.kind===`allow`)?.optionId??e.options[0]?.optionId??`allow`;return this.log.info(`[acp] auto-allowed permission request`),{outcome:{outcome:`selected`,optionId:t}}},sessionUpdate:async e=>{this.handleSessionUpdate(e)},readTextFile:async()=>({content:``}),writeTextFile:async()=>({})}),n);let r=await this.connection.initialize({protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}});this.agentTitle=r.agentInfo?.title||r.agentInfo?.name||this.name,this.started=!0,this.log.info(`[acp] initialized: ${this.agentTitle} v${r.agentInfo?.version??`?`} (pid=${this.proc.pid})`)}async chat(e,t,n){this.started||await this.start();let r=this.sessions.get(e);r?this.log.info(`[acp] reusing session (session=${r}, conversation=${e})`):r=await this.createSession(e);let i=[];this.chunkCollector=i;try{await this.connection.prompt({sessionId:r,prompt:[{type:`text`,text:t}]})}finally{this.chunkCollector=null}let a=i.join(``).trim();if(!a)throw Error(`agent returned empty response`);return a}async createSession(e){let t=await this.connection.newSession({cwd:this.cwd,mcpServers:[]}),n=t.sessionId;this.sessions.set(e,n);let r={};if(t.models&&(r.models={current:t.models.currentModelId,available:t.models.availableModels.map(e=>({id:e.modelId,name:e.name}))}),t.modes&&(r.modes={current:t.modes.currentModeId,available:t.modes.availableModes.map(e=>({id:e.id,name:e.name}))}),t.configOptions&&(r.configOptions=t.configOptions.map(e=>({id:e.id,name:e.name,type:e.type,current:(e.type,e.currentValue)}))),this.sessionMetas.set(e,r),this.config.model&&r.models){let e=r.models.available.find(e=>e.id===this.config.model||e.name.toLowerCase().includes(this.config.model.toLowerCase()));if(e&&e.id!==r.models.current)try{await this.connection.unstable_setSessionModel({sessionId:n,modelId:e.id}),r.models.current=e.id,this.log.info(`[acp] set default model to ${e.id}`)}catch(e){this.log.warn(`[acp] failed to set default model: ${e}`)}}return this.log.info(`[acp] new session (session=${n}, conversation=${e})`),n}hasSession(e){return this.sessions.has(e)}cancelPrompt(e){let t=this.sessions.get(e);!t||!this.connection||(this.log.info(`[acp] cancelling prompt (session=${t})`),this.connection.cancel({sessionId:t}))}async resetSession(e){return this.sessions.delete(e),this.sessionMetas.delete(e),this.log.info(`[acp] session reset (conversation=${e})`),this.started||await this.start(),this.createSession(e)}getSessionMeta(e){return this.sessionMetas.get(e)??null}async setModel(e,t){let n=this.sessions.get(e);if(!n||!this.connection)throw Error(`No active session`);await this.connection.unstable_setSessionModel({sessionId:n,modelId:t});let r=this.sessionMetas.get(e);r?.models&&(r.models.current=t),this.log.info(`[acp] model switched to ${t} (session=${n})`)}async setMode(e,t){let n=this.sessions.get(e);if(!n||!this.connection)throw Error(`No active session`);await this.connection.setSessionMode({sessionId:n,modeId:t});let r=this.sessionMetas.get(e);r?.modes&&(r.modes.current=t),this.log.info(`[acp] mode switched to ${t} (session=${n})`)}async setConfigOption(e,t,n){let r=this.sessions.get(e);if(!r||!this.connection)throw Error(`No active session`);await this.connection.setSessionConfigOption({sessionId:r,configOptionId:t,value:n});let i=this.sessionMetas.get(e);if(i?.configOptions){let e=i.configOptions.find(e=>e.id===t);e&&(e.current=n)}this.log.info(`[acp] config ${t} = ${n} (session=${r})`)}info(){return{name:this.agentTitle||this.name,type:`acp`,model:this.config.model||``,command:this.config.command||`claude-agent-acp`,pid:this.proc?.pid}}stop(){this.proc&&=(this.log.info(`[acp] stopping subprocess (pid=${this.proc.pid})`),this.proc.kill(),null),this.connection=null,this.started=!1,this.sessions.clear(),this.sessionMetas.clear()}handleSessionUpdate(e){let t=e.update;t.sessionUpdate===`agent_message_chunk`&&t.content.type===`text`&&this.chunkCollector?.push(t.content.text)}}})),U4,W4,G4,K4,q4=o((()=>{P_(),{spawn:U4}=N_(`child_process`),{createInterface:W4}=N_(`readline`),G4={info(){},warn(){},error(){}},K4=class{agentName;config;cwd;log;sessions=new Map;constructor(e,t,n,r){this.agentName=e,this.config=t,this.cwd=n,this.log=r??G4}async chat(e,t,n){switch(this.agentName){case`codex`:return this.chatCodex(t,n);case`gemini`:return this.chatGemini(t,n);default:return this.chatClaude(e,t,n)}}async chatClaude(e,t,n){let r=this.config.command||`claude`,i=[`-p`,t,`--output-format`,`stream-json`,`--verbose`];switch(this.config.model&&i.push(`--model`,this.config.model),this.config.systemPrompt&&i.push(`--append-system-prompt`,this.config.systemPrompt),this.config.permissionMode){case`bypass-permissions`:i.push(`--permission-mode`,`bypassPermissions`);break;case`dont-ask`:i.push(`--permission-mode`,`dontAsk`);break;case`plan-mode`:i.push(`--permission-mode`,`plan`);break;case`accept-edits`:i.push(`--permission-mode`,`acceptEdits`);break}this.config.args&&i.push(...this.config.args);let a=this.sessions.get(e);a?(i.push(`--resume`,a),this.log.info(`[cli] resuming session (session=${a}, conversation=${e})`)):this.log.info(`[cli] starting new conversation (command=${r}, conversation=${e})`);let o=U4(r,i,{cwd:this.cwd,stdio:[`pipe`,`pipe`,`pipe`],env:{...process.env,...this.config.env}});n&&n.addEventListener(`abort`,()=>o.kill(),{once:!0}),this.log.info(`[cli] spawned process (command=${r}, pid=${o.pid})`);let s=``,c=``,l=[],u=W4({input:o.stdout});for await(let e of u)if(e.trim())try{let t=JSON.parse(e);if(t.session_id&&(c=t.session_id),t.type===`result`){if(t.is_error)throw Error(`${this.agentName} error: ${t.result}`);s=t.result||``}else if(t.type===`assistant`&&t.message?.content)for(let e of t.message.content)e.type===`text`&&e.text&&l.push(e.text)}catch(e){if(e instanceof SyntaxError)continue;throw e}if(await new Promise((e,t)=>{o.on(`exit`,n=>{n!==0&&!s&&l.length===0?t(Error(`${this.agentName} exited with code ${n}`)):e()}),o.on(`error`,t)}),!s&&l.length>0&&(s=l.join(``)),c&&(this.sessions.set(e,c),this.log.info(`[cli] saved session (session=${c}, conversation=${e})`)),s=s.trim(),!s)throw Error(`${this.agentName} returned empty response`);return s}async chatCodex(e,t){let n=this.config.command||`codex`,r=[`exec`,e];switch(this.config.model&&r.push(`--model`,this.config.model),this.config.permissionMode){case`bypass-permissions`:r.push(`--dangerously-bypass-approvals-and-sandbox`);break;case`dont-ask`:r.push(`--full-auto`);break;case`plan-mode`:r.push(`-s`,`read-only`);break;case`accept-edits`:r.push(`-a`,`untrusted`,`-s`,`workspace-write`);break}this.config.reasoningEffort&&this.config.reasoningEffort!==`medium`&&r.push(`--reasoning-effort`,this.config.reasoningEffort),this.config.args&&r.push(...this.config.args),this.log.info(`[cli] running codex exec (command=${n})`);let i=U4(n,r,{cwd:this.cwd,stdio:[`pipe`,`pipe`,`pipe`],env:{...process.env,...this.config.env}});t&&t.addEventListener(`abort`,()=>i.kill(),{once:!0});let a=[];i.stdout?.on(`data`,e=>a.push(e));let o=[];i.stderr?.on(`data`,e=>o.push(e));let s=await new Promise((e,t)=>{i.on(`exit`,e),i.on(`error`,t)}),c=Buffer.concat(a).toString().trim();if(s!==0&&!c){let e=Buffer.concat(o).toString().trim();throw Error(`codex error (code=${s}): ${e||`unknown`}`)}if(!c)throw Error(`codex returned empty response`);return c}async chatGemini(e,t){let n=this.config.command||`gemini`,r=[`prompt`,e];switch(this.config.model&&r.push(`--model`,this.config.model),this.config.permissionMode){case`bypass-permissions`:case`dont-ask`:r.push(`--yolo`);break;case`plan-mode`:r.push(`--approval-mode`,`plan`);break;case`accept-edits`:r.push(`--approval-mode`,`auto_edit`);break}this.config.args&&r.push(...this.config.args),this.log.info(`[cli] running ${this.agentName} (command=${n})`);let i=U4(n,r,{cwd:this.cwd,stdio:[`pipe`,`pipe`,`pipe`],env:{...process.env,...this.config.env}});t&&t.addEventListener(`abort`,()=>i.kill(),{once:!0});let a=[];i.stdout?.on(`data`,e=>a.push(e));let o=[];i.stderr?.on(`data`,e=>o.push(e));let s=await new Promise((e,t)=>{i.on(`exit`,e),i.on(`error`,t)}),c=Buffer.concat(a).toString().trim();if(s!==0&&!c){let e=Buffer.concat(o).toString().trim();throw Error(`${this.agentName} error (code=${s}): ${e||`unknown`}`)}if(!c)throw Error(`${this.agentName} returned empty response`);return c}hasSession(e){return this.sessions.has(e)}cancelPrompt(){}async resetSession(e){return this.sessions.delete(e),this.log.info(`[cli] session reset (conversation=${e})`),``}info(){return{name:this.agentName,type:`cli`,model:this.config.model||``,command:this.config.command||this.agentName}}stop(){this.sessions.clear()}}})),J4,Y4,X4=o((()=>{J4={info(){},warn(){},error(){}},Y4=class{agentName;config;log;history=new Map;maxHistory;constructor(e,t,n){this.agentName=e,this.config=t,this.log=n??J4,this.maxHistory=t.maxHistory||20}async chat(e,t,n){let r=this.config.endpoint;if(!r)throw Error(`HTTP agent requires endpoint`);let i=this.buildMessages(e,t),a=JSON.stringify({model:this.config.model||`gpt-5.4-mini`,messages:i});this.log.info(`[http] sending to ${r} (conversation=${e})`);let o=await(0,f.requestUrl)({url:r,method:`POST`,headers:{"Content-Type":`application/json`,...this.config.apiKey?{Authorization:`Bearer ${this.config.apiKey}`}:{},...this.config.headers},body:a});if(o.status!==200)throw Error(`HTTP agent error ${o.status}: ${o.text}`);let s=o.json?.choices?.[0]?.message?.content;if(!s)throw Error(`HTTP agent: no content in response`);let c=this.history.get(e)??[];c.push({role:`user`,content:t},{role:`assistant`,content:s});let l=this.maxHistory*2;return c.length>l&&c.splice(0,c.length-l),this.history.set(e,c),this.log.info(`[http] reply received (conversation=${e}, len=${s.length})`),s}hasSession(e){return this.history.has(e)}cancelPrompt(){}async resetSession(e){return this.history.delete(e),this.log.info(`[http] session reset (conversation=${e})`),``}info(){return{name:this.agentName,type:`http`,model:this.config.model||`gpt-5.4-mini`,command:this.config.endpoint||``}}stop(){this.history.clear()}buildMessages(e,t){let n=[];this.config.systemPrompt&&n.push({role:`system`,content:this.config.systemPrompt});let r=this.history.get(e);return r&&n.push(...r),n.push({role:`user`,content:t}),n}}}));function Z4(e,t,n,r,i){let a=t.cwd||n,o={...t};switch(i&&(o.systemPrompt=i+`\nYour current working directory is: ${a}\nFiles must be within this directory to be sent automatically.`+(t.systemPrompt?`
|
||
|
||
`+t.systemPrompt:``)),o.type){case`acp`:return new V4(e,o,a,r);case`cli`:return new K4(e,o,a,r);case`http`:return new Y4(e,o,r);default:throw Error(`Unknown agent type: ${o.type}`)}}var Q4=o((()=>{H4(),q4(),X4()}));function $4(e,t){return t?.[e]?t[e]:r3[e]?r3[e]:e}function e3(e,t,n){let r=e.trim();if(!r.startsWith(`/`)&&!r.startsWith(`@`))return null;let i=[],a=r;for(;a.length>0&&(a=a.trimStart(),!(!a.startsWith(`/`)&&!a.startsWith(`@`)));){let e=a.slice(1),t=e.search(/[\s/@]/),r;if(t<0?(r=e,a=``):e[t]===`/`||e[t]===`@`?(r=e.slice(0,t),a=e.slice(t)):(r=e.slice(0,t),a=e.slice(t).trimStart()),r){let e=$4(r,n);if(i3.has(r))return null;i.push(e)}if(!a)break}if(i.length===0)return null;let o=new Set,s=i.filter(e=>o.has(e)?!1:(o.add(e),!0)).filter(e=>t.has(e));return s.length===0?null:{agents:s,message:a}}function t3(e,t){let n=[`Available commands:`,`@agent or /agent - Switch default agent`,`@agent msg or /agent msg - Send to a specific agent`,`@a @b msg - Broadcast to multiple agents`,`/new or /clear - Start a new session`,`/info - Show current agent info`,`/help - Show this help message`,``,`Default agent: ${t||`none`}`,``,`Configured agents:`];for(let[t,r]of Object.entries(e)){let e=r.aliases?.length?` (aliases: ${r.aliases.join(`, `)})`:``;n.push(` ${t} [${r.type}]${e}`)}n.push(``,`Built-in aliases:`);let r=Object.entries(r3).filter(([,t])=>e[t]).map(([e,t])=>`/${e}(${t})`);return r.length>0?n.push(` ${r.join(` `)}`):n.push(` (none active — configure agents to enable aliases)`),n.join(`
|
||
`)}var n3,r3,i3,a3,o3=o((()=>{Q4(),n3={info(){},warn(){},error(){}},r3={cc:`claude`,cx:`codex`,cs:`cursor`,km:`kimi`,gm:`gemini`,oc:`openclaw`,ocd:`opencode`,pi:`pi`,cp:`copilot`,dr:`droid`,if:`iflow`,kr:`kiro`,qw:`qwen`},i3=new Set([`info`,`help`,`new`,`clear`]),a3=class{agents=new Map;configs;_defaultAgent;cwd;log;customAliases;baseSystemPrompt;activeAgent=new Map;userLock=new Map;inFlight=new Map;constructor(e,t,n,r){this.configs=e,this._defaultAgent=t,this.cwd=n,this.log=r?.logger??n3,this.customAliases=r?.customAliases,this.baseSystemPrompt=r?.baseSystemPrompt}get defaultAgent(){return this._defaultAgent}set defaultAgent(e){this._defaultAgent=e}get knownAgents(){return new Set(Object.keys(this.configs))}async getOrCreateAgent(e){let t=this.agents.get(e);if(t)return t;let n=this.configs[e];if(!n)throw Error(`Agent "${e}" not configured`);return this.log.info(`[router] starting agent "${e}" on demand...`),t=Z4(e,n,this.cwd,this.log,this.baseSystemPrompt),this.agents.set(e,t),t}async chat(e,t,n){let r=this.userLock.get(t)??Promise.resolve(),i,a=new Promise(e=>{i=e});this.userLock.set(t,a);try{await r;let i=await this.getOrCreateAgent(e),a=i.info();this.log.info(`[router] dispatching to ${a.name} for ${t}`);let o=n.length>30?n.slice(0,30)+`...`:n;this.inFlight.set(t,{agent:e,startedAt:Date.now(),message:o});try{let e=await i.chat(t,n),r=Date.now()-(this.inFlight.get(t)?.startedAt??Date.now());return this.log.info(`[router] ${a.name} replied (elapsed=${r}ms, len=${e.length})`),e}finally{this.inFlight.delete(t)}}finally{i(),this.userLock.get(t)===a&&this.userLock.delete(t)}}async broadcast(e,t,n){let r=e.map(async e=>{try{return{name:e,reply:await this.chat(e,t,n)}}catch(t){return{name:e,reply:`Error: ${t instanceof Error?t.message:String(t)}`}}});return Promise.all(r)}async resetSession(e,t){let n=this.agents.get(e);return n?n.resetSession(t):``}cancelActivePrompt(e){let t=this.activeAgent.get(e)||this._defaultAgent;if(!t)return`No agent active.`;let n=this.agents.get(t);return n?(n.cancelPrompt(e),`Cancelled ${n.info().name}`):`Agent not started.`}getActiveAgent(e){return this.activeAgent.get(e)??null}setActiveAgent(e,t){this.activeAgent.set(e,t),this.log.info(`[router] active agent for ${e} → ${t}`)}clearActiveAgent(e){this.activeAgent.delete(e),this.log.info(`[router] active agent cleared for ${e}`)}async resetActiveSession(e){let t=this.activeAgent.get(e)||this._defaultAgent;if(!t)return`No agent active.`;let n=this.agents.get(t);if(!n)return`Agent not started.`;n.cancelPrompt(e),this.activeAgent.delete(e);let r=await n.resetSession(e),i=n.info().name;return this.log.info(`[router] /new: reset ${i} for ${e}`),r?`${i} session reset\n${r}`:`${i} session reset`}listUserSessions(e){let t=[],n=this.activeAgent.get(e),r=1;for(let[i,a]of this.agents)a.hasSession(e)&&t.push({index:r++,name:i,active:i===n});return t}formatSessionList(e){let t=this.listUserSessions(e);if(t.length===0)return`No active sessions.`;let n=[`Sessions:`,``];for(let e of t){let t=e.active?` *`:``;n.push(` ${e.index}. ${e.name}${t}`)}return n.push(``,`Reply /resume <number> to switch.`),n.join(`
|
||
`)}resumeByIndex(e,t){let n=this.listUserSessions(e).find(e=>e.index===t);return n?(this.activeAgent.set(e,n.name),this.log.info(`[router] /resume: ${e} → ${n.name}`),`Resumed ${n.name}`):`Invalid session number: ${t}`}resumeByName(e,t){let n=this.resolveAlias(t),r=this.agents.get(n);return!r||!r.hasSession(e)?`No session found for "${n}"`:(this.activeAgent.set(e,n),this.log.info(`[router] /resume: ${e} → ${n}`),`Resumed ${n}`)}resolveAlias(e){return this.customAliases?.[e]?this.customAliases[e]:r3[e]?r3[e]:e}getAgentInfo(e){let t=this.activeAgent.get(e),n=[];if(t){let r=this.agents.get(t),i=r?.info();n.push(`active: ${t}${i?` [${i.type}]`:``}`);let a=r?.getSessionMeta?.(e);if(a?.models){let e=a.models.available.find(e=>e.id===a.models.current);n.push(`model: ${e?.name||a.models.current}`)}else i?.model&&n.push(`model: ${i.model}`);if(a?.modes){let e=a.modes.available.find(e=>e.id===a.modes.current);n.push(`mode: ${e?.name||a.modes.current}`)}}else n.push(`active: none (thino mode)`);return this._defaultAgent&&n.push(`default: ${this._defaultAgent}`),n.join(`
|
||
`)}getActiveHelp(e){let t=this.activeAgent.get(e),n=[];if(t){let r=this.agents.get(t),i=r?.info();n.push(`Current: ${t} [${i?.type||`?`}]`);let a=r?.getSessionMeta?.(e);if(a?.models){let e=a.models.available.find(e=>e.id===a.models.current);n.push(`Model: ${e?.name||a.models.current}`),n.push(` /model <id> to switch. Available:`);for(let e of a.models.available){let t=e.id===a.models.current?` *`:``;n.push(` - ${e.id} (${e.name})${t}`)}}if(a?.modes){let e=a.modes.available.find(e=>e.id===a.modes.current);n.push(`Mode: ${e?.name||a.modes.current}`),n.push(` /mode <id> to switch. Available:`);for(let e of a.modes.available){let t=e.id===a.modes.current?` *`:``;n.push(` - ${e.id} (${e.name})${t}`)}}n.push(``)}else n.push(`No active agent (thino mode)`),n.push(``);n.push(`Commands:`),n.push(` @agent msg - Send to agent`),n.push(` @a @b msg - Broadcast`),n.push(` /thino <text> - Save as thino`),n.push(` /d, /t, /n - Diary/Todo/Note`),t?(n.push(` /info - Agent info`),n.push(` /new - Reset session`),n.push(` /cancel - Stop generation`),n.push(` /resume - Switch session`),meta?.models&&n.push(` /model <id> - Switch model`),meta?.modes&&n.push(` /mode <id> - Switch mode`),meta?.configOptions?.length&&n.push(` /config <id> <val> - Set config`)):n.push(` /resume - Resume a previous session`),n.push(` /status - Running tasks`);let r=Object.entries(r3).filter(([,e])=>this.configs[e]).map(([e,t])=>`/${e}(${t})`);return r.length>0&&n.push(``,`Aliases: ${r.join(` `)}`),n.join(`
|
||
`)}async setActiveModel(e,t){let n=this.activeAgent.get(e);if(!n)return`No active agent. Use @agent first.`;let r=this.agents.get(n);if(!r)return`Agent not started.`;if(!r.setModel)return`${n} does not support model switching.`;let i=r.getSessionMeta?.(e),a=t;if(i?.models&&!i.models.available.find(e=>e.id===t)){let e=i.models.available.find(e=>e.id.toLowerCase().includes(t.toLowerCase())||e.name.toLowerCase().includes(t.toLowerCase()));if(e)a=e.id;else return`Model "${t}" not found. Available:\n${i.models.available.map(e=>` - ${e.id} (${e.name})`).join(`
|
||
`)}`}try{return await r.setModel(e,a),`Model switched to ${a}`}catch(e){return`Failed: ${e instanceof Error?e.message:String(e)}`}}async setActiveMode(e,t){let n=this.activeAgent.get(e);if(!n)return`No active agent. Use @agent first.`;let r=this.agents.get(n);if(!r)return`Agent not started.`;if(!r.setMode)return`${n} does not support mode switching.`;let i=r.getSessionMeta?.(e),a=t;if(i?.modes&&!i.modes.available.find(e=>e.id===t)){let e=i.modes.available.find(e=>e.id.toLowerCase().includes(t.toLowerCase())||e.name.toLowerCase().includes(t.toLowerCase()));if(e)a=e.id;else return`Mode "${t}" not found. Available:\n${i.modes.available.map(e=>` - ${e.id} (${e.name})`).join(`
|
||
`)}`}try{return await r.setMode(e,a),`Mode switched to ${a}`}catch(e){return`Failed: ${e instanceof Error?e.message:String(e)}`}}listModels(e){let t=this.activeAgent.get(e);if(!t)return`No active agent.`;let n=this.agents.get(t)?.getSessionMeta?.(e);if(!n?.models)return`${t} does not expose model list.`;let r=[`Models (${t}):`];for(let e of n.models.available){let t=e.id===n.models.current?` *`:``;r.push(` ${e.id} - ${e.name}${t}`)}return r.join(`
|
||
`)}listModes(e){let t=this.activeAgent.get(e);if(!t)return`No active agent.`;let n=this.agents.get(t)?.getSessionMeta?.(e);if(!n?.modes)return`${t} does not expose mode list.`;let r=[`Modes (${t}):`];for(let e of n.modes.available){let t=e.id===n.modes.current?` *`:``;r.push(` ${e.id} - ${e.name}${t}`)}return r.join(`
|
||
`)}listConfig(e){let t=this.activeAgent.get(e);if(!t)return`No active agent.`;let n=this.agents.get(t)?.getSessionMeta?.(e);if(!n?.configOptions?.length)return`${t} has no config options.`;let r=[`Config (${t}):`];for(let e of n.configOptions)r.push(` ${e.id}: ${e.current} [${e.type}] - ${e.name}`);return r.push(``,`/config <id> <value> to change.`),r.join(`
|
||
`)}async setActiveConfig(e,t,n){let r=this.activeAgent.get(e);if(!r)return`No active agent.`;let i=this.agents.get(r);if(!i)return`Agent not started.`;if(!i.setConfigOption)return`${r} does not support config options.`;let a=n;n===`true`?a=!0:n===`false`&&(a=!1);try{return await i.setConfigOption(e,t,a),`${t} = ${n}`}catch(e){return`Failed: ${e instanceof Error?e.message:String(e)}`}}getStatus(){let e=[],t=[...this.agents.entries()].map(([e,t])=>{let n=t.info(),r=n.pid?` pid=${n.pid}`:``;return` ${e} [${n.type}]${r}`});e.push(`Running agents (${t.length}):`),t.length>0?e.push(...t):e.push(` (none)`),e.push(``);let n=[...this.inFlight.entries()].map(([e,t])=>{let n=Math.round((Date.now()-t.startedAt)/1e3);return` [${t.agent}] ${e} (${n}s) "${t.message}"`});e.push(`In-flight tasks (${n.length}):`),n.length>0?e.push(...n):e.push(` (none)`);let r=[...this.activeAgent.entries()];if(r.length>0){e.push(``),e.push(`Active sessions (${r.length}):`);for(let[t,n]of r)e.push(` ${t} → ${n}`)}return e.join(`
|
||
`)}async switchDefault(e){return this.configs[e]?(await this.getOrCreateAgent(e),this._defaultAgent=e,`Switched to ${e}`):`Agent "${e}" not configured`}parseCommand(e){return e3(e,this.knownAgents,this.customAliases)}helpText(){return t3(this.configs,this._defaultAgent)}stopAll(){for(let[e,t]of this.agents)this.log.info(`[router] stopping agent "${e}"`),t.stop();this.agents.clear()}}}));function s3(e){let t=e;return t=t.replace(g3,(e,t)=>t?t.trim():``),t=t.replace(v3,``),t=t.replace(y3,`$1`),t=t.replace(b3,``),t=t.replace(x3,(e,t)=>t.split(`|`).map(e=>e.trim()).join(` `)),t=t.replace(S3,``),t=t.replace(C3,(e,t,n)=>t||n),t=t.replace(w3,`$1`),t=t.replace(T3,``),t=t.replace(E3,``),t=t.replace(D3,`$1• `),t=t.replace(_3,`$1`),t=t.replace(O3,`
|
||
|
||
`),t.trim()}function c3(e){let t=[];for(let n of e.matchAll(k3)){let e=n[1].trim();(e.startsWith(`http://`)||e.startsWith(`https://`))&&t.push(e)}return t}function l3(e){let t=[],n=new Set;for(let r of e.split(`
|
||
`)){let e=r.trim();if(!e||!h3.isAbsolute(e))continue;let i=h3.extname(e).toLowerCase();if(M3.has(i)){try{if(m3.statSync(e).isDirectory())continue}catch{continue}n.has(e)||(n.add(e),t.push(e))}}return t}function u3(e,t){if(t.includes(``))return!0;let n;try{n=m3.realpathSync(e)}catch{try{n=h3.resolve(e)}catch{return!1}}for(let e of t){if(!e)continue;let t;try{t=m3.realpathSync(e)}catch{t=h3.resolve(e)}let r=h3.relative(t,n);if(r===`.`||!r.startsWith(`..`)&&!h3.isAbsolute(r))return!0}return!1}function d3(e,t,n){let r=new Map(t.map(e=>[e,`已发送附件:${h3.basename(e)}`])),i=e.split(`
|
||
`).map(e=>{let t=e.trim();return r.get(t)??e}).join(`
|
||
`),a=[...new Set(n)];if(a.length>0){let e=a.map(e=>`附件发送失败:${h3.basename(e)}`);i=i.trim()?i+`
|
||
`+e.join(`
|
||
`):e.join(`
|
||
`)}return i}function f3(e){let t=h3.extname(e).toLowerCase();return A3.has(t)?bK.Image:j3.has(t)?bK.Video:bK.File}async function p3(e){let{weclaw:t,toUserId:n,contextToken:r,allowedRoots:i,log:a}=e,{reply:o}=e,s=l3(o),c=[],l=[];for(let e of s){if(!u3(e,i)){a?.warn(`[media] rejected attachment outside allowed roots: ${e}`),l.push(e);continue}try{let i=m3.readFileSync(e),o=f3(e);await t.sendMedia(n,Buffer.from(i),o,{fileName:h3.basename(e),contextToken:r}),c.push(e),a?.info(`[media] sent attachment: ${e}`)}catch(t){a?.error(`[media] failed to send attachment ${e}:`,t),l.push(e)}}o=d3(o,c,l);let u=c3(o),d=s3(o);d&&await t.sendText(n,d,r);for(let e of u)try{let i=await(0,f.requestUrl)({url:e,method:`GET`});if(i.status!==200){a?.warn(`[media] failed to download image ${e}: HTTP ${i.status}`);continue}let o=Buffer.from(i.arrayBuffer);await t.sendMedia(n,o,bK.Image,{contextToken:r}),a?.info(`[media] sent image from URL: ${e}`)}catch(t){a?.error(`[media] failed to send image ${e}:`,t)}}var m3,h3,g3,_3,v3,y3,b3,x3,S3,C3,w3,T3,E3,D3,O3,k3,A3,j3,M3,N3=o((()=>{P_(),SK(),m3=N_(`fs`),h3=N_(`path`),g3=/```[^\n]*\n?([\s\S]*?)```/g,_3=/`([^`]+)`/g,v3=/!\[[^\]]*\]\([^)]*\)/g,y3=/\[([^\]]+)\]\([^)]*\)/g,b3=/^\|[\s:|-]+\|$/gm,x3=/^\|(.+)\|$/gm,S3=/^#{1,6}\s+/gm,C3=/\*\*(.+?)\*\*|__(.+?)__/g,w3=/~~(.+?)~~/g,T3=/^>\s?/gm,E3=/^[-*_]{3,}\s*$/gm,D3=/^(\s*)[-*+]\s+/gm,O3=/\n{3,}/g,k3=/!\[[^\]]*\]\(([^)]+)\)/g,A3=new Set([`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.bmp`]),j3=new Set([`.mp4`,`.mov`,`.webm`,`.mkv`,`.avi`]),M3=new Set([...A3,...j3,`.pdf`,`.doc`,`.docx`,`.xls`,`.xlsx`,`.ppt`,`.pptx`,`.zip`,`.txt`,`.csv`])})),P3=c({WeChatService:()=>I3});function F3(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}var I3,L3=o((()=>{kK(),MK(),lq(),mK(),yq(),N(),H(),Rg(),Mv(),Cv(),SK(),o3(),N3(),jG(),I3=class{plugin;weclaw=null;storage;silkCodec;qrModal=null;loginAbort=null;router=null;constructor(e){this.plugin=e,this.storage=new jK(e.app,e.manifest.id),this.silkCodec=new vq(e.app,e.manifest.id)}async isVerified(){let e=L.getState()?.verifyState;if(!e)return!1;let t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Dv():t?.identifier||t?.uuid;return e.appId===n}async start(){if(!f.Platform.isDesktop){new f.Notice(M(`WeChat integration is only available on desktop`));return}if(!await this.isVerified()){Sv();return}if(this.weclaw?.running){new f.Notice(M(`WeChat is already running`));return}this.storage.loadSecrets();let e=this.plugin.settings.wechat,t={info:(e,...t)=>console.log(e,...t),warn:(e,...t)=>console.warn(e,...t),error:(e,...t)=>console.error(e,...t)};this.initRouter(t),this.weclaw=new OK(this.storage,{defaultReply:e.defaultReply||!1,logger:t}),this.registerCommands(),this.weclaw.on(`qrcode`,({imageBase64:e})=>{this.qrModal&&this.qrModal.setQRCode(e)}),this.weclaw.on(`scanned`,()=>{this.qrModal?.setStatus(`scanned`,M(`Scanned! Please confirm on your phone.`))}),this.weclaw.on(`login`,()=>{this.qrModal?.setStatus(`confirmed`,M(`Login successful!`)),setTimeout(()=>this.qrModal?.close(),1500)}),this.weclaw.on(`ready`,()=>{new f.Notice(M(`WeChat connected`))}),this.weclaw.on(`error`,e=>{console.error(`[WeChatService] error:`,e)}),this.weclaw.on(`stopped`,()=>{new f.Notice(M(`WeChat disconnected`))}),this.storage.loadCredentials()||this.showQRModal(),this.weclaw.start().catch(e=>{console.error(`[WeChatService] start failed:`,e),e.message===`QR code expired`?this.qrModal?.setStatus(`expired`,M(`QR code expired. Please restart.`)):new f.Notice(`WeChat: ${e.message}`)})}stop(){this.loginAbort?.abort(),this.loginAbort=null,this.weclaw?.stop(),this.qrModal?.close(),this.qrModal=null,this.router?.stopAll(),this.router=null}logout(){this.router?.stopAll(),this.router=null,this.weclaw?.logout(),this.weclaw=null,new f.Notice(M(`WeChat logged out`))}get running(){return this.weclaw?.running??!1}hasCredentials(){return this.storage.loadCredentials()!==null}onunload(){this.stop(),this.weclaw?.removeAllListeners(),this.weclaw=null}showQRModal(){this.qrModal=new cq(this.plugin.app,()=>{this.loginAbort?.abort()}),this.qrModal.open()}initRouter(e){let t=this.plugin.settings.wechat.agentRouting;if(!t?.enabled){this.router=null;return}let n=t.agents??{};if(Object.keys(n).length===0){console.warn(`[WeChatService] agent routing enabled but no agents configured`),this.router=null;return}let r=this.plugin.app.vault.adapter.basePath||process.cwd(),i=t.cwd||r;this.router=new a3(n,t.defaultAgent||``,i,{logger:e,customAliases:t.customAliases,baseSystemPrompt:t.baseSystemPrompt??kG}),console.log(`[WeChatService] agent router initialized (default=${t.defaultAgent}, agents=${Object.keys(n).join(`,`)})`)}registerCommands(){if(!this.weclaw)return;let e=()=>this.plugin.settings.MemoSaveLocation||`DAILY`;this.weclaw.onDefault(async t=>this.handleDefaultMessage(t,e())),this.weclaw.command([`d`,`diary`],async e=>this.handleMessage(e,`DAILY`)),this.weclaw.command([`t`,`todo`],async t=>this.handleMessage(t,e(),!0)),this.weclaw.command([`n`,`note`],async e=>this.handleMessage(e,`MULTI`)),this.router&&(this.weclaw.command(`info`,async e=>this.router.getAgentInfo(e.fromUserId)),this.weclaw.command([`new`,`clear`],async e=>this.router.resetActiveSession(e.fromUserId)),this.weclaw.command(`help`,async e=>this.router.getActiveHelp(e.fromUserId)),this.weclaw.command(`model`,async e=>{let t=e.text.trim();return t?this.router.setActiveModel(e.fromUserId,t):this.router.listModels(e.fromUserId)}),this.weclaw.command(`mode`,async e=>{let t=e.text.trim();return t?this.router.setActiveMode(e.fromUserId,t):this.router.listModes(e.fromUserId)}),this.weclaw.command(`config`,async e=>{let t=e.text.trim();if(!t)return this.router.listConfig(e.fromUserId);let n=t.indexOf(` `);if(n<0)return this.router.listConfig(e.fromUserId);let r=t.slice(0,n),i=t.slice(n+1).trim();return this.router.setActiveConfig(e.fromUserId,r,i)}),this.weclaw.command(`status`,async()=>this.router.getStatus()),this.weclaw.command([`cancel`,`stop`],async e=>this.router.cancelActivePrompt(e.fromUserId)),this.weclaw.command(`resume`,async e=>{let t=e.text.trim();if(!t)return this.router.formatSessionList(e.fromUserId);let n=parseInt(t,10);return isNaN(n)?this.router.resumeByName(e.fromUserId,t):this.router.resumeByIndex(e.fromUserId,n)}),this.weclaw.command(`thino`,async t=>t.text?this.handleMessage(t,e()):M(`Usage: /thino <content>`)))}async handleDefaultMessage(e,t){if(!this.router||!this.weclaw)return this.handleMessage(e,t);try{let t=this.router.parseCommand(e.fullText);if(t){if(t.agents.length===1&&!t.message)return this.router.setActiveAgent(e.fromUserId,t.agents[0]),await this.router.switchDefault(t.agents[0]);let n=t.message||e.text||e.fullText;if(t.agents.length===1){this.router.setActiveAgent(e.fromUserId,t.agents[0]);let r=await this.router.chat(t.agents[0],e.fromUserId,n);await this.sendAgentReply(e,r);return}let r=(await this.router.broadcast(t.agents,e.fromUserId,n)).map(e=>`[${e.name}] ${e.reply}`).join(`
|
||
|
||
`);await this.sendAgentReply(e,r);return}let n=this.router.getActiveAgent(e.fromUserId);if(n){let t=await this.router.chat(n,e.fromUserId,e.text||e.fullText);await this.sendAgentReply(e,t);return}}catch(e){return console.error(`[WeChatService] agent routing error:`,e),`Agent error: ${e instanceof Error?e.message:String(e)}`}return this.handleMessage(e,t)}async sendAgentReply(e,t){if(!this.weclaw)return;let n=this.plugin.settings.wechat.agentRouting,r=this.plugin.app.vault.adapter.basePath||process.cwd(),i;i=n?.allowAllPaths?[process.platform===`win32`?``:`/`]:[r,n?.cwd,process.cwd(),...n?.allowedFileRoots??[]].filter(Boolean),await p3({weclaw:this.weclaw,toUserId:e.fromUserId,contextToken:e.contextToken,reply:t,allowedRoots:i,log:{info:(...e)=>console.log(...e),warn:(...e)=>console.warn(...e),error:(...e)=>console.error(...e)}})}async handleMessage(e,t,n=!1){try{let r=this.plugin.settings.wechat.voiceSaveMode??`both`,i=await this.saveMediaItems(e.items,r),a=e.text||e.fullText||``;if(r===`text`||r===`both`){let t=[];for(let n of e.items)n.type===yK.Voice&&n.voice_item?.text&&t.push(n.voice_item.text);if(t.length>0){let e=t.join(`
|
||
`);a=a.trim()?`${a.trim()}\n${e}`:e}}else if(!a.trim()){for(let t of e.items)if(t.type===yK.Voice&&t.voice_item?.text){a=t.voice_item.text;break}}let o=[];a.trim()&&o.push(n?`- [ ] ${a.trim()}`:a.trim()),i.length>0&&o.push(...i);let s=o.join(`
|
||
`);return s?(await V.createThino({content:s,type:t,isList:!0}),this.plugin.settings.wechat.defaultReply||M(`Saved`)):M(`Empty message, not saved`)}catch(e){return console.error(`[WeChatService] save thino error:`,e),M(`Failed to save`)}}async saveMediaItems(e,t=`both`){let n=[];for(let r of e)try{if(r.type===yK.Image&&r.image_item?.media){let e=r.image_item.media,t=await cK(e.encrypt_query_param,e.aes_key),i=`wechat-${(0,f.moment)().format(`YYYYMMDDHHmmss`)}-${F3(4)}.png`,a=await this.saveToVault(i,t);a&&n.push(`![[${a.name}]]`)}else if(r.type===yK.Voice&&r.voice_item?.media){if(t===`text`)continue;let e=r.voice_item.media,i=await cK(e.encrypt_query_param,e.aes_key),a=await this.silkCodec.decodeToWav(i),o=a?`wav`:`silk`,s=a??i,c=`wechat-${(0,f.moment)().format(`YYYYMMDDHHmmss`)}-${F3(4)}.${o}`,l=await this.saveToVault(c,s);l&&n.push(`![[${l.name}]]`)}else if(r.type===yK.Video&&r.video_item?.media){let e=r.video_item.media,t=await cK(e.encrypt_query_param,e.aes_key),i=`wechat-${(0,f.moment)().format(`YYYYMMDDHHmmss`)}-${F3(4)}.mp4`,a=await this.saveToVault(i,t);a&&n.push(`![[${a.name}]]`)}else if(r.type===yK.File&&r.file_item?.media){let e=r.file_item.media,t=await cK(e.encrypt_query_param,e.aes_key),i=r.file_item.file_name||`file`,a=i.includes(`.`)?``:`.bin`,o=`wechat-${(0,f.moment)().format(`YYYYMMDDHHmmss`)}-${i}${a}`,s=await this.saveToVault(o,t);s&&n.push(`![[${s.name}]]`)}}catch(e){console.error(`[WeChatService] media download error:`,e)}return n}async saveToVault(e,t){let n=this.plugin.app.vault,r=e.split(`.`).pop()||`bin`,i=e.replace(/\.[^.]+$/,``),a=await n.getAvailablePathForAttachments(i,r),o=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return await n.createBinary(a,o)}}}));N(),Cv(),jG();var R3=(0,f.requireApiVersion)(`1.11.0`),z3=class{constructor(e){this.props=e}async display(){let{containerEl:e,settingTab:t,plugin:n,tabName:r,verified:i}=this.props;new G(e,t).setHeading().setTab(r).setName(M(`WeChat Integration`)),new G(e,t).setTab(r).setDesc(M(`Receive WeChat messages and save them as Thino memos. Desktop only. Requires Pro.`)),new G(e,t).setName(M(`Enable WeChat`)).setDesc(M(`Enable WeChat message receiver`)).setTab(r).addToggle(e=>e.setValue(n.settings.wechat.enabled).onChange(async r=>{if(r&&!i){Sv(),e.setValue(!1);return}if(r&&!f.Platform.isDesktop){new f.Notice(M(`WeChat integration is only available on desktop`)),e.setValue(!1);return}n.settings.wechat={...n.settings.wechat,enabled:r},t.applySettingsUpdate()})),new G(e,t).setName(M(`Auto start`)).setDesc(M(`Automatically start WeChat receiver when Obsidian opens`)).setTab(r).addToggle(e=>e.setValue(n.settings.wechat.autoStart).onChange(async r=>{if(!i){Sv(),e.setValue(!1);return}n.settings.wechat={...n.settings.wechat,autoStart:r},t.applySettingsUpdate()})),new G(e,t).setName(M(`Default reply`)).setDesc(M(`Auto-reply text when a message is saved. Leave empty to disable.`)).setTab(r).addText(e=>e.setPlaceholder(M(`Saved`)).setValue(n.settings.wechat.defaultReply).onChange(async e=>{n.settings.wechat={...n.settings.wechat,defaultReply:e},t.applySettingsUpdate()})),new G(e,t).setName(M(`Voice save mode`)).setDesc(M(`How to save voice messages: transcription text, audio file, or both`)).setTab(r).addDropdown(e=>e.addOptions({both:M(`Text + Audio`),text:M(`Text only`),voice:M(`Audio only`)}).setValue(n.settings.wechat.voiceSaveMode??`both`).onChange(async e=>{n.settings.wechat={...n.settings.wechat,voiceSaveMode:e},t.applySettingsUpdate()})),new G(e,t).setHeading().setTab(r).setName(M(`Connection`));let a=n.wechatService?.running??!1,o=n.wechatService?.hasCredentials()??!1;new G(e,t).setName(M(a?`WeChat is running`:`WeChat is stopped`)).setDesc(M(o?`Credentials found. Click Start to connect.`:`No credentials. Will show QR code on start.`)).setTab(r).addButton(e=>{e.setButtonText(M(a?`Stop`:`Start`)).setCta().onClick(async()=>{if(!i){Sv();return}if(a)n.wechatService?.stop();else{if(!n.wechatService){let{WeChatService:e}=await Promise.resolve().then(()=>(L3(),P3));n.wechatService=new e(n)}await n.wechatService.start()}setTimeout(()=>t.debounceApplySettingsUpdate(),500)})}),o&&new G(e,t).setName(M(`Logout`)).setDesc(M(`Clear stored credentials and disconnect`)).setTab(r).addButton(e=>{e.setButtonText(M(`Logout`)).setWarning().onClick(async()=>{n.wechatService?.logout(),setTimeout(()=>t.debounceApplySettingsUpdate(),500)})}),new G(e,t).setHeading().setTab(r).setName(M(`Voice Codec`));let{SilkCodec:s}=await Promise.resolve().then(()=>(yq(),uq)),c=new s(n.app,n.manifest.id),l=await c.isInstalled();new G(e,t).setName(M(`SILK Decoder`)).setDesc(M(l?`Installed. Voice messages will be converted to playable WAV files.`:`Not installed. Download to enable voice message playback in Obsidian.`)).setTab(r).addButton(e=>{l?e.setButtonText(M(`Remove`)).setWarning().onClick(async()=>{await c.remove(),new f.Notice(M(`Voice codec removed`)),t.display()}):e.setButtonText(M(`Download`)).setCta().onClick(async()=>{e.setButtonText(M(`Downloading...`)).setDisabled(!0);try{await c.download(),new f.Notice(M(`Voice codec downloaded`))}catch(e){new f.Notice(`${M(`Download failed`)}: ${e.message}`)}t.display()})}),new G(e,t).setHeading().setTab(r).setName(M(`Commands`));let u=e.createDiv({cls:`wechat-commands-help`});u.innerHTML=[`<p>${M(`Send messages to the WeChat bot with these command prefixes:`)}</p>`,`<ul>`,`<li><code>/d</code> ${M(`or`)} <code>/diary</code> - ${M(`Save to daily note`)}</li>`,`<li><code>/t</code> ${M(`or`)} <code>/todo</code> - ${M(`Save as task`)}</li>`,`<li><code>/n</code> ${M(`or`)} <code>/note</code> - ${M(`Save as multi-file note`)}</li>`,`<li>${M(`No prefix`)} - ${M(`Save using default save type`)}</li>`,`</ul>`].join(``),this.displayAgentRouting(e,t,n,r)}displayAgentRouting(e,t,n,r){let i=n.settings.wechat.agentRouting??{...AG};new G(e,t).setHeading().setTab(r).setName(M(`Agent Routing`)),new G(e,t).setTab(r).setDesc(M(`Route incoming WeChat messages to AI agents (ACP/CLI/HTTP). When enabled, messages with @agent or /agent prefix are forwarded to the specified agent.`)),new G(e,t).setName(M(`Enable Agent Routing`)).setDesc(M(`Forward messages to AI agents instead of saving as memos`)).setTab(r).addToggle(e=>e.setValue(i.enabled).onChange(async e=>{n.settings.wechat={...n.settings.wechat,agentRouting:{...i,enabled:e}},t.applySettingsUpdate()}));let a=Object.keys(i.agents??{}),o={"":M(`None (save as memo)`)};for(let e of a)o[e]=e;new G(e,t).setName(M(`Default Agent`)).setDesc(M(`Agent used when message has no @agent prefix`)).setTab(r).addDropdown(e=>e.addOptions(o).setValue(i.defaultAgent||``).onChange(async e=>{n.settings.wechat={...n.settings.wechat,agentRouting:{...i,defaultAgent:e}},t.applySettingsUpdate()})),new G(e,t).setName(M(`Working Directory`)).setDesc(M(`Default working directory for all agents. Leave empty to use vault root.`)).setTab(r).addText(e=>e.setPlaceholder(M(`Vault root`)).setValue(i.cwd||``).onChange(async e=>{n.settings.wechat={...n.settings.wechat,agentRouting:{...i,cwd:e||void 0}},t.applySettingsUpdate()})),new G(e,t).setName(M(`Allow All File Paths`)).setDesc(M(`Skip path restriction when sending files. Enable if agents need to send files from any directory.`)).setTab(r).addToggle(e=>e.setValue(i.allowAllPaths??!1).onChange(async e=>{n.settings.wechat={...n.settings.wechat,agentRouting:{...i,allowAllPaths:e}},t.applySettingsUpdate()})),new G(e,t).setName(M(`Agents`)).setDesc(M(`Configure AI agents`)).setTab(r).addButton(e=>e.setButtonText(M(`Add Agent`)).setCta().onClick(async()=>{let e=`agent-`+Date.now().toString(36),r={...i.agents??{},[e]:{type:`acp`}};n.settings.wechat={...n.settings.wechat,agentRouting:{...i,agents:r}},t.applySettingsUpdate(),t.display()}));for(let[a,o]of Object.entries(i.agents??{}))R3?this.displayAgentGroup(e,t,n,r,a,o,i):this.displayAgentFlat(e,t,n,r,a,o,i);if(i.enabled&&a.length>0){let n=e.createDiv({cls:`wechat-commands-help`});t.addSettingToMasterSettingsList(r,n,`agent commands`),n.innerHTML=[`<p><strong>${M(`Agent Commands`)}:</strong></p>`,`<ul>`,`<li><code>@agent msg</code> or <code>/agent msg</code> - ${M(`Send to specific agent`)}</li>`,`<li><code>@a @b msg</code> - ${M(`Broadcast to multiple agents`)}</li>`,`<li><code>/agent</code> (${M(`no message`)}) - ${M(`Switch default agent`)}</li>`,`<li><code>/new</code> or <code>/clear</code> - ${M(`Reset agent session`)}</li>`,`<li><code>/info</code> - ${M(`Show current agent info`)}</li>`,`</ul>`,`<p><strong>${M(`Built-in aliases`)}:</strong> /cc(claude) /cx(codex) /cs(cursor) /km(kimi) /gm(gemini) /oc(openclaw)</p>`].join(``)}}displayAgentGroup(e,t,n,r,i,a,o){let s=`${i} [${a.type.toUpperCase()}]`,c=new f.SettingGroup(e).setHeading(s).addExtraButton(e=>{e.setIcon(`trash-2`).setTooltip(M(`Delete`)).onClick(async()=>{let e={...o.agents??{}};delete e[i],n.settings.wechat={...n.settings.wechat,agentRouting:{...o,agents:e}},t.applySettingsUpdate(),t.display()})}),l=e=>{let r={...o.agents??{}};r[i]={...a,...e},n.settings.wechat={...n.settings.wechat,agentRouting:{...o,agents:r}},t.applySettingsUpdate()};if(c.addSetting(e=>{e.setName(M(`Type`)).addDropdown(e=>e.addOptions({acp:`ACP`,cli:`CLI`,http:`HTTP`}).setValue(a.type||`acp`).onChange(e=>{l({type:e}),t.display()}))}),a.type===`http`?(c.addSetting(e=>{e.setName(M(`Endpoint`)).setDesc(M(`OpenAI-compatible API endpoint URL`)).addText(e=>e.setPlaceholder(`https://api.openai.com/v1/chat/completions`).setValue(a.endpoint||``).onChange(e=>l({endpoint:e})))}),c.addSetting(e=>{e.setName(M(`API Key`)).addText(e=>e.setPlaceholder(`sk-...`).setValue(a.apiKey||``).onChange(e=>l({apiKey:e})))})):(c.addSetting(e=>{e.setName(M(`Command`)).setDesc(M(`Path to agent binary`)).addText(e=>e.setPlaceholder(a.type===`acp`?`claude-agent-acp`:`claude`).setValue(a.command||``).onChange(e=>l({command:e})))}),c.addSetting(e=>{e.setName(M(`Args`)).setDesc(M(`Extra command-line arguments (space-separated)`)).addText(e=>e.setValue((a.args??[]).join(` `)).onChange(e=>l({args:e.trim()?e.trim().split(/\s+/):[]})))})),c.addSetting(e=>{e.setName(M(`Model`)).addText(e=>e.setPlaceholder(a.type===`http`?`gpt-5.4-mini`:`claude-sonnet-4-6`).setValue(a.model||``).onChange(e=>l({model:e})))}),a.type!==`http`){let e={};for(let[t,n]of Object.entries(OG))e[t]=M(n);c.addSetting(t=>{t.setName(M(`Permission Mode`)).setDesc(M(`Approval policy for agent tool calls`)).addDropdown(t=>t.addOptions(e).setValue(a.permissionMode||`default`).onChange(e=>l({permissionMode:e})))});let t={};for(let[e,n]of Object.entries(DG))t[e]=M(n);c.addSetting(e=>{e.setName(M(`Reasoning Effort`)).setDesc(M(`Thinking budget level (codex/ACP agents)`)).addDropdown(e=>e.addOptions(t).setValue(a.reasoningEffort||`medium`).onChange(e=>l({reasoningEffort:e})))}),c.addSetting(e=>{e.setName(M(`Working Directory`)).setDesc(M(`Override global working directory for this agent`)).addText(e=>e.setPlaceholder(M(`Use global`)).setValue(a.cwd||``).onChange(e=>l({cwd:e||void 0})))})}c.addSetting(e=>{e.setName(M(`System Prompt`)).setDesc(M(`Optional system prompt for the agent`)).addText(e=>e.setValue(a.systemPrompt||``).onChange(e=>l({systemPrompt:e})))})}displayAgentFlat(e,t,n,r,i,a,o){let s=e=>{let r={...o.agents??{}};r[i]={...a,...e},n.settings.wechat={...n.settings.wechat,agentRouting:{...o,agents:r}},t.applySettingsUpdate()},c=new G(e,t).setTab(r).setName(i);if(c.addDropdown(e=>e.addOptions({acp:`ACP`,cli:`CLI`,http:`HTTP`}).setValue(a.type||`acp`).onChange(e=>{s({type:e}),t.display()})),c.addButton(e=>e.setButtonText(M(`Delete`)).setWarning().onClick(async()=>{let e={...o.agents??{}};delete e[i],n.settings.wechat={...n.settings.wechat,agentRouting:{...o,agents:e}},t.applySettingsUpdate(),t.display()})),a.type===`http`?(new G(e,t).setName(M(`Endpoint`)).setTab(r).addText(e=>e.setPlaceholder(`https://api.openai.com/v1/chat/completions`).setValue(a.endpoint||``).onChange(e=>s({endpoint:e}))),new G(e,t).setName(M(`API Key`)).setTab(r).addText(e=>e.setPlaceholder(`sk-...`).setValue(a.apiKey||``).onChange(e=>s({apiKey:e})))):(new G(e,t).setName(M(`Command`)).setTab(r).addText(e=>e.setPlaceholder(a.type===`acp`?`claude-agent-acp`:`claude`).setValue(a.command||``).onChange(e=>s({command:e}))),new G(e,t).setName(M(`Args`)).setTab(r).addText(e=>e.setValue((a.args??[]).join(` `)).onChange(e=>s({args:e.trim()?e.trim().split(/\s+/):[]})))),new G(e,t).setName(M(`Model`)).setTab(r).addText(e=>e.setPlaceholder(a.type===`http`?`gpt-5.4-mini`:`claude-sonnet-4-6`).setValue(a.model||``).onChange(e=>s({model:e}))),a.type!==`http`){let n={};for(let[e,t]of Object.entries(OG))n[e]=M(t);new G(e,t).setName(M(`Permission Mode`)).setTab(r).addDropdown(e=>e.addOptions(n).setValue(a.permissionMode||`default`).onChange(e=>s({permissionMode:e})));let i={};for(let[e,t]of Object.entries(DG))i[e]=M(t);new G(e,t).setName(M(`Reasoning Effort`)).setDesc(M(`Thinking budget level (codex/ACP agents)`)).setTab(r).addDropdown(e=>e.addOptions(i).setValue(a.reasoningEffort||`medium`).onChange(e=>s({reasoningEffort:e}))),new G(e,t).setName(M(`Working Directory`)).setTab(r).addText(e=>e.setPlaceholder(M(`Use global`)).setValue(a.cwd||``).onChange(e=>s({cwd:e||void 0})))}new G(e,t).setName(M(`System Prompt`)).setTab(r).addText(e=>e.setValue(a.systemPrompt||``).onChange(e=>s({systemPrompt:e})))}};Rg(),N(),Wr(),H(),vi(),Cv(),Mv(),i_(),Dg(),P_();var B3=N_(`os`),V3=async()=>{let e=``;if(f.Platform.isDesktop)e=await Dv();else{let t=await window.Capacitor?.Plugins?.Device?.getId();e=t.identifier||t.uuid}let t;if(B3)t=JSON.stringify({hostname:B3.hostname(),platform:B3.platform(),machineid:e});else{let n=await window.Capacitor?.Plugins.Device.getInfo(),r=n?.model,i=n?.platform;t=JSON.stringify({hostname:r||(`mobile`+f.Platform.isMobile?Math.random().toString(36).substring(7):``),platform:i||`mobile`,machineid:e})}return QW(t)},H3={General:`chef-hat`,Thino:`Memos`,Interface:`brush`,Share:`share-2`,Advanced:`cog`,About:`info`,Blank:`home`,Editor:`edit`,Tasks:`check-square`,Super:`sparkles`,Pro:`diamond`},U3=[{value:`DAILY`,target:`ProcessEntriesBelow`,insert:`InsertAfter`},{value:`CANVAS`,target:`MemoDefaultCanvasPath`},{value:`MULTI`,target:`MemoDefaultMultiFilePath`},{value:`FILE`,target:`MemoDefaultSingleFilePath`},{value:`JOURNAL`,target:`JournalFolder`}],W3={FirstLoaded:!0,StartDate:`Sunday`,InsertAfter:``,UserName:`THINO 😉`,ProcessEntriesBelow:``,Language:`en`,SaveMemoButtonLabel:`NOTE`,SaveMemoButtonIcon:``,ShareFooterStart:`{ThinoNum} Thino {UsedDay} Day`,ShareFooterEnd:`✍️ by {UserName}`,DefaultPrefix:`List`,DefaultTimePrefix:`HH:mm`,UseDailyOrPeriodic:`Daily`,InsertDateFormat:`Tasks`,DefaultEditorLocation:`Top`,UseButtonToShowEditor:!1,FocusOnEditor:!0,ShowClipboardOnFocus:!0,OpenDailyMemosWithMemos:!0,HideDoneTasks:!1,ShowTaskLabel:!0,AppendDateWhenTaskDone:!1,MobileAndDesktop:`All`,OpenMemosAutomatically:!1,ShowScrollbar:!1,ShowTime:!0,ShowDate:!0,AddBlankLineWhenDate:!1,AutoSaveWhenOnMobile:!1,DeleteFileName:`delete`,QueryFileName:`query`,UseVaultTags:!1,SetCustomBackgroundImage:!1,SetCustomMemoFooter:!1,DefaultLightBackgroundImage:``,DefaultDarkBackgroundImage:``,DefaultLightBackgroundImageForClean:``,DefaultDarkBackgroundImageForClean:``,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`},JournalSettings:{granularity:`day`,useIndependentSettings:!1,headingDateFormat:`YYYY-MM-DD`,daily:{folder:``,format:`YYYY-MM-DD`,template:``},weekly:{folder:``,format:`gggg-[W]ww`,template:``},monthly:{folder:``,format:`YYYY-MM`,template:``},yearly:{folder:``,format:`YYYY`,template:``}},MemoDailyTarget:5,HeatmapColorScheme:`default`,EnabledHttpApi:!1,HttpApiIpType:`127.0.0.1`,HttpApiPort:`43999`,AutoDownloadImage:!1,EditorType:`obsidian`,EnabledLocationList:[{value:`DAILY`,target:`ProcessEntriesBelow`,insert:`InsertAfter`}],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:`modern`,LastUpdatedVersion:`0.0.0`,ShareToThinoWithText:!1,ShareToThinoWithTextAppend:``,ShareToThinoWithTextPrepend:``,ShareToThinoWithTextNewline:`none`,hidePinnedGroup:!1,DifferentInsertTarget:!1,InsertAfterForTask:``,ProcessContentTarget:`custom`,InsertType:`custom`,ShareAppendType:`preset`,SharePrependType:`preset`,SetFileNameAfterCreate:!1,TagForFileTypeFiles:`thino/file`,TagForMultiTypeFiles:`thino/multi`,MinHeightForShare:`200px`,ThinoMaxHeight:0,ThinoCollapsedHeight:100,OptimizeForCallout:!0,AppendOrPrependTextViaServer:!1,AppendViaServer:``,PrependViaServer:``,WithNewLineViaServer:`none`,SupportSelectOtherView:!1,WaitTemplaterToFinishParse:!1,NavbarButton:!1,AlwaysShowStatusText:!1,FilterByMetadata:!1,ShowSourcePath:!1,ShowUpdateMessage:!0,SyncManually:!1,MemoFixedPrefix:``,MemoFixedSuffix:``,UseMemoFixedStrings:!1,enableWordCount:!1,maxWordCount:0,enableReferenceLinksGroup:!1,doubleClickBehavior:`edit-thino`,useMobileViewDefaultHeader:!1,IgnoreFolderForMultiType:[],UseBlockLinkWhenDragging:!1,ShowScrollToTopButton:!0,ZoomImageWhenViewing:!1,ViewArchiveInRandomReview:!1,DraggingBehavior:`block-link`,superEnabled:!1,enableSecretMasking:!1,secretContentRegex:``,secretMaskingStyle:`blur`,fsrsRequestRetention:.9,fsrsMaximumInterval:36500,fsrsEnableFuzz:!0,fsrsEnableShortTerm:!0,fsrsWeights:[],fsrsDailyLimit:100,wechat:{enabled:!1,autoStart:!1,defaultReply:``,voiceSaveMode:`both`,agentRouting:{enabled:!1,defaultAgent:`claude`,agents:{claude:{type:`cli`,command:`claude`,aliases:[`cc`]},codex:{type:`cli`,command:`codex`,aliases:[`cx`]},gemini:{type:`cli`,command:`gemini`,aliases:[`gm`]}}}},general:{...lG}};function G3({plugin:e}){let[t,n]=(0,U.useState)(!1),[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(``),s=async()=>{let t=a,r=f.Platform.isDesktop?void 0:await window.Capacitor?.Plugins?.Device?.getId(),i=r?r.identifier||r.uuid:await Dv();t&&(e.settingTab.updateSettings(`tokenForVerify`,{...e.settings.tokenForVerify,[i]:t}),e.verify().then(t=>{t&&(n(!0),R.setRefresh(!0),setTimeout(()=>{e.settingTab.display()},200),e.registerToolbarCheck()),new f.Notice(M(t?`Verify successfully`:`Failed to verify`))}).catch(()=>{new f.Notice(M(`Failed to verify`))}))};return(0,W.jsxs)(`div`,{className:`thino-verify-content`,children:[(0,W.jsxs)(`div`,{className:`thino-description-link`,children:[M(`You can buy a license from`)+`->`,(0,W.jsxs)(`span`,{className:`thino-url`,onClick:()=>{r_()?window.open(`https://pkmer.cn/products/thino`,`_blank`):window.open(`https://thino.pkmer.net/en/#price`,`_blank`)},children:[` `,`PKMer`]})]}),(0,W.jsx)(`textarea`,{className:`thino-verify-textarea`,value:a,onChange:e=>o(e.target.value),placeholder:M(`Input activation code here`)}),(0,W.jsxs)(`div`,{className:`thino-button-container`,children:[(0,W.jsxs)(`div`,{className:`thino-button-group`,children:[!a&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{onClick:async()=>{try{let e=await V3();await navigator.clipboard.writeText(e),i(!0)}catch(e){console.error(e),new f.Notice(`Failed to copy id`);return}new f.Notice(M(`Copied to clipboard Successfully`))},children:M(`Copy Thino id`)}),(0,W.jsx)(`button`,{onClick:()=>{if(!r){new f.Notice(M(`Please copy Thino id first`));return}r_()?window.open(`https://pkmer.cn/products/UserProfile/#tab-21&getCode`,`_blank`):window.open(`https://pkmer.net/en/userprofile/#tab-21&getCode`,`_blank`),n(!0)},children:M(`Get activation code`)})]}),a&&(0,W.jsx)(`button`,{onClick:async()=>await s(),children:M(`Verify`)})]}),t?(0,W.jsx)(`p`,{children:M(`After you verify your account, please refresh this page.`)}):``]})]})}function K3({plugin:e}){let[t,n]=(0,U.useState)(!1),[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(e.settings.general?.userInfo);(0,U.useEffect)(()=>{if(!r)return;let t=setInterval(()=>{let t=e.settings.general?.userInfo;t?.sub&&(o(t),i(!1),n(!1))},1e3),a=setTimeout(()=>{i(!1),n(!1)},300*1e3);return()=>{clearInterval(t),clearTimeout(a)}},[r]);let s=async()=>{n(!0);try{if(await e.pkmerAuth.login(),f.Platform.isMobile){i(!0);return}if(await e.verify()){R.setRefresh(!0);let t=e.pkmerAuth.aiToken;if(t){let n=e.settings.general?.userInfo?.ai_quota;q3(t,n)}e.registerToolbarCheck()}o(e.settings.general?.userInfo??null)}finally{f.Platform.isMobile||n(!1)}},c=async()=>{await e.pkmerAuth.logout(),L.setVerifyState(null),R.setRefresh(!0),o(null);let t=B.getState();t.updateProvider(`pkmer`,{type:`pkmer`,enabled:!1,apiKey:``,quotaInfo:void 0}),t.activeCompletionProvider===`pkmer`&&t.setActiveCompletionProvider(`openai`)},l=()=>{e.settingTab?.activeModal?.close(),setTimeout(()=>e.settingTab?.openSettingsModal(`super`),100)};if(a?.sub){let e=a.ai_quota?Math.floor(a.ai_quota.remainingQuota/5e5):0,t=a.ai_quota?Math.floor(a.ai_quota.quota/5e5):0;return(0,W.jsxs)(`div`,{className:`thino-oauth-card`,children:[(0,W.jsxs)(`div`,{className:`thino-oauth-header`,children:[(0,W.jsx)(`span`,{className:`thino-oauth-username`,children:a.name||a.email||a.sub}),(0,W.jsx)(`button`,{className:`thino-oauth-logout clickable-icon`,onClick:c,children:M(`Logout`)})]}),a.ai_quota&&(0,W.jsxs)(`div`,{className:`thino-oauth-quota`,onClick:l,children:[(0,W.jsxs)(`div`,{className:`thino-oauth-quota-label`,children:[(0,W.jsx)(`span`,{children:M(`Thino Copilot quota`)}),(0,W.jsxs)(`span`,{className:`thino-oauth-quota-value`,children:[e,` / `,t]})]}),(0,W.jsx)(`div`,{className:`thino-oauth-quota-bar`,children:(0,W.jsx)(`div`,{className:`thino-oauth-quota-fill`,style:{width:t>0?`${e/t*100}%`:`0%`}})}),(0,W.jsx)(`span`,{className:`thino-oauth-quota-hint`,children:M(`Click to manage in Super settings`)})]})]})}return(0,W.jsxs)(`div`,{className:`thino-verify-content`,children:[(0,W.jsx)(`div`,{className:`thino-description-link`,children:M(`Login with PKMer account to activate Pro features`)}),(0,W.jsx)(`div`,{className:`thino-button-container`,children:(0,W.jsx)(`button`,{onClick:s,disabled:t,children:r?M(`Waiting for browser login...`):t?`...`:M(`Login with PKMer`)})})]})}function q3(e,t){let n=B.getState(),r=5e5;n.updateProvider(`pkmer`,{type:`pkmer`,enabled:!0,apiKey:e,baseUrl:`https://newapi.pkmer.cn`,completionModel:n.providers.pkmer?.completionModel||`03-agent`,quotaInfo:t?{remaining:Math.floor(t.remainingQuota/r),total:Math.floor(t.quota/r)}:void 0});let i=n.activeCompletionProvider;(!i||i===`local`||!n.providers[i]?.apiKey)&&n.setActiveCompletionProvider(`pkmer`)}function J3({plugin:e}){let{verifyState:t}=I(),[n,r]=(0,U.useState)(!1),i=r_();return t?(0,W.jsx)(`div`,{className:`thino-verify-component`,children:(0,W.jsxs)(`div`,{className:`thino-verify-content verified`,children:[(0,W.jsxs)(`div`,{className:`thino-verified-badge`,children:[(0,W.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,children:(0,W.jsx)(`path`,{d:`M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm3.78 5.97-4.5 5a.75.75 0 0 1-1.06.02l-2-2a.75.75 0 1 1 1.06-1.06l1.46 1.46 3.97-4.42a.75.75 0 1 1 1.12 1Z`,fill:`currentColor`})}),(0,W.jsx)(`span`,{children:M(`Pro activated`)})]}),i&&(0,W.jsx)(K3,{plugin:e}),(0,W.jsx)(`div`,{className:`thino-description-link`,children:(0,W.jsxs)(`span`,{className:`thino-url`,onClick:()=>{i?window.open(`https://pkmer.cn`,`_blank`):window.open(`https://thino.pkmer.net/en/`,`_blank`)},children:[M(`Contact support`),` →`]})})]})}):(0,W.jsxs)(`div`,{className:`thino-verify-component`,children:[i?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(K3,{plugin:e}),(0,W.jsxs)(`details`,{className:`thino-legacy-verify`,children:[(0,W.jsx)(`summary`,{children:M(`Legacy activation (deprecated)`)}),(0,W.jsx)(G3,{plugin:e})]})]}):(0,W.jsx)(G3,{plugin:e}),(0,W.jsxs)(`div`,{className:`thino-description-link`,children:[M(`If you have any questions, please contact us.`),(0,W.jsx)(`span`,{className:`thino-url`,onClick:()=>{i?window.open(`https://pkmer.cn`,`_blank`):window.open(`https://thino.pkmer.net/en/`,`_blank`)},children:`@ PKMer`})]})]})}var Y3=class extends f.PluginSettingTab{plugin;applyDebounceTimer=0;tabContent=new Map;selectedTab=`Blank`;search;searchSettingInfo=new Map;searchZeroState;navigateEl;settingsEl;passwordMatched=!1;root;activeModal=null;icon=`file`;constructor(e,t){super(e,t),this.plugin=t}updateSettings(e,t){this.plugin.settings={...this.plugin.settings,[e]:t},this.applySettingsUpdate()}debounceApplySettingsUpdate=(0,f.debounce)(async()=>{await this.plugin.saveSettings()},100,!0);debounceDisplay=(0,f.debounce)(async()=>{if(this.activeModal){this.activeModal.openTab(this.activeModal.activeTabId);return}await this.display()},300,!0);applySettingsUpdate(){this.debounceApplySettingsUpdate(),V.updateTagsState()}async hide(){this.root?.unmount(),this.passwordMatched=!1}openSettingsModal(e){let t=new cG(this.app,this.plugin,this,e);this.activeModal=t,t.open()}onModalClose(){this.root?.unmount(),this.activeModal=null,this.passwordMatched=!1}renderTabInModal(e,t){switch(this.searchSettingInfo=new Map,e){case`general`:this.generateGeneralSettings(e,t);break;case`thino`:this.generateMemosSettings(e,t);break;case`interface`:this.generateThemeSettings(e,t);break;case`editor`:this.generateEditorSettings(e,t);break;case`tasks`:this.generateTasksSettings(e,t);break;case`share`:this.generateShareSettings(e,t);break;case`super`:this.generateSuperSettings(e,t);break;case`pro`:this.customProSettings(e,t);break;case`review`:this.generateReviewSettings(e,t);break;case`advanced`:this.generateAdvancedSettings(e,t);break;case`wechat`:this.generateWeChatSettings(e,t);break;case`about`:this.generateAboutSettings(e,t);break}}async display(){await this.plugin.loadSettings(),this.root&&this.root?.unmount(),this.containerEl.empty(),this.containerEl.toggleClass(`memos-settings`,!0),this.containerEl.toggleClass(`thino-settings-entry`,!0),f.Platform.isMobile&&this.containerEl.toggleClass(`memos-mobile`,!0),this.generateEntryPage()}generateEntryPage(){let{containerEl:e}=this,t=e.createDiv({cls:`settings-entry-header`}),n=t.createDiv({cls:`settings-entry-title-container`});(0,f.setIcon)(n.createSpan({cls:`settings-entry-logo`}),`Memos`);let r=n.createDiv({cls:`settings-entry-title-text`});r.createEl(`h2`,{text:`Thino`}),r.createEl(`span`,{cls:`settings-entry-version`,text:`v${this.plugin.manifest.version}`}),t.createDiv({cls:`settings-entry-desc`}).createEl(`p`,{text:M(`Quick capture tool that allows you to create and manage your ideas, tasks, and more.`)}),new f.Setting(e).setName(M(`Open Settings`)).setDesc(M(`Configure all Thino settings in a dedicated window`)).addButton(e=>{e.setButtonText(M(`Open Settings`)).setCta().onClick(()=>{this.openSettingsModal()})});let i=e.createDiv({cls:`settings-entry-links`});i.createEl(`h3`,{text:M(`Quick Links`)});let a=i.createDiv({cls:`settings-entry-links-grid`}),o=[{icon:`book`,text:M(`Documentation`),url:`https://github.com/quorafind/obsidian-thino/`},{icon:`github`,text:`GitHub`,url:`https://github.com/quorafind/obsidian-thino/`},{icon:`heart`,text:M(`Support`),url:r_()?`https://pkmer.cn/products/thino`:`https://thino.pkmer.net/en/#price`}];r_()&&o.push({icon:`clipboard-list`,text:`Thino Web 问卷`,url:`https://memos.pkmer.cn:6002/s/cmkev0bdr0000o201ckgbarid`}),o.forEach(e=>{let t=a.createEl(`a`,{cls:`settings-entry-link`,href:e.url});t.setAttr(`target`,`_blank`),(0,f.setIcon)(t.createSpan({cls:`settings-entry-link-icon`}),e.icon),t.createSpan({text:e.text})});let s=e.createDiv({cls:`settings-entry-features`});s.createEl(`h3`,{text:M(`Features`)});let c=[{icon:`chef-hat`,title:M(`General`),desc:M(`User info and sync`),tabId:`general`},{icon:`Memos`,title:`Thino`,desc:M(`Memo save locations and format`),tabId:`thino`},{icon:`brush`,title:M(`Interface`),desc:M(`Theme and display options`),tabId:`interface`},{icon:`edit`,title:M(`Editor`),desc:M(`Editor behavior settings`),tabId:`editor`},{icon:`diamond`,title:`Pro`,desc:M(`Pro features and activation`),tabId:`pro`},{icon:`sparkles`,title:`Super`,desc:M(`AI-powered features`),tabId:`super`}],l=s.createDiv({cls:`settings-entry-features-grid`});c.forEach(e=>{let t=l.createDiv({cls:`settings-entry-feature`});e.tabId&&(t.addClass(`is-clickable`),t.addEventListener(`click`,()=>{this.openSettingsModal(e.tabId)})),(0,f.setIcon)(t.createDiv({cls:`settings-entry-feature-icon`}),e.icon);let n=t.createDiv({cls:`settings-entry-feature-text`});n.createEl(`strong`,{text:e.title}),n.createEl(`span`,{text:e.desc})})}generateSettingsTitle(){new f.Setting(this.containerEl).setName(`Thino`).setDesc(M(`Quick capture tool that allows you to create and manage your ideas, tasks, and more.`)).setHeading().addButton(e=>{e.buttonEl.addClass(`setting-home-nav-button`),e.setIcon(`home`),e.setTooltip(`Back to home`),e.onClick(()=>{this.triggerTabChange(null,`Blank`)})}).addSearch(e=>{this.search=e,e.setPlaceholder(M(`Search all settings`)),e.inputEl.oninput=()=>{if(e.inputEl.value===``){this.triggerTabChange(null,`Blank`),this.navigateEl.toggleClass(`memos-setting-searching`,!1),this.containerEl.toggleClass(`setting-searching`,!1);return}for(let t of this.tabContent){let n=t[1];n.navButton.removeClass(`memos-navigation-item-selected`),n.content.show(),n.heading.show();let r=e.getValue();this.selectedTab==``&&r.trim()!=``&&this.searchSettings(r.toLowerCase()),this.selectedTab=``}this.navigateEl.toggleClass(`memos-setting-searching`,!0),this.containerEl.toggleClass(`setting-searching`,!0)},e.onChange(e=>{if(e===``){this.triggerTabChange(null,`Blank`),this.navigateEl.toggleClass(`memos-setting-searching`,!1),this.containerEl.toggleClass(`setting-searching`,!1);return}this.searchSettings(e.toLowerCase())})})}addTabHeader(){this.navigateEl=this.containerEl.createEl(`nav`,{cls:`memos-setting-header`}).createDiv(`memos-setting-tab-group`),this.settingsEl=this.containerEl.createEl(`div`,{cls:`memos-setting-content`,attr:{"data-tab-id":this.selectedTab}}),this.updateOldData(),this.createTabAndContent(`General`,this.navigateEl,this.settingsEl,(e,t)=>this.generateGeneralSettings(t,e)),this.createTabAndContent(`Thino`,this.navigateEl,this.settingsEl,(e,t)=>this.generateMemosSettings(t,e)),this.createTabAndContent(`Interface`,this.navigateEl,this.settingsEl,(e,t)=>this.generateThemeSettings(t,e)),this.createTabAndContent(`Editor`,this.navigateEl,this.settingsEl,(e,t)=>this.generateEditorSettings(t,e)),this.createTabAndContent(`Tasks`,this.navigateEl,this.settingsEl,(e,t)=>this.generateTasksSettings(t,e)),this.createTabAndContent(`Share`,this.navigateEl,this.settingsEl,(e,t)=>this.generateShareSettings(t,e)),this.createTabAndContent(`Super`,this.navigateEl,this.settingsEl,(e,t)=>this.generateSuperSettings(t,e)),this.createTabAndContent(`Pro`,this.navigateEl,this.settingsEl,(e,t)=>this.customProSettings(t,e)),this.createTabAndContent(`Advanced`,this.navigateEl,this.settingsEl,(e,t)=>this.generateAdvancedSettings(t,e)),this.createTabAndContent(`About`,this.navigateEl,this.settingsEl,(e,t)=>this.generateAboutSettings(t,e)),this.createSearchZeroState(this.settingsEl)}searchAndUpdateTabList(){this.checkVerified().then(e=>{e&&this.navEl.toggleClass(`thino-pro-activated`,!0)})}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()}triggerTabChange(e,t){if(t===`Blank`){this.selectedTab=t;for(let e of this.tabContent){let t=e[1];t.content.hide(),t.heading.hide()}this.settingsEl?.setAttribute(`data-tab-id`,`Blank`),this.navigateEl.querySelector(`.memos-navigation-item-selected`)?.toggleClass(`memos-navigation-item-selected`,!1),this.searchZeroState.hide();return}if(this.selectedTab==t)return;this.settingsEl?.setAttribute(`data-tab-id`,t);let n=this.navigateEl.querySelector(`.memos-navigation-item-selected`);if(n&&n.toggleClass(`memos-navigation-item-selected`,!1),e.toggleClass(`memos-navigation-item-selected`,!0),(this.tabContent.get(t)?.content).show(),this.selectedTab!=``&&this.selectedTab!==`Blank`)(this.tabContent.get(n?.getAttribute(`data-tab-id`))?.content).hide();else{this.searchZeroState.hide();for(let e of this.searchSettingInfo)for(let t of e[1])t.containerEl.show();for(let e of this.tabContent){let n=e[1];n.heading.hide(),t!==e[0]&&n.content.hide()}}this.selectedTab=t}async createTabAndContent(e,t,n,r){let i=this.selectedTab===e,a=t.createEl(`div`,{cls:`memos-navigation-item`,attr:{"data-tab-id":e}}),o=await this.checkVerified();(0,f.setIcon)(a.createEl(`div`,{cls:`memos-navigation-item-icon`}),H3[e]),a.createSpan({text:M(e)},t=>{e===`About`&&t.createEl(`span`,{cls:[`thino-pro-text`,o?`thino-pro-activated`:``],text:o?` & ${M(`Activated Pro`)} 💎`:` & ${M(`Activate Pro`)}`})}),a.onclick=()=>{this.triggerTabChange(a,e)};let s=n.createDiv(`memos-tab-settings`),c=s.createEl(`h2`,{cls:`memos-setting-heading`,text:e+` Settings`});c.hide(),s.id=e.toLowerCase().replace(` `,`-`),i?a.addClass(`memos-navigation-item-selected`):s.hide(),r&&r(s,e),this.tabContent.set(e,{content:s,heading:c,navButton:a})}searchSettings(e){let t=new Set,n=(e,n)=>{e.show(),t.has(n)||t.add(n)};for(let t of this.searchSettingInfo){let r=t[0],i=t[1];for(let t of i)if(e.trim()===``||t.alias?.includes(e)||t.description.includes(e)||t.name.includes(e))n(t.containerEl,r);else if(t.options&&t.options.length>0)for(let i of t.options){if(i.description.toLowerCase().includes(e)||i.name.toLowerCase().includes(e)){n(t.containerEl,r);break}else if(i.options){for(let a of i.options)if(a.description.toLowerCase().includes(e)||a.value.toLowerCase().includes(e)){n(t.containerEl,r);break}}t.containerEl.hide()}else t.containerEl.hide()}for(let e of this.tabContent)t.has(e[0])?e[1].heading.show():e[1].heading.hide();t.size===0?this.searchZeroState.show():this.searchZeroState.hide()}addSettingToMasterSettingsList(e,t,n=``,r=``,i=[],a=``){let o={containerEl:t,name:n.toLowerCase(),description:r.toLowerCase(),options:i,alias:a};this.searchSettingInfo.has(e)?this.searchSettingInfo.get(e)?.push(o):this.searchSettingInfo.set(e,[o])}createSearchZeroState(e){this.searchZeroState=e.createDiv(),this.searchZeroState.hide(),this.searchZeroState.createEl(f.Platform.isMobile?`h3`:`h2`,{text:`No settings match search`}).style.textAlign=`center`}async checkVerified(){let e=L.getState().verifyState,t=f.Platform.isDesktop?void 0:await window.Capacitor?.Plugins?.Device?.getId(),n=t?t.identifier||t.uuid:await Dv();return e&&e?.appId===n}generateProSettings(e,t){new G(t,this).setClass(`thino-pro-setting`).setHeading().setName(`🏆 `+M(`Pro verification status`)).setTab(e);let n=document.createDocumentFragment(),r=n.createEl(`div`,{cls:`thino-activation`}),i=new G(t,this).setName(M(`Activate Pro Version`)).setClass(`thino-pro-setting`).setDesc(n).setTab(e);if(i.settingEl.toggleClass(`thino-activation-setting`,!0),i.nameEl.toggleClass(`thino-activation-title`,!0),this.root=$g.createRoot(r),this.root.render((0,W.jsx)(J3,{plugin:this.plugin})),!this.plugin.settings.general?.userInfo?.sub){let n=!1;new G(t,this).setName(M(`Deactivate`)).setClass(`thino-pro-setting`).setTab(e).addButton(e=>{e.setWarning().setButtonText(M(`Remove`)).onClick(async()=>{if(!n){e.setButtonText(M(`Confirm?`)),n=!0;return}n=!1;let t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins?.Device?.getId(),r=f.Platform.isDesktop?await Dv():t.identifier||t.uuid;if(this.plugin.settings.tokenForVerify[r]){let{[r]:e,...t}=this.plugin.settings.tokenForVerify;this.plugin.settings.tokenForVerify=t,await this.plugin.saveSettings(),new f.Notice(M(`Remove successfully`))}await this.plugin.verify(),R.setRefresh(!0),setTimeout(()=>{this.display()},20)})})}}generateGeneralSettings(e,t){new fG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e}).display()}async generateThemeSettings(e,t){let n=await this.checkVerified();await new mG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:n}).display()}async generateEditorSettings(e,t){new hG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e}).display()}async generateTasksSettings(e,t){new gG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e}).display()}async generateMemosSettings(e,t){let n=L.getState().verifyState,r=f.Platform.isDesktop?void 0:await window.Capacitor?.Plugins?.Device?.getId(),i=r?r.identifier||r.uuid:await Dv(),a=n&&n?.appId===i;await new pG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:a}).display()}async generateShareSettings(e,t){let n=L.getState().verifyState,r=f.Platform.isDesktop?void 0:await window.Capacitor?.Plugins?.Device?.getId(),i=r?r.identifier||r.uuid:await Dv(),a=n&&n?.appId===i;new _G({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:a}).display()}async generateSuperSettings(e,t){let n=await this.checkVerified();await new bG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:n}).display()}generateReviewSettings(e,t){new yG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e}).display()}async generateAdvancedSettings(e,t){this.addAutoOpenMemosSettings(e,t),this.setPasswordSettings(e,t),this.addDoubleClickBehaviorSettings(e,t),this.addDraggingBehaviorSettings(e,t),this.saveDataSettings(e,t),this.fetchDataSettings(e,t),this.navigationSettings(e,t),this.optimizeForCalloutSettings(e,t),this.addSecretMaskingSettings(e,t),this.clearConfigSettings(e,t)}addSecretMaskingSettings(e,t){if(!(0,f.requireApiVersion)(`1.11.4`)){new G(t,this).setName(M(`Secret Content Masking`)).setDesc(M(`Requires Obsidian API 1.11.4+`)).setTab(e);return}(0,f.requireApiVersion)(`1.11.4`)&&new G(t,this).setName(M(`Enable secret masking`)).setDesc(M(`Mask memo content matching a regex pattern`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.enableSecretMasking).onChange(async e=>{this.plugin.settings.enableSecretMasking=e,this.applySettingsUpdate(),this.debounceDisplay()})}),this.plugin.settings.enableSecretMasking&&(new G(t,this).setName(M(`Secret content regex`)).setDesc(M(`Regex pattern to match content that should be masked`)).setTab(e).addText(e=>{e.setPlaceholder(`#secret`).setValue(this.plugin.settings.secretContentRegex),e.inputEl.addEventListener(`blur`,()=>{this.plugin.settings.secretContentRegex=e.inputEl.value,this.applySettingsUpdate()})}),new G(t,this).setName(M(`Masking style`)).setDesc(M(`Choose between blur effect or block character replacement`)).setTab(e).addDropdown(async e=>{e.addOption(`blur`,`Blur`),e.addOption(`block`,`Block characters`),e.setValue(this.plugin.settings.secretMaskingStyle).onChange(async e=>{this.plugin.settings.secretMaskingStyle=e,this.applySettingsUpdate()})}),new G(t,this).setName(M(`Set secret password`)).setDesc(M(`Set or update the password used to reveal masked content`)).setTab(e).addButton(e=>{e.setButtonText(M(`Set secret password`)).onClick(()=>{new Z3(this.app).open()})}))}async generateWeChatSettings(e,t){let n=await this.checkVerified();await new z3({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:n}).display()}async generateAboutSettings(e,t){new vG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e}).display()}async customProSettings(e,t){this.generateProSettings(e,t);let n=await this.checkVerified();new CG({containerEl:t,settingTab:this,plugin:this.plugin,tabName:e,verified:n}).display()}addDoubleClickBehaviorSettings(e,t){new G(t,this).setName(M(`Double click behavior`)).setDesc(M(`Set the behavior when double click on a thino.`)).setTab(e).addDropdown(async e=>{e.addOption(`open-thino`,M(`Open thino`)),e.addOption(`edit-thino`,M(`Edit thino`)),e.addOption(`go-to-source`,M(`Go to source`)),e.addOption(`do-nothing`,M(`Do nothing`)),e.setValue(this.plugin.settings.doubleClickBehavior).onChange(async e=>{this.plugin.settings.doubleClickBehavior=e,this.applySettingsUpdate()})})}addDraggingBehaviorSettings(e,t){new G(t,this).setName(M(`Dragging behavior`)).setDesc(M(`Control the behavior when dragging a thino. You will paste the block link by default. Block-link option only works with source type is Daily Note.`)).setTab(e).addDropdown(async e=>{e.addOption(`block-link`,M(`Block link`)),e.addOption(`text`,M(`Text`)),e.setValue(this.plugin.settings.DraggingBehavior).onChange(async e=>{this.plugin.settings.DraggingBehavior=e,this.applySettingsUpdate()})})}addUseMobileViewDefaultHeaderSettings(e,t){new G(t,this).setName(M(`Use default header in mobile view`)).setDesc(M(`Use default header in mobile view of thino rather than custom header.`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.useMobileViewDefaultHeader).onChange(async e=>{this.plugin.settings.useMobileViewDefaultHeader=e,this.applySettingsUpdate()})})}async customNameAndTheme(e,t,n){new G(t,this).setName(M(`Theme for Thino`)).setDesc(M(`Set the theme for Thino`)).setTab(e).addDropdown(async e=>{e.addOption(`modern`,`Modern`),e.addOption(`classic`,`Classic`),e.setValue(this.plugin.settings.DefaultThemeForThino).onChange(async e=>{this.plugin.settings.DefaultThemeForThino=e,this.applySettingsUpdate()})}),new G(t,this).setTab(e).setHeading().setName(`🎨 `+M(`Interface Details`));let r;new G(t,this).setName(M(`Heatmap Color Scheme`)).setDesc(M(`Set different color scheme for heatmap.`)).setTab(e).addDropdown(async e=>{r=e,r.addOption(`default`,M(`Default`)),r.addOption(`gray`,M(`Gray`)),r.addOption(`grass`,M(`Grass`)),r.addOption(`flame`,M(`Flame`)),r.addOption(`olive`,M(`Olive`)),r.addOption(`ice`,M(`Ice`)),r.addOption(`magenta`,M(`Magenta`)),r.setValue(this.plugin.settings.HeatmapColorScheme).onChange(async e=>{this.plugin.settings.HeatmapColorScheme=e,this.applySettingsUpdate()})}),new G(t,this).setName(M(`Save Memo button label`)).setDesc(M(`The text shown on the save Memo button in the UI. 'NOTEIT' by default.`)).setTab(e).addText(e=>e.setPlaceholder(W3.SaveMemoButtonLabel).setValue(this.plugin.settings.SaveMemoButtonLabel).onChange(async e=>{this.plugin.settings.SaveMemoButtonLabel=e,this.applySettingsUpdate()})),!f.Platform.isMobile&&new G(t,this).setName(M(`Always Show Leaf Sidebar on PC`)).setDesc(M(`Show left sidebar on PC/Tablet even when the leaf width is less than 875px. False by default.`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.ShowLeftSideBar).onChange(async e=>{this.plugin.settings.ShowLeftSideBar=e,this.applySettingsUpdate()})),this.addUseMobileViewDefaultHeaderSettings(e,t),this.addRememberImageSettings(e,t),this.addScrollToTopSettings(e,t),new G(t,this).setName(M(`Max height for collapse`)).setDesc(M(`The max height for thino collapse, when set 0, thino would not collapse. 0 by default. (This is not lines count, it is height in px.)`)).setTab(e).addText(e=>e.setPlaceholder(W3.ThinoMaxHeight.toString()).setValue(this.plugin.settings.ThinoMaxHeight.toString()).onChange(async e=>{if(Number(e)<80&&Number(e)!==0){new f.Notice(M(`The value should be greater than`)+`80`);return}this.plugin.settings.ThinoMaxHeight=Number(e),this.debounceApplySettingsUpdate()})),new G(t,this).setName(M(`Thino height when collapsed`)).setDesc(M(`The height for thino when it is collapsed, when set 0, thino would not collapse. 100 by default. (This is not lines count, it is height in px.)`)).setTab(e).addText(e=>e.setPlaceholder(W3.ThinoCollapsedHeight.toString()).setValue(this.plugin.settings.ThinoCollapsedHeight.toString()).onChange(async e=>{if(Number(e)<40&&Number(e)!==0){new f.Notice(M(`The value should be greater than`)+`40`);return}this.plugin.settings.ThinoCollapsedHeight=Number(e),this.debounceApplySettingsUpdate()})),await this.getEditorLocation(t,e)}customEditorSettings(e,t){new G(t,this).setHeading().setTab(e).setName(`📝 `+M(`Editor`)),new G(t,this).setName(M(`Use Tags In Vault`)).setDesc(M(`Use tags in vault rather than only in Memos. False by default.`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.UseVaultTags).onChange(async e=>{this.plugin.settings.UseVaultTags=e,this.applySettingsUpdate()}));let n;new G(t,this).setName(M(`Default insert date format`)).setDesc(M(`Set the default date format when insert date by @, 'Tasks' by default.`)).setTab(e).addDropdown(async e=>{n=e,n.addOption(`Tasks`,`Tasks`),n.addOption(`Dataview`,`Dataview`),n.setValue(this.plugin.settings.InsertDateFormat).onChange(async e=>{this.plugin.settings.InsertDateFormat=e,this.applySettingsUpdate()})}),new G(t,this).setName(M(`Focus on editor when open`)).setDesc(M(`Focus on editor when open. True by default.`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.FocusOnEditor).onChange(async e=>{this.plugin.settings.FocusOnEditor=e,this.applySettingsUpdate()})}),new G(t,this).setName(M(`Default Editor Mode`)).setDesc(M(`Live-Preview Mode OR Source Mode.`)).setTab(e).addDropdown(async e=>{n=e,n.addOption(`obsidian`,M(`Live-preview`)),n.addOption(`memos`,M(`Source`)),n.setValue(this.plugin.settings.EditorType).onChange(async e=>{this.plugin.settings.EditorType=e,this.applySettingsUpdate()})})}customTasksSettings(e,t){this.addTaskRelatedSettings(e,t)}async getEditorLocation(e,t){let n;f.Platform.isMobile&&(new G(e,this).setName(M(`Default editor position on mobile`)).setDesc(M(`Set the default editor position on Mobile, 'Top' by default.`)).setTab(t).addDropdown(async e=>{n=e,n.addOption(`Top`,M(`Top`)),n.addOption(`Bottom`,M(`Bottom`)),n.setValue(this.plugin.settings.DefaultEditorLocation).onChange(async e=>{this.plugin.settings.DefaultEditorLocation=e,this.applySettingsUpdate(),setTimeout(()=>{this.display()},200)})}),this.plugin.settings.DefaultEditorLocation!==`Top`&&new G(e,this).setName(M(`Use button to show editor on mobile`)).setDesc(M(`Set a float button to call editor on mobile. Only when editor located at the bottom works.`)).setTab(t).addToggle(e=>e.setValue(this.plugin.settings.UseButtonToShowEditor).onChange(async e=>{this.plugin.settings.UseButtonToShowEditor=e,this.applySettingsUpdate()})))}customHeading(e,t){new G(t,this).setHeading().setName(`👤 `+M(`User info`)).setTab(e),new G(t,this).setName(M(`User name`)).setDesc(M(`Set your user name here. 'Memos 😏' By default`)).setTab(e).addText(e=>e.setPlaceholder(W3.UserName).setValue(this.plugin.settings.UserName).onChange(async e=>{this.plugin.settings.UserName=e,this.applySettingsUpdate()})),new G(t,this).setTab(e).setName(M(`User icon`)).setDesc(M(`Set user icon for thino. You can input http/https link or file path in vault.`)).addText(e=>{new cE(e.inputEl),e.setPlaceholder(`URL`).setValue(this.plugin.settings.MomentsIcon).onChange(async e=>{this.plugin.settings.MomentsIcon=e,this.applySettingsUpdate()})}),new G(t,this).setTab(e).setName(M(`User quote`)).setDesc(M(`Set user quote for thino`)).addText(e=>e.setPlaceholder(`Input anything here`).setValue(this.plugin.settings.MomentsQuote).onChange(async e=>{this.plugin.settings.MomentsQuote=e,this.applySettingsUpdate()}));let n=!1,r=document.createDocumentFragment();r.createEl(`span`,{text:M(`Connect to PKMer Sync, you can check it in `)});let i=r_()?`https://pkmer.cn/products/UserProfile/#tab-21&activateSync`:`https://thino.pkmer.net/en/`;r.createEl(`a`,{text:M(`PKMer Sync`),attr:{href:i}}),r_()&&new G(t,this).setHeading().setName(`☁ `+M(`Sync service`)).setTab(e),r_()&&new G(t,this).setName(M(`Sync Thino via PKMer`)).setDesc(r).setTab(e).addButton(e=>{let t=this.plugin.app?.loadLocalStorage(`tokenForSync`);e.setButtonText(M(t?`Unlink`:`Link`)).onClick(async()=>{if(!t){r_()?window.open(`https://pkmer.cn/products/UserProfile/#tab-21&activateSync`,`_blank`):window.open(`https://thino.pkmer.net/en/`,`_blank`);return}if(!n){e.setButtonText(M(`Confirm?`)),n=!0;return}n=!1,t&&(this.plugin.app?.saveLocalStorage(`tokenForSync`,``),new f.Notice(M(`Remove successfully`))),R.setRefresh(!0),setTimeout(()=>{this.display()},20)})}),r_()&&this.showSyncStatus(t,e)}showSyncStatus(e,t){this.plugin.app?.loadLocalStorage(`tokenForSync`)&&(new G(e,this).setName(M(`Save thino type when sync local`)).setDesc(M(`Set the default save thino type when sync local, FILE by default.`)).setTab(t).addDropdown(async e=>{e.addOption(`DAILY`,M(`DAILY`)),e.addOption(`FILE`,M(`FILE`)),e.addOption(`JOURNAL`,M(`JOURNAL`)),e.setValue(this.plugin.settings.saveThinoType).onChange(async e=>{this.plugin.settings.saveThinoType=e,this.applySettingsUpdate()})}),new G(e,this).setName(M(`Sync Status`)).setDesc(M(`Start or stop sync`)).setTab(t).addButton(e=>{e.setButtonText(this.plugin.settings.startSync?M(`Stop`):M(`Start`)).onClick(async()=>{this.plugin.settings.startSync=!this.plugin.settings.startSync,await this.plugin.saveSettings(),R.setRefresh(!0),new f.Notice(this.plugin.settings.startSync?M(`Start sync successfully`):M(`Stop sync successfully`)),setTimeout(()=>{this.display()},200)})}),new G(e,this).setName(M(`Sync manually`)).setTab(t).addToggle(e=>{e.setValue(this.plugin.settings.SyncManually).onChange(async e=>{this.plugin.settings.SyncManually=e,this.applySettingsUpdate()})}))}addMemoSettings(e,t){let n;new G(t,this).setHeading().setTab(e).setName(`📅 `+M(`Daily notes`)),new G(t,this).setName(M(`Default prefix when save thino`)).setDesc(M(`Set the default prefix when create memo, 'List' by default.`)).setTab(e).addDropdown(async e=>{n=e,n.addOption(`List`,M(`List`)),n.addOption(`Task`,M(`Task`)),n.setValue(this.plugin.settings.DefaultPrefix).onChange(async e=>{this.plugin.settings.DefaultPrefix=e,this.applySettingsUpdate()})}),this.plugin.settings.EnabledLocationList.some(e=>e.value===`DAILY`)&&new G(t,this).setName(M(`Default time prefix for thino in daily notes`)).setDesc(M(`Set default time prefix for thino in daily notes.`)).setTab(e).addDropdown(async e=>{n=e,n.addOption(`HH:mm`,`HH:mm`),n.addOption(`HH:mm:ss`,`HH:mm:ss`),n.setValue(this.plugin.settings.DefaultTimePrefix).onChange(async e=>{this.plugin.settings.DefaultTimePrefix=e,this.applySettingsUpdate()})}),new G(t,this).setHeading().setTab(e).setName(`🔗 `+M(`Fixed strings for thinos`)),new G(t,this).setName(M(`Use fixed strings for thinos`)).setDesc(M(`Enable to add fixed strings at the beginning or end of thinos.`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.UseMemoFixedStrings).onChange(async e=>{this.plugin.settings.UseMemoFixedStrings=e,this.applySettingsUpdate(),setTimeout(()=>{this.display()},200)})),this.plugin.settings.UseMemoFixedStrings&&(new G(t,this).setName(M(`Fixed prefix for thinos`)).setDesc(M(`Add this string at the beginning of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`)).setTab(e).addText(e=>e.setValue(this.plugin.settings.MemoFixedPrefix).onChange(async e=>{this.plugin.settings.MemoFixedPrefix=e,this.applySettingsUpdate()})),new G(t,this).setName(M(`Fixed suffix for thinos`)).setDesc(M(`Add this string at the end of each thino. Supports placeholders like {{TIME|YYYYMMDDHHmmss}}.`)).setTab(e).addText(e=>e.setValue(this.plugin.settings.MemoFixedSuffix).onChange(async e=>{this.plugin.settings.MemoFixedSuffix=e,this.applySettingsUpdate()})))}customMemoFooter(e,t){new G(t,this).setName(M(`Custom Memo Footer`)).setDesc(M(`Set custom memo footer.`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.SetCustomMemoFooter).onChange(async e=>{this.plugin.settings.SetCustomMemoFooter=e,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.SetCustomMemoFooter&&new G(t,this).setName(M(`Share Memos Image Footer Start`)).setDesc(M(`Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default`)).setTab(e).addText(e=>e.setPlaceholder(W3.ShareFooterStart).setValue(this.plugin.settings.ShareFooterStart).onChange(async e=>{this.plugin.settings.ShareFooterStart=e,this.applySettingsUpdate()}))}saveDataSettings(e,t){new G(t,this).setName(M(`Delete Thino Directly`)).setDesc(M(`When delete thino directly, it will not be moved to trash. False by default.`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.DeleteThinoDirectly).onChange(async e=>{this.plugin.settings.DeleteThinoDirectly=e,this.applySettingsUpdate()})})}fetchDataSettings(e,t){let n;new G(t,this).setName(M(`Use which plugin's default configuration`)).setDesc(M(`Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.`)).setTab(e).addDropdown(async e=>{n=e,n.addOption(`Daily`,M(`Daily`)),n.addOption(`Periodic`,`Periodic`).setDisabled(!this.app.plugins.getPlugin(`periodic-notes`)),n.setValue(this.plugin.settings.UseDailyOrPeriodic).onChange(async e=>{this.plugin.settings.UseDailyOrPeriodic=e,this.applySettingsUpdate()})}).addExtraButton(e=>{e.setIcon(`settings`).onClick(()=>{if(this.plugin.settings.UseDailyOrPeriodic===`Daily`){if(!this.app.internalPlugins.plugins[`daily-notes`]||!this.app.internalPlugins.plugins[`daily-notes`].enabled){new f.Notice(`Daily Notes plugin is not installed`);return}this.app.setting.open(),this.app.setting.openTabById(`daily-notes`)}else{if(!this.app.plugins.getPlugin(`periodic-notes`)||!this.app.plugins.getPlugin(`periodic-notes`)._loaded){new f.Notice(`Periodic Notes plugin is not installed`);return}this.app.setting.open(),this.app.setting.openTabById(`periodic-notes`)}})})}navigationSettings(e,t){new G(t,this).setName(M(`Open link directly in Thino view`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.navigation).onChange(async e=>{this.plugin.settings.navigation=e,this.applySettingsUpdate()}))}optimizeForCalloutSettings(e,t){new G(t,this).setName(M(`Optimize for Callout`)).setDesc(M(`Won't render content contains more than 3 callouts automatically. True by default`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.OptimizeForCallout).onChange(async e=>{this.plugin.settings.OptimizeForCallout=e,this.applySettingsUpdate()}))}addUpdateMessageSettings(e,t){new G(t,this).setName(M(`Show release notes`)).setDesc(M(`Show release notes when Thino is updated. True by default`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.ShowUpdateMessage).onChange(async e=>{this.plugin.settings.ShowUpdateMessage=e,this.applySettingsUpdate()}))}clearConfigSettings(e,t){new G(t,this).setName(M(`Reset all Thino settings`)).setDesc(M(`Reset Thino settings to default settings.`)).setTab(e).addButton(e=>{e.setWarning().setButtonText(M(`Reset settings`)).onClick(async()=>{new iC(this.app,M(`Reset all Thino settings`),async()=>{this.plugin.settings={...W3,tokenForVerify:this.plugin.settings.tokenForVerify,password:this.plugin.settings.password,needVerify:this.plugin.settings.needVerify},this.debounceApplySettingsUpdate(),await V.fetchAllMemos(),V.updateTagsState(),this.plugin.app?.saveLocalStorage(`tokenForSync`,``),R.setRefresh(!0),R.setMemoListView(`list`),new f.Notice(M(`All settings have been reset to default.`)),this.debounceDisplay()}).open()})})}addAutoOpenMemosSettings(e,t){new G(t,this).setName(M(`Open Memos when obsidian opens`)).setDesc(M(`When enable this, Memos will open when Obsidian opens. False by default.`)).setTab(e).addDropdown(e=>{e.addOption(`Desktop`,`Desktop`),e.addOption(`Mobile`,`Mobile`),e.addOption(`All`,`All`),e.setValue(this.plugin.settings.MobileAndDesktop).onChange(async e=>{this.plugin.settings.MobileAndDesktop=e,this.applySettingsUpdate()})}).addToggle(e=>e.setValue(this.plugin.settings.OpenMemosAutomatically).onChange(async e=>{this.plugin.settings.OpenMemosAutomatically=e,this.applySettingsUpdate()}))}setPasswordSettings(e,t){new G(t,this).setName(M(`Need password to unlock Thino`)).setTab(e).addToggle(e=>{this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched&&(e.toggleEl.onclick=t=>{this.passwordMatched||(t.preventDefault(),new X3(this.app,this,this.plugin,t=>{e.setDisabled(!t),this.passwordMatched=t,this.debounceDisplay()}).open(),new f.Notice(M(`Please input your password to change password settings`)))}),e.setDisabled(this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched).setValue(this.plugin.settings.needVerify).onChange(async e=>{this.plugin.settings.needVerify=e,e&&(this.passwordMatched=!1),this.applySettingsUpdate(),this.debounceDisplay()})}),this.plugin.settings.needVerify&&new G(t,this).setName(M(`Password to lock Thino`)).setTab(e).addText(e=>{this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched&&(e.inputEl.onclick=t=>{this.passwordMatched||(t.preventDefault(),new X3(this.app,this,this.plugin,t=>{e.inputEl.readOnly=!t,this.passwordMatched=t,this.debounceDisplay()}).open(),new f.Notice(M(`Please input your password to change password settings`)))}),e.inputEl.readOnly=this.plugin.settings.password&&this.plugin.settings.needVerify&&!this.passwordMatched,e.inputEl.oncopy=()=>!1,e.inputEl.type=`password`,e.setValue(this.plugin.settings.password).onChange(async e=>{this.plugin.settings.password=e,this.applySettingsUpdate()})})}checkInList(e){return this.plugin.settings.EnabledLocationList.find(t=>t.value===e)!==void 0}customFileNameSettings(e,t,n){let r=document.createDocumentFragment(),i=r.createEl(`div`,{cls:`memo-save-location-desc`});for(let e of U3){let t=i.createEl(`div`,{cls:`memo-save-location-desc-item ${e.value}`});(0,f.setIcon)(t.createEl(`span`,{cls:`memo-save-location-desc-item-icon`}),Ur.find(t=>t.title===e.value)?.icon||``);let r=e.value===`DAILY`?`${M(e.value)} (Deprecated)`:`${M(e.value)}`;t.createEl(`span`,{cls:`memo-save-location-desc-item-desc`,text:r});let a=t.createEl(`span`,{cls:`memo-save-location-desc-item-toggle`}),o=t.createEl(`span`,{cls:`memo-save-location-desc-item-setting`}),s=e.value===`DAILY`||e.value===`JOURNAL`;s||t.createEl(`span`,{cls:[`memo-save-location-desc-item-pro`,`user-pro-badge`],text:`PRO`}),new f.ToggleComponent(a).setValue(this.checkInList(e.value)).onChange(async t=>{if(!n&&!s){Sv();return}t?(await V.updateTypeMemos(e.value),this.plugin.settings.EnabledLocationList=[...this.plugin.settings.EnabledLocationList,e]):(await V.removeTypeMemos(e.value),this.plugin.settings.EnabledLocationList=this.plugin.settings.EnabledLocationList.filter(t=>t.value!==e.value)),this.plugin.settings.EnabledLocationList.length===1&&(this.plugin.settings.MemoSaveLocation=e.value),this.applySettingsUpdate(),setTimeout(()=>{this.display()},500)}).setDisabled(this.plugin.settings.EnabledLocationList.length===1&&this.checkInList(e.value)),new f.ExtraButtonComponent(o).setIcon(`settings`).onClick(()=>{new sG(this.app,this,this.plugin,e,n).open()})}let a=new G(t,this).setName(M(`Save type for Thino`)).setDesc(r).setTab(e);a.settingEl.toggleClass(`memo-save-location-setting`,!0),a.nameEl.toggleClass(`memo-save-location-title`,!0)}addScrollToTopSettings(e,t){new G(t,this).setName(M(`Show scroll to top button`)).setDesc(M(`Show scroll to top button. True by default`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.ShowScrollToTopButton).onChange(async e=>{this.plugin.settings.ShowScrollToTopButton=e,this.applySettingsUpdate()})})}addRememberImageSettings(e,t){new G(t,this).setName(M(`Zoom image by default`)).setDesc(M(`Zoom image by default when viewing image.`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.ZoomImageWhenViewing).onChange(async e=>{this.plugin.settings.ZoomImageWhenViewing=e,this.applySettingsUpdate()})})}addViewArchiveInRandomReviewSettings(e,t){new G(t,this).setName(M(`View archive in random review`)).setDesc(M(`View archived thinos in random review. True by default`)).setTab(e).addToggle(e=>{e.setValue(this.plugin.settings.ViewArchiveInRandomReview).onChange(async e=>{this.plugin.settings.ViewArchiveInRandomReview=e,this.applySettingsUpdate()})})}addTaskRelatedSettings(e,t){new G(t,this).setHeading().setName(`📃 `+M(`Task Management`)).setTab(e),new G(t,this).setName(M(`Show Tasks Label`)).setDesc(M(`Show tasks label near the time text. False by default`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.ShowTaskLabel).onChange(async e=>{this.plugin.settings.ShowTaskLabel=e,this.applySettingsUpdate()})),new G(t,this).setName(M(`Append completed date when task done in thino`)).setDesc(M(`Append completed date when task done in thino. False by default`)).setTab(e).addToggle(e=>e.setValue(this.plugin.settings.AppendDateWhenTaskDone).onChange(async e=>{this.plugin.settings.AppendDateWhenTaskDone=e,this.applySettingsUpdate()}))}},X3=class extends f.Modal{plugin;settingTab;constructor(e,t,n,r){super(e),this.cb=r,this.app=e,this.settingTab=t,this.plugin=n}onOpen(){let{contentEl:e}=this;e.parentElement?.classList.add(`memo-save-location-modal`),this.titleEl.toggleClass(`modal-title`,!0),this.titleEl.setText(M(`Password for Thino`)),e.createDiv(`modal-desc`,e=>{e.setText(M(`Please input your password to change password settings`))});let t=new G(e.createDiv(`modal-setting`),this.settingTab).setName(M(`Password`)).addText(e=>{e.setPlaceholder(M(`Please input your password`)).inputEl.type=`password`}),n=e.createDiv(`button-group`),r=n.createEl(`button`,{text:M(`Cancel`)}),i=n.createEl(`button`,{cls:`thino-password-confirm-btn`,text:M(`Confirm?`).replace(/(\?|?)/g,``)});i.onclick=async()=>{t.controlEl.querySelector(`input`).value===this.plugin.settings.password?(this.cb?.(!0),this.close()):new f.Notice(M(`Password is incorrect`))},r.onclick=async()=>{this.close()}}onClose(){let{contentEl:e}=this;e.empty()}},Z3=class extends f.Modal{constructor(e){super(e)}onOpen(){let{contentEl:e}=this;this.titleEl.setText(M(`Set secret password`));let t=e.createEl(`input`,{type:`password`,placeholder:M(`Enter password`),cls:`thino-secret-password-input`});t.style.width=`100%`,t.style.marginBottom=`12px`;let n=e.createEl(`input`,{type:`password`,placeholder:M(`Confirm password`),cls:`thino-secret-password-input`});n.style.width=`100%`,n.style.marginBottom=`12px`;let r=e.createDiv(`button-group`),i=r.createEl(`button`,{text:M(`Cancel`)}),a=r.createEl(`button`,{text:M(`Confirm`),cls:`mod-cta`});i.onclick=()=>this.close(),a.onclick=()=>{let e=t.value,r=n.value;if(e){if(e!==r){new f.Notice(M(`Passwords do not match`));return}this.app.secretStorage.setSecret(`thino-secret-masking-password`,e),new f.Notice(M(`Password set successfully`)),this.close()}}}onClose(){this.contentEl.empty()}};function Q3(e){return e.split(`-`)[0]}function $3(e){return e.split(`-`)[1]}function e6(e){return[`top`,`bottom`].includes(Q3(e))?`x`:`y`}function t6(e){return e===`y`?`height`:`width`}function n6(e){let{reference:t,floating:n,placement:r}=e,i=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,o;switch(Q3(r)){case`top`:o={x:i,y:t.y-n.height};break;case`bottom`:o={x:i,y:t.y+t.height};break;case`right`:o={x:t.x+t.width,y:a};break;case`left`:o={x:t.x-n.width,y:a};break;default:o={x:t.x,y:t.y}}let s=e6(r),c=t6(s);switch($3(r)){case`start`:o[s]=o[s]-(t[c]/2-n[c]/2);break;case`end`:o[s]=o[s]+(t[c]/2-n[c]/2);break}return o}var r6=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:l}=n6({...s,placement:r}),u=r,d={};for(let n=0;n<a.length;n++){let{name:f,fn:p}=a[n],{x:m,y:h,data:g,reset:_}=await p({x:c,y:l,initialPlacement:r,placement:u,strategy:i,middlewareData:d,rects:s,platform:o,elements:{reference:e,floating:t}});if(c=m??c,l=h??l,d={...d,[f]:g??{}},_){typeof _==`object`&&(_.placement&&(u=_.placement),_.rects&&(s=_.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):_.rects),{x:c,y:l}=n6({...s,placement:u})),n=-1;continue}}return{x:c,y:l,placement:u,strategy:i,middlewareData:d}};function i6(e){return{top:0,right:0,bottom:0,left:0,...e}}function a6(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:i6(e)}function o6(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function s6(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingParents`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=t,p=a6(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=await i.getClippingClientRect({element:await i.isElement(m)?m:m.contextElement||await i.getDocumentElement({element:o.floating}),boundary:c,rootBoundary:l}),g=o6(await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:u===`floating`?{...a.floating,x:n,y:r}:a.reference,offsetParent:await i.getOffsetParent({element:o.floating}),strategy:s}));return{top:h.top-g.top+p.top,bottom:g.bottom-h.bottom+p.bottom,left:h.left-g.left+p.left,right:g.right-h.right+p.right}}var c6={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function l6(e){return e.replace(/left|right|bottom|top/g,e=>c6[e])}function u6(e,t){let n=$3(e)===`start`,r=e6(e),i=t6(r),a=r===`x`?n?`right`:`left`:n?`bottom`:`top`;return t.reference[i]>t.floating[i]&&(a=l6(a)),{main:a,cross:l6(a)}}var d6={start:`end`,end:`start`};function f6(e){return e.replace(/start|end/g,e=>d6[e])}function p6(e){let t=l6(e);return[f6(e),t,f6(t)]}var m6=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o}=t;if((n=i.flip)!=null&&n.skip)return{};let{mainAxis:s=!0,crossAxis:c=!0,fallbackPlacements:l,fallbackStrategy:u=`bestFit`,flipAlignment:d=!0,...f}=e,p=Q3(r),m=[o,...l||(p===o||!d?[l6(o)]:p6(o))],h=await s6(t,f),g=[],_=i.flip?.overflows||[];if(s&&g.push(h[p]),c){let{main:e,cross:t}=u6(r,a);g.push(h[e],h[t])}if(_=[..._,{placement:r,overflows:g}],!g.every(e=>e<=0)){let e=(i.flip?.index??0)+1,t=m[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=`bottom`;switch(u){case`bestFit`:{let e=_.slice().sort((e,t)=>e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)-t.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0))[0]?.placement;e&&(n=e);break}case`initialPlacement`:n=o;break}return{data:{skip:!0},reset:{placement:n}}}return{}}}};function h6(e){let{placement:t,rects:n,value:r}=e,i=Q3(t),a=[`left`,`top`].includes(i)?-1:1,o=typeof r==`function`?r({...n,placement:t}):r,{mainAxis:s,crossAxis:c}=typeof o==`number`?{mainAxis:o,crossAxis:0}:{mainAxis:0,crossAxis:0,...o};return e6(i)===`x`?{x:c,y:s*a}:{x:s*a,y:c}}var g6=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,fn(t){let{x:n,y:r,placement:i,rects:a}=t,o=h6({placement:i,rects:a,value:e});return{x:n+o.x,y:r+o.y,data:o}}}};function _6(e){return e?.toString()===`[object Window]`}function v6(e){if(e==null)return window;if(!_6(e)){let t=e.ownerDocument;return t&&t.defaultView||window}return e}function y6(e){return v6(e).getComputedStyle(e)}function b6(e){return _6(e)?``:e?(e.nodeName||``).toLowerCase():``}function x6(e){return e instanceof v6(e).HTMLElement}function S6(e){return e instanceof v6(e).Element}function C6(e){return e instanceof v6(e).Node}function w6(e){return e instanceof v6(e).ShadowRoot||e instanceof ShadowRoot}function T6(e){let{overflow:t,overflowX:n,overflowY:r}=y6(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function E6(e){return[`table`,`td`,`th`].includes(b6(e))}function D6(e){let t=navigator.userAgent.toLowerCase().includes(`firefox`),n=y6(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)}var O6=Math.min,k6=Math.max,A6=Math.round;function j6(e,t){t===void 0&&(t=!1);let n=e.getBoundingClientRect(),r=1,i=1;return t&&x6(e)&&(r=e.offsetWidth>0&&A6(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&A6(n.height)/e.offsetHeight||1),{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function M6(e){return((C6(e)?e.ownerDocument:e.document)||window.document).documentElement}function N6(e){return _6(e)?{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}:{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function P6(e){return j6(M6(e)).left+N6(e).scrollLeft}function F6(e){let t=j6(e);return A6(t.width)!==e.offsetWidth||A6(t.height)!==e.offsetHeight}function I6(e,t,n){let r=x6(t),i=M6(t),a=j6(e,r&&F6(t)),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&n!==`fixed`)if((b6(t)!==`body`||T6(i))&&(o=N6(t)),x6(t)){let e=j6(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=P6(i));return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}function L6(e){return b6(e)===`html`?e:e.assignedSlot||e.parentNode||(w6(e)?e.host:null)||M6(e)}function R6(e){return!x6(e)||getComputedStyle(e).position===`fixed`?null:e.offsetParent}function z6(e){let t=L6(e);for(;x6(t)&&![`html`,`body`].includes(b6(t));)if(D6(t))return t;else t=t.parentNode;return null}function B6(e){let t=v6(e),n=R6(e);for(;n&&E6(n)&&getComputedStyle(n).position===`static`;)n=R6(n);return n&&(b6(n)===`html`||b6(n)===`body`&&getComputedStyle(n).position===`static`&&!D6(n))?t:n||z6(e)||t}function V6(e){return{width:e.offsetWidth,height:e.offsetHeight}}function H6(e){let{rect:t,offsetParent:n,strategy:r}=e,i=x6(n),a=M6(n);if(n===a)return t;let o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((i||!i&&r!==`fixed`)&&((b6(n)!==`body`||T6(a))&&(o=N6(n)),x6(n))){let e=j6(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-o.scrollLeft+s.x,y:t.y-o.scrollTop+s.y}}function U6(e){let t=v6(e),n=M6(e),r=t.visualViewport,i=n.clientWidth,a=n.clientHeight,o=0,s=0;return r&&(i=r.width,a=r.height,Math.abs(t.innerWidth/r.scale-r.width)<.01&&(o=r.offsetLeft,s=r.offsetTop)),{width:i,height:a,x:o,y:s}}function W6(e){let t=M6(e),n=N6(e),r=e.ownerDocument?.body,i=k6(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=k6(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+P6(e),s=-n.scrollTop;return y6(r||t).direction===`rtl`&&(o+=k6(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function G6(e){return[`html`,`body`,`#document`].includes(b6(e))?e.ownerDocument.body:x6(e)&&T6(e)?e:G6(L6(e))}function K6(e,t){t===void 0&&(t=[]);let n=G6(e),r=n===e.ownerDocument?.body,i=v6(n),a=r?[i].concat(i.visualViewport||[],T6(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(K6(L6(a)))}function q6(e,t){let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&w6(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function J6(e){let t=j6(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 Y6(e,t){return t===`viewport`?o6(U6(e)):S6(t)?J6(t):o6(W6(M6(e)))}function X6(e){let t=K6(L6(e)),n=[`absolute`,`fixed`].includes(y6(e).position)&&x6(e)?B6(e):e;return S6(n)?t.filter(e=>S6(e)&&q6(e,n)&&b6(e)!==`body`):[]}function Z6(e){let{element:t,boundary:n,rootBoundary:r}=e,i=[...n===`clippingParents`?X6(t):[].concat(n),r],a=i[0],o=i.reduce((e,n)=>{let r=Y6(t,n);return e.top=k6(r.top,e.top),e.right=O6(r.right,e.right),e.bottom=O6(r.bottom,e.bottom),e.left=k6(r.left,e.left),e},Y6(t,a));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var Q6={getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:I6(t,B6(n),r),floating:{...V6(n),x:0,y:0}}},convertOffsetParentRelativeRectToViewportRelativeRect:e=>H6(e),getOffsetParent:e=>{let{element:t}=e;return B6(t)},isElement:e=>S6(e),getDocumentElement:e=>{let{element:t}=e;return M6(t)},getClippingClientRect:e=>Z6(e),getDimensions:e=>{let{element:t}=e;return V6(t)},getClientRects:e=>{let{element:t}=e;return t.getClientRects()}},$6=(e,t,n)=>r6(e,t,{platform:Q6,...n}),e8=u(s(((e,t)=>{t.exports=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,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))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(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}}))()),t8=m.Facet.define({combine:e=>({defaultPlacement:e.find(e=>e.defaultPlacement)?.defaultPlacement||`top`,padding:e.find(e=>e.padding)?.padding||8})}),n8=e=>e.split(`-`)[0],r8=e=>e===`x`?`y`:`x`,i8=e=>[`top`,`bottom`].includes(n8(e))?`x`:`y`,a8=(e,t,n)=>Math.max(e,Math.min(t,n)),o8=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n],r)=>[e,t(n,e,r)])),s8=e=>e===void 0?e:typeof e==`number`?-e:o8(e,e=>e===void 0?e:-e),c8=(e={})=>({name:`shift`,fn:async t=>{let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s=({x:e,y:t})=>({x:e,y:t}),editorMenu:c,...l}=e,u={x:n,y:r},d=await s6(t,l),f=i8(n8(i)),p=r8(f),m=u[f],h=u[p];if(a){let e=f===`y`?`top`:`left`,n=f===`y`?`bottom`:`right`,r=m+d[e],i=m-d[n];if(c){let a=await s6(t,{...l,boundary:c.dom,padding:s8(l.padding)});if((p===`y`?[`top`,`bottom`]:[`left`,`right`]).every(e=>a[e]<=0)){let o=t.rects.floating.width,s=m+a[e]-o,c=m-a[n]+o,l=Math.abs(d[e]-a[e]),u=Math.abs(d[n]-a[n]);m=l>=o||u<l?a8(r,m,s):a8(c,m,i)}else m=a8(r,m,i)}else m=a8(r,m,i)}if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=a8(n,h,r)}return s({...t,[f]:m,[p]:h})}}),l8=`thino-mini-toolbar`,u8=(e=0,t=0)=>({width:0,height:0,top:t,left:e,bottom:t,right:e,x:e,y:t}),d8=(e,t)=>{if(!e)return null;let n=Math.min(e.left,t?.left??e.left),r=Math.max(e.right,t?.right??e.right),i=Math.max(e.bottom,t?.bottom??e.bottom)-Math.min(e.top,t?.top??e.top),a=Math.min(e.top,t?.top??e.top),o={left:n,right:r,top:a,bottom:a+i,width:0,height:i,x:a,y:n};return t&&(o.width=Math.abs(r-n)),o},f8=u8(),p8=class{containerEl;virtualEl;toolbar=null;isThinoView;get workspace(){return this.view.state.field(f.editorInfoField).app.workspace}tooltipInfo;inView=!0;defaultPlacement;editorMenu;constructor(e){this.view=e,this.containerEl=this.view.dom.parentElement,this.defaultPlacement=this.view.state.facet(t8).defaultPlacement,this.tooltipInfo=e.state.facet(h8),this.virtualEl={rect:f8,getBoundingClientRect(){return this.rect}},this.maybeMeasure(),this.editorMenu={currMenu:null,evtRef:e.state.field(f.editorInfoField)},console.log(`check thino view`),this.isThinoView=this.checkThinoView()}checkThinoView(){return this.view.state.field(f.editorInfoField)?this.view.state.field(f.editorInfoField)&&this.view.state.field(f.editorInfoField)?.getViewType?.()===`thino_view`:!1}shouldRemoveToolbar(e){return!((e??this.tooltipInfo)?.end||this.editorMenu.currMenu)}onEditorMenuOpen(e){this.editorMenu.currMenu||(this.editorMenu.currMenu=e,this.cachedRefRect?this.computePosition(this.cachedRefRect):this.maybeMeasure(),!f.Platform.isMacOS&&this.tooltipInfo&&(this.createToolbar(),this.maybeMeasure()))}onEditorMenuClose(e){this.editorMenu.currMenu===e&&(this.editorMenu.currMenu=null),!f.Platform.isMacOS&&this.toolbar&&this.shouldRemoveToolbar()&&this.removeToolbar()}createToolbar(e){let t=e??this.tooltipInfo;if(!t)return;this.removeToolbar();let n=t.create(this.containerEl),r=this.view.state.field(f.editorInfoField);if(!r||!r?.editor)return;let i=r.editor.offsetToPos(t.start),a=t.end?r.editor.offsetToPos(t.end):i;this.workspace.trigger(l8,n,{from:i,to:a},r.editor,r),this.toolbar=n}removeToolbar(){this.toolbar&&=(this.toolbar.hide(),null)}update(e){if(!this.isThinoView)return;let t=e.state.facet(h8),n=t!==this.tooltipInfo&&!(0,e8.default)(t,this.tooltipInfo);n&&(this.tooltipInfo=t,this.shouldRemoveToolbar()?this.removeToolbar():t&&!this.toolbar&&this.createToolbar(t));let r=n||e.geometryChanged,i=e.state.facet(t8);i.defaultPlacement!=this.defaultPlacement&&(i.defaultPlacement=this.defaultPlacement),r&&this.maybeMeasure()}destroy(){this.editorMenu.currMenu=null,this.removeToolbar(),this.toolbar=null,this.view.state.field(f.editorInfoField).app.workspace.offref(this.editorMenu.evtRef)}cachedRefRect=null;readFromDOM=()=>{if(this.tooltipInfo){let{start:e}=this.tooltipInfo,{end:t}=this.tooltipInfo;t&&e===t&&(t=void 0);let n=this.view.coordsAtPos(e),r=t?this.view.coordsAtPos(t):null;if(n&&r&&n.top!==r.top){let e=this.view.contentDOM.getBoundingClientRect();r={left:e.right,right:e.right,top:n.top,bottom:n.bottom}}let i=d8(n,r);i&&(this.cachedRefRect=i,this.computePosition(i))}};async computePosition(e){if(!this.toolbar)return;this.virtualEl.rect=e;let{padding:t}=this.view.state.facet(t8),{x:n,y:r}=await $6(this.virtualEl,this.toolbar.dom,{placement:this.defaultPlacement,middleware:[g6({mainAxis:5}),m6({padding:t,boundary:this.view.scrollDOM}),c8({padding:t,boundary:this.view.scrollDOM,editorMenu:this.editorMenu.currMenu})]});Object.assign(this.toolbar.dom.style,{top:`0`,left:`0`,transform:`translate(${Math.round(n)}px,${Math.round(r)}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())}},m8=h.ViewPlugin.fromClass(p8,{eventHandlers:{scroll(){this.maybeMeasure()}}}),h8=m.Facet.define({enables:[m8],combine:e=>e.filter(e=>e!=null).first()??null}),g8=e=>{let t=x8(e);t&&window.navigator.clipboard.writeText(t?.getSelection())},_8=e=>{e.commands.executeCommandById(`editor:toggle-bold`,e)},v8=e=>{e.commands.executeCommandById(`editor:toggle-strikethrough`,e)},y8=e=>{e.commands.executeCommandById(`editor:toggle-highlight`,e)},b8=e=>{e.commands.executeCommandById(`editor:toggle-italics`,e)},x8=e=>{let{editor:t}=e.field(f.editorInfoField);return t},S8=(e,t)=>{let n=e.selection.ranges[0];if(!n)return null;let{anchor:r,head:i,empty:a}=n,[o,s]=[r,i].sort();return{start:o,end:a?void 0:s,create:n=>new E8(n).addSmallButton(t=>t.setClass(`clickable-icon`).setIcon(`copy`).onClick(()=>g8(e))).addSmallButton(e=>e.setClass(`clickable-icon`).setIcon(`bold`).onClick(()=>_8(t))).addSmallButton(e=>e.setClass(`clickable-icon`).setIcon(`italic`).onClick(()=>b8(t))).addSmallButton(e=>e.setClass(`clickable-icon`).setIcon(`strikethrough`).onClick(()=>v8(t))).addSmallButton(e=>e.setClass(`clickable-icon`).setIcon(`highlighter`).onClick(()=>y8(t)))}},C8=e=>m.StateField.define({create:t=>S8(t,e),update:(t,n)=>!n.docChanged&&!n.selection?t:S8(n.state,e),provide:e=>h8.from(e)}),w8=e=>[C8(e)],T8=class extends f.BaseComponent{button;disabled=!1;dropdownOptions=[];menu;menuOpened=!1;constructor(e){super(),this.button=new f.ButtonComponent(e)}setDisabled(e){return this.button.setDisabled(e),this.disabled=e,this}setIcon(e){return this.button.setIcon(e),this}setClass(e){return this.button.setClass(e),this}setDropdownText(e){let t=this.button.buttonEl.createDiv(`mini-toolbar-text`);(0,f.setIcon)(this.button.buttonEl.createDiv(`mini-toolbar-icon-with-text`),`chevron-down`);let n=e.doc.lineAt(e.selection.ranges[0].from)?.from,r=(0,p.syntaxTree)(e).resolveInner(n+1),i=r.type.prop(p.tokenClassNodeProp);return t.setText(this.detectFormat(i,r)||`Text`),this}setDropdownIcon(){let e=this.button.buttonEl.createDiv(`mini-toolbar-highlight-icon`),t=this.button.buttonEl.createDiv(`mini-toolbar-icon-with-icon`);return(0,f.setIcon)(e,`highlighter`),(0,f.setIcon)(t,`chevron-down`),this}detectFormat(e,t){if(!e)return`Text`;if(e.includes(`strong`))return`Bold`;if(e.includes(`em`))return`Italic`;if(e.includes(`strikethrough`))return`Strike`;if(e.contains(`hmd-codeblock`))return`CodeBlock`;if(e.contains(`hmd-inline-code`))return`Code`;if(e.contains(`formatting-header`)){let t=e.match(/header-\d{1,}/);if(t)return`Heading `+t[0].slice(-1)}if(e.contains(`formatting-list`)||e.contains(`hmd-list-indent`)){if(t?.parent&&(t.parent?.type.prop(p.lineClassNodeProp))?.contains(`HyperMD-task-line`))return`To-do list`;if(e.contains(`formatting-list-ol`))return`Numbered list`;if(e.contains(`formatting-list-ul`))return`Bulleted list`}}setTooltip(e){return this.button.setTooltip(e),this}setOptionsList(e){return this.dropdownOptions=e,this}onClick(e){return this.dropdownOptions.length>0?(this.button.onClick(e=>this.showEditMenu(e)),this):(this.button.onClick(e),this)}showEditMenu(e){if(this.menuOpened=!this.menuOpened,!this.menuOpened)return;this.menu=new f.Menu,this.menu.onHide(()=>{this.menuOpened=!1});let t=e.currentTarget,n=e.currentTarget?.getBoundingClientRect(),r={x:n.left-6,y:n.bottom+6};for(let e=0;e<this.dropdownOptions?.length;e++)this.menu.addItem(t=>{t.setIcon(`zap`).setTitle(this.dropdownOptions[e]).onClick(()=>{console.log(`Hellow`)})});this.menu.setParentElement(t).showAtPosition(r)}then(e){return e(this),this}},E8=class extends f.Component{dom;smallBtnContainer;constructor(e){super(),this.dom=(e?.closest(`.memo-editor-wrapper`)||e?.closest(`.temp-editor`)).createDiv({cls:`cm-mini-toolbar`},e=>e.style.position=`absolute`),this.smallBtnContainer=this.dom}addSmallButton(e){return e(new T8(this.smallBtnContainer)),this}unloading=!1;hide(){return this.unload(),this.unloading?this:(this.unloading=!0,this.dom.detach(),this.unloading=!1,this)}};N();var D8=h.Decoration.line({attributes:{"data-ph":M(`What do you think now...`)},class:`thino-editor-placeholder`}),O8=m.StateField.define({create(){return h.Decoration.none},update(e,t){let n=t.state.field(f.editorInfoField);if(!n||n.getViewType&&n.getViewType()!==`thino_view`)return e;let r=new m.RangeSetBuilder,i=t.state.doc.toString(),a=t.state.doc.lineAt(0);return i?.length==0&&r.add(a.from,a.from,D8),r.finish()},provide:e=>h.EditorView.decorations.from(e)});Si();function k8(e){return`userId:${e}`}function A8(e,t){return`expiryDate:${t}:${e}`}function j8(e){try{if(!e?.appId)return``;let t=k8(e.appId);return xi.get([t])[t]||``}catch(e){return console.error(e),``}}function M8(e,t){try{if(!t?.appId)return;let n=k8(t.appId);return xi.set({[n]:e}),{userId:e,key:n}}catch(e){console.error(e)}}function N8(e,t){try{if(!t?.appId)return;let n=A8(j8(t),t.appId);xi.set({[n]:e})}catch(e){console.error(e)}}H(),Wr(),Qr(),N(),P_();var P8=N_(`http`),F8=N_(`url`),I8=class{worker=null;server=null;isServerRunning=!1;plugin;settings;messageHandlers=new Map;tokenManager;constructor(e,t){this.plugin=e,this.settings=t,this.tokenManager=new SG(e)}async initializeWorker(){if(!this.worker)try{this.createSecureServer()}catch(e){throw console.error(`Failed to initialize worker:`,e),e}}createSecureServer(){this.server=P8.createServer(async(e,t)=>{t.setHeader(`Access-Control-Allow-Origin`,`*`),t.setHeader(`Access-Control-Allow-Methods`,`GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE`),t.setHeader(`Access-Control-Allow-Headers`,`Origin, X-Requested-With, Content-Type, Accept, Authorization, Cache-Control, Pragma`),t.setHeader(`Access-Control-Allow-Credentials`,`false`),t.setHeader(`Access-Control-Max-Age`,`86400`),t.setHeader(`X-Content-Type-Options`,`nosniff`),t.setHeader(`X-Frame-Options`,`DENY`),t.setHeader(`X-XSS-Protection`,`1; mode=block`),t.setHeader(`Strict-Transport-Security`,`max-age=31536000; includeSubDomains`);try{await this.handleRequest(e,t)}catch(e){console.error(`Request handling error:`,e),this.sendErrorResponse(t,500,`Internal server error`)}}),this.server.on(`error`,e=>{console.error(`Server error:`,e),new f.Notice(`Thino - Server error: `+e.message)}),this.server.on(`clientError`,(e,t)=>{console.error(`Client error:`,e),t.end(`HTTP/1.1 400 Bad Request\r
|
||
\r
|
||
`)})}async handleRequest(e,t){if(!e.url){this.sendErrorResponse(t,400,`Invalid request`);return}let n=F8.parse(e.url,!0),r=n.pathname;if(e.method===`OPTIONS`){t.statusCode=200,t.setHeader(`Content-Length`,`0`),t.end();return}let i=e.headers.authorization;if(!i){this.sendErrorResponse(t,401,`Missing authorization header`);return}let a=this.tokenManager.extractTokenFromHeader(i);if(!a){this.sendErrorResponse(t,401,`Invalid authorization format`);return}if(!await this.tokenManager.validateToken(a)){this.sendErrorResponse(t,401,`Invalid or expired token`);return}if(!await this.tokenManager.isUserVerified()){this.sendErrorResponse(t,403,`Pro license required`);return}let o=e.socket.remoteAddress||`unknown`;if(!this.checkRateLimit(o)){this.sendErrorResponse(t,429,`Too many requests`);return}try{switch(r){case`/create`:await this.handleCreateRequest(e,t);break;case`/search`:await this.handleSearchRequest(e,t,n.query);break;case`/list`:await this.handleListRequest(e,t,n.query);break;case`/info`:await this.handleInfoRequest(e,t,n.query);break;default:this.sendErrorResponse(t,404,`Not found`);break}}catch(e){console.error(`Route handling error:`,e),this.sendErrorResponse(t,500,`Internal server error`)}}async handleCreateRequest(e,t){if(e.method!==`POST`){this.sendErrorResponse(t,405,`Method not allowed`);return}let n=``,r=0;e.on(`data`,e=>{if(r+=e.length,r>10485760){this.sendErrorResponse(t,413,`Request too large`);return}n+=e.toString()}),e.on(`end`,async()=>{try{let e=this.validateAndSanitizeInput(JSON.parse(n)),r=await this.processCreateRequest(e);t.statusCode=200,t.setHeader(`Content-Type`,`application/json`),t.end(JSON.stringify(r))}catch(e){console.error(`Create request error:`,e),this.sendErrorResponse(t,400,`Invalid request data`)}}),e.on(`error`,e=>{console.error(`Request stream error:`,e),this.sendErrorResponse(t,400,`Request error`)})}async handleSearchRequest(e,t,n){if(e.method!==`GET`){this.sendErrorResponse(t,405,`Method not allowed`);return}let r=this.sanitizeInput(n.keyword);if(!r){this.sendErrorResponse(t,400,`Invalid keyword`);return}try{let e=V.getThinoViaKeyword(r);t.statusCode=200,t.setHeader(`Content-Type`,`application/json`),t.end(JSON.stringify({status:`success`,thinos:e}))}catch(e){console.error(`Search error:`,e),this.sendErrorResponse(t,500,`Search failed`)}}async handleListRequest(e,t,n){if(e.method!==`GET`){this.sendErrorResponse(t,405,`Method not allowed`);return}let r=n.count,i=Math.min(Math.max(parseInt(r)||10,1),100);try{let e=V.getState().memos.slice(0,i);t.statusCode=200,t.setHeader(`Content-Type`,`application/json`),t.end(JSON.stringify({status:`success`,thinos:e}))}catch(e){console.error(`List error:`,e),this.sendErrorResponse(t,500,`List failed`)}}async handleInfoRequest(e,t,n){if(e.method!==`GET`){this.sendErrorResponse(t,405,`Method not allowed`);return}if(!n.getSettings){this.sendErrorResponse(t,400,`Missing getSettings parameter`);return}try{let e=L.getState().settings;t.statusCode=200,t.setHeader(`Content-Type`,`application/json`),t.end(JSON.stringify({status:`success`,infoSettings:e}))}catch(e){console.error(`Info error:`,e),this.sendErrorResponse(t,500,`Info retrieval failed`)}}validateAndSanitizeInput(e){if(!e||typeof e!=`object`)throw Error(`Invalid request data`);return{text:this.sanitizeInput(e.text||``),isList:!!e.isList,type:this.sanitizeInput(e.type||``),imageList:Array.isArray(e.imageList)?e.imageList.slice(0,10):[],sourceLink:this.sanitizeInput(e.sourceLink||``)}}sanitizeInput(e){return typeof e==`string`?e.replace(/[<>]/g,``).replace(/javascript:/gi,``).replace(/data:/gi,``).substring(0,1e4):``}async processCreateRequest(e){let{text:t,isList:n,type:r,imageList:i,sourceLink:a}=e;if(!t)return{status:`success`,thino:null,link:null};let o=t;if(/<[a-zA-Z][^>]*>/g.test(t)&&(o=(0,f.htmlToMarkdown)(t)),a)try{o=`${o} [source](<${decodeURIComponent(a)}>)`}catch(e){console.warn(`Failed to decode source link:`,e)}this.settings.AutoDownloadImage&&i.length>0&&(o=await this.processImages(o,i)),this.plugin.settings?.AppendOrPrependTextViaServer&&(o=this.formatText(o));let s=r||this.settings.MemoSaveLocation,c=await V.createThino({content:o,isList:n,type:s});return c&&(V.pushMemo(c),z.clearQuery()),{status:`success`,thino:c,link:c?`obsidian://thino?openId=${c.id}`:null}}async processImages(e,t){try{let n=e.match(Ir)||[],r=[];for(let e of n.slice(0,5))try{let t=await P.grabImageFromUrl(e);if(t.size===0)continue;let n=new File([t],`image.png`,{type:`image/png`}),i=await this.handleUploadFile(n);i&&r.push({oldUrl:e,newUrl:i})}catch(e){console.error(`Error processing image URL:`,e)}r.forEach(t=>{e=e.replace(t.oldUrl,t.newUrl)});let i=[];for(let e of t.slice(0,5))try{if(typeof e==`string`&&e.startsWith(`data:image/`)){let t=this.base64ImageToBlob(e),n=new File([t],`image.png`,{type:`image/png`}),r=await this.handleUploadFile(n);r&&i.push(r)}}catch(e){console.error(`Error processing base64 image:`,e)}i.length>0&&(e+=`
|
||
`+i.join(`
|
||
`))}catch(e){console.error(`Error processing images:`,e)}return e}base64ImageToBlob(e){let t=e.indexOf(`;base64,`);if(t===-1)throw Error(`Invalid base64 image format`);let n=e.substring(5,t),r=e.substr(t+8);if(!/^[A-Za-z0-9+/]*={0,2}$/.test(r))throw Error(`Invalid base64 characters`);let i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return new Blob([a],{type:n})}async handleUploadFile(e){let{type:t}=e;if(!t.startsWith(`image`))return null;try{return`${await Wg.upload(e)}`}catch(e){return console.error(`Upload error:`,e),new f.Notice(e),null}}formatText(e){let t=this.settings;return`${t?.PrependViaServer||``}${t?.WithNewLineViaServer===`prepend`||t?.WithNewLineViaServer===`both`?`
|
||
`:``}${e}${t?.WithNewLineViaServer===`append`||t?.WithNewLineViaServer===`both`?`
|
||
`:``}${t?.AppendViaServer||``}`}sendErrorResponse(e,t,n){e.statusCode=t,e.setHeader(`Content-Type`,`application/json`),e.setHeader(`Access-Control-Allow-Origin`,`*`),e.setHeader(`Access-Control-Allow-Methods`,`GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE`),e.setHeader(`Access-Control-Allow-Headers`,`Origin, X-Requested-With, Content-Type, Accept, Authorization, Cache-Control, Pragma`),e.end(JSON.stringify({status:`error`,message:n}))}rateLimitMap=new Map;checkRateLimit(e){let t=Date.now(),n=this.rateLimitMap.get(e);return!n||t>n.resetTime?(this.rateLimitMap.set(e,{count:1,resetTime:t+6e4}),!0):n.count>=100?!1:(n.count++,!0)}async listen(e,t){try{await this.initializeWorker(),console.log(`Thino - Starting HTTP server on port ${t}`),this.server.listen({port:parseInt(t),host:e},()=>{this.isServerRunning=!0,console.log(`Thino - Started HTTP server on port ${t}`),new f.Notice(`${M(`Thino - Started HTTP server on port`)} ${t}`)})}catch(e){throw console.error(`Failed to start server:`,e),new f.Notice(M(`Thino - Failed to start HTTP server, please check the port is available.`)),e}}close(){this.server&&this.isServerRunning&&this.server.close(()=>{this.isServerRunning=!1,console.log(`Thino - Terminated HTTP server`),new f.Notice(M(`Thino - Terminated HTTP server`))}),this.worker&&=(this.worker.terminate(),null)}isRunning(){return this.isServerRunning}};function L8(e,t){let n=new I8(e,t);return{listen(e,t){n.listen(e,t)},close(){n.close()}}}P_();var{clipboard:R8}=N_(`electron`),z8=new class{eventListeners;constructor(){this.eventListeners={}}on(e,t){this.eventListeners[e]=this.eventListeners[e]||[],this.eventListeners[e].push(t)}once(e,t){t.$emitOnce=!0,this.on(e,t)}removeListener(e,t){if(this.eventListeners[e]){let n=this.eventListeners[e].findIndex(e=>e===t);n>=0&&this.eventListeners[e].splice(n,1)}}removeAllListeners(e){this.eventListeners[e]&&(this.eventListeners[e].length=0)}emit(e,...t){this.eventListeners[e]&&this.eventListeners[e].forEach(n=>{n.call(this,...t),n.$emitOnce&&this.removeListener(e,n)})}},B8=null,V8=R8?.readText(),H8=R8?.readImage();R8&&(R8.on=(e,t)=>(z8.on(e,t),R8),R8.once=(e,t)=>(z8.once(e,t),R8),R8.off=(e,t)=>(t?z8.removeListener(e,t):z8.removeAllListeners(e),R8),R8.startWatching=()=>(B8||=setInterval(()=>{U8(V8,V8=R8?.readText())&&z8.emit(`text-changed`),W8(H8,H8=R8?.readImage())&&z8.emit(`image-changed`)},500),R8),R8.stopWatching=()=>(B8&&clearInterval(B8),B8=null,R8));function U8(e,t){return t&&e!==t}function W8(e,t){return!t.isEmpty()&&e.toDataURL()!==t.toDataURL()}N(),P_();var G8=N_(`electron`)?.remote,K8=N_(`electron`)?.remote?.screen,q8=class{isRegisted;leaf;clipboard;isScreenTop=!1;currentSplitWindow;intervalNum;allowsCopy=!1;plugin;actionEl=null;constructor(e,t){this.app=e,this.plugin=t,this.isRegisted=!1,this.leaf=null,this.clipboard=R8}async onload(){f.Platform.isDesktop&&(this.initGlobalCopyEvents(),await this.registerAllShortcuts(),this.registerEvents())}registerEvents(){this.plugin.registerEvent(this.app.workspace.on(`quit`,()=>{G8.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally)}))}initGlobalCopyEvents(){this.plugin.addCommand({id:`init-global-copy-events`,name:M(`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`,()=>{this.allowsCopy=!1,this.clipboard.stopWatching(),this.actionEl?.remove()}))}})}onunload(){this.isRegisted&&(G8.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(){return this.leaf?this.app.workspace.getLeavesOfType(`thino_view`).length>0&&this.app.workspace.getLeafById(this.leaf.id)?!0:(this.leaf?.detach(),this.currentSplitWindow.close(),this.currentSplitWindow=null,this.leaf=null,this.isScreenTop=!1,!1):!1}async registerAllShortcuts(){G8?.globalShortcut?.register(this.plugin.settings.CaptureKey.OpenThinoGlobally,()=>{this.getCurrentLeaf()?this.showThinoView():this.openThinoView()}),this.isRegisted=!0}showThinoView(){let e=K8.getCursorScreenPoint(),t=this.leaf?.parent?.parent?.win?.electronWindow;if(t){if(t.setAlwaysOnTop(!this.isScreenTop,`screen`),this.leaf.setPinned(!this.isScreenTop),this.leaf.view.containerEl.toggleClass(`thino-float-window`,!0),t.isMinimized()&&t.restore(),t.focus(),this.plugin.settings.CaptureKey.ShowNearMouse){let{width:n,height:r}=t.getBounds();t.setBounds({x:e.x,y:e.y,width:n,height:r})}if(this.app.workspace.trigger(`focus-on-textarea`),this.isScreenTop){this.isScreenTop=!1,setTimeout(()=>{t.setAlwaysOnTop(!1,`screen`)},200);return}this.isScreenTop=!0}}openThinoView(){this.leaf=this.app.workspace.openPopoutLeaf({size:{width:400,height:400}});let e=this.leaf;this.leaf.view.containerEl.toggleClass(`thino-float-window`,!0),this.leaf.setViewState({type:`thino_view`}),setTimeout(()=>{e.view.containerEl.classList.toggle(`mobile-view`,!0)},0),this.currentSplitWindow=this.leaf?.parent?.parent;let t=this.leaf?.parent?.parent?.win.electronWindow;if(!t)return;t.setAlwaysOnTop(!this.isScreenTop,`screen`),this.leaf.setPinned(!this.isScreenTop),this.isScreenTop=!0;let n=this.app,r=t=>{let r=K8.getCursorScreenPoint(),i=e?.parent?.parent?.win?.electronWindow;if(i){if(i.isMinimized()&&i.restore(),!this.isScreenTop&&this.plugin.settings.CaptureKey.ShowNearMouse){let{width:e,height:t}=i.getBounds();i.setBounds({x:r.x,y:r.y-200,width:e,height:t})}i.setAlwaysOnTop(!0,`screen`),n.workspace.trigger(`focus-on-textarea`),n.workspace.trigger(`send-to-thino`,t,e)}};this.clipboard.on(`text-changed`,()=>{let e=this.clipboard.readText();console.log(this.clipboard),r(e)}).on(`image-changed`,()=>{r(this.clipboard.readImage())})}};vi();var J8=()=>di(e=>{let{tag:t,duration:n,type:r,text:i,path:a,filter:o}=e.query;return!!(t||n&&n.from<n.to||r||i||a||o)});vi(),jg(),N();var Y8=({type:e,timestamp:t,useVirtual:n=!1,height:r=400})=>{let{memos:i}=F();si(e=>e.useVirtualScrolling);let a=J8(),o=Ag(e=>e.filteredMemos),s=Ag(e=>e.version),[c,l]=(0,U.useState)([]),u=U.useRef(null);return(0,U.useEffect)(()=>{let n=a?o:i;if(e===`daily`){let e=n;if(t){l(e.filter(e=>(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).isSame((0,f.moment)(t,`YYYY/MM/DD HH:mm:ss`),`day`)));return}l(e.filter(e=>(0,f.moment)(e.createdAt,`YYYY/MM/DD HH:mm:ss`).isSame((0,f.moment)(),`day`)))}else if(e===`latest`){let e=n.filter(e=>!e.deletedAt&&e.rowStatus!==`ARCHIVED`),t=e.filter(e=>e.pinned),r=e.filter(e=>!e.pinned);l([...t,...r])}},[i,o,s,a,e,t]),(0,U.useEffect)(()=>{u.current&&(u.current.scrollTop=0)},[c]),c.length>0?(0,W.jsx)(`div`,{ref:u,className:`thino-list-container`,children:c.map(e=>(0,W.jsx)(gT,{memo:e},e.id))}):(0,W.jsx)(`div`,{className:`tip-text-container`,children:(0,W.jsx)(`span`,{className:`tip-text`,children:M(`Here is No Memos.`)})})};N();var X8=(e,t)=>{$g.createRoot(e).render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(Z8,{plugin:t})}))},Z8=({plugin:e})=>(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`thino-error-code-block`,children:M(`Please open thino first`)}),(0,W.jsx)(`button`,{className:`thino-open-view`,onClick:()=>e.openMemos(`center`),children:M(`Open thino in center window`)})]}),Q8=(e,t)=>{$g.createRoot(e).render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)($8,{yaml:t})}))},$8=({yaml:e})=>{let t=Object.keys(e).filter(t=>e[t]),n=e.daily?e.daily:``,r=e=>{switch(e){case`editor`:return e5;case`heatmap`:return n5;case`calendar`:return r5;case`daily`:return a5;case`list`:return o5;case`status`:return i5;default:return e5}};return(0,W.jsx)(W.Fragment,{children:t.map(e=>(0,W.jsx)(`div`,{"data-embed-type":e,className:u_(`thino-embed-container`,e===`editor`?`thino-editor-modal`:``),children:e===`daily`?r(e)(n):r(e)()}))})};function e5(){return(0,W.jsx)(Aw,{editorType:`inline`,modal:!0})}function t5(e,t,n){try{let r=$g.createRoot(e);return r.render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(Aw,{editorType:`inline`,destroy:t,modal:n})})),r}catch(e){console.error(e)}}function n5(){return(0,W.jsx)($T,{basicType:`heatmap`})}function r5(){return(0,W.jsx)($T,{basicType:`basic`})}function i5(){return(0,W.jsx)(h_,{statusType:`banner`})}function a5(e){return(0,W.jsx)(Y8,{type:`daily`,timestamp:e})}function o5(){return(0,W.jsx)(Y8,{type:`latest`})}var s5=class extends f.Modal{root;constructor(e){super(e)}getViewType(){return`thino_view`}onOpen(){let{contentEl:e,modalEl:t}=this;try{this.root=t5(e,this.close.bind(this),this),t.toggleClass(`thino-editor-modal`,!0),setTimeout(()=>{e.querySelector(`textarea`)?.focus(),this.app.workspace.trigger(`focus-on-textarea`)},10)}catch(e){console.error(e)}}onClose(){this.root.unmount(),this.containerEl&&this.containerEl.empty()}};H();var c5=class extends f.EditorSuggest{root;editor;cursor;plugin;tags;type=`customTag`;HASHTAG_REGEX=/(^|\s)#[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]*$/g;constructor(e,t){super(e),this.plugin=t}checkSettings(){return this.plugin.settings.UseVaultTags}checkInMemosView(e){let t=e.containerEl;return t&&(t.parentElement?.parentElement)?.classList.contains(`common-editor-inputer`)||!1}fuzzySearchItemsOptimized(e,t){let n=(0,f.prepareFuzzySearch)(e);return t.map(e=>{let t=n(e);return t?{item:e,match:t}:null}).filter(Boolean)}onTrigger(e,t){if(!this.checkInMemosView(t)||this.checkSettings())return null;this.tags=V.getState().tags,this.cursor=e,this.editor=t;let n=e.line,r=t.getLine(n),i=r.substr(0,e.ch);if(i.match(this.HASHTAG_REGEX)&&r.substr(e.ch,1)!==`#`){let t=i.lastIndexOf(`#`),r=i.substr(t+1);return{start:{line:n,ch:t},end:{line:n,ch:e.ch},query:r}}return null}getSuggestions(e){return this.fuzzySearchItemsOptimized(e.query,this.tags).map(e=>e.item).sort((e,t)=>e.localeCompare(t))||[]}renderSuggestion(e,t){t.setText(e)}selectSuggestion(e){if(this.context){let t=this.context.editor,n=this.context.start,r=this.context.end;t.transaction({changes:[{from:n,to:r,text:`#`+e+` `}]}),setTimeout(function(){return t.focus()})}this.close()}},l5=crypto,u5=e=>e instanceof CryptoKey,d5=new TextEncoder,f5=new TextDecoder;function p5(...e){let t=e.reduce((e,{length:t})=>e+t,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}var m5=e=>{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},h5=e=>{let t=e;t instanceof Uint8Array&&(t=f5.decode(t)),t=t.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``);try{return m5(t)}catch{throw TypeError(`The input to be decoded is not correctly encoded.`)}},g5=class extends Error{constructor(e,t){super(e,t),this.code=`ERR_JOSE_GENERIC`,this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};g5.code=`ERR_JOSE_GENERIC`;var _5=class extends g5{constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.code=`ERR_JWT_CLAIM_VALIDATION_FAILED`,this.claim=n,this.reason=r,this.payload=t}};_5.code=`ERR_JWT_CLAIM_VALIDATION_FAILED`;var v5=class extends g5{constructor(e,t,n=`unspecified`,r=`unspecified`){super(e,{cause:{claim:n,reason:r,payload:t}}),this.code=`ERR_JWT_EXPIRED`,this.claim=n,this.reason=r,this.payload=t}};v5.code=`ERR_JWT_EXPIRED`;var y5=class extends g5{constructor(){super(...arguments),this.code=`ERR_JOSE_ALG_NOT_ALLOWED`}};y5.code=`ERR_JOSE_ALG_NOT_ALLOWED`;var b5=class extends g5{constructor(){super(...arguments),this.code=`ERR_JOSE_NOT_SUPPORTED`}};b5.code=`ERR_JOSE_NOT_SUPPORTED`;var x5=class extends g5{constructor(e=`decryption operation failed`,t){super(e,t),this.code=`ERR_JWE_DECRYPTION_FAILED`}};x5.code=`ERR_JWE_DECRYPTION_FAILED`;var S5=class extends g5{constructor(){super(...arguments),this.code=`ERR_JWE_INVALID`}};S5.code=`ERR_JWE_INVALID`;var C5=class extends g5{constructor(){super(...arguments),this.code=`ERR_JWS_INVALID`}};C5.code=`ERR_JWS_INVALID`;var w5=class extends g5{constructor(){super(...arguments),this.code=`ERR_JWT_INVALID`}};w5.code=`ERR_JWT_INVALID`;var T5=class extends g5{constructor(){super(...arguments),this.code=`ERR_JWK_INVALID`}};T5.code=`ERR_JWK_INVALID`;var E5=class extends g5{constructor(){super(...arguments),this.code=`ERR_JWKS_INVALID`}};E5.code=`ERR_JWKS_INVALID`;var D5=class extends g5{constructor(e=`no applicable key found in the JSON Web Key Set`,t){super(e,t),this.code=`ERR_JWKS_NO_MATCHING_KEY`}};D5.code=`ERR_JWKS_NO_MATCHING_KEY`;var O5=class extends g5{constructor(e=`multiple matching keys found in the JSON Web Key Set`,t){super(e,t),this.code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`}};O5.code=`ERR_JWKS_MULTIPLE_MATCHING_KEYS`;var k5=class extends g5{constructor(e=`request timed out`,t){super(e,t),this.code=`ERR_JWKS_TIMEOUT`}};k5.code=`ERR_JWKS_TIMEOUT`;var A5=class extends g5{constructor(e=`signature verification failed`,t){super(e,t),this.code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`}};A5.code=`ERR_JWS_SIGNATURE_VERIFICATION_FAILED`;function j5(e,t=`algorithm.name`){return TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function M5(e,t){return e.name===t}function N5(e){return parseInt(e.name.slice(4),10)}function P5(e){switch(e){case`ES256`:return`P-256`;case`ES384`:return`P-384`;case`ES512`:return`P-521`;default:throw Error(`unreachable`)}}function F5(e,t){if(t.length&&!t.some(t=>e.usages.includes(t))){let e=`CryptoKey does not support this operation, its usages must include `;if(t.length>2){let n=t.pop();e+=`one of ${t.join(`, `)}, or ${n}.`}else t.length===2?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw TypeError(e)}}function I5(e,t,...n){switch(t){case`HS256`:case`HS384`:case`HS512`:{if(!M5(e.algorithm,`HMAC`))throw j5(`HMAC`);let n=parseInt(t.slice(2),10);if(N5(e.algorithm.hash)!==n)throw j5(`SHA-${n}`,`algorithm.hash`);break}case`RS256`:case`RS384`:case`RS512`:{if(!M5(e.algorithm,`RSASSA-PKCS1-v1_5`))throw j5(`RSASSA-PKCS1-v1_5`);let n=parseInt(t.slice(2),10);if(N5(e.algorithm.hash)!==n)throw j5(`SHA-${n}`,`algorithm.hash`);break}case`PS256`:case`PS384`:case`PS512`:{if(!M5(e.algorithm,`RSA-PSS`))throw j5(`RSA-PSS`);let n=parseInt(t.slice(2),10);if(N5(e.algorithm.hash)!==n)throw j5(`SHA-${n}`,`algorithm.hash`);break}case`EdDSA`:if(e.algorithm.name!==`Ed25519`&&e.algorithm.name!==`Ed448`)throw j5(`Ed25519 or Ed448`);break;case`Ed25519`:if(!M5(e.algorithm,`Ed25519`))throw j5(`Ed25519`);break;case`ES256`:case`ES384`:case`ES512`:{if(!M5(e.algorithm,`ECDSA`))throw j5(`ECDSA`);let n=P5(t);if(e.algorithm.namedCurve!==n)throw j5(n,`algorithm.namedCurve`);break}default:throw TypeError(`CryptoKey does not support this operation`)}F5(e,n)}function L5(e,t,...n){if(n=n.filter(Boolean),n.length>2){let t=n.pop();e+=`one of type ${n.join(`, `)}, or ${t}.`}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&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var R5=(e,...t)=>L5(`Key must be `,e,...t);function z5(e,t,...n){return L5(`Key for the ${e} algorithm must be `,t,...n)}var B5=e=>u5(e)?!0:e?.[Symbol.toStringTag]===`KeyObject`,V5=[`CryptoKey`],H5=(...e)=>{let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(let e of t){let t=Object.keys(e);if(!n||n.size===0){n=new Set(t);continue}for(let e of t){if(n.has(e))return!1;n.add(e)}}return!0};function U5(e){return typeof e==`object`&&!!e}function W5(e){if(!U5(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}var G5=(e,t)=>{if(e.startsWith(`RS`)||e.startsWith(`PS`)){let{modulusLength:n}=t.algorithm;if(typeof n!=`number`||n<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};function K5(e){return W5(e)&&typeof e.kty==`string`}function q5(e){return e.kty!==`oct`&&typeof e.d==`string`}function J5(e){return e.kty!==`oct`&&e.d===void 0}function Y5(e){return K5(e)&&e.kty===`oct`&&typeof e.k==`string`}function X5(e){let t,n;switch(e.kty){case`RSA`:switch(e.alg){case`PS256`:case`PS384`:case`PS512`:t={name:`RSA-PSS`,hash:`SHA-${e.alg.slice(-3)}`},n=e.d?[`sign`]:[`verify`];break;case`RS256`:case`RS384`:case`RS512`:t={name:`RSASSA-PKCS1-v1_5`,hash:`SHA-${e.alg.slice(-3)}`},n=e.d?[`sign`]:[`verify`];break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:t={name:`RSA-OAEP`,hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},n=e.d?[`decrypt`,`unwrapKey`]:[`encrypt`,`wrapKey`];break;default:throw new b5(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;case`EC`:switch(e.alg){case`ES256`:t={name:`ECDSA`,namedCurve:`P-256`},n=e.d?[`sign`]:[`verify`];break;case`ES384`:t={name:`ECDSA`,namedCurve:`P-384`},n=e.d?[`sign`]:[`verify`];break;case`ES512`:t={name:`ECDSA`,namedCurve:`P-521`},n=e.d?[`sign`]:[`verify`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:t={name:`ECDH`,namedCurve:e.crv},n=e.d?[`deriveBits`]:[];break;default:throw new b5(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;case`OKP`:switch(e.alg){case`Ed25519`:t={name:`Ed25519`},n=e.d?[`sign`]:[`verify`];break;case`EdDSA`:t={name:e.crv},n=e.d?[`sign`]:[`verify`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:t={name:e.crv},n=e.d?[`deriveBits`]:[];break;default:throw new b5(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`)}break;default:throw new b5(`Invalid or unsupported JWK "kty" (Key Type) Parameter value`)}return{algorithm:t,keyUsages:n}}var Z5=async e=>{if(!e.alg)throw TypeError(`"alg" argument is required when "jwk.alg" is not present`);let{algorithm:t,keyUsages:n}=X5(e),r=[t,e.ext??!1,e.key_ops??n],i={...e};return delete i.alg,delete i.use,l5.subtle.importKey(`jwk`,i,...r)},Q5=e=>h5(e),$5,e7,t7=e=>e?.[Symbol.toStringTag]===`KeyObject`,n7=async(e,t,n,r,i=!1)=>{let a=e.get(t);if(a?.[r])return a[r];let o=await Z5({...n,alg:r});return i&&Object.freeze(t),a?a[r]=o:e.set(t,{[r]:o}),o},r7={normalizePublicKey:(e,t)=>{if(t7(e)){let n=e.export({format:`jwk`});return delete n.d,delete n.dp,delete n.dq,delete n.p,delete n.q,delete n.qi,n.k?Q5(n.k):(e7||=new WeakMap,n7(e7,e,n,t))}return K5(e)?e.k?h5(e.k):(e7||=new WeakMap,n7(e7,e,e,t,!0)):e},normalizePrivateKey:(e,t)=>{if(t7(e)){let n=e.export({format:`jwk`});return n.k?Q5(n.k):($5||=new WeakMap,n7($5,e,n,t))}return K5(e)?e.k?h5(e.k):($5||=new WeakMap,n7($5,e,e,t,!0)):e}},i7=(e,t,n=0)=>{n===0&&(t.unshift(t.length),t.unshift(6));let r=e.indexOf(t[0],n);if(r===-1)return!1;let i=e.subarray(r,r+t.length);return i.length===t.length?i.every((e,n)=>e===t[n])||i7(e,t,r+1):!1},a7=e=>{switch(!0){case i7(e,[42,134,72,206,61,3,1,7]):return`P-256`;case i7(e,[43,129,4,0,34]):return`P-384`;case i7(e,[43,129,4,0,35]):return`P-521`;case i7(e,[43,101,110]):return`X25519`;case i7(e,[43,101,111]):return`X448`;case i7(e,[43,101,112]):return`Ed25519`;case i7(e,[43,101,113]):return`Ed448`;default:throw new b5(`Invalid or unsupported EC Key Curve or OKP Key Sub Type`)}},o7=async(e,t,n,r,i)=>{let a,o,s=new Uint8Array(atob(n.replace(e,``)).split(``).map(e=>e.charCodeAt(0))),c=t===`spki`;switch(r){case`PS256`:case`PS384`:case`PS512`:a={name:`RSA-PSS`,hash:`SHA-${r.slice(-3)}`},o=c?[`verify`]:[`sign`];break;case`RS256`:case`RS384`:case`RS512`:a={name:`RSASSA-PKCS1-v1_5`,hash:`SHA-${r.slice(-3)}`},o=c?[`verify`]:[`sign`];break;case`RSA-OAEP`:case`RSA-OAEP-256`:case`RSA-OAEP-384`:case`RSA-OAEP-512`:a={name:`RSA-OAEP`,hash:`SHA-${parseInt(r.slice(-3),10)||1}`},o=c?[`encrypt`,`wrapKey`]:[`decrypt`,`unwrapKey`];break;case`ES256`:a={name:`ECDSA`,namedCurve:`P-256`},o=c?[`verify`]:[`sign`];break;case`ES384`:a={name:`ECDSA`,namedCurve:`P-384`},o=c?[`verify`]:[`sign`];break;case`ES512`:a={name:`ECDSA`,namedCurve:`P-521`},o=c?[`verify`]:[`sign`];break;case`ECDH-ES`:case`ECDH-ES+A128KW`:case`ECDH-ES+A192KW`:case`ECDH-ES+A256KW`:{let e=a7(s);a=e.startsWith(`P-`)?{name:`ECDH`,namedCurve:e}:{name:e},o=c?[]:[`deriveBits`];break}case`Ed25519`:a={name:`Ed25519`},o=c?[`verify`]:[`sign`];break;case`EdDSA`:a={name:a7(s)},o=c?[`verify`]:[`sign`];break;default:throw new b5(`Invalid or unsupported "alg" (Algorithm) value`)}return l5.subtle.importKey(t,s,a,i?.extractable??!1,o)},s7=(e,t,n)=>o7(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,`spki`,e,t,n);async function c7(e,t,n){if(typeof e!=`string`||e.indexOf(`-----BEGIN PUBLIC KEY-----`)!==0)throw TypeError(`"spki" must be SPKI formatted string`);return s7(e,t,n)}async function l7(e,t){if(!W5(e))throw TypeError(`JWK must be an object`);switch(t||=e.alg,e.kty){case`oct`:if(typeof e.k!=`string`||!e.k)throw TypeError(`missing "k" (Key Value) Parameter value`);return h5(e.k);case`RSA`:if(`oth`in e&&e.oth!==void 0)throw new b5(`RSA JWK "oth" (Other Primes Info) Parameter value is not supported`);case`EC`:case`OKP`:return Z5({...e,alg:t});default:throw new b5(`Unsupported "kty" (Key Type) Parameter value`)}}var u7=e=>e?.[Symbol.toStringTag],d7=(e,t,n)=>{if(t.use!==void 0&&t.use!==`sig`)throw TypeError(`Invalid key for this operation, when present its use must be sig`);if(t.key_ops!==void 0&&t.key_ops.includes?.(n)!==!0)throw TypeError(`Invalid key for this operation, when present its key_ops must include ${n}`);if(t.alg!==void 0&&t.alg!==e)throw TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},f7=(e,t,n,r)=>{if(!(t instanceof Uint8Array)){if(r&&K5(t)){if(Y5(t)&&d7(e,t,n))return;throw TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`)}if(!B5(t))throw TypeError(z5(e,t,...V5,`Uint8Array`,r?`JSON Web Key`:null));if(t.type!==`secret`)throw TypeError(`${u7(t)} instances for symmetric algorithms must be of type "secret"`)}},p7=(e,t,n,r)=>{if(r&&K5(t))switch(n){case`sign`:if(q5(t)&&d7(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a private JWK`);case`verify`:if(J5(t)&&d7(e,t,n))return;throw TypeError(`JSON Web Key for this operation be a public JWK`)}if(!B5(t))throw TypeError(z5(e,t,...V5,r?`JSON Web Key`:null));if(t.type===`secret`)throw TypeError(`${u7(t)} instances for asymmetric algorithms must not be of type "secret"`);if(n===`sign`&&t.type===`public`)throw TypeError(`${u7(t)} instances for asymmetric algorithm signing must be of type "private"`);if(n===`decrypt`&&t.type===`public`)throw TypeError(`${u7(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n===`verify`&&t.type===`private`)throw TypeError(`${u7(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n===`encrypt`&&t.type===`private`)throw TypeError(`${u7(t)} instances for asymmetric algorithm encryption must be of type "public"`)};function m7(e,t,n,r){t.startsWith(`HS`)||t===`dir`||t.startsWith(`PBES2`)||/^A\d{3}(?:GCM)?KW$/.test(t)?f7(t,n,r,e):p7(t,n,r,e)}m7.bind(void 0,!1);var h7=m7.bind(void 0,!0);function g7(e,t,n,r,i){if(i.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(e=>typeof e!=`string`||e.length===0))throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`);let a;a=n===void 0?t:new Map([...Object.entries(n),...t.entries()]);for(let t of r.crit){if(!a.has(t))throw new b5(`Extension Header Parameter "${t}" is not recognized`);if(i[t]===void 0)throw new e(`Extension Header Parameter "${t}" is missing`);if(a.get(t)&&r[t]===void 0)throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(r.crit)}var _7=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(e=>typeof e!=`string`)))throw TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};function v7(e,t){let 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`Ed25519`:return{name:`Ed25519`};case`EdDSA`:return{name:t.name};default:throw new b5(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}async function y7(e,t,n){if(n===`sign`&&(t=await r7.normalizePrivateKey(t,e)),n===`verify`&&(t=await r7.normalizePublicKey(t,e)),u5(t))return I5(t,e,n),t;if(t instanceof Uint8Array){if(!e.startsWith(`HS`))throw TypeError(R5(t,...V5));return l5.subtle.importKey(`raw`,t,{hash:`SHA-${e.slice(-3)}`,name:`HMAC`},!1,[n])}throw TypeError(R5(t,...V5,`Uint8Array`,`JSON Web Key`))}var b7=async(e,t,n,r)=>{let i=await y7(e,t,`verify`);G5(e,i);let a=v7(e,i.algorithm);try{return await l5.subtle.verify(a,i,n,r)}catch{return!1}};async function x7(e,t,n){if(!W5(e))throw new C5(`Flattened JWS must be an object`);if(e.protected===void 0&&e.header===void 0)throw new C5(`Flattened JWS must have either of the "protected" or "header" members`);if(e.protected!==void 0&&typeof e.protected!=`string`)throw new C5(`JWS Protected Header incorrect type`);if(e.payload===void 0)throw new C5(`JWS Payload missing`);if(typeof e.signature!=`string`)throw new C5(`JWS Signature missing or incorrect type`);if(e.header!==void 0&&!W5(e.header))throw new C5(`JWS Unprotected Header incorrect type`);let r={};if(e.protected)try{let t=h5(e.protected);r=JSON.parse(f5.decode(t))}catch{throw new C5(`JWS Protected Header is invalid`)}if(!H5(r,e.header))throw new C5(`JWS Protected and JWS Unprotected Header Parameter names must be disjoint`);let i={...r,...e.header},a=g7(C5,new Map([[`b64`,!0]]),n?.crit,r,i),o=!0;if(a.has(`b64`)&&(o=r.b64,typeof o!=`boolean`))throw new C5(`The "b64" (base64url-encode payload) Header Parameter must be a boolean`);let{alg:s}=i;if(typeof s!=`string`||!s)throw new C5(`JWS "alg" (Algorithm) Header Parameter missing or invalid`);let c=n&&_7(`algorithms`,n.algorithms);if(c&&!c.has(s))throw new y5(`"alg" (Algorithm) Header Parameter value not allowed`);if(o){if(typeof e.payload!=`string`)throw new C5(`JWS Payload must be a string`)}else if(typeof e.payload!=`string`&&!(e.payload instanceof Uint8Array))throw new C5(`JWS Payload must be a string or an Uint8Array instance`);let l=!1;typeof t==`function`?(t=await t(r,e),l=!0,h7(s,t,`verify`),K5(t)&&(t=await l7(t,s))):h7(s,t,`verify`);let u=p5(d5.encode(e.protected??``),d5.encode(`.`),typeof e.payload==`string`?d5.encode(e.payload):e.payload),d;try{d=h5(e.signature)}catch{throw new C5(`Failed to base64url decode the signature`)}if(!await b7(s,t,d,u))throw new A5;let f;if(o)try{f=h5(e.payload)}catch{throw new C5(`Failed to base64url decode the payload`)}else f=typeof e.payload==`string`?d5.encode(e.payload):e.payload;let p={payload:f};return e.protected!==void 0&&(p.protectedHeader=r),e.header!==void 0&&(p.unprotectedHeader=e.header),l?{...p,key:t}:p}async function S7(e,t,n){if(e instanceof Uint8Array&&(e=f5.decode(e)),typeof e!=`string`)throw new C5(`Compact JWS must be a string or Uint8Array`);let{0:r,1:i,2:a,length:o}=e.split(`.`);if(o!==3)throw new C5(`Invalid Compact JWS`);let s=await x7({payload:i,protected:r,signature:a},t,n),c={payload:s.payload,protectedHeader:s.protectedHeader};return typeof t==`function`?{...c,key:s.key}:c}var C7={webId:`globe-2`,pinned:`pin`,archived:`archive`,visibility:`eye`,deleted:`trash`},w7=class extends h.WidgetType{error=!1;constructor(e,t,n,r,i){super(),this.view=e,this.plugin=t,this.target=n,this.type=r,this.to=i}eq(e){return this.target===e.target}toDOM(){let e=createSpan();return e.toggleClass(`thino-inline-widget`,!0),(0,f.setIcon)(e,C7[this.type]||`help-circle`),f.setTooltip&&(0,f.setTooltip)(e,this.target),e}};function T7(e){class t{view;match=new h.MatchDecorator({regexp:/\[(webId|pinned|archived|visibility|deleted)::([^\]]+)\]/g,decorate:(t,n,r,i,a)=>{this.shouldRender(a,n,r)&&t(n,r,h.Decoration.replace({widget:new w7(a,e,i[0],i[1],r)}))}});decorations=h.Decoration.none;constructor(e){this.view=e,this.updateDecorations(e)}update(e){this.updateDecorations(e.view,e)}destroy(){this.decorations=h.Decoration.none}updateDecorations(e,t){!t||this.decorations.size===0?this.decorations=this.match.createDeco(e):this.decorations=this.match.updateDeco(t,this.decorations)}isLivePreview(e){return e.field(f.editorLivePreviewField)}shouldRender(e,t,n){return!e.state.selection.ranges.some(e=>e.from<=t?e.to>=t:e.from<=n)&&this.isLivePreview(e.state)}}return h.ViewPlugin.fromClass(t,{decorations:e=>e.decorations.update({filter:(t,n,r)=>{let i=r.spec.widget;return i&&i.error?!1:t===n||!e.view.state.selection.ranges.filter(e=>{let r=e.from,i=e.to;return r<=t?i>=t:r<=n}).length}})})}function E7(e){let t=new Uint8Array(e),n=``;for(let e=0;e<t.length;e++)n+=String.fromCharCode(t[e]);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}var D7=class{plugin;cachedVerified=null;refreshPromise=null;callbackServer=null;pendingCodeVerifier=null;pendingState=null;memAccessToken=null;memRefreshToken=null;memAiToken=null;constructor(e){this.plugin=e}get secrets(){return this.plugin.app.secretStorage}loadSecrets(){this.memAccessToken=this.secrets.getSecret(uG.accessToken)??null,this.memRefreshToken=this.secrets.getSecret(uG.refreshToken)??null,this.memAiToken=this.secrets.getSecret(uG.aiToken)??null}setAccessToken(e){this.memAccessToken=e,this.secrets.setSecret(uG.accessToken,e)}setRefreshToken(e){this.memRefreshToken=e,this.secrets.setSecret(uG.refreshToken,e)}setAiToken(e){this.memAiToken=e,this.secrets.setSecret(uG.aiToken,e)}clearSecrets(){this.memAccessToken=null,this.memRefreshToken=null,this.memAiToken=null,this.secrets.setSecret(uG.accessToken,``),this.secrets.setSecret(uG.refreshToken,``),this.secrets.setSecret(uG.aiToken,``)}get accessToken(){return this.memAccessToken??``}get aiToken(){return this.memAiToken??``}async migrateFromSettings(){let e=this.plugin.settings.general;if(!e)return;let t=!1,n={...e};if(e.accessToken&&(await this.setAccessToken(e.accessToken),n={...n,accessToken:void 0},t=!0),e.refreshToken&&(this.setRefreshToken(e.refreshToken),n={...n,refreshToken:void 0},t=!0),e.userInfo?.ai_token){this.setAiToken(e.userInfo.ai_token);let{ai_token:r,...i}=e.userInfo;n={...n,userInfo:i},t=!0}t&&(this.plugin.settings.general=n,await this.plugin.saveSettings(),console.log(`[PKMerAuth] Migrated tokens from settings to secretStorage`))}async verify(){let e=this.plugin.settings.general;if(!this.memAccessToken)return this.cachedVerified=!1,!1;if(e.tokenExpiresAt&&Date.now()<e.tokenExpiresAt)return this.cachedVerified=!0,!0;if(this.memRefreshToken){let e=await this.refreshTokens();return this.cachedVerified=e,e}return this.cachedVerified=!1,!1}async verifyWithResult(){return{verified:await this.verify(),userInfo:this.plugin.settings.general.userInfo??null,expiresAt:this.plugin.settings.general.tokenExpiresAt??0}}async login(){let e=this.generateRandom(),t=this.generateRandom();this.pendingCodeVerifier=t,this.pendingState=e;let n=await this.computeCodeChallenge(t);if(f.Platform.isMobile){let t=new URLSearchParams({response_type:`code`,client_id:dG.clientId,redirect_uri:dG.mobileRedirectUri,scope:dG.scopes,state:e,code_challenge:n,code_challenge_method:`S256`}),r=`${dG.authorizationUrl}?${t.toString()}`;window.open(r),setTimeout(()=>{this.pendingState===e&&(this.pendingState=null,this.pendingCodeVerifier=null)},300*1e3);return}let r=this.startCallbackServer(e),i=new URLSearchParams({response_type:`code`,client_id:dG.clientId,redirect_uri:dG.desktopRedirectUri,scope:dG.scopes,state:e,code_challenge:n,code_challenge_method:`S256`}),a=`${dG.authorizationUrl}?${i.toString()}`;window.open(a);try{let e=await r;if(!e){this.pendingCodeVerifier=null,this.pendingState=null,new f.Notice(`Login cancelled or timed out.`);return}await this.exchangeCodeForTokens(e,dG.desktopRedirectUri)?(await this.fetchUserInfo(),new f.Notice(`Successfully logged in to PKMer!`)):new f.Notice(`Failed to complete login. Please try again.`)}catch(e){console.error(`PKMer OAuth login error:`,e),new f.Notice(`Login failed. Please try again.`)}finally{this.pendingCodeVerifier=null,this.pendingState=null}}async handleOAuthCallback(e,t){if(!this.pendingState||t!==this.pendingState)return new f.Notice(`OAuth state mismatch. Please try logging in again.`),this.pendingState=null,this.pendingCodeVerifier=null,!1;try{return await this.exchangeCodeForTokens(e,dG.mobileRedirectUri)?(await this.fetchUserInfo(),new f.Notice(`Successfully logged in to PKMer!`),!0):(new f.Notice(`Failed to complete login. Please try again.`),!1)}catch(e){return console.error(`PKMer OAuth callback error:`,e),new f.Notice(`Login failed. Please try again.`),!1}finally{this.pendingState=null,this.pendingCodeVerifier=null}}async logout(){await this.clearSecrets(),this.plugin.settings.general={...this.plugin.settings.general,tokenExpiresAt:0,userInfo:null},this.cachedVerified=!1,await this.plugin.saveSettings(),new f.Notice(`Logged out from PKMer.`)}async refreshQuota(){return await this.verify()?(await this.fetchUserInfo(),this.plugin.settings.general?.userInfo?.ai_quota??null):null}async reloadVerifyID(){this.cachedVerified=null}onunload(){this.closeCallbackServer()}async computeCodeChallenge(e){let t=new TextEncoder().encode(e);return E7(await crypto.subtle.digest(`SHA-256`,t))}startCallbackServer(e){return new Promise(t=>{try{if(!f.Platform.isDesktop){t(null);return}let n=window.require(`node:http`).createServer((n,r)=>{let i=new URL(n.url,`http://localhost:${dG.callbackPort}`);if(i.pathname===`/thino/callback`){let n=i.searchParams.get(`code`);if(i.searchParams.get(`state`)!==e)r.writeHead(400,{"Content-Type":`text/html; charset=utf-8`}),r.end(`<html><body><h2>State mismatch. Please try again.</h2></body></html>`),t(null);else if(n)r.writeHead(200,{"Content-Type":`text/html; charset=utf-8`}),r.end(`<html><body><h2>Login successful!</h2><p>You can close this window and return to Obsidian.</p><script>window.close()<\/script></body></html>`),t(n);else{let e=i.searchParams.get(`error`)||`unknown error`;r.writeHead(400,{"Content-Type":`text/html; charset=utf-8`}),r.end(`<html><body><h2>Login failed: ${e}</h2></body></html>`),t(null)}setTimeout(()=>this.closeCallbackServer(),500)}else r.writeHead(404),r.end()});n.on(`error`,e=>{console.error(`Callback server error:`,e),new f.Notice(`Failed to start login server: ${e.message}`),t(null)}),n.listen(dG.callbackPort,`127.0.0.1`,()=>{console.log(`PKMer OAuth callback server listening on port ${dG.callbackPort}`)}),this.callbackServer=n,setTimeout(()=>{this.callbackServer===n&&(this.closeCallbackServer(),t(null))},300*1e3)}catch(e){console.error(`Failed to start callback server:`,e),t(null)}})}closeCallbackServer(){if(this.callbackServer){try{this.callbackServer.close()}catch{}this.callbackServer=null}}async exchangeCodeForTokens(e,t){try{let n={grant_type:`authorization_code`,code:e,redirect_uri:t,client_id:dG.clientId};this.pendingCodeVerifier&&(n.code_verifier=this.pendingCodeVerifier);let r=(await(0,f.requestUrl)({url:dG.tokenUrl,method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams(n).toString()})).json;return r.access_token?(await this.setAccessToken(r.access_token),await this.setRefreshToken(r.refresh_token||``),this.plugin.settings.general={...this.plugin.settings.general,tokenExpiresAt:Date.now()+(r.expires_in??3600)*1e3},await this.plugin.saveSettings(),this.cachedVerified=!0,!0):!1}catch(e){return console.error(`Token exchange failed:`,e),!1}}async refreshTokens(){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=(async()=>{try{let e=(await(0,f.requestUrl)({url:dG.tokenUrl,method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({grant_type:`refresh_token`,refresh_token:this.memRefreshToken||``,client_id:dG.clientId}).toString()})).json;return e.access_token?(await this.setAccessToken(e.access_token),e.refresh_token&&await this.setRefreshToken(e.refresh_token),this.plugin.settings.general={...this.plugin.settings.general,tokenExpiresAt:Date.now()+(e.expires_in??3600)*1e3},await this.plugin.saveSettings(),!0):!1}catch(e){return console.error(`Token refresh failed:`,e),await this.clearSecrets(),this.plugin.settings.general={...this.plugin.settings.general,tokenExpiresAt:0},await this.plugin.saveSettings(),!1}})();try{return await this.refreshPromise}finally{this.refreshPromise=null}}async fetchUserInfo(){try{let e=(await(0,f.requestUrl)({url:dG.userinfoUrl,method:`GET`,headers:{Authorization:`Bearer ${this.memAccessToken}`}})).json;e.ai_token&&await this.setAiToken(e.ai_token),this.plugin.settings.general={...this.plugin.settings.general,userInfo:{sub:e.sub||e.id||``,name:e.name||e.preferred_username||e.username||void 0,email:e.email||void 0,avatar:e.picture||e.avatar||void 0,ai_quota:e.ai_quota||void 0,device_count:e.device_count??void 0,thino:e.thino??void 0,thinoWebExpir:e.thinoWebExpir??void 0,supporter:e.supporter??void 0}},await this.plugin.saveSettings()}catch(e){console.error(`Failed to fetch user info:`,e)}}generateRandom(){let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}};Dg(),N(),H(),Cv(),vi(),_o(),Mv(),og(),i_();var O7=e=>e.ctrlKey!==void 0||e.metaKey!==void 0||e.shiftKey!==void 0||e.altKey!==void 0,k7=()=>{new f.Notice(M(`Open Memos Successfully`))},A7=[{id:`open-thino-in-left-sidebar`,shortName:M(`Left sidebar`),name:M(`Open thino in left sidebar`),icon:`arrow-left`,location:`left`,cb:k7,modKeys:`shift`},{id:`open-thino-in-right-sidebar`,shortName:M(`Right sidebar`),name:M(`Open thino in right sidebar`),icon:`arrow-right`,location:`right`,cb:k7,modKeys:[`ctrl`,`meta`]},{id:`open-thino-in-float`,shortName:M(`Float window`),name:M(`Open thino in float window`),icon:`layout`,location:`float`,cb:k7,modKeys:`alt`},{id:`open-thino-in-center`,shortName:M(`Center window`),name:M(`Open thino in center window`),icon:`tv-2`,location:`center`,cb:k7,modKeys:void 0}];function j7(e,t,n){return new Promise((r,i)=>{let a=``,o=``,s=n=>new Promise((r,i)=>{let s=t.ShareToThinoWithTextNewline===n||t.ShareToThinoWithTextNewline===`both`?`
|
||
`:` `;switch(t[n===`prepend`?`SharePrependType`:`ShareAppendType`]){case`none`:r();break;case`preset`:t.ShareToThinoWithText&&(n===`prepend`?a=t.ShareToThinoWithTextPrepend+s:o=s+t.ShareToThinoWithTextAppend),r();break;case`input`:new F7(e,`Thino `+M(n===`prepend`?`Prepend text`:`Append text`),e=>{n===`prepend`?a=e.trim()+(e.trim()?s:``):o=(e.trim()?s:``)+e,r()}).open();break;case`selectTags`:new QS(e,e=>{let t=e.length>0?e.map(e=>`#`+e).join(` `):``;n===`prepend`?a=t.trim()+(t.trim()?s:``):o=(t.trim()?s:``)+t.trim(),r()}).open();break;default:i(Error(`Invalid configuration type.`))}});Promise.all([s(`append`),s(`prepend`)]).then(()=>n(a,o)).then(()=>r()).catch(i)})}var M7=e=>{let t=e.embedRegistry;if(!t)return!1;let n=t.embedByExtension.md,r=n({app:e,containerEl:createDiv()},null,null);return r.editable=!0,r.set(``),r.showEditor(),Object.getPrototypeOf(Object.getPrototypeOf(r.editMode)).constructor};async function N7(e){try{let t=e.app.internalPlugins.plugins[`daily-notes`],n;n={settings:{...e.settings,tokenForVerify:`***`},plugins:Object.keys(e.app.plugins.plugins),manifest:e.manifest,platform:f.Platform.resourcePathPrefix},t&&(n={...n,dailyNotePluginInfo:{options:t.instance.options}}),await navigator.clipboard.writeText(`\`\`\`json\n${JSON.stringify(n,null,2)}\n\`\`\``),new f.Notice(M(`Debug info copied to clipboard`))}catch(e){console.error(e)}}var P7=class extends f.Plugin{settings;settingTab;thinoWorkerManager;triggerBySelf=!1;updatedID=``;debounceTimer=0;apiHttpServer=null;captureService=null;loaded=!1;MarkdownEditor;pkmerAuth;wechatService=null;async debug(e){let t=L.getState()?.verifyState,n=await Dv();if(!t||t?.appId!==n){console.error(`[thino:debug] Pro verification required.`);return}switch(e){case`wechat`:{if(this.wechatService){console.log(`[thino:debug] WeChat service already running, stopping...`),this.wechatService.onunload(),this.wechatService=null,console.log(`[thino:debug] WeChat stopped.`);return}console.log(`[thino:debug] Starting WeChat service...`);let{WeChatService:e}=await Promise.resolve().then(()=>(L3(),P3));this.wechatService=new e(this),await this.wechatService.start(),console.log(`[thino:debug] WeChat service started.`);break}default:console.log(`[thino:debug] Unknown feature: ${e}. Available: wechat`)}}async onload(){this.MarkdownEditor=M7(this.app),L.setPlugin(this),console.log(`obsidian-memos loading...`),await this.loadSettings(),FW(),this.registerRibbon(),this.pkmerAuth=new D7(this),await this.pkmerAuth.loadSecrets(),await this.pkmerAuth.migrateFromSettings(),await this.verify();try{this.settings.ShowUpdateMessage&&await this.checkVersionAndShowChangeLog()}catch(e){console.error(e)}this.settingTab=new Y3(this.app,this),this.addSettingTab(this.settingTab),this.initApp(),this.initEditor(),this.initURIHandler(),this.registerMobileEvent(),this.registerCommands(),(0,f.requireApiVersion)(`1.12.0`)&&this.registerCliHandlers(),this.registerCanvasNodeMemos(),this.registerHoverEvent(),this.registerLinkOpen(),this.registerCodeBlocks(),f.Platform.isMobile&&this.registerMobileNavbar(),this.updateLayoutSettings(),this.registerEditorContextMenu(),this.registerEditorSuggest(new NW(this.app,this)),this.registerEditorExtension([O8]),this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this)),this.registerView(gW,e=>new vW(e,this)),this.registerView(a_,e=>new s_(e,this.manifest.version)),this.registerView(IB,e=>new LB(e,this)),this.registerView(OW,e=>new jW(e,this)),jW.cleanupWorkingFile(this.app),this.addCommand({id:`open-thino-canvas-organizer`,name:`Open Thino Canvas Organizer`,callback:()=>this.openThinoCanvasOrganizer()}),this.thinoWorkerManager=new ag(this.app,this),this.addChild(this.thinoWorkerManager)}async loadSettings(){let e=await this.loadData();this.settings=JSON.parse(JSON.stringify(Object.assign({},W3,e))),L.setSettings(this.settings),this.settings.MemoListView&&R.setMemoListView(this.settings.MemoListView),this.initFSRS()}initFSRS(){let{updateFSRSInstance:e}=(uU(),d(QH)),t={request_retention:this.settings.fsrsRequestRetention??.9,maximum_interval:this.settings.fsrsMaximumInterval??36500,enable_fuzz:this.settings.fsrsEnableFuzz??!0,enable_short_term:this.settings.fsrsEnableShortTerm??!0};this.settings.fsrsWeights?.length===21&&(t.w=this.settings.fsrsWeights),e(t)}async saveSettings(){await this.saveData(this.settings),L.setSettings(this.settings)}async openThinoCanvasOrganizer(){let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Dv():t?.identifier||t?.uuid;if(!e||e?.appId!==n){Sv();return}let r=this.app.workspace.getLeavesOfType(OW);if(r.length>0){this.app.workspace.revealLeaf(r[0]);return}let i=this.app.workspace.getLeaf();await i.setViewState({type:OW,active:!0}),this.app.workspace.revealLeaf(i)}onunload(){this.app.workspace.detachLeavesOfType(gW),this.app.workspace.detachLeavesOfType(IB),this.app.workspace.detachLeavesOfType(OW),I.getState().clearFiles(),I.getState().clearView();let e=document.body.find(`.dialog-wrapper`);if(e&&e.parentElement?.detach(),this.apiHttpServer&&=(this.apiHttpServer.close(),null),this.captureService&&this.captureService.onunload(),this.pkmerAuth?.onunload(),this.wechatService?.onunload(),this.wechatService=null,f.Platform.isMobile){let e=this.app.mobileNavbar;e&&e.showThinoBtnEl&&this.settings?.NavbarButton&&(e.showThinoBtnEl.detach(),e.showThinoBtnEl=null)}new f.Notice(M(`Close Memos Successfully`))}initEditor(){this.register(mW(f.MetadataCache.prototype,{getFileCache:e=>function(t){return!t?.path&&!t?null:e.call(this,t)}})),(e=>{let t=e.app.embedRegistry.embedByExtension.md({app:e.app,containerEl:document.createElement(`div`)},null,``);t.editable=!0,t.showEditor();let n=mW(Object.getPrototypeOf(Object.getPrototypeOf(t.editMode)).constructor.prototype,{triggerClickableToken:e=>async function(...t){if(t[0].type===`internal-link`){if(this.editorEl.closest(`.memo-editor-wrapper`)){let n=V.getMemoById(t[0].text??``);if(n){Fx(n);return}return e.apply(this,t)}return e.apply(this,t)}return e.apply(this,t)}});this.register(n),t.unload()})(this)}initApp(){L.setApp(this.app)}initURIHandler(){this.registerObsidianProtocolHandler(`thino`,async e=>{if(!e)return;e.openSettings&&(this.app.setting.open(),this.app.setting.openTabById(this.manifest.id||`obsidian-memos`));let t=e.pkmer_code||e.code,n=e.pkmer_state||e.state;if(t&&n){await this.pkmerAuth.handleOAuthCallback(t,n)&&(await this.verify(),R.setRefresh(!0));return}if(e.userid)try{let t=e.userid;M8(t,this.app),N8((0,f.moment)().add(30,`days`).valueOf(),this.app),R.setRefresh(!0)}catch(e){console.error(e),new f.Notice(M(`Failed to verify`))}if(e.token)try{let t=e.token;this.app?.saveLocalStorage(`tokenForSync`,t),setTimeout(()=>{this.app.setting.open(),this.app.setting.openTabById(this.manifest.id||`obsidian-memos`),this.settingTab.display()},200),new f.Notice(M(`Saved sync token successfully`))}catch(e){console.error(e),new f.Notice(M(`Failed to save`))}if(e.copyToken){this.app.setting.open(),this.app.setting.openTabById(this.manifest.id??`obsidian-memos`);let e=await V3();await navigator.clipboard.writeText(e),new f.Notice(M(`Copied app id successfully`))}let r=L.getState()?.verifyState,i=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),a=f.Platform.isDesktop?await Dv():i?.identifier||i?.uuid;if(!(!r||r?.appId!==a)){if(e.content){let t=e.type,n=decodeURI(e.content)===e.content?e.content:decodeURI(e.content),r=e.task,i=await V.createThino({content:n,type:t,isList:!!r});if(!i)return;V.pushMemo(i),z.clearQuery()}e.openId&&await V.openThinoByID(e.openId)}})}initGlobalManifest(){R.setPluginManifest(this.manifest)}stopServer(){this.apiHttpServer&&=(this.apiHttpServer.close(),null)}async stopEnableList(){let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Dv():t?.identifier||t?.uuid;if(!e||e?.appId!==n){this.settings={...this.settings,EnabledLocationList:[{value:`DAILY`,target:`ProcessEntriesBelow`,insert:`InsertAfter`}]},this.settingTab.debounceApplySettingsUpdate();return}}async initServer(){if(f.Platform.isMobile||!this.settings.EnabledHttpApi)return;let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Dv():t?.identifier||t?.uuid;!e||e?.appId!==n||(this.apiHttpServer=L8(this,this.settings),this.initServerPort())}initServerPort(){this.apiHttpServer&&this.settings.EnabledHttpApi&&this.apiHttpServer.listen(this.settings.HttpApiIpType,this.settings.HttpApiPort)}async initCaptureService(){if(f.Platform.isMobile||!this.settings.CaptureKey.EnableCaptureKey)return;let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Dv():t?.identifier||t?.uuid;!e||e?.appId!==n||(this.captureService=new q8(this.app,this),await this.captureService.onload())}registerMobileEvent(){f.Platform.isMobile&&(this.registerEvent(this.app.workspace.on(`receive-text-menu`,(e,t)=>{e.addItem(e=>{e.setSection(`options`).setIcon(`popup-open`).setTitle(M(`Insert as Memo`)).onClick(async()=>{let e=t;try{await j7(this.app,this.settings,async(t,n)=>{e=t+e+n;let r=await V.createThino({content:e,type:this.settings.MemoSaveLocation||`DAILY`,isList:!0});V.pushMemo(r)})}catch(e){console.error(`Configuration failed:`,e);return}})})})),this.registerEvent(this.app.workspace.on(`receive-files-menu`,(e,t)=>{e.addItem(e=>{e.setIcon(`popup-open`).setTitle(M(`Insert file as memo content`)).onClick(async()=>{let e=t.map(e=>this.app.fileManager.generateMarkdownLink(e,e.path)).join(`
|
||
`);try{await j7(this.app,this.settings,async(t,n)=>{e=t+e+n;let r=await V.createThino({content:e,type:this.settings.MemoSaveLocation||`DAILY`,isList:!0});V.pushMemo(r)})}catch(e){console.error(`Configuration failed:`,e);return}})})})))}registerCliHandlers(){let e=()=>(0,f.moment)().format(`YYYY/MM/DD`),t=e=>(0,f.moment)(e,[`YYYY/MM/DD`,`YYYY-MM-DD`],!0).format(`YYYY/MM/DD`);this.registerCliHandler(`thino`,`Create or manage a single thino`,{add:{description:`Add a new thino`},content:{value:`<text>`,description:`Thino content (required for add)`},location:{value:`daily|file|multi|canvas`,description:`Save location (default: daily)`},type:{value:`task|journal`,description:`Save type — task: checkbox [ ], journal: list item - (default: task)`},name:{value:`<filename>`,description:`File name, only used with location=multi`}},async e=>{if(e.add===`true`){let t=e.content;if(!t)return`Missing required: content=<text>`;let n=(e.location??`daily`).toUpperCase(),r=(e.type??`task`)===`journal`,i=await V.createThino({content:t,isList:r,type:n,name:e.name});return`Thino added [${n.toLowerCase()}/${r?`journal`:`task`}]: ${i.id}`}return`Usage: obsidian thino:<add> [options]
|
||
Run: obsidian help thino`}),this.registerCliHandler(`thinos`,`Search and list thinos`,{date:{value:`<YYYY/MM/DD>`,description:`Filter by exact date (default: today)`},start:{value:`<YYYY/MM/DD>`,description:`Range start date (inclusive); implies all-dates mode`},end:{value:`<YYYY/MM/DD>`,description:`Range end date (inclusive); implies all-dates mode`},all:{description:`Disable date filter — show thinos from all dates`},query:{value:`<text>`,description:`Filter by content (case-insensitive substring)`},tag:{value:`<tag>`,description:`Filter by tag (#tag in content or frontmatter)`},location:{value:`daily|file|multi|canvas`,description:`Filter by save location`},type:{value:`task|journal`,description:`Filter by save type`},archived:{description:`Show archived thinos instead of normal ones`},total:{description:`Return count only`},format:{value:`text|json`,description:`Output format (default: text)`}},async n=>{let r=V.getState().memos,i=n.archived===`true`;if(r=r.filter(e=>e.rowStatus===(i?`ARCHIVED`:`NORMAL`)),n.start||n.end){let e=n.start?t(n.start):null,i=n.end?t(n.end):null;r=r.filter(t=>{let n=t.createdAt.slice(0,10);return!(e&&n<e||i&&n>i)})}else if(n.all!==`true`){let i=n.date?t(n.date):e();r=r.filter(e=>e.createdAt.slice(0,10)===i)}if(n.query){let e=n.query.toLowerCase();r=r.filter(t=>t.content.toLowerCase().includes(e))}if(n.tag){let e=n.tag.startsWith(`#`)?n.tag:`#${n.tag}`,t=n.tag.startsWith(`#`)?n.tag.slice(1):n.tag;r=r.filter(n=>n.content.includes(e)||n.fileInfo?.tags?.some(n=>n===t||n===e))}if(n.location){let e=n.location.toUpperCase();r=r.filter(t=>t.sourceType===e)}if(n.type){let e=n.type===`journal`?`JOURNAL`:`TASK-TODO`;r=r.filter(t=>t.thinoType===e)}if(n.total===`true`)return String(r.length);if(r.length===0)return`No thinos found.`;if(n.format===`json`)return JSON.stringify(r,null,2);let a=e=>e.replace(/^-\s+\[.\]\s*/,``).replace(/^-\s+/,``).trim();return r.map(e=>`${e.createdAt.slice(0,16)} ${`${e.sourceType.toLowerCase()}/${e.thinoType===`JOURNAL`?`journal`:`task`}`.padEnd(14)}${a(e.content)}`).join(`
|
||
`)}),this.registerCliHandler(`thinos:search`,`Search thinos using Super semantic search or text matching`,{query:{value:`<text>`,description:`Search query (required)`},top:{value:`<number>`,description:`Max results to return (default: 20)`},format:{value:`text|json`,description:`Output format (default: text)`}},async e=>{let t=e.query;if(!t)return`Missing required: query=<text>`;let n=e.top?parseInt(e.top,10):20,r=B.getState();if(r.enabled&&r.embeddingReady)try{let r=await av.hybridSearch(t,n);if(r.length===0)return`No results found.`;if(e.format===`json`)return JSON.stringify(r.map(e=>({score:e.score,memoId:e.entry.memoId,content:e.memo?.content??``,createdAt:e.memo?.createdAt??``})),null,2);let i=e=>e.replace(/^-\s+\[.\]\s*/,``).replace(/^-\s+/,``).trim();return r.map(e=>{let t=e.memo;return t?`${t.createdAt.slice(0,16)} [${e.score.toFixed(2)}] ${i(t.content)}`:`[score:${e.score.toFixed(2)}] (memo not found: ${e.entry.memoId})`}).join(`
|
||
`)}catch(e){console.warn(`[CLI search] Super search failed, falling back to text:`,e)}let i=t.toLowerCase(),a=V.getState().memos.filter(e=>e.rowStatus===`NORMAL`&&e.content.toLowerCase().includes(i));if(a=a.slice(0,n),a.length===0)return`No results found.`;if(e.format===`json`)return JSON.stringify(a,null,2);let o=e=>e.replace(/^-\s+\[.\]\s*/,``).replace(/^-\s+/,``).trim();return a.map(e=>`${e.createdAt.slice(0,16)} ${o(e.content)}`).join(`
|
||
`)}),f.Platform.isDesktop&&process&&process.env.mode!==`production`&&this.registerCliHandler(`thino:debug`,`Live integration tests for sync operations`,{status:{description:`Show sync status (enabled, token, last updated)`},"sync-cycle":{description:`Run full create -> edit -> delete cycle with sync verification`},multiline:{description:`Test multi-line DAILY thino create, sync, edit, and delete`},pull:{description:`Trigger pullFromWeb`},push:{description:`Trigger pushToWeb`},format:{value:`text|json`,description:`Output format (default: text)`}},async e=>{let t=e.format===`json`,n=[],r=e=>n.push(`[PASS] ${e}`),i=e=>n.push(`[FAIL] ${e}`),a=e=>n.push(`[INFO] ${e}`);if(e.status===`true`){let e=go.isSyncEnabled(),n=go.getToken(),r=go.getLastUpdatedTime();return t?JSON.stringify({enabled:e,hasToken:!!n,tokenPreview:n?n.slice(0,8)+`...`:``,lastUpdatedTime:r},null,2):[`Sync enabled : ${e}`,`Token : ${n?n.slice(0,8)+`...`:`(none)`}`,`Last updated : ${r} (${(0,f.moment)(Number(r)).format(`YYYY-MM-DD HH:mm:ss`)})`].join(`
|
||
`)}if(e.pull===`true`){if(!go.isSyncEnabled())return`Sync is disabled. Enable sync first.`;a(`Triggering pullFromWeb...`);try{await go.pullFromWeb(go.getLastUpdatedTime()),r(`pullFromWeb completed`)}catch(e){i(`pullFromWeb threw: ${e.message}`)}return n.join(`
|
||
`)}if(e.push===`true`){if(!go.isSyncEnabled())return`Sync is disabled. Enable sync first.`;a(`Triggering pushToWeb...`);try{await go.pushToWeb(),r(`pushToWeb completed`)}catch(e){i(`pushToWeb threw: ${e.message}`)}return n.join(`
|
||
`)}if(e.multiline===`true`){if(!go.isSyncEnabled())return`Sync is disabled. Enable sync first.`;let e=`debug-ml-${Date.now()}`,o=[{label:`A`,lines:[`aaa-line-1`,`aaa-line-2`,`aaa-line-3`]},{label:`B`,lines:[`bbb-line-1`,`bbb-line-2`,`bbb-line-3`,`bbb-line-4`]},{label:`C`,lines:[`ccc-line-1`,`ccc-line-2`]}],s=[];a(`[ML] ══ Phase 1: Create 3 multi-line DAILY thinoes ══`);for(let t of o){let n=`${t.label}-${e}`,o=[...t.lines,`#${n}`].join(`
|
||
`);a(`[ML:${t.label}] Creating (${t.lines.length} lines)...`);try{let e=await V.createThino({content:o,isList:!0,type:`DAILY`});if(!e?.id){i(`[ML:${t.label}] createThino returned no memo`);continue}r(`[ML:${t.label}] Created: id=${e.id}`),V.pushMemo(e);let c=V.getMemoById(e.id);c?c.content.split(`
|
||
`).length>=t.lines.length?r(`[ML:${t.label}] In store, ${c.content.split(`
|
||
`).length} lines`):i(`[ML:${t.label}] Store content line count mismatch`):i(`[ML:${t.label}] Not in store`),e.webId?r(`[ML:${t.label}] Synced: webId=${e.webId}`):a(`[ML:${t.label}] No webId yet`),s.push({label:t.label,memo:e,marker:n})}catch(e){i(`[ML:${t.label}] createThino threw: ${e.message}`)}}if(s.length===0)return i(`[ML] No memos created, aborting`),n.join(`
|
||
`);n.push(``),a(`[ML] ══ Phase 2: Verify all coexist in daily note file ══`);try{let e=L.getState().app||window.app,t=s[0].memo.path,n=e.vault.getAbstractFileByPath(t);if(!n)i(`[ML] Daily note not found: ${t}`);else{let t=await e.vault.read(n);for(let e of s){let n=t.includes(`#${e.marker}`),a=t.includes(o.find(t=>t.label===e.label).lines[0]);n&&a?r(`[ML:${e.label}] Found on disk`):i(`[ML:${e.label}] Missing on disk (marker=${n}, firstLine=${a})`)}}}catch(e){i(`[ML] Disk check threw: ${e.message}`)}n.push(``),a(`[ML] ══ Phase 3: Delete one-by-one, verify siblings ══`);let c=[...s];for(let e=0;e<s.length;e++){let e=c.shift();a(`[ML:${e.label}] Deleting (${c.length} should remain)...`);try{await V.deleteMemoById(e.memo.id),r(`[ML:${e.label}] deleteMemoById OK`)}catch(t){i(`[ML:${e.label}] deleteMemoById threw: ${t.message}`);continue}try{V.getMemoById(e.memo.id)?i(`[ML:${e.label}] Still in store`):r(`[ML:${e.label}] Removed from store`)}catch{r(`[ML:${e.label}] Removed from store`)}try{let t=L.getState().app||window.app,n=t.vault.getAbstractFileByPath(e.memo.path);if(n){let a=await t.vault.read(n);a.includes(`#${e.marker}`)?i(`[ML:${e.label}] Content still in file`):r(`[ML:${e.label}] Content removed from file`);for(let t of c)a.includes(`#${t.marker}`)?r(`[ML:${e.label}] Sibling ${t.label} survived on disk`):i(`[ML:${e.label}] Sibling ${t.label} corrupted/lost on disk`)}else c.length===0?a(`[ML:${e.label}] File removed (OK, was last memo)`):i(`[ML:${e.label}] File gone but ${c.length} memos should remain`)}catch(t){i(`[ML:${e.label}] Post-delete disk check threw: ${t.message}`)}c.length>0&&n.push(``)}let l=n.filter(e=>e.startsWith(`[PASS]`)).length,u=n.filter(e=>e.startsWith(`[FAIL]`)).length;return n.push(``),n.push(`--- ${l} passed, ${u} failed ---`),t?JSON.stringify({log:n,passes:l,fails:u},null,2):n.join(`
|
||
`)}if(e[`sync-cycle`]===`true`){if(!go.isSyncEnabled())return`Sync is disabled. Enable sync first.`;let e=`debug-${Date.now()}`,o=async t=>{let n=t.padEnd(5),o=`e2e-create-${t} #${e}`,s=`e2e-edited-${t} #${e}`;a(`[${n}] Creating thino...`);let c;try{if(c=await V.createThino({content:o,isList:!0,type:t}),!c?.id){i(`[${n}] createThino returned no memo`);return}r(`[${n}] Created: id=${c.id}`)}catch(e){i(`[${n}] createThino threw: ${e.message}`);return}try{V.pushMemo(c),V.getMemoById(c.id)?r(`[${n}] pushMemo OK, in store`):i(`[${n}] pushMemo called but not in store`)}catch(e){i(`[${n}] pushMemo threw: ${e.message}`)}t!==`DAILY`&&await new Promise(e=>setTimeout(e,1500));let l=V.getMemoById(c.id);l?.webId?r(`[${n}] Synced to server: webId=${l.webId}`):a(`[${n}] No webId (DAILY syncs before file write, so expected here)`),a(`[${n}] Editing...`);try{let e=await V.updateMemo(c.id,s);e?(V.editMemo(e),r(`[${n}] editMemo OK`)):i(`[${n}] updateMemo returned null`)}catch(e){i(`[${n}] edit threw: ${e.message}`)}a(`[${n}] Deleting...`);try{await V.deleteMemoById(c.id),r(`[${n}] deleteMemoById OK`)}catch(e){i(`[${n}] deleteMemoById threw: ${e.message}`)}try{V.getMemoById(c.id)?i(`[${n}] Still in store after delete`):r(`[${n}] Removed from store`)}catch{r(`[${n}] Removed from store`)}};await o(`FILE`),n.push(``),await o(`DAILY`),n.push(``),await o(`MULTI`),n.push(``),a(`[GUARD] Testing empty/null webId...`);try{await go.syncDelete(``),r(`[GUARD] syncDelete("") no-op`),await go.syncEdit({content:`x`}),r(`[GUARD] syncEdit(no webId) no-op`);let e=await go.syncPin(``,!0);e===null?r(`[GUARD] syncPin("") returned null`):i(`[GUARD] syncPin("") returned ${JSON.stringify(e)}`)}catch(e){i(`[GUARD] threw: ${e.message}`)}n.push(``),a(`[PIN] Testing pin/unpin...`);try{let t=await go.syncCreate(`pin-test #${e}`,`FILE`,!0);t?.id?((await go.syncPin(t.id,!0))?.pinned===!0?r(`[PIN] pin=true OK`):i(`[PIN] pin=true unexpected result`),(await go.syncPin(t.id,!1))?.pinned===!1?r(`[PIN] pin=false OK`):i(`[PIN] pin=false unexpected result`),await go.syncDelete(t.id),r(`[PIN] Cleaned up`)):i(`[PIN] syncCreate returned null`)}catch(e){i(`[PIN] threw: ${e.message}`)}let s=n.filter(e=>e.startsWith(`[PASS]`)).length,c=n.filter(e=>e.startsWith(`[FAIL]`)).length;return n.push(``),n.push(`--- ${s} passed, ${c} failed ---`),t?JSON.stringify({log:n,passes:s,fails:c},null,2):n.join(`
|
||
`)}return`Usage: obsidian thino:debug <status|sync-cycle|multiline|pull|push>
|
||
Run: obsidian help thino:debug`})}registerCommands(){A7.forEach(e=>{this.addCommand({id:e.id,name:e.name,callback:()=>this.openMemos(e.location,e.cb),hotkeys:[]})}),this.addCommand({id:`open-super-sidebar`,name:`Open Super sidebar`,callback:()=>this.openSuperSidebar()}),[`Modern`,`Clean`,`Minimal`,`Gradient`].forEach(e=>{this.addCommand({id:`share-thino-via-${e.toLowerCase()}`,name:M(`Share thino`)+` [${M(e)}]`,editorCallback:(t,n)=>{let r=t.getSelection();r.length!==0&&RS({id:`temp-${Date.now()}`,content:r,createdAt:(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),updatedAt:(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),deletedAt:``,pinned:!1,visibility:`PUBLIC`,rowStatus:`NORMAL`,thinoType:`JOURNAL`,hasId:``,linkId:[],resourceList:[],creatorName:`thino`,sourceType:`DAILY`,path:n.file.path,fileInfo:{tags:[],frontmatter:{}}},e.toLowerCase(),n)}})}),this.addCommand({id:`focus-mode`,name:`Focus mode`,callback:()=>{let e=document.body.hasClass(`thino-focus`);document.body.toggleClass(`thino-focus`,!e)}}),this.addCommand({id:`hide-side-bar`,name:M(`Toggle sidebar visibility`),callback:()=>{let e=R.getState().isMobileView,t=document.body.hasClass(`thino-hide-side-bar`);document.body.toggleClass(`thino-hide-side-bar`,e?!1:!t)}}),this.addCommand({id:`hide-tags`,name:M(`Toggle tags visibility`),callback:()=>{let e=document.body.hasClass(`thino-hide-tags`);document.body.toggleClass(`thino-hide-tags`,!e)}}),this.addCommand({id:`hide-query-list`,name:M(`Toggle query list visibility`),callback:()=>{let e=document.body.hasClass(`thino-hide-query-list`);document.body.toggleClass(`thino-hide-query-list`,!e)}}),this.addCommand({id:`insert-task`,name:M(`Insert task`),checkCallback:e=>{let t=this.app.plugins.getPlugin(`obsidian-tasks-plugin`),n=this.app.workspace.getLeavesOfType(`thino_view`).first();if(t&&n)return e||this.app.plugins.plugins[`obsidian-tasks-plugin`].apiV1.createTaskLineModal().then(e=>{let t=this.app.workspace.activeEditor;t&&t.editor?.insertText(e)}),!0}}),this.addCommand({id:`show-thino-editor`,name:M(`Show thino editor`),checkCallback:e=>{if(V.initialized&&L.initialized){if(!e){if(!L.getState().view){new f.Notice(M(`Please open thino first`));return}new s5(this.app).open()}return!0}}}),this.addCommand({id:`lock-thino`,name:M(`Lock thino`),checkCallback:e=>{if(this.app.workspace.getActiveViewOfType(vW)&&this.settings.needVerify)return e||R.setLocked(!0),!0}}),this.addCommand({id:`copy-debug-info`,name:M(`Copy debug info`),callback:async()=>{await N7(this)}}),this.addCommand({id:`insert-editor`,name:M(`Insert editor`),checkCallback:e=>{let t=this.app.workspace.getActiveViewOfType(f.MarkdownView);if(t&&t?.getViewType()===`markdown`)return e||t.editor.replaceSelection(`
|
||
\`\`\`thino
|
||
{
|
||
editor: false
|
||
}
|
||
\`\`\`
|
||
`),!0}}),this.addCommand({id:`toggle-minimal-thino`,name:M(`Toggle minimal mode`),callback:()=>{let e=document.body.hasClass(`minimal-thino`);document.body.toggleClass(`minimal-thino`,!e)}}),this.addCommand({id:`focus-on-thino-editor`,name:M(`Focus on thino editor`),callback:()=>this.focusOnEditor(),hotkeys:[]}),this.addCommand({id:`reinit-thino-sync`,name:M(`ReSync web thinos to local`),callback:()=>{go.resetLastUpdatedTime()}}),this.addCommand({id:`init-thino-sync`,name:M(`Sync local thinos to web`),callback:async()=>{if(!go.isSyncEnabled()){new f.Notice(M(go.getToken()?`Please enable sync first`:`Please input token first`));return}try{await go.pushToWeb()}catch(e){console.error(e),new f.Notice(M(`Init Failed`))}}}),this.addCommand({id:`show-daily-thino`,name:M(`Show daily thino`),callback:()=>this.openDailyMemo(),hotkeys:[]}),this.addCommand({id:`focus-on-search-bar`,name:M(`Focus on search bar`),callback:()=>this.searchIt(),hotkeys:[]}),this.addCommand({id:`show-thino-in-popover`,name:M(`Show-thino in popover(Hover editor)`),callback:()=>this.showInPopover(),hotkeys:[]})}async onLayoutReady(){await this.stopEnableList(),await this.initServer(),this.initGlobalManifest(),await this.initMemos(),this.autoOpenMemos(),this.registerThinoWidget(),await this.registerToolbarCheck(),await this.initCaptureService();let e=this.app.workspace.editorSuggest.suggests.findIndex(e=>e.type===`customTag`);e===-1||this.app.workspace.editorSuggest.suggests.splice(e,1),this.app.workspace.editorSuggest.suggests.unshift(new c5(this.app,this)),this.initSuper()}async initSuper(){let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Dv():t?.identifier||t?.uuid;!e||e?.appId!==n||B.getState().enabled&&(av.initialize(this.app,this).then(()=>{let e=B.getState();if(!(!e.wasmReady||!e.modelReady)){if(e.activeEmbeddingProvider===`local`&&f.Platform.isDesktop)return av.initializeEmbeddingAndIndex().then(()=>B.getState().setEmbeddingReady(!0));e.setEmbeddingReady(!0)}}).catch(e=>console.error(`[MemosPlugin] Super init failed:`,e)),this.register(B.subscribe(e=>e.enabled,e=>{e&&this.initSuper()})))}async initWeChat(){if(!f.Platform.isDesktop||!this.settings.wechat?.enabled)return;let e=L.getState()?.verifyState,t=await Dv();if(!e||e?.appId!==t)return;let{WeChatService:n}=await Promise.resolve().then(()=>(L3(),P3));this.wechatService=new n(this),this.settings.wechat.autoStart&&this.wechatService.start().catch(e=>{console.error(`[MemosPlugin] WeChat auto-start failed:`,e)})}async initMemos(){try{await this.initDailyNotes()}catch(e){console.error(e)}L.getState(),V.getState(),await V.fetchAllMemos()}async initDailyNotes(){this.settings.EnabledLocationList.find(e=>e.value===`DAILY`)&&await L.fechLocalDailyNotes()}registerCanvasNodeMemos(){if(!(0,f.requireApiVersion)(`1.2.0`)||!this.settings.EnabledLocationList.find(e=>e.value===`CANVAS`))return;let e=e=>{clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{setTimeout(async()=>{let n=e.canvas.getData(),r=n.nodes.find(t=>t.id===e.id);if(r&&(t(r),e.canvas.setData(n),V.getMemoById(e.id))){let t=await V.updateMemo(e.id,r.text,r.thinoType);V.editMemo(t)}e.canvas.requestSave(!0)},0)},800)},t=e=>{e.createdAt||=(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),e.updatedAt=(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),e.deletedAt=e.deletedAt?e.deletedAt:``,e.pinned=e.pinned?e.pinned:!1,e.visibility=e.visibility?e.visibility:`PUBLIC`,e.rowStatus=e.rowStatus?e.rowStatus:`NORMAL`,e.thinoType=e.thinoType?e.thinoType:`JOURNAL`,e.hasId=e.hasId?e.hasId:``,e.linkId=e.linkId?e.linkId:``,e.resourceList=[]},n=()=>{let t=this.app.workspace.getLeavesOfType(`canvas`).first()?.view;if(!t||!t?.canvas)return!1;let n=(this.app.workspace.getLeavesOfType(`canvas`).first()?.view).canvas.nodes.values(),r=Array.from(n).filter(e=>e.text!==void 0);if(!r||r.length===0)return!1;let i=r[0].child;if(!i)return!1;let a=mW(i.constructor.prototype,{save:t=>function(...n){t.call(this,...n),this.node.isEditing&&e(this.node)}});return this.register(a),console.log(`Obsidian-Memos: canvas node patched`),!0};this.app.workspace.onLayoutReady(()=>{if(!n()){let e=this.app.workspace.on(`layout-change`,()=>{n()&&this.app.workspace.offref(e)});this.registerEvent(e)}})}registerLinkOpen(){mW(f.Workspace.prototype,{openLinkText:e=>async function(...t){let n=V.getState().memos;if(n.find(e=>e.id===t[0]||e.id===t[1])){let e=n.find(e=>e.id===t[0]||e.id===t[1]);if(e){Fx(e);return}}await e.call(this,...t)}})}registerHoverEvent(){this.registerHoverLinkSource(`thino`,{defaultMod:!0,display:`Thino`})}registerCodeBlocks(){this.registerMarkdownCodeBlockProcessor(`thino`,async(e,t)=>{if(e){if(!this.app.workspace.getLeavesOfType(`thino_view`)?.length){t.toggleClass([`thino-editor-codeblock`,`view-error`],!0),X8(t,this);return}e&&Q8(t,(0,f.parseYaml)(e))}})}registerMobileNavbar(){if(!this.settings?.NavbarButton)return;let e=this.app.mobileNavbar;if(!e||e.showThinoBtnEl)return;let t=e.containerEl.find(`.mobile-navbar-actions`).createEl(`div`,{cls:`mobile-navbar-action mod-tappable`});new f.ExtraButtonComponent(t).setIcon(`Memos`).onClick(()=>{document.body.find(`.thino-editor-modal`)||new s5(this.app).open()}),e.showThinoBtnEl=t}updateLayoutSettings(){document.body.toggleClass(`thino-show-status`,!!this.settings.AlwaysShowStatusText)}registerEditorContextMenu(){this.registerEvent(this.app.workspace.on(`editor-menu`,(e,t,n)=>{let r=t.getSelection();if(r.length===0)return;let i={id:`temp-${Date.now()}`,content:r,createdAt:(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),updatedAt:(0,f.moment)().format(`YYYY-MM-DD HH:mm:ss`),deletedAt:``,pinned:!1,visibility:`PUBLIC`,rowStatus:`NORMAL`,thinoType:`JOURNAL`,hasId:``,linkId:[],resourceList:[],creatorName:`thino`,sourceType:`DAILY`,path:n.file.path,fileInfo:{tags:[],frontmatter:{}}},a=(e,t)=>{e.addItem(e=>{e.setSection(`selection`).setTitle(t+M(`Modern`)).setIcon(`palette`).onClick(async()=>{RS(i,`modern`,n)})}).addItem(e=>{e.setSection(`selection`).setTitle(t+M(`Clean`)).setIcon(`palette`).onClick(async()=>{RS(i,`clean`,n)})}).addItem(e=>{e.setSection(`selection`).setTitle(t+M(`Minimal`)).setIcon(`palette`).onClick(async()=>{RS(i,`minimal`,n)})}).addItem(e=>{e.setSection(`selection`).setTitle(M(`Gradient`)).setIcon(`palette`).onClick(async()=>{RS(i,`gradient`,n)})})};f.Platform.isDesktop&&e.addItem(e=>{a(e.setIcon(`Memos`).setSection(`selection`).setTitle(M(`Thino share`)).setSubmenu(),``)}),f.Platform.isMobile&&a(e,M(`Thino share`)+` `)}))}registerRibbon(){this.addRibbonIcon(`Memos`,M(`ribbonIconTitle`),async e=>{if(e.button===2){e.preventDefault();let t=new f.Menu;A7.forEach(e=>{t.addItem(t=>{t.setTitle(e.shortName).setIcon(e.icon).onClick(async()=>{await this.openMemos(e.location,e.cb)})})}),t.showAtMouseEvent(e);return}for(let t=0;t<A7.length;t++){let n=A7[t];if(!n.modKeys){await this.openMemos(n.location,n.cb);break}if(!O7(e))continue;let r=t=>e[`${t}Key`];if(typeof n.modKeys==`string`&&r(n.modKeys)||Array.isArray(n.modKeys)&&n.modKeys.some(r)){await this.openMemos(n.location,n.cb);break}}}),this.addRibbonIcon(`sparkles`,`Thino Super`,()=>this.openSuperSidebar())}registerThinoWidget(){this.registerEditorExtension([T7(this)])}async registerToolbarCheck(){if(this.loaded)return;let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Dv():t?.identifier||t?.uuid;!e||e?.appId!==n||(this.registerEditorExtension([w8(this.app)]),this.registerEditorSuggest(new MW(this.app,this)),this.loaded=!0)}async verify(){return r_()&&await this.verifyViaPKMerOAuth()?!0:await this.verifyViaLegacyJWT()}async verifyViaPKMerOAuth(){if(!await this.pkmerAuth.verify())return!1;let e=this.settings.general.userInfo;if(!e?.sub||!e.thino)return!1;let t=``;if(f.Platform.isDesktop)t=await Dv();else{let e=await window.Capacitor.Plugins.Device?.getId();if(!e)return!1;t=e?.identifier||e?.uuid}return L.setVerifyState({appId:t,iss:`pkmer`,type:`thino`,sub:e.sub,method:`oauth`}),!0}async verifyViaLegacyJWT(){let e=``;if(f.Platform.isDesktop)e=await Dv();else{let t=await window.Capacitor.Plugins.Device?.getId();if(!t)return;e=t?.identifier||t?.uuid}let t=this.settings.tokenForVerify[e];if(!t)return L.setVerifyState(null),!1;let n=await c7(`-----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{let{payload:r}=await S7(t,n),i=JSON.parse(new TextDecoder().decode(r));return!i||i.iss!==`pkmer`||i.type!==`thino`||i.appId!==e?!1:(L.setVerifyState(i),!0)}catch(e){console.error(e)}return!1}async checkVersionAndShowChangeLog(){let e=this.manifest.version;e!==this.settings.LastUpdatedVersion&&(this.settings={...this.settings,LastUpdatedVersion:e},await this.saveSettings(),this.showChangeLog())}async showChangeLog(){await o_(this.app)}autoOpenMemos(){this.app.workspace.getLeavesOfType(`thino_view`).length>0||this.settings.MobileAndDesktop===`Mobile`&&f.Platform.isDesktop||this.settings.MobileAndDesktop===`Desktop`&&f.Platform.isMobile||this.settings.OpenMemosAutomatically&&this.openMemos()}async openDailyMemo(){if(this.app.workspace.getLeavesOfType(`thino_view`).length>0){z.setPathname(`/daily`);return}await this.openMemos(),z.setPathname(`/daily`)}async openMemos(e=`center`,t){let n=this.app.workspace;if(n.getLeavesOfType(`thino_view`).length>0){let e=n.getLeavesOfType(gW)[0];return n.setActiveLeaf(e),n.revealLeaf(e),e}n.detachLeavesOfType(gW);let r;switch(e){case`left`:r=n.getLeftLeaf(!1);break;case`right`:r=n.getRightLeaf(!1);break;case`float`:r=n.getLeaf(`window`);break;default:r=n.getLeaf(!0);break}if(r)return await r.setViewState({type:gW}),n.revealLeaf(r),r;let i=r.view.containerEl.querySelector(`textarea`);return i?(i.focus(),r):(t?.(),r)}async openSuperSidebar(){let e=L.getState()?.verifyState,t=!f.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),n=f.Platform.isDesktop?await Dv():t?.identifier||t?.uuid;if(!e||e?.appId!==n){Sv();return}let r=this.app.workspace,i=r.getLeavesOfType(IB);if(i.length>0){r.revealLeaf(i[0]);return}let a=r.getRightLeaf(!1);await a.setViewState({type:IB,active:!0}),r.revealLeaf(a)}async searchIt(){let e=this.app.workspace,t=e.getLeavesOfType(gW);if(!(t.length>0)){let e=await this.openMemos();setTimeout(()=>{e.view.containerEl.find(`.search-bar-inputer .text-input`).focus(),this.app.workspace.trigger(`focus-on-searchbar`)},300);return}let n=t[0];e.revealLeaf(n),setTimeout(()=>{n.view.containerEl.find(`.search-bar-inputer .text-input`).focus(),this.app.workspace.trigger(`focus-on-searchbar`)},300)}async focusOnEditor(){if(!(this.app.workspace.getLeavesOfType(`thino_view`).length>0)){await this.openMemos();return}this.app.workspace.trigger(`focus-on-textarea`)}changeStatus(){let e=this.app.workspace,t=e.getLeavesOfType(gW);if(!(t.length>0)){new f.Notice(M(`Please Open Memos First`));return}let n=t[0];e.setActiveLeaf(n),n.view.containerEl.querySelector(`.list-or-task`).click()}async showInPopover(){let e=this.app.workspace;if(e.detachLeavesOfType(gW),!this.app.plugins.getPlugin(`obsidian-hover-editor`)){new f.Notice(M(`Please install obsidian-hover-editor plugin first`));return}let t=await this.app.plugins.getPlugin(`obsidian-hover-editor`)?.spawnPopover();t&&(await t.setViewState({type:gW}),e.revealLeaf(t),t.view.containerEl.classList.add(`mobile-view`),this.settings?.FocusOnEditor&&t.view.containerEl.querySelector(`textarea`)!==void 0&&t.view.containerEl.querySelector(`textarea`)?.focus())}},F7=class extends f.Modal{inputEl;callback;constructor(e,t,n){super(e),this.title=t,this.callback=n}onOpen(){let{contentEl:e}=this;this.setTitle(this.title),this.containerEl.toggleClass([`thino-input-dialog`,`thino-bulk-action-dialog`,`tag-actions`],!0),this.inputEl=e.createEl(`input`,{attr:{type:`text`}}),this.inputEl.focus(),new f.Setting(e).addButton(e=>{e.setButtonText(M(`OK`)).onClick(()=>{this.close()})})}onClose(){this.contentEl.empty(),this.callback(this.inputEl.value)}};exports.InputModal=F7,exports.default=P7,exports.getCurrentDebugInfo=N7; |