"use strict";var G3=Object.defineProperty;var q3=(e,t,n)=>t in e?G3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var he=(e,t,n)=>(q3(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const x=require("obsidian"),y0=require("@codemirror/language"),Qh=require("@codemirror/state"),Ci=require("@codemirror/view");var Jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tI={exports:{}},Nh={},nI={exports:{}},Nt={},Pb;function J3(){if(Pb)return Nt;Pb=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function w(Z){return Z===null||typeof Z!="object"?null:(Z=g&&Z[g]||Z["@@iterator"],typeof Z=="function"?Z:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,T={};function E(Z,$,X){this.props=Z,this.context=$,this.refs=T,this.updater=X||D}E.prototype.isReactComponent={},E.prototype.setState=function(Z,$){if(typeof Z!="object"&&typeof Z!="function"&&Z!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Z,$,"setState")},E.prototype.forceUpdate=function(Z){this.updater.enqueueForceUpdate(this,Z,"forceUpdate")};function A(){}A.prototype=E.prototype;function N(Z,$,X){this.props=Z,this.context=$,this.refs=T,this.updater=X||D}var R=N.prototype=new A;R.constructor=N,S(R,E.prototype),R.isPureReactComponent=!0;var F=Array.isArray,H=Object.prototype.hasOwnProperty,P={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function z(Z,$,X){var ve,De={},be=null,ke=null;if($!=null)for(ve in $.ref!==void 0&&(ke=$.ref),$.key!==void 0&&(be=""+$.key),$)H.call($,ve)&&!L.hasOwnProperty(ve)&&(De[ve]=$[ve]);var Be=arguments.length-2;if(Be===1)De.children=X;else if(1{const{children:t,store:n,context:r}=e,[a,o]=O.useState(n.getState());return O.useEffect(()=>{const s=n.subscribe(u=>{o(u)});return()=>{s()}},[]),y.jsx(r.Provider,{value:a,children:t})};function Q3(e){const t=Object.keys(e),n={};for(const r of t)typeof e[r]=="function"&&(n[r]=e[r]);return(r={},a)=>{let o=!1;const s={};for(const u of t){const d=r[u],m=n[u](d,a);s[u]=m,o=o||m!==d}return o?s:r}}function X3(e,t){const n=[];let r=e;return{dispatch:u=>{const d=t(r,u),m=r;r=d;for(const p of n)p(r,m)},getState:()=>r,subscribe:u=>{let d=!0;return n.push(u),()=>{if(!d)return;const m=n.indexOf(u);n.splice(m,1),d=!1}}}}function e4(e,t){switch(t.type){case"SET_MARK_MEMO_ID":return t.payload.markMemoId===e.markMemoId?e:{...e,markMemoId:t.payload.markMemoId};case"SET_EDIT_MEMO_ID":return t.payload.editMemoId===e.editMemoId?e:{...e,editMemoId:t.payload.editMemoId};case"SET_GLOBAL_EDITOR_SHOWN":return t.payload.globalEditorShown===e.globalEditorShown?e:{...e,globalEditorShown:t.payload.globalEditorShown};case"SET_COMMENT_MEMO_ID":return t.payload.commentMemoId===e.commentMemoId?e:{...e,commentMemoId:t.payload.commentMemoId};case"SET_MOBILE_VIEW":return t.payload.isMobileView===e.isMobileView?e:{...e,isMobileView:t.payload.isMobileView};case"SET_CHANGED_BY_MEMOS":return t.payload.changedByMemos===e.changedByMemos?e:{...e,changedByMemos:t.payload.changedByMemos};case"SET_REFRESH":return t.payload.refresh===e.refresh?e:{...e,refresh:t.payload.refresh};case"SET_INSTANCE":return{...e,instanceList:e.instanceList.set(t.payload.id,t.payload.instance)};case"SET_SHOW_SIDEBAR_IN_MOBILE_VIEW":return t.payload.showSiderbarInMobileView===e.showSiderbarInMobileView?e:{...e,showSiderbarInMobileView:t.payload.showSiderbarInMobileView};case"SET_MEMO_LIST_VIEW":return t.payload.memoListView===e.memoListView?e:{...e,memoListView:t.payload.memoListView};case"SET_MEMO_PLUGIN_MANIFEST":return{...e,manifest:t.payload.manifest};case"SET_LOADED":return{...e,loaded:t.payload.loaded};case"SET_LOCKED":return{...e,locked:t.payload.locked};case"SET_APP_SETTING":return{...e,...t.payload};default:return e}}const t4={markMemoId:"",editMemoId:"",commentMemoId:"",shouldSplitMemoWord:!0,shouldHideImageUrl:!0,shouldUseMarkdownParser:!0,useTinyUndoHistoryCache:!1,isMobileView:!1,showSiderbarInMobileView:!1,changedByMemos:!1,memoListView:null,manifest:null,refresh:!1,loaded:!1,globalEditorShown:!1,instanceList:new Map,locked:!1};function n4(e,t){switch(t.type){case"RELOAD":return rI;case"SET_LOCATION":return t.payload;case"SET_PATHNAME":return t.payload.pathname===e.pathname?e:{...e,pathname:t.payload.pathname};case"SET_HASH":return t.payload.hash===e.hash?e:{...e,hash:t.payload.hash};case"SET_QUERY":return{...e,query:{...t.payload}};case"SET_TAG_QUERY":return t.payload.tag===e.query.tag?e:{...e,query:{...e.query,tag:t.payload.tag}};case"SET_DURATION_QUERY":return t.payload.duration===e.query.duration?e:{...e,query:{...e.query,duration:{...e.query.duration,...t.payload.duration}}};case"SET_TYPE":return t.payload.type===e.query.type?e:{...e,query:{...e.query,type:t.payload.type}};case"SET_TEXT":return t.payload.text===e.query.text?e:{...e,query:{...e.query,text:t.payload.text}};case"SET_QUERY_FILTER":return t.payload===e.query.filter?e:{...e,query:{...e.query,filter:t.payload}};default:return e}}const rI={pathname:"/",hash:"",query:{tag:"",duration:null,type:"",text:"",filter:""}};var kt={};Object.defineProperty(kt,"__esModule",{value:!0});var Dn=x;const cw="YYYY-MM-DD",uw="gggg-[W]ww",aI="YYYY-MM",oI="YYYY-[Q]Q",iI="YYYY";function hm(e){var n,r;const t=window.app.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n[e])==null?void 0:r.enabled)}function mm(){var e,t,n,r;try{const{internalPlugins:a,plugins:o}=window.app;if(hm("daily")){const{format:m,folder:p,template:g}=((t=(e=o.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.daily)||{};return{format:m||cw,folder:(p==null?void 0:p.trim())||"",template:(g==null?void 0:g.trim())||""}}const{folder:s,format:u,template:d}=((r=(n=a.getPluginById("daily-notes"))==null?void 0:n.instance)==null?void 0:r.options)||{};return{format:u||cw,folder:(s==null?void 0:s.trim())||"",template:(d==null?void 0:d.trim())||""}}catch{}}function pm(){var e,t,n,r,a,o,s;try{const u=window.app.plugins,d=(e=u.getPlugin("calendar"))==null?void 0:e.options,m=(n=(t=u.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.weekly;if(hm("weekly"))return{format:m.format||uw,folder:((r=m.folder)==null?void 0:r.trim())||"",template:((a=m.template)==null?void 0:a.trim())||""};const p=d||{};return{format:p.weeklyNoteFormat||uw,folder:((o=p.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((s=p.weeklyNoteTemplate)==null?void 0:s.trim())||""}}catch{}}function gm(){var t,n,r,a;const e=window.app.plugins;try{const o=hm("monthly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.monthly)||{};return{format:o.format||aI,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function vm(){var t,n,r,a;const e=window.app.plugins;try{const o=hm("quarterly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.quarterly)||{};return{format:o.format||oI,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function ym(){var t,n,r,a;const e=window.app.plugins;try{const o=hm("yearly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.yearly)||{};return{format:o.format||iI,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function sI(...e){let t=[];for(let r=0,a=e.length;r{const N=r(),R=e.clone().set({hour:N.get("hour"),minute:N.get("minute"),second:N.get("second")});return S&&R.add(parseInt(T,10),E),A?R.format(A.substring(1).trim()):R.format(o)}).replace(/{{\s*yesterday\s*}}/gi,e.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,e.clone().add(1,"d").format(o)));return t.foldManager.save(g,d),g}catch(g){console.error(`Failed to create file: '${p}'`,g),new Dn.Notice("Unable to create new file.")}}function l4(e,t){return t[Bo(e,"day")]??null}function c4(){const{vault:e}=window.app,{folder:t}=mm(),n=e.getAbstractFileByPath(Dn.normalizePath(t));if(!n)throw new s4("Failed to find daily notes folder");const r={};return Dn.Vault.recurseChildren(n,a=>{if(a instanceof Dn.TFile){const o=Hd(a,"day");if(o){const s=Bo(o,"day");r[s]=a}}}),r}class u4 extends Error{}function d4(){const{moment:e}=window;let t=e.localeData()._week.dow;const n=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)n.push(n.shift()),t--;return n}function f4(e){return d4().indexOf(e.toLowerCase())}async function dI(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=pm(),[o,s]=await _d(n),u=e.format(r),d=await wm(a,u);try{const m=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,g,w,D,S,T)=>{const E=window.moment(),A=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return w&&A.add(parseInt(D,10),S),T?A.format(T.substring(1).trim()):A.format(r)}).replace(/{{\s*title\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(p,g,w)=>{const D=f4(g);return e.weekday(D).format(w.trim())}));return window.app.foldManager.save(m,s),m}catch(m){console.error(`Failed to create file: '${d}'`,m),new Dn.Notice("Unable to create new file.")}}function h4(e,t){return t[Bo(e,"week")]??null}function m4(){const e={};if(!hI())return e;const{vault:t}=window.app,{folder:n}=pm(),r=t.getAbstractFileByPath(Dn.normalizePath(n));if(!r)throw new u4("Failed to find weekly notes folder");return Dn.Vault.recurseChildren(r,a=>{if(a instanceof Dn.TFile){const o=Hd(a,"week");if(o){const s=Bo(o,"week");e[s]=a}}}),e}class p4 extends Error{}async function fI(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=gm(),[o,s]=await _d(n),u=e.format(r),d=await wm(a,u);try{const m=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,g,w,D,S,T)=>{const E=window.moment(),A=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return w&&A.add(parseInt(D,10),S),T?A.format(T.substring(1).trim()):A.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(m,s),m}catch(m){console.error(`Failed to create file: '${d}'`,m),new Dn.Notice("Unable to create new file.")}}function g4(e,t){return t[Bo(e,"month")]??null}function v4(){const e={};if(!mI())return e;const{vault:t}=window.app,{folder:n}=gm(),r=t.getAbstractFileByPath(Dn.normalizePath(n));if(!r)throw new p4("Failed to find monthly notes folder");return Dn.Vault.recurseChildren(r,a=>{if(a instanceof Dn.TFile){const o=Hd(a,"month");if(o){const s=Bo(o,"month");e[s]=a}}}),e}class y4 extends Error{}async function w4(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=vm(),[o,s]=await _d(n),u=e.format(r),d=await wm(a,u);try{const m=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,g,w,D,S,T)=>{const E=window.moment(),A=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return w&&A.add(parseInt(D,10),S),T?A.format(T.substring(1).trim()):A.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(m,s),m}catch(m){console.error(`Failed to create file: '${d}'`,m),new Dn.Notice("Unable to create new file.")}}function b4(e,t){return t[Bo(e,"quarter")]??null}function D4(){const e={};if(!pI())return e;const{vault:t}=window.app,{folder:n}=vm(),r=t.getAbstractFileByPath(Dn.normalizePath(n));if(!r)throw new y4("Failed to find quarterly notes folder");return Dn.Vault.recurseChildren(r,a=>{if(a instanceof Dn.TFile){const o=Hd(a,"quarter");if(o){const s=Bo(o,"quarter");e[s]=a}}}),e}class S4 extends Error{}async function I4(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=ym(),[o,s]=await _d(n),u=e.format(r),d=await wm(a,u);try{const m=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(p,g,w,D,S,T)=>{const E=window.moment(),A=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return w&&A.add(parseInt(D,10),S),T?A.format(T.substring(1).trim()):A.format(r)}).replace(/{{\s*date\s*}}/gi,u).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,u));return window.app.foldManager.save(m,s),m}catch(m){console.error(`Failed to create file: '${d}'`,m),new Dn.Notice("Unable to create new file.")}}function T4(e,t){return t[Bo(e,"year")]??null}function E4(){const e={};if(!gI())return e;const{vault:t}=window.app,{folder:n}=ym(),r=t.getAbstractFileByPath(Dn.normalizePath(n));if(!r)throw new S4("Failed to find yearly notes folder");return Dn.Vault.recurseChildren(r,a=>{if(a instanceof Dn.TFile){const o=Hd(a,"year");if(o){const s=Bo(o,"year");e[s]=a}}}),e}function x4(){var r,a;const{app:e}=window,t=e.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;const n=e.plugins.getPlugin("periodic-notes");return n&&((a=(r=n.settings)==null?void 0:r.daily)==null?void 0:a.enabled)}function hI(){var n,r;const{app:e}=window;if(e.plugins.getPlugin("calendar"))return!0;const t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.weekly)==null?void 0:r.enabled)}function mI(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.monthly)==null?void 0:r.enabled)}function pI(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.quarterly)==null?void 0:r.enabled)}function gI(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.yearly)==null?void 0:r.enabled)}function C4(e){const t={day:mm,week:pm,month:gm,quarter:vm,year:ym}[e];return t()}function M4(e,t){return{day:uI,month:fI,week:dI}[e](t)}kt.DEFAULT_DAILY_NOTE_FORMAT=cw;kt.DEFAULT_MONTHLY_NOTE_FORMAT=aI;kt.DEFAULT_QUARTERLY_NOTE_FORMAT=oI;kt.DEFAULT_WEEKLY_NOTE_FORMAT=uw;kt.DEFAULT_YEARLY_NOTE_FORMAT=iI;var vI=kt.appHasDailyNotesPluginLoaded=x4;kt.appHasMonthlyNotesPluginLoaded=mI;kt.appHasQuarterlyNotesPluginLoaded=pI;kt.appHasWeeklyNotesPluginLoaded=hI;kt.appHasYearlyNotesPluginLoaded=gI;var yI=kt.createDailyNote=uI;kt.createMonthlyNote=fI;kt.createPeriodicNote=M4;kt.createQuarterlyNote=w4;kt.createWeeklyNote=dI;kt.createYearlyNote=I4;var ws=kt.getAllDailyNotes=c4;kt.getAllMonthlyNotes=v4;kt.getAllQuarterlyNotes=D4;kt.getAllWeeklyNotes=m4;kt.getAllYearlyNotes=E4;var kv=kt.getDailyNote=l4,tv=kt.getDailyNoteSettings=mm,Zh=kt.getDateFromFile=Hd;kt.getDateFromPath=i4;kt.getDateUID=Bo;kt.getMonthlyNote=g4;kt.getMonthlyNoteSettings=gm;kt.getPeriodicNoteSettings=C4;kt.getQuarterlyNote=b4;kt.getQuarterlyNoteSettings=vm;kt.getTemplateInfo=_d;kt.getWeeklyNote=h4;kt.getWeeklyNoteSettings=pm;kt.getYearlyNote=T4;kt.getYearlyNoteSettings=ym;const N4={},k4={},A4={},O4={},wI={welcome:"Welcome to Thino",ribbonIconTitle:"Thino",to:"to",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],weekDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekDaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],year:null,month:null,"Basic Options":"Basic options","User name in Memos":"User name in Thino","Set your user name here. 'Memos 😏' By default":"Set your user name here. 'Thino 😏' By default",'You can set target heading like "# Heading" to control data location':'You can set target heading like "# Heading" to control data location',"Insert after heading":"Insert after heading","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"You should set the same heading below if you want to insert and process thino below the same heading.","Allows admonitions to be created using ":"Allows admonitions to be created using ","Process Memos below":"Process thino below","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.","Save Memo button label":"Save thino button label","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"The text shown on the save Thino button in the UI. 'NOTEIT' by default.","Focus on editor when open memos":"Focus on editor when open thino","Focus on editor when open memos. Focus by default.":"Focus on editor when open thino. Focus by default.","Open daily memos with open memos":"Open daily thino with open thino","Open daily memos with open memos. Open by default.":"Open daily thino with open thino. Open by default.","Open Memos when obsidian opens":"Open Thino when obsidian opens","When enable this, Memos will open when Obsidian opens. False by default.":"When enable this, Thino will open when Obsidian opens. False by default.","Hide done tasks in Memo list":"Hide done tasks in Thino list","Hide all done tasks in Memo list. Show done tasks by default.":"Hide all done tasks in Thino list. Show done tasks by default.","Advanced Options":"Advanced Options","UI language for date":"UI language for date","Translates the date UI language. Only 'en' and 'zh' are available.":"Translates the date UI language. Only 'en' and 'zh' are available.","Default prefix":"Default prefix","Set the default prefix when create memo, 'List' by default.":"Set the default prefix when create thino, 'List' by default.","Default insert date format":"Default insert date format","Set the default date format when insert date by @, 'Tasks' by default.":"Set the default date format when insert date by @, 'Tasks' by default.","Default editor position on mobile":"Default editor position on mobile","Set the default editor position on Mobile, 'Top' by default.":"Set the default editor position on Mobile, 'Top' by default.","Use button to show editor on mobile":"Use button to show editor on mobile","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Set a float button to call editor on mobile. Only when editor located at the bottom works.","Show Time When Copy Results":"Show Time When Copy Results","Show time when you copy results, like 12:00. Copy time by default.":"Show time when you copy results, like 12:00. Copy time by default.","Show Date When Copy Results":"Show Date When Copy Results","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"Show date when you copy results, like [[2022-01-01]]. Copy date by default.","Add Blank Line Between Different Date":"Add Blank Line Between Different Date","Add blank line when copy result with date. No blank line by default.":"Add blank line when copy result with date. No blank line by default.","Share Options":"Share Options","Share Memos Image Footer Start":"Share Thino Image Footer Start","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default","Share Memos Image Footer End":"Share Thino Image Footer End","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default","Save Shared Image To Folder For Mobile":"Save Shared Image To Folder For Mobile","Save image to folder for mobile. False by Default":"Save image to folder for mobile. False by Default","Say Thank You":"Say Thank You",Donate:"Donate","If you like this plugin, consider donating to support continued development:":"If you like this plugin, consider donating to support continued development:","File Name of Recycle Bin":"File Name of Recycle Bin","Set the filename for recycle bin. 'delete' By default":"Set the filename for recycle bin. 'delete' By default","File Name of Query File":"File Name of Query File","Set the filename for query file. 'query' By default":"Set the filename for query file. 'query' By default","Use Tags In Vault":"Use Tags In Vault","Use tags in vault rather than only in Memos. False by default.":"Use tags in vault rather than only in Thino. False by default.","Ready to convert image into background":"Ready to convert image into background",List:"List",Task:"Task",Top:"Top",Bottom:"Bottom",TAG:"TAG",DAY:"DAY",QUERY:"QUERY",EDIT:"EDIT",PIN:"PIN",UNPIN:"UNPIN",DELETE:"DELETE","CONFIRM!":"CONFIRM!","CREATE FILTER":"CREATE FILTER","Comment it...":"Comment it...",Settings:"Settings","Recycle bin":"Recycle bin","About Me":"About Me","Fetching data...":"Fetching data...","Here is No Memos.":"Here is No Thino.","Frequently Used Tags":"Frequently Used Tags","What do you think now...":"What do you think now...",READ:"READ",MARK:"MARK",SHARE:"SHARE",SOURCE:"SOURCE",RESTORE:"RESTORE",ARCHIVE:"Archive","DELETE AT":"DELETE AT","Noooop!":"Noooop!","All Data is Loaded 🎉":"All Data is Loaded 🎉","Quick filter":"Quick filter",TYPE:"TYPE",LINKED:"LINKED","NO TAGS":"NO TAGS","HAS LINKS":"HAS LINKS","HAS IMAGES":"HAS IMAGES",INCLUDE:"INCLUDE",EXCLUDE:"EXCLUDE",TEXT:"TEXT",IS:"IS",AND:"AND",OR:"OR",LIST:"LIST",ISNOT:"ISNOT",SELECT:"SELECT","ADD FILTER TERMS":"ADD FILTER TERMS",FILTER:"FILTER",Filter:"Filter",TITLE:"TITLE","CREATE QUERY":"CREATE QUERY","EDIT QUERY":"EDIT QUERY",MATCH:"MATCH",TIMES:"TIMES","Share Memo Image":"Share Thino Image","↗Click the button to save":"↗Click the button to save","Image is generating...":"Image is generating...","Image is loading...":"Image is loading...","Loading...":"Loading...","😟 Cannot load image, image link maybe broken":"😟 Cannot load image, image link maybe broken","Daily Memos":"Daily Thino","CANCEL EDIT":"CANCEL EDIT","LINK TO THE":"LINK TO THE","Mobile Options":"Mobile Options","Experimental Options":"Experimental Options","Don't support web image yet, please input image path in vault":"Don't support web image yet, please input image path in vault","Background Image in Dark Theme":"Background Image in Dark Theme","Background Image in Light Theme":"Background Image in Light Theme",'Set background image in dark theme. Set something like "Daily/one.png"':'Set background image in dark theme. Set something like "Daily/one.png"','Set background image in light theme. Set something like "Daily/one.png"':'Set background image in light theme. Set something like "Daily/one.png"','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Set default thino composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default',"Default Memo Composition":"[Deprecated] Default Thino Composition","Show Tasks Label":"Show Tasks Label","Show tasks label near the time text. False by default":"Show tasks label near the time text. False by default","Please Open Memos First":"Please Open Thino First",DATE:"DATE",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"BEFORE",AFTER:"AFTER","Allow Comments On Memos":"Allow Comments On Thino","You can comment on memos. False by default":"You can comment on thino. False by default",Import:"Import","TITLE CANNOT BE NULL!":"TITLE CANNOT BE NULL!","FILTER CANNOT BE NULL!":"FILTER CANNOT BE NULL!","Comments In Original DailyNotes/Notes":"Comments In Original DailyNotes/Notes","You should install Dataview Plugin ver 0.5.9 or later to use this feature.":"You should install Dataview Plugin ver 0.5.9 or later to use this feature.","Open Memos Successfully":"Open Thino Successfully","Fetch Memos Error":"😭 Fetch Error","Copied to clipboard Successfully":"Copied to clipboard Successfully","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin","Please finish the last filter setting first":"Please finish the last filter setting first","Close Memos Successfully":"Close Thino Successfully","Insert as Memo":"Insert as Thino","Insert file as memo content":"Insert file as thino content","Image load failed":"Image load failed","Content cannot be empty":"Content cannot be empty","Unable to create new file.":"Unable to create new file.","Failed to fetch deleted memos: ":"Failed to fetch deleted thino: ","RESTORE SUCCEED":"RESTORE SUCCEED","DELETE SUCCEED":"DELETE SUCCEED","Save Memo button icon":"Save Thino button icon","The icon shown on the save Memo button in the UI.":"The icon shown on the save Thino button in the UI.","Fetch Memos From Particular Notes":"Fetch Thino From Particular Notes",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'You can set any Dataview Query for thino to fetch it. All thino in those notes will show on list. "#memo" by default',"Allow Memos to Fetch Memo from Notes":"Allow Thino to Fetch Thino from Notes","Use Memos to manage all memos in your notes, not only in daily notes. False by default":"Use Thino to manage all thino in your notes, not only in daily notes. False by default","Always Show Memo Comments":"Always Show Thino Comments","Always show memo comments on memos. False by default":"Always show thino comments on thino. False by default","You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.","Please check your daily note plugin OR periodic notes plugin settings":"Please check your daily note plugin OR periodic notes plugin settings","Use which plugin's default configuration":"Use which plugin's default configuration","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"Thino use the plugin's default configuration to fetch thino from daily, 'Daily' by default.",Daily:"Daily","Always Show Leaf Sidebar on PC":"Always Show Leaf Sidebar on PC","Show left sidebar on PC even when the leaf width is less than 875px. False by default.":"Show left sidebar on PC even when the leaf width is less than 875px. False by default.","You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.","fetch more":"fetch more","Search all settings":"Search all settings",General:"General",Theme:"Theme",Share:"Share",Advanced:"Advanced",Thino:"Thino","Random Review":"Random Review","ARCHIVED AT":"ARCHIVED AT","Failed to get memos from daily notes":"Failed to get thino from daily notes","Failed to delete memo":"Failed to delete thino","CTRL + ENTER to save":"CTRL + ENTER to save","Started from":"Started from","Custom Background Image":"Custom Background Image","Set custom background image.":"Set custom background image.","Custom Memo Footer":"Custom Thino Footer","Set custom memo footer.":"Set custom thino footer.","Heatmap Color Scheme":"Heatmap Color Scheme","Set different color scheme for heatmap.":"Set different color scheme for heatmap.","Enable Local Http Server":"Enable Local Http Server","Memos Http Server Port":"Thino Http Server Port","Set memos http server port to listen. '43999' by default":"Set thino http server port to listen. '43999' by default","Default Editor Mode":"Default Editor Mode","Live-Preview Mode OR Source Mode.":"Live-Preview Mode/Source Mode.","Save Location for Memos":"Save Location for Thino",DAILY:"DAILY",MULTI:"MULTI",CANVAS:"CANVAS",ALL:"ALL",FILE:"FILE",TODO:"TODO",DONE:"DONE",JOURNAL:"JOURNAL",OTHER:"OTHER","Failed to create daily note, check if it exists.":"Failed to create daily note, check if it exists.","Failed to create daily note. Please check if you created a folder for daily notes.":"Failed to create daily note. Please check if you created a folder for daily notes.","After you verify your account, please refresh this page.":"After you verify your account, please refresh this page.",Verify:"Verify","Oops! You forget to verify insider account":"Oops! You forget to verify insider account","If you have any questions, please contact us.":"If you have any questions, please contact us.","Delete Thino Directly":"Delete Thino Directly","When delete thino directly, it will not be moved to trash. False by default.":"When delete thino directly, it will not be moved to trash. False by default.","Enable opening thino globally":"Enable opening thino globally","Enable opening thino globally. False by default.":"Enable opening thino globally. False by default.","Key for opening thino globally":"Key for opening thino globally","Set key for opening thino globally. CTRL + SHIFT + T by default.":"Set key for opening thino globally. CTRL + SHIFT + T by default.","Key for showing thino globally":"Key for showing thino globally","Set key for showing thino globally. CTRL + SHIFT + E by default.":"Set key for showing thino globally. CTRL + SHIFT + E by default.","Get activation code":"Get activation code","Input activation code here":"Input activation code here","Copy Thino id":"Copy Thino id","Activate Pro Version":"Activate Pro Version","Please copy Thino id first":"Please copy Thino id first",'You can set folder name with file name like "folder/file"':'You can set folder name with file name like "folder/file"','You can set folder name like "folder1/folder2/folder3" to create sub-folder':'You can set folder name like "folder1/folder2/folder3" to create sub-folder',"Default save location":"Default save location",'Set the default save location for thino. "DAILY" by default':'Set the default save location for thino. "DAILY" by default',"Sync Thino via PKMer":"Sync Thino via PKMer",Unlink:"Unlink",Link:"Link","Connect to PKMer Sync, you can check it in ":"Connect to PKMer Sync, you can check it in ","PKMer Sync":"PKMer Sync","Remove successfully":"Remove successfully",Deactivate:"Deactivate",Remove:"Remove","Confirm?":"Confirm?","Sync Status":"Sync Status","Start or stop sync":"Start or stop sync","Stop sync successfully":"Stop sync successfully","Start sync successfully":"Start sync successfully",Stop:"Stop",Start:"Start","Show thino near mouse":"Show thino near mouse","Query not found":"Query not found","Send to clipboard successfully":"Send to clipboard successfully","Thino - Failed to start HTTP server, please check the port is available.":"Thino - Failed to start HTTP server, please check the port is available.","Thino - Started HTTP server on port":"Thino - Started HTTP server on port","Thino - Terminated HTTP server":"Thino - Terminated HTTP server","File not exist":"File not exist","Thino not found":"Thino not found","File not found for the given thino path, is creating a new file":"File not found for the given thino path, is creating a new file","Saved sync token successfully":"Saved sync token successfully","Failed to find daily notes folder":"Failed to find daily notes folder","Please install obsidian-hover-editor plugin first":"Please install obsidian-hover-editor plugin first","Copied app id successfully":"Copied app id successfully","Please input token first":"Please input token first","Please enable sync first":"Please enable sync first","Init Failed":"Init Failed","Verify successfully":"Verify successfully","Failed to verify":"Failed to verify","Folder not found for the given thino path, is creating a new folder":"Folder not found for the given thino path, is creating a new folder","File not found for the given thino path":"File not found for the given thino path","Failed to read current daily note, check if it exists.":"Failed to read current daily note, check if it exists.","Failed to save":"Failed to save","Failed to login, please login again":"Failed to login, please login again","COPY FAILED":"COPY FAILED","COPY SUCCEED":"COPY SUCCEED",COPY:"COPY","This is a pro feature, please upgrade to pro version to use it.":"This is a pro feature, please upgrade to pro version to use it.","You can get pro version from: ":"You can get pro version from: ",Save:"Save",Cancel:"Cancel","Thino Daily Target":"Thino Daily Target",Input:"Input","#Tag":"#Tag","to create tag":"to create tag","You have verified your account. Congrats!":"You have verified your account. Congrats!","Pro Features":"Pro Features","Target Thino Count":"Target Thino Count",on:"on","Switch waterfall view":"Switch waterfall view","Switch view":"Switch view","Switch list view":"Switch list view","Set daily target":"Set daily target","Thino Save To: ":"Thino Save To: ","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",words:"words","Return To Home Page":"Return To Home Page","Open thino in center window":"Open thino in center window","Open thino in float window":"Open thino in float window","Open thino in right sidebar":"Open thino in right sidebar","Open thino in left sidebar":"Open thino in left sidebar","Show thino editor":"Show thino editor","Toggle minimal mode":"Toggle minimal mode","Focus on thino editor":"Focus on thino editor","ReSync web thinos to local":"ReSync web thinos to local","Sync local thinos to web":"Sync local thinos to web","Show daily thino dialog":"Show daily thino dialog","Focus on search bar":"Focus on search bar","Show-thino in popover(Hover editor)":"Show-thino in popover(Hover editor)","Center window":"Center window","Float window":"Float window","Right sidebar":"Right sidebar","Left sidebar":"Left sidebar","Save thino type when sync local":"Save thino type when sync local","Set the default save thino type when sync local, FILE by default.":"Set the default save thino type when sync local, FILE by default.","Sync service":"Sync service","Pro verification status":"Pro verification status","Live-preview":"Live-preview",Source:"Source","Global copy":"Global copy","Set the folder name":"Set the folder name","Set the filename":"Set the filename","Set the filename for current location file":"Set the filename for current location file","Switch calendar type":"Switch calendar type",alphabetical:"alphabetical",alphabeticalReverse:"alphabeticalReverse",byCount:"byCount",byCountReverse:"byCountReverse","Type here":"Type here",Today:"Today",Yesterday:"Yesterday","Last 7 days":"Last 7 days","Last 30 days":"Last 30 days","Last 90 days":"Last 90 days","Last 180 days":"Last 180 days","Last 365 days":"Last 365 days",Found:"Found","Copy filtered thinos":"Copy filtered thinos","Bulk delete":"Bulk delete","Bulk archive":"Bulk archive","Bulk tag operation":"Bulk tag operation","Bulk restore":"Bulk restore","If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.":"If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.",Preview:"Preview","Set and save":"Set and save","Show day mark on list mode":"Show day mark on list mode","Show day mark on the top of daily range thino. False by default.":"Show day mark on the top of daily range thino. False by default.","Click to expand or fold, Cmd+Click to show all thinos of the day":"Click to expand or fold, Cmd+Click to show all thinos of the day","You can buy a license from":"You can buy a license from","No thinos in range":"No thinos in range",Month:"Month",Week:"Week",Day:"Day",Agenda:"Agenda",Tomorrow:"Tomorrow",Previous:"Previous",Next:"Next","Search all columns...":"Search all columns...","Basic Info":"Basic Info","Additional Info":"Additional Info","Created At":"Created At",Content:"Content","Thino Type":"Thino Type","Source Type":"Source Type","Row status":"Row status",Path:"Path","Pinned Status":"Pinned Status",Table:"Table",Chat:"Chat",Moments:"Moments",Waterfall:"Waterfall",Calendar:"Calendar","Go to page":"Go to page",Page:"Page",Show:"Show",rows:"rows","Temp Filter":"Temp Filter","Allow navigation from view to Thino or Thino to view":"Allow navigation from view to Thino or Thino to view","Day mark range":"Day mark range","Set the range of day mark. Day by default.":"Set the range of day mark. Day by default.","Thino is locked":"Thino is locked","Please unlock Thino by input password":"Please unlock Thino by input password","Auto Download Image":"Auto Download Image","Auto download image when save to thino. 'false' by default":"Auto download image when save to thino. 'false' by default","Thino Http IP Type":"Thino Http IP Type","Set Thino http server ip to listen. 'localhost' by default":"Set Thino http server ip to listen. 'localhost' by default","Password to lock Thino":"Password to lock Thino",Unlock:"Unlock",Locked:"Locked","Password is incorrect":"Password is incorrect",Lock:"Lock","Need password to unlock Thino":"Need password to unlock Thino","You have not set a password or enable this feature yet":"You have not set a password or enable this feature yet",Password:"Password","Password for Thino":"Password for Thino","Please input your password to change password settings":"Please input your password to change password settings","Please input your password":"Please input your password","Lock thino":"Lock thino",date:"date",time:"time",event:"event","Add tag position":"Add tag position","Set the position of the tag when adding tag automatically":"Set the position of the tag when adding tag automatically","Add tag automatically":"Add tag automatically","Add tag to the end or beginning of the thino content when creating a thino and filtering tags":"Add tag to the end or beginning of the thino content when creating a thino and filtering tags","Add tag with new line":"Add tag with new line","Add tag with new line when adding tag automatically":"Add tag with new line when adding tag automatically","Input to select more tags":"Input to select more tags","Tag Bulk Edit":"Tag Bulk Edit","Exist Tags":"Exist Tags","Selected Tags":"Selected Tags","Click to remove exist tag":"Click to remove exist tag","Click to remove selected tag":"Click to remove selected tag","Select tags":"Select tags","Input to select exist tag":"Input to select exist tag",Beginning:"Beginning",End:"End","Set the heading for saving thino":"Set the heading for saving thino","# Heading":"# Heading","Chat view style":"Chat view style","Set the style of chat view":"Set the style of chat view","Background image for moments view":"Background image for moments view","Set the background image for moments view":"Set the background image for moments view","Icon for moments/chat view":"Icon for moments/chat view","Set the icon for moments/chat view":"Set the icon for moments/chat view","Quote for moments view":"Quote for moments view","Set the quote for moments view":"Set the quote for moments view","Theme for Thino":"Theme for Thino","Set the theme for Thino":"Set the theme for Thino","Theme Details":"Theme Details","Task amount":"Task amount","Thino status":"Thino status","Used tags":"Used tags","Used days":"Used days","Most active day":"Most active day","Most active hour":"Most active hour","Thino amount":"Thino amount","Latest version":"Latest version","Previous version":"Previous version","Thino update info":"Thino update info","Debug info copied to clipboard":"Debug info copied to clipboard","Copy debug info":"Copy debug info","Failed to load changelog":"Failed to load changelog","View online":"View online",ChangeLog:"ChangeLog"},F4={},P4={},j4={welcome:"Bienvenue dans Mémo !",ribbonIconTitle:"Mémos",months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],weekDays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],weekDaysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],to:"à",year:null,month:null,"Basic Options":"Options basique","User name in Memos":"Username dans Mémos","Set your user name here. 'Memos 😏' By default":"Définissez votre username ici. Défaut : 'Memo 😏'","Insert after heading":"Insérer après le titre","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Vous devez définir le même titre en-dessous si vous voulez insérer et traiter des mémos sous le même titre.","Allows admonitions to be created using ":"Permet de créer des admonitions en utilisant","Process Memos below":"Insérer Mémo sous","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Seulement les entrée sous cette section/phrase dans vos notes seront considérés. S'il n'existe pas, aucune notes ne sera traité pour ce fichier.","Save Memo button label":"Titre du bouton de sauvegarde","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"Le texte affiché sur le bouton de sauvegarde dans l'UI. Défaut : 'NOTEIT'","Focus on editor when open memos":"Focus sur l'éditeur lors de l'ouverture du mémo.","Focus on editor when open memos. Focus by default.":"Focus sur l'éditeur lors de l'ouverture du mémo. Focus par défaut.","Open daily memos with open memos":"Ouvrir les mémos quotidiens quand mémo est ouvert.","Open daily memos with open memos. Open by default.":"Ouvrir les mémos quotidiens quand mémo est ouvert.","Open Memos when obsidian opens":"Ouvrir Mémo quand Obsidian est ouvert.","When enable this, Memos will open when Obsidian opens. False by default.":"Quand activé, Memo sera ouvert quand Obsidian à l'ouverture d'Obsidian. Désactivé par défaut.","Hide done tasks in Memo list":"Masquer les tâches accomplies dans la liste des mémos.","Hide all done tasks in Memo list. Show done tasks by default.":"Masquer les tâches accomplies dans les mémos. Affiche les tâches accomplies par défaut.","Advanced Options":"Options avancées","UI language for date":"Langue de l'UI pour la date","Translates the date UI language. Only 'en' and 'zh' are available.":"Traduit la langue des dates dans l'UI. Seuls 'en', 'fr' et 'zh' sont disponibles. ","Default prefix":"Préfix par défaut.","Set the default prefix when create memo, 'List' by default.":"Définit le préfix par défaut lors de la création d'un mémo. Défault : 'Liste'","Default insert date format":"Format de la date insérée par défaut.","Default editor position on mobile":"Position par défaut de l'éditeur sur mobile.","Set the default date format when insert date by @, 'Tasks' by default.":"Définit le format de la date par défaut lors de l'insertion de la date par @. Défaut : 'Tâches'.","Set the default editor position on Mobile, 'Top' by default.":"Position par défaut de l'éditeur sur le mobile. Défaut : 'Haut'.","Use button to show editor on mobile":"Utilisation du bouton pour afficher l'éditeur sur le mobile.","Show Time When Copy Results":"Aficher l'heure quand les résultats sont copiés","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Place un bouton flottant pour appeler l'éditeur sur mobile. Fonctionne uniquement quand l'éditeur est placé en bas.","Show time when you copy results, like 12:00. Copy time by default.":"Affiche l'heure quand les résultats sont copiés, comme '12:00'. Copie l'heure par défaut","Show Date When Copy Results":"Affiche la date quand les résultats sont copiés","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"Affiche la date quand les résultats sont copiés, comme [[2022-01-01]]. Par défaut, copie la date.","Add Blank Line Between Different Date":"Ajoute une ligne entre les différentes dates.","Add blank line when copy result with date. No blank line by default.":"Ajoute une ligne lors de la copie du résultat avec la date. Pas de ligne par défaut.","Share Options":"Options de partage","Share Memos Image Footer Start":"Début du pied de page — Partage de mémo de mémos","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Définissez ce que vous voulez ici, utilisez {ThinoNum} pour afficher le nombre de thino, {UsedDay} pour les jours. Par défaut : '{ThinoNum} Thino {UsedDay} Days.","Share Memos Image Footer End":"Fin du pied de page — Partage de mémo","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Définissez ce que vous voulez ici. Utilisez {UserName} comme username. Par défaut : '✍️ By {UserName}'","Save Shared Image To Folder For Mobile":"Sauvegarde des images partagés dans un dossier sur mobile.","Save image to folder for mobile. False by Default":"Sauvegarder les images dans un dossier sur mobile. Désactivé par défaut.","Say Thank You":"Dites Merci",Donate:"Faire un don","If you like this plugin, consider donating to support continued development:":"Si vous aimez ce plugin, envisagez de faire un don pour soutenir le développement continu :","File Name of Recycle Bin":"Nom de la corbeille","Set the filename for recycle bin. 'delete' By default":"Définition du nom de la poubelle. Défaut : 'Delete'","Set the filename for query file. 'query' By default":"Définit le nom de fichier pour les requête. Défaut : 'Query'","Use Tags In Vault":"Utiliser des tags dans le Coffre","Use tags in vault rather than only in Memos. False by default.":"Utiliser des tags du coffre plutôt que ceux que seulement dans Mémo. Désactivé par défaut.","Ready to convert image into background":"Prêt pour convertir des image en arrière-plan.",List:"Liste",Task:"Tâche",Top:"Haut",Bottom:"Bas",TAG:"TAG",DAY:"JOUR",QUERY:"RECHERCHE",EDIT:"EDITER",PIN:"PIN",UNPIN:"ÉPINGLER",DELETE:"DESÉPINGLER","CONFIRM!":"CONFIRMER !","CREATE FILTER":"CRÉER FILTRE",Settings:"Paramètres","Recycle bin":"Corbeille","About Me":"À propos de moi","Fetching data...":"Récupération des données...","Here is No Memos.":"Il n'y a pas de Memos.","Frequently Used Tags":"Tags fréquemment utilisés","What do you think now...":"Que pensez-vous maintenant...",READ:"LU",MARK:"MARQUER",SHARE:"PARTAGER",SOURCE:"SOURCE",RESTORE:"RESTAURER","DELETE AT":"SUPPRIMER","Noooop!":"Noooop!","All Data is Loaded 🎉":"Toutes les données sont chargées 🎉","Quick filter":"Filtre rapide",TYPE:"TYPE",LINKED:"LIEN","NO TAGS":"PAS DE TAGS","HAS LINKS":"A DES LIENS","HAS IMAGES":"A DES IMAGES",INCLUDE:"INCLUS",EXCLUDE:"EXCLUS",TEXT:"TEXTE",IS:"EST",ISNOT:"N'EST PAS",SELECT:"SELECTION","ADD FILTER TERMS":"AJOUTER DES TERMES FILTRÉ",FILTER:"FILTRE",TITLE:"TITRE","CREATE QUERY":"CRÉER UNE RECHERCHE","EDIT QUERY":"ÉDITER UNE RECHERCHE",MATCH:"MATCH",TIMES:"HEURE","Share Memo Image":"Partager un mémo image","↗Click the button to save":"↗Clique pour sauvegarder","Image is generating...":"Génération de l'image...","Image is loading...":"Image en chargement...","Loading...":"Chargement...","😟 Cannot load image, image link maybe broken":"😟 Impossible de charger l'image, le lien peut être brisé","Daily Memos":"Mémo quotidien","CANCEL EDIT":"ANNULER L'ÉDITION","LINK TO THE":"LIENS À","Mobile Options":"Options mobile","Don't support web image yet, please input image path in vault":"Ne supporte pas les images webs. Merci d'insérer le chemin de l'image depuis le coffre.","Background Image in Dark Theme":"Image de fond en thème sombre","Background Image in Light Theme":"Image de fond en thème clair",'Set background image in dark theme. Set something like "Daily/one.png"':"Définir l'image de fond en thème sombre. Définir 'Daily/one.png' par exemple.",'Set background image in light theme. Set something like "Daily/one.png"':"Définir l'image de fond en thème clair. Définir 'Daily/one.png' par exemple.",'Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Définir la composition par défaut du mémo, vous devez utiliser {TIME} comme "HH:mm" et {CONTENT} comme contenu. "{TIME} {CONTENT}" par défaut',"Default Memo Composition":"Composition par défaut du mémo","Show Tasks Label":"Afficher les étiquettes des tâches","Show tasks label near the time text. False by default":"Afficher les étiquettes des tâches à côté du texte horaire. Désactivé par défaut.","Please Open Memos First":"Merci d'ouvrir les mémos en premier"},L4={},R4={},_4={},H4={},B4={},Y4={},z4={},U4={},V4={welcome:"Bem-vindo ao Thino!",ribbonIconTitle:"Thino",months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan.","Fev.","Mar.","Abr.","Maio","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."],weekDays:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],weekDaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],to:"para",year:null,month:null,"Basic Options":"Opções Básicas","User name in Memos":"Nome de Usuário no Thino","Set your user name here. 'Memos 😏' By default":"Defina o nome de usuário. Padrão: 'Thino 😏'.","Insert after heading":"Inserir após o cabeçalho","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Deve definir o mesmo cabeçalho na configuração posterior se pretende inserir e processar memorandos abaixo do cabeçalho aqui definido.","Allows admonitions to be created using ":"Permitir que Admonitions sejam criadas usando ","Process Memos below":"Processar Memorandos abaixo do Cabeçalho","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Somente as entradas abaixo deste cabeçalho serão processadas nas suas notas. Se não configurar esta funcionalidade, nenhuma nota será processada para o ficheiro respetivo.","Save Memo button label":"Legenda do Botão de Guardar Memorandos","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":'Define o texto apresentado na UI do botão guardar memorandos. Padrão: "NOTEIT".',"Focus on editor when open memos":"Focar no Editor ao iniciar o Thino","Focus on Editor when open memos. Focus by default.":'Focar no editor ao iniciar o Thino. Padrão: "Focar".',"Open daily memos with open memos":"Abrir memorandos diários ao iniciar o Thino","Open daily memos with open memos. Open by default.":'Abrir memorandos diários ao iniciar o Thino. Padrão: "Abrir".',"Open Memos when obsidian opens":"Abrir Thino quando o Obsidian inicia","When enable this, Memos will open when Obsidian opens. False by default.":'Quando esta opção está activa, o Memos abrirá quando o Obsidian inicia. Padrão: "Falso".',"Hide done tasks in Memo list":"Ocultar tarefas concluídas na lista de memorandos","Hide all done tasks in Memo list. Show done tasks by default.":'Ocultar todas as tarefas concluídas na lista de memorandos. Padrão: "Mostrar tarefas concluídas".',"Advanced Options":"Opções Avançadas","UI language for date":"Idioma na UI da Data ","Translates the date UI language. Only 'en' and 'zh' are available.":"Define o idioma na UI da Data. De momento, apenas 'en', 'fr', 'pt' e 'zh' estão disponíveis.","Default prefix":"Prefixo Padrão","Set the default prefix when create memo, 'List' by default.":"Define o prefixo padrão quando um memorando é criado. Padrão: 'Lista'.","Default insert date format":"Formato Padrão para Inserção de Data","Set the default date format when insert date by @, 'Tasks' by default.":"Define o formato de Data padrão ao inserir a data usando '@'. Padrão: 'Tarefas'.","Default editor position on mobile":"Posição Padrão do Editor de Memorandos na Versão Móvel","Set the default editor position on Mobile, 'Top' by default.":"Define a posição padrão do editor de memorandos na versão móvel. Padrão: 'Topo'.","Use button to show editor on mobile":"Usar Botão para Mostrar o Editor na Versão Móvel","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Define um botão flutuante para abrir o editor na versão móvel. Opção disponível somente quando a posição do editor está definida para 'Fundo'.","Show Time When Copy Results":"Mostrar a Hora ao Copiar os Resultados","Show time when you copy results, like 12:00. Copy time by default.":"Mostrar a Hora, no formato '12:00', ao copiar os resultados. Padrão: 'Copiar a hora'.","Show Date When Copy Results":"Mostrar a Data ao Copiar os Resultados","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":'Mostrar a Data, no formato [[2022-01-01]], ao copiar os resultados. Padrão: "Copiar a hora".',"Add Blank Line Between Different Date":"Adicionar Linha em Branco entre Datas Diferentes.","Add blank line when copy result with date. No blank line by default.":'Adicionar linha em branco ao copiar resultados com Data. Padrão: "Não adicionar linha."',"Share Options":"Opções de Partilha","Share Memos Image Footer Start":"Partilhar a Imagem de um memorando - Início do Rodapé","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Defina como preferir, use {ThinoNum} para mostrar o número de thinorandos e use {UsedDay} para dias. 'Padrão: {ThinoNum} Thinorandos {UsedDay} Dias'.","Share Memos Image Footer End":"Partilhar a Imagem de um memorando - Fim do Rodapé","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Defina como preferir, use {UserName} como o seu nome de usuário. Padrão: '✍️ Por {UserName}'.","Save Shared Image To Folder For Mobile":"Guardar a Imagem Partilhada para Pasta na Versão Móvel","Save image to folder for mobile. False by Default":'Guardar a imagem partilhada para pasta na versão móvel. Padrão: "Falso".',"Say Thank You":"Agradeça",Donate:"Doar","If you like this plugin, consider donating to support continued development:":"Se gosta deste plugin, considere doar para apoiar o seu desenvolvimento contínuo:","File Name of Recycle Bin":"Nome da Reciclagem","Set the filename for recycle bin. 'delete' By default":"Define o nome do ficheiro para a Reciclagem. Padrão: 'delete'.","File Name of Query File":"Nome do Ficheiro de Query","Set the filename for query file. 'query' By default":"Define o nome do ficheiro de Query. Padrão: 'Query'.","Use Tags In Vault":"Usar Tags no Vault","Use tags in vault rather than only in Memos. False by default.":'Usar as Tags do Vault e não somente dos memorandos. Padrão: "Falso".',"Ready to convert image into background":"Pronto para converter imagem em fundo",List:"Lista",Task:"Tarefa",Top:"Topo",Bottom:"Fundo",TAG:"TAG",DAY:"DIA",QUERY:"QUERY",EDIT:"EDITAR",PIN:"FIXAR",UNPIN:"DESAFIXAR",DELETE:"ELIMINAR","CONFIRM!":"CONFIRMAR!","CREATE FILTER":"CRIAR FILTRO",Settings:"Definições","Recycle bin":"Reciclagem","About Me":"Acerca de mim","Fetching data...":"A obter dados...","Here is No Memos.":"Não existem Thino.","Frequently Used Tags":"Tags Usadas Frequentemente","What do you think now...":"Em que está a pensar...",READ:"LER",MARK:"ASSINALAR",SHARE:"PARTILHAR",SOURCE:"ORIGEM",RESTORE:"RESTAURAR","DELETE AT":"ELIMINADO EM","Noooop!":"Noooop!","All Data is Loaded 🎉":"Todos os Dados foram Carregados 🎉","Quick filter":"Filtro rápido",TYPE:"TIPO",LINKED:"LINKED","NO TAGS":"SEM TAGS","HAS LINKS":"TEM LINKS","HAS IMAGES":"TEM IMAGENS",INCLUDE:"INCLUIR",EXCLUDE:"EXCLUIR",TEXT:"TEXTO",IS:"É",ISNOT:"NÃO É",SELECT:"SELECCIONAR","ADD FILTER TERMS":"ADICIONAR TERMOS DE FILTRAGEM",FILTER:"FILTRAR",TITLE:"TÍTULO","CREATE QUERY":"CRIAR QUERY","EDIT QUERY":"EDITAR QUERY",MATCH:"IGUALA",TIMES:"VEZES","Share Memo Image":"Partilhar Imagem de Memo","↗Click the button to save":"↗Clique no botão para guardar","Image is generating...":"A gerar Imagem..","Image is loading...":"A carregar Imagem...","Loading...":"Carregando...","😟 Cannot load image, image link maybe broken":"😟 Não é possível carregar a imagem, o link da imagem pode estar incorrecto","Daily Memos":"Thino Diários","CANCEL EDIT":"CANCELAR EDIÇÃO","LINK TO THE":"LINK PARA O","Mobile Options":"Opções Móveis","Don't support web image yet, please input image path in vault":"Ainda não existe suporte para imagens de web. Por favor, insira o link para uma imagem do vault","Experimental Options":"Opções Experimentais","Background Image in Dark Theme":"Imagem de Fundo no Tema Escuro","Background Image in Light Theme":"Imagem de Fundo no Tema Claro",'Set background image in dark theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema escuro. Defina da seguinte forma: "Daily/one.png".','Set background image in light theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema claro. Defina da seguinte forma: "Daily/one.png".','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Defina a composição padrão do memorando, deve usar {TIME} como "HH:mm" e {CONTENT} como conteúdo. Padrão: "{TIME} {CONTENT}".',"Default Memo Composition":"Composição Padrão de um Memorando","Show Tasks Label":"Mostrar Etiquetas de Tarefas","Show tasks label near the time text. False by default":'Mostrar etiquetas de tarefas próximas do texto de tempo. Padrão: "Falso".',"Please Open Memos First":"Por favor, abra o Thino primeiro",DATE:"DATA",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"ANTES",AFTER:"DEPOIS","Allow Comments On Memos":"Permitir Comentários nos Memorandos","You can comment on memos. False by default":'Permite que comente os memorandos. Padrão: "Falso".',Import:"Importar","TITLE CANNOT BE NULL!":"O TÍTULO NÃO PODE SER NULO!","FILTER CANNOT BE NULL!":"O FILTRO NÃO PODE SER NULO!","Comments In Original DailyNotes/Notes":"Comentários nas Notas/Notas Diárias Originais","You should install Dataview Plug-in ver 0.5.9 or later to use this feature.":"Deve instalar a versão 0.5.9 ou posterior do plugin Dataview para usar esta funcionalidade.","Open Memos Successfully":"Thino Iniciado com Sucesso","Fetch Memos Error":"😭 Erro de Fetch","Copied to clipboard Successfully":"Copiado para a área de transferência com sucesso","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Verifique se abriu o plugin de Notas Diárias ou de Notas Periódicas","Please finish the last filter setting first":"Por favor, termine primeiro a configuração do último filtro","Close Memos Successfully":"Thino Fechado com Sucesso","Insert as Memo":"Inserir como um Memorando","Insert file as memo content":"Inserir ficheiro como conteúdo de um memorando","Image load failed":"Falha no carregamento da imagem","Content cannot be empty":"O Conteúdo não pode estar vazio","Unable to create new file.":"Não foi possível criar um novo ficheiro.","Failed to fetch deleted memos: ":"Falha no fetch dos memorandos removidos: ","RESTORE SUCCEED":"RESTAURO BEM SUCEDIDO","Save Memo button icon":"Ícone do Botão para Guardar Memorandos","The icon shown on the save Memo button in the UI.":"O ícone exibido na UI do botão para guardar memorandos.","Fetch Memos From Particular Notes":"Obter Memorandos de Notas Específicas",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'Pode definir qualquer Query de Dataview para o Memos procurar. Todos os memorandos nessas notas serão mostrados na lista. Padrão: "#memo".',"Allow Memos to Fetch Memo from Notes":"Permitir que o Thino Obtenha memorandos das Notas","Use Memos to manage all memos in your notes, not only in daily notes. False by default":'Use o Memos para gerir todos os memorandos nas suas notas e não apenas nas notas diárias. Padrão: "Falso".',"Always Show Memo Comments":"Mostrar Comentários dos Memorandos","Always show memo comments on memos. False by default":'Mostrar sempre os comentários dos memorandos. Padrão: "Falso".',"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"Não definiu a pasta para as notas diárias, quer no plugin the Notas Periódicas ou de Notas Diárias.","Please check your daily note plugin OR periodic notes plugin settings":"Por favor, verifique as configurações dos plugins de Notas Diárias OU de Notas Periódicas","Use Which Plugin's Default Configuration":"Usar a Configuração Padrão do Plugin","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"O Memos usa a configuração padrão do plugin seleccionado para obter memorandos diariamente. Padrão: 'Notas Diárias'.",Daily:"Diário"},Z4={welcome:"Bem-vindo ao Memos!",ribbonIconTitle:"Thino",months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan.","Fev.","Mar.","Abr.","Maio","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."],weekDays:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],weekDaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],to:"para",year:null,month:null,"Basic Options":"Opções Básicas","User name in Memos":"Nome de Usuário no Thino","Set your user name here. 'Memos 😏' By default":"Defina o nome de usuário. Padrão: 'Thino 😏'.","Insert after heading":"Inserir após o cabeçalho","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Deve definir o mesmo cabeçalho na configuração posterior se pretende inserir e processar memorandos abaixo do cabeçalho aqui definido.","Allows admonitions to be created using ":"Permitir que Admonitions sejam criadas usando ","Process Memos below":"Processar Memorandos abaixo do Cabeçalho","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Somente as entradas abaixo deste cabeçalho serão processadas nas suas notas. Se não configurar esta funcionalidade, nenhuma nota será processada para o ficheiro respetivo.","Save Memo button label":"Legenda do Botão de Guardar Memorandos","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":'Define o texto apresentado na UI do botão guardar memorandos. Padrão: "NOTEIT".',"Focus on editor when open memos":"Focar no Editor ao iniciar o Thino","Focus on Editor when open memos. Focus by default.":'Focar no editor ao iniciar o Thino. Padrão: "Focar".',"Open daily memos with open memos":"Abrir memorandos diários ao iniciar o Thino","Open daily memos with open memos. Open by default.":'Abrir memorandos diários ao iniciar o Thino. Padrão: "Abrir".',"Open Memos when obsidian opens":"Abrir Thino quando o Obsidian inicia","When enable this, Memos will open when Obsidian opens. False by default.":'Quando esta opção está activa, o Memos abrirá quando o Obsidian inicia. Padrão: "Falso".',"Hide done tasks in Memo list":"Ocultar tarefas concluídas na lista de memorandos","Hide all done tasks in Memo list. Show done tasks by default.":'Ocultar todas as tarefas concluídas na lista de memorandos. Padrão: "Mostrar tarefas concluídas".',"Advanced Options":"Opções Avançadas","UI language for date":"Idioma na UI da Data ","Translates the date UI language. Only 'en' and 'zh' are available.":"Define o idioma na UI da Data. De momento, apenas 'en', 'fr', 'pt' e 'zh' estão disponíveis.","Default prefix":"Prefixo Padrão","Set the default prefix when create memo, 'List' by default.":"Define o prefixo padrão quando um memorando é criado. Padrão: 'Lista'.","Default insert date format":"Formato Padrão para Inserção de Data","Set the default date format when insert date by @, 'Tasks' by default.":"Define o formato de Data padrão ao inserir a data usando '@'. Padrão: 'Tarefas'.","Default editor position on mobile":"Posição Padrão do Editor de Memorandos na Versão Móvel","Set the default editor position on Mobile, 'Top' by default.":"Define a posição padrão do editor de memorandos na versão móvel. Padrão: 'Topo'.","Use button to show editor on mobile":"Usar Botão para Mostrar o Editor na Versão Móvel","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Define um botão flutuante para abrir o editor na versão móvel. Opção disponível somente quando a posição do editor está definida para 'Fundo'.","Show Time When Copy Results":"Mostrar a Hora ao Copiar os Resultados","Show time when you copy results, like 12:00. Copy time by default.":"Mostrar a Hora, no formato '12:00', ao copiar os resultados. Padrão: 'Copiar a hora'.","Show Date When Copy Results":"Mostrar a Data ao Copiar os Resultados","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":'Mostrar a Data, no formato [[2022-01-01]], ao copiar os resultados. Padrão: "Copiar a hora".',"Add Blank Line Between Different Date":"Adicionar Linha em Branco entre Datas Diferentes.","Add blank line when copy result with date. No blank line by default.":'Adicionar linha em branco ao copiar resultados com Data. Padrão: "Não adicionar linha."',"Share Options":"Opções de Partilha","Share Memos Image Footer Start":"Partilhar a Imagem de um memorando - Início do Rodapé","Set anything you want here, use {ThinoNum} to display Number of memos, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Defina como preferir, use {ThinoNum} para mostrar o número de thinorandos e use {UsedDay} para dias. 'Padrão: {ThinoNum} Thinorandos {UsedDay} Dias'.","Share Memos Image Footer End":"Partilhar a Imagem de um memorando - Fim do Rodapé","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Defina como preferir, use {UserName} como o seu nome de usuário. Padrão: '✍️ Por {UserName}'.","Save Shared Image To Folder For Mobile":"Guardar a Imagem Partilhada para Pasta na Versão Móvel","Save image to folder for mobile. False by Default":'Guardar a imagem partilhada para pasta na versão móvel. Padrão: "Falso".',"Say Thank You":"Agradeça",Donate:"Doar","If you like this plugin, consider donating to support continued development:":"Se gosta deste plugin, considere doar para apoiar o seu desenvolvimento contínuo:","File Name of Recycle Bin":"Nome da Reciclagem","Set the filename for recycle bin. 'delete' By default":"Define o nome do ficheiro para a Reciclagem. Padrão: 'delete'.","File Name of Query File":"Nome do Ficheiro de Query","Set the filename for query file. 'query' By default":"Define o nome do ficheiro de Query. Padrão: 'Query'.","Use Tags In Vault":"Usar Tags no Vault","Use tags in vault rather than only in Memos. False by default.":'Usar as Tags do Vault e não somente dos memorandos. Padrão: "Falso".',"Ready to convert image into background":"Pronto para converter imagem em fundo",List:"Lista",Task:"Tarefa",Top:"Topo",Bottom:"Fundo",TAG:"TAG",DAY:"DIA",QUERY:"QUERY",EDIT:"EDITAR",PIN:"FIXAR",UNPIN:"DESAFIXAR",DELETE:"ELIMINAR","CONFIRM!":"CONFIRMAR!","CREATE FILTER":"CRIAR FILTRO",Settings:"Definições","Recycle bin":"Reciclagem","About Me":"Acerca de mim","Fetching data...":"A obter dados...","Here is No Memos.":"Não existem Thino.","Frequently Used Tags":"Tags Usadas Frequentemente","What do you think now...":"Em que está a pensar...",READ:"LER",MARK:"ASSINALAR",SHARE:"PARTILHAR",SOURCE:"ORIGEM",RESTORE:"RESTAURAR","DELETE AT":"ELIMINADO EM","Noooop!":"Noooop!","All Data is Loaded 🎉":"Todos os Dados foram Carregados 🎉","Quick filter":"Filtro rápido",TYPE:"TIPO",LINKED:"LINKED","NO TAGS":"SEM TAGS","HAS LINKS":"TEM LINKS","HAS IMAGES":"TEM IMAGENS",INCLUDE:"INCLUIR",EXCLUDE:"EXCLUIR",TEXT:"TEXTO",IS:"É",ISNOT:"NÃO É",SELECT:"SELECCIONAR","ADD FILTER TERMS":"ADICIONAR TERMOS DE FILTRAGEM",FILTER:"FILTRAR",TITLE:"TÍTULO","CREATE QUERY":"CRIAR QUERY","EDIT QUERY":"EDITAR QUERY",MATCH:"IGUALA",TIMES:"VEZES","Share Memo Image":"Partilhar Imagem de Memo","↗Click the button to save":"↗Clique no botão para guardar","Image is generating...":"A gerar Imagem..","Image is loading...":"A carregar Imagem...","Loading...":"Carregando...","😟 Cannot load image, image link maybe broken":"😟 Não é possível carregar a imagem, o link da imagem pode estar incorrecto","Daily Memos":"Thino Diários","CANCEL EDIT":"CANCELAR EDIÇÃO","LINK TO THE":"LINK PARA O","Mobile Options":"Opções Móveis","Don't support web image yet, please input image path in vault":"Ainda não existe suporte para imagens de web. Por favor, insira o link para uma imagem do vault","Experimental Options":"Opções Experimentais","Background Image in Dark Theme":"Imagem de Fundo no Tema Escuro","Background Image in Light Theme":"Imagem de Fundo no Tema Claro",'Set background image in dark theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema escuro. Defina da seguinte forma: "Daily/one.png".','Set background image in light theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema claro. Defina da seguinte forma: "Daily/one.png".','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Defina a composição padrão do memorando, deve usar {TIME} como "HH:mm" e {CONTENT} como conteúdo. Padrão: "{TIME} {CONTENT}".',"Default Memo Composition":"Composição Padrão de um Memorando","Show Tasks Label":"Mostrar Etiquetas de Tarefas","Show tasks label near the time text. False by default":'Mostrar etiquetas de tarefas próximas do texto de tempo. Padrão: "Falso".',"Please Open Memos First":"Por favor, abra o Thino primeiro",DATE:"DATA",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"ANTES",AFTER:"DEPOIS","Allow Comments On Memos":"Permitir Comentários nos Memorandos","You can comment on memos. False by default":'Permite que comente os memorandos. Padrão: "Falso".',Import:"Importar","TITLE CANNOT BE NULL!":"O TÍTULO NÃO PODE SER NULO!","FILTER CANNOT BE NULL!":"O FILTRO NÃO PODE SER NULO!","Comments In Original DailyNotes/Notes":"Comentários nas Notas/Notas Diárias Originais","You should install Dataview Plug-in ver 0.5.9 or later to use this feature.":"Deve instalar a versão 0.5.9 ou posterior do plugin Dataview para usar esta funcionalidade.","Open Memos Successfully":"Thino Iniciado com Sucesso","Fetch Memos Error":"😭 Erro de Fetch","Copied to clipboard Successfully":"Copiado para a área de transferência com sucesso","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Verifique se abriu o plugin de Notas Diárias ou de Notas Periódicas","Please finish the last filter setting first":"Por favor, termine primeiro a configuração do último filtro","Close Memos Successfully":"Thino Fechado com Sucesso","Insert as Memo":"Inserir como um Memorando","Insert file as memo content":"Inserir ficheiro como conteúdo de um memorando","Image load failed":"Falha no carregamento da imagem","Content cannot be empty":"O Conteúdo não pode estar vazio","Unable to create new file.":"Não foi possível criar um novo ficheiro.","Failed to fetch deleted memos: ":"Falha no fetch dos memorandos removidos: ","RESTORE SUCCEED":"RESTAURO BEM SUCEDIDO","Save Memo button icon":"Ícone do Botão para Guardar Memorandos","The icon shown on the save Memo button in the UI.":"O ícone exibido na UI do botão para guardar memorandos.","Fetch Memos From Particular Notes":"Obter Memorandos de Notas Específicas",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'Pode definir qualquer Query de Dataview para o Memos procurar. Todos os memorandos nessas notas serão mostrados na lista. Padrão: "#memo".',"Allow Memos to Fetch Memo from Notes":"Permitir que o Thino Obtenha memorandos das Notas","Use Memos to manage all memos in your notes, not only in daily notes. False by default":'Use o Memos para gerir todos os memorandos nas suas notas e não apenas nas notas diárias. Padrão: "Falso".',"Always Show Memo Comments":"Mostrar Comentários dos Memorandos","Always show memo comments on memos. False by default":'Mostrar sempre os comentários dos memorandos. Padrão: "Falso".',"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"Não definiu a pasta para as notas diárias, quer no plugin the Notas Periódicas ou de Notas Diárias.","Please check your daily note plugin OR periodic notes plugin settings":"Por favor, verifique as configurações dos plugins de Notas Diárias OU de Notas Periódicas","Use Which Plugin's Default Configuration":"Usar a Configuração Padrão do Plugin","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"O Memos usa a configuração padrão do plugin seleccionado para obter memorandos diariamente. Padrão: 'Notas Diárias'.",Daily:"Diário"},W4={},$4={},G4={},q4={welcome:"欢迎使用 Thino ",ribbonIconTitle:"Thino",months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:[null,null,null,null,null,null,null,null,null,null,null,null],weekDays:["周日","周一","周二","周三","周四","周五","周六"],weekDaysShort:["周日","周一","周二","周三","周四","周五","周六"],to:"至",year:"年",month:"月","Basic Options":"基础选项","User name in Memos":"在 Thino 中显示的用户名","Set your user name here. 'Memos 😏' By default":"在这里设置你喜欢的用户名。 默认为 'Thino 😏'",'You can set target heading like "# Heading" to control data location':'You can set target heading like "# Heading" to control data location',"Insert after heading":"在指定标题后插入 Thino","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"若留空,则记录的 thino 内容在日记末尾插入,若填写标题,则记录的 thino 内容统一都记录在该标题下","Process Memos below":"解析指定标题后的 Thino","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"若留空,则在Thino界面会显示所有thino记录内容,若填写标题,则Thino界面只显示该标题下的内容,写入其他位置的内容不显示","Save Memo button label":"保存按钮上的文本","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"在保存按钮上展示的文本。默认为 'NOTEIT'","Focus on editor when open memos":"自动聚焦到 Thino 输入框","Focus on editor when open memos. Focus by default.":"当打开 Thino 的时候自动聚焦到 Thino 输入框。默认开启","Open daily memos with open memos":"打开每日 Thino 的时候打开 Thino 界面","Open daily memos with open memos. Open by default.":"打开每日 Thino 的时候打开 Thino 界面。默认开启","Open Memos when obsidian opens":"当开启 Obsidian 的时候自动打开 Thino","When enable this, Memos will open when Obsidian opens. False by default.":"当开启该选项, Thino 会在 Obsidian 打开时自动打开。默认不开启。","Hide done tasks in Memo list":"在 Thino 列表中隐藏已完成 Thino","Hide all done tasks in Memo list. Show done tasks by default.":"在 Thino 列表中隐藏已完成 Thino。默认不开启","Advanced Options":"进阶选项","UI language for date":"针对日期展示的语言界面","Translates the date UI language. Only 'en' and 'zh' are available.":"对日期的不同翻译。目前只能选择 'en' 和 'zh'(未来会废置)","Default prefix":"默认前缀","Set the default prefix when create memo, 'List' by default.":"设置默认的前缀样式。默认为列表","Default insert date format":"插入日期附带的样式","Set the default date format when insert date by @, 'Tasks' by default.":"当使用 @ 来快速插入日期时,插入日期附带的样式,默认为 'Tasks' 样式","Default editor position on mobile":"在移动端上的默认编辑器位置","Set the default editor position on Mobile, 'Top' by default.":"设置在移动端上的默认编辑器位置,默认在顶部。","Use button to show editor on mobile":"当编辑器位置在底部时,用按钮来唤出编辑器","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"设置一个浮动按钮来唤出编辑器。当在移动端上启用该选项才会生效","Show Time When Copy Results":"当复制检索结果时附带时间","Show time when you copy results, like 12:00. Copy time by default.":"在复制检索结果时附带其时间,例如 12:00 。默认开启","Show Date When Copy Results":"当复制检索结果时附带日期","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"在复制检索结果时附带其日期,例如 [[2022-01-01]]。默认开启","Add Blank Line Between Different Date":"在复制日期的时候加上空行","Add blank line when copy result with date. No blank line by default.":"在复制日期的时候在相邻的日期之间加上空行。默认无空行","Share Options":"分享选项","Share Memos Image Footer Start":"分享 Thino 图片的左边页脚","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"你可以在这里设置你想要的任意文本,用 {ThinoNum} 来展示你记录的 thino 数量,{UsedDay} 来展示使用日期。默认为'{ThinoNum} Thino {UsedDay} Days'","Share Memos Image Footer End":"分享 Thino 图片的右边页脚","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"你可以在这里设置你想要的任意文本,用 {UserName} 来展示你的用户名。默认为 '✍️ By {UserName}'","Save Shared Image To Folder For Mobile":"当在移动端上时保存图片到文件夹","Save image to folder for mobile. False by Default":"当在移动端上时,保存生成的图片到文件夹","Say Thank You":"感谢开发",Donate:"捐赠","If you like this plugin, consider donating to support continued development:":"如果你喜欢这个插件,而且也希望给我买鸡腿,那么可以考虑 Github 页面右边的 Sponsor~","File Name of Recycle Bin":"回收站的文件名","Set the filename for recycle bin. 'delete' By default":"给回收站设置一个文件名。默认为'delete'","File Name of Query File":"检索文件的文件名","Set the filename for query file. 'query' By default":"设置存放检索式的文件的文件名。默认为'query'","Use Tags In Vault":"使用在库内的所有标签","Use tags in vault rather than only in Memos. False by default.":"使用在库内的而不是 Thino 内的标签。默认关闭","Don't support web image yet, please input image path in vault":"暂不支持网络图片,请使用本地图片","Ready to convert image into background":"正在将图片转换为背景图",List:"列表",Task:"任务",Top:"顶部",Bottom:"底部",TAG:"标签",DAY:"天",QUERY:"检索式",EDIT:"编辑",PIN:"置顶",UNPIN:"取消置顶",DELETE:"删除","CONFIRM!":"确定删除","CREATE FILTER":"创建检索式",Filter:"筛选",Settings:"设置","Recycle bin":"回收站","About Me":"关于","Fetching data...":"获取数据中...","Here is No Memos.":"没有找到 Thino","Frequently Used Tags":"常用标签","What do you think now...":"你现在在想什么?",READ:"阅读",MARK:"引用",SHARE:"分享",SOURCE:"来源",RESTORE:"恢复",ARCHIVE:"归档","DELETE AT":"删除于","Noooop!":"啥都没有!","All Data is Loaded 🎉":"所有数据都加载好啦 🎉","Quick filter":"快速筛选",TYPE:"类型",LINKED:"有链接","NO TAGS":"无标签","HAS LINKS":"有超链接","HAS IMAGES":"有图片",INCLUDE:"包括",EXCLUDE:"排除",TEXT:"文本",IS:"是",AND:"和",OR:"或",LIST:"状态",ISNOT:"不是",SELECT:"选择","ADD FILTER TERMS":"添加检索条件",FILTER:"筛选器",TITLE:"标题","CREATE QUERY":"创建检索式","EDIT QUERY":"编辑检索式",MATCH:"匹配",TIMES:"次","Share Memo Image":"分享 Thino 图片","↗Click the button to save":"↗点击右上角的按钮来保存","Image is generating...":"图片正在生成中...","Image is loading...":"图片正在加载中...","😟 Cannot load image, image link maybe broken":"😟 无法加载图片,图片链接也许不存在","Loading...":"努力加载中...","Daily Memos":"每日 Thino","CANCEL EDIT":"取消编辑","LINK TO THE":"链接到","Mobile Options":"移动端选项","Experimental Options":"实验性选项","Background Image in Dark Theme":"深色主题的背景图","Background Image in Light Theme":"浅色主题的背景图",'Set background image in dark theme. Set something like "Daily/one.png"':'设置深色主题的背景图。请设置类似"Daily/one.png"的路径','Set background image in light theme. Set something like "Daily/one.png"':'设置浅色主题的背景图。请设置类似"Daily/one.png"的路径','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'设置默认 Thino 组成,你必须要使用 {TIME} 作为 "HH:mm" 而且要设置 {CONTENT} 作为内容识别。默认情况下, Thino 基于 "{TIME} {CONTENT}" 识别',"Default Memo Composition":"【已弃置】默认 Thino 组成","Show Tasks Label":"展示任务标签","Show tasks label near the time text. False by default":"在 Thino 的时间旁展示任务标签。默认情况下不展示","Please Open Memos First":"请先打开 Thino","Comment it...":"评论...",DATE:"日期",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"Obsidian Natrual DATES language 插件没启动",BEFORE:"在之前",AFTER:"在之后","Allow Comments On Memos":"允许在 Thino 上评论","You can comment on memos. False by default":"你可以在 Thino 点击图标进行评论了。默认不开启",Import:"导入","TITLE CANNOT BE NULL!":"标题不可以为空!","FILTER CANNOT BE NULL!":"筛选器不可以为空!","Comments In Original DailyNotes/Notes":"在原文件中进行评论","You should install Dataview Plugin ver 0.5.9 or later to use this feature.":"你需要安装 0.5.9 版本以上的 Dataview 插件来使用该功能","Open Memos Successfully":"成功打开 Thino ","Fetch Memos Error":"😭 Thino 获取失败","Copied to clipboard Successfully":"复制成功","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"请检查你有没有开启日记插件或者 Periodic Notes 插件且启用了日记模式","Please finish the last filter setting first":"先完善上一个过滤器吧","Close Memos Successfully":"成功关闭 Thino ","Insert as Memo":"插入内容为 Thino","Insert file as memo content":"插入文件为 Thino","Image load failed":"有个图片加载失败了😟","Content cannot be empty":"内容不能为空呀","Unable to create new file.":"无法新建文件","Failed to fetch deleted memos: ":"无法获取已删除的 Thino :","RESTORE SUCCEED":"成功恢复 Thino","DELETE SUCCEED":"删除成功","Save Memo button icon":"保存按钮上的图标","The icon shown on the save Memo button in the UI.":"你可以设置保存按钮上的图标","Fetch Memos From Particular Notes":"从指定的文件中获取 Thino",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'你可以给笔记设置指定检索式来让 Memos 可以索引到它。默认为 "#memo" ',"Allow Memos to Fetch Memo from Notes":"允许 Thino 从笔记中获取 Thino","Use Memos to manage all memos in your notes, not only in daily notes. False by default":"使用 Memos 来管理你笔记中的 Memos,不单只 DailyNotes 中的内容。默认为关闭","Always Show Memo Comments":"评论将总是可见","Always show memo comments on memos. False by default":"当开启后评论总是会在 Thino 的下方展示。默认为关闭","You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"你在 Periodic Notes 插件和日记插件都没设置日记的所在文件夹","Please check your daily note plugin OR periodic notes plugin settings":"请检查你的日记插件和/或 Periodic Notes 插件的设置","Use which plugin's default configuration":"使用哪个插件的默认日记配置","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"Thino 采用指定插件的默认配置来获取 Thino。默认为日记插件。",Daily:"日记插件","Always Show Leaf Sidebar on PC":"在 PC 上总是展示左侧栏","Show left sidebar on PC even when the leaf width is less than 875px. False by default.":"在 PC 上即使页面宽度小于 875px 时都展示左侧栏。默认为关闭","You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":"你在 Periodic Notes 插件和日记插件都没设置日记的格式","fetch more":"加载更多","Search all settings":"搜索所有设置","Random Review":"随机回顾","ARCHIVED AT":"归档于","Failed to get memos from daily notes":"无法从日记中获取 Thino","Failed to delete memo":"无法删除 Thino","CTRL + ENTER to save":"CTRL + ENTER 保存","Started from":"开始于","Custom Background Image":"自定义背景图","Set custom background image.":"设置自定义背景图","Custom Memo Footer":"自定义 Thino 页脚","Set custom memo footer.":"设置自定义 Thino 页脚","Heatmap Color Scheme":"热力图颜色","Set different color scheme for heatmap.":"设置热力图的颜色","Enable Local Http Server":"启用本地 HTTP 服务器","Memos Http Server Port":"Thino HTTP 服务器端口","Set memos http server port to listen. '43999' by default":"设置 Thino HTTP 服务器端口。默认为 '43999'","Live-Preview Mode OR Source Mode.":"基于 Thino 的所见即所得模式(默认) 或者 源码模式,你可以自己选择适合自己的输入体验。","Default Editor Mode":"默认编辑器模式","Save Location for Memos":"Thino 保存位置",DAILY:"日记",MULTI:"多文件",CANVAS:"画布",FILE:"单文件",ALL:"所有","Failed to create daily note, check if it exists.":"无法创建日记,请检查是否存在文件夹","Failed to create daily note. Please check if you created a folder for daily notes.":"无法创建日记,请检查是否存在日记文件夹","After you verify your account, please refresh this page.":"验证成功后,请刷新页面。",Verify:"去验证","Oops! You forget to verify insider account":"内测账户验证失败","If you have any questions, please contact us.":"如果你有任何问题,请联系我们。","Delete Thino Directly":"直接删除 Thino","When delete thino directly, it will not be moved to trash. False by default.":"当直接删除 Thino 时,不会移动到回收站。默认为关闭","Get activation code":"获取激活码","Input activation code here":"在这里输入激活码","Copy Thino id":"获取 Thino id","Activate Pro Version":"激活专业版","Please copy Thino id first":"请先获取 Thino id",'You can set folder name with file name like "folder/file"':'你可以设置例如 "folder/file" 的文件夹名+文件名的搭配来存放在指定文件夹','You can set folder name like "folder1/folder2/folder3" to create sub-folder':'你可以设置例如 "folder1/folder2/folder3" 的文件夹名来创建子文件夹',"Default save location":"默认保存位置",'Set the default save location for thino. "DAILY" by default':'设置 Thino 的默认保存位置。默认为 "DAILY"',"Enable opening thino globally":"全局唤醒 Thino","Enable opening thino globally. False by default.":"全局唤醒 Thino。默认为关闭","Key for opening thino globally":"全局唤醒 Thino 的快捷键","Set key for opening thino globally. CTRL + SHIFT + T by default.":"设置全局唤醒 Thino 的快捷键。默认为 CTRL + SHIFT + T","Sync Thino via PKMer":"通过 PKMer 同步 Thino",Unlink:"取消链接",Link:"链接","Connect to PKMer Sync, you can check it in ":"连接到 PKMer 同步,你可以在该链接中查看:","PKMer Sync":"PKMer 同步","Remove successfully":"移除成功",Deactivate:"取消激活",Remove:"移除","Confirm?":"确认?","Sync Status":"同步状态","Start or stop sync":"开始或停止同步","Stop sync successfully":"停止同步成功","Start sync successfully":"开始同步成功",Stop:"停止",Start:"开始","Show thino near mouse":"在鼠标附近展示 Thino","Query not found":"检索式未找到","Send to clipboard successfully":"发送到剪贴板成功","Thino - Failed to start HTTP server, please check the port is available.":"Thino - 启动 HTTP 服务器失败,请检查端口是否可用。","Thino - Started HTTP server on port":"Thino - 启动 HTTP 服务器成功,端口为","Thino - Terminated HTTP server":"Thino - 终止 HTTP 服务器","File not exist":"文件不存在","Thino not found":"Thino 未找到","File not found for the given thino path, is creating a new file":"未找到承载指定 Thino 的文件,正在创建新文件","Saved sync token successfully":"保存同步令牌成功","Failed to find daily notes folder":"未找到日记文件夹","Please install obsidian-hover-editor plugin first":"请先安装 obsidian-hover-editor 插件","Copied app id successfully":"复制 app id 成功","Please input token first":"请先输入 token","Please enable sync first":"请先启用同步","Init Failed":"初始化失败","Folder not found for the given thino path, is creating a new folder":"未找到承载指定 Thino 的文件夹,正在创建新文件夹","File not found for the given thino path":"未找到承载指定 Thino 的文件","Failed to read current daily note, check if it exists.":"无法读取日记文件,请检查是否存在","Verify successfully":"验证成功","Failed to verify":"验证失败","Failed to save":"保存失败","Failed to login, please login again":"登录已过期,请重新登录","COPY FAILED":"复制失败","COPY SUCCEED":"复制成功",COPY:"复制","This is a pro feature, please upgrade to pro version to use it.":"这是专业版功能,请升级到专业版来使用它。","You can get pro version from: ":"你可以从这里获取专业版:",Save:"保存",Cancel:"取消","Thino Daily Target":"Thino 每日目标",Input:"输入","#Tag":"#标签","to create tag":"来创建标签","You have verified your account. Congrats!":"你已经验证了你的账户。恭喜!","Pro Features":"专业版功能","Target Thino Count":"目标 Thino 数量",on:"在","Switch waterfall view":"切换瀑布流视图","Switch view":"切换视图","Switch list view":"切换列表视图","Set daily target":"设置每日目标","Thino Save To: ":"Thino 保存到:","Enter fullscreen mode":"进入全屏模式","Exit fullscreen mode":"退出全屏模式",words:"字","Return To Home Page":"返回首页","Open thino in center window":"在中心窗口打开 thino","Open thino in float window":"在浮动窗口打开 thino","Open thino in right sidebar":"在右侧边栏打开 thino","Open thino in left sidebar":"在左侧边栏打开 thino","Show thino editor":"显示 thino 编辑器","Toggle minimal mode":"切换 Minimal 模式","Focus on thino editor":"聚焦到 thino 编辑器","ReSync web thinos to local":"重新同步 web 上的 thino 到本地","Sync local thinos to web":"同步本地的 thino 到 web","Show daily thino dialog":"显示每日 thino 浮窗","Focus on search bar":"聚焦到搜索栏","Show-thino in popover(Hover editor)":"在弹出框中显示 thino","Center window":"中心窗口","Float window":"浮动窗口","Right sidebar":"右侧边栏","Left sidebar":"左侧边栏","Save thino type when sync local":"同步本地时保存的 thino 类型","Set the default save thino type when sync local, FILE by default.":"设置同步本地时保存的 thino 类型,默认为单文件。","Sync service":"同步服务","Pro verification status":"专业版激活状态","Live-preview":"所见即所得",Source:"源码",General:"通用",Thino:"Thino",Theme:"主题",Share:"分享",Advanced:"进阶","Global copy":"全局复制","Set the folder name":"设置文件夹名","Set the filename":"设置文件名","Set the filename for current location file":"设置当前位置文件的文件名","Switch calendar type":"切换日历类型",alphabetical:"标签名称(A-Z)",alphabeticalReverse:"标签名称(Z-A)",byCount:"按使用次数(从高到低)",byCountReverse:"按使用次数(从低到高)","Type here":"在这里输入",Today:"今天",Yesterday:"昨天","Last 7 days":"最近 7 天","Last 30 days":"最近 30 天","Last 90 days":"最近 90 天","Last 180 days":"最近 180 天","Last 365 days":"最近 365 天",Found:"被找到","Copy filtered thinos":"复制筛选的 thino","Bulk delete":"批量删除","Bulk archive":"批量归档","Bulk tag operation":"标签编辑","Bulk restore":"批量恢复","If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.":"如果你禁用了日记插件,可能会导致 thino 无法被正确删除。请启用插件后再试一次。",Preview:"预览","Set and save":"设置并保存","Show day mark on list mode":"在列表模式中展示日期标记","Show day mark on the top of daily range thino. False by default.":"在列表模式中展示日期标记。默认为关闭","Click to expand or fold, Cmd+Click to show all thinos of the day":"点击展开或折叠,Cmd+点击展示当天所有 thino","You can buy a license from":"你可以从这里购买许可证","No thinos in range":"该范围内没有 thino",Month:"月视图",Week:"周视图",Day:"日视图",Agenda:"日程视图",Tomorrow:"明天",Previous:"往前",Next:"往后","Search all columns...":"搜索所有的列...","Basic Info":"基础信息","Additional Info":"附加信息","Created At":"创建于",Content:"内容","Thino Type":"Thino 类型","Source Type":"来源类型","Row status":"归档状态",Path:"路径","Pinned Status":"置顶状态",Table:"表格",Chat:"聊天",Moments:"动态",Waterfall:"瀑布流",Calendar:"日历","Go to page":"跳转到页",Page:"页",Show:"展示",rows:"行","Temp Filter":"临时筛选器","Set the heading for saving thino":"设置保存 Thino 的标题","# Heading":"# 标题","Allow navigation from view to Thino or Thino to view":"允许从视图到 Thino 或者从 Thino 到视图的导航","Day mark range":"日期标记范围","Set the range of day mark. Day by default.":"设置日期标记的范围,默认为天","Thino is locked":"Thino 已锁定","Please unlock Thino by input password":"请输入密码来解锁 Thino","Auto Download Image":"自动下载图片","Auto download image when save to thino. 'false' by default":"当保存到 Thino 时自动下载图片。默认为 'false'","Thino Http IP Type":"Thino HTTP 服务器 IP 类型","Set Thino http server ip to listen. 'localhost' by default":"设置 Thino HTTP 服务器 IP。默认为 'localhost'","Password to lock Thino":"锁定 Thino 的密码",Unlock:"解锁",Locked:"已锁定","Password is incorrect":"密码错误",Lock:"锁定","Need password to unlock Thino":"需要密码来解锁 Thino","You have not set a password or enable this feature yet":"你还没有设置密码或者启用该功能",Password:"密码","Password for Thino":"Thino 的密码","Please input your password to change password settings":"请输入原来的密码来修改密码设置","Please input your password":"请输入密码","Lock thino":"锁定 Thino",date:"日期",time:"时间",event:"事件","Add tag position":"添加标签位置","Set the position of the tag when adding tag automatically":"设置自动添加标签的位置","Add tag automatically":"自动添加标签","Add tag to the end or beginning of the thino content when creating a thino and filtering tags":"在创建 Thino 和筛选标签时,将标签添加到 Thino 内容的末尾或开头","Add tag with new line":"添加标签时换行","Add tag with new line when adding tag automatically":"自动添加标签时换行","Input to select more tags":"输入来选择更多标签","Tag Bulk Edit":"标签批量编辑","Exist Tags":"已有标签","Selected Tags":"已选标签","Click to remove exist tag":"点击移除已有标签","Click to remove selected tag":"点击移除已选标签","Select tags":"选择标签","Input to select exist tag":"输入来选择已有标签",Beginning:"开头",End:"末尾","Chat view style":"聊天视图样式","Set the style of chat view":"设置聊天视图的样式","Background image for moments view":"动态视图的背景图","Set the background image for moments view":"设置动态视图的背景图","Icon for moments/chat view":"动态/聊天视图的头像","Set the icon for moments/chat view":"设置动态/聊天视图的头像","Quote for moments view":"动态视图的个性签名","Set the quote for moments view":"设置动态视图的个性签名","Theme for Thino":"Thino 主题","Set the theme for Thino":"设置 Thino 的主题","Theme Details":"主题详情","Task amount":"任务数量","Thino status":"Thino 状态","Used tags":"使用的标签","Used days":"使用的天数","Most active day":"最活跃的一天","Most active hour":"最活跃的一小时","Thino amount":"Thino 数量","Latest version":"最新版本","Previous version":"之前版本","Thino update info":"Thino 更新信息","Debug info copied to clipboard":"调试信息已复制到剪贴板","Copy debug info":"复制调试信息","Failed to load changelog":"无法加载更新日志","View online":"在线查看",ChangeLog:"更新日志"},J4={},K4={ar:N4,cs:k4,da:A4,de:O4,en:wI,"en-gb":F4,es:P4,fr:j4,hi:L4,id:R4,it:_4,ja:H4,ko:B4,nl:Y4,nn:z4,pl:U4,pt:V4,"pt-br":Z4,ro:W4,ru:$4,tr:G4,"zh-cn":q4,"zh-tw":J4},Lb=K4[x.moment.locale()];function k(e){const t=Lb&&Lb[e]||wI[e];return t===null?t:t||e}const Q4=/```([\s\S]*?)```/g,X4=/\*\*(.+?)\*\*/g,eN=/\*(.+?)\*/g,tN=/\[ \] /g,nN=/\[.{1}\] /g,rN=/^[*-]/g,aN=/(\d+)\. /g,Rb=/\[\[([^\]]+)\]\]/g,dw=/\[([^\]]+)\]\((([^\]]+).md)\)/g,oN=(e,t)=>{const n=e.replace(Q4,"
$1
").replace(rN,"").replace(aN,"$1.").replace(tN,"").replace(nN,"").replace(X4,"$1").replace(eN,"$1").replace(/<br>/g,"

").replace(/&/g,"&");let r=n;if(t){if(Rb.test(n)){const a=n.match(Rb);for(let o=0;o{const{metadataCache:n}=Ee.getState().dailyNotesState.app;return n.getFirstLinkpathDest(decodeURIComponent(e),"")instanceof x.TFile?t?`${t}`:`${e}`:t?`${t}`:`${e}`},iN=e=>{var t;return(t=/\[\[([^\]]+)\]\]/g.exec(e))==null?void 0:t[1]},sN=e=>{var t;return(t=dw.exec(e))==null?void 0:t[1]},lN=e=>{var t;return(t=/\[([^\]]+)\]\((([^\]]+).md)\)/g.exec(e))==null?void 0:t[3]},_b=e=>{const t=document.createElement("div");return t.className="memo-content-text",t.innerHTML=e,t.innerText},cN=e=>e.replace(/\n/g,"
"),uN=e=>{const t=document.createElement("div");return t.textContent=e,t.innerHTML},Hb="mobile-show-sidebar",bI=200,Ba=3600*24*1e3,An=/\s#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,hr=/(

|
)#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,$n=/^#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/gu,Rc=/(\s|:|\(|>|^)((http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-]))/g,dN=/\[([\s\S]*?)\]\(([\s\S]*?)\)/gu,_c=/([^\s<\\*>'(]+\.(jpeg|jpg|gif|png|svg))(\]\])?(\))?/g,Il=/\[@(.+?)\]\((.+?)\)/g,fN=/^(-|\*|\d\.)\s(\[.\]\s)?(\d{1,2}:\d{2}(:\d{2})?)\s(.*)$/g,Md=[{title:"DAILY",icon:"list"},{title:"CANVAS",icon:"layout-dashboard"},{title:"MULTI",icon:"file-text"},{title:"FILE",icon:"edit"}];var fw;(e=>{function t(){return parseInt(x.moment().format("x"))}e.getNowTimeStamp=t;function n(){const P=navigator.userAgent;let L="Unknown";return P.indexOf("Win")!=-1?L="Windows":P.indexOf("Mac")!=-1?L="MacOS":P.indexOf("Linux")!=-1&&(L="Linux"),L}e.getOSVersion=n;function r(P){return typeof P=="string"&&(P=P.replaceAll("-","/")),new Date(P).getTime()}e.getTimeStampByDate=r;function a(P){const L=new Date(r(P));return new Date(L.getFullYear(),L.getMonth(),L.getDate()).getTime()}e.getDateStampByDate=a;function o(P){const L=new Date(r(P)),z=L.getFullYear(),U=L.getMonth()+1,W=L.getDate();return`${z}/${U}/${W}`}e.getDateString=o;function s(P){const L=new Date(r(P)),z=L.getHours(),U=L.getMinutes(),W=z<10?"0"+z:z,K=U<10?"0"+U:U;return`${W}:${K}`}e.getTimeString=s;function u(P){const L=new Date(r(P)),z=L.getFullYear(),U=L.getMonth()+1,W=L.getDate(),K=L.getHours(),ae=L.getMinutes(),ce=L.getSeconds(),fe=U<10?"0"+U:U,ie=W<10?"0"+W:W,ge=K<10?"0"+K:K,Te=ae<10?"0"+ae:ae,se=ce<10?"0"+ce:ce;return`${z}/${fe}/${ie} ${ge}:${Te}:${se}`}e.getDateTimeString=u;function d(P){return Array.from(new Set(P))}e.dedupe=d;function m(P){const L=new Set,z=[];for(const U of P)L.has(U.id)||(L.add(U.id),z.push(U));return z}e.dedupeObjectWithId=m;function p(P,L){let z=null;return()=>{z&&clearTimeout(z),z=setTimeout(P,L)}}e.debounce=p;function g(P,L,z=!1,U){let W=null,K=!1;function ae(...ce){if(W&&clearTimeout(W),z&&!K){const fe=P.apply(this,ce);U&&typeof U=="function"&&U(fe),K=!0}else W=setTimeout(()=>{const fe=P.apply(this,ce);U&&typeof U=="function"&&U(fe),K=!1,W=null},L)}return ae.cancel=function(){W&&clearTimeout(W),W=null,K=!1},ae}e.debouncePlus=g;function w(P,L){let z=!0;return()=>{if(!z)return!1;z=!1,setTimeout(()=>{P(),z=!0},L)}}e.throttle=w;function D(P){const L=[],z=Object.keys(P).sort();for(const U of z){const W=P[U];W&&(typeof W=="object"?L.push(...D(W).split("&")):L.push(`${U}=${W}`))}return L.join("&")}e.transformObjectToParamsString=D;function S(P){const L={},z=P.split("&");for(const U of z){const[W,K]=U.split("=");W&&K&&(L[W]=K)}return L}e.transformParamsStringToObject=S;function T(P){if(!P)return{};const L={},z=Object.keys(P).sort();for(const U of z){const W=P[U];if(typeof W=="object"){const K=T(JSON.parse(JSON.stringify(W)));K&&Object.keys(K).length>0&&(L[U]=K)}else W&&(L[U]=W)}return L}e.filterObjectNullKeys=T;async function E(P){if(navigator.clipboard&&navigator.clipboard.writeText)try{await navigator.clipboard.writeText(P)}catch(L){console.warn("Copy to clipboard failed.",L)}else console.warn("Copy to clipboard failed, methods not supports.")}e.copyTextToClipboard=E;function A(P){return new Promise(L=>{const z=new Image;z.onload=()=>{const{width:U,height:W}=z;U>0&&W>0?L({width:U,height:W}):L({width:0,height:0})},z.onerror=()=>{L({width:0,height:0})},z.className="hidden",z.src=P,document.body.appendChild(z),z.remove()})}e.getImageSize=A;async function N(P){var W,K,ae,ce;let L;const U=app.plugins.getPlugin("obsidian-memos").settings.UseDailyOrPeriodic==="Daily";try{return!U&&((ce=(ae=(K=(W=window.app.plugins)==null?void 0:W.getPlugin("periodic-notes"))==null?void 0:K.calendarSetManager)==null?void 0:ae.getActiveConfig("day"))!=null&&ce.enabled)?(L=await window.app.plugins.getPlugin("periodic-notes").createPeriodicNote("day",P),L):(L=await yI(P),L)}catch(fe){return console.error(fe),new x.Notice(k("Failed to create daily note. Please check if you created a folder for daily notes.")),null}}e.createDailyNoteCheck=N;function R(P){const L=[];let z=0;for(;z").map(a=>`

${a!==""?a:"
"}

`).join(""),e=oN(e,t),e=e.replace(An,"#$1").replace(hr,"

#$2").replace(Rc,"$1$2").replace(dN,"$1").replace(Il,"$1").replace(/\^\S{6}/g,"");const n=document.createElement("div");n.innerHTML=e;for(let a=0;a{const n=window.atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let o=0;o{const s=Re.getTimeStampByDate(a.createdAt),u=Re.getTimeStampByDate(o.createdAt);return s===u?o.id.localeCompare(a.id):Re.getTimeStampByDate(o.createdAt)-Re.getTimeStampByDate(a.createdAt)}),r=Re.dedupeObjectWithId(n);return{...e,memos:[...r]}}case"SET_COMMENT_MEMOS":{const n=Re.dedupeObjectWithId(t.payload.commentMemos.sort((r,a)=>Re.getTimeStampByDate(a.createdAt)-Re.getTimeStampByDate(r.createdAt)));return{...e,commentMemos:[...n]}}case"SET_TAGS":return{...e,tags:t.payload.tags,tagsNum:t.payload.tagsNum};case"INSERT_MEMO":{const n=Re.dedupeObjectWithId([t.payload.memo,...e.memos].sort((r,a)=>Re.getTimeStampByDate(a.createdAt)-Re.getTimeStampByDate(r.createdAt)));return{...e,memos:n}}case"INSERT_COMMENT_MEMO":{const n=Re.dedupeObjectWithId([t.payload.memo,...e.commentMemos].sort((r,a)=>Re.getTimeStampByDate(a.createdAt)-Re.getTimeStampByDate(r.createdAt)));return{...e,commentMemos:[...n]}}case"DELETE_MEMO_BY_ID":return{...e,memos:[...e.memos].filter(n=>n.id!==t.payload.id)};case"DELETE_MEMO_BY_ID_BATCH":{const n=[...e.memos];return t.payload.ids.forEach(r=>{n.splice(n.findIndex(a=>a.id===r),1)}),{...e,memos:[...n]}}case"CLEAR_MEMOS":return{...SI};case"EDIT_MEMO":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"EDIT_MEMO_PATH":{const n=e.memos.map(r=>r.path===t.payload.path?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"UPDATE_MEMO_BATCH":{const n=e.memos.filter(a=>a.path!==t.payload.path),r=Re.dedupeObjectWithId([...t.payload.memos,...n].sort((a,o)=>Re.getTimeStampByDate(o.createdAt)-Re.getTimeStampByDate(a.createdAt)));return{...e,memos:[...r]}}case"ARCHIVE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"ARCHIVE_MEMO_BY_ID_BULK":{const n=e.memos.map(r=>t.payload.some(a=>a.id===r.id)?{...r,...t.payload.filter(a=>a.id===r.id)[0]}:r);return{...e,memos:[...n]}}case"UNARCHIVE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"PIN_MEMO":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,pinned:t.payload.pinned}:r);return{...e,memos:[...n]}}case"EDIT_COMMENT_MEMO":{const n=e.commentMemos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,commentMemos:[...n]}}default:return e}}const SI={memos:[],commentMemos:[],tags:[],tagsNum:{}};function pN(e,t){switch(t.type){case"SIGN_IN":return{user:t.payload.user};case"SIGN_OUT":return{user:null};default:return e}}const gN={user:null};function vN(e,t){switch(t.type){case"SET_QUERIES":{const n=Re.dedupeObjectWithId(t.payload.queries.sort((r,a)=>Re.getTimeStampByDate(a.createdAt)-Re.getTimeStampByDate(r.createdAt)).sort((r,a)=>Re.getTimeStampByDate(a.pinnedAt??0)-Re.getTimeStampByDate(r.pinnedAt??0)));return{...e,queries:n}}case"INSERT_QUERY":{const n=Re.dedupeObjectWithId([t.payload.query,...e.queries].sort((r,a)=>Re.getTimeStampByDate(a.createdAt)-Re.getTimeStampByDate(r.createdAt)));return{...e,queries:n}}case"DELETE_QUERY_BY_ID":return{...e,queries:[...e.queries].filter(n=>n.id!==t.payload.id)};case"UPDATE_QUERY":{const n=e.queries.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,queries:n}}default:return e}}const yN={queries:[]};function wN(e,t){var n,r,a,o;switch(t.type){case"SET_DAILY_NOTES":return{...e,dailyNotes:t.payload.dailyNotes};case"SET_APP":return e.app?{...e}:{...e,app:t.payload.app};case"SET_PLUGIN":return e.plugin?{...e}:{...e,plugin:t.payload.plugin};case"SET_EDITOR":return e.editor?{...e}:{...e,editor:t.payload.editor};case"SET_SETTINGS":return e.settings&&e.settings===t.payload.settings?{...e}:{...e,settings:t.payload.settings};case"SET_VIEW":return e.view&&((r=(n=e.view)==null?void 0:n.leaf)==null?void 0:r.id)===((o=(a=t.payload.view)==null?void 0:a.leaf)==null?void 0:o.id)?{...e}:{...e,view:t.payload.view};case"CLEAR_VIEW":return e.view&&e.view.unload(),{...e,view:null};case"CLEAR_FILES":return{...e,dailyNotes:null};case"SET_VERIFY_STATE":return{...e,verifyState:t.payload.verifyState};default:return e}}const bN={dailyNotes:null,app:null,view:null,settings:null,editor:null,plugin:null,verifyState:null},Ee=X3({globalState:t4,locationState:rI,memoState:SI,userState:gN,queryState:yN,dailyNotesState:bN},Q3({globalState:e4,locationState:n4,memoState:mN,userState:pN,queryState:vN,dailyNotesState:wN})),wt=O.createContext(Ee.getState());String.prototype.replaceAll||(String.prototype.replaceAll=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object regexp]"?this.replace(e,t):this.replace(new RegExp(e,"g"),t)});class DN{constructor(){he(this,"initialized",!1)}getState(){return Ee.getState().dailyNotesState}setApp(t){return Ee.dispatch({type:"SET_APP",payload:{app:t}}),t}setPlugin(t){return Ee.dispatch({type:"SET_PLUGIN",payload:{plugin:t}}),t}setSettings(t){return Ee.dispatch({type:"SET_SETTINGS",payload:{settings:t}}),this.initialized||(this.initialized=!0),t}setView(t){return Ee.dispatch({type:"SET_VIEW",payload:{view:t}}),t}setEditor(t){return Ee.dispatch({type:"SET_EDITOR",payload:{editor:t}}),t}async updateDailyNotes(t,n){const r=this.getState().dailyNotes,a=Zh(t,"day");return n?delete r[`day-${a.format("YYYY-MM-DD")}T00:00:00+08:00}`]:r[`day-${a.format("YYYY-MM-DD")}T00:00:00+08:00}`]=t,Ee.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:r}}),r}setVerifyState(t){return Ee.dispatch({type:"SET_VERIFY_STATE",payload:{verifyState:t}}),t}async fechLocalDailyNotes(){try{const t=ws();return Ee.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:t}}),t}catch(t){console.error(t)}}}const rt=new DN;var Kn;(e=>{function t(o){const s={};for(const u of o)try{const d=localStorage.getItem(u);if(d!==null){const m=JSON.parse(d);s[u]=m}}catch(d){console.error("Get storage failed in ",u,d)}return s}e.get=t;function n(o){for(const s in o)try{const u=JSON.stringify(o[s]);localStorage.setItem(s,u)}catch(u){console.error("Save storage failed in ",s,u)}}e.set=n;function r(o){for(const s of o)try{localStorage.removeItem(s)}catch(u){console.error("Remove storage failed in ",s,u)}}e.remove=r;function a(){var s;const o=document.createElement("iframe");o.style.display="none",document.body.appendChild(o),(s=o.contentWindow)==null||s.localStorage.setItem("t",Date.now().toString()),o.remove()}e.emitStorageChangedEvent=a})(Kn||(Kn={}));class SN{constructor(){he(this,"getState",()=>Ee.getState().globalState);he(this,"setEditMemoId",t=>{Ee.dispatch({type:"SET_EDIT_MEMO_ID",payload:{editMemoId:t}})});he(this,"setRefresh",t=>{Ee.dispatch({type:"SET_REFRESH",payload:{refresh:t}})});he(this,"setCommentMemoId",t=>{Ee.dispatch({type:"SET_COMMENT_MEMO_ID",payload:{commentMemoId:t}})});he(this,"setMarkMemoId",t=>{Ee.dispatch({type:"SET_MARK_MEMO_ID",payload:{markMemoId:t}})});he(this,"setLoaded",t=>{Ee.dispatch({type:"SET_LOADED",payload:{loaded:t}})});he(this,"setGlobalEditorShown",t=>{Ee.dispatch({type:"SET_GLOBAL_EDITOR_SHOWN",payload:{globalEditorShown:t}})});he(this,"setIsMobileView",t=>{Ee.dispatch({type:"SET_MOBILE_VIEW",payload:{isMobileView:t}})});he(this,"setChangedByMemos",t=>{Ee.dispatch({type:"SET_CHANGED_BY_MEMOS",payload:{changedByMemos:t}})});he(this,"setShowSiderbarInMobileView",t=>{Ee.dispatch({type:"SET_SHOW_SIDEBAR_IN_MOBILE_VIEW",payload:{showSiderbarInMobileView:t}})});he(this,"setAppSetting",t=>{Ee.dispatch({type:"SET_APP_SETTING",payload:t}),Kn.set(t)});he(this,"setMemoListView",t=>{Ee.dispatch({type:"SET_MEMO_LIST_VIEW",payload:{memoListView:t}})});he(this,"setInstance",(t,n)=>{Ee.dispatch({type:"SET_INSTANCE",payload:{id:t,instance:n}})});he(this,"setLocked",t=>{Ee.dispatch({type:"SET_LOCKED",payload:{locked:t}})});he(this,"setPluginManifest",t=>{Ee.dispatch({type:"SET_MEMO_PLUGIN_MANIFEST",payload:{manifest:t}})});const t=Kn.get(["shouldSplitMemoWord","shouldHideImageUrl","shouldUseMarkdownParser","useTinyUndoHistoryCache"]),n={shouldSplitMemoWord:t.shouldSplitMemoWord||!0,shouldHideImageUrl:t.shouldHideImageUrl||!0,shouldUseMarkdownParser:t.shouldUseMarkdownParser||!0,useTinyUndoHistoryCache:t.useTinyUndoHistoryCache||!1};this.setAppSetting(n)}}const Qe=new SN;class IN{constructor(){he(this,"updateStateWithLocation",()=>{const{pathname:t,search:n,hash:r}=window.location,a=new URLSearchParams(n),o={pathname:"/",hash:"",query:{tag:"",duration:null,text:"",type:"",filter:""}};o.query.tag=a.get("tag")||"",o.query.type=a.get("type")??"",o.query.text=a.get("text")??"",o.query.filter=a.get("filter")??"";const s=parseInt(a.get("from")??"0"),u=parseInt(a.get("to")??"0");u>s&&u!==0&&(o.query.duration={from:s,to:u}),o.hash=r,o.pathname=this.getValidPathname(t),Ee.dispatch({type:"SET_LOCATION",payload:o})});he(this,"getState",()=>Ee.getState().locationState);he(this,"clearQuery",()=>{Ee.dispatch({type:"SET_QUERY",payload:{tag:"",duration:null,text:"",type:"",filter:""}})});he(this,"setQuery",t=>{Ee.dispatch({type:"SET_QUERY",payload:t})});he(this,"reloadApp",()=>{Ee.dispatch({type:"RELOAD"})});he(this,"setHash",t=>{Ee.dispatch({type:"SET_HASH",payload:{hash:t}})});he(this,"setPathname",t=>{Ee.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});he(this,"pushHistory",t=>{Ee.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});he(this,"replaceHistory",t=>{Ee.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});he(this,"setMemoTypeQuery",(t="")=>{Ee.dispatch({type:"SET_TYPE",payload:{type:t}})});he(this,"setMemoFilter",t=>{Ee.dispatch({type:"SET_QUERY_FILTER",payload:t})});he(this,"setTextQuery",t=>{Ee.dispatch({type:"SET_TEXT",payload:{text:t}})});he(this,"setTimeQuery",t=>{Ee.dispatch({type:"SET_DURATION_QUERY",payload:{duration:t}})});he(this,"setTagQuery",t=>{Ee.dispatch({type:"SET_TAG_QUERY",payload:{tag:t}})});he(this,"setFromAndToQuery",(t,n)=>{Ee.dispatch({type:"SET_DURATION_QUERY",payload:{duration:{from:t,to:n}}})});he(this,"getValidPathname",t=>["/","/homeboard","/recycle","/setting"].includes(t)?t:"/");this.updateStateWithLocation(),window.onpopstate=()=>{this.updateStateWithLocation()}}}const We=new IN,xc=e=>`${e.vault.configDir}/query.json`,II=async(e,t)=>{try{return await e.vault.adapter.read(t),!0}catch(n){return console.error(n),!1}},Bd=async e=>(await II(e,xc(e))||await TI(e),JSON.parse(await e.vault.adapter.read(xc(e))).queries||[]),bm=async(e,t)=>{await e.vault.adapter.write(xc(e),JSON.stringify({queries:t},null,2))},TI=async e=>{const t=Qe.getState().manifest,n=e.plugins.getPlugin(t.id||"obsidian-memos").settings,r=e.metadataCache.getFirstLinkpathDest(n.QueryFileName,"");if(!r)await e.vault.adapter.write(xc(e),JSON.stringify({queries:[]},null,2));else{const o=(await e.vault.read(r)).split(` `);o.length===0&&await e.vault.adapter.write(xc(e),JSON.stringify({queries:[]},null,2));const s=[];for(let u=0;u{const{app:e}=Ee.getState().dailyNotesState;return await II(e,xc(e))||await TI(e),await Bd(e)||[]},EN=(e,t)=>({createdAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),id:e,pinnedAt:"",querystring:t,title:k("Temp Filter"),updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"}),xN=async(e,t)=>{const n=await Bd(Ee.getState().dailyNotesState.app)||[],r={createdAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),id:x.moment().format("YYYYMMDDHHmmss")+n.length,pinnedAt:"",querystring:t,title:e,updatedAt:x.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"};return n.push(r),await bm(Ee.getState().dailyNotesState.app,n),r};var nv={exports:{}};nv.exports;(function(e,t){(function(){var n,r="4.17.21",a=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",u="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",m=500,p="__lodash_placeholder__",g=1,w=2,D=4,S=1,T=2,E=1,A=2,N=4,R=8,F=16,H=32,P=64,L=128,z=256,U=512,W=30,K="...",ae=800,ce=16,fe=1,ie=2,ge=3,Te=1/0,se=9007199254740991,we=17976931348623157e292,Z=NaN,$=4294967295,X=$-1,ve=$>>>1,De=[["ary",L],["bind",E],["bindKey",A],["curry",R],["curryRight",F],["flip",U],["partial",H],["partialRight",P],["rearg",z]],be="[object Arguments]",ke="[object Array]",Be="[object AsyncFunction]",_e="[object Boolean]",it="[object Date]",Vt="[object DOMException]",Se="[object Error]",Ue="[object Function]",Je="[object GeneratorFunction]",$e="[object Map]",lt="[object Number]",ft="[object Null]",Dt="[object Object]",Et="[object Promise]",$t="[object Proxy]",rn="[object RegExp]",At="[object Set]",an="[object String]",Sn="[object Symbol]",In="[object Undefined]",vr="[object WeakMap]",Sa="[object WeakSet]",Mr="[object ArrayBuffer]",Nr="[object DataView]",Ss="[object Float32Array]",mo="[object Float64Array]",po="[object Int8Array]",Nl="[object Int16Array]",Fi="[object Int32Array]",Pi="[object Uint8Array]",Is="[object Uint8ClampedArray]",Yo="[object Uint16Array]",ji="[object Uint32Array]",V=/\b__p \+= '';/g,ne=/\b(__p \+=) '' \+/g,me=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ce=/&(?:amp|lt|gt|quot|#39);/g,je=/[&<>"']/g,Ye=RegExp(Ce.source),ze=RegExp(je.source),pt=/<%-([\s\S]+?)%>/g,Yt=/<%([\s\S]+?)%>/g,On=/<%=([\s\S]+?)%>/g,yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,na=/^\w*$/,Fn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yr=/[\\^$.*+?()[\]{}|]/g,ra=RegExp(yr.source),kl=/^\s+/,Jt=/\s/,Ia=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ta=/\{\n\/\* \[wrapped with (.+)\] \*/,Ea=/,? & /,zo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Uo=/[()=,{}\[\]\/\s]/,vy=/\\(\\)?/g,Li=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,of=/\w*$/,Um=/^[-+]0x[0-9a-f]+$/i,yy=/^0b[01]+$/i,Vm=/^\[object .+?Constructor\]$/,Zm=/^0o[0-7]+$/i,Wm=/^(?:0|[1-9]\d*)$/,$m=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zc=/($^)/,wy=/['\n\r\u2028\u2029\\]/g,on="\\ud800-\\udfff",by="\\u0300-\\u036f",sf="\\ufe20-\\ufe2f",Gm="\\u20d0-\\u20ff",Al=by+sf+Gm,qm="\\u2700-\\u27bf",lf="a-z\\xdf-\\xf6\\xf8-\\xff",Uc="\\xac\\xb1\\xd7\\xf7",Za="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dy="\\u2000-\\u206f",xa=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Jm="A-Z\\xc0-\\xd6\\xd8-\\xde",Km="\\ufe0e\\ufe0f",Qm=Uc+Za+Dy+xa,Ts="['’]",Vc="["+on+"]",Es="["+Qm+"]",Ri="["+Al+"]",Xm="\\d+",Sy="["+qm+"]",Zc="["+lf+"]",cf="[^"+on+Qm+Xm+qm+lf+Jm+"]",Ol="\\ud83c[\\udffb-\\udfff]",Fl="(?:"+Ri+"|"+Ol+")",ep="[^"+on+"]",Pl="(?:\\ud83c[\\udde6-\\uddff]){2}",_t="[\\ud800-\\udbff][\\udc00-\\udfff]",_i="["+Jm+"]",uf="\\u200d",Wc="(?:"+Zc+"|"+cf+")",tp="(?:"+_i+"|"+cf+")",df="(?:"+Ts+"(?:d|ll|m|re|s|t|ve))?",ff="(?:"+Ts+"(?:D|LL|M|RE|S|T|VE))?",$c=Fl+"?",jl="["+Km+"]?",Vo="(?:"+uf+"(?:"+[ep,Pl,_t].join("|")+")"+jl+$c+")*",Zo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Wo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",xs=jl+$c+Vo,Ll="(?:"+[Sy,Pl,_t].join("|")+")"+xs,$o="(?:"+[ep+Ri+"?",Ri,Pl,_t,Vc].join("|")+")",Iy=RegExp(Ts,"g"),np=RegExp(Ri,"g"),Hi=RegExp(Ol+"(?="+Ol+")|"+$o+xs,"g"),Ty=RegExp([_i+"?"+Zc+"+"+df+"(?="+[Es,_i,"$"].join("|")+")",tp+"+"+ff+"(?="+[Es,_i+Wc,"$"].join("|")+")",_i+"?"+Wc+"+"+df,_i+"+"+ff,Wo,Zo,Xm,Ll].join("|"),"g"),rp=RegExp("["+uf+on+Al+Km+"]"),Gc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ap=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ey=-1,zt={};zt[Ss]=zt[mo]=zt[po]=zt[Nl]=zt[Fi]=zt[Pi]=zt[Is]=zt[Yo]=zt[ji]=!0,zt[be]=zt[ke]=zt[Mr]=zt[_e]=zt[Nr]=zt[it]=zt[Se]=zt[Ue]=zt[$e]=zt[lt]=zt[Dt]=zt[rn]=zt[At]=zt[an]=zt[vr]=!1;var Ht={};Ht[be]=Ht[ke]=Ht[Mr]=Ht[Nr]=Ht[_e]=Ht[it]=Ht[Ss]=Ht[mo]=Ht[po]=Ht[Nl]=Ht[Fi]=Ht[$e]=Ht[lt]=Ht[Dt]=Ht[rn]=Ht[At]=Ht[an]=Ht[Sn]=Ht[Pi]=Ht[Is]=Ht[Yo]=Ht[ji]=!0,Ht[Se]=Ht[Ue]=Ht[vr]=!1;var Cs={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},qc={"&":"&","<":"<",">":">",'"':""","'":"'"},xy={"&":"&","<":"<",">":">",""":'"',"'":"'"},Cy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hf=parseFloat,Jc=parseInt,Kc=typeof Jn=="object"&&Jn&&Jn.Object===Object&&Jn,op=typeof self=="object"&&self&&self.Object===Object&&self,sn=Kc||op||Function("return this")(),Rl=t&&!t.nodeType&&t,Wa=Rl&&!0&&e&&!e.nodeType&&e,mf=Wa&&Wa.exports===Rl,Ms=mf&&Kc.process,wr=function(){try{var oe=Wa&&Wa.require&&Wa.require("util").types;return oe||Ms&&Ms.binding&&Ms.binding("util")}catch{}}(),pf=wr&&wr.isArrayBuffer,kr=wr&&wr.isDate,Bi=wr&&wr.isMap,Qc=wr&&wr.isRegExp,Ns=wr&&wr.isSet,ip=wr&&wr.isTypedArray;function br(oe,xe,pe){switch(pe.length){case 0:return oe.call(xe);case 1:return oe.call(xe,pe[0]);case 2:return oe.call(xe,pe[0],pe[1]);case 3:return oe.call(xe,pe[0],pe[1],pe[2])}return oe.apply(xe,pe)}function gf(oe,xe,pe,Ge){for(var bt=-1,Pt=oe==null?0:oe.length;++bt-1}function yf(oe,xe,pe){for(var Ge=-1,bt=oe==null?0:oe.length;++Ge-1;);return pe}function Ef(oe,xe){for(var pe=oe.length;pe--&&ks(xe,oe[pe],0)>-1;);return pe}function mp(oe,xe){for(var pe=oe.length,Ge=0;pe--;)oe[pe]===xe&&++Ge;return Ge}var pp=nu(Cs),gp=nu(qc);function vp(oe){return"\\"+Cy[oe]}function As(oe,xe){return oe==null?n:oe[xe]}function Os(oe){return rp.test(oe)}function Fy(oe){return Gc.test(oe)}function Py(oe){for(var xe,pe=[];!(xe=oe.next()).done;)pe.push(xe.value);return pe}function ru(oe){var xe=-1,pe=Array(oe.size);return oe.forEach(function(Ge,bt){pe[++xe]=[bt,Ge]}),pe}function xf(oe,xe){return function(pe){return oe(xe(pe))}}function aa(oe,xe){for(var pe=-1,Ge=oe.length,bt=0,Pt=[];++pe-1}function Mp(c,f){var b=this.__data__,M=or(b,c);return M<0?(++this.size,b.push([c,f])):b[M][1]=f,this}Dr.prototype.clear=Us,Dr.prototype.delete=Fr,Dr.prototype.get=vu,Dr.prototype.has=Cp,Dr.prototype.set=Mp;function ia(c){var f=-1,b=c==null?0:c.length;for(this.clear();++f=f?c:f)),c}function Pr(c,f,b,M,j,Y){var J,te=f&g,le=f&w,Me=f&D;if(b&&(J=j?b(c,M,j,Y):b(c)),J!==n)return J;if(!bn(c))return c;var Ne=Tt(c);if(Ne){if(J=Kp(c),!te)return Ir(c,J)}else{var Pe=cr(c),Ve=Pe==Ue||Pe==Je;if(sl(c))return Wf(c,te);if(Pe==Dt||Pe==be||Ve&&!j){if(J=le||Ve?{}:tl(c),!te)return le?zy(c,Ma(J,c)):Yp(c,Xt(J,c))}else{if(!Ht[Pe])return j?c:{};J=ur(c,Pe,te)}}Y||(Y=new ar);var ot=Y.get(c);if(ot)return ot;Y.set(c,J),wb(c)?c.forEach(function(vt){J.add(Pr(vt,f,b,vt,c,Y))}):vb(c)&&c.forEach(function(vt,Mt){J.set(Mt,Pr(vt,f,b,Mt,c,Y))});var gt=Me?le?cc:Uu:le?ma:fr,Ct=Ne?n:gt(c);return er(Ct||c,function(vt,Mt){Ct&&(Mt=vt,vt=c[Mt]),Gi(J,Mt,Pr(vt,f,b,Mt,c,Y))}),J}function Op(c){var f=fr(c);return function(b){return Jl(b,c,f)}}function Jl(c,f,b){var M=b.length;if(c==null)return!M;for(c=Zt(c);M--;){var j=b[M],Y=f[j],J=c[j];if(J===n&&!(j in c)||!Y(J))return!1}return!0}function Pf(c,f,b){if(typeof c!="function")throw new oa(s);return rl(function(){c.apply(n,b)},f)}function Xa(c,f,b,M){var j=-1,Y=eu,J=!0,te=c.length,le=[],Me=f.length;if(!te)return le;b&&(f=Gt(f,zr(b))),M?(Y=yf,J=!1):f.length>=a&&(Y=go,J=!1,f=new Zi(f));e:for(;++jj?0:j+b),M=M===n||M>j?j:xt(M),M<0&&(M+=j),M=b>M?0:Db(M);b0&&b(te)?f>1?Pn(te,f-1,b,M,j):qo(j,te):M||(j[j.length]=te)}return j}var Kl=Kf(),Iu=Kf(!0);function ca(c,f){return c&&Kl(c,f,fr)}function ri(c,f){return c&&Iu(c,f,fr)}function Sr(c,f){return Go(f,function(b){return as(c[b])})}function Wr(c,f){f=So(f,c);for(var b=0,M=f.length;c!=null&&bf}function ai(c,f){return c!=null&&jt.call(c,f)}function jf(c,f){return c!=null&&f in Zt(c)}function Pp(c,f,b){return c>=tr(f,b)&&c=120&&Ne.length>=120)?new Zi(J&&Ne):n}Ne=c[0];var Pe=-1,Ve=te[0];e:for(;++Pe-1;)te!==c&&uu.call(te,le,1),uu.call(c,le,1);return c}function tc(c,f){for(var b=c?f.length:0,M=b-1;b--;){var j=f[b];if(b==M||j!==Y){var Y=j;ua(j)?uu.call(c,j,1):Qi(c,j)}}return c}function nc(c,f){return c+Ko(Zl()*(f-c+1))}function Uf(c,f,b,M){for(var j=-1,Y=En(Ui((f-c)/(b||1)),0),J=pe(Y);Y--;)J[M?Y:++j]=c,c+=b;return J}function Gs(c,f){var b="";if(!c||f<1||f>se)return b;do f%2&&(b+=c),f=Ko(f/2),f&&(c+=c);while(f);return b}function It(c,f){return Gu(Wu(c,f,pa),c+"")}function Ki(c){return Ka(md(c))}function cn(c,f){var b=md(c);return Gr(b,Do(f,0,b.length))}function un(c,f,b,M){if(!bn(c))return c;f=So(f,c);for(var j=-1,Y=f.length,J=Y-1,te=c;te!=null&&++jj?0:j+f),b=b>j?j:b,b<0&&(b+=j),j=f>b?0:b-f>>>0,f>>>=0;for(var Y=pe(j);++M>>1,J=c[Y];J!==null&&!La(J)&&(b?J<=f:J=a){var Me=f?null:Tr(c);if(Me)return Jo(Me);J=!1,j=go,le=new Zi}else le=f?[]:te;e:for(;++M=M?c:sr(c,f,b)}var Js=Tp||function(c){return sn.clearTimeout(c)};function Wf(c,f){if(f)return c.slice();var b=c.length,M=Mf?Mf(b):new c.constructor(b);return c.copy(M),M}function Ks(c){var f=new c.constructor(c.byteLength);return new Ul(f).set(new Ul(c)),f}function Ru(c,f){var b=f?Ks(c.buffer):c.buffer;return new c.constructor(b,c.byteOffset,c.byteLength)}function Hp(c){var f=new c.constructor(c.source,of.exec(c));return f.lastIndex=c.lastIndex,f}function $f(c){return Vr?Zt(Vr.call(c)):{}}function Gf(c,f){var b=f?Ks(c.buffer):c.buffer;return new c.constructor(b,c.byteOffset,c.length)}function qf(c,f){if(c!==f){var b=c!==n,M=c===null,j=c===c,Y=La(c),J=f!==n,te=f===null,le=f===f,Me=La(f);if(!te&&!Me&&!Y&&c>f||Y&&J&&le&&!te&&!Me||M&&J&&le||!b&&le||!j)return 1;if(!M&&!Y&&!Me&&c=te)return le;var Me=b[M];return le*(Me=="desc"?-1:1)}}return c.index-f.index}function Jf(c,f,b,M){for(var j=-1,Y=c.length,J=b.length,te=-1,le=f.length,Me=En(Y-J,0),Ne=pe(le+Me),Pe=!M;++te1?b[j-1]:n,J=j>2?b[2]:n;for(Y=c.length>3&&typeof Y=="function"?(j--,Y):n,J&&Bt(b[0],b[1],J)&&(Y=j<3?n:Y,j=1),f=Zt(f);++M-1?j[Y?f[J]:J]:n}}function Xi(c){return no(function(f){var b=f.length,M=b,j=nr.prototype.thru;for(c&&f.reverse();M--;){var Y=f[M];if(typeof Y!="function")throw new oa(s);if(j&&!J&&dc(Y)=="wrapper")var J=new nr([],!0)}for(M=J?M:b;++M1&&Ft.reverse(),Ne&&lete))return!1;var Me=Y.get(c),Ne=Y.get(f);if(Me&&Ne)return Me==f&&Ne==c;var Pe=-1,Ve=!0,ot=b&T?new Zi:n;for(Y.set(c,f),Y.set(f,c);++Pe1?"& ":"")+f[M],f=f.join(b>2?", ":" "),c.replace(Ia,`{ /* [wrapped with `+f+`] */ `)}function Zy(c){return Tt(c)||wc(c)||!!(Ip&&c&&c[Ip])}function ua(c,f){var b=typeof c;return f=f??se,!!f&&(b=="number"||b!="symbol"&&Wm.test(c))&&c>-1&&c%1==0&&c0){if(++f>=ae)return arguments[0]}else f=0;return c.apply(n,arguments)}}function Gr(c,f){var b=-1,M=c.length,j=M-1;for(f=f===n?M:f;++b1?c[f-1]:n;return b=typeof b=="function"?(c.pop(),b):n,bh(c,b)});function Jr(c){var f=B(c);return f.__chain__=!0,f}function Dh(c,f){return f(c),c}function nd(c,f){return f(c)}var yi=no(function(c){var f=c.length,b=f?c[0]:0,M=this.__wrapped__,j=function(Y){return Du(Y,c)};return f>1||this.__actions__.length||!(M instanceof St)||!ua(b)?this.thru(j):(M=M.slice(b,+b+(f?1:0)),M.__actions__.push({func:nd,args:[j],thisArg:n}),new nr(M,this.__chain__).thru(function(Y){return f&&!Y.length&&Y.push(n),Y}))});function rd(){return Jr(this)}function rs(){return new nr(this.value(),this.__chain__)}function ad(){this.__values__===n&&(this.__values__=bb(this.value()));var c=this.__index__>=this.__values__.length,f=c?n:this.__values__[this.__index__++];return{done:c,value:f}}function Sh(){return this}function Ih(c){for(var f,b=this;b instanceof qa;){var M=uh(b);M.__index__=0,M.__values__=n,f?j.__wrapped__=M:f=M;var j=M;b=b.__wrapped__}return j.__wrapped__=c,f}function t0(){var c=this.__wrapped__;if(c instanceof St){var f=c;return this.__actions__.length&&(f=new St(this)),f=f.reverse(),f.__actions__.push({func:nd,args:[dr],thisArg:n}),new nr(f,this.__chain__)}return this.thru(dr)}function Th(){return Vf(this.__wrapped__,this.__actions__)}var n0=oc(function(c,f,b){jt.call(c,b)?++c[b]:Qa(c,b,1)});function hg(c,f,b){var M=Tt(c)?vf:Na;return b&&Bt(c,f,b)&&(f=n),M(c,ct(f,3))}function mg(c,f){var b=Tt(c)?Go:Ji;return b(c,ct(f,3))}var od=Vp(ol),id=Vp(hi);function pg(c,f){return Pn(ud(c,f),1)}function Eh(c,f){return Pn(ud(c,f),Te)}function r0(c,f,b){return b=b===n?1:xt(b),Pn(ud(c,f),b)}function xh(c,f){var b=Tt(c)?er:eo;return b(c,ct(f,3))}function sd(c,f){var b=Tt(c)?Xc:Fp;return b(c,ct(f,3))}var ld=oc(function(c,f,b){jt.call(c,b)?c[b].push(f):Qa(c,b,[f])});function Ch(c,f,b,M){c=ha(c)?c:md(c),b=b&&!M?xt(b):0;var j=c.length;return b<0&&(b=En(j+b,0)),yg(c)?b<=j&&c.indexOf(f,b)>-1:!!j&&ks(c,f,b)>-1}var cd=It(function(c,f,b){var M=-1,j=typeof f=="function",Y=ha(c)?pe(c.length):[];return eo(c,function(J){Y[++M]=j?br(f,J,b):ii(J,f,b)}),Y}),gg=oc(function(c,f,b){Qa(c,b,f)});function ud(c,f){var b=Tt(c)?Gt:Bf;return b(c,ct(f,3))}function dd(c,f,b,M){return c==null?[]:(Tt(f)||(f=f==null?[]:[f]),b=M?n:b,Tt(b)||(b=b==null?[]:[b]),Nu(c,f,b))}var a0=oc(function(c,f,b){c[b?0:1].push(f)},function(){return[[],[]]});function yc(c,f,b){var M=Tt(c)?wf:dp,j=arguments.length<3;return M(c,ct(f,4),b,j,eo)}function o0(c,f,b){var M=Tt(c)?My:dp,j=arguments.length<3;return M(c,ct(f,4),b,j,Fp)}function fd(c,f){var b=Tt(c)?Go:Ji;return b(c,de(ct(f,3)))}function i(c){var f=Tt(c)?Ka:Ki;return f(c)}function l(c,f,b){(b?Bt(c,f,b):f===n)?f=1:f=xt(f);var M=Tt(c)?$i:cn;return M(c,f)}function h(c){var f=Tt(c)?Ap:rc;return f(c)}function v(c){if(c==null)return 0;if(ha(c))return yg(c)?Yi(c):c.length;var f=cr(c);return f==$e||f==At?c.size:Mu(c).length}function I(c,f,b){var M=Tt(c)?bf:Yy;return b&&Bt(c,f,b)&&(f=n),M(c,ct(f,3))}var C=It(function(c,f){if(c==null)return[];var b=f.length;return b>1&&Bt(c,f[0],f[1])?f=[]:b>2&&Bt(f[0],f[1],f[2])&&(f=[f[0]]),Nu(c,Pn(f,1),[])}),_=Kt||function(){return sn.Date.now()};function G(c,f){if(typeof f!="function")throw new oa(s);return c=xt(c),function(){if(--c<1)return f.apply(this,arguments)}}function ee(c,f,b){return f=b?n:f,f=c&&f==null?c.length:f,to(c,L,n,n,n,n,f)}function ye(c,f){var b;if(typeof f!="function")throw new oa(s);return c=xt(c),function(){return--c>0&&(b=f.apply(this,arguments)),c<=1&&(f=n),b}}var Fe=It(function(c,f,b){var M=E;if(b.length){var j=aa(b,ui(Fe));M|=H}return to(c,M,f,b,j)}),Le=It(function(c,f,b){var M=E|A;if(b.length){var j=aa(b,ui(Le));M|=H}return to(f,M,c,b,j)});function Oe(c,f,b){f=b?n:f;var M=to(c,R,n,n,n,n,n,f);return M.placeholder=Oe.placeholder,M}function qe(c,f,b){f=b?n:f;var M=to(c,F,n,n,n,n,n,f);return M.placeholder=qe.placeholder,M}function tt(c,f,b){var M,j,Y,J,te,le,Me=0,Ne=!1,Pe=!1,Ve=!0;if(typeof c!="function")throw new oa(s);f=ao(f)||0,bn(b)&&(Ne=!!b.leading,Pe="maxWait"in b,Y=Pe?En(ao(b.maxWait)||0,f):Y,Ve="trailing"in b?!!b.trailing:Ve);function ot(Yn){var No=M,is=j;return M=j=n,Me=Yn,J=c.apply(is,No),J}function gt(Yn){return Me=Yn,te=rl(Mt,f),Ne?ot(Yn):J}function Ct(Yn){var No=Yn-le,is=Yn-Me,Fb=f-No;return Pe?tr(Fb,Y-is):Fb}function vt(Yn){var No=Yn-le,is=Yn-Me;return le===n||No>=f||No<0||Pe&&is>=Y}function Mt(){var Yn=_();if(vt(Yn))return Ft(Yn);te=rl(Mt,Ct(Yn))}function Ft(Yn){return te=n,Ve&&M?ot(Yn):(M=j=n,J)}function Ra(){te!==n&&Js(te),Me=0,M=le=j=te=n}function Kr(){return te===n?J:Ft(_())}function _a(){var Yn=_(),No=vt(Yn);if(M=arguments,j=this,le=Yn,No){if(te===n)return gt(le);if(Pe)return Js(te),te=rl(Mt,f),ot(le)}return te===n&&(te=rl(Mt,f)),J}return _a.cancel=Ra,_a.flush=Kr,_a}var nt=It(function(c,f){return Pf(c,1,f)}),wn=It(function(c,f,b){return Pf(c,ao(f)||0,b)});function ue(c){return to(c,U)}function re(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new oa(s);var b=function(){var M=arguments,j=f?f.apply(this,M):M[0],Y=b.cache;if(Y.has(j))return Y.get(j);var J=c.apply(this,M);return b.cache=Y.set(j,J)||Y,J};return b.cache=new(re.Cache||ia),b}re.Cache=ia;function de(c){if(typeof c!="function")throw new oa(s);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}function He(c){return ye(2,c)}var at=_p(function(c,f){f=f.length==1&&Tt(f[0])?Gt(f[0],zr(ct())):Gt(Pn(f,1),zr(ct()));var b=f.length;return It(function(M){for(var j=-1,Y=tr(M.length,b);++j=f}),wc=Lf(function(){return arguments}())?Lf:function(c){return Cn(c)&&jt.call(c,"callee")&&!cu.call(c,"callee")},Tt=pe.isArray,jC=pf?zr(pf):Eu;function ha(c){return c!=null&&vg(c.length)&&!as(c)}function Bn(c){return Cn(c)&&ha(c)}function LC(c){return c===!0||c===!1||Cn(c)&&ir(c)==_e}var sl=kf||v0,RC=kr?zr(kr):jp;function _C(c){return Cn(c)&&c.nodeType===1&&!Mh(c)}function HC(c){if(c==null)return!0;if(ha(c)&&(Tt(c)||typeof c=="string"||typeof c.splice=="function"||sl(c)||hd(c)||wc(c)))return!c.length;var f=cr(c);if(f==$e||f==At)return!c.size;if(fc(c))return!Mu(c).length;for(var b in c)if(jt.call(c,b))return!1;return!0}function BC(c,f){return Zs(c,f)}function YC(c,f,b){b=typeof b=="function"?b:n;var M=b?b(c,f):n;return M===n?Zs(c,f,n,b):!!M}function s0(c){if(!Cn(c))return!1;var f=ir(c);return f==Se||f==Vt||typeof c.message=="string"&&typeof c.name=="string"&&!Mh(c)}function zC(c){return typeof c=="number"&&Ls(c)}function as(c){if(!bn(c))return!1;var f=ir(c);return f==Ue||f==Je||f==Be||f==$t}function gb(c){return typeof c=="number"&&c==xt(c)}function vg(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=se}function bn(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function Cn(c){return c!=null&&typeof c=="object"}var vb=Bi?zr(Bi):xu;function UC(c,f){return c===f||Cu(c,f,Zu(f))}function VC(c,f,b){return b=typeof b=="function"?b:n,Cu(c,f,Zu(f),b)}function ZC(c){return yb(c)&&c!=+c}function WC(c){if(Qp(c))throw new bt(o);return _f(c)}function $C(c){return c===null}function GC(c){return c==null}function yb(c){return typeof c=="number"||Cn(c)&&ir(c)==lt}function Mh(c){if(!Cn(c)||ir(c)!=Dt)return!1;var f=Ca(c);if(f===null)return!0;var b=jt.call(f,"constructor")&&f.constructor;return typeof b=="function"&&b instanceof b&&Bl.call(b)==su}var l0=Qc?zr(Qc):Lp;function qC(c){return gb(c)&&c>=-se&&c<=se}var wb=Ns?zr(Ns):Hf;function yg(c){return typeof c=="string"||!Tt(c)&&Cn(c)&&ir(c)==an}function La(c){return typeof c=="symbol"||Cn(c)&&ir(c)==Sn}var hd=ip?zr(ip):Ql;function JC(c){return c===n}function KC(c){return Cn(c)&&cr(c)==vr}function QC(c){return Cn(c)&&ir(c)==Sa}var XC=lc(si),eM=lc(function(c,f){return c<=f});function bb(c){if(!c)return[];if(ha(c))return yg(c)?Ur(c):Ir(c);if(wo&&c[wo])return Py(c[wo]());var f=cr(c),b=f==$e?ru:f==At?Jo:md;return b(c)}function os(c){if(!c)return c===0?c:0;if(c=ao(c),c===Te||c===-Te){var f=c<0?-1:1;return f*we}return c===c?c:0}function xt(c){var f=os(c),b=f%1;return f===f?b?f-b:f:0}function Db(c){return c?Do(xt(c),0,$):0}function ao(c){if(typeof c=="number")return c;if(La(c))return Z;if(bn(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=bn(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=fp(c);var b=yy.test(c);return b||Zm.test(c)?Jc(c.slice(2),b?2:8):Um.test(c)?Z:+c}function Sb(c){return Fa(c,ma(c))}function tM(c){return c?Do(xt(c),-se,se):c===0?c:0}function Wt(c){return c==null?"":mn(c)}var nM=Qs(function(c,f){if(fc(f)||ha(f)){Fa(f,fr(f),c);return}for(var b in f)jt.call(f,b)&&Gi(c,b,f[b])}),Ib=Qs(function(c,f){Fa(f,ma(f),c)}),wg=Qs(function(c,f,b,M){Fa(f,ma(f),c,M)}),rM=Qs(function(c,f,b,M){Fa(f,fr(f),c,M)}),aM=no(Du);function oM(c,f){var b=Ys(c);return f==null?b:Xt(b,f)}var iM=It(function(c,f){c=Zt(c);var b=-1,M=f.length,j=M>2?f[2]:n;for(j&&Bt(f[0],f[1],j)&&(M=1);++b1),Y}),Fa(c,cc(c),b),M&&(b=Pr(b,g|w|D,$p));for(var j=f.length;j--;)Qi(b,f[j]);return b});function TM(c,f){return Eb(c,de(ct(f)))}var EM=no(function(c,f){return c==null?{}:$s(c,f)});function Eb(c,f){if(c==null)return{};var b=Gt(cc(c),function(M){return[M]});return f=ct(f),Yf(c,b,function(M,j){return f(M,j[0])})}function xM(c,f,b){f=So(f,c);var M=-1,j=f.length;for(j||(j=1,c=n);++Mf){var M=c;c=f,f=M}if(b||c%1||f%1){var j=Zl();return tr(c+j*(f-c+hf("1e-"+((j+"").length-1))),f)}return nc(c,f)}var RM=To(function(c,f,b){return f=f.toLowerCase(),c+(b?Mb(f):f)});function Mb(c){return d0(Wt(c).toLowerCase())}function Nb(c){return c=Wt(c),c&&c.replace($m,pp).replace(np,"")}function _M(c,f,b){c=Wt(c),f=mn(f);var M=c.length;b=b===n?M:Do(xt(b),0,M);var j=b;return b-=f.length,b>=0&&c.slice(b,j)==f}function HM(c){return c=Wt(c),c&&ze.test(c)?c.replace(je,gp):c}function BM(c){return c=Wt(c),c&&ra.test(c)?c.replace(yr,"\\$&"):c}var YM=To(function(c,f,b){return c+(b?"-":"")+f.toLowerCase()}),zM=To(function(c,f,b){return c+(b?" ":"")+f.toLowerCase()}),UM=Qf("toLowerCase");function VM(c,f,b){c=Wt(c),f=xt(f);var M=f?Yi(c):0;if(!f||M>=f)return c;var j=(f-M)/2;return sc(Ko(j),b)+c+sc(Ui(j),b)}function ZM(c,f,b){c=Wt(c),f=xt(f);var M=f?Yi(c):0;return f&&M>>0,b?(c=Wt(c),c&&(typeof f=="string"||f!=null&&!l0(f))&&(f=mn(f),!f&&Os(c))?Io(Ur(c),0,b):c.split(f,b)):[]}var QM=To(function(c,f,b){return c+(b?" ":"")+d0(f)});function XM(c,f,b){return c=Wt(c),b=b==null?0:Do(xt(b),0,c.length),f=mn(f),c.slice(b,b+f.length)==f}function e3(c,f,b){var M=B.templateSettings;b&&Bt(c,f,b)&&(f=n),c=Wt(c),f=wg({},f,M,th);var j=wg({},f.imports,M.imports,th),Y=fr(j),J=_l(j,Y),te,le,Me=0,Ne=f.interpolate||zc,Pe="__p += '",Ve=Hl((f.escape||zc).source+"|"+Ne.source+"|"+(Ne===On?Li:zc).source+"|"+(f.evaluate||zc).source+"|$","g"),ot="//# sourceURL="+(jt.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ey+"]")+` `;c.replace(Ve,function(vt,Mt,Ft,Ra,Kr,_a){return Ft||(Ft=Ra),Pe+=c.slice(Me,_a).replace(wy,vp),Mt&&(te=!0,Pe+=`' + __e(`+Mt+`) + '`),Kr&&(le=!0,Pe+=`'; `+Kr+`; __p += '`),Ft&&(Pe+=`' + ((__t = (`+Ft+`)) == null ? '' : __t) + '`),Me=_a+vt.length,vt}),Pe+=`'; `;var gt=jt.call(f,"variable")&&f.variable;if(!gt)Pe=`with (obj) { `+Pe+` } `;else if(Uo.test(gt))throw new bt(u);Pe=(le?Pe.replace(V,""):Pe).replace(ne,"$1").replace(me,"$1;"),Pe="function("+(gt||"obj")+`) { `+(gt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(te?", __e = _.escape":"")+(le?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Pe+`return __p }`;var Ct=Ab(function(){return Pt(Y,ot+"return "+Pe).apply(n,J)});if(Ct.source=Pe,s0(Ct))throw Ct;return Ct}function t3(c){return Wt(c).toLowerCase()}function n3(c){return Wt(c).toUpperCase()}function r3(c,f,b){if(c=Wt(c),c&&(b||f===n))return fp(c);if(!c||!(f=mn(f)))return c;var M=Ur(c),j=Ur(f),Y=hp(M,j),J=Ef(M,j)+1;return Io(M,Y,J).join("")}function a3(c,f,b){if(c=Wt(c),c&&(b||f===n))return c.slice(0,ou(c)+1);if(!c||!(f=mn(f)))return c;var M=Ur(c),j=Ef(M,Ur(f))+1;return Io(M,0,j).join("")}function o3(c,f,b){if(c=Wt(c),c&&(b||f===n))return c.replace(kl,"");if(!c||!(f=mn(f)))return c;var M=Ur(c),j=hp(M,Ur(f));return Io(M,j).join("")}function i3(c,f){var b=W,M=K;if(bn(f)){var j="separator"in f?f.separator:j;b="length"in f?xt(f.length):b,M="omission"in f?mn(f.omission):M}c=Wt(c);var Y=c.length;if(Os(c)){var J=Ur(c);Y=J.length}if(b>=Y)return c;var te=b-Yi(M);if(te<1)return M;var le=J?Io(J,0,te).join(""):c.slice(0,te);if(j===n)return le+M;if(J&&(te+=le.length-te),l0(j)){if(c.slice(te).search(j)){var Me,Ne=le;for(j.global||(j=Hl(j.source,Wt(of.exec(j))+"g")),j.lastIndex=0;Me=j.exec(Ne);)var Pe=Me.index;le=le.slice(0,Pe===n?te:Pe)}}else if(c.indexOf(mn(j),te)!=te){var Ve=le.lastIndexOf(j);Ve>-1&&(le=le.slice(0,Ve))}return le+M}function s3(c){return c=Wt(c),c&&Ye.test(c)?c.replace(Ce,yp):c}var l3=To(function(c,f,b){return c+(b?" ":"")+f.toUpperCase()}),d0=Qf("toUpperCase");function kb(c,f,b){return c=Wt(c),f=b?n:f,f===n?Fy(c)?Ry(c):ky(c):c.match(f)||[]}var Ab=It(function(c,f){try{return br(c,n,f)}catch(b){return s0(b)?b:new bt(b)}}),c3=no(function(c,f){return er(f,function(b){b=Pa(b),Qa(c,b,Fe(c[b],c))}),c});function u3(c){var f=c==null?0:c.length,b=ct();return c=f?Gt(c,function(M){if(typeof M[1]!="function")throw new oa(s);return[b(M[0]),M[1]]}):[],It(function(M){for(var j=-1;++jse)return[];var b=$,M=tr(c,$);f=ct(f),c-=$;for(var j=Tf(M,f);++b0||f<0)?new St(b):(c<0?b=b.takeRight(-c):c&&(b=b.drop(c)),f!==n&&(f=xt(f),b=f<0?b.dropRight(-f):b.take(f-c)),b)},St.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},St.prototype.toArray=function(){return this.take($)},ca(St.prototype,function(c,f){var b=/^(?:filter|find|map|reject)|While$/.test(f),M=/^(?:head|last)$/.test(f),j=B[M?"take"+(f=="last"?"Right":""):f],Y=M||/^find/.test(f);j&&(B.prototype[f]=function(){var J=this.__wrapped__,te=M?[1]:arguments,le=J instanceof St,Me=te[0],Ne=le||Tt(J),Pe=function(Mt){var Ft=j.apply(B,qo([Mt],te));return M&&Ve?Ft[0]:Ft};Ne&&b&&typeof Me=="function"&&Me.length!=1&&(le=Ne=!1);var Ve=this.__chain__,ot=!!this.__actions__.length,gt=Y&&!Ve,Ct=le&&!ot;if(!Y&&Ne){J=Ct?J:new St(this);var vt=c.apply(J,te);return vt.__actions__.push({func:nd,args:[Pe],thisArg:n}),new nr(vt,Ve)}return gt&&Ct?c.apply(this,te):(vt=this.thru(Pe),gt?M?vt.value()[0]:vt.value():vt)})}),er(["pop","push","shift","sort","splice","unshift"],function(c){var f=vo[c],b=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",M=/^(?:pop|shift)$/.test(c);B.prototype[c]=function(){var j=arguments;if(M&&!this.__chain__){var Y=this.value();return f.apply(Tt(Y)?Y:[],j)}return this[b](function(J){return f.apply(Tt(J)?J:[],j)})}}),ca(St.prototype,function(c,f){var b=B[f];if(b){var M=b.name+"";jt.call(Hs,M)||(Hs[M]=[]),Hs[M].push({name:f,func:b})}}),Hs[Xs(n,A).name]=[{name:"wrapper",func:n}],St.prototype.clone=gu,St.prototype.reverse=Of,St.prototype.value=zs,B.prototype.at=yi,B.prototype.chain=rd,B.prototype.commit=rs,B.prototype.next=ad,B.prototype.plant=Ih,B.prototype.reverse=t0,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=Th,B.prototype.first=B.prototype.head,wo&&(B.prototype[wo]=Sh),B},Fs=_y();Wa?((Wa.exports=Fs)._=Fs,Rl._=Fs):sn._=Fs}).call(Jn)})(nv,nv.exports);var EI=nv.exports;function bg(e){const t=e.match(/^#+/);return t?t[0].length:0}function CN(e,t){const n=e.split(` `);let r="",a=[],o=!1,s=1;for(let u=0;ubg(t)?a.push(d):(o=!1,a=[])}else o&&a.push(d)}return t?EI.isEmpty(a)?{content:"",startLine:-1}:{content:a.join(` `),startLine:s}:{content:e,startLine:0}}function MN(e){const t=e.split(/\r?\n/),n=[];for(let r=0;r [!thino]")?(r&&(n.push({metadata:o,content:a.join(` `).trim()}),a=[]),r=!0,o=u.replace("> [!thino]","").trim()):r&&u.startsWith(">")?a.push(u.replace(/^> /,"")):r&&!u.startsWith(">")&&(r=!1,n.push({metadata:o,content:a.join(` `).trim()}),a=[],o="")}return r&&n.push({metadata:o,content:a.join(` `).trim()}),n}const FN=e=>{let t;switch(e){case" ":t="TASK-TODO";break;case"x":case"X":t="TASK-DONE";break;default:t="TASK-"+e;break}return t};async function PN(e,t){if(!t)return 0;const{vault:n}=Ee.getState().dailyNotesState.app,r=e==null?void 0:e.DefaultMemoComposition,a=(e==null?void 0:e.ProcessEntriesBelow)||"";let o;try{o=await n.read(t)}catch(g){console.error(g),o=await n.cachedRead(t)}let s;r!=""&&/{TIME}/g.test(r)&&/{CONTENT}/g.test(r)?s="(-|\\*) (\\[(.{1})\\]\\s)?"+r.replace(/{TIME}/g,"((\\)?\\d{1,2}:\\d{2}(\\:\\d{2})?)?").replace(/ {CONTENT}/g,""):s="(-|\\*) (\\[(.{1})\\]\\s)?((\\)?\\d{1,2}\\:\\d{2}(\\:\\d{2})?)?";const u=new RegExp(s,"g"),d=(o.match(u)||[]).length,m=new RegExp(a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g"),p=(o.match(m)||[]).length;return o=null,p?d:0}function jN(e){return e.replace(/^(-|\*|\d\.) (\d{1,2}:\d{2}(:\d{2})?)\s(.*)$/g,"$4")}function LN(e,t){return RN(e,t)}const RN=(e,t)=>{var a;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*[\\-\\*]\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\)?((\\d{1,2})\\:(\\d{2}))?(\\<\\/time\\>)?").replace(/{CONTENT}/g,"(.*)$"):n="^\\s*[\\-\\*]\\s(\\[(.{1})\\]\\s?)?(\\)?((\\d{1,2})\\:(\\d{2}))?(\\<\\/time\\>)?\\s?(.*)$",(a=new RegExp(n,"").exec(t))==null?void 0:a[8]},_N=(e,t)=>{var a;let n;e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)$"):n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\)?(\\d{1,2})\\:(\\d{2})(.*)$";const r=new RegExp(n,"");return t.includes("42:22"),(a=r.exec(t))==null?void 0:a[6]},HN=(e,t)=>{var a;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)$"):n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\)?(\\d{1,2})\\:(\\d{2})(.*)$",(a=new RegExp(n,"").exec(t))==null?void 0:a[7]},BN=e=>{var r;const t="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\d{1,2})\\:(\\d{2})\\:(\\d{2})(.*)$";return(r=new RegExp(t,"").exec(e))==null?void 0:r[7]},YN=e=>{var t;return(t=/^\s*[\-\*]\s(\[(.{1})\])\s(.*)$/.exec(e))==null?void 0:t[2]},xI=()=>vI()?!0:(new x.Notice(k("Check if you opened Daily Notes Plugin Or Periodic Notes Plugin")),!1);async function CI(e,t){if(!e)return t;const n=Ee.getState().dailyNotesState.app,r=await kN(e,n);if(!r.trim())return t;let a=x.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss");await n.fileManager.processFrontMatter(e,o=>{if(!o)return t;const s=!!o.pinned,u=o.rowStatus&&o.rowStatus==="ARCHIVED",d=!!o.deletedAt;o.createdAt&&(a=x.moment(o.createdAt,"YYYY/MM/DD HH:mm:ss").isValid()?o.createdAt:a);const m=o.deletedAt?o.deletedAt:"",p=o.visibility?o.visibility:"PRIVATE",g=o.thinoType?o.thinoType:"JOURNAL",w=o.webId?o.webId:"";o.id||(o.id=Re.randomId(16));const D=o.id?o.id:"",S=o.hasId?o.hasId:"",T=o.linkId?o.linkId:"",E=e.path,A="Memo",N="MULTI",R=[];return t.push({id:D,content:r,createdAt:a,updatedAt:a,deletedAt:d?x.moment(m,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:s,rowStatus:u?"ARCHIVED":"NORMAL",visibility:p,thinoType:g,hasId:S,linkId:T,path:E,creatorName:A,sourceType:N,resourceList:R,webId:w}),t})}async function mw(e,t){var D,S,T,E,A,N;if(!e)return t;const{vault:n}=Ee.getState().dailyNotesState.app;let r;try{r=await n.read(e)}catch(R){console.error(R),r=await n.cachedRead(e)}if(!r)return;const a=x.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss"),o=x.moment(e.stat.mtime).format("YYYY/MM/DD HH:mm:ss"),s=e.path,u="Thino",d="FILE",m="",p="",g=[],w=await AN(r);for(const R of w){const F=ON(R.content);for(const H of F){const P=H.metadata.match(/\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}/g);if(!P)continue;const L=(S=(D=H.metadata.match(/id::([^\]]*)/g))==null?void 0:D[0])==null?void 0:S.replace("id::","");if(!L)continue;const z=P?P[0]:a,U=P?P[0]:o,W=H.metadata.match(/webId::([^\]]*)/g)?(E=(T=H.metadata.match(/webId::([^\]]*)/g))==null?void 0:T[0])==null?void 0:E.replace("webId::",""):"",K=H.metadata.contains("[pinned::true]"),ae=H.metadata.contains("[archived::true]"),ce=H.metadata.contains("[deleted::"),fe=(A=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(H.metadata))==null?void 0:A[2],ie=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(H.metadata)?"PUBLIC":"PRIVATE",ge=(N=new RegExp(/\[(thinoType|THINOTYPE)::([^\]]*)\]/,"g").exec(H.metadata))==null?void 0:N[2];t.push({id:L,content:H.content,createdAt:z,updatedAt:U,deletedAt:ce?x.moment(fe,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:K,rowStatus:ae?"ARCHIVED":"NORMAL",visibility:ie,thinoType:ge||"JOURNAL",hasId:m,linkId:p,path:s,creatorName:u,sourceType:d,resourceList:g,webId:W})}}return t}async function pw(e,t){var g,w,D;if(!e)return[];const n=Ee.getState().dailyNotesState.settings,{vault:r}=Ee.getState().dailyNotesState.app;if(await PN(n,e)===0)return;const o=Zh(e,"day");let s,u;try{u=await r.read(e)}catch(S){console.error(S),u=await r.cachedRead(e)}const{content:d,startLine:m}=CN(u,n.ProcessEntriesBelow),p=MN(d);for(const S of p){const T=_N(n.DefaultMemoComposition,S.line),E=HN(n.DefaultMemoComposition,S.line),A=BN(S.line);let N=jN(S.line);if(o.hours(parseInt(T)),o.minutes(parseInt(E)),A&&o.seconds(parseInt(A)),!A&&o.seconds(0),/^\s*[-*]\s(\[(.)\])\s/g.test(S.line)){const K=YN(S.line);N=LN(n.DefaultMemoComposition,S.line),s=FN(K)}else s="JOURNAL";let R=N.replaceAll(/
/g,` `);const F=new RegExp(/\[(pinned|PINNED)::true\]/,"g").test(N),H=new RegExp(/\[(archived|ARCHIVED)::true\]/,"g").test(N),P=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").test(N),L=(g=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(N))==null?void 0:g[2],z=(w=new RegExp(/\[(webId|WEBID)::([^\]]*)\]/,"g").exec(N))==null?void 0:w[2],U=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(N)?"PUBLIC":"PRIVATE",W=(D=new RegExp(/\s\^([0-9a-zA-Z-]+)$/).exec(N))==null?void 0:D[1];R=R.replace(/\s\[pinned::[^\]]+\]/g,"").replace(/\s\[visibility::[^\]]+\]/g,"").replace(/\s\[archived::[^\]]+\]/g,"").replace(/\s\[deleted::[^\]]+\]/g,"").replace(/\s\[webId::[^\]]+\]/g,"").replace(/\s\^([0-9a-zA-Z-]+)$/g,""),t.push({id:o.format("YYYYMMDDHHmmss")+`${S.index+m-1}`,content:R,createdAt:o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:o.format("YYYY/MM/DD HH:mm:ss"),thinoType:s,hasId:W||"",linkId:"",path:e.path,deletedAt:P?x.moment(L,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",rowStatus:H?"ARCHIVED":"NORMAL",visibility:U,pinned:F,creatorName:"Memo",resourceList:[],sourceType:"DAILY",webId:z})}}async function gw(e,t){const{app:n}=Ee.getState().dailyNotesState;if(!(e instanceof x.TFile))return;let r;try{r=await n.vault.read(e)}catch(s){console.error(s),r=await n.vault.cachedRead(e)}if(!r)return;const a=JSON.parse(r),o=a==null?void 0:a.nodes;for(const s of o){if(s.type==="group"||s.createdAt===void 0||s.text.trim()==="")continue;const u=x.moment(s==null?void 0:s.createdAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),d=x.moment(s==null?void 0:s.updatedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),m=s!=null&&s.deletedAt?x.moment(s==null?void 0:s.deletedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",p=!!(s!=null&&s.pinned),g=s!=null&&s.archived?"ARCHIVED":"NORMAL",w=s!=null&&s.visibility?s==null?void 0:s.visibility:"PRIVATE",D=s!=null&&s.thinoType?s==null?void 0:s.thinoType:"JOURNAL",S=s!=null&&s.text?s==null?void 0:s.text:"",T=s!=null&&s.id?s==null?void 0:s.id:"",E=s!=null&&s.hasId?s==null?void 0:s.hasId:"",A=s!=null&&s.linkId?s==null?void 0:s.linkId:"",N=e.path,R="Memo",F="CANVAS",H=[],P=s!=null&&s.webId?s==null?void 0:s.webId:void 0;t.push({id:T,content:S,createdAt:u,updatedAt:d,deletedAt:m,pinned:p,rowStatus:g,visibility:w,thinoType:D,hasId:E,linkId:A,path:N,creatorName:R,sourceType:F,resourceList:H,webId:P})}}async function Bb(e=[]){const t=[],n=[],r=Ee.getState().dailyNotesState.app,{vault:a}=r,{settings:o}=Ee.getState().dailyNotesState,s=r.loadLocalStorage("tokenForSync"),u=async(d,m)=>{for(const p of d)try{await m(p,t)}catch(g){console.error(g),new x.Notice(g)}};if(e.includes("CANVAS")){const d=zN(a);await u(d,gw)}if(e.includes("MULTI")){const d=UN(a,o);await u(d,CI)}if(e.includes("DAILY")){const d=await VN(a);await u(d,pw)}if(e.includes("FILE")||s){const d=ZN(a);await u(d,mw)}return{memos:t,commentMemos:n}}function zN(e){return e.getAllLoadedFiles().filter(t=>t instanceof x.TFile&&t.extension==="canvas"&&t.name.includes(".thino"))}function UN(e,t){return e.getMarkdownFiles().filter(n=>{var r;return n instanceof x.TFile&&((r=n.parent)==null?void 0:r.path.includes(t.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim()))})}async function VN(e){const t=DI();t===void 0&&new x.Notice(k("Please check your daily note plugin OR periodic notes plugin settings")+"folder path is empty or undefined"),e.getAbstractFileByPath(x.normalizePath(t))||new x.Notice(k("Failed to find daily notes folder"));const r=ws();return Object.values(r).filter(a=>a instanceof x.TFile&&a.extension==="md")}function ZN(e){return e.getMarkdownFiles().filter(t=>t instanceof x.TFile&&t.name.trim().includes("thino"))}const WN=async(e,t,n)=>{const r=await Bd(Ee.getState().dailyNotesState.app)||[],a=r.find(u=>u.id===e),o={...a,title:t,querystring:n},s=r.findIndex(u=>u.id===e);return r[s]=o,await bm(Ee.getState().dailyNotesState.app,r),[a]};function $N(e){return(e==null?void 0:e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"))||e}function GN(e){const t=[];let n=e;for(;n.contains(` `);){const r=n.indexOf(` `);t.push(n.slice(0,r)),n=n.slice(r+1)}return t.push(n),t}async function qN({content:e,isList:t}){const n=Ee.getState().dailyNotesState.settings,r=x.moment(),a=Re.randomId(16),o=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",s=`${o}/${r.format("YYYYMMDD")}-${a}.md`,u={id:a,content:e,deletedAt:"",path:s,createdAt:r.format("YYYY/MM/DD HH:mm:ss"),updatedAt:r.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"MULTI"},d=rt.getState().app,{vault:m,fileManager:p}=d,g=m.getAbstractFileByPath(o);(!g||!(g instanceof x.TFolder))&&(new x.Notice(k("Folder not found for the given thino path, is creating a new folder")),await m.createFolder(o)),Qe.setChangedByMemos(!0);const w=await m.create(s,e);return await p.processFrontMatter(w,D=>{D.id=a,D.createdAt=r.format("YYYY/MM/DD HH:mm:ss"),D.updatedAt=r.format("YYYY/MM/DD HH:mm:ss"),D.thinoType=t?"JOURNAL":"TASK-TODO",D.pinned=!1,D.visibility="PUBLIC",D.rowStatus="NORMAL"}),u}async function JN({content:e,isList:t}){const n=Ee.getState().dailyNotesState.settings,r=x.moment(),a=Re.randomId(16),o=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",s={id:a,content:e,deletedAt:"",path:o,createdAt:r.format("YYYY/MM/DD HH:mm:ss"),updatedAt:r.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE"},u=rt.getState().app,{vault:d}=u;let m=d.getAbstractFileByPath(o);(!m||!(m instanceof x.TFile))&&(new x.Notice(k("File not found for the given thino path, is creating a new file")),m=await d.create(o,""));let p="";try{p=await d.read(m)||await d.cachedRead(m)}catch(A){console.error(A),new x.Notice(k("Failed to read current daily note, check if it exists."))}const g=p.indexOf(`# ${r.format("YYYY-MM-DD")}`);let w=p.indexOf(` #`,g+1);w===-1&&(w=p.length);const D=`> [!thino] ${r.format("YYYY/MM/DD HH:mm:ss")} %% [id::${a}] [thinoType::${t?"JOURNAL":"TASK-TODO"}] %%`,S=e.replace(/\n/g,` > `),T=` ${D} > ${S} `;let E;if(g===-1){const A=`# ${r.format("YYYY-MM-DD")}`;E=`${p.substring(0,w)} ${A}${T} ${p.substring(w)}`}else E=`${p.substring(0,w)}${T}${p.substring(w)}`;return setTimeout(async()=>{Qe.setChangedByMemos(!0),await d.modify(m,E)},200),s}async function Yb(e){const t=Ee.getState().dailyNotesState.settings,n=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),r=e.id,a=(t==null?void 0:t.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",o={id:r,content:e.content,deletedAt:e.deletedAt||"",path:a,createdAt:n.format("YYYY/MM/DD HH:mm:ss"),updatedAt:n.format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",hasId:"",linkId:"",pinned:e.pinned,visibility:"PUBLIC",rowStatus:e.rowStatus||"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE",webId:e.id},s=rt.getState().app,{vault:u}=s;let d=u.getAbstractFileByPath(a);(!d||!(d instanceof x.TFile))&&(new x.Notice(k("File not found for the given thino path, is creating a new file")),d=await u.create(a,""));let m="";try{m=await u.read(d)||await u.cachedRead(d)}catch(E){console.error(E),new x.Notice(k("Failed to read current daily note, check if it exists."))}const p=m.indexOf(`# ${n.format("YYYY-MM-DD")}`);let g=m.indexOf(` #`,p+1);g===-1&&(g=m.length);const w=`> [!thino] ${n.format("YYYY/MM/DD HH:mm:ss")} %% [id::${r}] [thinoType::JOURNAL]${e.rowStatus==="ARCHIVED"?" [archived::true]":""}${e.pinned===!0?" [pinned::true]":""}${e.deletedAt?` [deleted::${e.deletedAt}]`:""}${e.id?` [webId::${e.id}]`:""} %%`,D=e.content.replace(/\n/g,` > `),S=` ${w} > ${D} `;let T;if(p===-1){const E=`# ${n.format("YYYY-MM-DD")}`;T=`${m.substring(0,g)} ${E}${S} ${m.substring(g)}`}else T=`${m.substring(0,g)}${S}${m.substring(g)}`;return Qe.setChangedByMemos(!0),await u.modify(d,T),o}async function KN({content:e,isList:t}){const n=Ee.getState().dailyNotesState.settings,r=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultCanvasPath)||"basic.thino.canvas",a=x.moment(),o=Re.randomId(16),s={id:o,content:e,deletedAt:"",path:r,createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"CANVAS"},u=rt.getState().app,{vault:d}=u,m=await NN(r,u);if(!m||!(m instanceof x.TFile)){new x.Notice(k("File not found for the given thino path, is creating a new file"));return}const p=await d.read(m),g=JSON.parse(p);if(g.nodes.find(E=>E.id===s.id))return;let D;g.nodes.length>0&&(D=[...g.nodes].reduce((E,A)=>{if(!E.createdAt)return A;const N=x.moment(E.createdAt,"YYYY/MM/DD HH:mm:ss"),R=x.moment(A.createdAt,"YYYY/MM/DD HH:mm:ss");return N.isAfter(R)?E:A}));const S=D?{x:D.x,y:D.y+100,width:D.width,height:D.height}:{x:0,y:0,width:200,height:100};g.nodes.push({...S,type:"text",id:o,text:e,deletedAt:"",createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[]}),Qe.setChangedByMemos(!0);const T=JSON.stringify(g,null,2);return await d.modify(m,T),s}async function zb(e,t,n){var N;const{vault:r}=Ee.getState().dailyNotesState.app||app,a=Ee.getState().dailyNotesState.settings,o=e.replace(/\n/g,"
"),s=n||x.moment(),u=s.format("HH"),d=s.format("mm"),m=`${u}:${d}`,p=t?"- ":"- [ ] ",g=a!=null&&a.DefaultMemoComposition?`${p}${(N=a==null?void 0:a.DefaultMemoComposition)==null?void 0:N.replace(/{TIME}/g,m).replace(/{CONTENT}/g,o)}`:`${p}${m} ${o}`,w=ws(),D=kv(s,w);let S;if(D?S=D:S=await Re.createDailyNoteCheck(s),!S){new x.Notice(k("Failed to create daily note, check if it exists."));return}D||await rt.fechLocalDailyNotes();let T="";try{T=await r.read(S)||await r.cachedRead(S)}catch(R){console.error(R),new x.Notice(k("Failed to read current daily note, check if it exists."))}const E=await MI(a==null?void 0:a.InsertAfter,g,T);n?await r.modify(S,E.content):setTimeout(async()=>{await r.modify(S,E.content)},200);const A=E.posNum===-1?NI(E.content).length-1:E.posNum+1;return Qe.setChangedByMemos(!0),{id:s.format("YYYYMMDDHHmm")+"00"+A,content:e,deletedAt:"",createdAt:s.format("YYYY/MM/DD HH:mm:ss"),updatedAt:s.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",path:S.path,hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"DAILY"}}async function QN(e){const{vault:t}=Ee.getState().dailyNotesState.app??app,{DefaultMemoComposition:n,InsertAfter:r}=Ee.getState().dailyNotesState.settings;let a=(e.pinned?" [pinned::true]":"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.visibility==="PRIVATE"?' [visibility::"PRIVATE"]':"");if(e.id){const R=" [webId::"+e.id+"]";a+=R}const o=x.moment();if(e.deletedAt){const R=" [deleted::"+o.format("YYYYMMDDHHmmss")+"]";a+=R}const s=e.content.replace(/\n/g,"
")+a,u=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),d=u.format("HH"),m=u.format("mm"),p=`${d}:${m}`,g=e.thinoType?"- [ ] ":"- ",w=n?`${g}${n==null?void 0:n.replace(/{TIME}/g,p).replace(/{CONTENT}/g,s)}`:`${g}${p} ${s}`,D=ws(),S=kv(u,D);let T;if(S?T=S:T=await Re.createDailyNoteCheck(u),!T){new x.Notice(k("Failed to create daily note, check if it exists."));return}S||await rt.fechLocalDailyNotes();let E="";try{E=await t.read(T)||await t.cachedRead(T)}catch(R){console.error(R),new x.Notice(k("Failed to read current daily note, check if it exists."))}const A=await MI(r,w,E);await t.modify(T,A.content);const N=A.posNum===-1?NI(A.content).length-1:A.posNum+1;return Qe.setChangedByMemos(!0),{id:u.format("YYYYMMDDHHmm")+"00"+N,content:e.content,deletedAt:e.deletedAt??"",createdAt:u.format("YYYY/MM/DD HH:mm:ss"),updatedAt:u.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType??"JOURNAL",path:T.path,hasId:"",linkId:"",pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY"}}async function MI(e,t,n){const r=new RegExp(`s*${await $N(e)}s*`),a=GN(n),o=a.findIndex(m=>r.test(m)),s=(e==null?void 0:e.trim())===""?!0:o===-1;s&&console.error("unable to find insert after line in file.");const u=a.slice(o+1).findIndex(m=>/^#+ |---/.test(m)),d=u!==-1;if(d){let m;for(let p=u+o;p>o;p--)if(!/^[\s\n ]*$/.test(a[p])){m=p;break}return m||(m=o),await Ub(t,n,s?-1:m,d)}else return await Ub(t,n,a.length-1,d)}async function Ub(e,t,n,r){if(n<-1)throw new Error("Invalid position");if(n===-1)return{content:`${t} ${e}`,posNum:-1};const a=t.split(` `),o=a.slice(0,n+1).join(` `),s=a.slice(n+1).join(` `),u=s.trim().length>0;return{content:`${o}${!u&&!r||!o.endsWith(` `)?` `:""}${e}${(u||r?` `:"")+s}`,posNum:n}}const NI=e=>e.split(/\r?\n/);async function XN(e){const t=Ee.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof x.TFile)){new x.Notice(k("File not found for the given thino path"));return}await t.vault.delete(n)}async function ek(e){const t=Ee.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof x.TFile)){new x.Notice(k("File not found for the given thino path"));return}const a=(await t.vault.read(n)).split(` `),o=a.findIndex(d=>d.includes(e.id));if(o===-1){new x.Notice(k("Thino not found"));return}const s=a.findIndex((d,m)=>m>o&&d.trim()==="");s===-1?a.splice(o,a.length-o):a.splice(o,s-o);const u=a.join(` `);if(!u){new x.Notice(k("Thino not found"));return}Qe.setChangedByMemos(!0),await t.vault.modify(n,u)}async function tk(e){const t=Ee.getState().dailyNotesState.app,n=t.metadataCache.getFirstLinkpathDest("",e.path);if(!n){new x.Notice(k("File not found for the given thino path"));return}const r=await t.vault.read(n),a=JSON.parse(r),o=a.nodes,s=o.findIndex(p=>p.id===e.id);if(s===-1){new x.Notice(k("Thino not found"));return}o.splice(s,1);const u=a.edges;u.filter(p=>p.fromNode===e.id||p.toNode===e.id).forEach(p=>{const g=u.findIndex(w=>w.id===p.id);g!==-1&&u.splice(g,1)}),Qe.setChangedByMemos(!0);const m=JSON.stringify(a,null,2);await t.vault.modify(n,m)}async function nk(e){xI()||new x.Notice(k("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."),5e3);const{vault:t}=Ee.getState().dailyNotesState.app,n=e.id.toString().slice(0,14),r=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(x.moment(n,"YYYYMMDDHHmmss"))?x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):x.moment(n,"YYYYMMDDHHmmss"),a=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(r,"day"),o=e.path,s=t.getAbstractFileByPath(o);if(!s){new x.Notice(k("Please check your daily note plugin OR periodic notes plugin settings"));return}const u=await t.read(s),d=u.split(` `),m=a?x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm"):(parseInt(e.id.toString().slice(10,12))+24).toString()+":"+e.id.toString().slice(12,14),p=d.findIndex(S=>S.includes(e.content.replace(/\n/g,"
").trim())&&S.includes(m)),g=parseInt(e.id.slice(14));let w=p;p===-1&&(w=g-1);const D=d[p]||d[g-1];if(!u){new x.Notice(k("Thino not found"));return}if(D===d[w]){Qe.setChangedByMemos(!0),d.splice(w,1),await t.modify(s,d.join(` `));return}}async function rk(){const{vault:e,metadataCache:t}=Ee.getState().dailyNotesState.app,n=Ee.getState().dailyNotesState.settings,a=DI()+"/"+n.DeleteFileName+".md",o=[],s=t.getFirstLinkpathDest("",a);if(s instanceof x.TFile){let u=await e.read(s),d=ak(u);if(d.length===0)return o;for(let m=0;me.split(/\r?\n/),ok=e=>{var t;return(t=/^- (\d{14})(\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[1]},ik=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[2]},sk=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[4]};async function lk(e){const t=await Bd(Ee.getState().dailyNotesState.app)||[],n=t.findIndex(r=>r.id===e);t.splice(n,1),await bm(Ee.getState().dailyNotesState.app,t)}const ck=async e=>{const{app:t}=Ee.getState().dailyNotesState,n=await Bd(t)||[],r=n.find(a=>a.id===e);if(r){const a=x.moment().format("YYYY/MM/DD HH:mm:ss");return r.pinnedAt=a,await bm(t,n),a}else{new x.Notice(k("Query not found"));return}},uk=async e=>{const{app:t}=Ee.getState().dailyNotesState,n=await Bd(t)||[],r=n.find(a=>a.id===e);if(r){r.pinnedAt="",await bm(t,n);return}else{new x.Notice(k("Query not found"));return}};function dk(e,t){const n=/%%(.*?)%%/,r=e.match(n);if(!r)return e;const a=r[1].trim(),o={};a.split(" ").forEach(u=>{const[d,m]=u.slice(1,-1).split("::");o[d]=m});for(const u of Object.keys(t))if(u!=="id"&&u!=="content"){if(u==="rowStatus"&&t.rowStatus==="ARCHIVED"){o.archived="true";continue}else if(u==="rowStatus"&&t.rowStatus==="NORMAL"){delete o.archived;continue}if(u==="deleted"&&t.deleted){const d=x.moment().format("YYYYMMDDHHmmss");o.deleted=d}else typeof t[u]=="boolean"?t[u]?o[u]="true":delete o[u]:t[u]&&(o[u]=t[u])}const s=Object.entries(o).map(([u,d])=>`[${u}::${d}]`).join(" ");return e.replace(n,`%% ${s} %%`)}async function Po(e,t){if(!e.sourceType||e.sourceType!=="MULTI")return e;const{vault:n,fileManager:r}=Ee.getState().dailyNotesState.app,a=n.getAbstractFileByPath(e.path);if(!a)return e;const o=x.moment();if(await r.processFrontMatter(a,s=>{(t.pinned||t.thinoType||t.rowStatus||t.visibility||t.deleted)&&Qe.setChangedByMemos(!0),t.id&&(s.id=t.id),t.thinoType&&(s.thinoType=t.thinoType),t.rowStatus&&(s.rowStatus=t.rowStatus),t.visibility&&(s.visibility=t.visibility),t.webId&&(s.webId=t.webId),t.pinned!==void 0&&(s.pinned=t.pinned),t.deleted!==void 0&&(s.deletedAt=t.deleted?o.format("YYYY/MM/DD HH:mm:ss"):""),s.createdAt||(s.createdAt=o.format("YYYY/MM/DD HH:mm:ss")),s.updatedAt=o.format("YYYY/MM/DD HH:mm:ss")}),t.content){const s=await n.read(a);let u=s;const d=t.content.replace(/\$/g,"$$$$");u=s.replace(e.content,d),await n.modify(a,u)}return Qe.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:e.updatedAt,content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned||e.pinned,webId:t.webId||e.webId,deletedAt:t.deleted?o.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Si(e,t){if(!e.sourceType||e.sourceType!=="FILE")return e;const{vault:n}=Ee.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const a=x.moment();let o="";try{o=await n.read(r)}catch(A){console.error(A),o=await n.cachedRead(r)}const s=o.split(/\r?\n/),u=s.findIndex(A=>A.includes(e.id)||e.webId&&A.includes(e.webId)),d=s[u];if(!d)return e;const m=dk(d,t);if(!d)return e;const p=m+` `,g=s.findIndex((A,N)=>N>u&&A.trim()==="");let w="";g===-1&&(w=s.slice(u+1).join(` `)),g!==-1&&(w=s.slice(u+1,g).join(` `));let D=w;t!=null&&t.content&&(D=t.content.split(/\r?\n/).map(F=>"> "+F).join(` `));const T=(p+D).split(/\r?\n/);s.splice(u,g?g-u:s.length-u,...T);const E=s.join(` `);return await n.modify(r,E),Qe.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:e.updatedAt,content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned||e.pinned,webId:t.webId||e.webId,deletedAt:t.deleted?a.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Ii(e,t){if(!e.sourceType||e.sourceType!=="CANVAS")return e;const{vault:n}=Ee.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const a=await n.read(r),o=JSON.parse(a),s=o.nodes.find(m=>m.id===e.id);if(!s)return e;t.content&&(s.text=t.content),t.thinoType&&(s.thinoType=t.thinoType),t.rowStatus&&(s.rowStatus=t.rowStatus),t.visibility&&(s.visibility=t.visibility),t.pinned!==void 0&&(s.pinned=t.pinned),t.webId&&(s.webId=t.webId);const u=x.moment();t.deleted!==void 0&&(s.deletedAt=t.deleted?u.format("YYYY/MM/DD HH:mm:ss"):""),s.updatedAt=u.format("YYYY/MM/DD HH:mm:ss");const d=JSON.stringify(o,null,2);return await n.modify(r,d),Qe.setChangedByMemos(!0),{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:e.updatedAt,content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?u.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Ti(e,t){xI()||new x.Notice(k("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."));const{vault:n}=Ee.getState().dailyNotesState.app,r=e.id.toString().slice(0,14),a=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(x.moment(r,"YYYYMMDDHHmmss"))?x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):x.moment(r,"YYYYMMDDHHmmss"),o=x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(a,"day"),s=e.path,u=n.getAbstractFileByPath(s)||n.getAbstractFileByPath(e.path);if(!u)return new x.Notice(k("Please check your daily note plugin OR periodic notes plugin settings")),e;const m=(await n.read(u)).split(` `),p=o?x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm"):(parseInt(e.id.toString().slice(10,12))+24).toString()+":"+e.id.toString().slice(12,14);let g,w,D;try{g=m.findIndex(A=>{const N=A.replace(/^(-|\*|\d\.|-\s\[.?\])\s\d{2}:\d{2}/,"").trim(),R=e.content.replace(/\n/g,"
").trim(),F=A.includes(p),H=N.includes(R);return F&&(H||N===R)}),D=!1,w=parseInt(e.id.slice(14))}catch(A){console.error(A)}let S=g!==-1&&g===w?g:w;g===-1&&(S=w,m[w-1]&&(D=!0));let T=m[w]||m[g];if(T=T.replace(/\s\^([0-9a-zA-Z-]+)$/g,""),!T)return new x.Notice(k("Thino not found")),e;if(t.content)if(D){const A=e.thinoType==="TASK-TODO"?"- [ ] ":e.thinoType==="TASK-DONE"?"- [x] ":e.thinoType.startsWith("TASK")?`- [${e.thinoType.slice(5)}] `:"- ",N=(e.pinned?" [pinned::true]":"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.visibility==="PUBLIC"?' [visibility::"PUBLIC"]':"");T=`${A}${p} ${t.content.trim()} ${N}`}else{const A=/^(((-|\*)|(\d\.)|(-\s\[.?\]))\s\d{2}:\d{2})/.exec(T)[1];T=T.replace(/^(((-|\*)|(\d\.)|(-\s\[.?\]))\s\d{2}:\d{2})/,"").replace(e.content.trim().replace(/\n/g,"
"),t.content.trim().replace(/\n/g,"
")).trim(),T=A+" "+T}if(t.thinoType){const A=t.thinoType==="TASK-TODO"?"- [ ] ":t.thinoType==="TASK-DONE"?"- [x] ":t.thinoType.startsWith("TASK")?`- [${t.thinoType.slice(5)}] `:"- ";T=T.replace(/^((- \[.\] )|((-|\*) ))/,A)}if(t.rowStatus){const A=t.rowStatus==="ARCHIVED"?"[archived::"+(t.rowStatus==="ARCHIVED"?"true":"false")+"]":"";T=T.includes("[archived::")?T.replace(/\[archived::(true|false)\]/,A):T+" "+A}if(t.visibility){const A='[visibility::"'+t.visibility+'"]';T=T.includes("[visibility::")?T.replace(/\[visibility::"(PUBLIC|PROTECTED)"\]/g,A):T+" "+A}if(t.pinned!==void 0){const A=t.pinned?"[pinned::"+(t.pinned?"true":"false")+"]":"";T=T.includes("[pinned::")?T.replace(/\[pinned::(true|false)\]/,t.pinned===!1?"":A):T+" "+A}if(t.webId!==void 0){const A="[webId::"+t.webId+"]";T=T.includes("[webId::")?T.replace(/\[webId::([^\]]+)\]/,t.webId===""?"":A):T+" "+A}const E=x.moment();if(t.deleted!==void 0){const A="[deleted::"+E.format("YYYYMMDDHHmmss")+"]";t.deleted?(T=T.replace(/\[deleted::([^\]]+)\]/,""),T=T+" "+A):t.deleted===!1&&(T=T.replace(/\[deleted::([^\]]+)\]/,""))}if(e.hasId){const A=" ^"+e.hasId;T=T.replace(/\s\^([0-9a-zA-Z-]+)$/g,"")+A}return T!==m[S]?(m.splice(S,1,T),await n.modify(u,m.join(` `)),Qe.setChangedByMemos(!0),{...e,thinoType:t.thinoType??e.thinoType,createdAt:e.createdAt,updatedAt:e.updatedAt,content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?E.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}):e}const fk=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return Ii(e,{id:e.id,pinned:!0});case"DAILY":return Ti(e,{id:e.id,pinned:!0});case"MULTI":return Po(e,{id:e.id,pinned:!0});case"FILE":return Si(e,{id:e.id,pinned:!0})}},hk=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return Ii(e,{id:e.id,pinned:!1});case"DAILY":return Ti(e,{id:e.id,pinned:!1});case"MULTI":return Po(e,{id:e.id,pinned:!1});case"FILE":return Si(e,{id:e.id,pinned:!1})}};var vw;(e=>{async function t(T){return await Bb(T)}e.getMyMemos=t;async function n(T){return await Bb([T])}e.updateSpecificTypeMemo=n;function r(){return rk()}e.getMyDeletedMemos=r;function a(T){const E=Ie.getMemoById(T);if(E)switch(E==null?void 0:E.sourceType){case"DAILY":return Ti(E,{id:E.id,deleted:!1});case"CANVAS":return Ii(E,{id:E.id,deleted:!1});case"MULTI":return Po(E,{id:E.id,deleted:!1});case"FILE":return Si(E,{id:E.id,deleted:!1})}}e.restoreMemo=a;function o(T){return ek(T)}e.deleteMemoInSingleFile=o;function s(T){return XN(T)}e.deleteMemoInMultiFiles=s;function u(T){return nk(T)}e.deleteMemoInDailyNote=u;function d(T){return tk(T)}e.deleteMemoInCanvas=d;function m(){return TN()}e.getMyQueries=m;async function p(T,E){return await xN(T,E)}e.createQuery=p;function g(T,E,A){return WN(T,E,A)}e.updateQuery=g;function w(T){return lk(T)}e.deleteQueryById=w;function D(T){return ck(T)}e.pinQuery=D;function S(T){return uk(T)}e.unpinQuery=S})(vw||(vw={}));const va=vw;var bs={};Object.defineProperty(bs,"__esModule",{value:!0});class Hc extends Error{}class mk extends Hc{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class pk extends Hc{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class gk extends Hc{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Yh extends Hc{}class kI extends Hc{constructor(t){super(`Invalid unit ${t}`)}}class io extends Hc{}class ll extends Hc{constructor(){super("Zone is an abstract class")}}const Ze="numeric",Ro="short",Ya="long",rv={year:Ze,month:Ze,day:Ze},AI={year:Ze,month:Ro,day:Ze},vk={year:Ze,month:Ro,day:Ze,weekday:Ro},OI={year:Ze,month:Ya,day:Ze},FI={year:Ze,month:Ya,day:Ze,weekday:Ya},PI={hour:Ze,minute:Ze},jI={hour:Ze,minute:Ze,second:Ze},LI={hour:Ze,minute:Ze,second:Ze,timeZoneName:Ro},RI={hour:Ze,minute:Ze,second:Ze,timeZoneName:Ya},_I={hour:Ze,minute:Ze,hourCycle:"h23"},HI={hour:Ze,minute:Ze,second:Ze,hourCycle:"h23"},BI={hour:Ze,minute:Ze,second:Ze,hourCycle:"h23",timeZoneName:Ro},YI={hour:Ze,minute:Ze,second:Ze,hourCycle:"h23",timeZoneName:Ya},zI={year:Ze,month:Ze,day:Ze,hour:Ze,minute:Ze},UI={year:Ze,month:Ze,day:Ze,hour:Ze,minute:Ze,second:Ze},VI={year:Ze,month:Ro,day:Ze,hour:Ze,minute:Ze},ZI={year:Ze,month:Ro,day:Ze,hour:Ze,minute:Ze,second:Ze},yk={year:Ze,month:Ro,day:Ze,weekday:Ro,hour:Ze,minute:Ze},WI={year:Ze,month:Ya,day:Ze,hour:Ze,minute:Ze,timeZoneName:Ro},$I={year:Ze,month:Ya,day:Ze,hour:Ze,minute:Ze,second:Ze,timeZoneName:Ro},GI={year:Ze,month:Ya,day:Ze,weekday:Ya,hour:Ze,minute:Ze,timeZoneName:Ya},qI={year:Ze,month:Ya,day:Ze,weekday:Ya,hour:Ze,minute:Ze,second:Ze,timeZoneName:Ya};class Dm{get type(){throw new ll}get name(){throw new ll}get ianaName(){return this.name}get isUniversal(){throw new ll}offsetName(t,n){throw new ll}formatOffset(t,n){throw new ll}offset(t){throw new ll}equals(t){throw new ll}get isValid(){throw new ll}}let b0=null;class Ov extends Dm{static get instance(){return b0===null&&(b0=new Ov),b0}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return KI(t,n,r)}formatOffset(t,n){return $h(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Ug={};function wk(e){return Ug[e]||(Ug[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Ug[e]}const bk={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Dk(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,o,s,u,d,m,p]=r;return[s,a,o,u,d,m,p]}function Sk(e,t){const n=e.formatToParts(t),r=[];for(let a=0;a=0?S:1e3+S,(w-D)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Vb={};function Ik(e,t={}){const n=JSON.stringify([e,t]);let r=Vb[n];return r||(r=new Intl.ListFormat(e,t),Vb[n]=r),r}let yw={};function ww(e,t={}){const n=JSON.stringify([e,t]);let r=yw[n];return r||(r=new Intl.DateTimeFormat(e,t),yw[n]=r),r}let bw={};function Tk(e,t={}){const n=JSON.stringify([e,t]);let r=bw[n];return r||(r=new Intl.NumberFormat(e,t),bw[n]=r),r}let Dw={};function Ek(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let o=Dw[a];return o||(o=new Intl.RelativeTimeFormat(e,t),Dw[a]=o),o}let zh=null;function xk(){return zh||(zh=new Intl.DateTimeFormat().resolvedOptions().locale,zh)}function Ck(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,a;try{r=ww(e).resolvedOptions(),a=e}catch{const d=e.substring(0,n);r=ww(d).resolvedOptions(),a=d}const{numberingSystem:o,calendar:s}=r;return[a,o,s]}}function Mk(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Nk(e){const t=[];for(let n=1;n<=12;n++){const r=st.utc(2016,n,1);t.push(e(r))}return t}function kk(e){const t=[];for(let n=1;n<=7;n++){const r=st.utc(2016,11,13+n);t.push(e(r))}return t}function Sg(e,t,n,r,a){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):a(t)}function Ak(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class Ok{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:a,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const u={useGrouping:!1,...r};r.padTo>0&&(u.minimumIntegerDigits=r.padTo),this.inf=Tk(t,u)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):r1(t,3);return Wn(n,this.padTo)}}}class Fk{constructor(t,n,r){this.opts=r;let a;if(t.zone.isUniversal){const s=-1*(t.offset/60),u=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&fs.create(u).valid?(a=u,this.dt=t):(a="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:st.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,a=t.zone.name);const o={...this.opts};o.timeZone=o.timeZone||a,this.dtf=ww(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Pk{constructor(t,n,r){this.opts={style:"long",...r},!n&&JI()&&(this.rtf=Ek(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Kk(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class hn{static fromOpts(t){return hn.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,a=!1){const o=t||Zn.defaultLocale,s=o||(a?"en-US":xk()),u=n||Zn.defaultNumberingSystem,d=r||Zn.defaultOutputCalendar;return new hn(s,u,d,o)}static resetCache(){zh=null,yw={},bw={},Dw={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return hn.create(t,n,r)}constructor(t,n,r,a){const[o,s,u]=Ck(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||u||null,this.intl=Mk(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ak(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:hn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return Sg(this,t,r,eT,()=>{const a=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=Nk(s=>this.extract(s,a,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return Sg(this,t,r,rT,()=>{const a=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=kk(s=>this.extract(s,a,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Sg(this,void 0,t,()=>aT,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[st.utc(2016,11,13,9),st.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return Sg(this,t,n,oT,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[st.utc(-40,1,1),st.utc(2017,1,1)].map(a=>this.extract(a,r,"era"))),this.eraCache[t]})}extract(t,n,r){const a=this.dtFormatter(t,n),o=a.formatToParts(),s=o.find(u=>u.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new Ok(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new Fk(t,this.intl,n)}relFormatter(t={}){return new Pk(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Ik(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}let D0=null;class Xr extends Dm{static get utcInstance(){return D0===null&&(D0=new Xr(0)),D0}static instance(t){return t===0?Xr.utcInstance:new Xr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Xr(Pv(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${$h(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${$h(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return $h(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class jk extends Dm{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function gl(e,t){if(Rt(e)||e===null)return t;if(e instanceof Dm)return e;if(Lk(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Ov.instance:n==="utc"||n==="gmt"?Xr.utcInstance:Xr.parseSpecifier(n)||fs.create(e)}else return Cc(e)?Xr.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new jk(e)}let Zb=()=>Date.now(),Wb="system",$b=null,Gb=null,qb=null,Jb=60,Kb;class Zn{static get now(){return Zb}static set now(t){Zb=t}static set defaultZone(t){Wb=t}static get defaultZone(){return gl(Wb,Ov.instance)}static get defaultLocale(){return $b}static set defaultLocale(t){$b=t}static get defaultNumberingSystem(){return Gb}static set defaultNumberingSystem(t){Gb=t}static get defaultOutputCalendar(){return qb}static set defaultOutputCalendar(t){qb=t}static get twoDigitCutoffYear(){return Jb}static set twoDigitCutoffYear(t){Jb=t%100}static get throwOnInvalid(){return Kb}static set throwOnInvalid(t){Kb=t}static resetCaches(){hn.resetCache(),fs.resetCache()}}function Rt(e){return typeof e>"u"}function Cc(e){return typeof e=="number"}function Fv(e){return typeof e=="number"&&e%1===0}function Lk(e){return typeof e=="string"}function Rk(e){return Object.prototype.toString.call(e)==="[object Date]"}function JI(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function _k(e){return Array.isArray(e)?e:[e]}function Qb(e,t,n){if(e.length!==0)return e.reduce((r,a)=>{const o=[t(a),a];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function Hk(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Nd(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ds(e,t,n){return Fv(e)&&e>=t&&e<=n}function Bk(e,t){return e-t*Math.floor(e/t)}function Wn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function pl(e){if(!(Rt(e)||e===null||e===""))return parseInt(e,10)}function bc(e){if(!(Rt(e)||e===null||e===""))return parseFloat(e)}function n1(e){if(!(Rt(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function r1(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Sm(e){return e%4===0&&(e%100!==0||e%400===0)}function Wh(e){return Sm(e)?366:365}function av(e,t){const n=Bk(t-1,12)+1,r=e+(t-n)/12;return n===2?Sm(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function a1(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function ov(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function Sw(e){return e>99?e:e>Zn.twoDigitCutoffYear?1900+e:2e3+e}function KI(e,t,n,r=null){const a=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},u=new Intl.DateTimeFormat(n,s).formatToParts(a).find(d=>d.type.toLowerCase()==="timezonename");return u?u.value:null}function Pv(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,a=n<0||Object.is(n,-0)?-r:r;return n*60+a}function QI(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new io(`Invalid unit value ${e}`);return t}function iv(e,t){const n={};for(const r in e)if(Nd(e,r)){const a=e[r];if(a==null)continue;n[t(r)]=QI(a)}return n}function $h(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${Wn(n,2)}:${Wn(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${Wn(n,2)}${Wn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function jv(e){return Hk(e,["hour","minute","second","millisecond"])}const Yk=["January","February","March","April","May","June","July","August","September","October","November","December"],XI=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],zk=["J","F","M","A","M","J","J","A","S","O","N","D"];function eT(e){switch(e){case"narrow":return[...zk];case"short":return[...XI];case"long":return[...Yk];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const tT=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],nT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Uk=["M","T","W","T","F","S","S"];function rT(e){switch(e){case"narrow":return[...Uk];case"short":return[...nT];case"long":return[...tT];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const aT=["AM","PM"],Vk=["Before Christ","Anno Domini"],Zk=["BC","AD"],Wk=["B","A"];function oT(e){switch(e){case"narrow":return[...Wk];case"short":return[...Zk];case"long":return[...Vk];default:return null}}function $k(e){return aT[e.hour<12?0:1]}function Gk(e,t){return rT(t)[e.weekday-1]}function qk(e,t){return eT(t)[e.month-1]}function Jk(e,t){return oT(t)[e.year<0?0:1]}function Kk(e,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const g=e==="days";switch(t){case 1:return g?"tomorrow":`next ${a[e][0]}`;case-1:return g?"yesterday":`last ${a[e][0]}`;case 0:return g?"today":`this ${a[e][0]}`}}const s=Object.is(t,-0)||t<0,u=Math.abs(t),d=u===1,m=a[e],p=r?d?m[1]:m[2]||m[1]:d?a[e][0]:e;return s?`${u} ${p} ago`:`in ${u} ${p}`}function Xb(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Qk={D:rv,DD:AI,DDD:OI,DDDD:FI,t:PI,tt:jI,ttt:LI,tttt:RI,T:_I,TT:HI,TTT:BI,TTTT:YI,f:zI,ff:VI,fff:WI,ffff:GI,F:UI,FF:ZI,FFF:$I,FFFF:qI};class Yr{static create(t,n={}){return new Yr(t,n)}static parseFormat(t){let n=null,r="",a=!1;const o=[];for(let s=0;s0&&o.push({literal:a,val:r}),n=null,r="",a=!a):a||u===n?r+=u:(r.length>0&&o.push({literal:!1,val:r}),r=u,n=u)}return r.length>0&&o.push({literal:a,val:r}),o}static macroTokenToFormatOpts(t){return Qk[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}formatInterval(t,n={}){return this.loc.dtFormatter(t.start,{...this.opts,...n}).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Wn(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",a=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(D,S)=>this.loc.extract(t,D,S),s=D=>t.isOffsetFixed&&t.offset===0&&D.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,D.format):"",u=()=>r?$k(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),d=(D,S)=>r?qk(t,D):o(S?{month:D}:{month:D,day:"numeric"},"month"),m=(D,S)=>r?Gk(t,D):o(S?{weekday:D}:{weekday:D,month:"long",day:"numeric"},"weekday"),p=D=>{const S=Yr.macroTokenToFormatOpts(D);return S?this.formatWithSystemDefault(t,S):D},g=D=>r?Jk(t,D):o({era:D},"era"),w=D=>{switch(D){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return u();case"d":return a?o({day:"numeric"},"day"):this.num(t.day);case"dd":return a?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return m("short",!0);case"cccc":return m("long",!0);case"ccccc":return m("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return m("short",!1);case"EEEE":return m("long",!1);case"EEEEE":return m("narrow",!1);case"L":return a?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return a?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return d("short",!0);case"LLLL":return d("long",!0);case"LLLLL":return d("narrow",!0);case"M":return a?o({month:"numeric"},"month"):this.num(t.month);case"MM":return a?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return d("short",!1);case"MMMM":return d("long",!1);case"MMMMM":return d("narrow",!1);case"y":return a?o({year:"numeric"},"year"):this.num(t.year);case"yy":return a?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return a?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return a?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return g("short");case"GG":return g("long");case"GGGGG":return g("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return p(D)}};return Xb(Yr.parseFormat(n),w)}formatDurationFromString(t,n){const r=d=>{switch(d[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},a=d=>m=>{const p=r(m);return p?this.num(d.get(p),m.length):m},o=Yr.parseFormat(n),s=o.reduce((d,{literal:m,val:p})=>m?d:d.concat(p),[]),u=t.shiftTo(...s.map(r).filter(d=>d));return Xb(o,a(u))}}class jo{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const iT=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Yd(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function zd(...e){return t=>e.reduce(([n,r,a],o)=>{const[s,u,d]=o(t,a);return[{...n,...s},u||r,d]},[{},null,1]).slice(0,2)}function Ud(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const a=n.exec(e);if(a)return r(a)}return[null,null]}function sT(...e){return(t,n)=>{const r={};let a;for(a=0;aD!==void 0&&(S||D&&p)?-D:D;return[{years:w(bc(n)),months:w(bc(r)),weeks:w(bc(a)),days:w(bc(o)),hours:w(bc(s)),minutes:w(bc(u)),seconds:w(bc(d),d==="-0"),milliseconds:w(n1(m),g)}]}const d6={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function s1(e,t,n,r,a,o,s){const u={year:t.length===2?Sw(pl(t)):pl(t),month:XI.indexOf(n)+1,day:pl(r),hour:pl(a),minute:pl(o)};return s&&(u.second=pl(s)),e&&(u.weekday=e.length>3?tT.indexOf(e)+1:nT.indexOf(e)+1),u}const f6=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function h6(e){const[,t,n,r,a,o,s,u,d,m,p,g]=e,w=s1(t,a,r,n,o,s,u);let D;return d?D=d6[d]:m?D=0:D=Pv(p,g),[w,new Xr(D)]}function m6(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const p6=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,g6=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,v6=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function eD(e){const[,t,n,r,a,o,s,u]=e;return[s1(t,a,r,n,o,s,u),Xr.utcInstance]}function y6(e){const[,t,n,r,a,o,s,u]=e;return[s1(t,u,n,r,a,o,s),Xr.utcInstance]}const w6=Yd(e6,i1),b6=Yd(t6,i1),D6=Yd(n6,i1),S6=Yd(cT),dT=zd(s6,Vd,Im,Tm),I6=zd(r6,Vd,Im,Tm),T6=zd(a6,Vd,Im,Tm),E6=zd(Vd,Im,Tm);function x6(e){return Ud(e,[w6,dT],[b6,I6],[D6,T6],[S6,E6])}function C6(e){return Ud(m6(e),[f6,h6])}function M6(e){return Ud(e,[p6,eD],[g6,eD],[v6,y6])}function N6(e){return Ud(e,[c6,u6])}const k6=zd(Vd);function A6(e){return Ud(e,[l6,k6])}const O6=Yd(o6,i6),F6=Yd(uT),P6=zd(Vd,Im,Tm);function j6(e){return Ud(e,[O6,dT],[F6,P6])}const L6="Invalid Duration",fT={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},R6={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...fT},oo=146097/400,pd=146097/4800,_6={years:{quarters:4,months:12,weeks:oo/7,days:oo,hours:oo*24,minutes:oo*24*60,seconds:oo*24*60*60,milliseconds:oo*24*60*60*1e3},quarters:{months:3,weeks:oo/28,days:oo/4,hours:oo*24/4,minutes:oo*24*60/4,seconds:oo*24*60*60/4,milliseconds:oo*24*60*60*1e3/4},months:{weeks:pd/7,days:pd,hours:pd*24,minutes:pd*24*60,seconds:pd*24*60*60,milliseconds:pd*24*60*60*1e3},...fT},Dc=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],H6=Dc.slice(0).reverse();function cl(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new et(r)}function B6(e){return e<0?Math.floor(e):Math.ceil(e)}function hT(e,t,n,r,a){const o=e[a][n],s=t[n]/o,u=Math.sign(s)===Math.sign(r[a]),d=!u&&r[a]!==0&&Math.abs(s)<=1?B6(s):Math.trunc(s);r[a]+=d,t[n]-=d*o}function Y6(e,t){H6.reduce((n,r)=>Rt(t[r])?n:(n&&hT(e,t,n,t,r),r),null)}function z6(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class et{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?_6:R6;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||hn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return et.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new io(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new et({values:iv(t,et.normalizeUnit),loc:hn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Cc(t))return et.fromMillis(t);if(et.isDuration(t))return t;if(typeof t=="object")return et.fromObject(t);throw new io(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=N6(t);return r?et.fromObject(r,n):et.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=A6(t);return r?et.fromObject(r,n):et.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new io("need to specify a reason the Duration is invalid");const r=t instanceof jo?t:new jo(t,n);if(Zn.throwOnInvalid)throw new gk(r);return new et({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new kI(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Yr.create(this.loc,r).formatDurationFromString(this,t):L6}toHuman(t={}){const n=Dc.map(r=>{const a=this.values[r];return Rt(a)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(a)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=r1(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let a=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(a+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(a+=".SSS"));let o=r.toFormat(a);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=et.fromDurationLike(t),r={};for(const a of Dc)(Nd(n.values,a)||Nd(this.values,a))&&(r[a]=n.get(a)+this.get(a));return cl(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=et.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=QI(t(this.values[r],r));return cl(this,{values:n},!0)}get(t){return this[et.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...iv(t,et.normalizeUnit)};return cl(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:a}={}){const s={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:a,conversionAccuracy:r};return cl(this,s)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Y6(this.matrix,t),cl(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=z6(this.normalize().shiftToAll().toObject());return cl(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>et.normalizeUnit(s));const n={},r={},a=this.toObject();let o;for(const s of Dc)if(t.indexOf(s)>=0){o=s;let u=0;for(const m in r)u+=this.matrix[m][s]*r[m],r[m]=0;Cc(a[s])&&(u+=a[s]);const d=Math.trunc(u);n[s]=d,r[s]=(u*1e3-d*1e3)/1e3;for(const m in a)Dc.indexOf(m)>Dc.indexOf(s)&&hT(this.matrix,a,m,n,s)}else Cc(a[s])&&(r[s]=a[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return cl(this,{values:n},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return cl(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,a){return r===void 0||r===0?a===void 0||a===0:r===a}for(const r of Dc)if(!n(this.values[r],t.values[r]))return!1;return!0}}const gd="Invalid Interval";function U6(e,t){return!e||!e.isValid?Nn.invalid("missing or invalid start"):!t||!t.isValid?Nn.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Nn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Oh).filter(s=>this.contains(s)).sort(),r=[];let{s:a}=this,o=0;for(;a+this.e?this.e:s;r.push(Nn.fromDateTimes(a,u)),a=u,o+=1}return r}splitBy(t){const n=et.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,a=1,o;const s=[];for(;rd*a));o=+u>+this.e?this.e:u,s.push(Nn.fromDateTimes(r,o)),r=o,a+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e=r?null:Nn.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.st.e?this.e:t.e;return Nn.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((a,o)=>a.s-o.s).reduce(([a,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[a,o.union(s)]:[a.concat([o]),s]:[a,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const a=[],o=t.map(d=>[{time:d.s,type:"s"},{time:d.e,type:"e"}]),s=Array.prototype.concat(...o),u=s.sort((d,m)=>d.time-m.time);for(const d of u)r+=d.type==="s"?1:-1,r===1?n=d.time:(n&&+n!=+d.time&&a.push(Nn.fromDateTimes(n,d.time)),n=null);return Nn.merge(a)}difference(...t){return Nn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:gd}toLocaleString(t=rv,n={}){return this.isValid?Yr.create(this.s.loc.clone(n),t).formatInterval(this):gd}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:gd}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:gd}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:gd}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:gd}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):et.invalid(this.invalidReason)}mapEndpoints(t){return Nn.fromDateTimes(t(this.s),t(this.e))}}class Ig{static hasDST(t=Zn.defaultZone){const n=st.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return fs.isValidZone(t)}static normalizeZone(t){return gl(t,Zn.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||hn.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||hn.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||hn.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||hn.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return hn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return hn.create(n,null,"gregory").eras(t)}static features(){return{relative:JI()}}}function tD(e,t){const n=a=>a.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(et.fromMillis(r).as("days"))}function V6(e,t,n){const r=[["years",(d,m)=>m.year-d.year],["quarters",(d,m)=>m.quarter-d.quarter+(m.year-d.year)*4],["months",(d,m)=>m.month-d.month+(m.year-d.year)*12],["weeks",(d,m)=>{const p=tD(d,m);return(p-p%7)/7}],["days",tD]],a={},o=e;let s,u;for(const[d,m]of r)n.indexOf(d)>=0&&(s=d,a[d]=m(e,t),u=o.plus(a),u>t?(a[d]--,e=o.plus(a)):e=u);return[e,a,u,s]}function Z6(e,t,n,r){let[a,o,s,u]=V6(e,t,n);const d=t-a,m=n.filter(g=>["hours","minutes","seconds","milliseconds"].indexOf(g)>=0);m.length===0&&(s0?et.fromMillis(d,r).shiftTo(...m).plus(p):p}const l1={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},nD={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},W6=l1.hanidec.replace(/[\[|\]]/g,"").split("");function $6(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}function ko({numberingSystem:e},t=""){return new RegExp(`${l1[e||"latn"]}${t}`)}const G6="missing Intl.DateTimeFormat.formatToParts support";function Ut(e,t=n=>n){return{regex:e,deser:([n])=>t($6(n))}}const q6=" ",mT=`[ ${q6}]`,pT=new RegExp(mT,"g");function J6(e){return e.replace(/\./g,"\\.?").replace(pT,mT)}function rD(e){return e.replace(/\./g,"").replace(pT," ").toLowerCase()}function Ao(e,t){return e===null?null:{regex:RegExp(e.map(J6).join("|")),deser:([n])=>e.findIndex(r=>rD(n)===rD(r))+t}}function aD(e,t){return{regex:e,deser:([,n,r])=>Pv(n,r),groups:t}}function S0(e){return{regex:e,deser:([t])=>t}}function K6(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Q6(e,t){const n=ko(t),r=ko(t,"{2}"),a=ko(t,"{3}"),o=ko(t,"{4}"),s=ko(t,"{6}"),u=ko(t,"{1,2}"),d=ko(t,"{1,3}"),m=ko(t,"{1,6}"),p=ko(t,"{1,9}"),g=ko(t,"{2,4}"),w=ko(t,"{4,6}"),D=E=>({regex:RegExp(K6(E.val)),deser:([A])=>A,literal:!0}),T=(E=>{if(e.literal)return D(E);switch(E.val){case"G":return Ao(t.eras("short",!1),0);case"GG":return Ao(t.eras("long",!1),0);case"y":return Ut(m);case"yy":return Ut(g,Sw);case"yyyy":return Ut(o);case"yyyyy":return Ut(w);case"yyyyyy":return Ut(s);case"M":return Ut(u);case"MM":return Ut(r);case"MMM":return Ao(t.months("short",!0,!1),1);case"MMMM":return Ao(t.months("long",!0,!1),1);case"L":return Ut(u);case"LL":return Ut(r);case"LLL":return Ao(t.months("short",!1,!1),1);case"LLLL":return Ao(t.months("long",!1,!1),1);case"d":return Ut(u);case"dd":return Ut(r);case"o":return Ut(d);case"ooo":return Ut(a);case"HH":return Ut(r);case"H":return Ut(u);case"hh":return Ut(r);case"h":return Ut(u);case"mm":return Ut(r);case"m":return Ut(u);case"q":return Ut(u);case"qq":return Ut(r);case"s":return Ut(u);case"ss":return Ut(r);case"S":return Ut(d);case"SSS":return Ut(a);case"u":return S0(p);case"uu":return S0(u);case"uuu":return Ut(n);case"a":return Ao(t.meridiems(),0);case"kkkk":return Ut(o);case"kk":return Ut(g,Sw);case"W":return Ut(u);case"WW":return Ut(r);case"E":case"c":return Ut(n);case"EEE":return Ao(t.weekdays("short",!1,!1),1);case"EEEE":return Ao(t.weekdays("long",!1,!1),1);case"ccc":return Ao(t.weekdays("short",!0,!1),1);case"cccc":return Ao(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return aD(new RegExp(`([+-]${u.source})(?::(${r.source}))?`),2);case"ZZZ":return aD(new RegExp(`([+-]${u.source})(${r.source})?`),2);case"z":return S0(/[a-z_+-/]{1,256}?/i);default:return D(E)}})(e)||{invalidReason:G6};return T.token=e,T}const X6={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function eA(e,t){const{type:n,value:r}=e;if(n==="literal")return{literal:!0,val:r};const a=t[n];let o=X6[n];if(typeof o=="object"&&(o=o[a]),o)return{literal:!1,val:o}}function tA(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function nA(e,t,n){const r=e.match(t);if(r){const a={};let o=1;for(const s in n)if(Nd(n,s)){const u=n[s],d=u.groups?u.groups+1:1;!u.literal&&u.token&&(a[u.token.val[0]]=u.deser(r.slice(o,o+d))),o+=d}return[r,a]}else return[r,{}]}function rA(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return Rt(e.z)||(n=fs.create(e.z)),Rt(e.Z)||(n||(n=new Xr(e.Z)),r=e.Z),Rt(e.q)||(e.M=(e.q-1)*3+1),Rt(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Rt(e.u)||(e.S=n1(e.u)),[Object.keys(e).reduce((o,s)=>{const u=t(s);return u&&(o[u]=e[s]),o},{}),n,r]}let I0=null;function aA(){return I0||(I0=st.fromMillis(1555555555555)),I0}function oA(e,t){if(e.literal)return e;const n=Yr.macroTokenToFormatOpts(e.val),r=yT(n,t);return r==null||r.includes(void 0)?e:r}function gT(e,t){return Array.prototype.concat(...e.map(n=>oA(n,t)))}function vT(e,t,n){const r=gT(Yr.parseFormat(n),e),a=r.map(s=>Q6(s,e)),o=a.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,u]=tA(a),d=RegExp(s,"i"),[m,p]=nA(t,d,u),[g,w,D]=p?rA(p):[null,null,void 0];if(Nd(p,"a")&&Nd(p,"H"))throw new Yh("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:d,rawMatches:m,matches:p,result:g,zone:w,specificOffset:D}}}function iA(e,t,n){const{result:r,zone:a,specificOffset:o,invalidReason:s}=vT(e,t,n);return[r,a,o,s]}function yT(e,t){return e?Yr.create(t,e).formatDateTimeParts(aA()).map(a=>eA(a,e)):null}const wT=[0,31,59,90,120,151,181,212,243,273,304,334],bT=[0,31,60,91,121,152,182,213,244,274,305,335];function so(e,t){return new jo("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function DT(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const a=r.getUTCDay();return a===0?7:a}function ST(e,t,n){return n+(Sm(e)?bT:wT)[t-1]}function IT(e,t){const n=Sm(e)?bT:wT,r=n.findIndex(o=>oov(t)?(u=t+1,s=1):u=t,{weekYear:u,weekNumber:s,weekday:o,...jv(e)}}function oD(e){const{weekYear:t,weekNumber:n,weekday:r}=e,a=DT(t,1,4),o=Wh(t);let s=n*7+r-a-3,u;s<1?(u=t-1,s+=Wh(u)):s>o?(u=t+1,s-=Wh(t)):u=t;const{month:d,day:m}=IT(u,s);return{year:u,month:d,day:m,...jv(e)}}function T0(e){const{year:t,month:n,day:r}=e,a=ST(t,n,r);return{year:t,ordinal:a,...jv(e)}}function iD(e){const{year:t,ordinal:n}=e,{month:r,day:a}=IT(t,n);return{year:t,month:r,day:a,...jv(e)}}function sA(e){const t=Fv(e.weekYear),n=ds(e.weekNumber,1,ov(e.weekYear)),r=ds(e.weekday,1,7);return t?n?r?!1:so("weekday",e.weekday):so("week",e.week):so("weekYear",e.weekYear)}function lA(e){const t=Fv(e.year),n=ds(e.ordinal,1,Wh(e.year));return t?n?!1:so("ordinal",e.ordinal):so("year",e.year)}function TT(e){const t=Fv(e.year),n=ds(e.month,1,12),r=ds(e.day,1,av(e.year,e.month));return t?n?r?!1:so("day",e.day):so("month",e.month):so("year",e.year)}function ET(e){const{hour:t,minute:n,second:r,millisecond:a}=e,o=ds(t,0,23)||t===24&&n===0&&r===0&&a===0,s=ds(n,0,59),u=ds(r,0,59),d=ds(a,0,999);return o?s?u?d?!1:so("millisecond",a):so("second",r):so("minute",n):so("hour",t)}const E0="Invalid DateTime",sD=864e13;function Tg(e){return new jo("unsupported zone",`the zone "${e.name}" is not supported`)}function x0(e){return e.weekData===null&&(e.weekData=Iw(e.c)),e.weekData}function kh(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new st({...n,...t,old:n})}function xT(e,t,n){let r=e-t*60*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=(a-t)*60*1e3;const o=n.offset(r);return a===o?[r,a]:[e-Math.min(a,o)*60*1e3,Math.max(a,o)]}function lD(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Vg(e,t,n){return xT(a1(e),t,n)}function cD(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),a=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:a,day:Math.min(e.c.day,av(r,a))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=et.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),u=a1(o);let[d,m]=xT(u,n,e.zone);return s!==0&&(d+=s,m=e.zone.offset(d)),{ts:d,o:m}}function Ah(e,t,n,r,a,o){const{setZone:s,zone:u}=n;if(e&&Object.keys(e).length!==0){const d=t||u,m=st.fromObject(e,{...n,zone:d,specificOffset:o});return s?m:m.setZone(u)}else return st.invalid(new jo("unparsable",`the input "${a}" can't be parsed as ${r}`))}function Eg(e,t,n=!0){return e.isValid?Yr.create(hn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function C0(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Wn(e.c.year,n?6:4),t?(r+="-",r+=Wn(e.c.month),r+="-",r+=Wn(e.c.day)):(r+=Wn(e.c.month),r+=Wn(e.c.day)),r}function uD(e,t,n,r,a,o){let s=Wn(e.c.hour);return t?(s+=":",s+=Wn(e.c.minute),(e.c.second!==0||!n)&&(s+=":")):s+=Wn(e.c.minute),(e.c.second!==0||!n)&&(s+=Wn(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=Wn(e.c.millisecond,3))),a&&(e.isOffsetFixed&&e.offset===0&&!o?s+="Z":e.o<0?(s+="-",s+=Wn(Math.trunc(-e.o/60)),s+=":",s+=Wn(Math.trunc(-e.o%60))):(s+="+",s+=Wn(Math.trunc(e.o/60)),s+=":",s+=Wn(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}const CT={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},cA={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},uA={ordinal:1,hour:0,minute:0,second:0,millisecond:0},MT=["year","month","day","hour","minute","second","millisecond"],dA=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],fA=["year","ordinal","hour","minute","second","millisecond"];function dD(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new kI(e);return t}function fD(e,t){const n=gl(t.zone,Zn.defaultZone),r=hn.fromObject(t),a=Zn.now();let o,s;if(Rt(e.year))o=a;else{for(const m of MT)Rt(e[m])&&(e[m]=CT[m]);const u=TT(e)||ET(e);if(u)return st.invalid(u);const d=n.offset(a);[o,s]=Vg(e,d,n)}return new st({ts:o,zone:n,loc:r,o:s})}function hD(e,t,n){const r=Rt(n.round)?!0:n.round,a=(s,u)=>(s=r1(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,u)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return a(o(n.unit),n.unit);for(const s of n.units){const u=o(s);if(Math.abs(u)>=1)return a(u,s)}return a(e>t?-0:0,n.units[n.units.length-1])}function mD(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class st{constructor(t){const n=t.zone||Zn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new jo("invalid input"):null)||(n.isValid?null:Tg(n));this.ts=Rt(t.ts)?Zn.now():t.ts;let a=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[a,o]=[t.old.c,t.old.o];else{const u=n.offset(this.ts);a=lD(this.ts,u),r=Number.isNaN(a.year)?new jo("invalid input"):null,a=r?null:a,o=r?null:u}this._zone=n,this.loc=t.loc||hn.create(),this.invalid=r,this.weekData=null,this.c=a,this.o=o,this.isLuxonDateTime=!0}static now(){return new st({})}static local(){const[t,n]=mD(arguments),[r,a,o,s,u,d,m]=n;return fD({year:r,month:a,day:o,hour:s,minute:u,second:d,millisecond:m},t)}static utc(){const[t,n]=mD(arguments),[r,a,o,s,u,d,m]=n;return t.zone=Xr.utcInstance,fD({year:r,month:a,day:o,hour:s,minute:u,second:d,millisecond:m},t)}static fromJSDate(t,n={}){const r=Rk(t)?t.valueOf():NaN;if(Number.isNaN(r))return st.invalid("invalid input");const a=gl(n.zone,Zn.defaultZone);return a.isValid?new st({ts:r,zone:a,loc:hn.fromObject(n)}):st.invalid(Tg(a))}static fromMillis(t,n={}){if(Cc(t))return t<-sD||t>sD?st.invalid("Timestamp out of range"):new st({ts:t,zone:gl(n.zone,Zn.defaultZone),loc:hn.fromObject(n)});throw new io(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Cc(t))return new st({ts:t*1e3,zone:gl(n.zone,Zn.defaultZone),loc:hn.fromObject(n)});throw new io("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=gl(n.zone,Zn.defaultZone);if(!r.isValid)return st.invalid(Tg(r));const a=Zn.now(),o=Rt(n.specificOffset)?r.offset(a):n.specificOffset,s=iv(t,dD),u=!Rt(s.ordinal),d=!Rt(s.year),m=!Rt(s.month)||!Rt(s.day),p=d||m,g=s.weekYear||s.weekNumber,w=hn.fromObject(n);if((p||u)&&g)throw new Yh("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(m&&u)throw new Yh("Can't mix ordinal dates with month/day");const D=g||s.weekday&&!p;let S,T,E=lD(a,o);D?(S=dA,T=cA,E=Iw(E)):u?(S=fA,T=uA,E=T0(E)):(S=MT,T=CT);let A=!1;for(const z of S){const U=s[z];Rt(U)?A?s[z]=T[z]:s[z]=E[z]:A=!0}const N=D?sA(s):u?lA(s):TT(s),R=N||ET(s);if(R)return st.invalid(R);const F=D?oD(s):u?iD(s):s,[H,P]=Vg(F,o,r),L=new st({ts:H,zone:r,o:P,loc:w});return s.weekday&&p&&t.weekday!==L.weekday?st.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${L.toISO()}`):L}static fromISO(t,n={}){const[r,a]=x6(t);return Ah(r,a,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,a]=C6(t);return Ah(r,a,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,a]=M6(t);return Ah(r,a,n,"HTTP",n)}static fromFormat(t,n,r={}){if(Rt(t)||Rt(n))throw new io("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:o=null}=r,s=hn.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0}),[u,d,m,p]=iA(s,t,n);return p?st.invalid(p):Ah(u,d,r,`format ${n}`,t,m)}static fromString(t,n,r={}){return st.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,a]=j6(t);return Ah(r,a,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new io("need to specify a reason the DateTime is invalid");const r=t instanceof jo?t:new jo(t,n);if(Zn.throwOnInvalid)throw new mk(r);return new st({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=yT(t,hn.fromObject(n));return r?r.map(a=>a?a.val:null).join(""):null}static expandFormat(t,n={}){return gT(Yr.parseFormat(t),hn.fromObject(n)).map(a=>a.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?x0(this).weekYear:NaN}get weekNumber(){return this.isValid?x0(this).weekNumber:NaN}get weekday(){return this.isValid?x0(this).weekday:NaN}get ordinal(){return this.isValid?T0(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ig.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ig.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ig.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ig.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Sm(this.year)}get daysInMonth(){return av(this.year,this.month)}get daysInYear(){return this.isValid?Wh(this.year):NaN}get weeksInWeekYear(){return this.isValid?ov(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:a}=Yr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:a}}toUTC(t=0,n={}){return this.setZone(Xr.instance(t),n)}toLocal(){return this.setZone(Zn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=gl(t,Zn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let a=this.ts;if(n||r){const o=t.offset(this.ts),s=this.toObject();[a]=Vg(s,o,t)}return kh(this,{ts:a,zone:t})}else return st.invalid(Tg(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const a=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return kh(this,{loc:a})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=iv(t,dD),r=!Rt(n.weekYear)||!Rt(n.weekNumber)||!Rt(n.weekday),a=!Rt(n.ordinal),o=!Rt(n.year),s=!Rt(n.month)||!Rt(n.day),u=o||s,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new Yh("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&a)throw new Yh("Can't mix ordinal dates with month/day");let m;r?m=oD({...Iw(this.c),...n}):Rt(n.ordinal)?(m={...this.toObject(),...n},Rt(n.day)&&(m.day=Math.min(av(m.year,m.month),m.day))):m=iD({...T0(this.c),...n});const[p,g]=Vg(m,this.o,this.zone);return kh(this,{ts:p,o:g})}plus(t){if(!this.isValid)return this;const n=et.fromDurationLike(t);return kh(this,cD(this,n))}minus(t){if(!this.isValid)return this;const n=et.fromDurationLike(t).negate();return kh(this,cD(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=et.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const a=Math.ceil(this.month/3);n.month=(a-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?Yr.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):E0}toLocaleString(t=rv,n={}){return this.isValid?Yr.create(this.loc.clone(n),t).formatDateTime(this):E0}toLocaleParts(t={}){return this.isValid?Yr.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:a=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s=t==="extended";let u=C0(this,s);return u+="T",u+=uD(this,s,n,r,a,o),u}toISODate({format:t="extended"}={}){return this.isValid?C0(this,t==="extended"):null}toISOWeekDate(){return Eg(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:a=!1,extendedZone:o=!1,format:s="extended"}={}){return this.isValid?(a?"T":"")+uD(this,s==="extended",n,t,r,o):null}toRFC2822(){return Eg(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Eg(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?C0(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let a="HH:mm:ss.SSS";return(n||t)&&(r&&(a+=" "),n?a+="z":t&&(a+="ZZ")),Eg(this,a,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():E0}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return et.invalid("created by diffing an invalid DateTime");const a={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=_k(n).map(et.normalizeUnit),s=t.valueOf()>this.valueOf(),u=s?this:t,d=s?t:this,m=Z6(u,d,o,a);return s?m.negate():m}diffNow(t="milliseconds",n={}){return this.diff(st.now(),t,n)}until(t){return this.isValid?Nn.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),a=this.setZone(t.zone,{keepLocalTime:!0});return a.startOf(n)<=r&&r<=a.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||st.fromObject({},{zone:this.zone}),r=t.padding?thisn.valueOf(),Math.min)}static max(...t){if(!t.every(st.isDateTime))throw new io("max requires all arguments be DateTimes");return Qb(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:a=null,numberingSystem:o=null}=r,s=hn.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0});return vT(s,t,n)}static fromStringExplain(t,n,r={}){return st.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return rv}static get DATE_MED(){return AI}static get DATE_MED_WITH_WEEKDAY(){return vk}static get DATE_FULL(){return OI}static get DATE_HUGE(){return FI}static get TIME_SIMPLE(){return PI}static get TIME_WITH_SECONDS(){return jI}static get TIME_WITH_SHORT_OFFSET(){return LI}static get TIME_WITH_LONG_OFFSET(){return RI}static get TIME_24_SIMPLE(){return _I}static get TIME_24_WITH_SECONDS(){return HI}static get TIME_24_WITH_SHORT_OFFSET(){return BI}static get TIME_24_WITH_LONG_OFFSET(){return YI}static get DATETIME_SHORT(){return zI}static get DATETIME_SHORT_WITH_SECONDS(){return UI}static get DATETIME_MED(){return VI}static get DATETIME_MED_WITH_SECONDS(){return ZI}static get DATETIME_MED_WITH_WEEKDAY(){return yk}static get DATETIME_FULL(){return WI}static get DATETIME_FULL_WITH_SECONDS(){return $I}static get DATETIME_HUGE(){return GI}static get DATETIME_HUGE_WITH_SECONDS(){return qI}}function Oh(e){if(st.isDateTime(e))return e;if(e&&e.valueOf&&Cc(e.valueOf()))return st.fromJSDate(e);if(e&&typeof e=="object")return st.fromObject(e);throw new io(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const c1={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},hA={allowHtml:!0};({...c1,...hA});class u1{constructor(t){this.value=t,this.successful=!0}map(t){return new u1(t(this.value))}flatMap(t){return t(this.value)}mapErr(t){return this}bimap(t,n){return this.map(t)}orElse(t){return this.value}cast(){return this}orElseThrow(t){return this.value}}class d1{constructor(t){this.error=t,this.successful=!1}map(t){return this}flatMap(t){return this}mapErr(t){return new d1(t(this.error))}bimap(t,n){return this.mapErr(n)}orElse(t){return t}cast(){return this}orElseThrow(t){throw t?new Error(t(this.error)):new Error(""+this.error)}}var sv;(function(e){function t(o){return new u1(o)}e.success=t;function n(o){return new d1(o)}e.failure=n;function r(o,s,u){return o.successful?s.successful?u(o.value,s.value):n(s.error):n(o.error)}e.flatMap2=r;function a(o,s,u){return r(o,s,(d,m)=>t(u(d,m)))}e.map2=a})(sv||(sv={}));var mA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Jn<"u"?Jn:typeof self<"u"?self:{},Q={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:mA,function(){return function(n){var r={};function a(o){if(r[o])return r[o].exports;var s=r[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=n,a.c=r,a.d=function(o,s,u){a.o(o,s)||Object.defineProperty(o,s,{configurable:!1,enumerable:!0,get:u})},a.r=function(o){Object.defineProperty(o,"__esModule",{value:!0})},a.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(s,"a",s),s},a.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},a.p="",a(a.s=0)}([function(n,r,a){function o(V){if(!(this instanceof o))return new o(V);this._=V}var s=o.prototype;function u(V,ne){for(var me=0;me>7),buf:function(je){var Ye=d(function(ze,pt,Yt,On){return ze.concat(Yt===On.length-1?Buffer.from([pt,0]).readUInt16BE(0):On.readUInt16BE(Yt))},[],je);return Buffer.from(m(function(ze){return(ze<<1&65535)>>8},Ye))}(me.buf)}}),me}function g(){return typeof Buffer<"u"}function w(){if(!g())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function D(V){w();var ne=d(function(Ye,ze){return Ye+ze},0,V);if(ne%8!=0)throw new Error("The bits ["+V.join(", ")+"] add up to "+ne+" which is not an even number of bytes; the total should be divisible by 8");var me,Ce=ne/8,je=(me=function(Ye){return Ye>48},d(function(Ye,ze){return Ye||(me(ze)?ze:Ye)},null,V));if(je)throw new Error(je+" bit range requested exceeds 48 bit (6 byte) Number max.");return new o(function(Ye,ze){var pt=Ce+ze;return pt>Ye.length?z(ze,Ce.toString()+" bytes"):L(pt,d(function(Yt,On){var yn=p(On,Yt.buf);return{coll:Yt.coll.concat(yn.v),buf:yn.buf}},{coll:[],buf:Ye.slice(ze,pt)},V).coll)})}function S(V,ne){return new o(function(me,Ce){return w(),Ce+ne>me.length?z(Ce,ne+" bytes for "+V):L(Ce+ne,me.slice(Ce,Ce+ne))})}function T(V,ne){if(typeof(me=ne)!="number"||Math.floor(me)!==me||ne<0||ne>6)throw new Error(V+" requires integer length in range [0, 6].");var me}function E(V){return T("uintBE",V),S("uintBE("+V+")",V).map(function(ne){return ne.readUIntBE(0,V)})}function A(V){return T("uintLE",V),S("uintLE("+V+")",V).map(function(ne){return ne.readUIntLE(0,V)})}function N(V){return T("intBE",V),S("intBE("+V+")",V).map(function(ne){return ne.readIntBE(0,V)})}function R(V){return T("intLE",V),S("intLE("+V+")",V).map(function(ne){return ne.readIntLE(0,V)})}function F(V){return V instanceof o}function H(V){return{}.toString.call(V)==="[object Array]"}function P(V){return g()&&Buffer.isBuffer(V)}function L(V,ne){return{status:!0,index:V,value:ne,furthest:-1,expected:[]}}function z(V,ne){return H(ne)||(ne=[ne]),{status:!1,index:-1,value:null,furthest:V,expected:ne}}function U(V,ne){if(!ne||V.furthest>ne.furthest)return V;var me=V.furthest===ne.furthest?function(Ce,je){if(function(){if(o._supportsSet!==void 0)return o._supportsSet;var yr=typeof Set<"u";return o._supportsSet=yr,yr}()&&Array.from){for(var Ye=new Set(Ce),ze=0;ze=0;){if(ze in me){Ce=me[ze].line,Ye===0&&(Ye=me[ze].lineStart);break}(V.charAt(ze)===` `||V.charAt(ze)==="\r"&&V.charAt(ze+1)!==` `)&&(je++,Ye===0&&(Ye=ze+1)),ze--}var pt=Ce+je,Yt=ne-Ye;return me[ne]={line:pt,lineStart:Ye},{offset:ne,line:pt+1,column:Yt+1}}function ae(V){if(!F(V))throw new Error("not a parser: "+V)}function ce(V,ne){return typeof V=="string"?V.charAt(ne):V[ne]}function fe(V){if(typeof V!="number")throw new Error("not a number: "+V)}function ie(V){if(typeof V!="function")throw new Error("not a function: "+V)}function ge(V){if(typeof V!="string")throw new Error("not a string: "+V)}var Te=2,se=3,we=8,Z=5*we,$=4*we,X=" ";function ve(V,ne){return new Array(ne+1).join(V)}function De(V,ne,me){var Ce=ne-V.length;return Ce<=0?V:ve(me,Ce)+V}function be(V,ne,me,Ce){return{from:V-ne>0?V-ne:0,to:V+me>Ce?Ce:V+me}}function ke(V,ne){var me,Ce,je,Ye,ze,pt=ne.index,Yt=pt.offset,On=1;if(Yt===V.length)return"Got the end of the input";if(P(V)){var yn=Yt-Yt%we,na=Yt-yn,Fn=be(yn,Z,$+we,V.length),yr=m(function(Jt){return m(function(Ia){return De(Ia.toString(16),2,"0")},Jt)},function(Jt,Ia){var Ta=Jt.length,Ea=[],zo=0;if(Ta<=Ia)return[Jt.slice()];for(var Uo=0;Uo=4&&(me+=1),On=2,je=m(function(Jt){return Jt.length<=4?Jt.join(" "):Jt.slice(0,4).join(" ")+" "+Jt.slice(4).join(" ")},yr),(ze=(8*(Ye.to>0?Ye.to-1:Ye.to)).toString(16).length)<2&&(ze=2)}else{var ra=V.split(/\r\n|[\n\r\u2028\u2029]/);me=pt.column-1,Ce=pt.line-1,Ye=be(Ce,Te,se,ra.length),je=ra.slice(Ye.from,Ye.to),ze=Ye.to.toString().length}var kl=Ce-Ye.from;return P(V)&&(ze=(8*(Ye.to>0?Ye.to-1:Ye.to)).toString(16).length)<2&&(ze=2),d(function(Jt,Ia,Ta){var Ea,zo=Ta===kl,Uo=zo?"> ":X;return Ea=P(V)?De((8*(Ye.from+Ta)).toString(16),ze,"0"):De((Ye.from+Ta+1).toString(),ze," "),[].concat(Jt,[Uo+Ea+" | "+Ia],zo?[X+ve(" ",ze)+" | "+De("",me," ")+ve("^",On)]:[])},[],je).join(` `)}function Be(V,ne){return[` `,"-- PARSING FAILED "+ve("-",50),` `,ke(V,ne),` `,(me=ne.expected,me.length===1?`Expected: `+me[0]:`Expected one of the following: `+me.join(", ")),` `].join("");var me}function _e(V){return V.flags!==void 0?V.flags:[V.global?"g":"",V.ignoreCase?"i":"",V.multiline?"m":"",V.unicode?"u":"",V.sticky?"y":""].join("")}function it(){for(var V=[].slice.call(arguments),ne=V.length,me=0;me=2?fe(ne):ne=0;var me=function(je){return RegExp("^(?:"+je.source+")",_e(je))}(V),Ce=""+V;return o(function(je,Ye){var ze=me.exec(je.slice(Ye));if(ze){if(0<=ne&&ne<=ze.length){var pt=ze[0],Yt=ze[ne];return L(Ye+pt.length,Yt)}return z(Ye,"valid match group (0 to "+ze.length+") in "+Ce)}return z(Ye,Ce)})}function ft(V){return o(function(ne,me){return L(me,V)})}function Dt(V){return o(function(ne,me){return z(me,V)})}function Et(V){if(F(V))return o(function(ne,me){var Ce=V._(ne,me);return Ce.index=me,Ce.value="",Ce});if(typeof V=="string")return Et($e(V));if(V instanceof RegExp)return Et(lt(V));throw new Error("not a string, regexp, or parser: "+V)}function $t(V){return ae(V),o(function(ne,me){var Ce=V._(ne,me),je=ne.slice(me,Ce.index);return Ce.status?z(me,'not "'+je+'"'):L(me,null)})}function rn(V){return ie(V),o(function(ne,me){var Ce=ce(ne,me);return me=V.length?z(ne,"any character/byte"):L(ne+1,ce(V,ne))}),vr=o(function(V,ne){return L(V.length,V.slice(ne))}),Sa=o(function(V,ne){return ne=0}).desc(ne)},o.optWhitespace=po,o.Parser=o,o.range=function(V,ne){return rn(function(me){return V<=me&&me<=ne}).desc(V+"-"+ne)},o.regex=lt,o.regexp=lt,o.sepBy=Ue,o.sepBy1=Je,o.seq=it,o.seqMap=Vt,o.seqObj=function(){for(var V,ne={},me=0,Ce=(V=arguments,Array.prototype.slice.call(V)),je=Ce.length,Ye=0;Ye255)throw new Error("Value specified to byte constructor ("+V+"=0x"+V.toString(16)+") is larger in value than a single byte.");var ne=(V>15?"0x":"0x0")+V.toString(16);return o(function(me,Ce){var je=ce(me,Ce);return je===V?L(Ce+1,je):z(Ce,ne)})},buffer:function(V){return S("buffer",V).map(function(ne){return Buffer.from(ne)})},encodedString:function(V,ne){return S("string",ne).map(function(me){return me.toString(V)})},uintBE:E,uint8BE:E(1),uint16BE:E(2),uint32BE:E(4),uintLE:A,uint8LE:A(1),uint16LE:A(2),uint32LE:A(4),intBE:N,int8BE:N(1),int16BE:N(2),int32BE:N(4),intLE:R,int8LE:R(1),int16LE:R(2),int32LE:R(4),floatBE:S("floatBE",4).map(function(V){return V.readFloatBE(0)}),floatLE:S("floatLE",4).map(function(V){return V.readFloatLE(0)}),doubleBE:S("doubleBE",8).map(function(V){return V.readDoubleBE(0)}),doubleLE:S("doubleLE",8).map(function(V){return V.readDoubleLE(0)})},n.exports=o}])})})(Q);var f1=()=>/(?:[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDD-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF6](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC2\uDED0-\uDED9\uDEE0-\uDEE7]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?))/g;function NT(e){return e==null?e:e.shiftToAll().normalize()}function pD(e){return e.includes("/")&&(e=e.substring(e.lastIndexOf("/")+1)),e.endsWith(".md")&&(e=e.substring(0,e.length-3)),e}Q.exports.alt(Q.exports.regex(new RegExp(f1(),"")),Q.exports.regex(/[0-9\p{Letter}_-]+/u).map(e=>e.toLocaleLowerCase()),Q.exports.whitespace.map(e=>"-"),Q.exports.any.map(e=>"")).many().map(e=>e.join(""));const pA=Q.exports.alt(Q.exports.regex(new RegExp(f1(),"")),Q.exports.regex(/[0-9\p{Letter}_-]+/u),Q.exports.whitespace.map(e=>" "),Q.exports.any.map(e=>" ")).many().map(e=>e.join("").split(/\s+/).join(" ").trim());function gA(e){return pA.tryParse(e)}function vA(e){return e=NT(e),e=et.fromObject(Object.fromEntries(Object.entries(e.toObject()).filter(([,t])=>t>0))),e.toHuman()}var Xh;(function(e){function t(F,H=c1,P=!1){let L=n(F);if(!L)return H.renderNullAs;switch(L.type){case"null":return H.renderNullAs;case"string":return L.value;case"number":case"boolean":return""+L.value;case"html":return L.value.outerHTML;case"widget":return L.value.markdown();case"link":return L.value.markdown();case"function":return"";case"array":let z="";return P&&(z+="["),z+=L.value.map(U=>t(U,H,!0)).join(", "),P&&(z+="]"),z;case"object":return"{ "+Object.entries(L.value).map(U=>U[0]+": "+t(U[1],H,!0)).join(", ")+" }";case"date":return L.value.second==0&&L.value.hour==0&&L.value.minute==0?L.value.toFormat(H.defaultDateFormat):L.value.toFormat(H.defaultDateTimeFormat);case"duration":return vA(L.value)}}e.toString=t;function n(F){return w(F)?{type:"null",value:F}:m(F)?{type:"number",value:F}:d(F)?{type:"string",value:F}:S(F)?{type:"boolean",value:F}:g(F)?{type:"duration",value:F}:p(F)?{type:"date",value:F}:E(F)?{type:"widget",value:F}:D(F)?{type:"array",value:F}:T(F)?{type:"link",value:F}:R(F)?{type:"function",value:F}:A(F)?{type:"html",value:F}:N(F)?{type:"object",value:F}:void 0}e.wrapValue=n;function r(F,H){if(N(F)){let P={};for(let[L,z]of Object.entries(F))P[L]=r(z,H);return P}else if(D(F)){let P=[];for(let L of F)P.push(r(L,H));return P}else return H(F)}e.mapLeaves=r;function a(F,H,P){var L,z;if(F===void 0&&(F=null),H===void 0&&(H=null),F===null&&H===null)return 0;if(F===null)return-1;if(H===null)return 1;let U=n(F),W=n(H);if(U===void 0&&W===void 0)return 0;if(U===void 0)return-1;if(W===void 0)return 1;if(U.type!=W.type)return U.type.localeCompare(W.type);if(U.value===W.value)return 0;switch(U.type){case"string":return U.value.localeCompare(W.value);case"number":return U.valueve),fe=ce(K.path).localeCompare(ce(ae.path));if(fe!=0)return fe;let ie=K.type.localeCompare(ae.type);return ie!=0?ie:K.subpath&&!ae.subpath?1:!K.subpath&&ae.subpath?-1:!K.subpath&&!ae.subpath?0:((L=K.subpath)!==null&&L!==void 0?L:"").localeCompare((z=ae.subpath)!==null&&z!==void 0?z:"");case"date":return U.value0;case"boolean":return H.value;case"link":return!!H.value.path;case"date":return H.value.toMillis()!=0;case"duration":return H.value.as("seconds")!=0;case"object":return Object.keys(H.value).length>0;case"array":return H.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}e.isTruthy=s;function u(F){if(F==null)return F;if(e.isArray(F))return[].concat(F.map(H=>u(H)));if(e.isObject(F)){let H={};for(let[P,L]of Object.entries(F))H[P]=u(L);return H}else return F}e.deepCopy=u;function d(F){return typeof F=="string"}e.isString=d;function m(F){return typeof F=="number"}e.isNumber=m;function p(F){return F instanceof st}e.isDate=p;function g(F){return F instanceof et}e.isDuration=g;function w(F){return F==null}e.isNull=w;function D(F){return Array.isArray(F)}e.isArray=D;function S(F){return typeof F=="boolean"}e.isBoolean=S;function T(F){return F instanceof _r}e.isLink=T;function E(F){return F instanceof h1}e.isWidget=E;function A(F){return typeof HTMLElement<"u"?F instanceof HTMLElement:!1}e.isHtml=A;function N(F){return typeof F=="object"&&!A(F)&&!E(F)&&!D(F)&&!g(F)&&!p(F)&&!T(F)&&F!==void 0&&!w(F)}e.isObject=N;function R(F){return typeof F=="function"}e.isFunction=R})(Xh||(Xh={}));var gD;(function(e){function t(a){return Xh.isObject(a)&&Object.keys(a).length==2&&"key"in a&&"rows"in a}e.isElementGroup=t;function n(a){for(let o of a)if(!t(o))return!1;return!0}e.isGrouping=n;function r(a){if(n(a)){let o=0;for(let s of a)o+=r(s.rows);return o}else return a.length}e.count=r})(gD||(gD={}));class _r{constructor(t){Object.assign(this,t)}static file(t,n=!1,r){return new _r({path:t,embed:n,display:r,subpath:void 0,type:"file"})}static infer(t,n=!1,r){if(t.includes("#^")){let a=t.split("#^");return _r.block(a[0],a[1],n,r)}else if(t.includes("#")){let a=t.split("#");return _r.header(a[0],a[1],n,r)}else return _r.file(t,n,r)}static header(t,n,r,a){return new _r({path:t,embed:r,display:a,subpath:gA(n),type:"header"})}static block(t,n,r,a){return new _r({path:t,embed:r,display:a,subpath:n,type:"block"})}static fromObject(t){return new _r(t)}equals(t){return t==null||t==null?!1:this.path==t.path&&this.type==t.type&&this.subpath==t.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(t){return new _r(Object.assign({},this,{path:t}))}withDisplay(t){return new _r(Object.assign({},this,{display:t}))}withHeader(t){return _r.header(this.path,t,this.embed,this.display)}toFile(){return _r.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let t=new _r(this);return t.embed=!0,t}}fromEmbed(){if(this.embed){let t=new _r(this);return t.embed=!1,t}else return this}markdown(){let t=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?t+="|"+this.display:(t+="|"+pD(this.path),(this.type=="header"||this.type=="block")&&(t+=" > "+this.subpath)),t+="]]",t}obsidianLink(){var t,n;const r=this.path.replace("|","\\|");return this.type=="header"?r+"#"+((t=this.subpath)===null||t===void 0?void 0:t.replace("|","\\|")):this.type=="block"?r+"#^"+((n=this.subpath)===null||n===void 0?void 0:n.replace("|","\\|")):r}fileName(){return pD(this.path).replace(".md","")}}class h1{constructor(t){this.$widget=t}}class yA extends h1{constructor(t,n){super("dataview:list-pair"),this.key=t,this.value=n}markdown(){return`${Xh.toString(this.key)}: ${Xh.toString(this.value)}`}}class wA extends h1{constructor(t,n){super("dataview:external-link"),this.url=t,this.display=n}markdown(){var t;return`[${(t=this.display)!==null&&t!==void 0?t:this.url}](${this.url})`}}var vD;(function(e){function t(s,u){return new yA(s,u)}e.listPair=t;function n(s,u){return new wA(s,u)}e.externalLink=n;function r(s){return s.$widget==="dataview:list-pair"}e.isListPair=r;function a(s){return s.$widget==="dataview:external-link"}e.isExternalLink=a;function o(s){return r(s)||a(s)}e.isBuiltin=o})(vD||(vD={}));var Mn;(function(e){function t(w){return{type:"variable",name:w}}e.variable=t;function n(w){return{type:"literal",value:w}}e.literal=n;function r(w,D,S){return{type:"binaryop",left:w,op:D,right:S}}e.binaryOp=r;function a(w,D){return{type:"index",object:w,index:D}}e.index=a;function o(w){let D=w.split("."),S=e.variable(D[0]);for(let T=1;T"||w==">="||w=="!="||w=="="}e.isCompareOp=g,e.NULL=e.literal(null)})(Mn||(Mn={}));var Ei;(function(e){function t(p){return{type:"tag",tag:p}}e.tag=t;function n(p){return{type:"csv",path:p}}e.csv=n;function r(p){return{type:"folder",folder:p}}e.folder=r;function a(p,g){return{type:"link",file:p,direction:g?"incoming":"outgoing"}}e.link=a;function o(p,g,w){return{type:"binaryop",left:p,op:g,right:w}}e.binaryOp=o;function s(p,g){return{type:"binaryop",left:p,op:"&",right:g}}e.and=s;function u(p,g){return{type:"binaryop",left:p,op:"|",right:g}}e.or=u;function d(p){return{type:"negate",child:p}}e.negate=d;function m(){return{type:"empty"}}e.empty=m})(Ei||(Ei={}));const yD=new RegExp(f1(),""),Tw={year:et.fromObject({years:1}),years:et.fromObject({years:1}),yr:et.fromObject({years:1}),yrs:et.fromObject({years:1}),month:et.fromObject({months:1}),months:et.fromObject({months:1}),mo:et.fromObject({months:1}),mos:et.fromObject({months:1}),week:et.fromObject({weeks:1}),weeks:et.fromObject({weeks:1}),wk:et.fromObject({weeks:1}),wks:et.fromObject({weeks:1}),w:et.fromObject({weeks:1}),day:et.fromObject({days:1}),days:et.fromObject({days:1}),d:et.fromObject({days:1}),hour:et.fromObject({hours:1}),hours:et.fromObject({hours:1}),hr:et.fromObject({hours:1}),hrs:et.fromObject({hours:1}),h:et.fromObject({hours:1}),minute:et.fromObject({minutes:1}),minutes:et.fromObject({minutes:1}),min:et.fromObject({minutes:1}),mins:et.fromObject({minutes:1}),m:et.fromObject({minutes:1}),second:et.fromObject({seconds:1}),seconds:et.fromObject({seconds:1}),sec:et.fromObject({seconds:1}),secs:et.fromObject({seconds:1}),s:et.fromObject({seconds:1})},Ew={now:()=>st.local(),today:()=>st.local().startOf("day"),yesterday:()=>st.local().startOf("day").minus(et.fromObject({days:1})),tomorrow:()=>st.local().startOf("day").plus(et.fromObject({days:1})),sow:()=>st.local().startOf("week"),"start-of-week":()=>st.local().startOf("week"),eow:()=>st.local().endOf("week"),"end-of-week":()=>st.local().endOf("week"),soy:()=>st.local().startOf("year"),"start-of-year":()=>st.local().startOf("year"),eoy:()=>st.local().endOf("year"),"end-of-year":()=>st.local().endOf("year"),som:()=>st.local().startOf("month"),"start-of-month":()=>st.local().startOf("month"),eom:()=>st.local().endOf("month"),"end-of-month":()=>st.local().endOf("month")},xw=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function bA(e){let t=-1;for(;(t=e.indexOf("|",t+1))>=0;)if(!(t>0&&e[t-1]=="\\"))return[e.substring(0,t).replace(/\\\|/g,"|"),e.substring(t+1)];return[e.replace(/\\\|/g,"|"),void 0]}function DA(e){let[t,n]=bA(e);return _r.infer(t,!1,n)}function Fh(e,t,n){return Q.exports.seqMap(e,Q.exports.seq(Q.exports.optWhitespace,t,Q.exports.optWhitespace,e).many(),(r,a)=>{if(a.length==0)return r;let o=n(r,a[0][1],a[0][3]);for(let s=1;s(a,o)=>{let s=e._(a,o);if(!s.status)return s;for(let u of t){let d=u(s.value)._(a,s.index);if(!d.status)return s;s=d}return s})}const Fo=Q.exports.createLanguage({number:e=>Q.exports.regexp(/-?[0-9]+(\.[0-9]+)?/).map(t=>Number.parseFloat(t)).desc("number"),string:e=>Q.exports.string('"').then(Q.exports.alt(e.escapeCharacter,Q.exports.noneOf('"\\')).atLeast(0).map(t=>t.join(""))).skip(Q.exports.string('"')).desc("string"),escapeCharacter:e=>Q.exports.string("\\").then(Q.exports.any).map(t=>t==='"'?'"':t==="\\"?"\\":"\\"+t),bool:e=>Q.exports.regexp(/true|false|True|False/).map(t=>t.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:e=>Q.exports.seqMap(Q.exports.string("#"),Q.exports.alt(Q.exports.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(t,n)=>t+n.join("")).desc("tag ('#hello/stuff')"),identifier:e=>Q.exports.seqMap(Q.exports.alt(Q.exports.regexp(new RegExp("\\p{Letter}","u")),Q.exports.regexp(yD).desc("text")),Q.exports.alt(Q.exports.regexp(/[0-9\p{Letter}_-]/u),Q.exports.regexp(yD).desc("text")).many(),(t,n)=>t+n.join("")).desc("variable identifier"),link:e=>Q.exports.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(t=>DA(t)).desc("file link"),embedLink:e=>Q.exports.seqMap(Q.exports.string("!").atMost(1),e.link,(t,n)=>(t.length>0&&(n.embed=!0),n)).desc("file link"),binaryPlusMinus:e=>Q.exports.regexp(/\+|-/).map(t=>t).desc("'+' or '-'"),binaryMulDiv:e=>Q.exports.regexp(/\*|\/|%/).map(t=>t).desc("'*' or '/' or '%'"),binaryCompareOp:e=>Q.exports.regexp(/>=|<=|!=|>|<|=/).map(t=>t).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:e=>Q.exports.regexp(/and|or|&|\|/i).map(t=>t.toLowerCase()=="and"?"&":t.toLowerCase()=="or"?"|":t).desc("'and' or 'or'"),rootDate:e=>Q.exports.seqMap(Q.exports.regexp(/\d{4}/),Q.exports.string("-"),Q.exports.regexp(/\d{2}/),(t,n,r)=>st.fromObject({year:Number.parseInt(t),month:Number.parseInt(r)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:e=>Q.exports.alt(...Object.keys(Ew).sort((t,n)=>n.length-t.length).map(Q.exports.string)),date:e=>SA(e.rootDate,t=>Q.exports.seqMap(Q.exports.string("-"),Q.exports.regexp(/\d{2}/),(n,r)=>t.set({day:Number.parseInt(r)})),t=>Q.exports.seqMap(Q.exports.string("T"),Q.exports.regexp(/\d{2}/),(n,r)=>t.set({hour:Number.parseInt(r)})),t=>Q.exports.seqMap(Q.exports.string(":"),Q.exports.regexp(/\d{2}/),(n,r)=>t.set({minute:Number.parseInt(r)})),t=>Q.exports.seqMap(Q.exports.string(":"),Q.exports.regexp(/\d{2}/),(n,r)=>t.set({second:Number.parseInt(r)})),t=>Q.exports.alt(Q.exports.seqMap(Q.exports.string("."),Q.exports.regexp(/\d{3}/),(n,r)=>t.set({millisecond:Number.parseInt(r)})),Q.exports.succeed(t)),t=>Q.exports.alt(Q.exports.seqMap(Q.exports.string("+").or(Q.exports.string("-")),Q.exports.regexp(/\d{1,2}(:\d{2})?/),(n,r)=>t.setZone("UTC"+n+r,{keepLocalTime:!0})),Q.exports.seqMap(Q.exports.string("Z"),()=>t.setZone("utc",{keepLocalTime:!0})),Q.exports.seqMap(Q.exports.string("["),Q.exports.regexp(/[0-9A-Za-z+-\/]+/u),Q.exports.string("]"),(n,r,a)=>t.setZone(r,{keepLocalTime:!0})))).assert(t=>t.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:e=>Q.exports.alt(e.dateShorthand.map(t=>Ew[t]()),e.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:e=>Q.exports.alt(...Object.keys(Tw).sort((t,n)=>n.length-t.length).map(Q.exports.string)),duration:e=>Q.exports.seqMap(e.number,Q.exports.optWhitespace,e.durationType,(t,n,r)=>Tw[r].mapUnits(a=>a*t)).sepBy1(Q.exports.string(",").trim(Q.exports.optWhitespace).or(Q.exports.optWhitespace)).map(t=>t.reduce((n,r)=>n.plus(r))).desc("duration like 4hr2min"),rawNull:e=>Q.exports.string("null"),tagSource:e=>e.tag.map(t=>Ei.tag(t)),csvSource:e=>Q.exports.seqMap(Q.exports.string("csv(").skip(Q.exports.optWhitespace),e.string,Q.exports.string(")"),(t,n,r)=>Ei.csv(n)),linkIncomingSource:e=>e.link.map(t=>Ei.link(t.path,!0)),linkOutgoingSource:e=>Q.exports.seqMap(Q.exports.string("outgoing(").skip(Q.exports.optWhitespace),e.link,Q.exports.string(")"),(t,n,r)=>Ei.link(n.path,!1)),folderSource:e=>e.string.map(t=>Ei.folder(t)),parensSource:e=>Q.exports.seqMap(Q.exports.string("("),Q.exports.optWhitespace,e.source,Q.exports.optWhitespace,Q.exports.string(")"),(t,n,r,a,o)=>r),negateSource:e=>Q.exports.seqMap(Q.exports.alt(Q.exports.string("-"),Q.exports.string("!")),e.atomSource,(t,n)=>Ei.negate(n)),atomSource:e=>Q.exports.alt(e.parensSource,e.negateSource,e.linkOutgoingSource,e.linkIncomingSource,e.folderSource,e.tagSource,e.csvSource),binaryOpSource:e=>Fh(e.atomSource,e.binaryBooleanOp.map(t=>t),Ei.binaryOp),source:e=>e.binaryOpSource,variableField:e=>e.identifier.chain(t=>xw.includes(t.toUpperCase())?Q.exports.fail("Variable fields cannot be a keyword ("+xw.join(" or ")+")"):Q.exports.succeed(Mn.variable(t))).desc("variable"),numberField:e=>e.number.map(t=>Mn.literal(t)).desc("number"),stringField:e=>e.string.map(t=>Mn.literal(t)).desc("string"),boolField:e=>e.bool.map(t=>Mn.literal(t)).desc("boolean"),dateField:e=>Q.exports.seqMap(Q.exports.string("date("),Q.exports.optWhitespace,e.datePlus,Q.exports.optWhitespace,Q.exports.string(")"),(t,n,r,a,o)=>Mn.literal(r)).desc("date"),durationField:e=>Q.exports.seqMap(Q.exports.string("dur("),Q.exports.optWhitespace,e.duration,Q.exports.optWhitespace,Q.exports.string(")"),(t,n,r,a,o)=>Mn.literal(r)).desc("duration"),nullField:e=>e.rawNull.map(t=>Mn.NULL),linkField:e=>e.link.map(t=>Mn.literal(t)),listField:e=>e.field.sepBy(Q.exports.string(",").trim(Q.exports.optWhitespace)).wrap(Q.exports.string("[").skip(Q.exports.optWhitespace),Q.exports.optWhitespace.then(Q.exports.string("]"))).map(t=>Mn.list(t)).desc("list ('[1, 2, 3]')"),objectField:e=>Q.exports.seqMap(e.identifier.or(e.string),Q.exports.string(":").trim(Q.exports.optWhitespace),e.field,(t,n,r)=>({name:t,value:r})).sepBy(Q.exports.string(",").trim(Q.exports.optWhitespace)).wrap(Q.exports.string("{").skip(Q.exports.optWhitespace),Q.exports.optWhitespace.then(Q.exports.string("}"))).map(t=>{let n={};for(let r of t)n[r.name]=r.value;return Mn.object(n)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:e=>Q.exports.alt(e.date,e.duration.map(t=>NT(t)),e.string,e.tag,e.embedLink,e.bool,e.number,e.rawNull),inlineFieldList:e=>e.atomInlineField.sepBy(Q.exports.string(",").trim(Q.exports.optWhitespace).lookahead(e.atomInlineField)),inlineField:e=>Q.exports.alt(Q.exports.seqMap(e.atomInlineField,Q.exports.string(",").trim(Q.exports.optWhitespace),e.inlineFieldList,(t,n,r)=>[t].concat(r)),e.atomInlineField),atomField:e=>Q.exports.alt(e.embedLink.map(t=>Mn.literal(t)),e.negatedField,e.linkField,e.listField,e.objectField,e.lambdaField,e.parensField,e.boolField,e.numberField,e.stringField,e.dateField,e.durationField,e.nullField,e.variableField),indexField:e=>Q.exports.seqMap(e.atomField,Q.exports.alt(e.dotPostfix,e.indexPostfix,e.functionPostfix).many(),(t,n)=>{let r=t;for(let a of n)switch(a.type){case"dot":r=Mn.index(r,Mn.literal(a.field));break;case"index":r=Mn.index(r,a.field);break;case"function":r=Mn.func(r,a.fields);break}return r}),negatedField:e=>Q.exports.seqMap(Q.exports.string("!"),e.indexField,(t,n)=>Mn.negate(n)).desc("negated field"),parensField:e=>Q.exports.seqMap(Q.exports.string("("),Q.exports.optWhitespace,e.field,Q.exports.optWhitespace,Q.exports.string(")"),(t,n,r,a,o)=>r),lambdaField:e=>Q.exports.seqMap(e.identifier.sepBy(Q.exports.string(",").trim(Q.exports.optWhitespace)).wrap(Q.exports.string("(").trim(Q.exports.optWhitespace),Q.exports.string(")").trim(Q.exports.optWhitespace)),Q.exports.string("=>").trim(Q.exports.optWhitespace),e.field,(t,n,r)=>({type:"lambda",arguments:t,value:r})),dotPostfix:e=>Q.exports.seqMap(Q.exports.string("."),e.identifier,(t,n)=>({type:"dot",field:n})),indexPostfix:e=>Q.exports.seqMap(Q.exports.string("["),Q.exports.optWhitespace,e.field,Q.exports.optWhitespace,Q.exports.string("]"),(t,n,r,a,o)=>({type:"index",field:r})),functionPostfix:e=>Q.exports.seqMap(Q.exports.string("("),Q.exports.optWhitespace,e.field.sepBy(Q.exports.string(",").trim(Q.exports.optWhitespace)),Q.exports.optWhitespace,Q.exports.string(")"),(t,n,r,a,o)=>({type:"function",fields:r})),binaryMulDivField:e=>Fh(e.indexField,e.binaryMulDiv,Mn.binaryOp),binaryPlusMinusField:e=>Fh(e.binaryMulDivField,e.binaryPlusMinus,Mn.binaryOp),binaryCompareField:e=>Fh(e.binaryPlusMinusField,e.binaryCompareOp,Mn.binaryOp),binaryBooleanField:e=>Fh(e.binaryCompareField,e.binaryBooleanOp,Mn.binaryOp),binaryOpField:e=>e.binaryBooleanField,field:e=>e.binaryOpField});function IA(e){try{return sv.success(Fo.field.tryParse(e))}catch(t){return sv.failure(""+t)}}var lv;(function(e){function t(r,a){return{name:r,field:a}}e.named=t;function n(r,a){return{field:r,direction:a}}e.sortBy=n})(lv||(lv={}));function TA(e){return Q.exports.custom((t,n)=>(r,a)=>{let o=e._(r,a);return o.status?Object.assign({},o,{value:[o.value,r.substring(a,o.index)]}):o})}function EA(e){return e.split(/[\r\n]+/).map(t=>t.trim()).join("")}const xA=Q.exports.createLanguage({queryType:e=>Q.exports.alt(Q.exports.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(t=>t.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:e=>Q.exports.seqMap(Fo.field.skip(Q.exports.whitespace),Q.exports.regexp(/AS/i).skip(Q.exports.whitespace),Fo.identifier.or(Fo.string),(t,n,r)=>lv.named(r,t)),namedField:e=>Q.exports.alt(e.explicitNamedField,TA(Fo.field).map(([t,n])=>lv.named(EA(n),t))),sortField:e=>Q.exports.seqMap(Fo.field.skip(Q.exports.optWhitespace),Q.exports.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(t,n)=>{let r=n.length==0?"ascending":n[0].toLowerCase();return r=="desc"&&(r="descending"),r=="asc"&&(r="ascending"),{field:t,direction:r}}),headerClause:e=>e.queryType.skip(Q.exports.whitespace).chain(t=>{switch(t){case"table":return Q.exports.seqMap(Q.exports.regexp(/WITHOUT\s+ID/i).skip(Q.exports.optWhitespace).atMost(1),Q.exports.sepBy(e.namedField,Q.exports.string(",").trim(Q.exports.optWhitespace)),(n,r)=>({type:"table",fields:r,showId:n.length==0}));case"list":return Q.exports.seqMap(Q.exports.regexp(/WITHOUT\s+ID/i).skip(Q.exports.optWhitespace).atMost(1),Fo.field.atMost(1),(n,r)=>({type:"list",format:r.length==1?r[0]:void 0,showId:n.length==0}));case"task":return Q.exports.succeed({type:"task"});case"calendar":return Q.exports.seqMap(e.namedField,n=>({type:"calendar",showId:!0,field:n}));default:return Q.exports.fail(`Unrecognized query type '${t}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:e=>Q.exports.seqMap(Q.exports.regexp(/FROM/i),Q.exports.whitespace,Fo.source,(t,n,r)=>r),whereClause:e=>Q.exports.seqMap(Q.exports.regexp(/WHERE/i),Q.exports.whitespace,Fo.field,(t,n,r)=>({type:"where",clause:r})).desc("WHERE "),sortByClause:e=>Q.exports.seqMap(Q.exports.regexp(/SORT/i),Q.exports.whitespace,e.sortField.sepBy1(Q.exports.string(",").trim(Q.exports.optWhitespace)),(t,n,r)=>({type:"sort",fields:r})).desc("SORT field [ASC/DESC]"),limitClause:e=>Q.exports.seqMap(Q.exports.regexp(/LIMIT/i),Q.exports.whitespace,Fo.field,(t,n,r)=>({type:"limit",amount:r})).desc("LIMIT "),flattenClause:e=>Q.exports.seqMap(Q.exports.regexp(/FLATTEN/i).skip(Q.exports.whitespace),e.namedField,(t,n)=>({type:"flatten",field:n})).desc("FLATTEN [AS ]"),groupByClause:e=>Q.exports.seqMap(Q.exports.regexp(/GROUP BY/i).skip(Q.exports.whitespace),e.namedField,(t,n)=>({type:"group",field:n})).desc("GROUP BY [AS ]"),clause:e=>Q.exports.alt(e.fromClause,e.whereClause,e.sortByClause,e.limitClause,e.groupByClause,e.flattenClause),query:e=>Q.exports.seqMap(e.headerClause.trim(Q.exports.optWhitespace),e.fromClause.trim(Q.exports.optWhitespace).atMost(1),e.clause.trim(Q.exports.optWhitespace).many(),(t,n,r)=>({header:t,source:n.length==0?Ei.folder(""):n[0],operations:r,settings:c1}))}),CA=e=>{var t;return e?(t=e.plugins.plugins.dataview)===null||t===void 0?void 0:t.api:window.DataviewAPI},MA=e=>e.plugins.enabledPlugins.has("dataview");bs.DATE_SHORTHANDS=Ew;bs.DURATION_TYPES=Tw;bs.EXPRESSION=Fo;bs.KEYWORDS=xw;bs.QUERY_LANGUAGE=xA;var NA=bs.getAPI=CA;bs.isPluginEnabled=MA;bs.parseField=IA;async function kA(e,t,n,r,a){var E,A;const{vault:o,metadataCache:s}=Ee.getState().dailyNotesState.app===void 0?app:Ee.getState().dailyNotesState.app,u=Ee.getState().dailyNotesState.settings,d=e.replace(/\n/g,"
");if(n===void 0)return;const m=s.getFirstLinkpathDest("",n),p=x.moment(),g=p.format("YYYYMMDDHHmmss"),w=r.slice(14),D=" ",S=g+" "+d.trim(),T=D+"- "+g+" "+d.trim();if(m){let N;if(u!=null&&u.CommentOnMemos&&(u!=null&&u.CommentsInOriginalNotes)){const P=NA();if(P!==void 0)try{N=(A=(E=P.page(m.path))==null?void 0:E.file.lists.values)==null?void 0:A.filter(L=>L.line===parseInt(w))}catch(L){console.error(L)}}const R=await o.read(m);let F=0;N[0].children.values.length>0?F=N[0].children.values[N[0].children.values.length-1].line:F=N[0].line;const H=await AA(T,R,F);if(await o.modify(m,H.content),t)return{id:g+(F+1),content:S,deletedAt:"",createdAt:p.format("YYYY/MM/DD HH:mm:ss"),updatedAt:p.format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",path:m.path,hasId:"",linkId:a}}}async function AA(e,t,n){if(n===-1)return{content:`${t} ${e}`,posNum:-1};const r=t.split(` `),a=r.slice(0,n+1).join(` `),o=r.slice(n+1).join(` `);return/^\s*$/g.test(r[n+1])?{content:`${a} ${e} ${o}`,posNum:n}:{content:`${a} ${e} ${o}`,posNum:n}}const m1=async e=>{const t=rt.getState().app,n=t.metadataCache.getFirstLinkpathDest("",e);if(!n){new x.Notice(k("File not found for the given thino path"));return}await t.workspace.getLeaf("split").openFile(n)},p1=async(e,t)=>{const{app:n}=rt.getState(),r=parseInt(e.slice(14)),a=n.metadataCache.getFirstLinkpathDest("",t);if(!x.Platform.isMobile)await n.workspace.getLeaf("split").openFile(a,{eState:{line:r}});else{let o=n.workspace.activeLeaf;o===null&&(o=n.workspace.getLeaf(!1)),await o.openFile(a,{eState:{line:r}})}},g1=async(e,t)=>{var d;const n=rt.getState().app,r=n.metadataCache.getFirstLinkpathDest("",t);if(!r){new x.Notice(k("File not found for the given thino path"));return}let a="";try{a=await n.vault.read(r)}catch(m){console.error(m),a=await n.vault.cachedRead(r)}const s=a.split(/\r?\n/).findIndex(m=>m.contains(e)),u=n.workspace.getLeaf("split");await u.openFile(r,{eState:{line:s}});try{(d=u.view.editor)==null||d.setCursor({line:s,ch:1})}catch(m){console.error(m)}},v1=async(e,t)=>{var u;const n=rt.getState().app,r=(d,m)=>{var g;const p=(g=Array.from(d.nodes.values()))==null?void 0:g.find(w=>w.id===m);return p?(d.selectOnly(p),d.zoomToSelection(),!0):!1},a=n.workspace.getLeavesOfType("canvas");for(const d of a){const m=d.view;if(((u=m==null?void 0:m.file)==null?void 0:u.path)===t&&r(m.canvas,e))return}const o=n.metadataCache.getFirstLinkpathDest("",t);if(!o){new x.Notice(k("File not found for the given thino path"));return}const s=n.workspace.getLeaf("split");await s.openFile(o),setTimeout(()=>{var d;r((d=s.view)==null?void 0:d.canvas,e)},10)},OA="https://api.thino.pkmer.cn/test",Zd=OA,FA="unknown",PA=/!\[(?[^\]]+)\]\((?[^)]+)\)/g;function jA(e){return e.substring(e.lastIndexOf(".")+1)}function LA(e){return{id:e.id,createdAt:Date.now().toString(),filename:e.id,type:`${jA(e.id)}`,size:e.size.toString()}}function RA(e){const t=e==null?void 0:e.matchAll(PA);return t?Array.from(t).map(n=>{var r;return LA({url:(r=n.groups)==null?void 0:r.link,id:FA,size:0,mtime:""})}).filter(n=>n.type!="html"):[]}function Em(e){var t;return{id:e.id,createdAt:x.moment(e.ctime.toString(),"x").format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.moment(e.mtime.toString(),"x").format("YYYY/MM/DD HH:mm:ss"),deletedAt:(t=e.ttime)!=null&&t.toString()?x.moment(e.ttime.toString(),"x").format("YYYY-MM-DD HH:mm:ss"):"",rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,resourceList:RA(e.content),creatorName:"thino",sourceType:(e==null?void 0:e.thinoType)||"FILE",visibility:"PUBLIC",localId:e.originalId,deleted:!!e.dtime}}async function _A(e){const n={url:`${Zd}/thino/getThinos${e?`?since=${e}&includeDeleted=true`:""}`,method:"GET",headers:{Authorization:`Bearer ${Wd()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to fetch memos: ${r.status}`);try{return r.json.payload.map(o=>Em(o))}catch(a){console.error(`Error processing memo response: ${a}`)}}).catch(r=>(console.error(r),[]))}function Wd(){const e=Ee.getState().dailyNotesState.app||app;return(e==null?void 0:e.loadLocalStorage("tokenForSync"))||""}async function kT(e){const t=`${Zd}/thino/createThino`,n={content:e.content,thinoType:(e==null?void 0:e.thinoType)||"FILE",pinned:!1,rowStatus:"NORMAL",encrypted:!1},r={url:t,method:"POST",contentType:"application/json",body:JSON.stringify(n),headers:{Authorization:`Bearer ${Wd()}`}};return x.requestUrl(r).then(a=>{a.status>=400&&console.error(`Failed to create memo: ${a.status}`);try{const o=a.json;return Em(o.payload)}catch(o){console.error(`Error processing memo creation response: ${o}`)}}).catch(a=>(console.error(a),null))}function HA(e){return{id:e.id,ctime:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").valueOf(),mtime:x.moment(e.updatedAt,"YYYY/MM/DD HH:mm:ss").valueOf(),ttime:e.deletedAt?x.moment(e.deletedAt,"YYYY/MM/DD HH:mm:ss").valueOf():void 0,rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,encrypted:!1,thinoType:e.sourceType==="DAILY"?"DAILY":"FILE",tags:[]}}async function BA(e){const t=`${Zd}/thino/createThinosByData`,n=e.map(a=>HA(a)),r={url:t,method:"POST",contentType:"application/json",body:JSON.stringify(n),headers:{Authorization:`Bearer ${Wd()}`}};return x.requestUrl(r).then(a=>{a.status>=400&&console.error(`Failed to create thinos: ${a.status}`);try{return a.json.payload.map(u=>Em(u))}catch(o){console.error(`Error processing thinos creation response: ${o}`)}}).catch(a=>(console.error(a),[]))}async function M0(e){const n={url:`${Zd}/thino/updateThinoById/${e.id}`,method:"POST",contentType:"application/json",body:JSON.stringify(e),headers:{Authorization:`Bearer ${Wd()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to update memo: ${r.status}`);try{const a=r.json;return Em(a.payload)}catch(a){console.error(`Error processing memo update response: ${a}`)}}).catch(r=>(console.error(r),null))}async function AT(e){const n={url:`${Zd}/thino/recoverThinoFromTrash/${e}`,method:"POST",headers:{Authorization:`Bearer ${Wd()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to recover memo: ${r.status}`);try{const a=r.json;return Em(a.payload)}catch(a){console.error(`Error processing memo recovery response: ${a}`)}}).catch(r=>(console.error(r),null))}async function YA(e){const n={url:`${Zd}/thino/deleteThinoById/${e}`,method:"DELETE",headers:{Authorization:`Bearer ${Wd()}`}};return x.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to delete memo: ${r.status}`)}).catch(r=>(console.error(r),null))}class zA{constructor(){he(this,"initialized",!1)}getState(){return Ee.getState().memoState}async fetchAllMemos(){const t=rt.getState().settings,n=await va.getMyMemos(t.EnabledLocationList.map(o=>o.value)),r=[...n.memos],a=[...n.commentMemos];return Ee.dispatch({type:"SET_MEMOS",payload:{memos:r}}),Ee.dispatch({type:"SET_COMMENT_MEMOS",payload:{commentMemos:a}}),this.initialized||(this.initialized=!0,Qe.setLoaded(!0)),r}async updateTypeMemos(t){const n=await va.updateSpecificTypeMemo(t),r=this.getState().memos.filter(a=>a.sourceType!==t);Ee.dispatch({type:"SET_MEMOS",payload:{memos:[...r,...n.memos]}})}async removeTypeMemos(t){const n=this.getState().memos.filter(r=>r.sourceType!==t);Ee.dispatch({type:"SET_MEMOS",payload:{memos:[...n]}})}async fetchDeletedMemos(){const t=await va.getMyDeletedMemos();return t.sort((n,r)=>Re.getTimeStampByDate(r.deletedAt)-Re.getTimeStampByDate(n.deletedAt)),t}pushMemo(t){Ee.dispatch({type:"INSERT_MEMO",payload:{memo:{...t}}})}pushCommentMemo(t){Ee.dispatch({type:"INSERT_COMMENT_MEMO",payload:{memo:{...t}}})}getMemoById(t){for(const n of this.getState().memos)if(n.id===t)return n;return null}getCommentMemoById(t){for(const n of this.getState().commentMemos)if(n.id===t)return n;return null}getMemoByWebId(t){for(const n of this.getState().memos)if(n.webId===t||n.id===t)return n;return null}async updateMemoById(t,n,r){const a=this.getMemoByWebId(t);if(!a)return;let o=null;const s=r?{}:{content:n.content,rowStatus:n.rowStatus,pinned:n.pinned,deleted:!!n.deletedAt,thinoType:n.thinoType??""};switch(a.sourceType){case"DAILY":o=await Ti(a,{id:a.id,webId:n.id,...s});break;case"CANVAS":o=await Ii(a,{id:a.id,webId:n.id,...s});break;case"MULTI":o=await Po(a,{id:a.id,webId:n.id,...s});break;case"FILE":o=await Si(a,{id:a.id,webId:n.id,...s});break}if(!o)return a;Ee.dispatch({type:"EDIT_MEMO",payload:o})}async archiveThinoBulk(t){const n=[];for(const r of t){let a;switch(r.sourceType){case"DAILY":a=await Ti(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"CANVAS":a=await Ii(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"MULTI":a=await Po(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"FILE":a=await Si(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break}}return n.length>0?(Ee.dispatch({type:"ARCHIVE_MEMO_BY_ID_BULK",payload:n}),n):t}async archiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await Ti(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"CANVAS":n=await Ii(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"MULTI":n=await Po(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"FILE":n=await Si(t,{id:t.id,rowStatus:"ARCHIVED"});break}return n?(Ee.dispatch({type:"ARCHIVE_MEMO_BY_ID",payload:n}),n):t}async unarchiveThinoBulk(t){const n=[];for(const r of t){let a;switch(r.sourceType){case"DAILY":a=await Ti(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"CANVAS":a=await Ii(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"MULTI":a=await Po(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"FILE":a=await Si(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break}}return n.length>0?(Ee.dispatch({type:"ARCHIVE_MEMO_BY_ID_BULK",payload:n}),n):t}async unarchiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await Ti(t,{id:t.id,rowStatus:"NORMAL"});break;case"CANVAS":n=await Ii(t,{id:t.id,rowStatus:"NORMAL"});break;case"MULTI":n=await Po(t,{id:t.id,rowStatus:"NORMAL"});break;case"FILE":n=await Si(t,{id:t.id,rowStatus:"NORMAL"});break}return Ee.dispatch({type:"UNARCHIVE_MEMO_BY_ID",payload:n}),n}async hideMemoById(t){const n=this.getMemoById(t);if(!n)return n;let r=null;switch(n.sourceType){case"DAILY":r=await Ti(n,{id:n.id,deleted:!0});break;case"CANVAS":r=await Ii(n,{id:n.id,deleted:!0});break;case"MULTI":r=await Po(n,{id:n.id,deleted:!0});break;case"FILE":r=await Si(n,{id:n.id,deleted:!0});break}if(!r)return n;if(r)return r}async restoreMemoById(t){return await va.restoreMemo(t)}async deleteMemoById(t,n){const r=this.getMemoById(t);try{switch(r.sourceType){case"DAILY":await va.deleteMemoInDailyNote(r);break;case"CANVAS":await va.deleteMemoInCanvas(r);break;case"MULTI":await va.deleteMemoInMultiFiles(r);break;case"FILE":await va.deleteMemoInSingleFile(r);break}Ee.dispatch({type:"DELETE_MEMO_BY_ID",payload:{id:t}})}catch(u){console.error(u),new x.Notice(k("Failed to delete memo"))}if(n&&n==="local")return;const a=rt.getState().settings,o=rt.getState().app;!(o!=null&&o.loadLocalStorage("tokenForSync"))||!a.startSync||r.webId&&await YA(r.webId)}async removeMemosInFile(t,n){var a,o;const r=[];try{if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n)await pw(t,r);else if(t.path.contains("thino.canvas"))await gw(t,r);else if((a=t==null?void 0:t.parent)!=null&&a.path.contains(n)||!(t!=null&&t.parent)&&!((o=t==null?void 0:t.parent)!=null&&o.path)){const u=this.getState().memos.filter(d=>d.path.trim()===t.path.trim());u.length>0&&r.push(...u)}else t.path.endsWith(".md")&&t.path.contains(".thino")&&await mw(t,r);const s=r.map(u=>u.id);Ee.dispatch({type:"DELETE_MEMO_BY_ID_BATCH",payload:{ids:s}})}catch(s){console.error(s)}}async updateMemosInFile(t,n){const r=[],a=async()=>{if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n){await pw(t,r);return}else if(t.path.contains("thino.canvas")){await gw(t,r);return}else if(t!=null&&t.parent.path.contains(n)){await CI(t,r);return}else if(t.path.endsWith(".md")&&t.path.contains(".thino")){await mw(t,r);return}};try{await a(),Ee.dispatch({type:"UPDATE_MEMO_BATCH",payload:{memos:r,path:t.path}})}catch(o){console.error(o)}}async updateMemoProperty(t){const n=Re.randomId(16),r=await Po(t,{id:n});Ee.dispatch({type:"EDIT_MEMO_PATH",payload:r})}editMemo(t){const n=t.webId;Ee.dispatch({type:"EDIT_MEMO",payload:t});const r=rt.getState().settings,a=rt.getState().app;if(!(!(a!=null&&a.loadLocalStorage("tokenForSync"))||!r.startSync))try{t&&n&&M0({id:n,content:t.content,rowStatus:t.rowStatus,pinned:t.pinned,ttime:t.deletedAt?x.moment(t.deletedAt,"YYYY/MM/DD HH:mm:ss").valueOf():0,thinoType:t.sourceType==="DAILY"?"DAILY":"FILE"})}catch(s){console.error(s)}}editMemoBulk(t){for(const n of t)this.editMemo(n);this.updateTagsState()}editCommentMemo(t){Ee.dispatch({type:"EDIT_COMMENT_MEMO",payload:t})}getThinoViaKeyword(t){const{memos:n}=this.getState();return n.filter(a=>a.content.toLowerCase().includes(t==null?void 0:t.toLowerCase()))}updateTagsState(){const{memos:t}=this.getState(),n=new Set,r={};for(const a of t){const o=a.content.replace(/<[^>]*>/g,"").replace(/\`\`\`[a-z]*\n[\s\S]*?\n\`\`\`/g,"").replace(/\`([^\`].*?)\`/g,"");if(a.deletedAt!==""&&a.deletedAt)continue;[...Array.from(o.match(An)||[]),...Array.from(o.match($n)||[]),...Array.from(o.match(hr)||[])].forEach(u=>{const d=u.replace(An,"$1").replace($n,"$1").replace(hr,"$2").trim();/^\d+$/.test(d)||(n.add(d),r[d]=(r[d]||0)+1)})}Ee.dispatch({type:"SET_TAGS",payload:{tags:Array.from(n),tagsNum:r}})}clearMemos(){Ee.dispatch({type:"SET_MEMOS",payload:{memos:[]}})}async getLinkedMemos(t){const{memos:n}=this.getState();return n.filter(r=>r.content.includes(t))}async getCommentMemos(t){const{memos:n}=this.getState();return n.filter(r=>r.content.includes("comment: "+t))}async createMemoMultiFile({content:t,isList:n}){return await qN({content:t,isList:n})}async createMemoSingleFile({content:t,isList:n}){return await JN({content:t,isList:n})}async createOrPatchThinoFromWeb(t){const n=this.getState().memos;if(t.localId&&(n!=null&&n.some(o=>o.id===t.localId)))return await this.updateMemoById(t.localId,t,!0),null;if(n!=null&&n.some(o=>o.id===t.id)||n!=null&&n.some(o=>o.webId===t.id))return await this.updateMemoById(t.id,t,!1),null;let r=t.sourceType;const a=rt.getState().settings;switch(a&&(a!=null&&a.saveThinoType)&&(r=a.saveThinoType!=="FILE"?a.saveThinoType:t.sourceType),r){case"FILE":case"MULTI":case"CANVAS":return await Yb(t);case"DAILY":return await QN(t);default:return await Yb(t)}}async initSync(){const n=this.getState().memos.filter(a=>!a.webId),r=await BA(n);for(const a of r)await this.createOrPatchThinoFromWeb(a)}async createMemoCanvas({text:t,isList:n}){return await KN({content:t,isList:n})}async createMemoDaily(t,n){return await zb(t,n)}async pinMemoById(t){const n=this.getMemoById(t),r=await fk(n);Ee.dispatch({type:"PIN_MEMO",payload:r});try{const a=rt.getState().settings,o=rt.getState().app;if((o==null?void 0:o.loadLocalStorage("tokenForSync"))&&a.startSync){const u=await M0({id:r.webId,pinned:!0});this.editMemo(u)}}catch(a){console.error(a)}}async unpinMemoById(t){const n=this.getMemoById(t),r=await hk(n);Ee.dispatch({type:"PIN_MEMO",payload:r});try{const a=rt.getState().settings,o=rt.getState().app;if((o==null?void 0:o.loadLocalStorage("tokenForSync"))&&a.startSync){const u=await M0({id:r.webId,pinned:!1});this.editMemo(u)}}catch(a){console.error(a)}}async createCommentMemo(t,n,r,a,o){return await kA(t,n,r,a,o)}async importMemos(t,n,r){return await zb(t,n,r)}async createThino({content:t,isList:n,type:r}){let a=null;switch(r.toLowerCase()){case"canvas":a=await Ie.createMemoCanvas({text:t,isList:n});break;case"multi":a=await Ie.createMemoMultiFile({content:t,isList:n});break;case"daily":a=await Ie.createMemoDaily(t,n);break;case"file":a=await Ie.createMemoSingleFile({content:t,isList:n});break;default:a=await Ie.createMemoDaily(t,n);break}const o=rt.getState().settings,s=rt.getState().app,u=s==null?void 0:s.loadLocalStorage("tokenForSync");if(a&&u&&o.startSync){const d=await kT({content:t,thinoType:r==="DAILY"?"DAILY":"FILE"});await this.updateMemoById(a.id,d,!0)}return a}async openThinoByID(t){const n=this.getMemoById(t);if(n)switch(n.sourceType){case"DAILY":await p1(n.id,n.path);break;case"CANVAS":await v1(n.id,n.path);break;case"MULTI":await m1(n.path);break;case"FILE":await g1(n.id,n.path);break}}async updateMemo(t,n,r){const a=this.getMemoById(t);if(a){let o=null;switch(a.sourceType){case"DAILY":o=await Ti(a,{id:a.id,content:n,thinoType:r||""});break;case"CANVAS":o=await Ii(a,{id:a.id,content:n,thinoType:r||""});break;case"MULTI":o=await Po(a,{id:a.id,content:n,thinoType:r||""});break;case"FILE":o=await Si(a,{id:a.id,content:n,thinoType:r||""})}if(o)return o}return a}}const Ie=new zA;class UA{getState(){return Ee.getState().queryState}async getMyAllQueries(){const t=We.getState().query.filter,n=this.getQueryById(t),r=await va.getMyQueries();return Ee.dispatch({type:"SET_QUERIES",payload:{queries:[...r,...n?[n]:[]]}}),r}getQueryById(t){return this.getState().queries.find(n=>n.id===t)}pushQuery(t){Ee.dispatch({type:"INSERT_QUERY",payload:{query:{...t}}})}editQuery(t){Ee.dispatch({type:"UPDATE_QUERY",payload:t})}async deleteQuery(t){await va.deleteQueryById(t),Ee.dispatch({type:"DELETE_QUERY_BY_ID",payload:{id:t}})}async createQuery(t,n){return await va.createQuery(t,n)}createTempQuery(t,n){return EN(t,n)}async updateQuery(t,n,r){return await va.updateQuery(t,n,r)}async pinQuery(t){await va.pinQuery(t)}async unpinQuery(t){await va.unpinQuery(t)}}const tn=new UA;class VA{async upload(t){const{vault:n,fileManager:r}=Ee.getState().dailyNotesState.app,a=await t.arrayBuffer(),o=ZA(t.type),s=ws(),u=x.moment(),d=kv(u,s);let m;if(d)d instanceof x.TFile&&(m=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,o,d),a));else{const p=await yI(u);m=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,o,p),a)}return r.generateMarkdownLink(m,m.path,"","")}async parseHtml(t){const n=await t.text(),r=document.createElement("html");r.innerHTML=n;const a=Array.from(r.getElementsByClassName("memo"));for(const o of a){const s=o.getElementsByClassName("content")[0],u=x.htmlToMarkdown(s.innerHTML),d=await Ie.importMemos(u,!0,x.moment(o.getElementsByClassName("time")[0].innerHTML));Ie.pushMemo(d)}}}const ZA=e=>{var t;return(t=/^image\/(.+)$/.exec(e))==null?void 0:t[1]},y1=new VA;var hs={},OT={exports:{}},ga={},N0={exports:{}},k0={},wD;function WA(){return wD||(wD=1,function(e){function t(se,we){var Z=se.length;se.push(we);e:for(;0>>1,X=se[$];if(0>>1;$a(be,Z))kea(Be,be)?(se[$]=Be,se[ke]=Z,$=ke):(se[$]=be,se[De]=Z,$=De);else if(kea(Be,Z))se[$]=Be,se[ke]=Z,$=ke;else break e}}return we}function a(se,we){var Z=se.sortIndex-we.sortIndex;return Z!==0?Z:se.id-we.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var d=[],m=[],p=1,g=null,w=3,D=!1,S=!1,T=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(se){for(var we=n(m);we!==null;){if(we.callback===null)r(m);else if(we.startTime<=se)r(m),we.sortIndex=we.expirationTime,t(d,we);else break;we=n(m)}}function F(se){if(T=!1,R(se),!S)if(n(d)!==null)S=!0,ge(H);else{var we=n(m);we!==null&&Te(F,we.startTime-se)}}function H(se,we){S=!1,T&&(T=!1,A(z),z=-1),D=!0;var Z=w;try{for(R(we),g=n(d);g!==null&&(!(g.expirationTime>we)||se&&!K());){var $=g.callback;if(typeof $=="function"){g.callback=null,w=g.priorityLevel;var X=$(g.expirationTime<=we);we=e.unstable_now(),typeof X=="function"?g.callback=X:g===n(d)&&r(d),R(we)}else r(d);g=n(d)}if(g!==null)var ve=!0;else{var De=n(m);De!==null&&Te(F,De.startTime-we),ve=!1}return ve}finally{g=null,w=Z,D=!1}}var P=!1,L=null,z=-1,U=5,W=-1;function K(){return!(e.unstable_now()-Wse||125$?(se.sortIndex=Z,t(m,se),n(d)===null&&se===n(m)&&(T?(A(z),z=-1):T=!0,Te(F,Z-$))):(se.sortIndex=X,t(d,se),S||D||(S=!0,ge(H))),se},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(se){var we=w;return function(){var Z=w;w=we;try{return se.apply(this,arguments)}finally{w=Z}}}}(k0)),k0}var bD;function $A(){return bD||(bD=1,N0.exports=WA()),N0.exports}var DD;function GA(){if(DD)return ga;DD=1;var e=O,t=$A();function n(i){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+i,h=1;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,m=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},g={};function w(i){return d.call(g,i)?!0:d.call(p,i)?!1:m.test(i)?g[i]=!0:(p[i]=!0,!1)}function D(i,l,h,v){if(h!==null&&h.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return v?!1:h!==null?!h.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function S(i,l,h,v){if(l===null||typeof l>"u"||D(i,l,h,v))return!0;if(v)return!1;if(h!==null)switch(h.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function T(i,l,h,v,I,C,_){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=v,this.attributeNamespace=I,this.mustUseProperty=h,this.propertyName=i,this.type=l,this.sanitizeURL=C,this.removeEmptyString=_}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){E[i]=new T(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var l=i[0];E[l]=new T(l,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){E[i]=new T(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){E[i]=new T(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){E[i]=new T(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){E[i]=new T(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){E[i]=new T(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){E[i]=new T(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){E[i]=new T(i,5,!1,i.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function N(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var l=i.replace(A,N);E[l]=new T(l,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var l=i.replace(A,N);E[l]=new T(l,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var l=i.replace(A,N);E[l]=new T(l,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){E[i]=new T(i,1,!1,i.toLowerCase(),null,!1,!1)}),E.xlinkHref=new T("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){E[i]=new T(i,1,!1,i.toLowerCase(),null,!0,!0)});function R(i,l,h,v){var I=E.hasOwnProperty(l)?E[l]:null;(I!==null?I.type!==0:v||!(2G||I[_]!==C[G]){var ee=` `+I[_].replace(" at new "," at ");return i.displayName&&ee.includes("")&&(ee=ee.replace("",i.displayName)),ee}while(1<=_&&0<=G);break}}}finally{ve=!1,Error.prepareStackTrace=h}return(i=i?i.displayName||i.name:"")?X(i):""}function be(i){switch(i.tag){case 5:return X(i.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("SuspenseList");case 0:case 2:case 15:return i=De(i.type,!1),i;case 11:return i=De(i.type.render,!1),i;case 1:return i=De(i.type,!0),i;default:return""}}function ke(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case L:return"Fragment";case P:return"Portal";case U:return"Profiler";case z:return"StrictMode";case ce:return"Suspense";case fe:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case K:return(i.displayName||"Context")+".Consumer";case W:return(i._context.displayName||"Context")+".Provider";case ae:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ie:return l=i.displayName||null,l!==null?l:ke(i.type)||"Memo";case ge:l=i._payload,i=i._init;try{return ke(i(l))}catch{}}return null}function Be(i){var l=i.type;switch(i.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ke(l);case 8:return l===z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function _e(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function it(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Vt(i){var l=it(i)?"checked":"value",h=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),v=""+i[l];if(!i.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var I=h.get,C=h.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return I.call(this)},set:function(_){v=""+_,C.call(this,_)}}),Object.defineProperty(i,l,{enumerable:h.enumerable}),{getValue:function(){return v},setValue:function(_){v=""+_},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Se(i){i._valueTracker||(i._valueTracker=Vt(i))}function Ue(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var h=l.getValue(),v="";return i&&(v=it(i)?i.checked?"true":"false":i.value),i=v,i!==h?(l.setValue(i),!0):!1}function Je(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function $e(i,l){var h=l.checked;return Z({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??i._wrapperState.initialChecked})}function lt(i,l){var h=l.defaultValue==null?"":l.defaultValue,v=l.checked!=null?l.checked:l.defaultChecked;h=_e(l.value!=null?l.value:h),i._wrapperState={initialChecked:v,initialValue:h,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ft(i,l){l=l.checked,l!=null&&R(i,"checked",l,!1)}function Dt(i,l){ft(i,l);var h=_e(l.value),v=l.type;if(h!=null)v==="number"?(h===0&&i.value===""||i.value!=h)&&(i.value=""+h):i.value!==""+h&&(i.value=""+h);else if(v==="submit"||v==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?$t(i,l.type,h):l.hasOwnProperty("defaultValue")&&$t(i,l.type,_e(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function Et(i,l,h){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var v=l.type;if(!(v!=="submit"&&v!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+i._wrapperState.initialValue,h||l===i.value||(i.value=l),i.defaultValue=l}h=i.name,h!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,h!==""&&(i.name=h)}function $t(i,l,h){(l!=="number"||Je(i.ownerDocument)!==i)&&(h==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+h&&(i.defaultValue=""+h))}var rn=Array.isArray;function At(i,l,h,v){if(i=i.options,l){l={};for(var I=0;I"+l.valueOf().toString()+"",l=Nr.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function mo(i,l){if(l){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=l;return}}i.textContent=l}var po={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Nl=["Webkit","ms","Moz","O"];Object.keys(po).forEach(function(i){Nl.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),po[l]=po[i]})});function Fi(i,l,h){return l==null||typeof l=="boolean"||l===""?"":h||typeof l!="number"||l===0||po.hasOwnProperty(i)&&po[i]?(""+l).trim():l+"px"}function Pi(i,l){i=i.style;for(var h in l)if(l.hasOwnProperty(h)){var v=h.indexOf("--")===0,I=Fi(h,l[h],v);h==="float"&&(h="cssFloat"),v?i.setProperty(h,I):i[h]=I}}var Is=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yo(i,l){if(l){if(Is[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function ji(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var V=null;function ne(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var me=null,Ce=null,je=null;function Ye(i){if(i=nr(i)){if(typeof me!="function")throw Error(n(280));var l=i.stateNode;l&&(l=gu(l),me(i.stateNode,i.type,l))}}function ze(i){Ce?je?je.push(i):je=[i]:Ce=i}function pt(){if(Ce){var i=Ce,l=je;if(je=Ce=null,Ye(i),l)for(i=0;i>>=0,i===0?32:31-(Jm(i)/Km|0)|0}var Ts=64,Vc=4194304;function Es(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Ri(i,l){var h=i.pendingLanes;if(h===0)return 0;var v=0,I=i.suspendedLanes,C=i.pingedLanes,_=h&268435455;if(_!==0){var G=_&~I;G!==0?v=Es(G):(C&=_,C!==0&&(v=Es(C)))}else _=h&~I,_!==0?v=Es(_):C!==0&&(v=Es(C));if(v===0)return 0;if(l!==0&&l!==v&&!(l&I)&&(I=v&-v,C=l&-l,I>=C||I===16&&(C&4194240)!==0))return l;if(v&4&&(v|=h&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=v;0h;h++)l.push(i);return l}function Fl(i,l,h){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-xa(l),i[l]=h}function ep(i,l){var h=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var v=i.eventTimes;for(i=i.expirationTimes;0=go),mp=" ",pp=!1;function gp(i,l){switch(i){case"keyup":return zr.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vp(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var As=!1;function Os(i,l){switch(i){case"compositionend":return vp(l);case"keypress":return l.which!==32?null:(pp=!0,mp);case"textInput":return i=l.data,i===mp&&pp?null:i;default:return null}}function Fy(i,l){if(As)return i==="compositionend"||!_l&&gp(i,l)?(i=mf(),Wa=Rl=sn=null,As=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:h,offset:l-i};i=v}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=bt(h)}}function Tn(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?Tn(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function Zt(){for(var i=window,l=Je();l instanceof i.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)i=l.contentWindow;else break;l=Je(i.document)}return l}function Hl(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function Hy(i){var l=Zt(),h=i.focusedElem,v=i.selectionRange;if(l!==h&&h&&h.ownerDocument&&Tn(h.ownerDocument.documentElement,h)){if(v!==null&&Hl(h)){if(l=v.start,i=v.end,i===void 0&&(i=l),"selectionStart"in h)h.selectionStart=l,h.selectionEnd=Math.min(i,h.value.length);else if(i=(l=h.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var I=h.textContent.length,C=Math.min(v.start,I);v=v.end===void 0?C:Math.min(v.end,I),!i.extend&&C>v&&(I=v,v=C,C=I),I=Pt(h,C);var _=Pt(h,v);I&&_&&(i.rangeCount!==1||i.anchorNode!==I.node||i.anchorOffset!==I.offset||i.focusNode!==_.node||i.focusOffset!==_.offset)&&(l=l.createRange(),l.setStart(I.node,I.offset),i.removeAllRanges(),C>v?(i.addRange(l),i.extend(_.node,_.offset)):(l.setEnd(_.node,_.offset),i.addRange(l)))}}for(l=[],i=h;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h=document.documentMode,vo=null,Cf=null,$a=null,Ps=!1;function Bl(i,l,h){var v=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Ps||vo==null||vo!==Je(v)||(v=vo,"selectionStart"in v&&Hl(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),$a&&Ge($a,v)||($a=v,v=fu(Cf,"onSelect"),0zs||(i.current=Of[zs],Of[zs]=null,zs--)}function qt(i,l){zs++,Of[zs]=i.current,i.current=l}var ti={},rr=Ar(ti),Or=Ar(!1),Dr=ti;function Us(i,l){var h=i.type.contextTypes;if(!h)return ti;var v=i.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===l)return v.__reactInternalMemoizedMaskedChildContext;var I={},C;for(C in h)I[C]=l[C];return v&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=I),I}function Fr(i){return i=i.childContextTypes,i!=null}function vu(){Qt(Or),Qt(rr)}function Cp(i,l,h){if(rr.current!==ti)throw Error(n(168));qt(rr,l),qt(Or,h)}function Mp(i,l,h){var v=i.stateNode;if(l=l.childContextTypes,typeof v.getChildContext!="function")return h;v=v.getChildContext();for(var I in v)if(!(I in l))throw Error(n(108,Be(i)||"Unknown",I));return Z({},h,v)}function ia(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||ti,Dr=rr.current,qt(rr,i),qt(Or,Or.current),!0}function Np(i,l,h){var v=i.stateNode;if(!v)throw Error(n(169));h?(i=Mp(i,l,Dr),v.__reactInternalMemoizedMergedChildContext=i,Qt(Or),Qt(rr),qt(rr,i)):Qt(Or),qt(Or,h)}var bo=null,yu=!1,Ff=!1;function kp(i){bo===null?bo=[i]:bo.push(i)}function Zi(i){yu=!0,kp(i)}function ni(){if(!Ff&&bo!==null){Ff=!0;var i=0,l=_t;try{var h=bo;for(_t=1;i>=_,I-=_,Ja=1<<32-xa(l)+I|h<yt?(Vn=dt,dt=null):Vn=dt.sibling;var Lt=Oe(ue,dt,de[yt],He);if(Lt===null){dt===null&&(dt=Vn);break}i&&dt&&Lt.alternate===null&&l(ue,dt),re=C(Lt,re,yt),ut===null?at=Lt:ut.sibling=Lt,ut=Lt,dt=Vn}if(yt===de.length)return h(ue,dt),Xt&&$i(ue,yt),at;if(dt===null){for(;ytyt?(Vn=dt,dt=null):Vn=dt.sibling;var wi=Oe(ue,dt,Lt.value,He);if(wi===null){dt===null&&(dt=Vn);break}i&&dt&&wi.alternate===null&&l(ue,dt),re=C(wi,re,yt),ut===null?at=wi:ut.sibling=wi,ut=wi,dt=Vn}if(Lt.done)return h(ue,dt),Xt&&$i(ue,yt),at;if(dt===null){for(;!Lt.done;yt++,Lt=de.next())Lt=Le(ue,Lt.value,He),Lt!==null&&(re=C(Lt,re,yt),ut===null?at=Lt:ut.sibling=Lt,ut=Lt);return Xt&&$i(ue,yt),at}for(dt=v(ue,dt);!Lt.done;yt++,Lt=de.next())Lt=qe(dt,ue,yt,Lt.value,He),Lt!==null&&(i&&Lt.alternate!==null&&dt.delete(Lt.key===null?yt:Lt.key),re=C(Lt,re,yt),ut===null?at=Lt:ut.sibling=Lt,ut=Lt);return i&&dt.forEach(function(i0){return l(ue,i0)}),Xt&&$i(ue,yt),at}function wn(ue,re,de,He){if(typeof de=="object"&&de!==null&&de.type===L&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case H:e:{for(var at=de.key,ut=re;ut!==null;){if(ut.key===at){if(at=de.type,at===L){if(ut.tag===7){h(ue,ut.sibling),re=I(ut,de.props.children),re.return=ue,ue=re;break e}}else if(ut.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===ge&&Mu(at)===ut.type){h(ue,ut.sibling),re=I(ut,de.props),re.ref=Ql(ue,ut,de),re.return=ue,ue=re;break e}h(ue,ut);break}else l(ue,ut);ut=ut.sibling}de.type===L?(re=rs(de.props.children,ue.mode,He,de.key),re.return=ue,ue=re):(He=rd(de.type,de.key,de.props,null,ue.mode,He),He.ref=Ql(ue,re,de),He.return=ue,ue=He)}return _(ue);case P:e:{for(ut=de.key;re!==null;){if(re.key===ut)if(re.tag===4&&re.stateNode.containerInfo===de.containerInfo&&re.stateNode.implementation===de.implementation){h(ue,re.sibling),re=I(re,de.children||[]),re.return=ue,ue=re;break e}else{h(ue,re);break}else l(ue,re);re=re.sibling}re=Ih(de,ue.mode,He),re.return=ue,ue=re}return _(ue);case ge:return ut=de._init,wn(ue,re,ut(de._payload),He)}if(rn(de))return tt(ue,re,de,He);if(we(de))return nt(ue,re,de,He);Xl(ue,de)}return typeof de=="string"&&de!==""||typeof de=="number"?(de=""+de,re!==null&&re.tag===6?(h(ue,re.sibling),re=I(re,de),re.return=ue,ue=re):(h(ue,re),re=Sh(de,ue.mode,He),re.return=ue,ue=re),_(ue)):h(ue,re)}return wn}var si=Rp(!0),Bf=Rp(!1),Ws={},Oa=Ar(Ws),li=Ar(Ws),ec=Ar(Ws);function ci(i){if(i===Ws)throw Error(n(174));return i}function Nu(i,l){switch(qt(ec,l),qt(li,i),qt(Oa,Ws),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Mr(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=Mr(l,i)}Qt(Oa),qt(Oa,l)}function $s(){Qt(Oa),Qt(li),Qt(ec)}function Yf(i){ci(ec.current);var l=ci(Oa.current),h=Mr(l,i.type);l!==h&&(qt(li,i),qt(Oa,h))}function zf(i){li.current===i&&(Qt(Oa),Qt(li))}var en=Ar(0);function tc(i){for(var l=i;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var nc=[];function Uf(){for(var i=0;ih?h:4,i(!0);var v=It.transition;It.transition={};try{i(!1),l()}finally{_t=h,It.transition=v}}function oc(){return Rn().memoizedState}function Qs(i,l,h){var v=pi(i);if(h={lane:v,action:h,hasEagerState:!1,eagerState:null,next:null},Kf(i))Up(l,h);else if(h=ir(i,l,h,v),h!==null){var I=Er();ja(h,i,v,I),Qf(h,l,v)}}function zp(i,l,h){var v=pi(i),I={lane:v,action:h,hasEagerState:!1,eagerState:null,next:null};if(Kf(i))Up(l,I);else{var C=i.alternate;if(i.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var _=l.lastRenderedState,G=C(_,h);if(I.hasEagerState=!0,I.eagerState=G,pe(G,_)){var ee=l.interleaved;ee===null?(I.next=I,Tu(l)):(I.next=ee.next,ee.next=I),l.interleaved=I;return}}catch{}h=ir(i,l,I,v),h!==null&&(I=Er(),ja(h,i,v,I),Qf(h,l,v))}}function Kf(i){var l=i.alternate;return i===cn||l!==null&&l===cn}function Up(i,l){rc=ku=!0;var h=i.pending;h===null?l.next=l:(l.next=h.next,h.next=l),i.pending=l}function Qf(i,l,h){if(h&4194240){var v=l.lanes;v&=i.pendingLanes,h|=v,l.lanes=h,Pl(i,h)}}var To={readContext:Sr,useCallback:Ln,useContext:Ln,useEffect:Ln,useImperativeHandle:Ln,useInsertionEffect:Ln,useLayoutEffect:Ln,useMemo:Ln,useReducer:Ln,useRef:Ln,useState:Ln,useDebugValue:Ln,useDeferredValue:Ln,useTransition:Ln,useMutableSource:Ln,useSyncExternalStore:Ln,useId:Ln,unstable_isNewReconciler:!1},ic={readContext:Sr,useCallback:function(i,l){return mn().memoizedState=[i,l===void 0?null:l],i},useContext:Sr,useEffect:Hp,useImperativeHandle:function(i,l,h){return h=h!=null?h.concat([i]):null,Ks(4194308,4,Bp.bind(null,l,i),h)},useLayoutEffect:function(i,l){return Ks(4194308,4,i,l)},useInsertionEffect:function(i,l){return Ks(4,2,i,l)},useMemo:function(i,l){var h=mn();return l=l===void 0?null:l,i=i(),h.memoizedState=[i,l],i},useReducer:function(i,l,h){var v=mn();return l=h!==void 0?h(l):l,v.memoizedState=v.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},v.queue=i,i=i.dispatch=Qs.bind(null,cn,i),[v.memoizedState,i]},useRef:function(i){var l=mn();return i={current:i},l.memoizedState=i},useState:Io,useDebugValue:_u,useDeferredValue:function(i){return mn().memoizedState=i},useTransition:function(){var i=Io(!1),l=i[0];return i=zy.bind(null,i[1]),mn().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,h){var v=cn,I=mn();if(Xt){if(h===void 0)throw Error(n(407));h=h()}else{if(h=l(),Un===null)throw Error(n(349));Ki&30||Zf(v,l,h)}I.memoizedState=h;var C={value:h,getSnapshot:l};return I.queue=C,Hp(Lu.bind(null,v,C,i),[i]),v.flags|=2048,Js(9,ju.bind(null,v,C,h,l),void 0,null),h},useId:function(){var i=mn(),l=Un.identifierPrefix;if(Xt){var h=Ka,v=Ja;h=(v&~(1<<32-xa(v)-1)).toString(32)+h,l=":"+l+"R"+h,h=sr++,0<\/script>",i=i.removeChild(i.firstChild)):typeof v.is=="string"?i=_.createElement(h,{is:v.is}):(i=_.createElement(h),h==="select"&&(_=i,v.multiple?_.multiple=!0:v.size&&(_.size=v.size))):i=_.createElementNS(i,h),i[Ga]=l,i[ei]=v,Jp(i,l,!1,!1),l.stateNode=i;e:{switch(_=ji(h,v),h){case"dialog":Kt("cancel",i),Kt("close",i),I=v;break;case"iframe":case"object":case"embed":Kt("load",i),I=v;break;case"video":case"audio":for(I=0;Iil&&(l.flags|=128,v=!0,tl(C,!1),l.lanes=4194304)}else{if(!v)if(i=tc(_),i!==null){if(l.flags|=128,v=!0,h=i.updateQueue,h!==null&&(l.updateQueue=h,l.flags|=4),tl(C,!0),C.tail===null&&C.tailMode==="hidden"&&!_.alternate&&!Xt)return ur(l),null}else 2*on()-C.renderingStartTime>il&&h!==1073741824&&(l.flags|=128,v=!0,tl(C,!1),l.lanes=4194304);C.isBackwards?(_.sibling=l.child,l.child=_):(h=C.last,h!==null?h.sibling=_:l.child=_,C.last=_)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=on(),l.sibling=null,h=en.current,qt(en,v?h&1|2:h&1),l):(ur(l),null);case 22:case 23:return yh(),v=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==v&&(l.flags|=8192),v&&l.mode&1?qr&1073741824&&(ur(l),l.subtreeFlags&6&&(l.flags|=8192)):ur(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function Zy(i,l){switch(Gi(l),l.tag){case 1:return Fr(l.type)&&vu(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return $s(),Qt(Or),Qt(rr),Uf(),i=l.flags,i&65536&&!(i&128)?(l.flags=i&-65537|128,l):null;case 5:return zf(l),null;case 13:if(Qt(en),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Xa()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return Qt(en),null;case 4:return $s(),null;case 10:return Iu(l.type._context),null;case 22:case 23:return yh(),null;case 24:return null;default:return null}}var ua=!1,Bt=!1,ih=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function di(i,l){var h=i.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(v){pn(i,l,v)}else h.current=null}function sh(i,l,h){try{h()}catch(v){pn(i,l,v)}}var Qp=!1;function fc(i,l){if(Wl=qc,i=Zt(),Hl(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var v=h.getSelection&&h.getSelection();if(v&&v.rangeCount!==0){h=v.anchorNode;var I=v.anchorOffset,C=v.focusNode;v=v.focusOffset;try{h.nodeType,C.nodeType}catch{h=null;break e}var _=0,G=-1,ee=-1,ye=0,Fe=0,Le=i,Oe=null;t:for(;;){for(var qe;Le!==h||I!==0&&Le.nodeType!==3||(G=_+I),Le!==C||v!==0&&Le.nodeType!==3||(ee=_+v),Le.nodeType===3&&(_+=Le.nodeValue.length),(qe=Le.firstChild)!==null;)Oe=Le,Le=qe;for(;;){if(Le===i)break t;if(Oe===h&&++ye===I&&(G=_),Oe===C&&++Fe===v&&(ee=_),(qe=Le.nextSibling)!==null)break;Le=Oe,Oe=Le.parentNode}Le=qe}h=G===-1||ee===-1?null:{start:G,end:ee}}else h=null}h=h||{start:0,end:0}}else h=null;for(Vi={focusedElem:i,selectionRange:h},qc=!1,Xe=l;Xe!==null;)if(l=Xe,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,Xe=i;else for(;Xe!==null;){l=Xe;try{var tt=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(tt!==null){var nt=tt.memoizedProps,wn=tt.memoizedState,ue=l.stateNode,re=ue.getSnapshotBeforeUpdate(l.elementType===l.type?nt:Na(l.type,nt),wn);ue.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var de=l.stateNode.containerInfo;de.nodeType===1?de.textContent="":de.nodeType===9&&de.documentElement&&de.removeChild(de.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(He){pn(l,l.return,He)}if(i=l.sibling,i!==null){i.return=l.return,Xe=i;break}Xe=l.return}return tt=Qp,Qp=!1,tt}function nl(i,l,h){var v=l.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var I=v=v.next;do{if((I.tag&i)===i){var C=I.destroy;I.destroy=void 0,C!==void 0&&sh(l,h,C)}I=I.next}while(I!==v)}}function hc(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&i)===i){var v=h.create;h.destroy=v()}h=h.next}while(h!==l)}}function lh(i){var l=i.ref;if(l!==null){var h=i.stateNode;switch(i.tag){case 5:i=h;break;default:i=h}typeof l=="function"?l(i):l.current=i}}function Xp(i){var l=i.alternate;l!==null&&(i.alternate=null,Xp(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[Ga],delete l[ei],delete l[pu],delete l[B],delete l[Ys])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function eg(i){return i.tag===5||i.tag===3||i.tag===4}function tg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||eg(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Wu(i,l,h){var v=i.tag;if(v===5||v===6)i=i.stateNode,l?h.nodeType===8?h.parentNode.insertBefore(i,l):h.insertBefore(i,l):(h.nodeType===8?(l=h.parentNode,l.insertBefore(i,h)):(l=h,l.appendChild(i)),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=hu));else if(v!==4&&(i=i.child,i!==null))for(Wu(i,l,h),i=i.sibling;i!==null;)Wu(i,l,h),i=i.sibling}function $u(i,l,h){var v=i.tag;if(v===5||v===6)i=i.stateNode,l?h.insertBefore(i,l):h.appendChild(i);else if(v!==4&&(i=i.child,i!==null))for($u(i,l,h),i=i.sibling;i!==null;)$u(i,l,h),i=i.sibling}var Gn=null,$r=!1;function xo(i,l,h){for(h=h.child;h!==null;)rl(i,l,h),h=h.sibling}function rl(i,l,h){if(Za&&typeof Za.onCommitFiberUnmount=="function")try{Za.onCommitFiberUnmount(Uc,h)}catch{}switch(h.tag){case 5:Bt||di(h,l);case 6:var v=Gn,I=$r;Gn=null,xo(i,l,h),Gn=v,$r=I,Gn!==null&&($r?(i=Gn,h=h.stateNode,i.nodeType===8?i.parentNode.removeChild(h):i.removeChild(h)):Gn.removeChild(h.stateNode));break;case 18:Gn!==null&&($r?(i=Gn,h=h.stateNode,i.nodeType===8?Af(i.parentNode,h):i.nodeType===1&&Af(i,h),Ht(i)):Af(Gn,h.stateNode));break;case 4:v=Gn,I=$r,Gn=h.stateNode.containerInfo,$r=!0,xo(i,l,h),Gn=v,$r=I;break;case 0:case 11:case 14:case 15:if(!Bt&&(v=h.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){I=v=v.next;do{var C=I,_=C.destroy;C=C.tag,_!==void 0&&(C&2||C&4)&&sh(h,l,_),I=I.next}while(I!==v)}xo(i,l,h);break;case 1:if(!Bt&&(di(h,l),v=h.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=h.memoizedProps,v.state=h.memoizedState,v.componentWillUnmount()}catch(G){pn(h,l,G)}xo(i,l,h);break;case 21:xo(i,l,h);break;case 22:h.mode&1?(Bt=(v=Bt)||h.memoizedState!==null,xo(i,l,h),Bt=v):xo(i,l,h);break;default:xo(i,l,h)}}function Gu(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var h=i.stateNode;h===null&&(h=i.stateNode=new ih),l.forEach(function(v){var I=Xy.bind(null,i,v);h.has(v)||(h.add(v),v.then(I,I))})}}function da(i,l){var h=l.deletions;if(h!==null)for(var v=0;vI&&(I=_),v&=~C}if(v=I,v=on()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*Wy(v/1960))-v,10i?16:i,Hn===null)var v=!1;else{if(i=Hn,Hn=null,Xu=0,Ot&6)throw Error(n(331));var I=Ot;for(Ot|=4,Xe=i.current;Xe!==null;){var C=Xe,_=C.child;if(Xe.flags&16){var G=C.deletions;if(G!==null){for(var ee=0;eeon()-Ju?ts(i,0):fh|=h),dr(i,l)}function ug(i,l){l===0&&(i.mode&1?(l=Vc,Vc<<=1,!(Vc&130023424)&&(Vc=4194304)):l=1);var h=Er();i=ka(i,l),i!==null&&(Fl(i,l,h),dr(i,h))}function Qy(i){var l=i.memoizedState,h=0;l!==null&&(h=l.retryLane),ug(i,h)}function Xy(i,l){var h=0;switch(i.tag){case 13:var v=i.stateNode,I=i.memoizedState;I!==null&&(h=I.retryLane);break;case 19:v=i.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(l),ug(i,h)}var dg;dg=function(i,l,h){if(i!==null)if(i.memoizedProps!==l.pendingProps||Or.current)lr=!0;else{if(!(i.lanes&h)&&!(l.flags&128))return lr=!1,cr(i,l,h);lr=!!(i.flags&131072)}else lr=!1,Xt&&l.flags&1048576&&Ap(l,bu,l.index);switch(l.lanes=0,l.tag){case 2:var v=l.type;el(i,l),i=l.pendingProps;var I=Us(l,rr.current);ri(l,h),I=Au(null,l,v,i,I,h);var C=Ou();return l.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Fr(v)?(C=!0,ia(l)):C=!1,l.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,jf(l),I.updater=xu,l.stateNode=I,I._reactInternals=l,Hf(l,v,i,h),l=rh(null,l,v,!0,C,h)):(l.tag=0,Xt&&C&&ql(l),Tr(null,l,I,h),l=l.child),l;case 16:v=l.elementType;e:{switch(el(i,l),i=l.pendingProps,I=v._init,v=I(v._payload),l.type=v,I=l.tag=nd(v),i=Na(v,i),I){case 0:l=zu(null,l,v,i,h);break e;case 1:l=Gp(null,l,v,i,h);break e;case 11:l=eh(null,l,v,i,h);break e;case 14:l=to(null,l,v,Na(v.type,i),h);break e}throw Error(n(306,v,""))}return l;case 0:return v=l.type,I=l.pendingProps,I=l.elementType===v?I:Na(v,I),zu(i,l,v,I,h);case 1:return v=l.type,I=l.pendingProps,I=l.elementType===v?I:Na(v,I),Gp(i,l,v,I,h);case 3:e:{if(no(l),i===null)throw Error(n(387));v=l.pendingProps,C=l.memoizedState,I=C.element,Pp(i,l),Eu(l,v,null,h);var _=l.memoizedState;if(v=_.element,C.isDehydrated)if(C={element:v,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){I=Xi(Error(n(423)),l),l=Uu(i,l,v,h,I);break e}else if(v!==I){I=Xi(Error(n(424)),l),l=Uu(i,l,v,h,I);break e}else for(Zr=Xo(l.stateNode.containerInfo.firstChild),or=l,Xt=!0,Ma=null,h=Bf(l,null,v,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Xa(),v===I){l=ro(i,l,h);break e}Tr(i,l,v,h)}l=l.child}return l;case 5:return Yf(l),i===null&&Pr(l),v=l.type,I=l.pendingProps,C=i!==null?i.memoizedProps:null,_=I.children,$l(v,I)?_=null:C!==null&&$l(v,C)&&(l.flags|=32),$p(i,l),Tr(i,l,_,h),l.child;case 6:return i===null&&Pr(l),null;case 13:return dc(i,l,h);case 4:return Nu(l,l.stateNode.containerInfo),v=l.pendingProps,i===null?l.child=si(l,null,v,h):Tr(i,l,v,h),l.child;case 11:return v=l.type,I=l.pendingProps,I=l.elementType===v?I:Na(v,I),eh(i,l,v,I,h);case 7:return Tr(i,l,l.pendingProps,h),l.child;case 8:return Tr(i,l,l.pendingProps.children,h),l.child;case 12:return Tr(i,l,l.pendingProps.children,h),l.child;case 10:e:{if(v=l.type._context,I=l.pendingProps,C=l.memoizedProps,_=I.value,qt(qi,v._currentValue),v._currentValue=_,C!==null)if(pe(C.value,_)){if(C.children===I.children&&!Or.current){l=ro(i,l,h);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var G=C.dependencies;if(G!==null){_=C.child;for(var ee=G.firstContext;ee!==null;){if(ee.context===v){if(C.tag===1){ee=Aa(-1,h&-h),ee.tag=2;var ye=C.updateQueue;if(ye!==null){ye=ye.shared;var Fe=ye.pending;Fe===null?ee.next=ee:(ee.next=Fe.next,Fe.next=ee),ye.pending=ee}}C.lanes|=h,ee=C.alternate,ee!==null&&(ee.lanes|=h),ca(C.return,h,l),G.lanes|=h;break}ee=ee.next}}else if(C.tag===10)_=C.type===l.type?null:C.child;else if(C.tag===18){if(_=C.return,_===null)throw Error(n(341));_.lanes|=h,G=_.alternate,G!==null&&(G.lanes|=h),ca(_,h,l),_=C.sibling}else _=C.child;if(_!==null)_.return=C;else for(_=C;_!==null;){if(_===l){_=null;break}if(C=_.sibling,C!==null){C.return=_.return,_=C;break}_=_.return}C=_}Tr(i,l,I.children,h),l=l.child}return l;case 9:return I=l.type,v=l.pendingProps.children,ri(l,h),I=Sr(I),v=v(I),l.flags|=1,Tr(i,l,v,h),l.child;case 14:return v=l.type,I=Na(v,l.pendingProps),I=Na(v.type,I),to(i,l,v,I,h);case 15:return th(i,l,l.type,l.pendingProps,h);case 17:return v=l.type,I=l.pendingProps,I=l.elementType===v?I:Na(v,I),el(i,l),l.tag=1,Fr(v)?(i=!0,ia(l)):i=!1,ri(l,h),_f(l,v,I),Hf(l,v,I,h),rh(null,l,v,!0,i,h);case 19:return qp(i,l,h);case 22:return nh(i,l,h)}throw Error(n(156,l.tag))};function fg(i,l){return Wm(i,l)}function e0(i,l,h,v){this.tag=i,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jr(i,l,h,v){return new e0(i,l,h,v)}function Dh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function nd(i){if(typeof i=="function")return Dh(i)?1:0;if(i!=null){if(i=i.$$typeof,i===ae)return 11;if(i===ie)return 14}return 2}function yi(i,l){var h=i.alternate;return h===null?(h=Jr(i.tag,l,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=l,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&14680064,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,l=i.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h}function rd(i,l,h,v,I,C){var _=2;if(v=i,typeof i=="function")Dh(i)&&(_=1);else if(typeof i=="string")_=5;else e:switch(i){case L:return rs(h.children,I,C,l);case z:_=8,I|=8;break;case U:return i=Jr(12,h,l,I|2),i.elementType=U,i.lanes=C,i;case ce:return i=Jr(13,h,l,I),i.elementType=ce,i.lanes=C,i;case fe:return i=Jr(19,h,l,I),i.elementType=fe,i.lanes=C,i;case Te:return ad(h,I,C,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case W:_=10;break e;case K:_=9;break e;case ae:_=11;break e;case ie:_=14;break e;case ge:_=16,v=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return l=Jr(_,h,l,I),l.elementType=i,l.type=v,l.lanes=C,l}function rs(i,l,h,v){return i=Jr(7,i,v,l),i.lanes=h,i}function ad(i,l,h,v){return i=Jr(22,i,v,l),i.elementType=Te,i.lanes=h,i.stateNode={isHidden:!1},i}function Sh(i,l,h){return i=Jr(6,i,null,l),i.lanes=h,i}function Ih(i,l,h){return l=Jr(4,i.children!==null?i.children:[],i.key,l),l.lanes=h,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function t0(i,l,h,v,I){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ol(0),this.expirationTimes=Ol(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ol(0),this.identifierPrefix=v,this.onRecoverableError=I,this.mutableSourceEagerHydrationData=null}function Th(i,l,h,v,I,C,_,G,ee){return i=new t0(i,l,h,G,ee),l===1?(l=1,C===!0&&(l|=8)):l=0,C=Jr(3,null,null,l),i.current=C,C.stateNode=i,C.memoizedState={element:v,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},jf(C),i}function n0(i,l,h){var v=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(FT)}catch(e){console.error(e)}}FT();OT.exports=GA();var w1=OT.exports;const b1=Xn(w1);var Lv,PT=w1;Lv=hs.createRoot=PT.createRoot;hs.hydrateRoot=PT.hydrateRoot;const qA=e=>{const{children:t,className:n,clickSpaceDestroy:r,destroy:a}=e,o=()=>{r&&a()},s=u=>{(u.key==="Escape"||(u.ctrlKey||u.metaKey)&&u.key.toLowerCase()==="w")&&a()};return y.jsx("div",{className:`dialog-wrapper ${n}`,onClick:o,onKeyDown:u=>s(u),children:y.jsx("div",{className:"dialog-container",onClick:u=>u.stopPropagation(),children:t})})};function xm(e,t,n){const r=document.createElement("div");document.body.append(r),setTimeout(()=>{var d;(d=r.firstElementChild)==null||d.classList.add("showup")},0);const a={destroy:()=>{var d,m;(d=r.firstElementChild)==null||d.classList.remove("showup"),(m=r.firstElementChild)==null||m.classList.add("showoff"),setTimeout(()=>{r.detach(),u.unmount()},bI)}},o={...n,destroy:a.destroy};let s=y.jsx(qA,{destroy:a.destroy,clickSpaceDestroy:!0,...e,children:y.jsx(t,{...o})});s=y.jsx(Sl,{store:Ee,context:wt,children:s});const u=hs.createRoot(r);return u.render(s),a}const JA=e=>{const{shownStatus:t,setShownStatus:n}=e,{dailyNotesState:{app:r,settings:a},globalState:{manifest:o}}=O.useContext(wt),s=O.useRef(null);O.useEffect(()=>{if(t){const w=D=>{var S;(S=s.current)!=null&&S.contains(D.target)||D.stopPropagation(),n(!1)};window.addEventListener("click",w,{capture:!0,once:!0})}},[t]);const u=O.useCallback(async w=>{const{type:D}=w;if(D.startsWith("text"))try{return`${await y1.parseHtml(w)}`}catch(S){new x.Notice(S)}},[]),d=O.useCallback(()=>{const w=document.createElement("input");document.body.appendChild(w),w.type="file",w.multiple=!1,w.accept="text/html",w.onchange=async()=>{if(!w.files||w.files.length===0)return;const D=w.files[0];await u(D),document.body.removeChild(w)},w.click()},[]),m=()=>{r.setting.open(),r.setting.openTabById(o.id||"obsidian-memos")},p=()=>{if(a!=null&&a.needVerify){Qe.setLocked(!0);return}else new x.Notice(k("You have not set a password or enable this feature yet")),r.setting.open(),r.setting.openTabById(o.id||"obsidian-memos")},g=()=>{new pb(r,o.version).open()};return y.jsxs("div",{className:`menu-btns-popup ${t?"":"hidden"}`,ref:s,children:[y.jsxs("div",{className:"btn action-btn",onClick:m,children:[y.jsx("span",{ref:w=>{w&&x.setIcon(w,"user")},className:"icon"}),k("Settings")]}),(a==null?void 0:a.needVerify)&&y.jsxs("div",{className:"btn action-btn",onClick:p,children:[y.jsx("span",{ref:w=>{w&&x.setIcon(w,"lock")},className:"icon"}),k("Lock")]}),y.jsxs("div",{className:"btn action-btn",onClick:d,children:[y.jsx("span",{ref:w=>{w&&x.setIcon(w,"import")},className:"icon"}),k("Import")]}),y.jsxs("div",{className:"btn action-btn",onClick:g,children:[y.jsx("span",{ref:w=>{w&&x.setIcon(w,"file-text")},className:"icon"}),k("ChangeLog")]})]})};function jT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const t={};return e.forEach(n=>{const r=Re.getDateString(n.createdAt);t[r]?t[r]++:t[r]=1}),Object.keys(t).sort((n,r)=>t[r]-t[n])[0]},QA=e=>{const t={};return e.forEach(n=>{const r=Re.getTimeString(n.createdAt).split(":")[0];t[r]?t[r]++:t[r]=1}),Object.keys(t).sort((n,r)=>t[r]-t[n])[0]},LT=({statusType:e})=>{const{memoState:{memos:t,tags:n},locationState:{pathname:r},dailyNotesState:{settings:a,app:o}}=O.useContext(wt),[s,u]=O.useState(0),[d,m]=O.useState(0),[p,g]=O.useState(0),[w,D]=O.useState(null),[S,T]=O.useState(!1),E=q.useRef(null),[A,N]=O.useState(0),[R,F]=O.useState(0),[H,P]=O.useState(0),[L,z]=O.useState(""),[U,W]=O.useState("");return O.useEffect(()=>{const K=t.filter(ae=>!ae.deletedAt&&ae.rowStatus!=="ARCHIVED");P(K.filter(ae=>ae.thinoType.startsWith("TASK")).length),z(KA(t)),W(QA(t))},[t]),O.useLayoutEffect(()=>{if(!o)return;const{tags:K,memos:ae,days:ce}=XA(o);g(K),u(ae),m(ce)},[o]),O.useEffect(()=>{let K=0;const ae=s-A,ce=1e3,fe=ie=>{K||(K=ie);const ge=ie-K;if(ge{let K=0;const ae=d-R,ce=1e3,fe=ie=>{K||(K=ie);const ge=ie-K;if(ge{!a||!o||(T(s>9999||p>999||d>999),e8({tags:p,memos:s,days:d},o))},[s,p,d]),O.useEffect(()=>{Ie.initialized&&t&&r==="/"&&(g(n.length),u(t.filter(K=>!(K.deletedAt!==""&&K.deletedAt)).length),D(t.length>0?t[t.length-1]:null))},[n,t,r]),O.useEffect(()=>{if(!Ie.initialized)return;if(!w){m(0);return}if(!E.current||!(w!=null&&w.createdAt))return;x.requireApiVersion("1.4.4")&&x.setTooltip(E.current,k("Started from")+" "+Re.getDateTimeString((w==null?void 0:w.createdAt)??""));const K=Math.ceil((Date.now()-Re.getTimeStampByDate(w==null?void 0:w.createdAt))/1e3/3600/24);m(t?K:0)},[w]),y.jsx("div",{className:mr("status-text-container",S?"text-overflow":"",e),children:e==="banner"?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"status-text memos-text",children:[y.jsx("span",{className:"amount-text",children:Math.round(A)}),y.jsx("span",{className:"type-text",children:"THINO"})]}),y.jsxs("div",{className:"status-text tags-text",children:[y.jsx("span",{className:"amount-text",children:p}),y.jsx("span",{className:"type-text",children:k("TAG")})]}),y.jsxs("div",{ref:E,className:"status-text duration-text",onClick:()=>{Qe.setShowSiderbarInMobileView(!1),We.setPathname("/daily")},children:[y.jsx("span",{className:"amount-text",children:Math.round(R)??0}),y.jsx("span",{className:"type-text",children:k("DAY")})]})]}):y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"status-sidebar-header title-text",children:y.jsx("span",{className:"normal-text",children:k("Thino status")})}),y.jsxs("div",{className:"status-sidebar-wrapper",children:[y.jsxs("div",{className:"status-text memos-text",children:[y.jsx("span",{className:"type-text",children:k("Thino amount")}),y.jsx("span",{className:"amount-text",children:Math.round(A)})]}),y.jsxs("div",{className:"status-text memos-text",children:[y.jsx("span",{className:"type-text",children:k("Task amount")}),y.jsx("span",{className:"amount-text",children:Math.round(H)??0})]}),y.jsxs("div",{className:"status-text tags-text",children:[y.jsx("span",{className:"type-text",children:k("Used tags")}),y.jsx("span",{className:"amount-text",children:p})]}),y.jsxs("div",{ref:E,className:"status-text duration-text",onClick:()=>{Qe.setShowSiderbarInMobileView(!1),We.setPathname("/daily")},children:[y.jsx("span",{className:"type-text",children:k("Used days")}),y.jsx("span",{className:"amount-text",children:Math.round(R)??0})]}),y.jsxs("div",{className:"status-text most-active-day-text",onClick:()=>{const K=x.moment(L,"YYYY/MM/DD").startOf("day").valueOf(),ae=x.moment(L,"YYYY/MM/DD").endOf("day").valueOf();We.setFromAndToQuery(K,ae)},children:[y.jsx("span",{className:"type-text",children:k("Most active day")}),y.jsx("span",{className:"amount-text",children:L})]}),y.jsxs("div",{className:"status-text most-active-hour-text",children:[y.jsx("span",{className:"type-text",children:k("Most active hour")}),y.jsx("span",{className:"amount-text",children:U})]})]})]})})};function RT(e){return`userBannerCache:${e}`}function XA(e){try{const t=RT(e==null?void 0:e.appId),n=Kn.get([t])[t];return n?JSON.parse(n):{tags:0,memos:0,days:0}}catch(t){return console.error(t),{tags:0,memos:0,days:0}}}function e8({tags:e,memos:t,days:n},r){try{const a={tags:e,memos:t,days:n},o=RT(r==null?void 0:r.appId);Kn.set({[o]:JSON.stringify(a)})}catch(a){console.error(a)}}const t8=[{text:k("AND"),value:"AND"},{text:k("OR"),value:"OR"}],hl={TAG:{value:"TAG",text:k("TAG"),operators:[{text:k("INCLUDE"),value:"CONTAIN"},{text:k("EXCLUDE"),value:"NOT_CONTAIN"}]},TYPE:{value:"TYPE",text:k("TYPE"),operators:[{value:"IS",text:k("IS")},{value:"IS_NOT",text:k("ISNOT")}],values:[{value:"CONNECTED",text:k("LINKED")},{value:"NOT_TAGGED",text:k("NO TAGS")},{value:"LINKED",text:k("HAS LINKS")},{value:"IMAGED",text:k("HAS IMAGES")}]},TEXT:{value:"TEXT",text:k("TEXT"),operators:[{value:"CONTAIN",text:k("INCLUDE")},{value:"NOT_CONTAIN",text:k("EXCLUDE")}]},DATE:{value:"DATE",text:k("DATE"),operators:[{value:"NOT_CONTAIN",text:k("BEFORE")},{value:"CONTAIN",text:k("AFTER")}]},LIST:{value:"LIST",text:k("LIST"),operators:[{value:"IS",text:k("IS")},{value:"IS_NOT",text:k("ISNOT")}],values:[{value:"TODO",text:k("TODO")},{value:"DONE",text:k("DONE")},{value:"LIST",text:k("JOURNAL")},{value:"OTHER",text:k("OTHER")}]},SOURCE:{value:"SOURCE",text:k("SOURCE"),operators:[{value:"IS",text:k("IS")},{value:"IS_NOT",text:k("ISNOT")}],values:[{value:"DAILY",text:k("DAILY")},{value:"MULTI",text:k("MULTI")},{value:"FILE",text:k("FILE")},{value:"CANVAS",text:k("CANVAS")}]}},Cw=hl.TYPE.values,n8=e=>{for(const t of Cw)if(t.value===e)return t.text;return""},SD=()=>({type:"TAG",value:{operator:"CONTAIN",value:""},relation:"AND"}),$d=(e,t)=>{let n=!0;for(const r of t){const{relation:a}=r,o=r8(e,r);a==="OR"?n=n||o:n=n&&o}return n},r8=(e,t)=>{const{type:n,value:{operator:r,value:a}}=t;if(a==="")return!0;let o=!0;if(n==="TAG"){let s=!0;const u=new Set;for(const d of Array.from(e.content.match(An)||[])){const p=d.replace(An,"$1").trim().split("/");let g="";for(const w of p)g+=w,u.add(g),g+="/"}for(const d of Array.from(e.content.match($n)||[])){const p=d.replace($n,"$1").trim().split("/");let g="";for(const w of p)g+=w,u.add(g),g+="/"}u.has(a)||(s=!1),r==="NOT_CONTAIN"&&(s=!s),o=s}else if(n==="TYPE"){let s=!1;(a==="NOT_TAGGED"&&e.content.match(An)===null&&e.content.match(hr)===null||a==="LINKED"&&e.content.match(Rc)!==null||a==="IMAGED"&&e.content.match(_c)!==null||a==="CONNECTED"&&e.content.match(Il)!==null)&&(s=!0),r==="IS_NOT"&&(s=!s),o=s}else if(n==="TEXT"){let s=e.content.toLowerCase().includes(a.toLowerCase());r==="NOT_CONTAIN"&&(s=!s),o=s}else if(n==="LIST"){let u=(e.thinoType==="JOURNAL"?"LIST":e.thinoType==="TASK-TODO"?"TODO":e.thinoType==="TASK-DONE"?"DONE":"OTHER").contains(a);r==="IS_NOT"&&(u=!u),o=u}else if(n==="SOURCE"){let s=e.sourceType===a;r==="IS_NOT"&&(s=!s),o=s}else if(n==="DATE"){const s=x.moment(a,"YYYY-MM-DD").isValid();let u,d;if(s)u=x.moment(a,"YYYY-MM-DD"),d=u.isBefore(x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),"day");else{const p=(app.plugins.enabledPlugins.has("nldates-obsidian")&&app.plugins.getPlugin("nldates-obsidian")).parseDate(a);p.date!==null&&(d=p.moment.isBefore(x.moment(e.createdAt),"day"))}r==="NOT_CONTAIN"&&(d=!d),o=d}return o=e.linkId===""?o:!1,o};function _o(e){const[t,n]=O.useState(()=>!!e),r=O.useCallback(a=>{n(typeof a=="boolean"?a:o=>!o)},[]);return[t,r]}const Rv=()=>{const{dailyNotesState:{app:e,view:t},locationState:{query:{type:n}}}=O.useContext(wt),r=q.useRef(null),a=q.useRef(null),[o,s]=_o(!1);O.useEffect(()=>{!r||!t||!e||(t.registerEvent(e.workspace.on("blur-on-memos",()=>{var g;(g=r.current)==null||g.blur()})),t.registerEvent(e.workspace.on("focus-on-searchBar",()=>{var g;(g=r.current)==null||g.focus()})))},[r,e,t]),O.useEffect(()=>{a&&x.setIcon(a.current,"search")},[a]);const u=g=>{const{type:w}=We.getState().query;g===w&&(g=""),We.setMemoTypeQuery(g)},d=g=>{const w=g.currentTarget.value;if(!w.contains(" -time: ")){We.setTextQuery(w);return}const D=w.split(" -time: ")[1],S=D.length>10?D.match(/\d{4}-\d{2}-\d{2}/g):null;if(S==null){We.setTextQuery(w.split(" -time: ")[0]);return}if(S.length===1){const T=x.moment(S[0]);We.setTimeQuery({from:T.startOf("day").valueOf(),to:T.endOf("day").valueOf()})}else if(S.length===2){const T=x.moment(S[0]),E=x.moment(S[1]);We.setTimeQuery({from:T.startOf("day").valueOf(),to:E.endOf("day").valueOf()})}We.setTextQuery(w.split(" -time: ")[0])},m=()=>{s(!0)},p=()=>{s(!1)};return y.jsxs("div",{className:"search-bar-container",children:[y.jsxs("div",{className:"search-bar-inputer",children:[y.jsx("span",{ref:a,className:"btn icon-img"}),y.jsx("input",{ref:r,className:"text-input",type:"text",onMouseOver:m,onMouseOut:p,placeholder:o?k("Type here"):"",onChange:d})]}),y.jsx("div",{className:"quickly-action-wrapper",children:y.jsxs("div",{className:"quickly-action-container",children:[y.jsx("span",{className:"title-text",children:k("Quick filter")}),y.jsxs("div",{className:"section-container types-container",children:[y.jsxs("span",{className:"section-text",children:[k("TYPE"),":"]}),y.jsx("div",{className:"values-container",children:Cw.map((g,w)=>y.jsxs("div",{children:[y.jsx("span",{className:`type-item ${n===g.value?"selected":""}`,onClick:()=>{u(g.value)},children:g.text}),w+1{const{children:t,when:n}=e;return n?y.jsx(y.Fragment,{children:t}):null},lo=a8;function fn(){const e=document.createDocumentFragment();e.createEl("div",{cls:"thino-info"}).createEl("div",{text:k("This is a pro feature, please upgrade to pro version to use it.")});const r=e.createEl("div",{cls:"thino-link"}).createEl("div",{text:k("You can get pro version from: ")}),a=localStorage.getItem("language");let o="https://pkmer.cn/products/UserProfile/";a&&a==="zh"?o="https://pkmer.cn/products/thino/":o="https://thino.pkmer.net/en/",r.createEl("a",{text:"PKMer",attr:{href:o}}),new x.Notice(e,5e3)}const{exec:o8,execSync:tX}=x.Platform.isDesktop&&require("child_process"),{createHash:i8}=x.Platform.isDesktop&&require("crypto"),s8={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},l8=x.Platform.isDesktop&&{darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:`${s8[c8()]}\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`,linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"};function c8(){return process.platform!=="win32"?"":process.arch==="ia32"&&Object.hasOwnProperty.call(process.env,"PROCESSOR_ARCHITEW6432")?"mixed":"native"}function u8(e){return i8("sha256").update(e).digest("hex")}function d8(e){switch(process.platform){case"darwin":return e.split("IOPlatformUUID")[1].split(` `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return e.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return e.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return e.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error(`Unsupported platform: ${process.platform}`)}}function zn(e=!1){return new Promise((t,n)=>{o8(l8[process.platform],{},(r,a)=>{if(r)return n(new Error(`Error while obtaining machine id: ${r.stack}`));const o=d8(a.toString());return t(e?o:u8(o))})})}const ID={list:"align-left",waterfall:"layout-grid",calendar:"calendar",minimal:"list",table:"table",chat:"message-square",moments:"chrome"},f8=e=>{const{dailyNotesState:{app:t,view:n,verifyState:r,settings:a},globalState:{manifest:o,isMobileView:s}}=O.useContext(wt),u=O.useRef(null),d=O.useRef(null),[m,p]=O.useState((window.app||t).loadLocalStorage("thinoListView")||"list"),[g,w]=O.useState(null);O.useEffect(()=>{if(!o||!t)return;const S=t==null?void 0:t.plugins.getPlugin(o.id);w(S),p(S==null?void 0:S.settings.MemoListView),Qe.setMemoListView(S==null?void 0:S.settings.MemoListView)},[o,t]),O.useEffect(()=>{if(!t||!n||!g||!g.settings)return;const S=()=>{var E;if(n.leaf.height===0)return;const T=(E=g==null?void 0:g.settings)==null?void 0:E.MemoListView;T==="chat"||T==="moments"||(n.leaf.width>950?(p(T||"list"),Qe.setMemoListView(T||"list")):n.leaf.width<=950&&(Qe.setMemoListView("list"),p("list")))};S(),d.current||(d.current=t.workspace.on("resize",S),n.registerEvent(d.current))},[t,n,g]),O.useEffect(()=>{u&&(x.setIcon(u.current,ID[m]),Qe.setMemoListView(m),x.requireApiVersion("1.4.4")&&x.setTooltip(u.current,k("Switch view")))},[m]);const D=async S=>{var F;const T=!x.Platform.isDesktop&&await((F=window.Capacitor)==null?void 0:F.Plugins.Device.getId()),E=x.Platform.isDesktop?await zn():T.identifier||T.uuid;if(!r||(r==null?void 0:r.appId)!==E){fn();return}const A=async H=>{Qe.setMemoListView(H),g&&(g.settings.MemoListView=H,await g.saveSettings()),p(H)},N=[{view:"list",title:k("List")},{view:"chat",title:k("Chat")},{view:"moments",title:k("Moments")}];s||N.push({view:"waterfall",title:k("Waterfall")},{view:"calendar",title:k("Calendar")},{view:"table",title:k("Table")});const R=new x.Menu;N.forEach(({view:H,title:P})=>{R.addItem(L=>{L.setChecked(m===H).setIcon(ID[H]).setTitle(P).onClick(()=>{m!==H&&A(H)})})}),R.showAtMouseEvent(S.nativeEvent)};return y.jsx("div",{className:`memos-view-switcher-wrapper ${e.className?e.className:""} pro`,ref:u,onClick:D})},h8=()=>{const e=O.useRef(null);return O.useEffect(()=>{e&&(x.setIcon(e.current,"calendar-check"),x.setTooltip&&x.setTooltip(e.current,k("Daily Memos")))},[e]),y.jsx("div",{className:"memos-review-entry-wrapper",ref:e,onClick:()=>{We.setPathname("/daily")}})},A0=()=>({type:"initialText",value:"",timestamp:Date.now(),selectionStart:0,selectionEnd:0}),TD={initialValue:"",interval:300};class m8{constructor(t,n=TD){this.listeners=[],this.runUndo=()=>{const r=this.actions[this.currentIndex].selectionStart;this.currentIndex>0&&this.currentIndex--,this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(r,r),this.dispatchChange()},this.runRedo=()=>{this.currentIndexthis.actions,this.setState=(r,a)=>{this.actions=[...r],this.currentIndex=a{this.actions=[A0()],this.currentIndex=0,this.dispatchChange()},this.destroy=()=>{this.rmEventListeners()},this.subscribe=r=>{this.listeners.push(r)},this.handleElementKeydown=r=>{const a=r;a.key==="z"&&!a.shiftKey&&(a.metaKey||a.ctrlKey)?(r.preventDefault(),this.runUndo()):(a.key==="z"&&a.shiftKey&&(a.metaKey||a.ctrlKey)||a.key==="y"&&(a.metaKey||a.ctrlKey))&&(r.preventDefault(),this.runRedo())},this.handleElementInput=r=>{const a=r,o=this.actions[this.currentIndex];this.pushNewAction({type:a.inputType,value:this.element.value,timestamp:Date.now(),selectionStart:this.element.selectionEnd-(this.element.value.length-o.value.length),selectionEnd:this.element.selectionEnd})},this.addEventListeners=()=>{this.element.addEventListener("keydown",this.handleElementKeydown),this.element.addEventListener("input",this.handleElementInput)},this.rmEventListeners=()=>{this.element.removeEventListener("keydown",this.handleElementKeydown),this.element.removeEventListener("input",this.handleElementInput)},this.pushNewAction=r=>{const a=this.actions[this.currentIndex];a&&a.type===r.type&&r.timestamp-a.timestamp=this.config.maxSize?(this.actions.shift(),this.actions[0]=A0()):this.currentIndex++,this.actions[this.currentIndex]=r,this.actions=this.actions.slice(0,this.currentIndex+1)),this.dispatchChange()},this.dispatchChange=()=>{for(const r of this.listeners)r([...this.actions],this.currentIndex)},this.element=t,this.config=Object.assign(Object.assign({},TD),n),this.config.initialActions&&this.config.initialActions.length>0?(this.actions=this.config.initialActions,this.config.initialIndex!==void 0&&this.config.initialIndex{e(n=>!n)},[])}var _T={exports:{}};(function(e){(function(){var t=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n=typeof window<"u",r=n&&window.mozInnerScreenX!=null;function a(o,s,u){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var d=u&&u.debug||!1;if(d){var m=document.querySelector("#input-textarea-caret-position-mirror-div");m&&m.parentNode.removeChild(m)}var p=document.createElement("div");p.id="input-textarea-caret-position-mirror-div",document.body.appendChild(p);var g=p.style,w=window.getComputedStyle?getComputedStyle(o):o.currentStyle;g.whiteSpace="pre-wrap",o.nodeName!=="INPUT"&&(g.wordWrap="break-word"),g.position="absolute",d||(g.visibility="hidden"),t.forEach(function(T){g[T]=w[T]}),r?o.scrollHeight>parseInt(w.height)&&(g.overflowY="scroll"):g.overflow="hidden",p.textContent=o.value.substring(0,s),o.nodeName==="INPUT"&&(p.textContent=p.textContent.replace(/\s/g," "));var D=document.createElement("span");D.textContent=o.value.substring(s)||".",p.appendChild(D);var S={top:D.offsetTop+parseInt(w.borderTopWidth),left:D.offsetLeft+parseInt(w.borderLeftWidth)};return d?D.style.backgroundColor="#aaa":document.body.removeChild(p),S}e.exports=a})()})(_T);var g8=_T.exports;const v8=Xn(g8);var HT=Jn.CustomEvent;function y8(){try{var e=new HT("cat",{detail:{foo:"bar"}});return e.type==="cat"&&e.detail.foo==="bar"}catch{}return!1}var w8=y8()?HT:typeof document<"u"&&typeof document.createEvent=="function"?function(t,n){var r=document.createEvent("CustomEvent");return n?r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):r.initCustomEvent(t,!1,!1,void 0),r}:function(t,n){var r=document.createEventObject();return r.type=t,n?(r.bubbles=!!n.bubbles,r.cancelable=!!n.cancelable,r.detail=n.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r};const b8=Xn(w8);function D8(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S8(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:!1,m=r.props.onItemHighlighted;r.state.selectedItem!==u&&r.setState({selectedItem:u},function(){m(u),d&&r.props.dropdownScroll(r.itemsRef[r.getId(u)])})},r.scroll=function(u){u.preventDefault();var d=r.props.values,m=u.keyCode||u.which,p=r.getPositionInList(),g;switch(m){case Ha.DOWN:g=p+1;break;case Ha.UP:g=p-1;break;default:g=p;break}g=(g%d.length+d.length)%d.length,r.selectItem(d[g],[Ha.DOWN,Ha.UP].includes(m))},r.isSelected=function(u){var d=r.state.selectedItem;return d?r.getId(d)===r.getId(u):!1},r}return _v(t,[{key:"componentDidMount",value:function(){this.listeners.push(Ec.add([Ha.DOWN,Ha.UP],this.scroll),Ec.add([Ha.ENTER,Ha.TAB],this.onPressEnter));var r=this.props.values;r&&r[0]&&this.selectItem(r[0])}},{key:"componentDidUpdate",value:function(r){var a=this,o=r.values,s=this.props.values,u=o.map(function(m){return a.getId(m)}).join(""),d=s.map(function(m){return a.getId(m)}).join("");u!==d&&s&&s[0]&&this.selectItem(s[0])}},{key:"componentWillUnmount",value:function(){for(var r;this.listeners.length;)r=this.listeners.pop(),Ec.remove(r)}},{key:"render",value:function(){var r=this,a=this.props,o=a.values,s=a.component,u=a.style,d=a.itemClassName,m=a.className,p=a.itemStyle;return q.createElement("ul",{className:"rta__list ".concat(m||""),style:u},o.map(function(g){return q.createElement(N8,{key:r.getId(g),innerRef:function(D){r.itemsRef[r.getId(g)]=D},selected:r.isSelected(g),item:g,className:d,style:p,onClickHandler:r.onPressEnter,onSelectHandler:r.selectItem,component:s})}))}}]),t}(q.Component);function A8(e,t){var n=parseInt(getComputedStyle(t).getPropertyValue("height"),10),r=parseInt(getComputedStyle(e).getPropertyValue("height"),10)-n,a=t.offsetTop,o=e.scrollTop;ag.right&&D.left+s>w.width?(p=s-w.width,u.push(ul.X.LEFT),d.push(ul.X.RIGHT)):(p=s,u.push(ul.X.RIGHT),d.push(ul.X.LEFT)),R>g.bottom&&D.top+o>w.height?(m=o-w.height,u.push(ul.Y.TOP),d.push(ul.Y.BOTTOM)):(m=o,u.push(ul.Y.BOTTOM),d.push(ul.Y.TOP)),this.props.renderToBody&&(m+=D.top,p+=D.left),this.ref.style.top="".concat(m,"px"),this.ref.style.left="".concat(p,"px"),(r=this.ref.classList).remove.apply(r,d),(a=this.ref.classList).add.apply(a,u)}},{key:"render",value:function(){var r=this,a=this.props,o=a.style,s=a.className,u=a.innerRef,d=a.children,m=a.renderToBody,p=document.body,g=q.createElement("div",{ref:function(D){r.ref=D,u(D)},className:"rta__autocomplete ".concat(s||""),style:o},d);return m&&p!==null?b1.createPortal(g,p):g}}]),t}(q.Component),BT=function(e){Bv(t,e);function t(n){var r;Cm(this,t),r=Hv(this,kd(t).call(this,n)),r.state={top:null,left:null,currentTrigger:null,actualToken:"",data:null,value:"",dataLoading:!1,selectionEnd:0,component:null,textToReplace:null},r.escListenerInit=function(){r.escListener||(r.escListener=Ec.add(Ha.ESC,r._closeAutocomplete))},r.escListenerDestroy=function(){r.escListener&&(Ec.remove(r.escListener),r.escListener=null)},r.getSelectionPosition=function(){return r.textareaRef?{selectionStart:r.textareaRef.selectionStart,selectionEnd:r.textareaRef.selectionEnd}:null},r.getSelectedText=function(){if(!r.textareaRef)return null;var d=r.textareaRef,m=d.selectionStart,p=d.selectionEnd;return m===p?null:r.state.value.substr(m,p-m)},r.setCaretPosition=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;r.textareaRef&&(r.textareaRef.focus(),r.textareaRef.setSelectionRange(d,d))},r.getCaretPosition=function(){if(!r.textareaRef)return 0;var d=r.textareaRef.selectionEnd;return d},r._handleCaretChange=function(d){var m=function(){var w=r.getCaretPosition()-1;r.lastTrigger=r.lastTrigger?w:0};if(d.type==="keydown"){var p=d.keyCode||d.which;switch(p){case Ha.UP:case Ha.DOWN:r._isAutocompleteOpen()||m();break;case Ha.LEFT:case Ha.RIGHT:m();break}return}m()},r._onSelect=function(d){var m=r.state,p=m.selectionEnd,g=m.currentTrigger,w=m.value,D=r.props.onItemSelected;if(g){var S=r._getTextToReplace(g);if(!S){r._closeAutocomplete();return}var T=S(d);if(!T){r._closeAutocomplete();return}D&&D({currentTrigger:g,item:d});var E=function(W,K,ae){switch(W){case"start":return ae;case"next":case"end":return ae+K.length;default:if(!Number.isInteger(W))throw new Error('RTA: caretPosition should be "start", "next", "end" or number.');return W}},A=w.slice(0,p),N=xg(g),R=A.length-A.lastIndexOf(g),F=A.search(new RegExp("(?!".concat(N,")$")))-R,H=T.caretPosition==="next"?"".concat(T.text," "):T.text,P=E(T.caretPosition,H,F),L=A.substring(0,F)+H,z=w.replace(A,L);r.setState({value:z,dataLoading:!1},function(){var U=r.tokenRegExpEnding.exec(H),W=U?U[0].length:1;r.lastTrigger=P&&P-W,r.textareaRef.value=z,r.textareaRef.selectionEnd=P,r._changeHandler();var K=r.textareaRef.scrollTop;r.setCaretPosition(P),window.chrome&&(r.textareaRef.scrollTop=K)})}},r._getTextToReplace=function(d){var m=r.props.trigger[d];if(!d||!m)return null;var p=m.output;return function(g){if(typeof g=="object"&&(!p||typeof p!="function"))throw new Error('Output functor is not defined! If you are using items as object you have to define "output" function. https://github.com/webscopeio/react-textarea-autocomplete#trigger-type');if(p){var w=p(g,d);if(w===void 0||typeof w=="number")throw new Error(`Output functor should return string or object in shape {text: string, caretPosition: string | number}. Got "`.concat(String(w),'". Check the implementation for trigger "').concat(d,`" See https://github.com/webscopeio/react-textarea-autocomplete#trigger-type for more information. `));if(w===null)return null;if(typeof w=="string")return{text:w,caretPosition:xD};if(!w.text&&typeof w.text!="string")throw new Error('Output "text" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(d,`" `));if(!w.caretPosition)throw new Error('Output "caretPosition" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(d,`" `));return w}if(typeof g!="string")throw new Error(`Output item should be string `);return{text:"".concat(d).concat(g).concat(d),caretPosition:xD}}},r._getCurrentTriggerSettings=function(){var d=r.state.currentTrigger;return d?r.props.trigger[d]:null},r._getValuesFromProvider=function(){var d=r.state,m=d.currentTrigger,p=d.actualToken,g=r._getCurrentTriggerSettings();if(!(!m||!g)){var w=g.dataProvider,D=g.component;if(typeof w!="function")throw new Error("Trigger provider has to be a function!");r.setState({dataLoading:!0});var S=w(p);S instanceof Promise||(S=Promise.resolve(S)),S.then(function(T){if(!Array.isArray(T))throw new Error("Trigger provider has to provide an array!");if(typeof D!="function")throw new Error("Component should be defined!");if(m===r.state.currentTrigger){if(!T.length){r._closeAutocomplete();return}r.setState({dataLoading:!1,data:T,component:D})}}).catch(function(T){return CD(T.message)})}},r._getSuggestions=function(){var d=r.state,m=d.currentTrigger,p=d.data;return!m||!p||p&&!p.length?null:p},r._createRegExp=function(){var d=r.props.trigger;r.tokenRegExp=new RegExp("(".concat(Object.keys(d).sort(function(m,p){return mp?-1:0}).map(function(m){return xg(m)}).join("|"),")((?:(?!\\1)[^\\s])*$)")),r.tokenRegExpEnding=new RegExp("(".concat(Object.keys(d).sort(function(m,p){return mp?-1:0}).map(function(m){return xg(m)}).join("|"),")$"))},r._closeAutocomplete=function(){var d=r.state.currentTrigger;r.escListenerDestroy(),r.setState({data:null,dataLoading:!1,currentTrigger:null},function(){d&&r._onItemHighlightedHandler(null)})},r._cleanUpProps=function(){var d=S8({},r.props),m=["loadingComponent","boundariesElement","containerStyle","minChar","scrollToItem","ref","innerRef","onChange","onCaretPositionChange","className","value","trigger","listStyle","itemStyle","containerStyle","loaderStyle","className","containerClassName","listClassName","itemClassName","loaderClassName","dropdownStyle","dropdownClassName","movePopupAsYouType","textAreaComponent","renderToBody","onItemSelected","onItemHighlighted"];for(var p in d)m.includes(p)&&delete d[p];return d},r._changeHandler=function(d){var m=r.props,p=m.trigger,g=m.onChange,w=m.minChar,D=m.onCaretPositionChange,S=m.movePopupAsYouType,T=r.state,E=T.top,A=T.left,N=d;N||(N=new b8("change",{bubbles:!0}),r.textareaRef.dispatchEvent(N));var R=N.target||r.textareaRef,F=R.selectionEnd,H=R.value;if(r.lastValueBubbledEvent=H,g&&N&&(N.persist&&N.persist(),g(new Proxy(N,{get:function(Z,$,X){return $==="target"?R:Reflect.get(Z,$,X)}}))),D){var P=r.getCaretPosition();D(P)}r.setState({value:H});var L=function(){var Z=v8(R,F),$=Z.top,X=Z.left;r.setState({top:$-r.textareaRef.scrollTop||0,left:X})},z=function(Z){r.lastTrigger=F-Z,r._closeAutocomplete(),L()};if(F<=r.lastTrigger){var U=H.slice(0,F),W=r.tokenRegExp.exec(U);z(W?W[0].length:0)}var K=H.slice(r.lastTrigger,F),ae=r.tokenRegExp.exec(K),ce=ae&&ae[0],fe=ae&&ae[1]||null,ie=fe?fe.length-1:0,ge=r.tokenRegExpEnding.exec(K);if(ge?z(ge[0].length):r._isAutocompleteOpen()||r._closeAutocomplete(),(!ce||ce.length<=w+ie)&&(r.state.currentTrigger&&!p[r.state.currentTrigger].allowWhitespace||!r.state.currentTrigger)){r._closeAutocomplete();return}if(fe&&p[fe].afterWhitespace&&!/\s/.test(H[F-ce.length-1])&&H[F-ce.length-1]!==void 0){r._closeAutocomplete();return}if(r.state.currentTrigger&&p[r.state.currentTrigger].allowWhitespace){if(ae=new RegExp("".concat(xg(r.state.currentTrigger),".*$")).exec(H.slice(0,F)),ce=ae&&ae[0],!ce){r._closeAutocomplete();return}fe=Object.keys(p).find(function(we){return we.slice(0,ie+1)===ce.slice(0,ie+1)})||null}var Te=ce.slice(1);if(fe){(S||E===null&&A===null||r.state.currentTrigger!==fe)&&L(),r.escListenerInit();var se=r._getTextToReplace(fe);r.setState({selectionEnd:F,currentTrigger:fe,textToReplace:se,actualToken:Te},function(){try{r._getValuesFromProvider()}catch(we){CD(we.message)}})}},r._selectHandler=function(d){var m=r.props,p=m.onCaretPositionChange,g=m.onSelect;if(p){var w=r.getCaretPosition();p(w)}g&&(d.persist(),g(d))},r._shouldStayOpen=function(d){var m=d.relatedTarget;return m===null&&(m=document.activeElement),!!(r.dropdownRef&&m instanceof Node&&r.dropdownRef.contains(m))},r._onClick=function(d){var m=r.props.onClick;m&&(d.persist(),m(d)),!r._shouldStayOpen(d)&&r._closeAutocomplete()},r._onBlur=function(d){var m=r.props.onBlur;m&&(d.persist(),m(d)),!r._shouldStayOpen(d)&&r._closeAutocomplete()},r._onScrollHandler=function(){r._closeAutocomplete()},r._onItemHighlightedHandler=function(d){var m=r.props.onItemHighlighted,p=r.state.currentTrigger;if(m)if(typeof m=="function")m({currentTrigger:p,item:d});else throw new Error("`onItemHighlighted` has to be a function")},r._dropdownScroll=function(d){var m=r.props.scrollToItem;if(m){if(m===!0){A8(r.dropdownRef,d);return}if(typeof m!="function"||m.length!==2)throw new Error("`scrollToItem` has to be boolean (true for default implementation) or function with two parameters: container, item.");m(r.dropdownRef,d)}},r._isAutocompleteOpen=function(){var d=r.state,m=d.dataLoading,p=d.currentTrigger,g=r._getSuggestions();return!!((m||g)&&p)},r._textareaRef=function(d){r.props.innerRef&&r.props.innerRef(d),r.textareaRef=d},r.lastTrigger=0,r.escListener=null;var a=r.props,o=a.loadingComponent,s=a.trigger,u=a.value;if(u&&(r.state.value=u),r._createRegExp(),!o)throw new Error("RTA: loadingComponent is not defined");if(!s)throw new Error("RTA: trigger is not defined");return r}return _v(t,[{key:"componentDidMount",value:function(){Ec.startListen(this.textareaRef),this.textareaRef&&this.textareaRef.addEventListener("focus",this._handleCaretChange),this.textareaRef&&this.textareaRef.addEventListener("click",this._handleCaretChange),this.textareaRef&&this.textareaRef.addEventListener("keydown",this._handleCaretChange)}},{key:"componentDidUpdate",value:function(r){var a=r.trigger,o=r.value,s=this.props,u=s.trigger,d=s.value;Object.keys(u).join("")!==Object.keys(a).join("")&&this._createRegExp(),o!==d&&this.lastValueBubbledEvent!==d&&(this.lastTrigger=0,this._changeHandler())}},{key:"componentWillUnmount",value:function(){this.escListenerDestroy(),Ec.stopListen(this.textareaRef),this.textareaRef&&this.textareaRef.removeEventListener("focus",this._handleCaretChange),this.textareaRef&&this.textareaRef.removeEventListener("click",this._handleCaretChange),this.textareaRef&&this.textareaRef.removeEventListener("keydown",this._handleCaretChange)}},{key:"render",value:function(){var r=this,a=this.props,o=a.loadingComponent,s=a.style,u=a.className,d=a.listStyle,m=a.itemStyle,p=a.boundariesElement,g=a.movePopupAsYouType,w=a.listClassName,D=a.itemClassName,S=a.dropdownClassName,T=a.dropdownStyle,E=a.containerStyle,A=a.containerClassName,N=a.loaderStyle,R=a.loaderClassName,F=a.textAreaComponent,H=a.renderToBody,P=this.state,L=P.left,z=P.top,U=P.dataLoading,W=P.component,K=P.value,ae=P.textToReplace,ce=this._isAutocompleteOpen(),fe=this._getSuggestions(),ie={},ge;return F.component?(ge=F.component,ie[F.ref]=this._textareaRef):(ge=F,ie.ref=this._textareaRef),q.createElement("div",{className:"rta ".concat(U===!0?"rta--loading":""," ").concat(A||""),style:E},q.createElement(ge,Object.assign({},this._cleanUpProps(),{className:"rta__textarea ".concat(u||""),onChange:this._changeHandler,onSelect:this._selectHandler,onScroll:this._onScrollHandler,onClick:this._onClick,onBlur:this._onBlur,value:K,style:s},ie)),ce&&q.createElement(F8,{innerRef:function(se){r.dropdownRef=se},top:z,left:L,style:T,className:S,movePopupAsYouType:g,boundariesElement:p,textareaRef:this.textareaRef,renderToBody:H},fe&&W&&ae&&q.createElement(k8,{values:fe,component:W,style:d,className:w,itemClassName:D,itemStyle:m,getTextToReplace:ae,onItemHighlighted:this._onItemHighlightedHandler,onSelect:this._onSelect,dropdownScroll:this._dropdownScroll}),U&&q.createElement("div",{className:"rta__loader ".concat(fe!==null?"rta__loader--suggestion-data":"rta__loader--empty-suggestion-data"," ").concat(R||""),style:N},q.createElement(o,{data:fe}))))}}],[{key:"getDerivedStateFromProps",value:function(r){var a=r.value;return a==null?null:{value:a}}}]),t}(q.Component);BT.defaultProps={movePopupAsYouType:!1,value:null,minChar:1,boundariesElement:"body",scrollToItem:!0,textAreaComponent:"textarea",renderToBody:!1};const P8=()=>{const{app:e}=rt.getState(),t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())},j8=e=>{let t=[];const n=rt.getState().settings;if(n&&(n!=null&&n.UseVaultTags))t=P8();else{const{tags:o}=Ie.getState();t=o}const r=e.toLowerCase(),a=[];return t.forEach(o=>{o&&o.toLowerCase().contains(r)&&a.push({name:o,char:o})}),a},L8=e=>{const{app:t}=rt.getState(),n=t.vault.getAllLoadedFiles(),r=[];let a;return n.forEach(o=>{e==="["?a="":e.contains("[")&&(a=e.slice(1));const s=a.toLowerCase();o instanceof x.TFile&&["md","png","jpg","canvas","jpeg","gif"].contains(o.extension)&&o.path.toLowerCase().contains(s)&&r.push({name:o.basename,char:o.name,file:o})}),r};var O0=O,R8=function(e){return typeof e=="function"},_8=function(e){var t=O0.useState(e),n=t[0],r=t[1],a=O0.useRef(n),o=O0.useCallback(function(s){a.current=R8(s)?s(a.current):s,r(a.current)},[]);return[n,o,a]},H8=_8;const Br=Xn(H8);function cv(e,t){const n=Object.keys(t).map(r=>B8(e,r,t[r]));return n.length===1?n[0]:function(){n.forEach(r=>r())}}function B8(e,t,n){const r=e[t],a=e.hasOwnProperty(t);let o=n(r);return r&&Object.setPrototypeOf(o,r),Object.setPrototypeOf(s,o),e[t]=s,u;function s(...d){return o===r&&e[t]===s&&u(),o.apply(this,d)}function u(){e[t]===s&&(a?e[t]=r:delete e[t]),o!==r&&(o=r,Object.setPrototypeOf(s,r||Function))}}function Y8(e){return e.containerEl.matches(".memos-list-view")}const z8=e=>{const{dailyNotesState:{app:t,plugin:n,editor:r,view:a,dailyNotes:o}}=O.useContext(wt),[s,u]=O.useState(null),[d,m]=O.useState(!1),[p,g]=O.useState(""),[w,D]=O.useState(null),S=O.useRef(x.debounce((L,z)=>{V8(L,z)},100));O.useEffect(()=>{if(!w){for(const L in o)if(o[L]instanceof x.TFile){D(o[L]);break}}},[o]),O.useEffect(()=>{if(!(!e||!r)&&!d)return N(e),()=>{m(!1),s==null||s.destroy()}},[r,e]),O.useEffect(()=>{if(!s||!t)return;const L=U8(t);g(L),(s==null?void 0:s.editor).replaceSelection(L)},[s,t]),O.useEffect(()=>{!s||!t||S.current(p,t)},[p,t]);const T=()=>{s&&s.toggleSource()},E=x.debounce((L,z)=>A(L,z),500,!0),A=(L,z)=>{L&&g(z)},N=L=>{if(r&&a){a.register(cv(r.constructor.prototype,{onUpdate:U=>function(...W){if(U.call(this,W),this.owner.getViewType()==="thino_view"||this.owner instanceof yl){const K=this.get();E(this.owner,K)}},getMode:()=>function(){return"source"}})),a.register(cv(x.Workspace.prototype,{getActiveViewOfType:U=>function(W){const K=U.call(this,W);if(!K&&(W==null?void 0:W.VIEW_TYPE)==="markdown"){const ae=this.activeLeaf;if(ae.view instanceof yl)return ae.view}return K},setActiveLeaf:U=>function(W,K){if(Y8(W)&&(U.call(this,W,K),W.activeTime=17e11),U.call(this,W,K),W.view instanceof yl){const ae=Qe.getState().instanceList.get(W.id);if(!ae)return;self.app.workspace.activeEditor=ae.owner,W.view.editor=ae.editor}},getActiveFile:U=>function(){var K;const W=U.call(this);return((K=this.activeLeaf)==null?void 0:K.view)instanceof yl&&w||W}}));const z=new r.constructor(a.app,L,a);z.owner.editor=z.editor,z.set&&z.set("",!0),z.owner.onMarkdownScroll=()=>{},t.workspace.trigger("thino-editor-created",L,z.editor),m(!0),u(z),Qe.setInstance(`${a.leaf.id}`,z)}};return{instance:s,value:p,set:L=>{try{s&&((s==null?void 0:s.editor).replaceSelection(L),g(L))}catch(z){console.error(z)}},get:()=>s?s.get():"",append:(L,z)=>{if(!s||z&&z!==s.owner.leaf.id)return;const W=(s.get()||"")+L;(s==null?void 0:s.editor).replaceSelection(L),g(W)},clear:()=>{s&&(s.clear(),g(""))},toggleSource:T}};function YT(e){return`thinoEditorContentCache:${e}`}function U8(e){try{const t=YT(e==null?void 0:e.appId);return Kn.get([t])[t]||""}catch(t){return console.error(t),""}}function V8(e,t){try{const n=YT(t==null?void 0:t.appId);Kn.set({[n]:e})}catch(n){console.error(n)}}const MD=({entity:{name:e,char:t,file:n}})=>y.jsx("div",{children:`${t}`}),Z8=({data:e})=>y.jsx("div",{children:"Loading"});let bi;const W8=O.forwardRef((e,t)=>{var De;const{globalState:{useTinyUndoHistoryCache:n,globalEditorShown:r,memoListView:a},dailyNotesState:{settings:o,app:s}}=O.useContext(wt),{SaveMemoButtonLabel:u,SaveMemoButtonIcon:d}=o,{className:m,inputerType:p,initialContent:g,placeholder:w,showConfirmBtn:D,showCancelBtn:S,onConfirmBtnClick:T,onCancelBtnClick:E,onContentChange:A}=e,N=O.useRef(null),R=O.useRef(null),F=O.useRef(null),H=p8(),{instance:P,value:L,set:z,get:U,append:W,clear:K,toggleSource:ae}=z8(R.current),[,ce,fe]=Br(0),[ie,ge]=Br(!1);O.useEffect(()=>{var be,ke;if(o&&o.FocusOnEditor)switch(p){case"minimal":case"memos":(be=N.current)==null||be.focus();break;case"obsidian":P&&((ke=P.editor)==null||ke.focus())}},[o,P]),O.useEffect(()=>{if(!s)return;const be=s.workspace.getLeavesOfType(Hr);let ke,Be;be.length>0?(Be=be[0].view.containerEl,ke=Be.offsetHeight):(Be=document,ke=window.outerHeight),ce(ke)},[s]),O.useEffect(()=>{!N.current||p==="obsidian"||g&&(N.current.value=g,H())},[]),O.useEffect(()=>{var be;if(p!=="obsidian")if(n){if(!N.current)return;const{tinyUndoActionsCache:ke,tinyUndoIndexCache:Be}=Kn.get(["tinyUndoActionsCache","tinyUndoIndexCache"]);return F.current=new m8(N.current,{interval:5e3,initialActions:ke,initialIndex:Be}),F.current.subscribe((_e,it)=>{Kn.set({tinyUndoActionsCache:_e,tinyUndoIndexCache:it})}),()=>{var _e;(_e=F.current)==null||_e.destroy()}}else(be=F.current)==null||be.destroy(),F.current=null,Kn.remove(["tinyUndoActionsCache","tinyUndoIndexCache"])},[n]),O.useEffect(()=>{N.current&&(N.current.style.height="auto",N.current.style.height=(N.current.scrollHeight??0)+"px")},[(De=N.current)==null?void 0:De.value]),O.useImperativeHandle(t,()=>({element:N.current,blur:()=>{var be,ke;switch(p){case"minimal":case"memos":(be=N.current)==null||be.blur();break;case"obsidian":P&&((ke=P.editor)==null||ke.blur())}},focus:be=>{var ke,Be,_e,it,Vt;switch(p){case"minimal":case"memos":o!=null&&o.FocusOnEditor&&((ke=N.current)==null||ke.focus());break;case"obsidian":if(o!=null&&o.FocusOnEditor&&P){if(be&&be!==((it=(_e=(Be=P==null?void 0:P.owner)==null?void 0:Be.view)==null?void 0:_e.leaf)==null?void 0:it.id))return;(Vt=P.editor)==null||Vt.focus()}}},insertText:(be,ke)=>{switch(p){case"minimal":case"memos":{if(!N.current)return;const Be=N.current.value;N.current.value=Be.slice(0,N.current.selectionStart)+be+Be.slice(N.current.selectionStart),A(N.current.value),H()}break;case"obsidian":P&&W(be,ke);break}},setContent:be=>{switch(p){case"minimal":case"memos":N.current&&(N.current.value=be,A(N.current.value),H());break;case"obsidian":P&&z(be);break}},getContent:()=>{switch(p){case"minimal":case"memos":return N.current?N.current.value:"";case"obsidian":return U()}},toggleSource:()=>{switch(p){case"minimal":case"memos":break;case"obsidian":ae();break}},clear:()=>{switch(p){case"minimal":case"memos":N.current&&(N.current.value="",A(N.current.value),H());break;case"obsidian":K();break}}}),[P,p]);const Te=be=>{if(!N.current)return;const{fileManager:ke}=Ee.getState().dailyNotesState.app;if(be.currentTrigger==="#"){const Be=N.current.value;let _e;bi!=null?_e=bi.length:_e=0;let it=N.current.selectionStart;for(let Vt=0;Vt{var be;A(((be=N.current)==null?void 0:be.value)||""),H()},[]),we=()=>{var be;switch(p){case"minimal":case"memos":if(!N.current)return;N.current.value=$(),T(N.current.value),N.current.value="",H(),(be=F.current)==null||be.resetState();break;case"obsidian":T(U()),K(),H();break}},Z=O.useCallback(()=>{switch(p){case"minimal":case"memos":N.current&&(N.current.value="",A(N.current.value),H());break;case"obsidian":K();break}E()},[p,P,N]),$=()=>Kn.get(["thinoEditorContentCache"]).thinoEditorContentCache||"",X=()=>{if(N.current)return N.current.value=$(),N.current.value},ve=be=>{switch(be){case"memos":return y.jsx(BT,{className:`common-editor-inputer scroll ${ie?" editing":""}`,loadingComponent:Z8,placeholder:w,movePopupAsYouType:!0,value:X(),innerRef:ke=>{N.current=ke},onFocus:()=>{ge(!0)},onBlur:()=>{ge(!1)},onInput:se,style:{maxHeight:`${fe.current>400?fe.current-400:100}px`},dropdownStyle:{minWidth:180,maxHeight:250,overflowY:"auto"},minChar:0,onItemSelected:Te,scrollToItem:!0,trigger:{"#":{dataProvider:ke=>(bi=ke,j8(ke).map(({name:Be,char:_e})=>({name:Be,char:_e}))),component:MD,afterWhitespace:!0,output:ke=>ke.char},"[[":{dataProvider:ke=>(bi=ke,L8(ke).slice(0,10).map(({name:Be,char:_e,file:it})=>({name:Be,char:_e,file:it}))),component:MD,afterWhitespace:!0,output:ke=>ke.char}}});case"minimal":return y.jsx("textarea",{style:{minHeight:48},className:"common-editor-inputer scroll",rows:1,placeholder:w,ref:N,onInput:se});case"obsidian":return y.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",ref:R});default:return y.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",ref:R})}};return y.jsxs("div",{className:"common-editor-wrapper "+m,children:[ve(p),y.jsxs("div",{className:"common-tools-wrapper",children:[y.jsx("div",{className:"common-tools-container",children:y.jsx(lo,{when:e.tools!==void 0,children:e.tools})}),y.jsxs("div",{className:"btns-container",children:[y.jsx(lo,{when:S,children:y.jsx("button",{className:"action-btn cancel-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&Z()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&Z()},children:We.getState().pathname==="/"&&a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?"":k("CANCEL EDIT")})}),y.jsx(lo,{when:D,children:y.jsxs("button",{title:"Ctrl/Cmd + Enter to save thino",className:"action-btn confirm-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&we()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&we()},children:[a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?"":u,y.jsx("span",{className:"icon-text",children:a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?null:d})]})})]})]})]})}),$8=typeof window<"u"?O.useLayoutEffect:O.useEffect;function G8(e,t,n,r){const a=O.useRef(t);$8(()=>{a.current=t},[t]),O.useEffect(()=>{const o=(n==null?void 0:n.current)||window;if(!(o&&o.addEventListener))return;const s=u=>{a.current(u)};return o.addEventListener(e,s,r),()=>{o.removeEventListener(e,s,r)}},[e,n,r])}function Mm(e,t,n="mousedown"){G8(n,r=>{const a=r.target;if(!a||!a.isConnected||a.closest(".suggestion-container")||a.closest(".menu"))return;(Array.isArray(e)?e.every(s=>s.current&&!s.current.contains(a)):e.current&&!e.current.contains(a))&&t(r)})}const zT=e=>{const{year:t,handleYearChange:n}=e,[r,a]=O.useState([]),[o,s]=O.useState(t),u=O.useRef(null),d=O.useRef(null),[m,p]=q.useState(!1),g=q.useRef(null);Mm(g,()=>{p(!1)}),O.useEffect(()=>{u.current&&x.setIcon(u.current,"chevron-left"),d.current&&x.setIcon(d.current,"chevron-right")},[u,d,m]),O.useEffect(()=>{D(o)},[t]);const D=S=>{const T=parseInt(S),E=T-T%10,A=[];for(let N=0;N<10;N++)A.push(`${E+N}`);a(A)};return y.jsxs(y.Fragment,{children:[y.jsxs("span",{className:"btn year-btn",onClick:()=>{p(!m)},children:[y.jsx("span",{children:t}),y.jsx("span",{children:k("year")})]}),m&&y.jsxs("div",{ref:g,className:"year-picker-wrapper",children:[y.jsxs("div",{className:"year-picker-header",children:[y.jsxs("div",{className:"year-picker-header-title",children:[o," "+(k("year")||"")]}),y.jsxs("div",{className:"year-picker-header-btns",children:[y.jsx("span",{className:"btn",ref:u,onClick:()=>{const S=parseInt(o)-10;s(S.toString()),D(S.toString())}}),y.jsx("span",{className:"btn",ref:d,onClick:()=>{const S=parseInt(o)+10;s(S.toString()),D(S.toString())}})]})]}),y.jsx("div",{className:"year-picker-body",children:y.jsx("div",{className:"year-picker-body-list",children:r.map(S=>y.jsx("div",{className:`year-picker-body-item ${S===o?"selected":""}`,onClick:()=>{s(S),n(S),p(!1)},children:S},S))})})]})]})},UT=e=>{const{month:t,handleMonthChange:n}=e,[r,a]=O.useState([]),[o,s]=O.useState((parseInt(t)+1).toString()),[u,d]=q.useState(!1),m=q.useRef(null);Mm(m,()=>{d(!1)}),O.useEffect(()=>{g()},[t]);const g=()=>{const w=[];for(let D=1;D<=12;D++)w.push(`${D}`);a(w)};return y.jsxs(y.Fragment,{children:[y.jsxs("span",{className:"btn month-btn",onClick:()=>{d(!u)},children:[y.jsxs("span",{children:[k("monthsShort")[parseInt(t)]||parseInt(t)+1," "]}),y.jsx("span",{children:k("month")||""})]}),u&&y.jsxs("div",{ref:m,className:"month-picker-wrapper",children:[y.jsxs("div",{className:"month-picker-header",children:[y.jsxs("div",{className:"month-picker-header-title",children:[o," "+(k("month")||"")]}),y.jsx("div",{className:"month-picker-header-btns"})]}),y.jsx("div",{className:"month-picker-body",children:y.jsx("div",{className:"month-picker-body-list",children:r.map(w=>y.jsx("div",{className:`month-picker-body-item ${w===o?"selected":""}`,onClick:()=>{s(w),n(w),d(!1)},children:w},w))})})]})]})},Nm=e=>{const{className:t,datestamp:n,handleDateStampChange:r}=e,[a,o]=O.useState(Ph(n)),[s,u]=O.useState(n);O.useEffect(()=>{o(Ph(n))},[n]);const d=new Date(a),m=d.getDay(),p=[];for(let S=0;S{r(T,S.nativeEvent),u(T)},D=S=>{const T=d.getFullYear(),E=d.getMonth()+1;let A=0;E===1&&S===-1?A=new Date(`${T-1}/12/1`).getTime():E===12&&S===1?A=new Date(`${T+1}/1/1`).getTime():A=new Date(`${T}/${E+S}/1`).getTime(),o(Ph(A))};return y.jsxs("div",{className:`date-picker-wrapper ${t}`,children:[y.jsxs("div",{className:"date-picker-header",children:[y.jsx("span",{ref:S=>{S&&x.setIcon(S,"chevron-left")},className:"btn btn-text",onClick:()=>D(-1)}),y.jsxs("span",{className:"normal-text",children:[y.jsx(zT,{year:d.getFullYear().toString(),handleYearChange:S=>{o(Ph(new Date(`${S}/${d.getMonth()+1}/1`).getTime()))}}),y.jsx(UT,{month:d.getMonth().toString(),handleMonthChange:S=>{o(Ph(new Date(`${d.getFullYear()}/${parseInt(S)}/1`).getTime()))}})]}),y.jsx("span",{ref:S=>{S&&x.setIcon(S,"chevron-right")},className:"btn btn-text",onClick:()=>D(1)})]}),y.jsxs("div",{className:"date-picker-day-container",children:[y.jsx("div",{className:"date-picker-day-header",children:k("weekDaysShort").map(S=>y.jsx("span",{className:"day-item",children:S},S))}),y.jsx("div",{className:"date-picker-day-content",children:p.map(S=>S.date===0?y.jsx("span",{className:"day-item null",children:""},S.datestamp):y.jsx("span",{className:`day-item ${S.datestamp===n?"current":""} ${S.datestamp===s?"selected":""}`,onClick:T=>w(T,S.datestamp),children:y.jsx("span",{className:"day-item-text",children:S.date})},S.datestamp))})]})]})};function q8(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return((n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-n.getTime())/Ba}function Ph(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}var ND=function(t){return t.reduce(function(n,r){var a=r[0],o=r[1];return n[a]=o,n},{})},kD=typeof window<"u"&&window.document&&window.document.createElement?O.useLayoutEffect:O.useEffect,wa="top",uo="bottom",fo="right",ba="left",D1="auto",km=[wa,uo,fo,ba],Ad="start",em="end",J8="clippingParents",VT="viewport",jh="popper",K8="reference",AD=km.reduce(function(e,t){return e.concat([t+"-"+Ad,t+"-"+em])},[]),S1=[].concat(km,[D1]).reduce(function(e,t){return e.concat([t,t+"-"+Ad,t+"-"+em])},[]),Q8="beforeRead",X8="read",e9="afterRead",t9="beforeMain",n9="main",r9="afterMain",a9="beforeWrite",o9="write",i9="afterWrite",s9=[Q8,X8,e9,t9,n9,r9,a9,o9,i9];function ki(e){return e?(e.nodeName||"").toLowerCase():null}function za(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function kc(e){var t=za(e).Element;return e instanceof t||e instanceof Element}function co(e){var t=za(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function I1(e){if(typeof ShadowRoot>"u")return!1;var t=za(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function l9(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},a=t.attributes[n]||{},o=t.elements[n];!co(o)||!ki(o)||(Object.assign(o.style,r),Object.keys(a).forEach(function(s){var u=a[s];u===!1?o.removeAttribute(s):o.setAttribute(s,u===!0?"":u)}))})}function c9(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var a=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=s.reduce(function(d,m){return d[m]="",d},{});!co(a)||!ki(a)||(Object.assign(a.style,u),Object.keys(o).forEach(function(d){a.removeAttribute(d)}))})}}const u9={name:"applyStyles",enabled:!0,phase:"write",fn:l9,effect:c9,requires:["computeStyles"]};function Ni(e){return e.split("-")[0]}var Mc=Math.max,uv=Math.min,Od=Math.round;function Nw(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function ZT(){return!/^((?!chrome|android).)*safari/i.test(Nw())}function Fd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),a=1,o=1;t&&co(e)&&(a=e.offsetWidth>0&&Od(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Od(r.height)/e.offsetHeight||1);var s=kc(e)?za(e):window,u=s.visualViewport,d=!ZT()&&n,m=(r.left+(d&&u?u.offsetLeft:0))/a,p=(r.top+(d&&u?u.offsetTop:0))/o,g=r.width/a,w=r.height/o;return{width:g,height:w,top:p,right:m+g,bottom:p+w,left:m,x:m,y:p}}function T1(e){var t=Fd(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function WT(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&I1(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ms(e){return za(e).getComputedStyle(e)}function d9(e){return["table","td","th"].indexOf(ki(e))>=0}function Tl(e){return((kc(e)?e.ownerDocument:e.document)||window.document).documentElement}function Yv(e){return ki(e)==="html"?e:e.assignedSlot||e.parentNode||(I1(e)?e.host:null)||Tl(e)}function OD(e){return!co(e)||ms(e).position==="fixed"?null:e.offsetParent}function f9(e){var t=/firefox/i.test(Nw()),n=/Trident/i.test(Nw());if(n&&co(e)){var r=ms(e);if(r.position==="fixed")return null}var a=Yv(e);for(I1(a)&&(a=a.host);co(a)&&["html","body"].indexOf(ki(a))<0;){var o=ms(a);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return a;a=a.parentNode}return null}function Am(e){for(var t=za(e),n=OD(e);n&&d9(n)&&ms(n).position==="static";)n=OD(n);return n&&(ki(n)==="html"||ki(n)==="body"&&ms(n).position==="static")?t:n||f9(e)||t}function E1(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Gh(e,t,n){return Mc(e,uv(t,n))}function h9(e,t,n){var r=Gh(e,t,n);return r>n?n:r}function $T(){return{top:0,right:0,bottom:0,left:0}}function GT(e){return Object.assign({},$T(),e)}function qT(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var m9=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,GT(typeof t!="number"?t:qT(t,km))};function p9(e){var t,n=e.state,r=e.name,a=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,u=Ni(n.placement),d=E1(u),m=[ba,fo].indexOf(u)>=0,p=m?"height":"width";if(!(!o||!s)){var g=m9(a.padding,n),w=T1(o),D=d==="y"?wa:ba,S=d==="y"?uo:fo,T=n.rects.reference[p]+n.rects.reference[d]-s[d]-n.rects.popper[p],E=s[d]-n.rects.reference[d],A=Am(o),N=A?d==="y"?A.clientHeight||0:A.clientWidth||0:0,R=T/2-E/2,F=g[D],H=N-w[p]-g[S],P=N/2-w[p]/2+R,L=Gh(F,P,H),z=d;n.modifiersData[r]=(t={},t[z]=L,t.centerOffset=L-P,t)}}function g9(e){var t=e.state,n=e.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=t.elements.popper.querySelector(a),!a)||WT(t.elements.popper,a)&&(t.elements.arrow=a))}const JT={name:"arrow",enabled:!0,phase:"main",fn:p9,effect:g9,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Pd(e){return e.split("-")[1]}var v9={top:"auto",right:"auto",bottom:"auto",left:"auto"};function y9(e,t){var n=e.x,r=e.y,a=t.devicePixelRatio||1;return{x:Od(n*a)/a||0,y:Od(r*a)/a||0}}function FD(e){var t,n=e.popper,r=e.popperRect,a=e.placement,o=e.variation,s=e.offsets,u=e.position,d=e.gpuAcceleration,m=e.adaptive,p=e.roundOffsets,g=e.isFixed,w=s.x,D=w===void 0?0:w,S=s.y,T=S===void 0?0:S,E=typeof p=="function"?p({x:D,y:T}):{x:D,y:T};D=E.x,T=E.y;var A=s.hasOwnProperty("x"),N=s.hasOwnProperty("y"),R=ba,F=wa,H=window;if(m){var P=Am(n),L="clientHeight",z="clientWidth";if(P===za(n)&&(P=Tl(n),ms(P).position!=="static"&&u==="absolute"&&(L="scrollHeight",z="scrollWidth")),a===wa||(a===ba||a===fo)&&o===em){F=uo;var U=g&&P===H&&H.visualViewport?H.visualViewport.height:P[L];T-=U-r.height,T*=d?1:-1}if(a===ba||(a===wa||a===uo)&&o===em){R=fo;var W=g&&P===H&&H.visualViewport?H.visualViewport.width:P[z];D-=W-r.width,D*=d?1:-1}}var K=Object.assign({position:u},m&&v9),ae=p===!0?y9({x:D,y:T},za(n)):{x:D,y:T};if(D=ae.x,T=ae.y,d){var ce;return Object.assign({},K,(ce={},ce[F]=N?"0":"",ce[R]=A?"0":"",ce.transform=(H.devicePixelRatio||1)<=1?"translate("+D+"px, "+T+"px)":"translate3d("+D+"px, "+T+"px, 0)",ce))}return Object.assign({},K,(t={},t[F]=N?T+"px":"",t[R]=A?D+"px":"",t.transform="",t))}function w9(e){var t=e.state,n=e.options,r=n.gpuAcceleration,a=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,u=n.roundOffsets,d=u===void 0?!0:u,m={placement:Ni(t.placement),variation:Pd(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,FD(Object.assign({},m,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:d})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,FD(Object.assign({},m,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const KT={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:w9,data:{}};var Cg={passive:!0};function b9(e){var t=e.state,n=e.instance,r=e.options,a=r.scroll,o=a===void 0?!0:a,s=r.resize,u=s===void 0?!0:s,d=za(t.elements.popper),m=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&m.forEach(function(p){p.addEventListener("scroll",n.update,Cg)}),u&&d.addEventListener("resize",n.update,Cg),function(){o&&m.forEach(function(p){p.removeEventListener("scroll",n.update,Cg)}),u&&d.removeEventListener("resize",n.update,Cg)}}const QT={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:b9,data:{}};var D9={left:"right",right:"left",bottom:"top",top:"bottom"};function Wg(e){return e.replace(/left|right|bottom|top/g,function(t){return D9[t]})}var S9={start:"end",end:"start"};function PD(e){return e.replace(/start|end/g,function(t){return S9[t]})}function x1(e){var t=za(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function C1(e){return Fd(Tl(e)).left+x1(e).scrollLeft}function I9(e,t){var n=za(e),r=Tl(e),a=n.visualViewport,o=r.clientWidth,s=r.clientHeight,u=0,d=0;if(a){o=a.width,s=a.height;var m=ZT();(m||!m&&t==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}return{width:o,height:s,x:u+C1(e),y:d}}function T9(e){var t,n=Tl(e),r=x1(e),a=(t=e.ownerDocument)==null?void 0:t.body,o=Mc(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Mc(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),u=-r.scrollLeft+C1(e),d=-r.scrollTop;return ms(a||n).direction==="rtl"&&(u+=Mc(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:s,x:u,y:d}}function M1(e){var t=ms(e),n=t.overflow,r=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function XT(e){return["html","body","#document"].indexOf(ki(e))>=0?e.ownerDocument.body:co(e)&&M1(e)?e:XT(Yv(e))}function qh(e,t){var n;t===void 0&&(t=[]);var r=XT(e),a=r===((n=e.ownerDocument)==null?void 0:n.body),o=za(r),s=a?[o].concat(o.visualViewport||[],M1(r)?r:[]):r,u=t.concat(s);return a?u:u.concat(qh(Yv(s)))}function kw(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function E9(e,t){var n=Fd(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function jD(e,t,n){return t===VT?kw(I9(e,n)):kc(t)?E9(t,n):kw(T9(Tl(e)))}function x9(e){var t=qh(Yv(e)),n=["absolute","fixed"].indexOf(ms(e).position)>=0,r=n&&co(e)?Am(e):e;return kc(r)?t.filter(function(a){return kc(a)&&WT(a,r)&&ki(a)!=="body"}):[]}function C9(e,t,n,r){var a=t==="clippingParents"?x9(e):[].concat(t),o=[].concat(a,[n]),s=o[0],u=o.reduce(function(d,m){var p=jD(e,m,r);return d.top=Mc(p.top,d.top),d.right=uv(p.right,d.right),d.bottom=uv(p.bottom,d.bottom),d.left=Mc(p.left,d.left),d},jD(e,s,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function eE(e){var t=e.reference,n=e.element,r=e.placement,a=r?Ni(r):null,o=r?Pd(r):null,s=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,d;switch(a){case wa:d={x:s,y:t.y-n.height};break;case uo:d={x:s,y:t.y+t.height};break;case fo:d={x:t.x+t.width,y:u};break;case ba:d={x:t.x-n.width,y:u};break;default:d={x:t.x,y:t.y}}var m=a?E1(a):null;if(m!=null){var p=m==="y"?"height":"width";switch(o){case Ad:d[m]=d[m]-(t[p]/2-n[p]/2);break;case em:d[m]=d[m]+(t[p]/2-n[p]/2);break}}return d}function tm(e,t){t===void 0&&(t={});var n=t,r=n.placement,a=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,u=n.boundary,d=u===void 0?J8:u,m=n.rootBoundary,p=m===void 0?VT:m,g=n.elementContext,w=g===void 0?jh:g,D=n.altBoundary,S=D===void 0?!1:D,T=n.padding,E=T===void 0?0:T,A=GT(typeof E!="number"?E:qT(E,km)),N=w===jh?K8:jh,R=e.rects.popper,F=e.elements[S?N:w],H=C9(kc(F)?F:F.contextElement||Tl(e.elements.popper),d,p,s),P=Fd(e.elements.reference),L=eE({reference:P,element:R,strategy:"absolute",placement:a}),z=kw(Object.assign({},R,L)),U=w===jh?z:P,W={top:H.top-U.top+A.top,bottom:U.bottom-H.bottom+A.bottom,left:H.left-U.left+A.left,right:U.right-H.right+A.right},K=e.modifiersData.offset;if(w===jh&&K){var ae=K[a];Object.keys(W).forEach(function(ce){var fe=[fo,uo].indexOf(ce)>=0?1:-1,ie=[wa,uo].indexOf(ce)>=0?"y":"x";W[ce]+=ae[ie]*fe})}return W}function M9(e,t){t===void 0&&(t={});var n=t,r=n.placement,a=n.boundary,o=n.rootBoundary,s=n.padding,u=n.flipVariations,d=n.allowedAutoPlacements,m=d===void 0?S1:d,p=Pd(r),g=p?u?AD:AD.filter(function(S){return Pd(S)===p}):km,w=g.filter(function(S){return m.indexOf(S)>=0});w.length===0&&(w=g);var D=w.reduce(function(S,T){return S[T]=tm(e,{placement:T,boundary:a,rootBoundary:o,padding:s})[Ni(T)],S},{});return Object.keys(D).sort(function(S,T){return D[S]-D[T]})}function N9(e){if(Ni(e)===D1)return[];var t=Wg(e);return[PD(e),t,PD(t)]}function k9(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var a=n.mainAxis,o=a===void 0?!0:a,s=n.altAxis,u=s===void 0?!0:s,d=n.fallbackPlacements,m=n.padding,p=n.boundary,g=n.rootBoundary,w=n.altBoundary,D=n.flipVariations,S=D===void 0?!0:D,T=n.allowedAutoPlacements,E=t.options.placement,A=Ni(E),N=A===E,R=d||(N||!S?[Wg(E)]:N9(E)),F=[E].concat(R).reduce(function(De,be){return De.concat(Ni(be)===D1?M9(t,{placement:be,boundary:p,rootBoundary:g,padding:m,flipVariations:S,allowedAutoPlacements:T}):be)},[]),H=t.rects.reference,P=t.rects.popper,L=new Map,z=!0,U=F[0],W=0;W=0,ie=fe?"width":"height",ge=tm(t,{placement:K,boundary:p,rootBoundary:g,altBoundary:w,padding:m}),Te=fe?ce?fo:ba:ce?uo:wa;H[ie]>P[ie]&&(Te=Wg(Te));var se=Wg(Te),we=[];if(o&&we.push(ge[ae]<=0),u&&we.push(ge[Te]<=0,ge[se]<=0),we.every(function(De){return De})){U=K,z=!1;break}L.set(K,we)}if(z)for(var Z=S?3:1,$=function(be){var ke=F.find(function(Be){var _e=L.get(Be);if(_e)return _e.slice(0,be).every(function(it){return it})});if(ke)return U=ke,"break"},X=Z;X>0;X--){var ve=$(X);if(ve==="break")break}t.placement!==U&&(t.modifiersData[r]._skip=!0,t.placement=U,t.reset=!0)}}const tE={name:"flip",enabled:!0,phase:"main",fn:k9,requiresIfExists:["offset"],data:{_skip:!1}};function LD(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function RD(e){return[wa,fo,uo,ba].some(function(t){return e[t]>=0})}function A9(e){var t=e.state,n=e.name,r=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,s=tm(t,{elementContext:"reference"}),u=tm(t,{altBoundary:!0}),d=LD(s,r),m=LD(u,a,o),p=RD(d),g=RD(m);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:m,isReferenceHidden:p,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":g})}const nE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:A9};function O9(e,t,n){var r=Ni(e),a=[ba,wa].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],u=o[1];return s=s||0,u=(u||0)*a,[ba,fo].indexOf(r)>=0?{x:u,y:s}:{x:s,y:u}}function F9(e){var t=e.state,n=e.options,r=e.name,a=n.offset,o=a===void 0?[0,0]:a,s=S1.reduce(function(p,g){return p[g]=O9(g,t.rects,o),p},{}),u=s[t.placement],d=u.x,m=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=m),t.modifiersData[r]=s}const rE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:F9};function P9(e){var t=e.state,n=e.name;t.modifiersData[n]=eE({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const aE={name:"popperOffsets",enabled:!0,phase:"read",fn:P9,data:{}};function j9(e){return e==="x"?"y":"x"}function L9(e){var t=e.state,n=e.options,r=e.name,a=n.mainAxis,o=a===void 0?!0:a,s=n.altAxis,u=s===void 0?!1:s,d=n.boundary,m=n.rootBoundary,p=n.altBoundary,g=n.padding,w=n.tether,D=w===void 0?!0:w,S=n.tetherOffset,T=S===void 0?0:S,E=tm(t,{boundary:d,rootBoundary:m,padding:g,altBoundary:p}),A=Ni(t.placement),N=Pd(t.placement),R=!N,F=E1(A),H=j9(F),P=t.modifiersData.popperOffsets,L=t.rects.reference,z=t.rects.popper,U=typeof T=="function"?T(Object.assign({},t.rects,{placement:t.placement})):T,W=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,ae={x:0,y:0};if(P){if(o){var ce,fe=F==="y"?wa:ba,ie=F==="y"?uo:fo,ge=F==="y"?"height":"width",Te=P[F],se=Te+E[fe],we=Te-E[ie],Z=D?-z[ge]/2:0,$=N===Ad?L[ge]:z[ge],X=N===Ad?-z[ge]:-L[ge],ve=t.elements.arrow,De=D&&ve?T1(ve):{width:0,height:0},be=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:$T(),ke=be[fe],Be=be[ie],_e=Gh(0,L[ge],De[ge]),it=R?L[ge]/2-Z-_e-ke-W.mainAxis:$-_e-ke-W.mainAxis,Vt=R?-L[ge]/2+Z+_e+Be+W.mainAxis:X+_e+Be+W.mainAxis,Se=t.elements.arrow&&Am(t.elements.arrow),Ue=Se?F==="y"?Se.clientTop||0:Se.clientLeft||0:0,Je=(ce=K==null?void 0:K[F])!=null?ce:0,$e=Te+it-Je-Ue,lt=Te+Vt-Je,ft=Gh(D?uv(se,$e):se,Te,D?Mc(we,lt):we);P[F]=ft,ae[F]=ft-Te}if(u){var Dt,Et=F==="x"?wa:ba,$t=F==="x"?uo:fo,rn=P[H],At=H==="y"?"height":"width",an=rn+E[Et],Sn=rn-E[$t],In=[wa,ba].indexOf(A)!==-1,vr=(Dt=K==null?void 0:K[H])!=null?Dt:0,Sa=In?an:rn-L[At]-z[At]-vr+W.altAxis,Mr=In?rn+L[At]+z[At]-vr-W.altAxis:Sn,Nr=D&&In?h9(Sa,rn,Mr):Gh(D?Sa:an,rn,D?Mr:Sn);P[H]=Nr,ae[H]=Nr-rn}t.modifiersData[r]=ae}}const oE={name:"preventOverflow",enabled:!0,phase:"main",fn:L9,requiresIfExists:["offset"]};function R9(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function _9(e){return e===za(e)||!co(e)?x1(e):R9(e)}function H9(e){var t=e.getBoundingClientRect(),n=Od(t.width)/e.offsetWidth||1,r=Od(t.height)/e.offsetHeight||1;return n!==1||r!==1}function B9(e,t,n){n===void 0&&(n=!1);var r=co(t),a=co(t)&&H9(t),o=Tl(t),s=Fd(e,a,n),u={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!n)&&((ki(t)!=="body"||M1(o))&&(u=_9(t)),co(t)?(d=Fd(t,!0),d.x+=t.clientLeft,d.y+=t.clientTop):o&&(d.x=C1(o))),{x:s.left+u.scrollLeft-d.x,y:s.top+u.scrollTop-d.y,width:s.width,height:s.height}}function Y9(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function a(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(u){if(!n.has(u)){var d=t.get(u);d&&a(d)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||a(o)}),r}function z9(e){var t=Y9(e);return s9.reduce(function(n,r){return n.concat(t.filter(function(a){return a.phase===r}))},[])}function U9(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function V9(e){var t=e.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var _D={placement:"bottom",modifiers:[],strategy:"absolute"};function HD(){for(var e=arguments.length,t=new Array(e),n=0;n({placement:e,modifiers:[{name:"flip",options:{allowedAutoPlacements:t,rootBoundary:"document"}},{name:"preventOverflow",options:{rootBoundary:"document"}}]}),r5=e=>{const n=O.useRef(null),[r,a]=O.useState(null),[o,s]=O.useState(0);let u,d;const m=()=>{if(x.Platform.isMobile){u="right-end",d=["bottom"];return}const g=window.innerWidth-o>280*1.2,w=window.innerWidth-o<280,D=window.innerWidth>280*1.5;if(e.DefaultEditorLocation!=="Bottom"){g?(u="right-end",d=["left-end"]):w&&D?(u="left-end",d=["right-end"]):(u="bottom",d=["bottom"]);return}g?(u="top-end",d=["top-start"]):w&&o>280?(u="top-start",d=["top-end"]):(u="top",d=["top"])};O.useEffect(()=>{e&&m()},[o,e==null?void 0:e.DefaultEditorLocation]);const p=zv(n.current,r,n5(u,d));return{setPosX:s,popperRef:n,setPopperElement:a,popper:p}},a5=()=>{const e=new Set,t=We.getState().query.filter,n=We.getState().query.tag,r=tn.getQueryById(t||"");if(r&&r.querystring){const a=JSON.parse(r.querystring);if(Array.isArray(a))for(const o of a)o.type==="TAG"&&o.value&&o.value.operator==="CONTAIN"&&e.add(o.value.value)}return n&&e.add(n),Array.from(e)},o5=e=>{const{offsetLeft:t,offsetTop:n,offsetHeight:r,offsetWidth:a,selectionEnd:o}=e,s=document.createElement("div"),u=window.getComputedStyle(e);for(const T of u)s.style.setProperty(T,u.getPropertyValue(T));s.style.position="fixed",s.style.visibility="hidden",s.style.whiteSpace="pre-wrap";const m=e.tagName==="INPUT"?e.value.replace(/ /g,"."):e.value;s.textContent=m.substring(0,o||0),e.tagName==="TEXTAREA"&&(s.style.height="auto");const p=document.createElement("span");p.textContent=m.substring(o||0)||".",s.appendChild(p),document.body.appendChild(s);const{offsetLeft:g,offsetTop:w,offsetHeight:D,offsetWidth:S}=p;return document.body.removeChild(s),{x:t+g,y:n+w,h:r+D,w:a+S}},Cd=({className:e,editorType:t,destroy:n})=>{const{globalState:r,dailyNotesState:{app:a,settings:o,view:s,verifyState:u}}=O.useContext(wt),[d,m]=_o(!0),p=O.useRef(d),[g,w]=Br(!0),D=O.useRef(null),S=O.useRef(null),T=O.useRef(r),[E,A]=Br(!1),[N,R]=Br(!1),{setPosX:F,popperRef:H,setPopperElement:P,popper:L}=r5(o),[z]=Br(parseInt(x.moment().format("x"))),U=O.useRef(null),[W,K]=Br((o==null?void 0:o.EnabledLocationList.length)===1?o==null?void 0:o.EnabledLocationList[0].value:(o==null?void 0:o.MemoSaveLocation)||"DAILY"),ae=O.useRef(o.MemoSaveLocation||"DAILY");O.useEffect(()=>{p.current=d},[d]),O.useEffect(()=>{!S.current||!a||!s||(s.registerEvent(a.workspace.on("focus-on-textarea",Se=>{var Ue;(Ue=S.current)==null||Ue.focus(Se==null?void 0:Se.id)})),s.registerEvent(a.workspace.on("blur-on-memos",()=>{var Se;(Se=S.current)==null||Se.blur()})),s.registerEvent(a.workspace.on("send-to-thino",async(Se,Ue)=>{var Je,$e;if(typeof Se=="string")(Je=S.current)==null||Je.insertText(Se+` `,Ue.id);else{const lt=Se.toPNG(),ft=new Blob([lt],{type:"image/png"}),Dt=new File([ft],"image.png",{type:"image/png",lastModified:Date.now()});if(!Dt)return;const Et=await se(Dt);Et&&(($e=S.current)==null||$e.insertText(Et+` `,Ue.id))}})))},[S,s,a]),O.useEffect(()=>{o&&m(o.DefaultPrefix==="List")},[o==null?void 0:o.DefaultPrefix]),O.useEffect(()=>{if(o){if(o.EnabledLocationList.length===1){K(o.EnabledLocationList[0].value);return}K(o.MemoSaveLocation||"DAILY")}},[o==null?void 0:o.MemoSaveLocation,o==null?void 0:o.EnabledLocationList]),O.useEffect(()=>{var Je;if(!o||!U.current)return;const Se=(Je=Md.find($e=>$e.title===W))==null?void 0:Je.icon;x.setIcon(U.current,Se),x.requireApiVersion("1.4.4")&&x.setTooltip(U.current,k("Thino Save To: ")+W),ae.current=W;const Ue=r.manifest;if(Ue){const $e=a==null?void 0:a.plugins.getPlugin(Ue.id);if($e){if($e.settings.MemoSaveLocation===W)return;$e.settings.MemoSaveLocation=W,$e.saveSettings()}}},[W,g]),O.useEffect(()=>{S.current&&o.MemoSaveLocation&&K(o.MemoSaveLocation)},[U,o]),O.useEffect(()=>{if(!S.current||!o||x.Platform.isDesktop||r.globalEditorShown)return;const Se=x.Platform.isMobile===!0,Ue=o.UseButtonToShowEditor&&o.DefaultEditorLocation==="Bottom";if(x.Platform.isDesktop){w(!0);return}if(w(Se&&!Ue),t&&t==="inline")return;const Je=document.body.find(".memolist-wrapper");Je&&(Je.onscroll=()=>{if(r.globalEditorShown)return;const $e=S.current.getContent();Se&&Ue&&!$e&&w(!1)})},[r.globalEditorShown,S,o==null?void 0:o.UseButtonToShowEditor,o==null?void 0:o.DefaultEditorLocation]);const ce=()=>{R(!1)};O.useEffect(()=>{var Se,Ue,Je,$e,lt,ft,Dt,Et;if(r.markMemoId){const $t=`${k("MARK")}: [@THINO](${r.markMemoId})`;(Se=S.current)==null||Se.insertText($t),(Ue=S.current)==null||Ue.focus(),Qe.setMarkMemoId("");return}if((Je=r.editMemoId)!=null&&Je.trim()&&r.editMemoId!==T.current.editMemoId){const $t=Ie.getMemoById(r.editMemoId);if($t)switch(o.EditorType){case"memos":($e=S.current)==null||$e.setContent($t.content.replace(/ \^\S{6}$/,"")||""),(lt=S.current)==null||lt.focus();break;case"obsidian":(ft=S.current)==null||ft.clear(),(Dt=S.current)==null||Dt.setContent($t.content.replace(/ \^\S{6}$/,"")||""),(Et=S.current)==null||Et.focus();break}}T.current=r},[r.markMemoId,r.editMemoId]),O.useEffect(()=>{var Se,Ue,Je;!S.current||E||o.EditorType==="memos"&&((Se=S.current)==null||Se.element.addEventListener("paste",fe),(Ue=S.current)==null||Ue.element.addEventListener("drop",ie),(Je=S.current)==null||Je.element.addEventListener("click",ge),A(!0))},[S.current]);const fe=async Se=>{var Ue;if(Se.clipboardData&&Se.clipboardData.files.length>0){Se.preventDefault();const Je=Se.clipboardData.files;for(const $e of Je){const lt=await se($e);lt&&((Ue=S.current)==null||Ue.insertText(lt))}}},ie=async Se=>{var Ue;if(Se.dataTransfer&&Se.dataTransfer.files.length>0){Se.preventDefault();const Je=Se.dataTransfer.files;for(const $e of Je){const lt=await se($e);lt&&((Ue=S.current)==null||Ue.insertText(lt))}}},ge=()=>{var Se;$(((Se=S.current)==null?void 0:Se.element.value)||"")},Te=async(Se,Ue)=>{var lt,ft,Dt;const Je=Se.ctrlKey||Se.metaKey,$e=Se.altKey;if(Se.key==="Escape"&&r.globalEditorShown&&(Qe.setGlobalEditorShown(!1),Se.preventDefault()),Je&&Se.key==="Enter"){Se.preventDefault(),Se.stopPropagation(),Ue?(await we((ft=S.current)==null?void 0:ft.getContent()),(Dt=S.current)==null||Dt.clear()):await we((lt=S.current)==null?void 0:lt.element.value);return}if($e)for(let Et=0;Et{var Et;Ue||$(((Et=S.current)==null?void 0:Et.element.value)||"")})},se=O.useCallback(async Se=>{const{type:Ue}=Se;if(Ue.startsWith("image"))try{return`${await y1.upload(Se)}`}catch(Je){new x.Notice(Je)}},[]),we=async Se=>{if(!Se||Se.trim()===""){new x.Notice(k("Content cannot be empty"));return}const Ue=rt.getState().settings,Je=Ue==null?void 0:Ue.addTagAutomatically,$e=Ue==null?void 0:Ue.addTagWithNewline,lt=Ue==null?void 0:Ue.addTagPosition,Dt=(a5()||[]).filter(At=>!Se.includes(`#${At}`)),Et=async(At,an)=>{an=an.replaceAll(" "," "),Mg("");try{if(!At){let In;switch(ae.current){case"CANVAS":In=await Ie.createMemoCanvas({text:an,isList:p.current});break;case"MULTI":In=await Ie.createMemoMultiFile({content:an,isList:p.current});break;case"DAILY":In=await Ie.createMemoDaily(an,p.current);break;case"FILE":In=await Ie.createMemoSingleFile({content:an,isList:p.current});break}if(!In)return;Ie.pushMemo(In),(!Je||Dt.length===0)&&We.clearQuery();const vr=a||rt.getState().app,Sa=vr==null?void 0:vr.loadLocalStorage("tokenForSync");In&&Sa&&o.startSync&&setTimeout(async()=>{const Mr=await kT({content:an,thinoType:ae.current==="DAILY"?"DAILY":"FILE"});await Ie.updateMemoById(In.id,Mr,!0)},200);return}const Sn=Ie.getMemoById(At);if(Sn&&Sn.content!==an){const In=await Ie.updateMemo(Sn.id,an,p.current?"JOURNAL":"TASK-TODO");In.updatedAt=Re.getDateTimeString(Date.now()),Ie.editMemo(In)}Qe.setEditMemoId("")}catch(Sn){new x.Notice(Sn.message)}},{editMemoId:$t}=Qe.getState(),rn=Dt&&Dt.length>0&&Je?lt==="Beginning"?`${Dt.map(At=>`#${At}`).join(" ")} ${$e?` `:""}${Se}`:`${Se} ${$e?` `:""}${Dt.map(At=>`#${At}`).join(" ")}`:Se;await Et($t,rn),n&&n(),Mg("")},Z=O.useCallback(()=>{var Se;Qe.setEditMemoId(""),(Se=S.current)==null||Se.setContent(""),Mg("")},[]),$=O.useCallback(Se=>{if(Mg(Se??""),!S.current)return;const Ue=S.current.getContent(),Je=S.current.element.selectionStart,$e=Ue.slice(0,Je),lt=Ue.slice(Je);($e.endsWith("@")||$e.endsWith("📆"))&<.startsWith(" ")||($e.endsWith("@")||$e.endsWith("📆"))&<===""?(Be(),R(!0)):R(!1),setTimeout(()=>{var ft;(ft=S.current)==null||ft.focus()})},[o.EditorType]),X=Se=>{if(!S.current||!o)return;Se&&(ce(),m(!1));const Ue=S.current.getContent(),Je=S.current.element.selectionStart,$e=Ue.slice(0,Je),lt=Ue.slice(Je),ft=x.moment(Se);if($e.endsWith("@"))switch(o.InsertDateFormat){case"Dataview":S.current.element.value=Ue.slice(0,S.current.element.selectionStart-1)+"[due::"+ft.format("YYYY-MM-DD")+"]"+lt,S.current.element.setSelectionRange(Je+17,Je+17),S.current.focus(),$(S.current.element.value);break;case"Tasks":S.current.element.value=Ue.slice(0,S.current.element.selectionStart-1)+"📆"+ft.format("YYYY-MM-DD")+lt,S.current.element.setSelectionRange(Je+11,Je+11),S.current.focus(),$(S.current.element.value)}else{S.current.element.value=$e+ft.format("YYYY-MM-DD")+lt,S.current.element.setSelectionRange(Je+10,Je+10),S.current.focus(),$(S.current.element.value);return}},ve=()=>{S.current&&m()},De=async()=>{var Je;const Se=!x.Platform.isDesktop&&await((Je=window.Capacitor)==null?void 0:Je.Plugins.Device.getId()),Ue=x.Platform.isDesktop?await zn():Se.identifier||Se.uuid;return!u||(u==null?void 0:u.appId)!==Ue?(fn(),!1):!0},be=async Se=>{if(!await De())return;const Ue=new x.Menu;o.EnabledLocationList.forEach(ft=>{Ue.addItem(Dt=>{var Et;Dt.setTitle(ft.value).setIcon(((Et=Md.find($t=>$t.title===ft.value))==null?void 0:Et.icon)??"file").setChecked(W===ft.value).onClick(()=>{K(ft.value)})})});let Je=Se.target,$e=null;for(;!Je.hasClass("location-wrapper")&&($e=Je.parentElement,$e);)Je=$e;const lt=Je.getBoundingClientRect();setTimeout(()=>{Ue.showAtPosition({x:lt.x,y:lt.bottom,width:lt.width,left:!1,overlap:!0})},200)},ke=O.useCallback(()=>{var Se,Ue;if(!(!S.current&&o.EditorType==="memos"))switch(o.EditorType){case"obsidian":(Se=S.current)==null||Se.focus(),(Ue=a==null?void 0:a.commands)==null||Ue.executeCommandById("editor:insert-tag");break;case"memos":{const Je=S.current.getContent(),$e=S.current.element.selectionStart,lt=Je.slice(0,$e),ft=Je.slice($e);let Dt=lt+"# "+ft,Et=lt.length+1;lt.endsWith("#")&&ft.startsWith(" ")&&(Dt=lt.slice(0,lt.length-1)+ft.slice(1),Et=lt.length-1),S.current.element.value=Dt,S.current.element.setSelectionRange(Et,Et),S.current.focus();const $t=new Event("input",{bubbles:!0,cancelable:!0});S.current.element.dispatchEvent($t),$(S.current.element.value)}}},[a]),Be=O.useCallback(()=>{if(!S.current||!H.current||!o||!a)return;const Je=a.workspace.getLeavesOfType(Hr)[0].view.containerEl,$e=280,lt=Je.clientWidth,{x:ft,y:Dt}=o5(S.current.element);let Et,$t;x.Platform.isMobile?(window.innerWidth-ft>$e?Et=(ft+$e+16>lt,ft+18):window.innerWidth-ft<$e?Et=(ft+$e+16>lt,ft+34):Et=S.current.element.clientWidth/2,o.DefaultEditorLocation==="Bottom"&&window.innerWidth>875?$t=Dt+4:o.DefaultEditorLocation==="Bottom"&&window.innerWidth<=875?$t=Dt+19:o.DefaultEditorLocation==="Top"&&window.innerWidth<=875&&($t=Dt+36)):(Et=(ft+$e+16>lt,ft+18),$t=Dt+34),F(ft),H.current.style.left=`${Et}px`,H.current.style.top=`${$t}px`},[o,a]),_e=O.useCallback(()=>{const Se=document.createElement("input");document.body.appendChild(Se),Se.type="file",Se.multiple=!1,Se.accept="image/png, image/gif, image/jpeg",Se.onchange=async()=>{var $e;if(!Se.files||Se.files.length===0)return;const Ue=Se.files[0],Je=await se(Ue);Je&&(($e=S.current)==null||$e.insertText(Je)),document.body.removeChild(Se)},Se.click()},[]),it=!!r.editMemoId,Vt=O.useMemo(()=>({className:"memo-editor",inputerType:o.EditorType||"obsidian",initialContent:i5(),placeholder:k("What do you think now..."),showConfirmBtn:!0,showCancelBtn:it,showTools:!0,onConfirmBtnClick:we,onCancelBtnClick:Z,onContentChange:$}),[it,o.EditorType]);return y.jsxs(y.Fragment,{children:[!r.globalEditorShown&&t==="block"&&y.jsx("div",{ref:Se=>{D.current=Se,Se&&x.setIcon&&x.setIcon(Se,"plus-circle")},className:`memo-show-editor-button ${g?"hidden":""}`,onClick:()=>{var Se;(Se=D.current.firstElementChild)==null||Se.toggleClass("rotate-hidden",!0),setTimeout(()=>{w(!0),D.current.firstElementChild.toggleClass("rotate-hidden",!1)},500),setTimeout(()=>{var Ue;(Ue=S.current)==null||Ue.focus()},600)}}),y.jsxs("div",{className:`memo-editor-wrapper ${e||""} ${it?"edit-ing":""} ${r.globalEditorShown?"fullscreen-editor":""} ${g?"":"hidden"}`,onKeyDownCapture:Se=>Te(Se,!0),children:[y.jsx("span",{className:`tip-text ${it?"":"hidden"}`,children:"Modifying..."}),y.jsx(W8,{ref:S,...Vt,tools:y.jsxs(y.Fragment,{children:[y.jsx("span",{ref:Se=>{Se&&x.setIcon(Se,"hash")},className:"btn action-btn add-tag",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&ke()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&ke()}}),y.jsx("span",{ref:Se=>{Se&&x.setIcon(Se,"paperclip")},className:"btn action-btn file-upload",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&_e()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&_e()}}),y.jsx("span",{ref:Se=>{Se&&x.setIcon(Se,d?"layout-list":"check-square")},className:mr("btn action-btn list-or-task",d?"list":"task"),onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&ve()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&ve()}}),y.jsx("div",{ref:Se=>{Se&&(x.setIcon&&x.setIcon(Se,r.globalEditorShown?"shrink":"expand"),x.setTooltip&&x.setTooltip(Se,r.globalEditorShown?k("Exit fullscreen mode"):k("Enter fullscreen mode")))},className:"action-btn show-editor pro",onPointerDown:async()=>{await De()&&(w(!0),Qe.setGlobalEditorShown(!r.globalEditorShown))}}),y.jsx("div",{className:"action-btn split-line pro"}),y.jsx("div",{className:"action-btn location-wrapper pro",onClick:async Se=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&await be(Se)},onPointerDown:async Se=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&await be(Se)},children:y.jsx("div",{ref:U,className:"action-btn file-location-btn"})})]})}),y.jsx("div",{ref:H,className:"date-picker",children:N&&y.jsx("div",{tabIndex:-1,style:L.styles.popper,...L.attributes.popper,ref:P,role:"dialog",children:y.jsx(Nm,{className:`editor-date-picker ${N?"":"hidden"}`,datestamp:z,handleDateStampChange:X})})})]})]})};function i5(){return Kn.get(["thinoEditorContentCache"]).thinoEditorContentCache??""}function Mg(e){Kn.set({thinoEditorContentCache:e})}const s5=e=>{const t=[];return e.map(n=>{t.length==0?t.push({date:x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]}):t.some(a=>{if(a.date==x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"))return a.have.push(n),!0})||t.push({date:x.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]})}),t},l5=e=>Ie.getState().commentMemos.filter(t=>t.linkId===e.hasId).sort((t,n)=>Re.getTimeStampByDate(t.createdAt)-Re.getTimeStampByDate(n.createdAt)).map(t=>({...t,createdAtStr:Re.getDateTimeString(t.createdAt),dateStr:Re.getDateString(t.createdAt)})),c5=e=>{const t=rt.getState().settings,n=hN(),r=t!=null&&t.ShowDate?" ":"",a="YYYY/MM/DD HH:mm:ss",o=/comment:(.*)$/g,s=/^\d{14}/g,u=(g,w,D)=>{const S=x.moment(g.createdAt,a).format("HH:mm");return D?D.replace(/{TIME}/g,S).replace(/{CONTENT}/g,w):`${S} ${w}`},d=g=>{const w=g.match(/TASK-(.*)?/g);return w?w[1]:""},m=g=>g==="TASK-TODO"?"- [ ] ":g==="TASK-DONE"?"- [x] ":g.match(/TASK-(.*)?/g)?`- [${d(g)}] `:"- ",p=g=>g.reduce((w,D)=>{const S=D.sourceType!=="MULTI"?`${D.content}`:`[[${D.path}]]`,T=t!=null&&t.ShowTime?u(D,S,t==null?void 0:t.DefaultMemoComposition):S,E=`${m(D.thinoType)}${T}`;let A="";return t.CommentOnMemos&&D.hasId!==void 0&&D.hasId!==""&&(A=l5(D).reduce((R,F)=>{const H=m(F.thinoType),P=F.content.replace(o,"").replace(s,""),L=t!=null&&t.ShowDate?`${H}[[${x.moment(F.createdAt).format(n)}]] ${x.moment(F.createdAt).format("HH:mm")} ${P}`:`${H}${P}`;return R+r+" "+L+` `},"")),w+r+E.replace(/ \^\S{6}/g,"")+` `+A},"");return e.reduce((g,w)=>{const D=t!=null&&t.ShowDate?`- [[${x.moment(w.date,"YYYY-MM-DD").format(n)}]] `:"",S=p(w.have),T=t!=null&&t.ShowDate&&(t!=null&&t.AddBlankLineWhenDate)&&!(t!=null&&t.CommentOnMemos)?` `:"";return g+D+S+T},"").replace(/
/g,` `)},u5=[{label:k("Today"),value:x.moment().format("YYYY-MM-DD")},{label:k("Yesterday"),value:x.moment().subtract(1,"days").format("YYYY-MM-DD")},{label:k("Last 7 days"),value:x.moment().subtract(7,"days").format("YYYY-MM-DD")},{label:k("Last 30 days"),value:x.moment().subtract(30,"days").format("YYYY-MM-DD")},{label:k("Last 90 days"),value:x.moment().subtract(90,"days").format("YYYY-MM-DD")},{label:k("Last 180 days"),value:x.moment().subtract(180,"days").format("YYYY-MM-DD")},{label:k("Last 365 days"),value:x.moment().subtract(365,"days").format("YYYY-MM-DD")}],lE=e=>{const{handleValueChange:t,setShownStatus:n}=e;return y.jsxs(y.Fragment,{children:[e.type==="icon"&&y.jsx("div",{className:"quick-date-btn-group",children:u5.map((r,a)=>y.jsx("div",{className:"btn action-btn quick-date-btn",onClick:()=>{t(r.value),n&&n(!1)},children:r.label},a))}),y.jsx(Nm,{className:"calendar-date-picker",datestamp:(e==null?void 0:e.defaultValue)||x.moment().startOf("day").valueOf(),handleDateStampChange:(r,a)=>{t(e.type==="icon"?x.moment(r).format("YYYY-MM-DD"):r.toString()),n&&n(!1)}})]})},dv=e=>{const{handleValueChange:t}=e,[n,r]=q.useState(!1),a=q.useRef(null),o=q.useRef(null),s=zv(o.current,a.current,{placement:"bottom-start"});return Mm(a,()=>{r(!1)}),y.jsxs(y.Fragment,{children:[y.jsx("span",{ref:d=>{o.current=d,d&&e.type==="icon"&&x.setIcon(d,"calendar")},className:`btn calendar-btn ${e.type==="icon"?"icon-btn":"text-btn"}`,onClick:()=>{!x.Platform.isMobile&&r(!n),!x.Platform.isMobile&&(s!=null&&s.update)&&(s==null||s.update()),x.Platform.isMobile&&new cE(rt.getState().app,e.type,t).open()},children:e.type==="text"&&e.defaultValue?e.defaultText?e.defaultText:x.moment(e.defaultValue,"x").subtract(e.startOrEnd==="end"?1:0,"days").format("YYYY/MM/DD"):""}),y.jsx("div",{className:`menu-btns-popup ${n?"":"hidden"}`,ref:a,style:s.styles.popper,children:y.jsx(lE,{type:e.defaultText?"icon":e.type,handleValueChange:t,setShownStatus:r})})]})};class cE extends x.Modal{constructor(n,r,a){super(n);he(this,"root");he(this,"type");he(this,"handleValueChange");this.type=r,this.handleValueChange=a}onOpen(){const{contentEl:n}=this;this.root=Lv(n),this.root.render(y.jsx(lE,{type:this.type,handleValueChange:this.handleValueChange.bind(this),setShownStatus:r=>{!r&&this.close()}}))}onClose(){var n;(n=this.root)==null||n.unmount()}}const d5=(e,t)=>(e%t+t)%t;class f5{constructor(t,n,r){he(this,"owner");he(this,"values");he(this,"suggestions");he(this,"selectedItem");he(this,"containerEl");this.owner=t,this.containerEl=n,n.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),n.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),r.register([],"ArrowUp",a=>{if(!a.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",a=>{if(!a.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",a=>{if(!a.isComposing)return this.useSelectedItem(a),!1})}onSuggestionClick(t,n){t.preventDefault();const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1),this.useSelectedItem(t)}onSuggestionMouseover(t,n){const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1)}setSuggestions(t){this.containerEl.empty();const n=[];t.forEach(r=>{const a=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,a),n.push(a)}),this.values=t,this.suggestions=n,this.setSelectedItem(0,!1)}useSelectedItem(t){const n=this.values[this.selectedItem];n&&this.owner.selectSuggestion(n,t)}setSelectedItem(t,n){const r=d5(t,this.suggestions.length),a=this.suggestions[this.selectedItem],o=this.suggestions[r];a==null||a.removeClass("is-selected"),o==null||o.addClass("is-selected"),this.selectedItem=r,n&&o.scrollIntoView(!1)}}class uE{constructor(t,n){he(this,"inputEl");he(this,"popper");he(this,"scope");he(this,"suggestEl");he(this,"suggest");he(this,"cb");this.inputEl=t,this.scope=new x.Scope,this.cb=n,this.suggestEl=createDiv("suggestion-container");const r=this.suggestEl.createDiv("suggestion");this.suggest=new f5(this,r,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("click",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",a=>{a.preventDefault()})}clearInput(){this.inputEl.value="",this.inputEl.trigger("blur"),this.inputEl.trigger("focus"),this.inputEl.trigger("input"),this.onInputChanged()}onInputChanged(){const t=this.inputEl.value,n=this.getSuggestions(t);if(!n){this.close();return}n.length>0?(this.suggest.setSuggestions(n),this.open(app.dom.appContainerEl,this.inputEl)):this.close()}open(t,n){app.keymap.pushScope(this.scope),t.appendChild(this.suggestEl),this.popper=sE(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:a})=>{const o=`${r.rects.reference.width}px`;r.styles.popper.width!==o&&(r.styles.popper.width=o,a.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}destroy(){this.inputEl.removeEventListener("input",this.onInputChanged.bind(this)),this.inputEl.removeEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.removeEventListener("blur",this.close.bind(this)),this.close()}updateCb(t){this.cb=t}}const h5=e=>{const t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())};let dE=class extends uE{fuzzySearchItemsOptimized(t,n){const r=x.prepareFuzzySearch(t);return n.map(a=>{const o=r(a);return o?{item:a,match:o,score:o.score}:null}).sort((a,o)=>(o==null?void 0:o.score)-(a==null?void 0:a.score)).filter(Boolean)}getSuggestions(t){const{settings:n,app:r}=rt.getState(),a=t.toLocaleLowerCase(),o=n.UseVaultTags?h5(r):Ie.getState().tags;return this.fuzzySearchItemsOptimized(a,o).map(s=>s.item)}renderSuggestion(t,n){n.toggleClass("thino-image-suggest-item",!0),n.createSpan({cls:"suggestion-name",text:t})}selectSuggestion(t){this.inputEl.value=t,this.inputEl.dispatchEvent(new Event("change")),this.cb&&this.cb(t),this.close()}};const m5=e=>{const t=new Set;return e.forEach(n=>{const r=new RegExp(An).exec(n.content),a=new RegExp($n).exec(n.content);if(r)for(let o=1;o{const[r,a]=q.useState([]),[o,s]=q.useState([]),[u,d]=q.useState([]),m=q.useRef(null),p=q.useRef(null),g=q.useRef(null),w=q.useRef("End"),D=q.useRef(!1),S=q.useRef(null);O.useEffect(()=>{t&&t.length&&a(m5(t))},[t]),O.useEffect(()=>{!g.current||!p.current||(new x.Setting(p.current).setName(k("Add tag position")).addDropdown(N=>{N.addOption("End",k("End")),N.addOption("Beginning",k("Beginning")),N.setValue("End").onChange(async R=>{w.current=R})}),new x.Setting(g.current).setName(k("Add tag with new line")).addToggle(N=>{N.setValue(!1).onChange(async R=>{D.current=R})}))},[]);const T=N=>{if(!N)return;const R=new Set(o);R.add(N),s(Array.from(R)),m.current.clearInput()};O.useEffect(()=>{if(S.current){if(m.current){m.current.updateCb(T);return}m.current=new dE(S.current,T)}},[S.current,o]);const E=()=>{n(),A({remove:u,add:o,targetThinos:t})},A=async({remove:N,add:R,targetThinos:F})=>{const H=D.current||!1,P=[];for(const L of F){let z=L.content;for(const U of N)z=z.replace(new RegExp(`#${U}`,"g"),"");if(z=z.trim(),R.length>0&&(z=w.current==="Beginning"?`${R.map(U=>`#${U}`).join(" ")} ${H?` `:""}${z}`:`${z} ${H?` `:""}${R.map(U=>`#${U}`).join(" ")}`),L&&L.content!==z){const U=await Ie.updateMemo(L.id,z==null?void 0:z.trim());P.push(U)}}P.length>0&&Ie.editMemoBulk(P),P.length>0&&We.clearQuery()};return y.jsxs("div",{className:"thino-tag-operation",children:[y.jsx("div",{className:"tag-operation-title",children:k("Tag Bulk Edit")}),y.jsxs("div",{className:"tag-operation-content",children:[y.jsxs("div",{className:"tag-operation-content-title exist-tags",children:[y.jsx("div",{className:"name",children:k("Exist Tags")}),y.jsx("div",{className:"desc",children:k("Click to remove exist tag")})]}),y.jsx("div",{className:"tag-operation-content-tags exist-tags",children:r.map(N=>y.jsx("div",{className:mr("tag-operation-content-tag",u.includes(N)&&"tag-operation-content-tag-removed"),onClick:()=>{u.includes(N)||d([...u,N]),u.includes(N)&&d(u.filter(R=>R!==N)),o.includes(N)&&s(o.filter(R=>R!==N))},children:N},N))}),y.jsxs("div",{className:"tag-operation-content-title selected-tags",children:[y.jsx("div",{className:"name",children:k("Selected Tags")}),y.jsx("div",{className:"desc",children:k("Click to remove selected tag")})]}),y.jsx("div",{className:"tag-operation-content-tags selected-tags",children:o.map(N=>y.jsx("div",{className:"tag-operation-content-tag",onClick:()=>{s(o.filter(R=>R!==N))},children:N},N))}),y.jsx("div",{className:"tag-operation-content-inputer",children:y.jsx("input",{placeholder:k("Input to select exist tag"),ref:S})}),y.jsxs("div",{className:"tag-operation-settings",children:[y.jsx("div",{ref:p}),y.jsx("div",{ref:g})]}),y.jsxs("div",{className:"tag-operation-content-btn-group",children:[y.jsx("button",{className:"cancel-btn",onClick:n,children:k("Cancel")}),y.jsx("button",{className:"save-btn",onClick:E,children:k("Save")})]})]})]})},vd=async()=>{var r;const{verifyState:e}=rt.getState(),t=!x.Platform.isDesktop&&await((r=window.Capacitor)==null?void 0:r.Plugins.Device.getId()),n=x.Platform.isDesktop?await zn():t.identifier||t.uuid;return e&&(e==null?void 0:e.appId)===n};class yd extends x.Modal{constructor(t,n,r){super(t),this.title=n,this.cb=r}onOpen(){super.onOpen(),this.containerEl.toggleClass("thino-bulk-action-dialog",!0),this.titleEl.setText(this.title+k("Confirm?")),this.contentEl.createEl("button",{text:k("Confirm?").replace(/\?|?/,"")}).onclick=()=>{this.cb("confirm"),this.close()},this.contentEl.createEl("button",{text:k("Cancel")}).onclick=()=>{this.cb("cancel"),this.close()}}onClose(){super.onClose()}}class g5 extends x.Modal{constructor(n,r){super(n);he(this,"root");this.thinos=r}onOpen(){super.onOpen(),this.containerEl.toggleClass(["thino-bulk-action-dialog","tag-actions"],!0),this.root=hs.createRoot(this.contentEl),this.root.render(y.jsx(Sl,{store:Ee,context:wt,children:y.jsx(p5,{app:this.app,closeDialog:this.close.bind(this),thinos:this.thinos})}))}onClose(){var n;super.onClose(),(n=this.root)==null||n.unmount()}}const Om=({thinosCount:e,thinos:t})=>{const{locationState:{query:n,pathname:r},dailyNotesState:{settings:a,app:o}}=O.useContext(wt),{tag:s,duration:u,type:d,text:m,filter:p}=n,g=tn.getQueryById(p),w=!!(s||u&&u.from{D&&x.setIcon(D.current,"more-horizontal")},[D]);const S=async()=>{if(!((t==null?void 0:t.length)>0))return;const P=s5(t),L=c5(P);await Re.copyTextToClipboard(L),new x.Notice(k("Copied to clipboard Successfully"))},T=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await vd()){fn();return}const P=[...t],L=a.DeleteThinoDirectly;try{for(const z of P)if(L)await Ie.deleteMemoById(z.id);else{const U=await Ie.hideMemoById(z.id);U&&Ie.editMemo(U)}We.clearQuery()}catch(z){console.error("error",z),new x.Notice(z.message)}},E=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await vd()){fn();return}const P=[...t];try{for(const L of P)await Ie.deleteMemoById(L.id);We.clearQuery(),new x.Notice(k("DELETE SUCCEED"))}catch(L){console.error("error",L),new x.Notice(L.message)}},A=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await vd()){fn();return}const P=[...t];try{const L=await Ie.unarchiveThinoBulk(P);for(const z of L)z&&Ie.editMemo(z);new x.Notice(k("RESTORE SUCCEED")),We.clearQuery()}catch(L){console.error("error",L),new x.Notice(L.message)}},N=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await vd()){fn();return}const P=[...t],L=rt.getState().settings.startSync;try{for(const z of P){const U=await Ie.restoreMemoById(z.id),W=rt.getState().app,K=W==null?void 0:W.loadLocalStorage("tokenForSync");U&&U.webId&&K&&L&&await AT(U.webId),U&&Ie.editMemo(U)}We.clearQuery(),new x.Notice(k("RESTORE SUCCEED"))}catch(z){new x.Notice(z.message)}},R=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await vd()){fn();return}const P=[...t];try{const L=await Ie.archiveThinoBulk(P);for(const z of L)z&&Ie.editMemo(z);We.clearQuery()}catch(L){console.error("error",L),new x.Notice(L.message)}},F=async()=>{if((t==null?void 0:t.length)>0){if(!await vd()){fn();return}new g5(o,t).open()}},H=P=>{const L=new x.Menu;switch(L.addItem(z=>{z.setTitle(k("Copy filtered thinos")).setIcon("copy").onClick(async()=>{await S()})}),L.addSeparator(),r){case"/":L.addItem(z=>{z.setTitle(k("Bulk tag operation")).setIcon("hash").onClick(async()=>{await F()})}).addItem(z=>{z.setTitle(k("Bulk archive")).setIcon("archive").onClick(async()=>{new yd(o,k("ARCHIVE"),async U=>{U==="confirm"&&await R()}).open()})}).addItem(z=>{z.setTitle(k("Bulk delete")).setIcon("trash").onClick(async()=>{new yd(o,k("DELETE"),async U=>{U==="confirm"&&await T()}).open()})});break;case"/archive":L.addItem(z=>{z.setTitle(k("Bulk restore")).setIcon("archive").onClick(async()=>{new yd(o,k("RESTORE"),async U=>{U==="confirm"&&await A()}).open()})}).addItem(z=>{z.setTitle(k("Bulk delete")).setIcon("trash").onClick(async()=>{new yd(o,k("DELETE"),async U=>{U==="confirm"&&await T()}).open()})});break;case"/recycle":L.addItem(z=>{z.setTitle(k("Bulk restore")).setIcon("archive-restore").onClick(async()=>{new yd(o,k("RESTORE"),async U=>{U==="confirm"&&await N()}).open()})}).addItem(z=>{z.setTitle(k("Bulk delete")).setIcon("trash").onClick(async()=>{new yd(o,k("DELETE"),async U=>{U==="confirm"&&await E()}).open()})});break}L.showAtMouseEvent(P.nativeEvent)};return y.jsxs("div",{className:`filter-query-container ${w?"":"hidden"}`,children:[y.jsxs("div",{className:"filter-query",children:[y.jsx("span",{className:"tip-text",children:k("FILTER")}),y.jsxs("div",{className:"filter-item-container "+(g?"":"hidden"),onClick:()=>{We.setMemoFilter("")},children:[y.jsx("span",{className:"icon-text",children:"🔖"})," ",g==null?void 0:g.title]}),y.jsxs("div",{className:"filter-item-container "+(s?"":"hidden"),onClick:()=>{We.setTagQuery("")},children:[y.jsx("span",{className:"icon-text",children:"🏷️"})," ",s]}),y.jsxs("div",{className:"filter-item-container "+(d?"":"hidden"),onClick:()=>{We.setMemoTypeQuery("")},children:[y.jsx("span",{className:"icon-text",children:"📦"})," ",n8(d)]}),u&&u.from{const L=x.moment(u.to,"x"),z=x.moment(P,"x"),U=z.isAfter(L)||z.isSame(L);We.setFromAndToQuery(U?L.startOf("day").valueOf():x.moment(P,"x").startOf("day").valueOf(),u.to)}}),y.jsx("span",{children:k("to")}),y.jsx(dv,{type:"text",startOrEnd:"end",defaultValue:x.moment(u.to,"x").add(1,"days").valueOf(),handleValueChange:P=>{const L=x.moment(u.from,"x"),z=x.moment(P,"x"),U=z.isBefore(L)||z.isSame(L),W=x.moment(P,"x").endOf("day").valueOf();We.setFromAndToQuery(u.from,U?L.endOf("day").valueOf():W)}})]}),y.jsx("div",{ref:P=>P&&x.setIcon(P,"x"),className:"btn close-btn",onClick:()=>{We.setFromAndToQuery(0,0)}})]}),y.jsxs("div",{className:"filter-item-container "+(m?"":"hidden"),onClick:()=>{We.setTextQuery("")},children:[y.jsx("span",{className:"icon-text",children:"🔍"})," ",m]})]}),y.jsxs("div",{className:"thino-filter-items",children:[e&&y.jsx("div",{className:"thinos-count",children:`${e?`${e} Thinos `:""}`}),y.jsx("div",{ref:D,className:"btn memo-action-menu",onClick:H})]})]})},v5=e=>{const{dailyNotesState:{app:t,view:n}}=O.useContext(wt),{memo:r,handleMemoContentClick:a,handleMemoDoubleClick:o}=e,s=q.useRef(null),[u,d]=q.useState("");return O.useEffect(()=>{if(!s.current||s.current.hasChildNodes()&&r.content===u||!n||!t)return;d(r.content),s.current.hasChildNodes()&&s.current.empty(),(async()=>{var g,w;await x.MarkdownRenderer.render(t,r.content+` `,s.current,r.path,n),(g=s.current)==null||g.toggleClass(["markdown-rendered"],!0);const p=(w=s.current)==null?void 0:w.querySelectorAll(".internal-link");p==null||p.forEach(D=>{const S=D,T=S.getAttribute("data-href");if(!T)return;t.metadataCache.getFirstLinkpathDest(T,r.path)||D.classList.add("is-unresolved"),S.addEventListener("mouseover",A=>{A.stopPropagation(),t.workspace.trigger("hover-link",{event:A,source:"thino",hoverParent:n.containerEl,targetEl:S,linktext:T,sourcePath:S.href})})})})()},[r.content,n,t]),y.jsx("div",{ref:s,className:"memo-content-text",onClick:m=>a(m,r),onDoubleClick:o,onContextMenu:m=>{m.preventDefault()}})},fE=O.memo(v5),y5=e=>{const[t,n]=O.useState({...e.memo,createdAtStr:Re.getDateTimeString(e.memo.createdAt)}),[r,a]=O.useState([]),[o,s]=O.useState([]);O.useEffect(()=>{(async()=>{try{const g=[],w=[...t.content.matchAll(Il)];for(const S of w)if(S&&S.length===3){const T=S[2],E=Ie.getMemoById(T);E&&g.push({...E,createdAtStr:Re.getDateTimeString(E.createdAt),dateStr:Re.getDateString(E.createdAt)})}a([...g]);const D=await Ie.getLinkedMemos(t.id);s(D.sort((S,T)=>Re.getTimeStampByDate(T.createdAt)-Re.getTimeStampByDate(S.createdAt)).map(S=>({...S,createdAtStr:Re.getDateTimeString(S.createdAt),dateStr:Re.getDateString(S.createdAt)})))}catch(g){console.error(g)}})()},[t.id]);const u=O.useCallback(async p=>{var w;const g=p.target;if(g.className==="memo-link-text"){const D=(w=g.dataset)==null?void 0:w.value,S=Ie.getMemoById(D??"");if(S){const T={...S,createdAtStr:Re.getDateTimeString(S.createdAt)};a([]),s([]),n(T)}else new x.Notice(k("Thino not found")),g.classList.remove("memo-link-text")}},[]),d=O.useCallback(p=>{a([]),s([]),n({...p,createdAtStr:Re.getDateTimeString(p.createdAt)})},[t.id]),m=O.useCallback(()=>{e.destroy(),Qe.setEditMemoId(t.id)},[t.id]);return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"memo-card-container",children:[y.jsxs("div",{className:"header-container",children:[y.jsx("span",{className:"time-text",children:t.createdAtStr}),y.jsxs("div",{className:"btns-container",children:[y.jsx("button",{ref:p=>{p&&x.setIcon(p,"edit")},className:"btn edit-btn",onClick:m}),y.jsx("button",{ref:p=>{p&&x.setIcon(p,"x")},className:"btn close-btn",onClick:e.destroy})]})]}),y.jsx("div",{className:"memo-container",children:y.jsx("div",{className:"memo-content-text",children:y.jsx(fE,{memo:t,handleMemoContentClick:u,handleMemoDoubleClick:()=>{}})})}),y.jsx("div",{className:"layer-container"})]}),r.length>0?y.jsxs("div",{className:"linked-memos-wrapper",children:[y.jsxs("span",{className:"normal-text",children:[k("LINKED")," ",r.length," THINO"," "]}),r.map(p=>{const g=_b(hw(p.content)).replaceAll(` `," ");return y.jsxs("div",{className:"linked-memo-container",onClick:()=>d(p),children:[y.jsxs("span",{className:"time-text",children:[p.dateStr," "]}),g]},p.id)})]}):null,o.length>0?y.jsxs("div",{className:"linked-memos-wrapper",children:[y.jsxs("span",{className:"normal-text",children:[o.length," THINO ",k("LINK TO THE")," THINO"]}),o.map(p=>{const g=_b(hw(p.content)).replaceAll(` `," ");return y.jsxs("div",{className:"linked-memo-container",onClick:()=>d(p),children:[y.jsxs("span",{className:"time-text",children:[p.dateStr," "]}),g]},p.id)})]}):null]})};function Gd(e){xm({className:"memo-card-dialog"},y5,{memo:e})}const Aw=new Map,Gg=async(e,t=!0)=>{const{vault:n,metadataCache:r}=rt.getState().app;if(t&&Aw.has(e))return Promise.resolve(Aw.get(e));let a;const o=await n.adapter.exists(e);let s="";try{if(!o&&!/(http|https)/g.test(e)){const u=r.getFirstLinkpathDest(e,"");if(!u){new x.Notice(k("File not exist"));return}s=u.path}else s=e}catch(u){console.error(u)}if(s){if(/(http|https)/g.test(s))try{const u=await x.requestUrl(e),d=new Uint8Array(u.arrayBuffer);a=new Blob([d],{type:"image/png"})}catch{}else if(s){const u=await n.adapter.readBinary(s),d=new Uint8Array(u);a=new Blob([d],{type:"image/png"})}return a?w5(a,e):""}},w5=(e,t)=>new Promise(n=>{const r=new FileReader;r.onloadend=()=>{const a=r.result;Aw.set(t,a),n(a)},r.readAsDataURL(e)}),b5=async e=>{const t=document.createElement(e.tagName);t.innerHTML=e.innerHTML;const n=async(r,a)=>{if(!r||!a)return;const o=window.getComputedStyle(r);if(r.tagName==="IMG")try{let s="";const u=r.getAttribute("src");u!=null&&u.startsWith("http")&&!u.startsWith("http://localhost")?s=await Gg(r==null?void 0:r.getAttribute("src")):s=await Gg(r.getAttribute("path")||x.normalizePath(r==null?void 0:r.parentElement.getAttribute("src"))),a.src=s}catch(s){console.error(s)}else if(r.className==="property-image")try{const s=r.style.backgroundImage,u=await Gg(s);a.style.backgroundImage=u}catch(s){console.error(s)}for(const s of o)a.style.setProperty(s,o.getPropertyValue(s),o.getPropertyPriority(s));for(let s=0;s{const t=e.ownerDocument.styleSheets,n=[];for(const a of t)for(const o of a.cssRules)o.constructor.name==="CSSFontFaceRule"&&n.push(o.style);return document.createElement("style")},hE=e=>{const{width:t,height:n}=window.getComputedStyle(e);return{width:parseInt(t.replace("px","")),height:parseInt(n.replace("px",""))}},S5=e=>{const t=new XMLSerializer().serializeToString(e);return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`},I5=(e,t,n)=>{const r="http://www.w3.org/2000/svg",a=document.createElementNS(r,"svg");a.setAttribute("width",`${e}`),a.setAttribute("height",`${t}`),a.setAttribute("viewBox",`0 0 ${e} ${t}`);const o=document.createElementNS(r,"foreignObject");return o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),o.appendChild(n),a.appendChild(o),a},T5=async(e,t)=>{const{width:n,height:r}=hE(e),a=await b5(e);t!=null&&t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor);const o=I5(n,r,a);return o.prepend(await D5(e)),S5(o)},E5=async(e,t)=>{const n=await T5(e,t),r=new Image;r.src=n;const a=(t==null?void 0:t.pixelRatio)||1,{width:o,height:s}=hE(e),u=document.createElement("canvas"),d=u.getContext("2d");return d?(u.width=o*a,u.height=s*a,u.style.width=`${o}`,u.style.height=`${s}`,(t!=null&&t.backgroundColor||document.body.className.contains("theme-dark"))&&(d.fillStyle=t.backgroundColor||"#1f1f1f",d.fillRect(0,0,u.width,u.height)),new Promise(m=>{r.onload=()=>{d.drawImage(r,0,0,u.width,u.height),m(u)}})):Promise.reject("Canvas error")},Uv=async(e,t)=>(await E5(e,t)).toDataURL(),x5='',C5='',M5=(e,t)=>{const n=window.atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let o=0;o{const{vault:t}=rt.getState().app,n=await t.adapter.readBinary(e),r=new Uint8Array(n),a=new Blob([r],{type:"image/png"});return new Promise(o=>{const s=new FileReader;s.onloadend=()=>{const u=s.result;o(u)},s.readAsDataURL(a)})},k5=async()=>{const{app:e,settings:t}=rt.getState();let n,r;const a=document.body.hasClass("theme-light"),o=a?t==null?void 0:t.DefaultLightBackgroundImage:t==null?void 0:t.DefaultDarkBackgroundImage;await e.vault.adapter.exists(t==null?void 0:t.DefaultLightBackgroundImage)&&/\.(png|svg|jpg|jpeg)/g.test(t==null?void 0:t.DefaultLightBackgroundImage)?(r=o,n=await N5(r)):n="data:image/svg+xml;base64,"+btoa(a?x5:C5);const u=document.querySelector(".dialog-wrapper .memo-background .property-image");u.style.backgroundImage="url('"+n+"')",document.body.className.contains("theme-dark")&&(u.style.backgroundColor="#1f1f1f")},A5=e=>{const{memo:t,destroy:n}=e,{memos:r}=Ee.getState().memoState,{view:a,app:o,settings:s}=Ee.getState().dailyNotesState,u={...t,createdAtStr:Re.getDateTimeString(t.createdAt)},[d,m]=O.useState(!1),[p,g]=O.useState(u.content),[w,D]=O.useState(!1),S=O.useRef(null),T=O.useRef(null),[E,A]=O.useState(""),N=O.useRef(null),R=O.useRef(null);let F,H;r.length&&(F=r.length>0?r[r.length-1]:null,F?H=r?Math.ceil((Date.now()-Re.getTimeStampByDate(F==null?void 0:F.createdAt))/1e3/3600/24)+1:0:H=0);const P=s==null?void 0:s.ShareFooterEnd.replace("{UserName}",s==null?void 0:s.UserName),L=s==null?void 0:s.ShareFooterStart.replace("{ThinoNum}",r.length.toString()).replace("{UsedDay}",H.toString());O.useEffect(()=>{!S.current||!T.current||(x.setIcon(S.current,"copy"),x.setIcon(T.current,"x"))},[S,T]),O.useEffect(()=>{x.setIcon(S.current,w?"loader":"copy"),S.current.disabled=w,S.current.toggleClass("copying",w)},[w]),O.useEffect(()=>{if(!R.current||!a||d)return;g(t.content),R.current.hasChildNodes()&&R.current.empty();async function K(){await x.MarkdownRenderer.render(o,t.content+` `,R.current,t.path,a)}K(),setTimeout(()=>{if(k5(),!N.current)return;let ae;document.body.hasClass("theme-dark")?ae="#727171":ae="#eaeaea",Uv(N.current,{backgroundColor:ae,pixelRatio:window.devicePixelRatio*2}).then(ce=>{A(ce),m(!0)}).catch(()=>{})},bI)},[N,R,u]);const z=()=>{n()},U=O.useCallback(K=>{D(K)},[w]),W=async()=>{U(!0);const{vault:K}=Ee.getState().dailyNotesState.app,ae=N.current.querySelector(".memo-shortcut-img");if(!ae)return;const ce=ae==null?void 0:ae.getAttribute("src").split("base64,")[1],fe=M5(ce,"image/png");let ie;if(s!=null&&s.AutoSaveWhenOnMobile&&x.Platform.isMobile&&fe.arrayBuffer().then(async Te=>{const se="png",we=ws();for(const Z in we)if(we[Z]instanceof x.TFile){ie=we[Z];break}ie!==void 0&&await K.createBinary(await K.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,se,ie),Te)}),!fe){new x.Notice("Copy to clipboard failed");return}const ge=new ClipboardItem({"image/png":fe});window.navigator.clipboard.write([ge]).then(()=>{setTimeout(()=>{U(!1)},500)}),new x.Notice("Copy to clipboard successfully")};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"dialog-header-container",children:[y.jsxs("p",{className:"title-text",children:[y.jsx("span",{className:"icon-text",children:"🥰"}),k("Share Memo Image")]}),y.jsxs("div",{className:"btn-group",children:[y.jsx("button",{ref:S,className:"btn copy-btn",onClick:W}),y.jsx("button",{ref:T,className:"btn close-btn",onClick:z})]})]}),y.jsxs("div",{className:"dialog-content-container",children:[y.jsx("div",{className:`tip-words-container ${E?"finish":"loading"}`,children:y.jsx("p",{className:"tip-text",children:k(E?"↗Click the button to save":"Image is generating...")})}),y.jsxs("div",{className:"memo-container",ref:N,children:[y.jsx(lo,{when:E!=="",children:y.jsx("img",{className:"memo-shortcut-img",onClick:W,src:E})}),y.jsxs("div",{className:"memo-background",children:[y.jsx("div",{className:"property-image",style:{backgroundSize:"cover",backgroundRepeat:"no-repeat"}}),y.jsx("span",{className:"background-container"}),y.jsx("div",{ref:R,className:"memo-content-text"}),y.jsxs("div",{className:"watermark-container",children:[y.jsxs("span",{className:"normal-text footer-start",children:[y.jsx("div",{className:"property-social-icons"}),y.jsx("span",{className:"name-text",children:L})]}),y.jsx("span",{className:"normal-text footer-end",children:y.jsx("span",{className:"name-text",children:P})})]})]})]})]})]})};function O5(e){xm({className:"share-memo-image-dialog"},A5,{memo:e})}const BD=async e=>{e.startsWith("http")&&(e=await Gg(e));const t=e.split("base64,")[1],n=Av(t,"image/png");await mE(n),new x.Notice(k("Send to clipboard successfully"))},F5=async(e,t)=>{const n=await e.vault.adapter.exists(t);let r="";if(n)r=t;else{const u=e.metadataCache.getFirstLinkpathDest(t,"");if(!u){new x.Notice(k("File not exist"));return}r=u.path}const a=await e.vault.adapter.readBinary(r),o=new Uint8Array(a),s=new Blob([o],{type:"image/png"});await mE(s)},mE=async e=>{const t=new ClipboardItem({"image/png":e});await window.navigator.clipboard.write([t])},YD=1.1,zD=300,UD=20,P5=({destroy:e,imgUrl:t,filepath:n,otherIMGEls:r,currentIndex:a})=>{const o=O.useRef(null),[s,u]=O.useState(-1),d=Ee.getState().dailyNotesState.app,[m,p]=O.useState(a),[g,w]=O.useState(t),D={close:O.useRef(null),previous:O.useRef(null),next:O.useRef(null),decrease:O.useRef(null),increase:O.useRef(null),zoom:O.useRef(null),copy:O.useRef(null)};O.useEffect(()=>{!n&&!t||(x.setIcon(D.close.current,"x"),D.previous.current&&x.setIcon(D.previous.current,"arrow-left"),D.next.current&&x.setIcon(D.next.current,"arrow-right"),x.setIcon(D.decrease.current,"zoom-out"),x.setIcon(D.increase.current,"zoom-in"),x.setIcon(D.zoom.current,"circle"),x.setIcon(D.copy.current,"clipboard"))},[D]),O.useEffect(()=>{Re.getImageSize(g).then(({width:P})=>{u(P!==0?40:0)})},[g]);const S=()=>{let P=m-1;P<0&&(P=r.length-1),p(P),w(r[P].src)},T=()=>{let P=m+1;P>=r.length&&(P=0),p(P),w(r[P].src)},E=()=>{e()},A=()=>{s>30&&u(s-10)},N=()=>{u(s+10)},R=P=>{P.target!==o.current&&P.target===o.current.parentElement&&E()},F=P=>{if(P.ctrlKey){P.preventDefault();const L=o.current,z=P.nativeEvent.offsetX,U=P.nativeEvent.offsetY,W=z/L.clientWidth,K=U/L.clientHeight;let ae;P.deltaY>0?ae=s/YD:ae=s*YD,ae>zD?ae=zD:ae{if(g&&!n)await BD(t);else if(n){const L=r[m].parentElement.getAttribute("src");if(!L){await BD(g);return}await F5(d,L)}};return y.jsxs(y.Fragment,{children:[y.jsx("button",{ref:D.close,className:"btn close-btn",onClick:E}),y.jsxs("div",{className:"img-container internal-embed image-embed is-loaded",onClick:R,onWheel:F,children:[y.jsx("img",{className:s<=0?"hidden":"",ref:o,height:s+"%",src:g}),y.jsx("span",{className:"loading-text "+(s===-1?"":"hidden"),children:k("Image is loading...")}),y.jsx("span",{className:"loading-text "+(s===0?"":"hidden"),children:k("😟 Cannot load image, image link maybe broken")})]}),y.jsxs("div",{className:"action-btns-container",children:[r&&(r==null?void 0:r.length)>1&&y.jsxs(y.Fragment,{children:[y.jsx("button",{ref:D.previous,className:"btn",onClick:S}),y.jsx("button",{ref:D.next,className:"btn",onClick:T})]}),y.jsx("button",{ref:D.decrease,className:"btn",onClick:A}),y.jsx("button",{ref:D.increase,className:"btn",onClick:N}),y.jsx("button",{ref:D.zoom,className:"btn",onClick:()=>u(80)}),y.jsx("button",{ref:D.copy,className:"btn",onClick:H})]})]})};function Vv({imgUrl:e,filepath:t,otherIMGEls:n,currentIndex:r}){xm({className:"preview-image-dialog"},P5,{...{imgUrl:e,otherIMGEls:n,currentIndex:r},filepath:t})}const j5=O.forwardRef((e,t)=>{const{memo:n,handlePinMemoClick:r,handleFixMemoClick:a,handleSourceMemoClick:o,handleShowMemoStoryDialog:s,handleCopyMemoClick:u,handleEditMemoClick:d,handleGenMemoImageBtnClick:m,handleMarkMemoClick:p,handleArchiveMemo:g,handleDeleteMemoClick:w}=e,D=O.useRef(null),S=Ee.getState().dailyNotesState.settings,[T,E]=_o(!1),A=O.useRef(null),N={pinRef:O.useRef(null),fixRef:O.useRef(null),typeRef:O.useRef(null),moreRef:O.useRef(null)},R={copy:O.useRef(null),read:O.useRef(null),mark:O.useRef(null),share:O.useRef(null),edit:O.useRef(null),source:O.useRef(null),archive:O.useRef(null),delete:O.useRef(null)};return O.useEffect(()=>{A.current&&(x.setIcon(R.copy.current,"copy"),x.setIcon(R.read.current,"book-open"),x.setIcon(R.mark.current,"bookmark"),x.setIcon(R.share.current,"share-2"),x.setIcon(R.edit.current,"pencil"),x.setIcon(R.source.current,"home"),x.setIcon(R.archive.current,"archive"),x.setIcon(R.delete.current,"trash"))},[A]),O.useEffect(()=>{if(!N.typeRef)return;const F=Md.find(H=>H.title===n.sourceType);x.setIcon(N.typeRef.current,F.icon),x.requireApiVersion("1.4.4")&&x.setTooltip(N.typeRef.current,n.path),N.fixRef&&(x.setIcon(N.fixRef.current,"shield-alert"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.fixRef.current,"Update Thino property"))},[N.typeRef]),O.useEffect(()=>{N.pinRef&&(n.pinned?(x.setIcon(N.pinRef.current,"pin-off"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.pinRef.current,k("UNPIN"))):(x.setIcon(N.pinRef.current,"pin"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.pinRef.current,k("PIN"))))},[N.pinRef,n.pinned]),O.useImperativeHandle(t,()=>({toggleConfirm:F=>E(F),confirmStatus:T})),y.jsx("div",{ref:A,className:"memo-top-right-wrapper",children:y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:N.fixRef,className:`btn ${n.sourceType!=="MULTI"||n.id!==""?"hidden":""} fix-memo-btn`,onClick:()=>a(n)}),y.jsx("span",{ref:N.typeRef,className:`btn ${n.sourceType==="DAILY"?"hidden":""} source-type-btn`,onClick:()=>o(n)}),y.jsx("span",{ref:N.pinRef,className:`btn ${e.memo.pinned?"pinned-btn":"unpinned-btn"} pro`,onClick:r}),y.jsx("span",{ref:F=>{N.moreRef.current=F,F&&x.setIcon(F,"more-horizontal")},className:"btn more-action-btn"}),y.jsx("div",{ref:D,className:"more-action-btns-wrapper",children:y.jsxs("div",{className:"more-action-btns-container",children:[y.jsxs("div",{className:"more-action-btn-group more-action-menu-item",children:[y.jsx("span",{ref:R.copy,className:"more-action-item-icon",onClick:u}),y.jsx("span",{ref:R.edit,className:"more-action-item-icon",onClick:d}),y.jsx("span",{ref:R.share,className:"more-action-item-icon",onClick:m})]}),y.jsx("hr",{className:"menu-hr"}),y.jsxs("div",{className:"more-action-menu-item",onClick:s,children:[y.jsx("span",{ref:R.read,className:"more-action-item-icon"}),y.jsx("span",{className:"btn",children:k("READ")})]}),y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:R.mark,className:"more-action-item-icon"}),y.jsx("span",{className:"btn",onClick:p,children:k("MARK")})]}),y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:R.source,className:"more-action-item-icon"}),y.jsx("span",{className:"btn",onClick:()=>o(n),children:k("SOURCE")})]}),y.jsx("hr",{className:"menu-hr"}),y.jsxs("div",{className:"more-action-menu-item archive-menu-item",children:[y.jsx("span",{ref:R.archive,className:"more-action-item-icon"}),y.jsx("span",{className:"btn delete-btn",onClick:()=>g(n),children:k("ARCHIVE").toUpperCase()})]}),y.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[y.jsx("span",{ref:R.delete,className:"more-action-item-icon"}),y.jsx("span",{className:`btn delete-btn ${T?"final-confirm":""}`,onClick:async F=>{F.stopPropagation(),F.preventDefault(),await w(F)},children:T?k("CONFIRM!"):S.DeleteThinoDirectly?k("DELETE"):k("Recycle bin").toUpperCase()})]}),y.jsx("hr",{className:"menu-hr"}),y.jsx("div",{className:"text-count-item more-action-menu-item",children:y.jsx("span",{className:"btn text-count-btn",children:Re.countWords(n.content)+` ${k("words")}`})})]})})]})})}),L5=e=>{const{memo:t,handleMemoTypeToggle:n,handleShowMemoStoryDialog:r,settings:a}=e;return y.jsxs("div",{className:"memo-top-left-wrapper",children:[e.children,y.jsx("span",{title:t.createdAt,className:"time-text",onClick:r,children:t.createdAt}),y.jsx("div",{className:`btn memo-type-img ${a!=null&&a.ShowTaskLabel?"":"hidden"}`,onClick:n,children:t.thinoType!=="JOURNAL"&&y.jsx("input",{className:"task-list-item-checkbox",type:"checkbox",checked:t.thinoType!=="TASK-TODO","data-task":t.thinoType==="TASK-TODO"?"":t.thinoType==="TASK-DONE"?"x":t.thinoType.slice(5)})})]})},R5=async(e,t,n)=>{const r=n.getAttribute("href"),a=n.className;if(a.contains("tag"))_5(n.innerText.slice(1));else if(a.contains("internal-link")){const o=n.getAttribute("data-href"),s=Ie.getMemoById(o??"");s?Gd(s):await e.workspace.openLinkText(o,o,!x.Platform.isMobile&&t.navigation!==!0)}else r&&window.open(r,"_blank")},_5=e=>{const t=We.getState().query.tag;We.setTagQuery(t===e?"":e)},H5=(e,t)=>{const n=t==null?void 0:t.getAttribute("src"),r=t==null?void 0:t.parentElement.getAttribute("src"),a=[...(e==null?void 0:e.querySelectorAll("img"))||[]],o=a.indexOf(t);Vv({imgUrl:n,filepath:n.startsWith("app")?r:void 0,otherIMGEls:a,currentIndex:o})},B5=e=>{var r;const t=(r=e.dataset)==null?void 0:r.value,n=Ie.getMemoById(t??"");n?Gd(n):(new x.Notice("Thino Not Found"),e.classList.remove("memo-link-text"))},Y5=async(e,t,n)=>{var o;const r=((o=n.parentElement.dataset)==null?void 0:o.task)==="x"?"DONE":"TODO",a=[...(t==null?void 0:t.querySelectorAll("li.task-list-item"))||[]];for(const s of a)if(s===n||s===n.closest("li.task-list-item")){const u=a.indexOf(s),d=e.content.split(/\n/),m=[];for(let S=0;S{const{globalState:{editMemoId:t},dailyNotesState:{app:n,view:r,settings:a,verifyState:o},locationState:{pathname:s}}=O.useContext(wt),{memo:u,type:d="inline"}=e,m=O.useRef(null),p=O.useRef(null),[g,w]=O.useState(!1);O.useEffect(()=>{g&&setTimeout(()=>{Qe.setEditMemoId(u.id)},100)},[g]),O.useEffect(()=>{(s==="/review"||s==="/daily")&&t!==u.id&&g&&w(!1)},[t]);const D=()=>{Gd(u)},S=()=>{if(a!=null&&a.UseButtonToShowEditor&&(a==null?void 0:a.DefaultEditorLocation)==="Bottom"){const ie=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.hidden)");ie&&ie.trigger("click")}Qe.setMarkMemoId(u.id)},T=async()=>{var Te;const ie=!x.Platform.isDesktop&&await((Te=window.Capacitor)==null?void 0:Te.Plugins.Device.getId()),ge=x.Platform.isDesktop?await zn():ie.identifier||ie.uuid;if(!o||(o==null?void 0:o.appId)!==ge){fn();return}u.pinned?await Ie.unpinMemoById(u.id):await Ie.pinMemoById(u.id)},E=()=>{if(a!=null&&a.UseButtonToShowEditor&&(a==null?void 0:a.DefaultEditorLocation)==="Bottom"&&x.Platform.isMobile){const ie=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.hidden)");ie&&ie.trigger("click")}(s==="/review"||s==="/daily")&&w(!0),s!=="/review"&&s!=="/daily"&&Qe.setEditMemoId(u.id)},A=async ie=>{ie.sourceType==="MULTI"&&ie.id.trim()===""&&await Ie.updateMemoProperty(ie)},N=async ie=>{await Ie.openThinoByID(ie.id)},R=async ie=>{try{const ge=await Ie.archiveMemo(ie);ge&&Ie.editMemo(ge)}catch(ge){console.error(ge),new x.Notice(ge.message)}},F=async(ie,ge)=>{if(!ge&&p.current&&!p.current.confirmStatus){p.current&&p.current.toggleConfirm();return}try{if(a.DeleteThinoDirectly)await Ie.deleteMemoById(u.id);else{const Te=await Ie.hideMemoById(u.id);Te&&Ie.editMemo(Te)}}catch(Te){new x.Notice(Te.message)}Qe.getState().editMemoId===u.id&&Qe.setEditMemoId("")},H=()=>{if(p.current&&!p.current.confirmStatus){p.current&&p.current.toggleConfirm(!1);return}},P=()=>{O5(u)},L=async()=>{const ie=await Ie.updateMemo(u.id,u.content,u.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");ie&&Ie.editMemo(ie)},z=async ie=>{ie.stopPropagation(),navigator.clipboard.writeText(u.content).then(()=>{new x.Notice(k("COPY SUCCEED"))}).catch(()=>{new x.Notice(k("COPY FAILED"))})},U=ie=>{ie&&E()},W=async(ie,ge)=>{ie.preventDefault();const Te=ie.target;if(ie.ctrlKey||ie.metaKey){await N(ge);return}if(Te.tagName==="A"){await R5(n,r,Te);return}if(Te.tagName==="IMG"){H5(m.current,Te);return}if(Te.tagName==="A"&&Te.getAttribute("href")){const se=Te.getAttribute("href");window.open(se,"_blank");return}if(Te.className==="memo-link-text"){B5(Te);return}if(Te.tagName==="INPUT"&&Te.hasClass("task-list-item-checkbox")){await Y5(ge,m.current,Te);return}},K=ie=>{const ge=new x.Menu;ge.dom.toggleClass("memo-context-menu",!0);const Te=window.getSelection();(Te==null?void 0:Te.toString().length)>0&&ge.addItem(se=>{se.setIcon("copy").setTitle(k("COPY")).onClick(()=>{navigator.clipboard.writeText(Te.toString()).then(()=>{new x.Notice(k("COPY SUCCEED"))}).catch(()=>{new x.Notice(k("COPY FAILED"))})})}).addSeparator(),ge.addItem(se=>{se.setIcon("book-open").setTitle(k("READ")).onClick(D)}).addItem(se=>{se.setIcon(u.pinned?"pin-off":"pin").setTitle(u.pinned?k("UNPIN"):k("PIN")).onClick(T)}).addItem(se=>{se.setIcon("bookmark").setTitle(k("MARK")).onClick(S)}).addItem(se=>{se.setIcon("share-2").setTitle(k("SHARE")).onClick(P)}).addItem(se=>{se.setIcon("pencil").setTitle(k("EDIT")).onClick(E)}).addItem(se=>{se.setIcon("home").setTitle(k("SOURCE")).onClick(()=>N(u))}).addSeparator().addItem(se=>{se.setIcon("archive").setTitle(k("ARCHIVE")).onClick(()=>R(u))}).addItem(se=>{se.setIcon("trash").setTitle(k("DELETE")).onClick(async we=>{await F(we,!0)})}),ge.showAtMouseEvent(ie.nativeEvent)},ae=O.useMemo(()=>({memo:u,handlePinMemoClick:T,handleFixMemoClick:A,handleSourceMemoClick:N,handleArchiveMemo:R,handleDeleteMemoClick:F,handleGenMemoImageBtnClick:P,handleMarkMemoClick:S,handleEditMemoClick:E,handleCopyMemoClick:z,handleShowMemoStoryDialog:D}),[u]),ce=O.useMemo(()=>({memo:u,handleMemoTypeToggle:L,handleShowMemoStoryDialog:D,settings:a}),[u,a]),fe=O.useMemo(()=>y.jsxs("div",{ref:m,className:`memo-wrapper ${u.pinned?"pinned":""}`,"data-source-type":u.sourceType,"data-thino-type":u.thinoType,"data-thino-id":u.id,onMouseLeave:H,onContextMenu:K,children:[g&&y.jsx(Cd,{editorType:"inline"}),!g&&y.jsxs(y.Fragment,{children:[d==="inline"&&y.jsxs("div",{className:"memo-top-wrapper",draggable:!0,onDragStart:ie=>{ie.target.classList.add("dragging"),ie.dataTransfer.setDragImage(m.current,0,0),ie.dataTransfer.setData("text/plain",u.content)},onDragEnd:ie=>{ie.target.classList.remove("dragging")},children:[y.jsx(L5,{...ce}),y.jsx(j5,{ref:p,...ae})]}),y.jsx(fE,{memo:u,handleMemoContentClick:W,handleMemoDoubleClick:U})]})]}),[u,g]);return y.jsx(y.Fragment,{children:fe})},Ua=O.memo(z5);function U5(e,t){if(e==null)return{};var n=V5(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function V5(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o=0)&&(n[a]=e[a]);return n}function fv(){return fv=Object.assign||function(e){for(var t=1;t{this.reCalculateColumnCount()})}reCalculateColumnCount(){const t=window&&window.innerWidth||1/0;let n=this.props.breakpointCols;typeof n!="object"&&(n={default:parseInt(n)||F0});let r=1/0,a=n.default||F0;for(let o in n){const s=parseInt(o);s>0&&t<=s&&s"u"&&(s="my-masonry-grid_column"));const u=Lh(Lh(Lh({},t),n),{},{style:Lh(Lh({},n.style),{},{width:o}),className:s});return a.map((d,m)=>q.createElement("div",fv({},u,{key:m}),d))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:n,breakpointCols:r,columnClassName:a,columnAttrs:o,column:s,className:u}=t,d=U5(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let m=u;return typeof u!="string"&&(this.logDeprecated('The property "className" requires a string'),typeof u>"u"&&(m="my-masonry-grid")),q.createElement("div",fv({},d,{className:m}),this.renderColumns())}}hv.defaultProps=W5;const ZD=e=>{const{thinos:t,dayMark:n,dayMarkRange:r="day"}=e,[a,o]=q.useState(!0),s=q.useRef(null);O.useEffect(()=>{s&&x.setTooltip&&x.setTooltip(s.current,k("Click to expand or fold, Cmd+Click to show all thinos of the day"))},[s]);const u=m=>{if(x.Keymap.isModifier(m.nativeEvent,"Mod")){const p={day:"YYYY-MM-DD",week:"YYYY-[W]WW",month:"YYYY-MM",quarter:"YYYY-[Q]Q",year:"YYYY"},g=x.moment(n,p[r]);We.setFromAndToQuery(g.startOf(r).valueOf(),g.endOf(r).valueOf());return}o(!a)},d=O.useMemo(()=>y.jsx(y.Fragment,{children:e.type==="list"?y.jsxs(y.Fragment,{children:[y.jsx("div",{ref:s,className:`day-mark ${a?"":"folded"} PINNED`,onClick:u,children:y.jsxs("span",{className:"day-mark-text",children:[a?"▼ ":"▶ ",n==="PINNED"?n+" 📌":n]})},n),a&&t.map((m,p)=>y.jsx(Ua,{memo:m},`${m.id}-${x.moment(m.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${p}`))]}):y.jsxs(y.Fragment,{children:[y.jsx("div",{ref:s,className:`day-mark ${a?"":"folded"}`,onClick:u,children:y.jsxs("span",{className:"day-mark-text",children:[a?"▼ ":"▶ ",n==="PINNED"?n+" 📌":n]})},n),y.jsx(hv,{breakpointCols:e.type==="waterfall"?3:1,className:`${e.type}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:a&&t.map((m,p)=>y.jsx(Ua,{memo:m},`${m.id}-${x.moment(m.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${p}`))})]})}),[t,a]);return y.jsx(y.Fragment,{children:d})};function ps(e){"@babel/helpers - typeof";return ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ps(e)}function $5(e,t){if(ps(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ps(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pE(e){var t=$5(e,"string");return ps(t)=="symbol"?t:String(t)}function Ic(e,t,n){return t=pE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function nn(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function Ai(e,t){if(e==null)return{};var n=Zv(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $D(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?L-1:0),U=1;Ut}),Pm=Jd(function(e,t){return e>=t}),A1=Jd(function(e,t){return e=t&&a.getHours()-n.getHours()a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(a);++r-1&&e%1==0&&e<=$O}var F1=GO,qO=O1,JO=F1;function KO(e){return e!=null&&JO(e.length)&&!qO(e)}var Lm=KO,QO=9007199254740991,XO=/^(?:0|[1-9]\d*)$/;function eF(e,t){var n=typeof e;return t=t??QO,!!t&&(n=="number"||n!="symbol"&&XO.test(e))&&e>-1&&e%1==0&&e{t.current=e},[e]),t}function sS(e){const t=n7(e);return O.useCallback(function(...n){return t.current&&t.current(...n)},[t])}function lS(){return O.useState(null)}function r7(){const e=O.useRef(!0),t=O.useRef(()=>e.current);return O.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function a7(e){const t=r7();return[e[0],O.useCallback(n=>{if(t())return e[1](n)},[t,e[1]])]}var o7=iE({defaultModifiers:[nE,aE,KT,QT,rE,tE,oE,JT]}),cS=function(t){return{position:t,top:"0",left:"0",opacity:"0",pointerEvents:"none"}},i7={name:"applyStyles",enabled:!1},s7={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:function(t){var n=t.state;return function(){var r=n.elements,a=r.reference,o=r.popper;if("removeAttribute"in a){var s=(a.getAttribute("aria-describedby")||"").split(",").filter(function(u){return u.trim()!==o.id});s.length?a.setAttribute("aria-describedby",s.join(",")):a.removeAttribute("aria-describedby")}}},fn:function(t){var n,r=t.state,a=r.elements,o=a.popper,s=a.reference,u=(n=o.getAttribute("role"))==null?void 0:n.toLowerCase();if(o.id&&u==="tooltip"&&"setAttribute"in s){var d=s.getAttribute("aria-describedby");if(d&&d.split(",").indexOf(o.id)!==-1)return;s.setAttribute("aria-describedby",d?d+","+o.id:o.id)}}},l7=[];function c7(e,t,n){var r=n===void 0?{}:n,a=r.enabled,o=a===void 0?!0:a,s=r.placement,u=s===void 0?"bottom":s,d=r.strategy,m=d===void 0?"absolute":d,p=r.modifiers,g=p===void 0?l7:p,w=Zv(r,["enabled","placement","strategy","modifiers"]),D=O.useRef(),S=O.useCallback(function(){var F;(F=D.current)==null||F.update()},[]),T=O.useCallback(function(){var F;(F=D.current)==null||F.forceUpdate()},[]),E=a7(O.useState({placement:u,update:S,forceUpdate:T,attributes:{},styles:{popper:cS(m),arrow:{}}})),A=E[0],N=E[1],R=O.useMemo(function(){return{name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(H){var P=H.state,L={},z={};Object.keys(P.elements).forEach(function(U){L[U]=P.styles[U],z[U]=P.attributes[U]}),N({state:P,styles:L,attributes:z,update:S,forceUpdate:T,placement:P.placement})}}},[S,T,N]);return O.useEffect(function(){!D.current||!o||D.current.setOptions({placement:u,strategy:m,modifiers:[].concat(g,[R,i7])})},[m,u,R,o]),O.useEffect(function(){if(!(!o||e==null||t==null))return D.current=o7(e,t,kn({},w,{placement:u,strategy:m,modifiers:[].concat(g,[s7,R])})),function(){D.current!=null&&(D.current.destroy(),D.current=void 0,N(function(F){return kn({},F,{attributes:{},styles:{popper:cS(m)}})}))}},[o,e,t]),A}function u7(e,t,n,r){var a=r&&typeof r!="boolean"?r.capture:r;e.removeEventListener(t,n,a),n.__once&&e.removeEventListener(t,n.__once,a)}function Uh(e,t,n,r){return t7(e,t,n,r),function(){u7(e,t,n,r)}}function d7(e){return e&&"setState"in e?b1.findDOMNode(e):e??null}const f7=function(e){return _m(d7(e))};var h7=27,uS=function(){};function m7(e){return e.button===0}function p7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var dS=function(t){return t&&("current"in t?t.current:t)};function g7(e,t,n){var r=n===void 0?{}:n,a=r.disabled,o=r.clickTrigger,s=o===void 0?"click":o,u=O.useRef(!1),d=t||uS,m=O.useCallback(function(w){var D,S=dS(e);t5(!!S,"RootClose captured a close event but does not have a ref to compare it to. useRootClose(), should be passed a ref that resolves to a DOM node"),u.current=!S||p7(w)||!m7(w)||!!dm(S,(D=w.composedPath==null?void 0:w.composedPath()[0])!=null?D:w.target)},[e]),p=sS(function(w){u.current||d(w)}),g=sS(function(w){w.keyCode===h7&&d(w)});O.useEffect(function(){if(!(a||e==null)){var w=window.event,D=f7(dS(e)),S=Uh(D,s,m,!0),T=Uh(D,s,function(N){if(N===w){w=void 0;return}p(N)}),E=Uh(D,"keyup",function(N){if(N===w){w=void 0;return}g(N)}),A=[];return"ontouchstart"in D.documentElement&&(A=[].slice.call(D.body.children).map(function(N){return Uh(N,"mousemove",uS)})),function(){S(),T(),E(),A.forEach(function(N){return N()})}}},[e,a,s,m,p,g])}function v7(e){var t={};return Array.isArray(e)?(e==null||e.forEach(function(n){t[n.name]=n}),t):e||t}function y7(e){return e===void 0&&(e={}),Array.isArray(e)?e:Object.keys(e).map(function(t){return e[t].name=t,e[t]})}function w7(e){var t,n,r,a,o=e.enabled,s=e.enableEvents,u=e.placement,d=e.flip,m=e.offset,p=e.fixed,g=e.containerPadding,w=e.arrowElement,D=e.popperConfig,S=D===void 0?{}:D,T=v7(S.modifiers);return kn({},S,{placement:u,enabled:o,strategy:p?"fixed":S.strategy,modifiers:y7(kn({},T,{eventListeners:{enabled:s},preventOverflow:kn({},T.preventOverflow,{options:g?kn({padding:g},(t=T.preventOverflow)==null?void 0:t.options):(n=T.preventOverflow)==null?void 0:n.options}),offset:{options:kn({offset:m},(r=T.offset)==null?void 0:r.options)},arrow:kn({},T.arrow,{enabled:!!w,options:kn({},(a=T.arrow)==null?void 0:a.options,{element:w})}),flip:kn({enabled:!!d},T.flip)}))})}function b7(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function D7(e,t){e.classList?e.classList.add(t):b7(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function fS(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function S7(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=fS(e.className,t):e.setAttribute("class",fS(e.className&&e.className.baseVal||"",t))}var kg;function VE(e){if((!kg&&kg!==0||e)&&L1){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),kg=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return kg}var _0=function(t){var n;return typeof document>"u"?null:t==null?_m().body:(typeof t=="function"&&(t=t()),t&&"current"in t&&(t=t.current),(n=t)!=null&&n.nodeType&&t||null)};function hS(e,t){var n=O.useState(function(){return _0(e)}),r=n[0],a=n[1];if(!r){var o=_0(e);o&&a(o)}return O.useEffect(function(){t&&r&&t(r)},[t,r]),O.useEffect(function(){var s=_0(e);s!==r&&a(s)},[e,r]),r}const mS=e=>!e||typeof e=="function"?e:t=>{e.current=t};function I7(e,t){const n=mS(e),r=mS(t);return a=>{n&&n(a),r&&r(a)}}function T7(e,t){return O.useMemo(()=>I7(e,t),[e,t])}var R1=q.forwardRef(function(e,t){var n=e.flip,r=e.offset,a=e.placement,o=e.containerPadding,s=o===void 0?5:o,u=e.popperConfig,d=u===void 0?{}:u,m=e.transition,p=lS(),g=p[0],w=p[1],D=lS(),S=D[0],T=D[1],E=T7(w,t),A=hS(e.container),N=hS(e.target),R=O.useState(!e.show),F=R[0],H=R[1],P=c7(N,g,w7({placement:a,enableEvents:!!e.show,containerPadding:s||5,flip:n,offset:r,arrowElement:S,popperConfig:d})),L=P.styles,z=P.attributes,U=Zv(P,["styles","attributes"]);e.show?F&&H(!1):!e.transition&&!F&&H(!0);var W=function(){H(!0),e.onExited&&e.onExited.apply(e,arguments)},K=e.show||m&&!F;if(g7(g,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!K)return null;var ae=e.children(kn({},U,{show:!!e.show,props:kn({},z.popper,{style:L.popper,ref:E}),arrowProps:kn({},z.arrow,{style:L.arrow,ref:T})}));if(m){var ce=e.onExit,fe=e.onExiting,ie=e.onEnter,ge=e.onEntering,Te=e.onEntered;ae=q.createElement(m,{in:e.show,appear:!0,onExit:ce,onExiting:fe,onExited:W,onEnter:ie,onEntering:ge,onEntered:Te},ae)}return A?b1.createPortal(ae,A):null});R1.displayName="Overlay";R1.propTypes={show:Ae.bool,placement:Ae.oneOf(S1),target:Ae.any,container:Ae.any,flip:Ae.bool,children:Ae.func.isRequired,containerPadding:Ae.number,popperConfig:Ae.object,rootClose:Ae.bool,rootCloseEvent:Ae.oneOf(["click","mousedown"]),rootCloseDisabled:Ae.bool,onHide:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a-1}var B7=H7,Y7=Gv;function z7(e,t){var n=this.__data__,r=Y7(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var U7=z7,V7=C7,Z7=P7,W7=R7,$7=B7,G7=U7;function Xd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tu))return!1;var m=o.get(e),p=o.get(t);if(m&&p)return m==t&&p==e;var g=-1,w=!0,D=n&iL?new nL:void 0;for(o.set(e,t),o.set(t,e);++g0&&n(u)?t>1?lx(u,t-1,n,r,a):yY(a,u):r||(a[a.length]=u)}return a}var cx=lx;function bY(e){return function(t,n,r){for(var a=-1,o=Object(t),s=r(t),u=s.length;u--;){var d=s[e?u:++a];if(n(o[d],d,o)===!1)break}return t}}var DY=bY,SY=DY,IY=SY(),TY=IY,EY=TY,xY=Hm;function CY(e,t){return e&&EY(e,t,xY)}var K1=CY,MY=Lm;function NY(e,t){return function(n,r){if(n==null)return n;if(!MY(n))return e(n,r);for(var a=n.length,o=t?a:-1,s=Object(n);(t?o--:++ot||o&&s&&d&&!u&&!m||r&&s&&d||!n&&d||!a)return 1;if(!r&&!o&&!m&&e=u)return d;var m=n[r];return d*(m=="desc"?-1:1)}}return e.index-t.index}var ZY=VY,V0=J1,WY=ny,$Y=ay,GY=_Y,qY=BY,JY=Xv,KY=ZY,QY=ry,XY=ho;function ez(e,t,n){t.length?t=V0(t,function(o){return XY(o)?function(s){return WY(s,o.length===1?o[0]:o)}:o}):t=[QY];var r=-1;t=V0(t,JY($Y));var a=GY(e,function(o,s,u){var d=V0(t,function(m){return m(o)});return{criteria:d,index:++r,value:o}});return qY(a,function(o,s){return KY(o,s,n)})}var tz=ez;function nz(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var rz=nz,az=rz,ZS=Math.max;function oz(e,t,n){return t=ZS(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=ZS(r.length-t,0),s=Array(o);++a0){if(++t>=mz)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var yz=vz,wz=hz,bz=yz,Dz=bz(wz),fx=Dz,Sz=ry,Iz=ux,Tz=fx;function Ez(e,t){return Tz(Iz(e,t,Sz),e+"")}var hx=Ez,xz=cx,Cz=tz,Mz=hx,$S=$v,Nz=Mz(function(e,t){if(e==null)return[];var n=t.length;return n>1&&$S(e,t[0],t[1])?t=[]:n>2&&$S(t[0],t[1],t[2])&&(t=[t[0]]),Cz(e,xz(t,1),[])}),kz=Nz;const Az=Xn(kz);function zw(e,t){var n=j1(e);return n?n.innerWidth:t?e.clientWidth:Nc(e).width}function mx(e){return yE(e)||FE(e)||N1(e)||wE()}function Oz(e,t){for(var n=-1,r=e==null?0:e.length;++n1),o}),IW(e,xW(e),n),r&&(n=bW(n,CW|MW|NW,TW));for(var a=t.length;a--;)DW(n,t[a]);return n}),AW=kW;const OW=Xn(AW);var FW=hx,PW=jm,jW=$v,LW=oy,Tx=Object.prototype,RW=Tx.hasOwnProperty,_W=FW(function(e,t){e=Object(e);var n=-1,r=t.length,a=r>2?t[2]:void 0;for(a&&jW(t[0],t[1],a)&&(r=1);++n0&&(u=u[0]),d=(u=u.filter(function(p){return p}))[0];for(var m=1;m2?r-2:0),o=2;o2&&arguments[2]!==void 0?arguments[2]:"day",r=e,a=[];qd(r,t,n);)a.push(r),r=Ho(r,1,n);return a}function g$(e,t){return t==null&&e==null?null:(t==null&&(t=new Date),e==null&&(e=new Date),e=Cr(e,"day"),e=um(e,um(t)),e=Ld(e,Ld(t)),e=cm(e,cm(t)),lm(e,lm(t)))}function i2(e){return um(e)===0&&Ld(e)===0&&cm(e)===0&&lm(e)===0}function v$(e,t,n,r){return n==="day"&&(n="date"),Math.abs(KD[n](e,void 0,r)-KD[n](t,void 0,r))}function eb(e,t,n){return!n||n==="milliseconds"?Math.abs(+e-+t):Math.round(Math.abs(+Cr(e,n)/o2[n]-+Cr(t,n)/o2[n]))}var y$=Ae.oneOfType([Ae.string,Ae.func]);function w$(e,t,n,r,a){var o=typeof r=="function"?r(n,a,e):t.call(e,n,r,a);return nm(o==null||typeof o=="string","`localizer format(..)` must return a string, null, or undefined"),o}function b$(e,t,n){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,t+n,0,0)}function tb(e,t){return e.getTimezoneOffset()-t.getTimezoneOffset()}function D$(e,t){return eb(e,t,"minutes")+tb(e,t)}function S$(e){var t=Cr(e,"day");return eb(t,e,"minutes")+tb(t,e)}function I$(e,t){return A1(e,t,"day")}function T$(e,t,n){var r=Fm(e,t,"minutes");return r?Pm(t,n,"minutes"):Wv(t,n,"minutes")}function Uw(e,t){return v$(e,t,"day")}function E$(e){var t=e.evtA,n=t.start,r=t.end,a=t.allDay,o=e.evtB,s=o.start,u=o.end,d=o.allDay,m=+Cr(n,"day")-+Cr(s,"day"),p=Uw(n,r),g=Uw(s,u);return m||g-p||!!d-!!a||+n-+s||+r-+u}function x$(e){var t=e.event,n=t.start,r=t.end,a=e.range,o=a.start,s=a.end,u=Cr(n,"day"),d=qd(u,s,"day"),m=k1(u,r,"minutes"),p=m?Wv(r,o,"minutes"):Pm(r,o,"minutes");return d&&p}function C$(e,t){return Fm(e,t,"day")}function M$(e,t){return i2(e)&&i2(t)}var N$=gr(function e(t){var n=this;pr(this,e),nm(typeof t.format=="function","date localizer `format(..)` must be a function"),nm(typeof t.firstOfWeek=="function","date localizer `firstOfWeek(..)` must be a function"),this.propType=t.propType||y$,this.formats=t.formats,this.format=function(){for(var r=arguments.length,a=new Array(r),o=0;o1,fe=E.eventProp(s,K,W,u),ie=q.createElement("div",{className:"rbc-event-content",title:U||void 0},R?q.createElement(R,{event:s,continuesPrior:D,continuesAfter:S,title:z,isAllDay:ae,localizer:w,slotStart:H,slotEnd:P}):z);return q.createElement(F,Object.assign({},this.props,{type:"date"}),q.createElement("div",Object.assign({},L,{style:nn(nn({},fe.style),a),className:Qn("rbc-event",o,fe.className,{"rbc-selected":u,"rbc-event-allday":ce,"rbc-event-continues-prior":D,"rbc-event-continues-after":S}),onClick:function(Te){return m&&m(s,Te)},onDoubleClick:function(Te){return p&&p(s,Te)},onKeyDown:function(Te){return g&&g(s,Te)}}),typeof A=="function"?A(ie):ie))}}]),t}(q.Component);function sy(e,t){return!e||t==null?!1:Q_(e,t)}function Mx(e,t){var n=e.right-e.left,r=n/t;return r}function Nx(e,t,n,r){var a=Mx(e,r);return n?r-1-Math.floor((t-e.left)/a):Math.floor((t-e.left)/a)}function j$(e,t){var n=t.x,r=t.y;return r>=e.top&&r<=e.bottom&&n>=e.left&&n<=e.right}function L$(e,t,n,r,a){var o=-1,s=-1,u=r-1,d=Mx(t,r),m=Nx(t,n.x,a,r),p=t.topn.y,g=t.tope.y,w=e.y>t.bottom,D=t.top>e.y,S=n.topt.bottom;return S&&(o=0,s=u),p&&(D?(o=0,s=m):w&&(o=m,s=u)),g&&(o=s=a?u-Math.floor((e.x-t.left)/d):Math.floor((e.x-t.left)/d),p?mN?s-A-L:s+L+m,U=H>R?u+P-E+d:u+P;return{topOffset:z,leftOffset:U}}function _$(e){var t=e.containerRef,n=e.accessors,r=e.getters,a=e.selected,o=e.components,s=e.localizer,u=e.position,d=e.show,m=e.events,p=e.slotStart,g=e.slotEnd,w=e.onSelect,D=e.onDoubleClick,S=e.onKeyPress,T=e.handleDragStart,E=e.popperRef,A=e.target,N=e.offset;F$({ref:E,callback:d}),O.useLayoutEffect(function(){var H=R$({target:A,offset:N,container:t.current,box:E.current}),P=H.topOffset,L=H.leftOffset;E.current.style.top="".concat(P,"px"),E.current.style.left="".concat(L,"px")},[N.x,N.y,A]);var R=u.width,F={minWidth:R+R/2};return q.createElement("div",{style:F,className:"rbc-overlay",ref:E},q.createElement("div",{className:"rbc-overlay-header"},s.format(p,"dayHeaderFormat")),m.map(function(H,P){return q.createElement(Cx,{key:P,type:"popup",localizer:s,event:H,getters:r,onSelect:w,accessors:n,components:o,onDoubleClick:D,onKeyPress:S,continuesPrior:s.lt(n.end(H),p,"day"),continuesAfter:s.gte(n.start(H),g,"day"),slotStart:p,slotEnd:g,selected:sy(H,a),draggable:!0,onDragStart:function(){return T(H)},onDragEnd:function(){return d()}})}))}var kx=q.forwardRef(function(e,t){return q.createElement(_$,Object.assign({},e,{popperRef:t}))});kx.propTypes={accessors:Ae.object.isRequired,getters:Ae.object.isRequired,selected:Ae.object,components:Ae.object.isRequired,localizer:Ae.object.isRequired,position:Ae.object.isRequired,show:Ae.func.isRequired,events:Ae.array.isRequired,slotStart:Ae.instanceOf(Date).isRequired,slotEnd:Ae.instanceOf(Date),onSelect:Ae.func,onDoubleClick:Ae.func,onKeyPress:Ae.func,handleDragStart:Ae.func,style:Ae.object,offset:Ae.shape({x:Ae.number,y:Ae.number})};function H$(e){var t=e.containerRef,n=e.popupOffset,r=n===void 0?5:n,a=e.overlay,o=e.accessors,s=e.localizer,u=e.components,d=e.getters,m=e.selected,p=e.handleSelectEvent,g=e.handleDoubleClickEvent,w=e.handleKeyPressEvent,D=e.handleDragStart,S=e.onHide,T=e.overlayDisplay,E=O.useRef(null);if(!a.position)return null;var A=r;isNaN(r)||(A={x:r,y:r});var N=a.position,R=a.events,F=a.date,H=a.end;return q.createElement(E7,{rootClose:!0,flip:!0,show:!0,placement:"bottom",onHide:S,target:a.target},function(P){var L=P.props;return q.createElement(kx,Object.assign({},L,{containerRef:t,ref:E,target:a.target,offset:A,accessors:o,getters:d,selected:m,components:u,localizer:s,position:N,show:T,events:R,slotStart:F,slotEnd:H,onSelect:p,onDoubleClick:g,onKeyPress:w,handleDragStart:D}))})}var nb=q.forwardRef(function(e,t){return q.createElement(H$,Object.assign({},e,{containerRef:t}))});nb.propTypes={popupOffset:Ae.oneOfType([Ae.number,Ae.shape({x:Ae.number,y:Ae.number})]),overlay:Ae.shape({position:Ae.object,events:Ae.array,date:Ae.instanceOf(Date),end:Ae.instanceOf(Date)}),accessors:Ae.object.isRequired,localizer:Ae.object.isRequired,components:Ae.object.isRequired,getters:Ae.object.isRequired,selected:Ae.object,handleSelectEvent:Ae.func,handleDoubleClickEvent:Ae.func,handleKeyPressEvent:Ae.func,handleDragStart:Ae.func,onHide:Ae.func,overlayDisplay:Ae.func};function Lr(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document;return Uh(n,e,t,{passive:!1})}function B$(e,t,n){return!e||dm(e,document.elementFromPoint(t,n))}function Y$(e,t){var n=t.clientX,r=t.clientY,a=document.elementFromPoint(n,r);return nx(a,".rbc-event",e)}function z$(e,t){var n=t.clientX,r=t.clientY,a=document.elementFromPoint(n,r);return nx(a,".rbc-show-more",e)}function Iv(e,t){return!!Y$(e,t)}function U$(e,t){return!!z$(e,t)}function wd(e){var t=e;return e.touches&&e.touches.length&&(t=e.touches[0]),{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY}}var s2=5,V$=250,Ax=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.global,a=r===void 0?!1:r,o=n.longPressThreshold,s=o===void 0?250:o,u=n.validContainers,d=u===void 0?[]:u;pr(this,e),this.isDetached=!1,this.container=t,this.globalMouse=!t||a,this.longPressThreshold=s,this.validContainers=d,this._listeners=Object.create(null),this._handleInitialEvent=this._handleInitialEvent.bind(this),this._handleMoveEvent=this._handleMoveEvent.bind(this),this._handleTerminatingEvent=this._handleTerminatingEvent.bind(this),this._keyListener=this._keyListener.bind(this),this._dropFromOutsideListener=this._dropFromOutsideListener.bind(this),this._dragOverFromOutsideListener=this._dragOverFromOutsideListener.bind(this),this._removeTouchMoveWindowListener=Lr("touchmove",function(){},window),this._removeKeyDownListener=Lr("keydown",this._keyListener),this._removeKeyUpListener=Lr("keyup",this._keyListener),this._removeDropFromOutsideListener=Lr("drop",this._dropFromOutsideListener),this._removeDragOverFromOutsideListener=Lr("dragover",this._dragOverFromOutsideListener),this._addInitialEventListener()}return gr(e,[{key:"on",value:function(n,r){var a=this._listeners[n]||(this._listeners[n]=[]);return a.push(r),{remove:function(){var s=a.indexOf(r);s!==-1&&a.splice(s,1)}}}},{key:"emit",value:function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o0&&arguments[0]!==void 0?arguments[0]:0;return ps(e)!=="object"&&(e={top:e,left:e,right:e,bottom:e}),e}function l2(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=Lc(e),a=r.top,o=r.left,s=r.right,u=s===void 0?o:s,d=r.bottom,m=d===void 0?a:d,p=Lc(t),g=p.top,w=p.left,D=p.right,S=D===void 0?w:D,T=p.bottom,E=T===void 0?g:T;return!(m-nE||u-nS)}function Lc(e){if(!e.getBoundingClientRect)return e;var t=e.getBoundingClientRect(),n=t.left+c2("left"),r=t.top+c2("top");return{top:r,left:n,right:(e.offsetWidth||0)+n,bottom:(e.offsetHeight||0)+r}}function c2(e){if(e==="left")return window.pageXOffset||document.body.scrollLeft||0;if(e==="top")return window.pageYOffset||document.body.scrollTop||0}var W$=function(e){ta(t,e);function t(n,r){var a;return pr(this,t),a=ea(this,t,[n,r]),a.state={selecting:!1},a.containerRef=O.createRef(),a}return gr(t,[{key:"componentDidMount",value:function(){this.props.selectable&&this._selectable()}},{key:"componentWillUnmount",value:function(){this._teardownSelectable()}},{key:"componentDidUpdate",value:function(r){!r.selectable&&this.props.selectable&&this._selectable(),r.selectable&&!this.props.selectable&&this._teardownSelectable()}},{key:"render",value:function(){var r=this.props,a=r.range,o=r.getNow,s=r.getters,u=r.date,d=r.components.dateCellWrapper,m=r.localizer,p=this.state,g=p.selecting,w=p.startIdx,D=p.endIdx,S=o();return q.createElement("div",{className:"rbc-row-bg",ref:this.containerRef},a.map(function(T,E){var A=g&&E>=w&&E<=D,N=s.dayProp(T),R=N.className,F=N.style;return q.createElement(d,{key:E,value:T,range:a},q.createElement("div",{style:F,className:Qn("rbc-day-bg",R,A&&"rbc-selected-cell",m.isSameDate(T,S)&&"rbc-today",u&&m.neq(u,T,"month")&&"rbc-off-range-bg")}))}))}},{key:"_selectable",value:function(){var r=this,a=this.containerRef.current,o=this._selector=new Ax(this.props.container,{longPressThreshold:this.props.longPressThreshold}),s=function(d,m){if(!Iv(a,d)&&!U$(a,d)){var p=Lc(a),g=r.props,w=g.range,D=g.rtl;if(j$(p,d)){var S=Nx(p,d.x,D,w.length);r._selectSlot({startIdx:S,endIdx:S,action:m,box:d})}}r._initial={},r.setState({selecting:!1})};o.on("selecting",function(u){var d=r.props,m=d.range,p=d.rtl,g=-1,w=-1;if(r.state.selecting||(vn(r.props.onSelectStart,[u]),r._initial={x:u.x,y:u.y}),o.isSelected(a)){var D=Lc(a),S=L$(r._initial,D,u,m.length,p);g=S.startIdx,w=S.endIdx}r.setState({selecting:!0,startIdx:g,endIdx:w})}),o.on("beforeSelect",function(u){if(r.props.selectable==="ignoreEvents")return!Iv(r.containerRef.current,u)}),o.on("click",function(u){return s(u,"click")}),o.on("doubleClick",function(u){return s(u,"doubleClick")}),o.on("select",function(u){r._selectSlot(nn(nn({},r.state),{},{action:"select",bounds:u})),r._initial={},r.setState({selecting:!1}),vn(r.props.onSelectEnd,[r.state])})}},{key:"_teardownSelectable",value:function(){this._selector&&(this._selector.teardown(),this._selector=null)}},{key:"_selectSlot",value:function(r){var a=r.endIdx,o=r.startIdx,s=r.action,u=r.bounds,d=r.box;a!==-1&&o!==-1&&this.props.onSelectSlot&&this.props.onSelectSlot({start:o,end:a,action:s,bounds:u,box:d,resourceId:this.props.resourceId})}}]),t}(q.Component),Mi={propTypes:{slotMetrics:Ae.object.isRequired,selected:Ae.object,isAllDay:Ae.bool,accessors:Ae.object.isRequired,localizer:Ae.object.isRequired,components:Ae.object.isRequired,getters:Ae.object.isRequired,onSelect:Ae.func,onDoubleClick:Ae.func,onKeyPress:Ae.func},defaultProps:{segments:[],selected:{}},renderEvent:function(t,n){var r=t.selected;t.isAllDay;var a=t.accessors,o=t.getters,s=t.onSelect,u=t.onDoubleClick,d=t.onKeyPress,m=t.localizer,p=t.slotMetrics,g=t.components,w=t.resizable,D=p.continuesPrior(n),S=p.continuesAfter(n);return q.createElement(Cx,{event:n,getters:o,localizer:m,accessors:a,components:g,onSelect:s,onDoubleClick:u,onKeyPress:d,continuesPrior:D,continuesAfter:S,slotStart:p.first,slotEnd:p.last,selected:sy(n,r),resizable:w})},renderSpan:function(t,n,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:" ",o=Math.abs(n)/t*100+"%";return q.createElement("div",{key:r,className:"rbc-row-segment",style:{WebkitFlexBasis:o,flexBasis:o,maxWidth:o}},a)}},Ox=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){var r=this,a=this.props,o=a.segments,s=a.slotMetrics.slots,u=a.className,d=1;return q.createElement("div",{className:Qn(u,"rbc-row")},o.reduce(function(m,p,g){var w=p.event,D=p.left,S=p.right,T=p.span,E="_lvl_"+g,A=D-d,N=Mi.renderEvent(r.props,w);return A&&m.push(Mi.renderSpan(s,A,"".concat(E,"_gap"))),m.push(Mi.renderSpan(s,T,E,N)),d=S+1,m},[]))}}]),t}(q.Component);Ox.defaultProps=nn({},Mi.defaultProps);function Fx(e){var t=e.dateRange,n=e.unit,r=n===void 0?"day":n,a=e.localizer;return{first:t[0],last:a.add(t[t.length-1],1,r)}}function $$(e,t,n,r){var a=Fx({dateRange:t,localizer:r}),o=a.first,s=a.last,u=r.diff(o,s,"day"),d=r.max(r.startOf(n.start(e),"day"),o),m=r.min(r.ceil(n.end(e),"day"),s),p=XB(t,function(w){return r.isSameDate(w,d)}),g=r.diff(d,m,"day");return g=Math.min(g,u),g=Math.max(g-r.segmentOffset,1),{event:e,span:g,left:p+1,right:Math.max(p+g,1)}}function Px(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0,n,r,a,o=[],s=[];for(n=0;n=t?s.push(a):(o[r]||(o[r]=[])).push(a)}for(n=0;n=e.left})}function q$(e,t,n){var r=Jg(e),a=[],o=[];r.forEach(function(d){var m=t.start(d),p=t.end(d);n.daySpan(m,p)>1?a.push(d):o.push(d)});var s=a.sort(function(d,m){return Vw(d,m,t,n)}),u=o.sort(function(d,m){return Vw(d,m,t,n)});return[].concat(Jg(s),Jg(u))}function Vw(e,t,n,r){var a={start:n.start(e),end:n.end(e),allDay:n.allDay(e)},o={start:n.start(t),end:n.end(t),allDay:n.allDay(t)};return r.sortEvents({evtA:a,evtB:o})}var jx=function(t,n){return t.left<=n&&t.right>=n},u2=function(t,n){return t.filter(function(r){return jx(r,n)}).map(function(r){return r.event})},Lx=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){for(var r=this.props,a=r.segments,o=r.slotMetrics.slots,s=Px(a).levels[0],u=1,d=1,m=[];u<=o;){var p="_lvl_"+u,g=s.filter(function(N){return jx(N,u)})[0]||{},w=g.event,D=g.left,S=g.right,T=g.span;if(!w){u++;continue}var E=Math.max(0,D-d);if(this.canRenderSlotEvent(D,T)){var A=Mi.renderEvent(this.props,w);E&&m.push(Mi.renderSpan(o,E,p+"_gap")),m.push(Mi.renderSpan(o,T,p,A)),d=u=S+1}else E&&m.push(Mi.renderSpan(o,E,p+"_gap")),m.push(Mi.renderSpan(o,1,p,this.renderShowMore(a,u))),d=u+=1}return q.createElement("div",{className:"rbc-row"},m)}},{key:"canRenderSlotEvent",value:function(r,a){var o=this.props.segments;return dY(r,r+a).every(function(s){var u=u2(o,s).length;return u===1})}},{key:"renderShowMore",value:function(r,a){var o=this,s=this.props,u=s.localizer,d=s.slotMetrics,m=d.getEventsForSlot(a),p=u2(r,a),g=p.length;return g?q.createElement("button",{type:"button",key:"sm_"+a,className:Qn("rbc-button-link","rbc-show-more"),onClick:function(D){return o.showMore(a,D)}},u.messages.showMore(g,p,m)):!1}},{key:"showMore",value:function(r,a){a.preventDefault(),a.stopPropagation(),this.props.onShowMore(r,a.target)}}]),t}(q.Component);Lx.defaultProps=nn({},Mi.defaultProps);var J$=function(t){var n=t.children;return q.createElement("div",{className:"rbc-row-content-scroll-container"},n)},K$=function(t,n){return t.left<=n&&t.right>=n},Q$=function(t,n){return t[0].range===n[0].range&&t[0].events===n[0].events};function Rx(){return sx(function(e){for(var t=e.range,n=e.events,r=e.maxRows,a=e.minRows,o=e.accessors,s=e.localizer,u=Fx({dateRange:t,localizer:s}),d=u.first,m=u.last,p=n.map(function(T){return $$(T,t,o,s)}),g=Px(p,Math.max(r-1,1)),w=g.levels,D=g.extra,S=D.length>0?a-1:a;w.length1&&arguments[1]!==void 0?arguments[1]:0;if(o.lt(F,t,"minutes"))return w[0];if(o.gt(F,n,"minutes"))return w[w.length-1];var P=o.diff(t,F,"minutes");return w[(P-P%r)/r+H]},startsBeforeDay:function(F){return o.lt(F,t,"day")},startsAfterDay:function(F){return o.gt(F,n,"day")},startsBefore:function(F){return o.lt(o.merge(t,F),t,"minutes")},startsAfter:function(F){return o.gt(o.merge(n,F),n,"minutes")},getRange:function(F,H,P,L){P||(F=o.min(n,o.max(t,F))),L||(H=o.min(n,o.max(t,H)));var z=N(F),U=N(H),W=U>r*p&&!o.eq(n,H)?(z-r)/(r*p)*100:z/(r*p)*100;return{top:W,height:U/(r*p)*100-W,start:N(F),startDate:F,end:N(H),endDate:H}},getCurrentTimePosition:function(F){var H=N(F),P=H/(r*p)*100;return P}}}var nG=function(){function e(t,n){var r=n.accessors,a=n.slotMetrics;pr(this,e);var o=a.getRange(r.start(t),r.end(t)),s=o.start,u=o.startDate,d=o.end,m=o.endDate,p=o.top,g=o.height;this.start=s,this.end=d,this.startMs=+u,this.endMs=+m,this.top=p,this.height=g,this.data=t}return gr(e,[{key:"_width",get:function(){if(this.rows){var n=this.rows.reduce(function(a,o){return Math.max(a,o.leaves.length+1)},0)+1;return 100/n}if(this.leaves){var r=100-this.container._width;return r/(this.leaves.length+1)}return this.row._width}},{key:"width",get:function(){var n=this._width,r=Math.min(100,this._width*1.7);if(this.rows)return r;if(this.leaves)return this.leaves.length>0?r:n;var a=this.row.leaves,o=a.indexOf(this);return o===a.length-1?n:r}},{key:"xOffset",get:function(){if(this.rows)return 0;if(this.leaves)return this.container._width;var n=this.row,r=n.leaves,a=n.xOffset,o=n._width,s=r.indexOf(this)+1;return a+s*o}}]),e}();function rG(e,t,n){return Math.abs(t.start-e.start)e.start&&t.start0;){var r=t.shift();n.push(r);for(var a=0;ao.startMs)){if(a>0){var s=t.splice(a,1)[0];n.push(s)}break}}}return n}function Hx(e){for(var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,a=e.accessors,o=t.map(function(p){return new nG(p,{slotMetrics:r,accessors:a})}),s=aG(o),u=[],d=function(){var g=s[m],w=u.find(function(T){return T.end>g.start||Math.abs(g.start-T.start)=0;S--)rG(w.rows[S],g,n)&&(D=w.rows[S]);D?(D.leaves.push(g),g.row=D):(g.leaves=[],w.rows.push(g))},m=0;m-1)){t=t>e.friends[r].idx?t:e.friends[r].idx,n.push(e.friends[r]);var a=Bx(e.friends[r],t,n);t=t>a?t:a}return t}function oG(e){var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,a=e.accessors,o=Hx({events:t,minimumStartDifference:n,slotMetrics:r,accessors:a});o.sort(function(ie,ge){return ie=ie.style,ge=ge.style,ie.top!==ge.top?ie.top>ge.top?1:-1:ie.height!==ge.height?ie.top+ie.height=m&&S<=p||S>m&&S<=p||D>=m&&Dce?K:ce}K<=W.idx&&(W.size=100-W.idx*W.size);var fe=W.idx===0?0:3;W.style.width="calc(".concat(W.size,"% - ").concat(fe,"px)"),W.style.height="calc(".concat(W.style.height,"% - 2px)"),W.style.xOffset="calc(".concat(W.style.left,"% + ").concat(fe,"px)")}return o}var f2={overlap:Hx,"no-overlap":oG};function iG(e){return!!(e&&e.constructor&&e.call&&e.apply)}function sG(e){e.events,e.minimumStartDifference,e.slotMetrics,e.accessors;var t=e.dayLayoutAlgorithm,n=t;return t in f2&&(n=f2[t]),iG(n)?n.apply(this,arguments):[]}var Yx=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){var r=this.props,a=r.renderSlot,o=r.resource,s=r.group,u=r.getters,d=r.components,m=d===void 0?{}:d,p=m.timeSlotWrapper,g=p===void 0?cs:p,w=u?u.slotGroupProp(s):{};return q.createElement("div",Object.assign({className:"rbc-timeslot-group"},w),s.map(function(D,S){var T=u?u.slotProp(D,o):{};return q.createElement(g,{key:S,value:D,resource:o},q.createElement("div",Object.assign({},T,{className:Qn("rbc-time-slot",T.className)}),a&&a(D,S)))}))}}]),t}(O.Component);function Og(e){return typeof e=="string"?e:e+"%"}function lG(e){var t=e.style,n=e.className,r=e.event,a=e.accessors,o=e.rtl,s=e.selected,u=e.label,d=e.continuesPrior,m=e.continuesAfter,p=e.getters,g=e.onClick,w=e.onDoubleClick,D=e.isBackgroundEvent,S=e.onKeyPress,T=e.components,E=T.event,A=T.eventWrapper,N=a.title(r),R=a.tooltip(r),F=a.end(r),H=a.start(r),P=p.eventProp(r,H,F,s),L=[q.createElement("div",{key:"1",className:"rbc-event-label"},u),q.createElement("div",{key:"2",className:"rbc-event-content"},E?q.createElement(E,{event:r,title:N}):N)],z=t.height,U=t.top,W=t.width,K=t.xOffset,ae=nn(nn({},P.style),{},Ic({top:Og(U),height:Og(z),width:Og(W)},o?"right":"left",Og(K)));return q.createElement(A,Object.assign({type:"time"},e),q.createElement("div",{role:"button",tabIndex:0,onClick:g,onDoubleClick:w,style:ae,onKeyDown:S,title:R?(typeof u=="string"?u+": ":"")+R:void 0,className:Qn(D?"rbc-background-event":"rbc-event",n,P.className,{"rbc-selected":s,"rbc-event-continues-earlier":d,"rbc-event-continues-later":m})},L))}var cG=function(t){var n=t.children,r=t.className,a=t.style,o=t.innerRef;return q.createElement("div",{className:r,style:a,ref:o},n)},uG=q.forwardRef(function(e,t){return q.createElement(cG,Object.assign({},e,{innerRef:t}))}),dG=["dayProp"],fG=["eventContainerWrapper"],zx=function(e){ta(t,e);function t(){var n;pr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o0&&arguments[0]!==void 0?arguments[0]:!1;!this.intervalTriggered&&!a&&this.positionTimeIndicator(),this._timeIndicatorTimeout=window.setTimeout(function(){r.intervalTriggered=!0,r.positionTimeIndicator(),r.setTimeIndicatorPositionUpdateInterval()},6e4)}},{key:"clearTimeIndicatorInterval",value:function(){this.intervalTriggered=!1,window.clearTimeout(this._timeIndicatorTimeout)}},{key:"positionTimeIndicator",value:function(){var r=this.props,a=r.min,o=r.max,s=r.getNow,u=s();if(u>=a&&u<=o){var d=this.slotMetrics.getCurrentTimePosition(u);this.intervalTriggered=!0,this.setState({timeIndicatorPosition:d})}else this.clearTimeIndicatorInterval()}},{key:"render",value:function(){var r=this.props,a=r.date,o=r.max,s=r.rtl,u=r.isNow,d=r.resource,m=r.accessors,p=r.localizer,g=r.getters,w=g.dayProp,D=Ai(g,dG),S=r.components,T=S.eventContainerWrapper,E=Ai(S,fG),A=this.slotMetrics,N=this.state,R=N.selecting,F=N.top,H=N.height,P=N.startDate,L=N.endDate,z={start:P,end:L},U=w(o),W=U.className,K=U.style,ae=E.dayColumnWrapper||uG;return q.createElement(ae,{ref:this.containerRef,date:a,style:K,className:Qn(W,"rbc-day-slot","rbc-time-column",u&&"rbc-now",u&&"rbc-today",R&&"rbc-slot-selecting"),slotMetrics:A},A.groups.map(function(ce,fe){return q.createElement(Yx,{key:fe,group:ce,resource:d,getters:D,components:E})}),q.createElement(T,{localizer:p,resource:d,accessors:m,getters:D,components:E,slotMetrics:A},q.createElement("div",{className:Qn("rbc-events-container",s&&"rtl")},this.renderEvents({events:this.props.backgroundEvents,isBackgroundEvent:!0}),this.renderEvents({events:this.props.events}))),R&&q.createElement("div",{className:"rbc-slot-selection",style:{top:F,height:H}},q.createElement("span",null,p.format(z,"selectRangeFormat"))),u&&this.intervalTriggered&&q.createElement("div",{className:"rbc-current-time-indicator",style:{top:"".concat(this.state.timeIndicatorPosition,"%")}}))}}]),t}(q.Component);zx.defaultProps={dragThroughEvents:!0,timeslots:2};function hG(e){var t=e.min,n=e.max,r=e.localizer;return r.getTimezoneOffset(t)!==r.getTimezoneOffset(n)?{start:r.add(t,-1,"day"),end:r.add(n,-1,"day")}:{start:t,end:n}}var mG=function(t){var n=t.min,r=t.max,a=t.timeslots,o=t.step,s=t.localizer,u=t.getNow,d=t.resource,m=t.components,p=t.getters,g=t.gutterRef,w=m.timeGutterWrapper,D=O.useMemo(function(){return hG({min:n,max:r,localizer:s})},[n==null?void 0:n.toISOString(),r==null?void 0:r.toISOString(),s]),S=D.start,T=D.end,E=O.useState(rb({min:S,max:T,timeslots:a,step:o,localizer:s})),A=us(E,2),N=A[0],R=A[1];O.useEffect(function(){N&&R(N.update({min:S,max:T,timeslots:a,step:o,localizer:s}))},[S==null?void 0:S.toISOString(),T==null?void 0:T.toISOString(),a,o]);var F=O.useCallback(function(H,P){if(P)return null;var L=N.dateIsInGroup(u(),P);return q.createElement("span",{className:Qn("rbc-label",L&&"rbc-now")},s.format(H,"timeGutterFormat"))},[N,s,u]);return q.createElement(w,{slotMetrics:N},q.createElement("div",{className:"rbc-time-gutter rbc-time-column",ref:g},N.groups.map(function(H,P){return q.createElement(Yx,{key:P,group:H,resource:d,components:m,renderSlot:F,getters:p})})))},pG=q.forwardRef(function(e,t){return q.createElement(mG,Object.assign({gutterRef:t},e))}),gG=function(t){var n=t.label;return q.createElement(q.Fragment,null,n)},vG=function(e){ta(t,e);function t(){var n;pr(this,t);for(var r=arguments.length,a=new Array(r),o=0;oa.clientHeight;r.state.isOverflowing!==o&&(r._updatingOverflow=!0,r.setState({isOverflowing:o},function(){r._updatingOverflow=!1}))}}},r.memoizedResources=sx(function(a,o){return yG(a,o)}),r.state={gutterWidth:void 0,isOverflowing:null},r.scrollRef=q.createRef(),r.contentRef=q.createRef(),r.containerRef=q.createRef(),r._scrollRatio=null,r.gutterRef=O.createRef(),r}return gr(t,[{key:"getSnapshotBeforeUpdate",value:function(){return this.checkOverflow(),null}},{key:"componentDidMount",value:function(){this.props.width==null&&this.measureGutter(),this.calculateScroll(),this.applyScroll(),window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize),iS(this.rafHandle),this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest)}},{key:"componentDidUpdate",value:function(){this.applyScroll()}},{key:"renderEvents",value:function(r,a,o,s){var u=this,d=this.props,m=d.min,p=d.max,g=d.components,w=d.accessors,D=d.localizer,S=d.dayLayoutAlgorithm,T=this.memoizedResources(this.props.resources,w),E=T.groupEvents(a),A=T.groupEvents(o);return T.map(function(N,R){var F=us(N,2),H=F[0],P=F[1];return r.map(function(L,z){var U=(E.get(H)||[]).filter(function(K){return D.inRange(L,w.start(K),w.end(K),"day")}),W=(A.get(H)||[]).filter(function(K){return D.inRange(L,w.start(K),w.end(K),"day")});return q.createElement(zx,Object.assign({},u.props,{localizer:D,min:D.merge(L,m),max:D.merge(L,p),resource:P&&H,components:g,isNow:D.isSameDate(L,s),key:R+"-"+z,date:L,events:U,backgroundEvents:W,dayLayoutAlgorithm:S}))})})}},{key:"render",value:function(){var r,a=this.props,o=a.events,s=a.backgroundEvents,u=a.range,d=a.width,m=a.rtl,p=a.selected,g=a.getNow,w=a.resources,D=a.components,S=a.accessors,T=a.getters,E=a.localizer,A=a.min,N=a.max,R=a.showMultiDayTimes,F=a.longPressThreshold,H=a.resizable;d=d||this.state.gutterWidth;var P=u[0],L=u[u.length-1];this.slots=u.length;var z=[],U=[],W=[];return o.forEach(function(K){if(fm(K,P,L,S,E)){var ae=S.start(K),ce=S.end(K);S.allDay(K)||E.startAndEndAreDateOnly(ae,ce)||!R&&!E.isSameDate(ae,ce)?z.push(K):U.push(K)}}),s.forEach(function(K){fm(K,P,L,S,E)&&W.push(K)}),z.sort(function(K,ae){return Vw(K,ae,S,E)}),q.createElement("div",{className:Qn("rbc-time-view",w&&"rbc-time-view-resources"),ref:this.containerRef},q.createElement(vG,{range:u,events:z,width:d,rtl:m,getNow:g,localizer:E,selected:p,allDayMaxRows:this.props.showAllEvents?1/0:(r=this.props.allDayMaxRows)!==null&&r!==void 0?r:1/0,resources:this.memoizedResources(w,S),selectable:this.props.selectable,accessors:S,getters:T,components:D,scrollRef:this.scrollRef,isOverflowing:this.state.isOverflowing,longPressThreshold:F,onSelectSlot:this.handleSelectAllDaySlot,onSelectEvent:this.handleSelectEvent,onShowMore:this.handleShowMore,onDoubleClickEvent:this.props.onDoubleClickEvent,onKeyPressEvent:this.props.onKeyPressEvent,onDrillDown:this.props.onDrillDown,getDrilldownView:this.props.getDrilldownView,resizable:H}),this.props.popup&&this.renderOverlay(),q.createElement("div",{ref:this.contentRef,className:"rbc-time-content",onScroll:this.handleScroll},q.createElement(pG,{date:P,ref:this.gutterRef,localizer:E,min:E.merge(P,A),max:E.merge(P,N),step:this.props.step,getNow:this.props.getNow,timeslots:this.props.timeslots,components:D,className:"rbc-time-gutter",getters:T}),this.renderEvents(u,U,W,g())))}},{key:"renderOverlay",value:function(){var r,a,o=this,s=(r=(a=this.state)===null||a===void 0?void 0:a.overlay)!==null&&r!==void 0?r:{},u=this.props,d=u.accessors,m=u.localizer,p=u.components,g=u.getters,w=u.selected,D=u.popupOffset,S=u.handleDragStart,T=function(){return o.setState({overlay:null})};return q.createElement(nb,{overlay:s,accessors:d,localizer:m,components:p,getters:g,selected:w,popupOffset:D,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:S,show:!!s.position,overlayDisplay:this.overlayDisplay,onHide:T})}},{key:"clearSelection",value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}},{key:"measureGutter",value:function(){var r=this;this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest),this.measureGutterAnimationFrameRequest=window.requestAnimationFrame(function(){var a,o=(a=r.gutterRef)!==null&&a!==void 0&&a.current?zw(r.gutterRef.current):void 0;o&&r.state.gutterWidth!==o&&r.setState({gutterWidth:o})})}},{key:"applyScroll",value:function(){if(this._scrollRatio!=null&&this.props.enableAutoScroll===!0){var r=this.contentRef.current;r.scrollTop=r.scrollHeight*this._scrollRatio,this._scrollRatio=null}}},{key:"calculateScroll",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,a=r.min,o=r.max,s=r.scrollToTime,u=r.localizer,d=u.diff(u.merge(s,a),s,"milliseconds"),m=u.diff(a,o,"milliseconds");this._scrollRatio=d/m}}]),t}(O.Component);af.defaultProps={step:30,timeslots:2};var wG=["date","localizer","min","max","scrollToTime","enableAutoScroll"],cy=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,s=r.min,u=s===void 0?o.startOf(new Date,"day"):s,d=r.max,m=d===void 0?o.endOf(new Date,"day"):d,p=r.scrollToTime,g=p===void 0?o.startOf(new Date,"day"):p,w=r.enableAutoScroll,D=w===void 0?!0:w,S=Ai(r,wG),T=t.range(a,{localizer:o});return q.createElement(af,Object.assign({},S,{range:T,eventOffset:10,localizer:o,min:u,max:m,scrollToTime:g,enableAutoScroll:D}))}}]),t}(q.Component);cy.range=function(e,t){var n=t.localizer;return[n.startOf(e,"day")]};cy.navigate=function(e,t,n){var r=n.localizer;switch(t){case Da.PREVIOUS:return r.add(e,-1,"day");case Da.NEXT:return r.add(e,1,"day");default:return e}};cy.title=function(e,t){var n=t.localizer;return n.format(e,"dayHeaderFormat")};var bG=["date","localizer","min","max","scrollToTime","enableAutoScroll"],wl=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,s=r.min,u=s===void 0?o.startOf(new Date,"day"):s,d=r.max,m=d===void 0?o.endOf(new Date,"day"):d,p=r.scrollToTime,g=p===void 0?o.startOf(new Date,"day"):p,w=r.enableAutoScroll,D=w===void 0?!0:w,S=Ai(r,bG),T=t.range(a,this.props);return q.createElement(af,Object.assign({},S,{range:T,eventOffset:15,localizer:o,min:u,max:m,scrollToTime:g,enableAutoScroll:D}))}}]),t}(q.Component);wl.defaultProps=af.defaultProps;wl.navigate=function(e,t,n){var r=n.localizer;switch(t){case Da.PREVIOUS:return r.add(e,-1,"week");case Da.NEXT:return r.add(e,1,"week");default:return e}};wl.range=function(e,t){var n=t.localizer,r=n.startOfWeek(),a=n.startOf(e,"week",r),o=n.endOf(e,"week",r);return n.range(a,o)};wl.title=function(e,t){var n=t.localizer,r=wl.range(e,{localizer:n}),a=mx(r),o=a[0],s=a.slice(1);return n.format({start:o,end:s.pop()},"dayRangeHeaderFormat")};var DG=["date","localizer","min","max","scrollToTime","enableAutoScroll"];function ab(e,t){return wl.range(e,t).filter(function(n){return[6,0].indexOf(n.getDay())===-1})}var zm=function(e){ta(t,e);function t(){return pr(this,t),ea(this,t,arguments)}return gr(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,s=r.min,u=s===void 0?o.startOf(new Date,"day"):s,d=r.max,m=d===void 0?o.endOf(new Date,"day"):d,p=r.scrollToTime,g=p===void 0?o.startOf(new Date,"day"):p,w=r.enableAutoScroll,D=w===void 0?!0:w,S=Ai(r,DG),T=ab(a,this.props);return q.createElement(af,Object.assign({},S,{range:T,eventOffset:15,localizer:o,min:u,max:m,scrollToTime:g,enableAutoScroll:D}))}}]),t}(q.Component);zm.defaultProps=af.defaultProps;zm.range=ab;zm.navigate=wl.navigate;zm.title=function(e,t){var n=t.localizer,r=ab(e,{localizer:n}),a=mx(r),o=a[0],s=a.slice(1);return n.format({start:o,end:s.pop()},"dayRangeHeaderFormat")};function bl(e){var t=e.accessors,n=e.components,r=e.date,a=e.events,o=e.getters,s=e.length,u=e.localizer,d=e.onDoubleClickEvent,m=e.onSelectEvent,p=e.selected,g=O.useRef(null),w=O.useRef(null),D=O.useRef(null),S=O.useRef(null),T=O.useRef(null);O.useEffect(function(){N()});var E=function(L,z,U){var W=n.event,K=n.date;return z=z.filter(function(ae){return fm(ae,u.startOf(L,"day"),u.endOf(L,"day"),t,u)}),z.map(function(ae,ce){var fe=t.title(ae),ie=t.end(ae),ge=t.start(ae),Te=o.eventProp(ae,ge,ie,sy(ae,p)),se=ce===0&&u.format(L,"agendaDateFormat"),we=ce===0?q.createElement("td",{rowSpan:z.length,className:"rbc-agenda-date-cell"},K?q.createElement(K,{day:L,label:se}):se):!1;return q.createElement("tr",{key:U+"_"+ce,className:Te.className,style:Te.style},we,q.createElement("td",{className:"rbc-agenda-time-cell"},A(L,ae)),q.createElement("td",{className:"rbc-agenda-event-cell",onClick:function($){return m&&m(ae,$)},onDoubleClick:function($){return d&&d(ae,$)}},W?q.createElement(W,{event:ae,title:fe}):fe))},[])},A=function(L,z){var U="",W=n.time,K=u.messages.allDay,ae=t.end(z),ce=t.start(z);return t.allDay(z)||(u.eq(ce,ae)?K=u.format(ce,"agendaTimeFormat"):u.isSameDate(ce,ae)?K=u.format({start:ce,end:ae},"agendaTimeRangeFormat"):u.isSameDate(L,ce)?K=u.format(ce,"agendaTimeFormat"):u.isSameDate(L,ae)&&(K=u.format(ae,"agendaTimeFormat"))),u.gt(L,ce,"day")&&(U="rbc-continues-prior"),u.lt(L,ae,"day")&&(U+=" rbc-continues-after"),q.createElement("span",{className:U.trim()},W?q.createElement(W,{event:z,day:L,label:K}):K)},N=function(){if(T.current){var L=g.current,z=T.current.firstChild;if(z){var U=S.current.scrollHeight>S.current.clientHeight,W=[],K=W;W=[zw(z.children[0]),zw(z.children[1])],(K[0]!==W[0]||K[1]!==W[1])&&(w.current.style.width=W[0]+"px",D.current.style.width=W[1]+"px"),U?(D7(L,"rbc-header-overflowing"),L.style.marginRight=VE()+"px"):S7(L,"rbc-header-overflowing")}}},R=u.messages,F=u.add(r,s,"day"),H=u.range(r,F,"day");return a=a.filter(function(P){return fm(P,u.startOf(r,"day"),u.endOf(F,"day"),t,u)}),a.sort(function(P,L){return+t.start(P)-+t.start(L)}),q.createElement("div",{className:"rbc-agenda-view"},a.length!==0?q.createElement(q.Fragment,null,q.createElement("table",{ref:g,className:"rbc-agenda-table"},q.createElement("thead",null,q.createElement("tr",null,q.createElement("th",{className:"rbc-header",ref:w},R.date),q.createElement("th",{className:"rbc-header",ref:D},R.time),q.createElement("th",{className:"rbc-header"},R.event)))),q.createElement("div",{className:"rbc-agenda-content",ref:S},q.createElement("table",{className:"rbc-agenda-table"},q.createElement("tbody",{ref:T},H.map(function(P,L){return E(P,a,L)}))))):q.createElement("span",{className:"rbc-agenda-empty"},R.noEventsInRange))}bl.defaultProps={length:30};bl.range=function(e,t){var n=t.length,r=n===void 0?bl.defaultProps.length:n,a=t.localizer,o=a.add(e,r,"day");return{start:e,end:o}};bl.navigate=function(e,t,n){var r=n.length,a=r===void 0?bl.defaultProps.length:r,o=n.localizer;switch(t){case Da.PREVIOUS:return o.add(e,-a,"day");case Da.NEXT:return o.add(e,a,"day");default:return e}};bl.title=function(e,t){var n=t.length,r=n===void 0?bl.defaultProps.length:n,a=t.localizer,o=a.add(e,r,"day");return a.format({start:e,end:o},"agendaHeaderFormat")};var Qg=Ic(Ic(Ic(Ic(Ic({},Qr.MONTH,ly),Qr.WEEK,wl),Qr.WORK_WEEK,zm),Qr.DAY,cy),Qr.AGENDA,bl),SG=["action","date","today"];function IG(e,t){var n=t.action,r=t.date,a=t.today,o=Ai(t,SG);switch(e=typeof e=="string"?Qg[e]:e,n){case Da.TODAY:r=a||new Date;break;case Da.DATE:break;default:nm(e&&typeof e.navigate=="function","Calendar View components must implement a static `.navigate(date, action)` method.s"),r=e.navigate(r,n,o)}return r}var TG=function(e){ta(t,e);function t(){var n;pr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o1)return o.map(function(u){return q.createElement("button",{type:"button",key:u,className:Qn({"rbc-active":s===u}),onClick:a.view.bind(null,u)},r[u])})}}]),t}(q.Component);function EG(e,t){var n=null;return typeof t=="function"?n=t(e):typeof t=="string"&&ps(e)==="object"&&e!=null&&t in e&&(n=e[t]),n}var dl=function(t){return function(n){return EG(n,t)}},xG=["view","date","getNow","onNavigate"],CG=["view","toolbar","events","backgroundEvents","style","className","elementProps","date","getNow","length","showMultiDayTimes","onShowMore","doShowMoreDrillDown","components","formats","messages","culture"];function Ux(e){if(Array.isArray(e))return e;for(var t=[],n=0,r=Object.entries(e);n0&&arguments[0]!==void 0?arguments[0]:null,X=arguments.length>1?arguments[1]:void 0,ve=fl(X);return ve?e($).startOf(ve).toDate():e($).toDate()}function u(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,X=arguments.length>1?arguments[1]:void 0,ve=fl(X);return ve?e($).endOf(ve).toDate():e($).toDate()}function d($,X,ve){var De=o($,X,ve),be=us(De,3),ke=be[0],Be=be[1],_e=be[2];return ke.isSame(Be,_e)}function m($,X,ve){return!d($,X,ve)}function p($,X,ve){var De=o($,X,ve),be=us(De,3),ke=be[0],Be=be[1],_e=be[2];return ke.isAfter(Be,_e)}function g($,X,ve){var De=o($,X,ve),be=us(De,3),ke=be[0],Be=be[1],_e=be[2];return ke.isBefore(Be,_e)}function w($,X,ve){var De=o($,X,ve),be=us(De,3),ke=be[0],Be=be[1],_e=be[2];return ke.isSameOrBefore(Be,_e)}function D($,X,ve){var De=o($,X,ve),be=us(De,3),ke=be[0],Be=be[1],_e=be[2];return ke.isSameOrBefore(Be,_e)}function S($,X,ve){var De=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"day",be=fl(De),ke=e($),Be=e(X),_e=e(ve);return ke.isBetween(Be,_e,be,"[]")}function T($,X){var ve=e($),De=e(X),be=e.min(ve,De);return be.toDate()}function E($,X){var ve=e($),De=e(X),be=e.max(ve,De);return be.toDate()}function A($,X){if(!$&&!X)return null;var ve=e(X).format("HH:mm:ss"),De=e($).startOf("day").format("MM/DD/YYYY");return e("".concat(De," ").concat(ve),"MM/DD/YYYY HH:mm:ss").toDate()}function N($,X,ve){var De=fl(ve);return e($).add(X,De).toDate()}function R($,X){for(var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",De=fl(ve),be=e($).toDate(),ke=[];D(be,X);)ke.push(be),be=N(be,1,De);return ke}function F($,X){var ve=fl(X),De=s($,ve);return d(De,$)?De:N(De,1,ve)}function H($,X){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",De=fl(ve),be=e($),ke=e(X);return ke.diff(be,De)}function P($){var X=e($);return X.minutes()}function L($){var X=$?e.localeData($):e.localeData();return X?X.firstDayOfWeek():0}function z($){return e($).startOf("month").startOf("week").toDate()}function U($){return e($).endOf("month").endOf("week").toDate()}function W($){for(var X=z($),ve=U($),De=[];D(X,ve);)De.push(X),X=N(X,1,"d");return De}function K($,X,ve){return e($).startOf("day").minute(X+ve).toDate()}function ae($,X){return H($,X,"minutes")}function ce($){var X=e($).startOf("day"),ve=e($);return ve.diff(X,"minutes")+a($)}function fe($,X){var ve=e($),De=e(X);return ve.isBefore(De,"day")}function ie($,X,ve){var De=e(X),be=e(ve);return De.isSameOrAfter(be,"minutes")}function ge($,X){var ve=e($),De=e(X),be=e.duration(De.diff(ve));return be.days()}function Te($){var X=$.evtA,ve=X.start,De=X.end,be=X.allDay,ke=$.evtB,Be=ke.start,_e=ke.end,it=ke.allDay,Vt=+s(ve,"day")-+s(Be,"day"),Se=ge(ve,De),Ue=ge(Be,_e);return Vt||Ue-Se||!!it-!!be||+ve-+Be||+De-+_e}function se($){var X=$.event,ve=X.start,De=X.end,be=$.range,ke=be.start,Be=be.end,_e=e(ve).startOf("day"),it=e(De),Vt=e(ke),Se=e(Be),Ue=_e.isSameOrBefore(Se,"day"),Je=!_e.isSame(it,"minutes"),$e=Je?it.isAfter(Vt,"minutes"):it.isSameOrAfter(Vt,"minutes");return Ue&&$e}function we($,X){var ve=e($),De=e(X);return ve.isSame(De,"day")}function Z(){var $=new Date,X=/-/.test($.toString())?"-":"",ve=$.getTimezoneOffset(),De=Number("".concat(X).concat(Math.abs(ve))),be=e().utcOffset();return be>De?1:0}return new N$({formats:PG,firstOfWeek:L,firstVisibleDay:z,lastVisibleDay:U,visibleDays:W,format:function(X,ve,De){return t(e(X),De).format(ve)},lt:g,lte:D,gt:p,gte:w,eq:d,neq:m,merge:A,inRange:S,startOf:s,endOf:u,range:R,add:N,diff:H,ceil:F,min:T,max:E,minutes:P,getSlotDate:K,getTimezoneOffset:n,getDstOffset:r,getTotalMin:ae,getMinutesFromMidnight:ce,continuesPrior:fe,continuesAfter:ie,sortEvents:Te,inEventRange:se,isSameDate:we,daySpan:ge,browserTZOffset:Z})}function h2(e,t,n,r,a){const o={start:r.start(e),end:r.end(e)},s={start:t,end:n};return a.inEventRange({event:o,range:s})}function LG(e,t){return!e||t==null?!1:EI.isEqual(e,t)}const Td={PREVIOUS:"PREV",NEXT:"NEXT",TODAY:"TODAY",DATE:"DATE"};function gs({accessors:e,components:t,date:n,events:r,getters:a,length:o,localizer:s,onDoubleClickEvent:u,onSelectEvent:d,selected:m}){O.useRef(null);const p=O.useRef(null),g=O.useRef(null),w=O.useRef(null),D=O.useRef(null),[S,T]=O.useState(!1),[E,A]=O.useState(!1),N=(W,K,ae)=>{const{event:ce,date:fe}=t;return K=K.filter(ie=>h2(ie,s.startOf(W,"day"),s.endOf(W,"day"),e,s)),K.map((ie,ge)=>{const Te=e.title(ie),se=e.end(ie),we=e.start(ie),Z=a.eventProp(ie,we,se,LG(ie,m)),$=ge===0&&s.format(W,"agendaDateFormat"),X=ge===0?y.jsx("td",{rowSpan:K.length,className:"rbc-agenda-date-cell",children:fe?y.jsx(fe,{day:W,label:$}):$}):!1;return y.jsxs("tr",{className:Z.className,style:Z.style,children:[X,y.jsx("td",{className:"rbc-agenda-time-cell",children:R(W,ie)}),y.jsx("td",{className:"rbc-agenda-event-cell",onClick:ve=>d&&d(ie,ve),onDoubleClick:ve=>u&&u(ie,ve),children:ce?y.jsx(ce,{event:ie,title:Te}):Te})]},ae+"_"+ge)},[])},R=(W,K)=>{const ae=t.time;let ce="",fe=s.messages.allDay;const ie=e.end(K),ge=e.start(K);return e.allDay(K)||(s.eq(ge,ie)?fe=s.format(ge,"agendaTimeFormat"):s.isSameDate(ge,ie)?fe=s.format({start:ge,end:ie},"agendaTimeRangeFormat"):s.isSameDate(W,ge)?fe=s.format(ge,"agendaTimeFormat"):s.isSameDate(W,ie)&&(fe=s.format(ie,"agendaTimeFormat"))),s.gt(W,ge,"day")&&(ce="rbc-continues-prior"),s.lt(W,ie,"day")&&(ce+=" rbc-continues-after"),y.jsx("span",{className:ce.trim(),children:ae?y.jsx(ae,{event:K,day:W,label:fe}):fe})},{messages:F}=s,H=s.add(n,-o/2,"day"),P=s.add(n,o/2,"day"),L=s.range(H,P,"day");S&&L.reverse(),r=r.filter(W=>h2(W,s.startOf(H,"day"),s.endOf(P,"day"),e,s)),r.sort((W,K)=>+e.start(W)-+e.start(K)),E&&r.reverse();const z=O.useCallback(()=>setTimeout(()=>{D.current&&Uv(D.current,{backgroundColor:"#ffffff",pixelRatio:window.devicePixelRatio*2}).then(W=>{new x.Notice(k("Image is generating..."));const K=rt.getState().settings.AutoSaveWhenOnMobile,ae=rt.getState().app.vault;if(K&&x.Platform.isMobile){const ce=W.split("base64,")[1];Av(ce,"image/png").arrayBuffer().then(async ie=>{let ge;const Te="png",se=ws();for(const we in se)if(se[we]instanceof x.TFile){ge=se[we];break}ge!==void 0&&await ae.createBinary(await ae.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,Te,ge),ie)})}Vv({imgUrl:W})}).catch(W=>{console.error(W)})},0),[D.current,L]),U=O.useCallback(W=>{const K=new x.Menu;K.addItem(ae=>{ae.setIcon("share-2").setTitle(k("Share")).onClick(()=>{z()})}),K.showAtMouseEvent(W.nativeEvent)},[D.current,L,z]);return y.jsx("div",{className:"rbc-agenda-view",children:r.length!==0?y.jsx(q.Fragment,{children:y.jsxs("table",{ref:D,className:"rbc-agenda-table",children:[y.jsx("thead",{onContextMenu:U,children:y.jsxs("tr",{children:[y.jsx("th",{className:"rbc-header",ref:p,onClick:()=>{T(!S)},children:F.date+(S?" 🔼":" 🔽")}),y.jsx("th",{className:"rbc-header",ref:g,onClick:()=>{A(!E)},children:F.time+(E?" 🔼":" 🔽")}),y.jsx("th",{className:"rbc-header",children:F.event})]})}),y.jsx("tbody",{ref:w,children:L.map((W,K)=>N(W,r,K))})]})}):y.jsx("span",{className:"rbc-agenda-empty",children:F.noEventsInRange})})}gs.propTypes={accessors:Ae.object.isRequired,components:Ae.object.isRequired,date:Ae.instanceOf(Date),events:Ae.array,getters:Ae.object.isRequired,length:Ae.number.isRequired,localizer:Ae.object.isRequired,onSelectEvent:Ae.func,onDoubleClickEvent:Ae.func,selected:Ae.object};gs.defaultProps={length:30};gs.range=(e,{length:t=gs.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),a=n.add(e,t/2,"day");return{customStart:r,customEnd:a}};gs.navigate=(e,t,{length:n=gs.defaultProps.length,localizer:r})=>{switch(t){case Td.PREVIOUS:return r.add(e,-n,"day");case Td.NEXT:return r.add(e,n,"day");default:return e}};gs.title=(e,{length:t=gs.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),a=n.add(e,t/2,"day");return n.format({start:r,end:a},"agendaHeaderFormat")};function RG(e,t){e.hoverEl.toggleClass("thino-hover-popover",!0);const n=Lv(e.hoverEl);return n.render(y.jsx(Sl,{store:Ee,context:wt,children:y.jsx(Ua,{memo:t})})),n}function _G({event:e}){const t=e.resource,n=t.content.split(` `)[0].slice(0,20),r=q.useRef(null),a=q.useRef(null),o=q.useRef(null);O.useEffect(()=>{if(a.current)return x.setIcon(a.current,"calendar"),()=>{r.current&&(r.current=null)}},[r]);const s=O.useCallback(d=>{o.current&&(o.current.unmount(),o.current=null),o.current=d},[]),u=O.useCallback(d=>{if(!r.current||!x.Keymap.isModifier(d.nativeEvent,"Mod"))return;const m=new x.HoverPopover(rt.getState().view,r.current,100),p=RG(m,t);s(p)},[r.current]);return y.jsxs("span",{className:"rbc-event-renderer","data-source-type":t.sourceType,"data-thino-type":t.thinoType,"data-thino-id":t.id,ref:r,"aria-label":t.path,onMouseOver:u,children:[y.jsx(HG,{event:e}),y.jsx("strong",{children:n})]})}const HG=({event:e})=>{const t=q.useRef(null),n=e.resource;O.useEffect(()=>{t.current&&x.setIcon(t.current,n.thinoType==="JOURNAL"?"calendar":n.thinoType==="TASK-TODO"?"square":"check-square")},[n==null?void 0:n.thinoType,t]);const r=O.useCallback(async a=>{a.stopPropagation(),a.preventDefault(),await(async()=>{const s=await Ie.updateMemo(n.id,n.content,n.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");s&&Ie.editMemo(s)})()},[n==null?void 0:n.thinoType,n==null?void 0:n.id,n==null?void 0:n.content]);return y.jsx(y.Fragment,{children:y.jsxs("span",{className:"rbc-event-icon-group",children:[y.jsx("span",{className:"rbc-event-icon",ref:t,onClick:r}),y.jsx("span",{className:mr("rbc-event-time","hidden"),children:y.jsx("span",{className:"rbc-event-time-text",children:x.moment(e.start).format("HH:mm")})})]})})};function Zx({views:e,view:t,messages:n,onView:r}){return e.map(a=>y.jsx("button",{type:"button",className:mr({"rbc-active":t===a}),onClick:()=>r(a),children:n[a]},a))}Zx.propTypes={messages:Ae.object,onView:Ae.func,view:Ae.string,views:Ae.array};function Wx({date:e,label:t,localizer:{messages:n},onNavigate:r,onView:a,view:o,views:s}){const u={previous:O.useRef(null),today:O.useRef(null),next:O.useRef(null)};O.useEffect(()=>{u&&(x.setIcon(u.previous.current,"chevron-left"),x.setIcon(u.today.current,"dot"),x.setIcon(u.next.current,"chevron-right"))},[u]);const d=O.useMemo(()=>y.jsxs(y.Fragment,{children:[y.jsx("button",{ref:u.previous,type:"button",onClick:()=>r(Td.PREVIOUS),"aria-label":n.previous,children:"<"}),y.jsx("button",{ref:u.today,type:"button",onClick:()=>r(Td.TODAY),"aria-label":n.today,children:"•"}),y.jsx("button",{ref:u.next,type:"button",onClick:()=>r(Td.NEXT),"aria-label":n.next,children:">"})]}),[n]);return y.jsxs("div",{className:"rbc-toolbar",children:[y.jsx("span",{className:mr("rbc-btn-group","thino-view-custom-toolbar"),children:d}),y.jsx("span",{className:"rbc-toolbar-label",children:y.jsx(dv,{type:"text",handleValueChange:m=>{r(Td.DATE,x.moment(m,"YYYY-MM-DD").format("YYYY-MM-DDTHH:mm:ssZ"))},defaultText:t+(o==="week"?x.moment(e.valueOf(),"x").format(" [W]WW"):""),defaultValue:x.moment(e.valueOf(),"x").valueOf()})}),y.jsx("span",{className:"rbc-btn-group",children:y.jsx(Zx,{view:o,views:s,messages:n,onView:a})})]})}Wx.propTypes={date:Ae.instanceOf(Date),label:Ae.string,localizer:Ae.object,messages:Ae.object,onNavigate:Ae.func,onView:Ae.func,view:Ae.string,views:Ae.array};function BG({event:e,children:t,showPopup:n,callRender:r,...a}){const o=O.useRef(null),s=O.useRef(null),u=O.useCallback(d=>{if(!d.isTrusted){r();return}s.current=d.nativeEvent.target,s.current&&(s.current.hasClass("rbc-event")||(s.current=s.current.closest(".rbc-event")),o.current!==null?(window.clearTimeout(o.current),o.current=null):o.current=window.setTimeout(()=>{n(e,s.current),o.current=null},250))},[e,n]);return y.jsx(y.Fragment,{children:y.jsx("div",{className:"rbc-event-wrapper","aria-describedby":"thino",onClick:u,children:t})})}const YG=jG(x.moment),zG=({event:e})=>{const t=e.resource;return y.jsx(y.Fragment,{children:y.jsx(Ua,{memo:t})})},UG=e=>{var ae;const{thinos:t}=e,[n,r]=q.useState([]),[a,o]=q.useState((app==null?void 0:app.loadLocalStorage("thino-calendar-view"))||"month"),[s,u]=q.useState(null),d=q.useRef(null),m=q.useRef(null),[p,g]=q.useState(!1),w=O.useRef(null),[D,S]=O.useState(new Date);O.useEffect(()=>()=>{d.current&&(d.current=null),m.current&&(m.current=null),w.current&&(w.current=null)},[]),O.useEffect(()=>{const ce=t.map(fe=>{const ie=x.moment(fe.createdAt,"YYYY/MM/DD HH:mm:ss"),ge=ie.clone().add(1,"minute");return{title:fe.content,start:new Date(ie.format("YYYY-MM-DDTHH:mm:ss")),end:new Date(ge.format("YYYY-MM-DDTHH:mm:ss")),resource:fe}});r(ce)},[t]),O.useEffect(()=>{app==null||app.saveLocalStorage("thino-calendar-view",a)},[a]),O.useEffect(()=>{p&&u(t.find(ce=>ce.id===s.id))},[t]),O.useEffect(()=>{s&&w.current.update()},[s]),w.current=zv(d.current,m.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,4]}}]});const T=O.useCallback(()=>{w.current.update(),w.current.update()},[]),E=O.useCallback((ce,fe)=>{u(null),F(),w.current.state.elements.reference=fe,u(ce.resource),H()},[]),A=O.useCallback(()=>{F(),u(null)},[]),N=O.useCallback((ce,fe,ie)=>{var ge;if(R(ce),fe==="week"||fe==="day"){const Te=d.current.find(".rbc-event-wrapper");if(d.current.closest(".memolist-wrapper"),Te){(ge=Te.children[0])==null||ge.click();return}else{setTimeout(()=>{var we,Z;const se=d.current.find(".rbc-event-wrapper");(Z=(we=se==null?void 0:se.children)==null?void 0:we[0])==null||Z.click()},0);return}}},[]),R=O.useCallback(ce=>{S(ce)},[S]);Mm(m,A);const F=O.useCallback(()=>{g(!1)},[g]),H=O.useCallback(()=>{w.current.update(),g(!0)},[g]),P=O.useCallback(ce=>{const fe=ce.resource;Qe.setEditMemoId(fe.id)},[]),L=O.useCallback(ce=>{o(ce)},[o]),{components:z,views:U,messages:W}=O.useMemo(()=>({components:{toolbar:Wx,eventWrapper:ce=>y.jsx(BG,{...ce,callRender:T,showPopup:E}),agenda:{event:zG},event:_G},views:{month:!0,agenda:gs,week:!0,day:!0},messages:{month:k("Month"),day:k("Day"),next:k("Next"),previous:k("Previous"),today:k("Today"),agenda:k("Agenda"),week:k("Week"),yesterday:k("Yesterday"),tomorrow:k("Tomorrow"),noEventsInRange:k("No thinos in range"),date:k("date"),time:k("time"),event:k("event")}}),[]),K=O.useMemo(()=>({timeGutterFormat:(ce,fe,ie)=>ie.format(ce,"HH:mm",fe),agendaTimeRangeFormat:({start:ce,end:fe},ie,ge)=>ge.format(ce,"HH:mm",ie)+" — "+ge.format(fe,"HH:mm",ie),agendaHeaderFormat:({start:ce,end:fe},ie,ge)=>ge.format(ce,"YYYY-MM-DD")+" — "+ge.format(fe,"YYYY-MM-DD")}),[]);return y.jsxs("div",{ref:d,className:"calendar-view",children:[y.jsx(NG,{date:D,messages:W,components:z,localizer:YG,events:n,views:U,onView:L,onDoubleClickEvent:P,onNavigate:N,formats:K,defaultView:a,tooltipAccessor:null,startAccessor:"start",endAccessor:"end"}),y.jsx("div",{ref:m,style:(ae=w.current)==null?void 0:ae.styles.popper,className:mr("thino-popup-container",p?"":"hidden"),children:s&&y.jsx(Ua,{memo:s})})]})};function vl(e,t){return typeof e=="function"?e(t):e}function Va(e,t){return n=>{t.setState(r=>({...r,[e]:vl(n,r[e])}))}}function Ev(e){return e instanceof Function}function VG(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ZG(e,t){const n=[],r=a=>{a.forEach(o=>{n.push(o);const s=t(o);s!=null&&s.length&&r(s)})};return r(e),n}function ht(e,t,n){let r=[],a;return o=>{let s;n.key&&n.debug&&(s=Date.now());const u=e(o);if(!(u.length!==r.length||u.some((p,g)=>r[g]!==p)))return a;r=u;let m;if(n.key&&n.debug&&(m=Date.now()),a=t(...u),n==null||n.onChange==null||n.onChange(a),n.key&&n.debug&&n!=null&&n.debug()){const p=Math.round((Date.now()-s)*100)/100,w=Math.round((Date.now()-m)*100)/100/16,D=(S,T)=>{for(S=String(S);S.length{var a;return(a=e==null?void 0:e.debugAll)!=null?a:e[t]},key:!1,onChange:r}}function WG(e,t,n,r){var a,o;const u={...e._getDefaultColumnDef(),...t},d=u.accessorKey;let m=(a=(o=u.id)!=null?o:d?d.replace(".","_"):void 0)!=null?a:typeof u.header=="string"?u.header:void 0,p;if(u.accessorFn?p=u.accessorFn:d&&(d.includes(".")?p=w=>{let D=w;for(const T of d.split(".")){var S;D=(S=D)==null?void 0:S[T]}return D}:p=w=>w[u.accessorKey]),!m)throw new Error;let g={id:`${String(m)}`,accessorFn:p,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:ht(()=>[!0],()=>{var w;return[g,...(w=g.columns)==null?void 0:w.flatMap(D=>D.getFlatColumns())]},mt(e.options,"debugColumns")),getLeafColumns:ht(()=>[e._getOrderColumnsFn()],w=>{var D;if((D=g.columns)!=null&&D.length){let S=g.columns.flatMap(T=>T.getLeafColumns());return w(S)}return[g]},mt(e.options,"debugColumns"))};for(const w of e._features)w.createColumn==null||w.createColumn(g,e);return g}const Rr="debugHeaders";function m2(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],u=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(u),s.push(d)};return u(o),s},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(o,e)}),o}const $G={createTable:e=>{e.getHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>{var o,s;const u=(o=r==null?void 0:r.map(g=>n.find(w=>w.id===g)).filter(Boolean))!=null?o:[],d=(s=a==null?void 0:a.map(g=>n.find(w=>w.id===g)).filter(Boolean))!=null?s:[],m=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(a!=null&&a.includes(g.id)));return Fg(t,[...u,...m,...d],e)},mt(e.options,Rr)),e.getCenterHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(a!=null&&a.includes(o.id))),Fg(t,n,e,"center")),mt(e.options,Rr)),e.getLeftHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var a;const o=(a=r==null?void 0:r.map(s=>n.find(u=>u.id===s)).filter(Boolean))!=null?a:[];return Fg(t,o,e,"left")},mt(e.options,Rr)),e.getRightHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var a;const o=(a=r==null?void 0:r.map(s=>n.find(u=>u.id===s)).filter(Boolean))!=null?a:[];return Fg(t,o,e,"right")},mt(e.options,Rr)),e.getFooterGroups=ht(()=>[e.getHeaderGroups()],t=>[...t].reverse(),mt(e.options,Rr)),e.getLeftFooterGroups=ht(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),mt(e.options,Rr)),e.getCenterFooterGroups=ht(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),mt(e.options,Rr)),e.getRightFooterGroups=ht(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),mt(e.options,Rr)),e.getFlatHeaders=ht(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),mt(e.options,Rr)),e.getLeftFlatHeaders=ht(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),mt(e.options,Rr)),e.getCenterFlatHeaders=ht(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),mt(e.options,Rr)),e.getRightFlatHeaders=ht(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),mt(e.options,Rr)),e.getCenterLeafHeaders=ht(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),mt(e.options,Rr)),e.getLeftLeafHeaders=ht(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),mt(e.options,Rr)),e.getRightLeafHeaders=ht(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),mt(e.options,Rr)),e.getLeafHeaders=ht(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var a,o,s,u,d,m;return[...(a=(o=t[0])==null?void 0:o.headers)!=null?a:[],...(s=(u=n[0])==null?void 0:u.headers)!=null?s:[],...(d=(m=r[0])==null?void 0:m.headers)!=null?d:[]].map(p=>p.getLeafHeaders()).flat()},mt(e.options,Rr))}};function Fg(e,t,n,r){var a,o;let s=0;const u=function(w,D){D===void 0&&(D=1),s=Math.max(s,D),w.filter(S=>S.getIsVisible()).forEach(S=>{var T;(T=S.columns)!=null&&T.length&&u(S.columns,D+1)},0)};u(e);let d=[];const m=(w,D)=>{const S={depth:D,id:[r,`${D}`].filter(Boolean).join("_"),headers:[]},T=[];w.forEach(E=>{const A=[...T].reverse()[0],N=E.column.depth===S.depth;let R,F=!1;if(N&&E.column.parent?R=E.column.parent:(R=E.column,F=!0),A&&(A==null?void 0:A.column)===R)A.subHeaders.push(E);else{const H=m2(n,R,{id:[r,D,R.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:F,placeholderId:F?`${T.filter(P=>P.column===R).length}`:void 0,depth:D,index:T.length});H.subHeaders.push(E),T.push(H)}S.headers.push(E),E.headerGroup=S}),d.push(S),D>0&&m(T,D-1)},p=t.map((w,D)=>m2(n,w,{depth:s,index:D}));m(p,s-1),d.reverse();const g=w=>w.filter(S=>S.column.getIsVisible()).map(S=>{let T=0,E=0,A=[0];S.subHeaders&&S.subHeaders.length?(A=[],g(S.subHeaders).forEach(R=>{let{colSpan:F,rowSpan:H}=R;T+=F,A.push(H)})):T=1;const N=Math.min(...A);return E+=N,S.colSpan=T,S.rowSpan=E,{colSpan:T,rowSpan:E}});return g((a=(o=d[0])==null?void 0:o.headers)!=null?a:[]),d}const Pg={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},$0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),GG={getDefaultColumnDef:()=>Pg,getInitialState:e=>({columnSizing:{},columnSizingInfo:$0(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Va("columnSizing",e),onColumnSizingInfoChange:Va("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,a;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Pg.minSize,(r=o??e.columnDef.size)!=null?r:Pg.size),(a=e.columnDef.maxSize)!=null?a:Pg.maxSize)},e.getStart=ht(n=>[n,Jh(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((a,o)=>a+o.getSize(),0),mt(t.options,"debugColumns")),e.getAfter=ht(n=>[n,Jh(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((a,o)=>a+o.getSize(),0),mt(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...a}=n;return a})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=a=>{if(a.subHeaders.length)a.subHeaders.forEach(r);else{var o;n+=(o=a.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),a=r==null?void 0:r.getCanResize();return o=>{if(!r||!a||(o.persist==null||o.persist(),G0(o)&&o.touches&&o.touches.length>1))return;const s=e.getSize(),u=e?e.getLeafHeaders().map(A=>[A.column.id,A.column.getSize()]):[[r.id,r.getSize()]],d=G0(o)?Math.round(o.touches[0].clientX):o.clientX,m={},p=(A,N)=>{typeof N=="number"&&(t.setColumnSizingInfo(R=>{var F,H;const P=t.options.columnResizeDirection==="rtl"?-1:1,L=(N-((F=R==null?void 0:R.startOffset)!=null?F:0))*P,z=Math.max(L/((H=R==null?void 0:R.startSize)!=null?H:0),-.999999);return R.columnSizingStart.forEach(U=>{let[W,K]=U;m[W]=Math.round(Math.max(K+K*z,0)*100)/100}),{...R,deltaOffset:L,deltaPercentage:z}}),(t.options.columnResizeMode==="onChange"||A==="end")&&t.setColumnSizing(R=>({...R,...m})))},g=A=>p("move",A),w=A=>{p("end",A),t.setColumnSizingInfo(N=>({...N,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},D=n||typeof document<"u"?document:null,S={moveHandler:A=>g(A.clientX),upHandler:A=>{D==null||D.removeEventListener("mousemove",S.moveHandler),D==null||D.removeEventListener("mouseup",S.upHandler),w(A.clientX)}},T={moveHandler:A=>(A.cancelable&&(A.preventDefault(),A.stopPropagation()),g(A.touches[0].clientX),!1),upHandler:A=>{var N;D==null||D.removeEventListener("touchmove",T.moveHandler),D==null||D.removeEventListener("touchend",T.upHandler),A.cancelable&&(A.preventDefault(),A.stopPropagation()),w((N=A.touches[0])==null?void 0:N.clientX)}},E=qG()?{passive:!1}:!1;G0(o)?(D==null||D.addEventListener("touchmove",T.moveHandler,E),D==null||D.addEventListener("touchend",T.upHandler,E)):(D==null||D.addEventListener("mousemove",S.moveHandler,E),D==null||D.addEventListener("mouseup",S.upHandler,E)),t.setColumnSizingInfo(A=>({...A,startOffset:d,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?$0():(n=e.initialState.columnSizingInfo)!=null?n:$0())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0}}};let jg=null;function qG(){if(typeof jg=="boolean")return jg;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return jg=e,jg}function G0(e){return e.type==="touchstart"}const JG={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Va("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var a,o;e.setExpanded(r?{}:(a=(o=e.initialState)==null?void 0:o.expanded)!=null?a:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(a=>!a.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const s=o.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var a;const o=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{s[u]=!0}):s=r,n=(a=n)!=null?a:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){const{[e.id]:u,...d}=s;return d}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,a;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((a=e.subRows)!=null&&a.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},$x=(e,t,n)=>{var r;const a=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(a))};$x.autoRemove=e=>Lo(e);const Gx=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Gx.autoRemove=e=>Lo(e);const qx=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};qx.autoRemove=e=>Lo(e);const Jx=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Jx.autoRemove=e=>Lo(e)||!(e!=null&&e.length);const Kx=(e,t,n)=>!n.some(r=>{var a;return!((a=e.getValue(t))!=null&&a.includes(r))});Kx.autoRemove=e=>Lo(e)||!(e!=null&&e.length);const Qx=(e,t,n)=>n.some(r=>{var a;return(a=e.getValue(t))==null?void 0:a.includes(r)});Qx.autoRemove=e=>Lo(e)||!(e!=null&&e.length);const Xx=(e,t,n)=>e.getValue(t)===n;Xx.autoRemove=e=>Lo(e);const eC=(e,t,n)=>e.getValue(t)==n;eC.autoRemove=e=>Lo(e);const ob=(e,t,n)=>{let[r,a]=n;const o=e.getValue(t);return o>=r&&o<=a};ob.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,a=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(a)?1/0:a;if(o>s){const u=o;o=s,s=u}return[o,s]};ob.autoRemove=e=>Lo(e)||Lo(e[0])&&Lo(e[1]);const ss={includesString:$x,includesStringSensitive:Gx,equalsString:qx,arrIncludes:Jx,arrIncludesAll:Kx,arrIncludesSome:Qx,equals:Xx,weakEquals:eC,inNumberRange:ob};function Lo(e){return e==null||e===""}const KG={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Va("columnFilters",e),onGlobalFilterChange:Va("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?ss.includesString:typeof r=="number"?ss.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ss.equals:Array.isArray(r)?ss.arrIncludes:ss.weakEquals},e.getFilterFn=()=>{var n,r;return Ev(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ss[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,a;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,a,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(a=>a.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const a=e.getFilterFn(),o=r==null?void 0:r.find(p=>p.id===e.id),s=vl(n,o?o.value:void 0);if(p2(a,s,e)){var u;return(u=r==null?void 0:r.filter(p=>p.id!==e.id))!=null?u:[]}const d={id:e.id,value:s};if(o){var m;return(m=r==null?void 0:r.map(p=>p.id===e.id?d:p))!=null?m:[]}return r!=null&&r.length?[...r,d]:[d]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ss.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Ev(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ss[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=a=>{var o;return(o=vl(t,a))==null?void 0:o.filter(s=>{const u=n.find(d=>d.id===s.id);if(u){const d=u.getFilterFn();if(p2(d,s.value,u))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function p2(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const QG=(e,t,n)=>n.reduce((r,a)=>{const o=a.getValue(e);return r+(typeof o=="number"?o:0)},0),XG=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},eq=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r=o)&&(r=o)}),r},tq=(e,t,n)=>{let r,a;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r===void 0?s>=s&&(r=a=s):(r>s&&(r=s),a{let n=0,r=0;if(t.forEach(a=>{let o=a.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},rq=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!VG(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),a=n.sort((o,s)=>o-s);return n.length%2!==0?a[r]:(a[r-1]+a[r])/2},aq=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),oq=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,iq=(e,t)=>t.length,q0={sum:QG,min:XG,max:eq,extent:tq,mean:nq,median:rq,unique:aq,uniqueCount:oq,count:iq},sq={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Va("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r,a,o;return(n=(r=(a=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?a:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return q0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return q0.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Ev(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:q0[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var a;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((a=n.subRows)!=null&&a.length)}}};function lq(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(s=>s.id===o)).filter(Boolean),...r]}const cq={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Va("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ht(n=>[Jh(t,n)],n=>n.findIndex(r=>r.id===e.id),mt(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Jh(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const a=Jh(t,n);return((r=a[a.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ht(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>a=>{let o=[];if(!(t!=null&&t.length))o=a;else{const s=[...t],u=[...a];for(;u.length&&s.length;){const d=s.shift(),m=u.findIndex(p=>p.id===d);m>-1&&o.push(u.splice(m,1)[0])}o=[...o,...u]}return lq(o,n,r)},mt(e.options,"debugTable"))}},Zw=0,Ww=10,J0=()=>({pageIndex:Zw,pageSize:Ww}),uq={getInitialState:e=>({...e,pagination:{...J0(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Va("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const a=o=>vl(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(a)},e.resetPagination=r=>{var a;e.setPagination(r?J0():(a=e.initialState.pagination)!=null?a:J0())},e.setPageIndex=r=>{e.setPagination(a=>{let o=vl(r,a.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,s)),{...a,pageIndex:o}})},e.resetPageIndex=r=>{var a,o;e.setPageIndex(r?Zw:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?a:Zw)},e.resetPageSize=r=>{var a,o;e.setPageSize(r?Ww:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?a:Ww)},e.setPageSize=r=>{e.setPagination(a=>{const o=Math.max(1,vl(r,a.pageSize)),s=a.pageSize*a.pageIndex,u=Math.floor(s/o);return{...a,pageIndex:u,pageSize:o}})},e.setPageCount=r=>e.setPagination(a=>{var o;let s=vl(r,(o=e.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...a,pageCount:s}}),e.getPageOptions=ht(()=>[e.getPageCount()],r=>{let a=[];return r&&r>0&&(a=[...new Array(r)].fill(null).map((o,s)=>s)),a},mt(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,a=e.getPageCount();return a===-1?!0:a===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},K0=()=>({left:[],right:[]}),Q0=()=>({top:[],bottom:[]}),dq={getInitialState:e=>({columnPinning:K0(),rowPinning:Q0(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Va("columnPinning",e),onRowPinningChange:Va("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(a=>a.id).filter(Boolean);t.setColumnPinning(a=>{var o,s;if(n==="right"){var u,d;return{left:((u=a==null?void 0:a.left)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((d=a==null?void 0:a.right)!=null?d:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var m,p;return{left:[...((m=a==null?void 0:a.left)!=null?m:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((p=a==null?void 0:a.right)!=null?p:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((o=a==null?void 0:a.left)!=null?o:[]).filter(g=>!(r!=null&&r.includes(g))),right:((s=a==null?void 0:a.right)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var a,o,s;return((a=r.columnDef.enablePinning)!=null?a:!0)&&((o=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(u=>u.id),{left:r,right:a}=t.getState().columnPinning,o=n.some(u=>r==null?void 0:r.includes(u)),s=n.some(u=>a==null?void 0:a.includes(u));return o?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();return a?(n=(r=t.getState().columnPinning)==null||(r=r[a])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,a)=>{const o=r?e.getLeafRows().map(d=>{let{id:m}=d;return m}):[],s=a?e.getParentRows().map(d=>{let{id:m}=d;return m}):[],u=new Set([...s,e.id,...o]);t.setRowPinning(d=>{var m,p;if(n==="bottom"){var g,w;return{top:((g=d==null?void 0:d.top)!=null?g:[]).filter(T=>!(u!=null&&u.has(T))),bottom:[...((w=d==null?void 0:d.bottom)!=null?w:[]).filter(T=>!(u!=null&&u.has(T))),...Array.from(u)]}}if(n==="top"){var D,S;return{top:[...((D=d==null?void 0:d.top)!=null?D:[]).filter(T=>!(u!=null&&u.has(T))),...Array.from(u)],bottom:((S=d==null?void 0:d.bottom)!=null?S:[]).filter(T=>!(u!=null&&u.has(T)))}}return{top:((m=d==null?void 0:d.top)!=null?m:[]).filter(T=>!(u!=null&&u.has(T))),bottom:((p=d==null?void 0:d.bottom)!=null?p:[]).filter(T=>!(u!=null&&u.has(T)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:a}=t.options;return typeof r=="function"?r(e):(n=r??a)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:a}=t.getState().rowPinning,o=n.some(u=>r==null?void 0:r.includes(u)),s=n.some(u=>a==null?void 0:a.includes(u));return o?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();if(!a)return-1;const o=(n=t._getPinnedRows(a))==null?void 0:n.map(s=>{let{id:u}=s;return u});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=ht(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,a)=>{const o=[...r??[],...a??[]];return n.filter(s=>!o.includes(s.column.id))},mt(t.options,"debugRows")),e.getLeftVisibleCells=ht(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),mt(t.options,"debugRows")),e.getRightVisibleCells=ht(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),mt(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?K0():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:K0())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var a,o;return!!((a=r.left)!=null&&a.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ht(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),mt(e.options,"debugColumns")),e.getRightLeafColumns=ht(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),mt(e.options,"debugColumns")),e.getCenterLeafColumns=ht(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const a=[...n??[],...r??[]];return t.filter(o=>!a.includes(o.id))},mt(e.options,"debugColumns")),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Q0():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Q0())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var a,o;return!!((a=r.top)!=null&&a.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=ht(t=>[e.getRowModel().rows,e.getState().rowPinning[t],t],(t,n,r)=>{var a;return((a=e.options.keepPinnedRows)==null||a?(n??[]).map(s=>{const u=e.getRow(s,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(s=>t.find(u=>u.id===s))).filter(Boolean).map(s=>({...s,position:r}))},mt(e.options,"debugRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=ht(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const a=new Set([...n??[],...r??[]]);return t.filter(o=>!a.has(o.id))},mt(e.options,"debugRows"))}},fq={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Va("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},a=e.getPreGroupedRowModel().flatRows;return t?a.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):a.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),a={...n};return e.getRowModel().rows.forEach(o=>{$w(a,o.id,r,!0,e)}),a}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ht(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?X0(e,n):{rows:[],flatRows:[],rowsById:{}},mt(e.options,"debugTable")),e.getFilteredSelectedRowModel=ht(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?X0(e,n):{rows:[],flatRows:[],rowsById:{}},mt(e.options,"debugTable")),e.getGroupedSelectedRowModel=ht(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?X0(e,n):{rows:[],flatRows:[],rowsById:{}},mt(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(a=>a.getCanSelect()&&!n[a.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(a=>a.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(a=>!n[a.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const a=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=typeof n<"u"?n:!a,e.getCanSelect()&&a===n)return o;const u={...o};return $w(u,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return ib(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Gw(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Gw(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var a;n&&e.toggleSelected((a=r.target)==null?void 0:a.checked)}}}},$w=(e,t,n,r,a)=>{var o;const s=a.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=s.subRows)!=null&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(u=>$w(e,u.id,n,r,a))};function X0(e,t){const n=e.getState().rowSelection,r=[],a={},o=function(s,u){return s.map(d=>{var m;const p=ib(d,n);if(p&&(r.push(d),a[d.id]=d),(m=d.subRows)!=null&&m.length&&(d={...d,subRows:o(d.subRows)}),p)return d}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:a}}function ib(e,t){var n;return(n=t[e.id])!=null?n:!1}function Gw(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let a=!0,o=!1;return e.subRows.forEach(s=>{if(!(o&&!a)&&(s.getCanSelect()&&(ib(s,t)?o=!0:a=!1),s.subRows&&s.subRows.length)){const u=Gw(s,t);u==="all"?o=!0:(u==="some"&&(o=!0),a=!1)}}),a?"all":o?"some":!1}const qw=/([0-9]+)/gm,hq=(e,t,n)=>tC(Dl(e.getValue(n)).toLowerCase(),Dl(t.getValue(n)).toLowerCase()),mq=(e,t,n)=>tC(Dl(e.getValue(n)),Dl(t.getValue(n))),pq=(e,t,n)=>sb(Dl(e.getValue(n)).toLowerCase(),Dl(t.getValue(n)).toLowerCase()),gq=(e,t,n)=>sb(Dl(e.getValue(n)),Dl(t.getValue(n))),vq=(e,t,n)=>{const r=e.getValue(n),a=t.getValue(n);return r>a?1:rsb(e.getValue(n),t.getValue(n));function sb(e,t){return e===t?0:e>t?1:-1}function Dl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function tC(e,t){const n=e.split(qw).filter(Boolean),r=t.split(qw).filter(Boolean);for(;n.length&&r.length;){const a=n.shift(),o=r.shift(),s=parseInt(a,10),u=parseInt(o,10),d=[s,u].sort();if(isNaN(d[0])){if(a>o)return 1;if(o>a)return-1;continue}if(isNaN(d[1]))return isNaN(s)?-1:1;if(s>u)return 1;if(u>s)return-1}return n.length-r.length}const Id={alphanumeric:hq,alphanumericCaseSensitive:mq,text:pq,textCaseSensitive:gq,datetime:vq,basic:yq},wq={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Va("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const a of n){const o=a==null?void 0:a.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Id.datetime;if(typeof o=="string"&&(r=!0,o.split(qw).length>1))return Id.alphanumeric}return r?Id.text:Id.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Ev(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Id[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const a=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(s=>{const u=s==null?void 0:s.find(D=>D.id===e.id),d=s==null?void 0:s.findIndex(D=>D.id===e.id);let m=[],p,g=o?n:a==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?u?p="toggle":p="add":s!=null&&s.length&&d!==s.length-1?p="replace":u?p="toggle":p="replace",p==="toggle"&&(o||a||(p="remove")),p==="add"){var w;m=[...s,{id:e.id,desc:g}],m.splice(0,m.length-((w=t.options.maxMultiSortColCount)!=null?w:Number.MAX_SAFE_INTEGER))}else p==="toggle"?m=s.map(D=>D.id===e.id?{...D,desc:g}:D):p==="remove"?m=s.filter(D=>D.id!==e.id):m=[{id:e.id,desc:g}];return m})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,a;const o=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(a=t.options.enableMultiRemove)!=null)||a)?!1:s==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(a=>a.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(a=>a.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},bq={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Va("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const a=e.columns;return(n=a.length?a.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ht(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),mt(t.options,"debugRows")),e.getVisibleCells=ht(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,a)=>[...n,...r,...a],mt(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>ht(()=>[r(),r().filter(a=>a.getIsVisible()).map(a=>a.id).join("_")],a=>a.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),mt(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((a,o)=>({...a,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Jh(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const g2=[$G,bq,cq,dq,KG,wq,sq,JG,uq,fq,GG];function Dq(e){var t;e.debugAll||e.debugTable;let n={_features:g2};const r=n._features.reduce((p,g)=>Object.assign(p,g.getDefaultOptions==null?void 0:g.getDefaultOptions(n)),{}),a=p=>n.options.mergeOptions?n.options.mergeOptions(r,p):{...r,...p};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(p=>{var g;s=(g=p.getInitialState==null?void 0:p.getInitialState(s))!=null?g:s});const u=[];let d=!1;const m={_features:g2,options:{...r,...e},initialState:s,_queue:p=>{u.push(p),d||(d=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();d=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{n.setState(n.initialState)},setOptions:p=>{const g=vl(p,n.options);n.options=a(g)},getState:()=>n.options.state,setState:p=>{n.options.onStateChange==null||n.options.onStateChange(p)},_getRowId:(p,g,w)=>{var D;return(D=n.options.getRowId==null?void 0:n.options.getRowId(p,g,w))!=null?D:`${w?[w.id,g].join("."):g}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(p,g)=>{let w=(g?n.getPrePaginationRowModel():n.getRowModel()).rowsById[p];if(!w&&(w=n.getCoreRowModel().rowsById[p],!w))throw new Error;return w},_getDefaultColumnDef:ht(()=>[n.options.defaultColumn],p=>{var g;return p=(g=p)!=null?g:{},{header:w=>{const D=w.header.column.columnDef;return D.accessorKey?D.accessorKey:D.accessorFn?D.id:null},cell:w=>{var D,S;return(D=(S=w.renderValue())==null||S.toString==null?void 0:S.toString())!=null?D:null},...n._features.reduce((w,D)=>Object.assign(w,D.getDefaultColumnDef==null?void 0:D.getDefaultColumnDef()),{}),...p}},mt(e,"debugColumns")),_getColumnDefs:()=>n.options.columns,getAllColumns:ht(()=>[n._getColumnDefs()],p=>{const g=function(w,D,S){return S===void 0&&(S=0),w.map(T=>{const E=WG(n,T,S,D),A=T;return E.columns=A.columns?g(A.columns,E,S+1):[],E})};return g(p)},mt(e,"debugColumns")),getAllFlatColumns:ht(()=>[n.getAllColumns()],p=>p.flatMap(g=>g.getFlatColumns()),mt(e,"debugColumns")),_getAllFlatColumnsById:ht(()=>[n.getAllFlatColumns()],p=>p.reduce((g,w)=>(g[w.id]=w,g),{}),mt(e,"debugColumns")),getAllLeafColumns:ht(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(p,g)=>{let w=p.flatMap(D=>D.getLeafColumns());return g(w)},mt(e,"debugColumns")),getColumn:p=>n._getAllFlatColumnsById()[p]};Object.assign(n,m);for(let p=0;p{var s;return(s=o.getValue())!=null?s:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:a,getContext:ht(()=>[e,n,t,o],(s,u,d,m)=>({table:s,column:u,row:d,cell:m,getValue:m.getValue,renderValue:m.renderValue}),mt(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(o,n,t,e)},{}),o}const lb=(e,t,n,r,a,o,s)=>{let u={id:t,index:r,original:n,depth:a,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(u._valuesCache.hasOwnProperty(d))return u._valuesCache[d];const m=e.getColumn(d);if(m!=null&&m.accessorFn)return u._valuesCache[d]=m.accessorFn(u.original,r),u._valuesCache[d]},getUniqueValues:d=>{if(u._uniqueValuesCache.hasOwnProperty(d))return u._uniqueValuesCache[d];const m=e.getColumn(d);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(u._uniqueValuesCache[d]=m.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[d]):(u._uniqueValuesCache[d]=[u.getValue(d)],u._uniqueValuesCache[d])},renderValue:d=>{var m;return(m=u.getValue(d))!=null?m:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>ZG(u.subRows,d=>d.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let d=[],m=u;for(;;){const p=m.getParentRow();if(!p)break;d.push(p),m=p}return d.reverse()},getAllCells:ht(()=>[e.getAllLeafColumns()],d=>d.map(m=>Sq(e,u,m,m.id)),mt(e.options,"debugRows")),_getAllCellsByColumnId:ht(()=>[u.getAllCells()],d=>d.reduce((m,p)=>(m[p.column.id]=p,m),{}),mt(e.options,"debugRows"))};for(let d=0;dht(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(a,o,s){o===void 0&&(o=0);const u=[];for(let m=0;me._autoResetPageIndex()))}function nC(e,t,n){return n.options.filterFromLeafRows?Tq(e,t,n):Eq(e,t,n)}function Tq(e,t,n){var r;const a=[],o={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(d,m){m===void 0&&(m=0);const p=[];for(let w=0;wht(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let w=0;w{var D;const S=e.getColumn(w.id);if(!S)return;const T=S.getFilterFn();T&&a.push({id:w.id,filterFn:T,resolvedValue:(D=T.resolveFilterValue==null?void 0:T.resolveFilterValue(w.value))!=null?D:w.value})});const s=n.map(w=>w.id),u=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(w=>w.getCanGlobalFilter());r&&u&&d.length&&(s.push("__global__"),d.forEach(w=>{var D;o.push({id:w.id,filterFn:u,resolvedValue:(D=u.resolveFilterValue==null?void 0:u.resolveFilterValue(r))!=null?D:r})}));let m,p;for(let w=0;w{D.columnFiltersMeta[T]=E})}if(o.length){for(let S=0;S{D.columnFiltersMeta[T]=E})){D.columnFilters.__global__=!0;break}}D.columnFilters.__global__!==!0&&(D.columnFilters.__global__=!1)}}const g=w=>{for(let D=0;De._autoResetPageIndex()))}function Cq(){return(e,t)=>ht(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,a)=>{if(!n.rows.length||!(r!=null&&r.length)&&!a)return n;const o=[...r.map(u=>u.id).filter(u=>u!==t),a?"__global__":void 0].filter(Boolean),s=u=>{for(let d=0;dht(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let o=0;oht(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{var r;if(!n)return;const a=(r=n.flatRows[0])==null?void 0:r.getUniqueValues(t);if(typeof a>"u")return;let o=[a,a];for(let s=0;so[1]&&(o[1]=m)}}return o},mt(e.options,"debugTable"))}function kq(){return e=>ht(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,a=[],o=r.filter(d=>{var m;return(m=e.getColumn(d.id))==null?void 0:m.getCanSort()}),s={};o.forEach(d=>{const m=e.getColumn(d.id);m&&(s[d.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const u=d=>{const m=d.map(p=>({...p}));return m.sort((p,g)=>{for(let D=0;D{var g;a.push(p),(g=p.subRows)!=null&&g.length&&(p.subRows=u(p.subRows))}),m};return{rows:u(n.rows),flatRows:a,rowsById:n.rowsById}},mt(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Aq(e){const t=[],n=r=>{var a;t.push(r),(a=r.subRows)!=null&&a.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Oq(e){return t=>ht(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:a,pageIndex:o}=n;let{rows:s,flatRows:u,rowsById:d}=r;const m=a*o,p=m+a;s=s.slice(m,p);let g;t.options.paginateExpandedRows?g={rows:s,flatRows:u,rowsById:d}:g=Aq({rows:s,flatRows:u,rowsById:d}),g.flatRows=[];const w=D=>{g.flatRows.push(D),D.subRows.length&&D.subRows.forEach(w)};return g.rows.forEach(w),g},mt(t.options,"debugTable"))}function v2(e,t){return e?Fq(e)?O.createElement(e,t):e:null}function Fq(e){return Pq(e)||typeof e=="function"||jq(e)}function Pq(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function jq(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Lq(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=O.useState(()=>({current:Dq(t)})),[r,a]=O.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:s=>{a(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const rC={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},Rq=Object.keys(rC).join("|"),_q=new RegExp(Rq,"g");function Hq(e){return e.replace(_q,t=>rC[t])}const ya={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Bq(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:ya.MATCHES,!n.accessors){const s=y2(e,t,n);return{rankedValue:e,rank:s,accessorIndex:-1,accessorThreshold:n.threshold,passed:s>=n.threshold}}const a=Zq(e,n.accessors),o={rankedValue:e,rank:ya.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s=ya.MATCHES?d=m:d>p&&(d=p),d=Math.min(d,p),d>=g&&d>o.rank&&(o.rank=d,o.passed=!0,o.accessorIndex=s,o.accessorThreshold=g,o.rankedValue=u.itemValue)}return o}function y2(e,t,n){return e=w2(e,n),t=w2(t,n),t.length>e.length?ya.NO_MATCH:e===t?ya.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?ya.EQUAL:e.startsWith(t)?ya.STARTS_WITH:e.includes(` ${t}`)?ya.WORD_STARTS_WITH:e.includes(t)?ya.CONTAINS:t.length===1?ya.NO_MATCH:Yq(e).includes(t)?ya.ACRONYM:zq(e,t))}function Yq(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(o=>{t+=o.substr(0,1)})}),t}function zq(e,t){let n=0,r=0;function a(d,m,p){for(let g=p,w=m.length;g-1))return ya.NO_MATCH}const u=r-s;return o(u)}function Uq(e,t){return e.rank===t.rank?0:e.rank>t.rank?-1:1}function w2(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=Hq(e)),e}function Vq(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function Zq(e,t){const n=[];for(let r=0,a=t.length;r{const t=O.useRef(null);O.useEffect(()=>(t.current&&x.setIcon(t.current,"pin"),()=>{t.current&&(t.current=null)}),[t]);const n=O.useCallback(async()=>{e.pinned?await Ie.unpinMemoById(e.id):await Ie.pinMemoById(e.id)},[e]);return y.jsx("span",{ref:t,className:mr("pinned-status",e.pinned?"pinned":"not-pinned"),onClick:n})},Gq=({thino:e})=>{const t=O.useRef(null);O.useEffect(()=>(t.current&&x.setIcon(t.current,e.thinoType==="JOURNAL"?"calendar":"check-square"),()=>{t.current&&(t.current=null)}),[t,e==null?void 0:e.thinoType]);const n=O.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const r=await Ie.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");r&&Ie.editMemo(r)},[e]);return y.jsx(y.Fragment,{children:e.thinoType!=="JOURNAL"?y.jsx("input",{className:mr("thino-type-status","task-list-item-checkbox"),type:"checkbox",checked:e.thinoType!=="TASK-TODO","data-task":e.thinoType==="TASK-TODO"?"":e.thinoType==="TASK-DONE"?"x":e.thinoType.slice(5),onClick:n}):y.jsx("span",{ref:t,className:"thino-type-status"})})},qq=({id:e,path:t})=>{const n=O.useRef(null);O.useEffect(()=>(n.current&&x.setIcon(n.current,"link"),()=>{n.current&&(n.current=null)}),[]);const r=O.useCallback(()=>{!e||!t||Ie.openThinoByID(e)},[e,t]);return y.jsxs("span",{className:"source-thino",onClick:r,children:[y.jsx("span",{children:t}),y.jsx("span",{ref:n,className:"source-thino-icon"})]})},Jq=({id:e,sourceType:t})=>{const n=O.useRef(null);O.useEffect(()=>{var a;return n.current&&x.setIcon(n.current,((a=Md.find(o=>o.title===t))==null?void 0:a.icon)||"list"),()=>{n.current&&(n.current=null)}},[]);const r=O.useCallback(async()=>{e&&await Ie.openThinoByID(e)},[e]);return y.jsx("span",{ref:n,className:"source-type-icon",onClick:r})},D2=(e,t,n,r)=>{const a=Bq(e.getValue(t),n);return r({itemRank:a}),a.passed},S2=(e,t,n)=>{var a,o;let r=0;return e.columnFiltersMeta[n]&&(r=Uq((a=e.columnFiltersMeta[n])==null?void 0:a.itemRank,(o=t.columnFiltersMeta[n])==null?void 0:o.itemRank)),r===0?Id.alphanumeric(e,t,n):r};function Kq({thinos:e}){var p;q.useReducer(()=>({}),{})[1];const[t,n]=q.useState([]),[r,a]=q.useState(""),o=q.useMemo(()=>[{header:k("Basic Info"),footer:g=>g.column.id,columns:[{accessorKey:"createdAt",header:()=>y.jsx("span",{className:"create-at-header-cell",children:k("Created At")}),cell:g=>g.getValue(),footer:g=>g.column.id,enableColumnFilter:!1},{accessorFn:g=>g.content,id:"content",header:()=>y.jsx("span",{className:"thino-header-cell",children:k("Thino")}),cell:g=>y.jsx(Ua,{memo:g.row.original,type:"table"}),footer:g=>g.column.id,filterFn:"fuzzy",sortingFn:S2},{accessorFn:g=>g.thinoType,id:"thinoType",cell:g=>y.jsx(Gq,{thino:g.row.original}),header:()=>y.jsx("span",{children:k("Thino Type")}),footer:g=>g.column.id},{accessorFn:g=>g.sourceType,id:"sourceType",cell:g=>y.jsx(Jq,{id:g.row.original.id,sourceType:g.getValue()}),header:()=>y.jsx("span",{children:k("Source Type")}),footer:g=>g.column.id}]},{header:k("Additional Info"),footer:g=>g.column.id,columns:[{accessorKey:"pinned",header:()=>y.jsx("span",{children:k("Pinned Status")}),cell:g=>y.jsx($q,{thino:g.row.original}),footer:g=>g.column.id,filterFn:"fuzzy",sortingFn:S2},{accessorKey:"rowStatus",header:()=>y.jsx("span",{children:k("Row status")}),cell:g=>y.jsx("span",{children:g.getValue()==="NORMAL"?"":g.getValue()}),footer:g=>g.column.id},{accessorKey:"path",header:()=>k("Path"),cell:g=>y.jsx(qq,{id:g.row.original.id,path:g.getValue()}),footer:g=>g.column.id}]}],[]),[s,u]=q.useState(()=>e),d=()=>u(g=>e);O.useEffect(()=>{d()},[e]);const m=Lq({data:s,columns:o,filterFns:{fuzzy:D2},initialState:{pagination:{pageSize:20}},state:{columnFilters:t,globalFilter:r},onColumnFiltersChange:n,onGlobalFilterChange:a,globalFilterFn:D2,getCoreRowModel:Iq(),getFilteredRowModel:xq(),getSortedRowModel:kq(),getPaginationRowModel:Oq(),getFacetedRowModel:Cq(),getFacetedUniqueValues:Mq(),getFacetedMinMaxValues:Nq(),debugTable:!1,debugHeaders:!1,debugColumns:!1});return q.useEffect(()=>{var g,w;((g=m.getState().columnFilters[0])==null?void 0:g.id)==="createdAt"&&((w=m.getState().sorting[0])==null?void 0:w.id)!=="createdAt"&&m.setSorting([{id:"createdAt",desc:!1}])},[(p=m.getState().columnFilters[0])==null?void 0:p.id]),y.jsxs("div",{className:"table-view",children:[y.jsx("div",{children:y.jsx(Xg,{value:r||"",onChange:g=>a(String(g)),className:"table-search-bar",placeholder:k("Search all columns...")})}),y.jsxs("table",{children:[y.jsx("thead",{children:m.getHeaderGroups().map(g=>y.jsx("tr",{children:g.headers.map(w=>y.jsx("th",{colSpan:w.colSpan,children:w.isPlaceholder?null:y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:mr(w.column.getCanSort()?"filter-header":"","table-header",w.column.id==="content"?"content-header":""),onClick:w.column.getToggleSortingHandler(),children:[v2(w.column.columnDef.header,w.getContext()),{asc:" 🔼",desc:" 🔽"}[w.column.getIsSorted()]??null]}),w.column.getCanFilter()?y.jsx(Xq,{column:w.column,table:m}):null]})},w.id))},g.id))}),y.jsx("tbody",{children:m.getRowModel().rows.map(g=>y.jsx("tr",{className:mr(g.getValue("pinned")?"pinned":""),children:g.getVisibleCells().map(w=>y.jsx("td",{children:v2(w.column.columnDef.cell,w.getContext())},w.id))},g.id))})]}),y.jsxs("div",{className:"table-nav-bar",children:[y.jsx("button",{className:"prev-start-btn",onClick:()=>m.setPageIndex(0),disabled:!m.getCanPreviousPage(),children:"<<"}),y.jsx("button",{className:"prev-btn",onClick:()=>m.previousPage(),disabled:!m.getCanPreviousPage(),children:"<"}),y.jsx("button",{className:"next-btn",onClick:()=>m.nextPage(),disabled:!m.getCanNextPage(),children:">"}),y.jsx("button",{className:"next-end-btn",onClick:()=>m.setPageIndex(m.getPageCount()-1),disabled:!m.getCanNextPage(),children:">>"}),y.jsxs("span",{className:"table-page-info",children:[y.jsx("div",{children:k("Page")}),y.jsxs("strong",{children:[m.getState().pagination.pageIndex+1," of ",m.getPageCount()]})]}),y.jsxs("span",{className:"table-page-jump",children:["| ",k("Go to page"),":",y.jsx("input",{type:"number",defaultValue:m.getState().pagination.pageIndex+1,onChange:g=>{const w=g.target.value?Number(g.target.value)-1:0;m.setPageIndex(w)},className:"jump-inputer"})]}),y.jsx("select",{value:m.getState().pagination.pageSize,onChange:g=>{m.setPageSize(Number(g.target.value))},children:[10,20,30,40,50].map(g=>y.jsxs("option",{value:g,children:[k("Show")," ",g," ",k("rows")]},g))})]})]})}const Qq=e=>e==="sourceType"?["ALL"]:["ALL","ALL-TASK"];function Xq({column:e,table:t}){var o,s,u,d,m,p,g,w,D;const n=(o=t.getPreFilteredRowModel().flatRows[0])==null?void 0:o.getValue(e.id),r=e.getFilterValue(),a=q.useMemo(()=>typeof n=="number"?[]:Array.from(e.getFacetedUniqueValues().keys()).sort(),[e.getFacetedUniqueValues()]);return typeof n=="number"?y.jsx("div",{children:y.jsxs("div",{className:"filter-input-group",children:[y.jsx(Xg,{type:"number",min:Number(((s=e.getFacetedMinMaxValues())==null?void 0:s[0])??""),max:Number(((u=e.getFacetedMinMaxValues())==null?void 0:u[1])??""),value:(r==null?void 0:r[0])??"",onChange:S=>e.setFilterValue(T=>[S,T==null?void 0:T[1]]),placeholder:`Min ${(d=e.getFacetedMinMaxValues())!=null&&d[0]?`(${(m=e.getFacetedMinMaxValues())==null?void 0:m[0]})`:""}`,className:"filter-input-short"}),y.jsx(Xg,{type:"number",min:Number(((p=e.getFacetedMinMaxValues())==null?void 0:p[0])??""),max:Number(((g=e.getFacetedMinMaxValues())==null?void 0:g[1])??""),value:(r==null?void 0:r[1])??"",onChange:S=>e.setFilterValue(T=>[T==null?void 0:T[0],S]),placeholder:`Max ${(w=e.getFacetedMinMaxValues())!=null&&w[1]?`(${(D=e.getFacetedMinMaxValues())==null?void 0:D[1]})`:""}`,className:"filter-input-short"})]})}):y.jsx(y.Fragment,{children:a.length>1?y.jsxs(y.Fragment,{children:[e.id!=="path"&&e.id!=="content"&&e.id!=="thinoType"&&e.id!=="sourceType"&&y.jsx("datalist",{id:e.id+"list",children:a.slice(0,5e3).map(S=>y.jsx("option",{value:S},S))}),e.id==="thinoType"||e.id==="sourceType"?y.jsx("select",{id:e.id,onChange:S=>e.setFilterValue(S.target.value==="ALL"?"":S.target.value==="ALL-TASK"?"TASK":S.target.value),children:[...Qq(e.id),...a].map(S=>y.jsx("option",{value:S,children:k(S)},S))}):"",e.id!=="thinoType"&&e.id!=="sourceType"?y.jsx(Xg,{type:"text",value:r??"",onChange:S=>e.setFilterValue(S),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,className:"filter-input-long",list:e.id+"list"}):""]}):""})}function Xg({value:e,onChange:t,debounce:n=500,...r}){const[a,o]=q.useState(e);return q.useEffect(()=>{o(e)},[e]),q.useEffect(()=>{const s=setTimeout(()=>{t(a)},n);return()=>clearTimeout(s)},[a]),y.jsx("input",{...r,value:a,onChange:s=>o(s.target.value)})}const eJ=e=>{const{locationState:{query:t},globalState:{memoListView:n,manifest:r},dailyNotesState:{app:a,settings:o}}=O.useContext(wt),{thinos:s}=e,[u,d]=q.useState(xv(s,"day")),m=q.useRef(null),p=O.useRef([]),g=O.useRef(0);O.useEffect(()=>{d(xv(s,"day"))},[s]),O.useEffect(()=>{var N,R;const S=s.filter(F=>F.pinned),T=s.filter(F=>!F.pinned),E=p.current.filter(F=>F.pinned)[0],A=p.current.filter(F=>!F.pinned)[0];if(E&&E.id!==((N=S[0])==null?void 0:N.id)||A&&A.id!==((R=T[0])==null?void 0:R.id)){const F=m.current.closest(".memolist-wrapper");F.scrollTop=F.scrollHeight}else{const F=m.current.closest(".memolist-wrapper");F.scrollTop=F.scrollHeight-g.current,p.current=s}},[s]),O.useEffect(()=>{if(!m.current)return;const S=m.current.closest(".memolist-wrapper");S.scrollTop=S.scrollHeight},[t]),O.useEffect(()=>{if(n==="chat"&&m.current){const S=m.current.closest(".memolist-wrapper");S.scrollTop=S.scrollHeight,g.current=S.scrollHeight-S.scrollTop,p.current=s,S.onscrollend=()=>{g.current=S.scrollHeight-S.scrollTop}}},[m.current]);const w=O.useCallback(()=>{a.setting.open(),a.setting.openTabById(r.id||"obsidian-memos")},[a]),D=O.useMemo(()=>y.jsx(y.Fragment,{children:Object.keys(u).map((S,T)=>y.jsx(y.Fragment,{children:y.jsx(tJ,{thinos:u[S],dayMark:S,handleOpenSettings:w},S+T)}))}),[u]);return y.jsx("div",{ref:m,className:mr("chat-view",`${o==null?void 0:o.chatViewStyle}-style`),children:D})},tJ=({thinos:e,dayMark:t,handleOpenSettings:n})=>{const{dailyNotesState:{settings:r}}=O.useContext(wt),[a,o]=q.useState(!0),s=q.useRef(null),u=p=>{if(x.Keymap.isModifier(p.nativeEvent,"Mod")){const g=x.moment(t,"YYYY-MM-DD");We.setFromAndToQuery(g.startOf("day").valueOf(),g.endOf("day").valueOf());return}o(!a),s.current.scrollIntoView(!0)},d=p=>{Gd(p)},m=O.useMemo(()=>e.map((p,g)=>y.jsxs("div",{className:"thino-bubble right",children:[y.jsx(nJ,{icon:r==null?void 0:r.MomentsIcon}),y.jsx("div",{className:"wrap",children:y.jsx(rJ,{thino:p,handleClickTimeStamp:d},`${p.id}-${x.moment(p.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${g}`)})]},p.id+g)),[e,r==null?void 0:r.MomentsIcon]);return y.jsxs(y.Fragment,{children:[a&&m,y.jsx("div",{className:`thino-chat-day-mark day-mark ${a?"":"folded"}`,onClick:u,children:y.jsx("div",{className:"day-mark-bubble",children:(t==="PINNED"?t+" 📌":t)+(a?"":"...")})})]})},nJ=({icon:e})=>{const t=O.useCallback(()=>{app.setting.open(),app.setting.openTabById(manifest.id||"obsidian-memos")},[]);return y.jsx("div",{ref:n=>{if(e){n==null||n.empty();return}e||n&&x.setIcon(n,"Memos")},className:"icon-img",style:{backgroundImage:`url(${e})`},onClick:t})},rJ=({thino:e,handleClickTimeStamp:t})=>{const n=O.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const o=await Ie.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");o&&Ie.editMemo(o)},[e]),r=O.useMemo(()=>y.jsxs("div",{className:"content",children:[y.jsx("div",{className:"time-stamp","data-date":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),"data-time":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss"),onClick:()=>{t(e)},children:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss")}),y.jsx(Ua,{memo:e})]}),[e.content]),a=O.useMemo(()=>y.jsxs("div",{className:"content task",children:[y.jsx("div",{className:"task-inputer",children:y.jsx("input",{className:mr("thino-type-status","task-list-item-checkbox"),type:"checkbox",checked:e.thinoType!=="TASK-TODO","data-task":e.thinoType==="TASK-TODO"?"":e.thinoType==="TASK-DONE"?"x":e.thinoType.slice(5),onClick:n})}),y.jsx("div",{className:"time-stamp","data-date":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),"data-time":x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss"),onClick:()=>{t(e)},children:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss")}),y.jsx(Ua,{memo:e})]}),[e.content,e.thinoType]);return e.thinoType==="JOURNAL"?r:a};class aC extends x.Modal{constructor(n){super(n);he(this,"root")}onOpen(){const{contentEl:n,modalEl:r}=this;try{this.root=tK(n,this.close.bind(this)),r.toggleClass("thino-editor-modal",!0),setTimeout(()=>{var a;(a=n.querySelector("textarea"))==null||a.focus(),this.app.workspace.trigger("focus-on-textarea")},10)}catch(a){console.error(a)}}onClose(){this.root.unmount(),this.containerEl&&this.containerEl.empty()}}const aJ=({userIcon:e})=>y.jsx("div",{className:"moments-view-user-icon",ref:t=>{if(e){t==null||t.empty();return}e||t&&x.setIcon(t,"Memos")},style:{backgroundImage:`url(${e})`}}),I2="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuZGV2L3N2Z2pzIiB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDQwIDU2MCI+PGcgbWFzaz0idXJsKCZxdW90OyNTdmdqc01hc2sxMDgwJnF1b3Q7KSIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE0NDAiIGhlaWdodD0iNTYwIiB4PSIwIiB5PSIwIiBmaWxsPSIjMGUyYTQ3Ij48L3JlY3Q+PHVzZSB4bGluazpocmVmPSIjU3ZnanNTeW1ib2wxMDg3IiB4PSIwIiB5PSIwIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1N5bWJvbDEwODciIHg9IjcyMCIgeT0iMCI+PC91c2U+PC9nPjxkZWZzPjxtYXNrIGlkPSJTdmdqc01hc2sxMDgwIj48cmVjdCB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIGZpbGw9IiNmZmZmZmYiPjwvcmVjdD48L21hc2s+PHBhdGggZD0iTS0xIDAgYTEgMSAwIDEgMCAyIDAgYTEgMSAwIDEgMCAtMiAweiIgaWQ9IlN2Z2pzUGF0aDEwODIiPjwvcGF0aD48cGF0aCBkPSJNLTMgMCBhMyAzIDAgMSAwIDYgMCBhMyAzIDAgMSAwIC02IDB6IiBpZD0iU3ZnanNQYXRoMTA4NiI+PC9wYXRoPjxwYXRoIGQ9Ik0tNSAwIGE1IDUgMCAxIDAgMTAgMCBhNSA1IDAgMSAwIC0xMCAweiIgaWQ9IlN2Z2pzUGF0aDEwODMiPjwvcGF0aD48cGF0aCBkPSJNMiAtMiBMLTIgMnoiIGlkPSJTdmdqc1BhdGgxMDg0Ij48L3BhdGg+PHBhdGggZD0iTTYgLTYgTC02IDZ6IiBpZD0iU3ZnanNQYXRoMTA4MSI+PC9wYXRoPjxwYXRoIGQ9Ik0zMCAtMzAgTC0zMCAzMHoiIGlkPSJTdmdqc1BhdGgxMDg1Ij48L3BhdGg+PC9kZWZzPjxzeW1ib2wgaWQ9IlN2Z2pzU3ltYm9sMTA4NyI+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSI5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI5MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iOTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iOTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjkwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjE1MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMTUwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjIxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjIxMCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIyMTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjIxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIyMTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMjEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyMTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyMTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMjcwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMjcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMjcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjI3MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjMzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjMzMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMzMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjM5MCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzOTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzkwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjM5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzOTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjM5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIzOTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzOTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iNDUwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI0NTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjQ1MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iNDUwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjQ1MCIgeT0iNDUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI0NTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1MTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1MTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjUxMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjU3MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI1NzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNTcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjU3MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjU3MCIgeT0iNTEwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjYzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2MzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNjMwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjYzMCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNjMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iNTEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2MzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjY5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjY5MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI2OTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjY5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNjkwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjY5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNjkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2OTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjY5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48L3N5bWJvbD48L3N2Zz4=",ew="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuZGV2L3N2Z2pzIiB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDQwIDU2MCI+PGcgbWFzaz0idXJsKCZxdW90OyNTdmdqc01hc2sxMDgwJnF1b3Q7KSIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE0NDAiIGhlaWdodD0iNTYwIiB4PSIwIiB5PSIwIiBmaWxsPSJyZ2JhKDIzMSwgMjM4LCAyNDUsIDEpIj48L3JlY3Q+PHVzZSB4bGluazpocmVmPSIjU3ZnanNTeW1ib2wxMDg3IiB4PSIwIiB5PSIwIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1N5bWJvbDEwODciIHg9IjcyMCIgeT0iMCI+PC91c2U+PC9nPjxkZWZzPjxtYXNrIGlkPSJTdmdqc01hc2sxMDgwIj48cmVjdCB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIGZpbGw9IiNmZmZmZmYiPjwvcmVjdD48L21hc2s+PHBhdGggZD0iTS0xIDAgYTEgMSAwIDEgMCAyIDAgYTEgMSAwIDEgMCAtMiAweiIgaWQ9IlN2Z2pzUGF0aDEwODUiPjwvcGF0aD48cGF0aCBkPSJNLTMgMCBhMyAzIDAgMSAwIDYgMCBhMyAzIDAgMSAwIC02IDB6IiBpZD0iU3ZnanNQYXRoMTA4MyI+PC9wYXRoPjxwYXRoIGQ9Ik0tNSAwIGE1IDUgMCAxIDAgMTAgMCBhNSA1IDAgMSAwIC0xMCAweiIgaWQ9IlN2Z2pzUGF0aDEwODYiPjwvcGF0aD48cGF0aCBkPSJNMiAtMiBMLTIgMnoiIGlkPSJTdmdqc1BhdGgxMDg0Ij48L3BhdGg+PHBhdGggZD0iTTYgLTYgTC02IDZ6IiBpZD0iU3ZnanNQYXRoMTA4MSI+PC9wYXRoPjxwYXRoIGQ9Ik0zMCAtMzAgTC0zMCAzMHoiIGlkPSJTdmdqc1BhdGgxMDgyIj48L3BhdGg+PC9kZWZzPjxzeW1ib2wgaWQ9IlN2Z2pzU3ltYm9sMTA4NyI+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjMwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIzMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iOTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI5MCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjkwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iOTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iOTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMTUwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIxNTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIxNTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIxNTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIxNTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjE1MCIgeT0iNTEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMjEwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIyMTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjIxMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMjEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMjEwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyMTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyMTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIyMTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyNzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjI3MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMjcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyNzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjMzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzMwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMzMwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMzkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIzOTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjM5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjM5MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjM5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzkwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzkwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNDUwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSI0NTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNDUwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNDUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI1MTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjUxMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTEwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTEwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTEwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTEwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1NzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjU3MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTcwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTcwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI1NzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI1NzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjYzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjY5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2OTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2OTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2OTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2OTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48L3N5bWJvbD48L3N2Zz4=",oJ=e=>{const{globalState:{memoListView:t,markMemoId:n,manifest:r,editMemoId:a},dailyNotesState:{app:o,settings:s}}=O.useContext(wt),{thinos:u}=e,d=q.useRef(null),m=q.useRef(null),[p,g]=q.useState(!1);O.useEffect(()=>{d.current.closest(".workspace-window")&&g(!0)},[d.current]),O.useEffect(()=>{n&&g(!0)},[n]),O.useEffect(()=>{a?(g(!0),setTimeout(()=>{o.workspace.trigger("focus-on-textarea")},200)):g(!1)},[a]),O.useEffect(()=>{m.current&&(!p&&x.setIcon(m.current,"camera"),p&&x.setIcon(m.current,"camera-off"))},[m.current,p]);const w=O.useCallback(()=>{o.setting.open(),o.setting.openTabById(r.id||"obsidian-memos")},[o]);return O.useEffect(()=>{},[p]),y.jsxs("div",{ref:d,className:mr("moments-view",p?"show-editor":""),children:[y.jsxs("div",{className:"moments-view-background-wrapper",children:[y.jsx(iJ,{}),y.jsx("div",{ref:m,className:"moments-show-editor-btn",onClick:()=>{(p||a)&&g(!p),!p&&!a&&new aC(o).open()}}),y.jsxs("div",{className:"moments-view-background-overlay",children:[y.jsxs("div",{className:"moments-view-user-info",children:[y.jsx("div",{className:"moments-view-user-name",children:s==null?void 0:s.UserName}),y.jsx(aJ,{userIcon:s==null?void 0:s.MomentsIcon})]}),y.jsx("div",{className:"moments-view-user-idea",children:s.MomentsQuote||" "})]})]}),u.map((D,S)=>y.jsx(lJ,{thino:D,handleOpenSettings:w},D.createdAt+S))]})},iJ=()=>{const{dailyNotesState:{view:e,settings:t}}=O.useContext(wt),[n,r]=O.useState((t==null?void 0:t.MomentsBackgroundImage)||ew);return O.useEffect(()=>{if(!(t!=null&&t.MomentsBackgroundImage)){r(document.body.hasClass("theme-dark")?I2:ew);return}r(t==null?void 0:t.MomentsBackgroundImage)},[t==null?void 0:t.MomentsBackgroundImage]),O.useEffect(()=>{e&&e.registerEvent(e.app.workspace.on("css-change",()=>{r(document.body.hasClass("theme-dark")&&!(t!=null&&t.MomentsBackgroundImage)?I2:!document.body.hasClass("theme-dark")&&!(t!=null&&t.MomentsBackgroundImage)?ew:t==null?void 0:t.MomentsBackgroundImage)}))},[e]),y.jsx("div",{className:"moments-view-background",style:{backgroundImage:`url(${n})`}})},sJ=e=>{const{icon:t}=e,n=O.useCallback(()=>{app.setting.open(),app.setting.openTabById(manifest.id||"obsidian-memos")},[]);return y.jsx("div",{className:"thino-moment-icon",ref:r=>{if(t){r==null||r.empty();return}t||r&&x.setIcon(r,"Memos")},style:{backgroundImage:`url(${t})`},onClick:n})},lJ=e=>{const{dailyNotesState:{settings:t}}=O.useContext(wt),n=O.useRef(null),r=O.useRef(null),{thino:a}=e;return O.useEffect(()=>{n.current&&x.setIcon(n.current,"more-horizontal")},[n.current]),y.jsxs("div",{className:"thino-moment-wrapper",children:[y.jsx(sJ,{icon:t==null?void 0:t.MomentsIcon}),y.jsxs("div",{ref:r,className:"thino-moment-container",children:[y.jsx("div",{className:"thino-moment-user-name",children:t==null?void 0:t.UserName}),y.jsx("div",{className:"thino-moment-user-content",children:y.jsx(Ua,{memo:a})})]})]})};function cJ(e){const t=e.filter(r=>r.pinned),n=e.filter(r=>!r.pinned);return[...t,...n]}function xv(e,t){const n={},r={day:"YYYY-MM-DD",week:"YYYY-[W]WW",month:"YYYY-MM",quarter:"YYYY-[Q]1",year:"YYYY"};for(const a of e){const o=x.moment(a.createdAt,"YYYY/MM/DD HH:mm:ss").format(r[t]);if(a.pinned){n.PINNED||(n.PINNED=[]),n.PINNED.push(a);continue}n[o]||(n[o]=[]),n[o].push(a)}return n}function Lg(e){const{tag:t,duration:n,type:r,text:a,filter:o}=e,s=tn.getQueryById(o);return!(!!(t||n&&n.from{const r=e.filter(g=>g.rowStatus!=="ARCHIVED"&&!(g.deletedAt!==""&&g.deletedAt)),{tag:a,duration:o,type:s,text:u,filter:d}=t,m=tn.getQueryById(d);return!!(a||o&&o.from{let w=!0;if(g.thinoType!==void 0&&n&&g.thinoType==="TASK-DONE"&&(w=!1),g.content.contains("comment:")&&(w=!1),m){const D=JSON.parse(m.querystring);Array.isArray(D)&&(w=$d(g,D))}if(a){const D=new Set;for(const S of Array.from(g.content.match(An)||[])){const E=S.replace(An,"$1").trim().split("/");let A="";for(const N of E)A+=N,D.add(A),A+="/"}for(const S of Array.from(g.content.match($n)||[])){const E=S.replace($n,"$1").trim().split("/");let A="";for(const N of E)A+=N,D.add(A),A+="/"}for(const S of Array.from(g.content.match(hr)||[])){const E=S.replace(hr,"$2").trim().split("/");let A="";for(const N of E)A+=N,D.add(A),A+="/"}D.has(a)||(w=!1)}return o&&o.fromo.to)&&(w=!1),s&&(s==="NOT_TAGGED"&&(g.content.match(An)!==null||g.content.match(hr)!==null||g.content.match($n)!==null)||s==="LINKED"&&g.content.match(Rc)===null||s==="IMAGED"&&g.content.match(_c)===null||s==="CONNECTED"&&g.content.match(Il)===null)&&(w=!1),u&&!g.content.toLowerCase().includes(u.toLowerCase())&&(w=!1),w}):r.filter(g=>!g.content.contains("comment:"))},dJ=({updateThinos:e})=>{var $;const{locationState:{query:t},memoState:{memos:n},globalState:{memoListView:r},dailyNotesState:{app:a,settings:o,verifyState:s,plugin:u}}=O.useContext(wt),[d,m]=O.useState(!1),[p,g]=O.useState(!1),[w,D,S]=Br([]),[T,E]=O.useState([]),[A,N]=O.useState({}),[R,F]=O.useState(($=window.app||a)==null?void 0:$.loadLocalStorage("thinoListView")),[H,P]=O.useState((a==null?void 0:a.loadLocalStorage("showDayMark"))||!1),[L,z]=O.useState((a==null?void 0:a.loadLocalStorage("dayMarkRange"))||"day"),[U,W,K]=Br([]),ae=O.useRef(0),ce=O.useRef(!1),fe=O.useRef(null),ie=O.useRef(null),ge=O.useRef(null),Te=O.useRef(null),se=O.useRef(!1);O.useEffect(()=>{F(r),a&&a.saveLocalStorage("thinoListView",r),D(U.slice(0,w.length>20?Math.min(w.length,40):40))},[r]),O.useEffect(()=>()=>{ie.current&&(ie.current=null),ge.current&&(ge.current=null),Te.current&&(Te.current=null)},[]),O.useLayoutEffect(()=>{if((n.length!==0||!a)&&se.current===!0)return;const X=fJ(a);!X||X.length===0||(W(X),E(X),P((a==null?void 0:a.loadLocalStorage("showDayMark"))||!1),a!=null&&a.loadLocalStorage("showDayMark")&&N(xv(X,(a==null?void 0:a.loadLocalStorage("dayMarkRange"))||"day")))},[a]),O.useEffect(()=>{if(n.length===0&&!Ie.initialized)return;m(!1);const X=cJ(n),ve=uJ({tempMemos:X,query:t,HideDoneTasks:(o==null?void 0:o.HideDoneTasks)||!1});return se.current=!0,e&&e(ve),W(ve),()=>{se.current=!1}},[n,t,o==null?void 0:o.HideDoneTasks]),O.useEffect(()=>{D(U.slice(0,w.length>20?Math.min(w.length,40):40))},[U]),O.useEffect(()=>{var X;w.length<40&&((X=ge.current)==null||X.click())},[U]),O.useEffect(()=>{(Lg(t)&&w.length0||!Lg(t)&&w.length===U.length&&U.length>0)&&g(!0),hJ(w||[],a),E(w),a==null||a.saveLocalStorage("showDayMark",o==null?void 0:o.showDayMark),a==null||a.saveLocalStorage("dayMarkRange",o==null?void 0:o.dayMarkRange),P((o==null?void 0:o.showDayMark)||!1),z((o==null?void 0:o.dayMarkRange)||"day"),o!=null&&o.showDayMark&&N(xv(w,o==null?void 0:o.dayMarkRange))},[w,o==null?void 0:o.showDayMark,o==null?void 0:o.dayMarkRange]),O.useEffect(()=>{if(!ie.current)return;const X=async()=>{ce.current||(ae.current++,await we(),ae.current>=1&&(ce.current=!0,setTimeout(()=>{ae.current=0,ce.current=!1},3e3)))};w.length<40&&X();const ve=new IntersectionObserver(([De])=>{if(De.isIntersecting){if(p)return;X()}else ae.current=0,ce.current=!1});return ie!=null&&ie.current&&ve.observe(ie.current),()=>{ie!=null&&ie.current&&ve.unobserve(ie.current)}},[d,p,ie.current]),O.useEffect(()=>{var X;(X=Te.current)==null||X.scrollTo({top:0})},[t]);const we=async()=>{try{if(K.current.length>S.current.length){m(!0);const X=Math.min(S.current.length+40,K.current.length)-S.current.length,ve=K.current.slice(S.current.length,S.current.length+X);D(De=>[...De,...ve]),m(!1),g(ve.length<40)}}catch(X){console.error(X),new x.Notice(X.response.data.message)}},Z=O.useMemo(()=>y.jsx("div",{ref:ie,className:mr("status-text-container",R==="calendar"||R==="table"?"hidden":""),children:y.jsx("p",{className:"status-text",children:d?k("Fetching data..."):p?U.length===0?k("Noooop!"):k("All Data is Loaded 🎉"):y.jsx(y.Fragment,{children:y.jsx("span",{ref:ge,className:"cursor-pointer hover:text-green-600",onClick:we,children:k("fetch more")})})})}),[R,we,U,d,p,ie]);return y.jsxs("div",{className:`memolist-wrapper ${p?"completed":""}`,ref:Te,children:[R==="chat"&&Z,y.jsxs("div",{ref:fe,className:"memolist-container",children:[R==="chat"&&y.jsx(eJ,{thinos:T}),R==="calendar"&&y.jsx(UG,{thinos:U}),R==="table"&&y.jsx(Kq,{thinos:U}),R==="moments"&&y.jsx(oJ,{thinos:T}),R==="list"&&y.jsx(hv,{breakpointCols:1,className:`${R}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:H?y.jsx(y.Fragment,{children:Object.keys(A).map(X=>y.jsx(ZD,{type:"list",thinos:A[X],dayMark:X,dayMarkRange:L},X))}):T.map((X,ve)=>y.jsx(Ua,{memo:X},`${X.id}-${x.moment(X.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${ve}`))}),R==="waterfall"&&y.jsx(y.Fragment,{children:H&&Object.keys(A).length>0?Object.keys(A).map(X=>y.jsx(ZD,{type:"waterfall",thinos:A[X],dayMark:X,dayMarkRange:L},X)):y.jsx(hv,{breakpointCols:3,className:`${R}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:T.map((X,ve)=>y.jsx(Ua,{memo:X},`${X.id}-${x.moment(X.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${ve}`))})})]}),R!=="chat"&&Z]})};function oC(e){return`memosListCache:${e}`}function fJ(e){var t;try{const n=oC(e==null?void 0:e.appId),r=Kn.get([n])[n];return r?((t=JSON.parse(r))==null?void 0:t.memos)||[]:[]}catch(n){return console.error(n),[]}}function hJ(e,t){try{if(!e)return;const n=e==null?void 0:e.slice(0,100),r=oC(t==null?void 0:t.appId);Kn.set({[r]:JSON.stringify({memos:n})})}catch(n){console.error(n)}}const Tc=async e=>{const{app:t,settings:n}=rt.getState();if(!n.startSync||!(t!=null&&t.loadLocalStorage("tokenForSync")))return;const r=await _A(e);if(!r||r.length===0)return;r.sort((s,u)=>x.moment(s.createdAt,"YYYY/MM/DD HH:mm:ss").isAfter(x.moment(u.createdAt,"YYYY/MM/DD HH:mm:ss"))?1:-1);const a=r.filter(s=>!s.deleted),o=r.filter(s=>s.deleted);for(let s=0;s{if(!t||!r||!n||!(t==null?void 0:t.loadLocalStorage("tokenForSync"))||!e.startSync)return;s.current=window.setInterval(async()=>{const w=Jw(t);await Tc(w)},3e4),n.registerInterval(s.current);const g=Jw(t);return Tc(g),()=>{s.current&&window.clearInterval(s.current)}},[n,t,r,e.startSync]);const m=[y.jsx(Om,{thinosCount:u.length,thinos:u},"filter"),y.jsx(dJ,{updateThinos:p=>{d(p)}},"list")];return y.jsx(y.Fragment,{children:a==="chat"?y.jsx(y.Fragment,{children:[y.jsx(ev,{syncThino:Tc},"header"),...m.reverse(),y.jsx(Cd,{className:"mod-editor-bottom",editorType:"inline"},"editor")]}):y.jsx(y.Fragment,{children:o?[y.jsx(ev,{syncThino:Tc},"header"),...m,y.jsx(Cd,{className:"mod-editor-bottom",editorType:"block"},"editor")]:[y.jsx(ev,{syncThino:Tc},"header"),y.jsx(Cd,{editorType:"block"},"editor"),...m]})})}function pJ(e){try{e!=null&&e.saveLocalStorage&&(e==null||e.saveLocalStorage("thinoLastUpdated",x.moment("2000-01-01 00:01:00","YYYY-MM-DD HH:mm:ss").format("x")))}catch(t){console.error(t)}}function Jw(e){try{const t=(e==null?void 0:e.loadLocalStorage)&&(e==null?void 0:e.loadLocalStorage("thinoLastUpdated"));return t||x.moment("2000-01-01 00:01:00","YYYY-MM-DD HH:mm:ss").format("x")}catch(t){return console.error(t),x.moment().format("x")}}function gJ(e){try{e!=null&&e.saveLocalStorage&&(e==null||e.saveLocalStorage("thinoLastUpdated",x.moment().format("x")))}catch(t){console.error(t)}}function Yc(e=!0){const[t,n]=O.useState({isLoading:e,isFailed:!1,isSucceed:!1,isPending:!1});return{...t,setLoading:()=>{n({...t,isLoading:!0,isFailed:!1,isPending:!1,isSucceed:!1})},setFinish:()=>{n({...t,isLoading:!1,isFailed:!1,isPending:!1,isSucceed:!0})},setError:()=>{n({...t,isLoading:!1,isFailed:!0,isPending:!1,isSucceed:!1})},setPending:()=>{n({...t,isLoading:!1,isFailed:!1,isPending:!0,isSucceed:!1})}}}const vJ={text:k("SELECT"),value:""},yJ=e=>{const{className:t,dataSource:n,handleValueChanged:r,value:a}=e,[o,s]=_o(!1),u=O.useRef(null);let d=vJ;for(const g of n)if(g.value===a){d=g;break}O.useEffect(()=>{if(o){const g=w=>{var D;(D=u.current)!=null&&D.contains(w.target)||s(!1)};window.addEventListener("click",g,{capture:!0,once:!0})}},[o]);const m=g=>{r&&r(g.value),s(!1)},p=g=>{g.stopPropagation(),s()};return y.jsxs("div",{className:`selector-wrapper ${t||""}`,ref:u,children:[y.jsxs("div",{className:`current-value-container ${o?"active":""}`,onClick:p,children:[y.jsx("span",{className:"value-text",children:d.text}),y.jsx("span",{ref:g=>{g&&x.setIcon(g,"chevron-right")},className:"btn arrow-text"})]}),y.jsx("div",{className:`items-wrapper ${o?"":"hidden"}`,children:n.map(g=>y.jsx("div",{className:`item-container ${g.value===a?"selected":""}`,onClick:()=>{m(g)},children:g.text},g.value))})]})},bd=O.memo(yJ),cb=e=>{const{destroy:t,queryId:n,type:r="dialog"}=e,[a,o]=O.useState(""),[s,u]=O.useState(r!=="dialog"?[SD()]:[]),d=Yc(!1),[m,p]=O.useState(!1),[g,w]=_o(!1),D=Ie.getState().memos.filter(P=>!(P.deletedAt!==""&&P.deletedAt)).filter(P=>$d(P,s)).length;O.useEffect(()=>{S()},[n]);const S=()=>{const P=tn.getQueryById(n??"");if(P){o(P.title);const L=JSON.parse(P.querystring);return Array.isArray(L)&&u(L),P}},T=P=>{const L=P.target.value;o(L)},E=async()=>{if(!a)return new x.Notice(k("TITLE CANNOT BE NULL!")),null;if(s.length===0)return new x.Notice(k("FILTER CANNOT BE NULL!")),null;if(s.length===1&&s[s.length-1].value.value==="")return new x.Notice(k("Please finish the last filter setting first")),null;let P;try{n&&!n.startsWith("Filter [Temp] ")?(P=await tn.updateQuery(n,a,JSON.stringify(s)),tn.editQuery(P),await tn.getMyAllQueries()):(P=await tn.createQuery(a,JSON.stringify(s)),tn.pushQuery(P),await tn.getMyAllQueries())}catch(L){new x.Notice(L.message)}return P},A=async()=>{switch(r){case"modal":case"inline":if(s.length===0){new x.Notice(k("FILTER CANNOT BE NULL!"));return}if(s.length===1&&s[s.length-1].value.value===""){new x.Notice(k("Please finish the last filter setting first"));return}try{const P=tn.getQueryById(n??"");if(P&&JSON.stringify(s)===P.querystring){We.setMemoFilter(P.id),t();return}const L=tn.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(s));tn.pushQuery(L),We.setMemoFilter(L.id)}catch(P){new x.Notice(P.message)}t();break;case"dialog":try{if(!await E())return}catch(P){console.error(P),new x.Notice(P.message)}t();break}},N=()=>{if(s.length===0){new x.Notice(k("FILTER CANNOT BE NULL!"));return}if(m){We.setMemoFilter(""),p(!1);return}const P=tn.getQueryById(n??"");if(P&&JSON.stringify(s)===P.querystring){We.setMemoFilter(P.id);return}const L=tn.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(s));tn.pushQuery(L),We.setMemoFilter(L.id),e.setPreview&&e.setPreview(L.id),p(!0)},R=()=>{if(s.length>0&&s[s.length-1].value.value===""){new x.Notice(k("Please finish the last filter setting first"));return}u([...s,SD()])},F=O.useCallback((P,L)=>{u(z=>{const U=[...z];return U[P]=L,U})},[]),H=O.useCallback(P=>{u(L=>L.filter((U,W)=>W!==P))},[]);return y.jsxs(y.Fragment,{children:[r==="dialog"&&y.jsxs("div",{className:"dialog-header-container",children:[y.jsxs("span",{className:"title-text",children:[y.jsx("span",{className:"icon-text",children:"🔖"}),k(n?"EDIT QUERY":"CREATE QUERY")]}),y.jsx("button",{ref:P=>{P&&x.setIcon(P,"x")},className:"btn close-btn",onClick:t})]}),y.jsxs("div",{className:"dialog-content-container",children:[(r==="dialog"||g)&&y.jsxs("div",{className:"form-item-container input-form-container",children:[y.jsx("span",{className:"normal-text",children:k("TITLE")}),y.jsx("input",{className:"title-input",type:"text",value:a,onChange:T})]}),y.jsxs("div",{className:"form-item-container filter-form-container",children:[y.jsx("span",{className:"normal-text",children:k("FILTER")}),y.jsxs("div",{className:"filters-wrapper",children:[s.map((P,L)=>y.jsx(bJ,{index:L,filter:P,handleFilterChange:F,handleFilterRemove:H},L)),y.jsx("div",{className:"create-filter-btn",onClick:R,children:k("ADD FILTER TERMS")})]})]})]}),y.jsx("div",{className:"dialog-footer-container",children:y.jsxs("div",{className:"btns-container",children:[(r==="inline"||r==="modal")&&y.jsx("button",{className:`btn ${g?"mod-cta":"save-btn"}`,onClick:async()=>{if(!g)w();else{const P=await E();w(!1),t(),P&&We.setMemoFilter(P.id)}},children:k(g?"Set and save":"Save")}),y.jsxs("div",{className:"btns-group-container",children:[y.jsxs("span",{className:`tip-text ${s.length===0&&"hidden"}`,children:[k("MATCH")," Thino ",y.jsx("strong",{children:D})," ",k("TIMES")]}),y.jsx(y.Fragment,{children:r==="inline"&&y.jsx("button",{className:"btn mod-cta",onClick:N,children:k("Preview")})}),y.jsx("button",{className:`btn save-btn ${d.isLoading?"requesting":""}`,onClick:A,children:k(r==="inline"||r==="modal"?"Filter":n?"EDIT":"Save")})]})]})})]})},wJ=e=>{const{index:t,filter:n,handleFilterChange:r,handleFilterRemove:a}=e,{type:o}=n,s=O.useRef(null),u=O.useRef(null),d=O.useRef(n),m=O.useRef(o);O.useEffect(()=>{d.current=e.filter},[n]),O.useEffect(()=>{if(s.current)return o==="TAG"&&!u.current&&(m.current=o,u.current=new dE(s.current,D)),()=>{u.current&&(u.current.destroy(),u.current=null)}},[s,o]);const p=O.useCallback(E=>{["AND","OR"].includes(E)&&r(t,{...n,relation:E})},[n]),g=O.useCallback(async E=>{var A;if(n.type!==E){const{verifyState:N}=rt.getState(),R=!x.Platform.isDesktop&&await((A=window.Capacitor)==null?void 0:A.Plugins.Device.getId()),F=x.Platform.isDesktop?await zn():R.identifier||R.uuid,H=N&&(N==null?void 0:N.appId)===F;if(E==="SOURCE"&&!H){fn();return}const P=Object.values(hl[E].operators);r(t,{...n,type:E,value:{operator:P[0].value,value:""}})}},[n]),w=O.useCallback(E=>{r(t,{...n,value:{...n.value,operator:E}})},[n]),D=O.useCallback(E=>{r(t,{...d.current,value:{...d.current.value,value:E}})},[n]),S=()=>{a(t)},T={TYPE:y.jsx(bd,{className:"value-selector",dataSource:hl.TYPE.values,value:n.value.value,handleValueChanged:D}),LIST:y.jsx(bd,{className:"value-selector",dataSource:hl.LIST.values,value:n.value.value,handleValueChanged:D}),SOURCE:y.jsx(bd,{className:"value-selector",dataSource:hl.SOURCE.values,value:n.value.value,handleValueChanged:D}),TAG:y.jsx("input",{type:"text",id:Math.random().toString(36).substring(7),className:"value-inputer",ref:s,value:n.value.value,onChange:E=>{D(E.target.value)}}),TEXT:y.jsx("input",{type:"text",className:"value-inputer",value:n.value.value,onChange:E=>{D(E.target.value)}}),DATE:y.jsxs("div",{className:"date-inputer",children:[y.jsx(dv,{type:"icon",handleValueChange:D}),y.jsx("input",{type:"text",className:"value-inputer",value:n.value.value,onChange:E=>{D(E.target.value)}})]})};return y.jsxs("div",{className:"memo-filter-input-wrapper",children:[t>0&&y.jsx(bd,{className:"relation-selector",dataSource:t8,value:n.relation,handleValueChanged:p}),y.jsx(bd,{className:"type-selector",dataSource:Object.values(hl),value:n.type,handleValueChanged:g}),y.jsxs(y.Fragment,{children:[Object.keys(hl).includes(o)&&y.jsx(bd,{className:"operator-selector",dataSource:Object.values(hl[o].operators),value:n.value.operator,handleValueChanged:w}),T[o]]}),y.jsx("div",{ref:E=>{E&&x.setIcon(E,"x")},className:"btn remove-btn",onClick:S})]})},bJ=O.memo(wJ);function Kw(e){xm({className:"create-query-dialog"},cb,{queryId:e})}const iC=e=>{var D,S;const{dailyNotesState:{app:t,verifyState:n},locationState:{query:r}}=O.useContext(wt),a=q.useRef(null),[o,s]=q.useState(!1),u=q.useRef(null),[d,m]=q.useState(""),p=zv(a.current,u.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,10]}}]});O.useEffect(()=>{o&&p.update&&(p==null||p.update())},[o]),O.useEffect(()=>{a&&x.setIcon(a.current,"filter")},[a]);const g=async()=>{var A;const T=!x.Platform.isDesktop&&await((A=window.Capacitor)==null?void 0:A.Plugins.Device.getId()),E=x.Platform.isDesktop?await zn():T.identifier||T.uuid;return!n||(n==null?void 0:n.appId)!==E?(fn(),!1):!0};return Mm(u,()=>{s(!1),d&&We.getState().query.filter===d&&We.setMemoFilter("")}),y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"thino-inline-filter-wrapper pro",ref:a,onClick:async()=>{await g()&&(x.Platform.isDesktop?(s(!o),await(p==null?void 0:p.update())):new DJ(rt.getState().app,r.filter,E=>{m(E)}).open())}}),y.jsx("div",{ref:u,className:`thino-inline-filter-container ${o?"":"hidden"}`,style:p.styles.popper,children:o&&y.jsx(cb,{type:"inline",queryId:(D=r.filter)!=null&&D.startsWith("Filter [Temp] ")&&!((S=r.filter)!=null&&S.includes("Filter [Temp]"))?"":r.filter,destroy:()=>{s(!1)},setPreview:T=>{m(T)}})})]})};class DJ extends x.Modal{constructor(n,r,a){super(n);he(this,"root");he(this,"setPreview");this.filter=r,this.setPreview=a}onOpen(){var r,a;const{contentEl:n}=this;this.root=Lv(n),this.root.render(y.jsx(Sl,{store:Ee,context:wt,children:y.jsx("div",{className:"thino-inline-filter-container",children:y.jsx(cb,{type:"modal",queryId:(r=this.filter)!=null&&r.startsWith("Filter [Temp] ")&&!((a=this.filter)!=null&&a.includes("Filter [Temp]"))?"":this.filter,destroy:()=>{this.close()},setPreview:o=>{this.setPreview(o)}})})}))}onClose(){var n;(n=this.root)==null||n.unmount()}}const sC=()=>{const{dailyNotesState:{app:e},globalState:{isMobileView:t,showSiderbarInMobileView:n}}=O.useContext(wt),[r]=O.useState(q.createRef());O.useEffect(()=>{if(!r.current)return;const o=r.current;x.setIcon(o,"refresh-cw")},[r.current]);const a=O.useCallback(async()=>{if(!(t&&n)){if(Tc){const o=Jw(e);await Tc(o)}await Ie.fetchAllMemos()}},[]);return y.jsx("span",{className:"refresh-icon",ref:r,onClick:()=>{a(),r&&r.current.firstElementChild.toggleClass("rotate-hidden",!0),setTimeout(()=>{r&&r.current.firstElementChild.toggleClass("rotate-hidden",!1)},1e3)}})},ev=()=>{const{locationState:{query:{filter:e}},globalState:{isMobileView:t},queryState:{queries:n}}=O.useContext(wt),[r,a]=O.useState("THINO");O.useEffect(()=>{const s=tn.getQueryById(e);a(s?s.title:"THINO")},[e,n]);const o=O.useCallback(s=>{s.stopPropagation(),Qe.setShowSiderbarInMobileView(!0)},[]);return y.jsxs("div",{className:"section-header-container memos-header-container",children:[y.jsxs("div",{className:"title-text",children:[y.jsx(lo,{when:t,children:y.jsx("button",{ref:s=>{s&&x.setIcon(s,"menu")},className:"btn action-btn clickable-icon",onClick:o})}),y.jsx("span",{className:"normal-text",children:r}),y.jsx(sC,{})]}),y.jsxs("div",{className:"memos-header-search-section",children:[y.jsx(h8,{}),y.jsx(f8,{}),y.jsx(iC,{}),y.jsx(Rv,{})]})]})},SJ=()=>{const{dailyNotesState:{settings:e,app:t,verifyState:n},globalState:{manifest:r,showSiderbarInMobileView:a,isMobileView:o}}=O.useContext(wt),[s,u]=O.useState("Memos"),[d,m]=O.useState(!1);O.useEffect(()=>{e&&u(e.UserName)},[e]);const p=O.useCallback(()=>{We.pushHistory("/"),We.clearQuery()},[]),g=()=>{const w=document.querySelector(".memos-sidebar-wrapper"),D=document.querySelector(".menu-btns-popup");D.style.top=70-w.scrollTop+"px",m(!0)};return y.jsxs("div",{className:"user-banner-container",children:[y.jsxs("div",{className:"userinfo-header-container",children:[y.jsxs("span",{className:"username-container",children:[y.jsx("span",{className:"username-text",onClick:p,children:s==="MEMO 😉"?"THINO 😉":s||"THINO"}),y.jsx("span",{className:`user-pro-badge ${n?"activated":""}`,onClick:()=>{t.setting.open(),t.setting.openTabById(r.id||"obsidian-memos")},children:"PRO"})]}),y.jsxs("span",{className:"btn-group",children:[(e==null?void 0:e.DefaultThemeForThino)==="modern"&&!o&&y.jsx(sC,{}),y.jsx("span",{ref:w=>{w&&w.hasChildNodes()||w&&x.setIcon(w,"more-horizontal")},className:"btn action-btn menu-popup-btn",onClick:g}),a&&y.jsx("span",{ref:w=>{w&&w.hasChildNodes()||w&&x.setIcon(w,"x")},className:"btn action-btn",onClick:()=>{Qe.setShowSiderbarInMobileView(!1)}})]}),y.jsx(JA,{shownStatus:d,setShownStatus:m})]}),y.jsx(LT,{statusType:"banner"})]})},T2=()=>{const{queryState:{queries:e},dailyNotesState:{app:t},locationState:{query:{filter:n}}}=O.useContext(wt),r=Yc(),[a,o]=O.useState([]);return O.useEffect(()=>{const s=e.filter(u=>{var d,m;return!((d=u.id)!=null&&d.toString().startsWith("Filter [Temp]"))&&!((m=u.id)!=null&&m.toString().includes("Filter [Temp]"))}).sort((u,d)=>{if(d.pinnedAt&&!u.pinnedAt)return 1;if(u.pinnedAt&&!d.pinnedAt)return-1;const m=Re.getTimeStampByDate(u.pinnedAt||u.createdAt);return Re.getTimeStampByDate(d.pinnedAt||d.createdAt)-m});o(s)},[e]),O.useEffect(()=>{tn.getMyAllQueries().catch(()=>{}).finally(()=>{r.setFinish()})},[t]),y.jsxs("div",{className:"queries-wrapper",children:[y.jsxs("span",{className:"title-text",children:[y.jsx("span",{className:"normal-text",children:k("QUERY")}),y.jsx("span",{ref:s=>{s&&x.setIcon(s,"plus")},className:"btn create-query-btn",onClick:()=>Kw()})]}),y.jsx(lo,{when:r.isSucceed&&a.length===0,children:y.jsx("div",{className:"create-query-btn-container",children:y.jsx("span",{className:"btn",onClick:()=>Kw(),children:k("CREATE FILTER")})})}),y.jsx("div",{className:"queries-container",children:a.map(s=>y.jsx(IJ,{query:s,isActive:s.id===n},`${s.id}-${x.moment(s.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}`))})]})},IJ=e=>{const{query:t,isActive:n}=e,[r,a]=_o(!1),[o,s]=_o(!1),u=()=>{We.setMemoFilter(n?"":t.id)},d=T=>{T.stopPropagation(),a()},m=()=>{a(!1)},p=async T=>{if(T.stopPropagation(),o)try{await tn.deleteQuery(t.id)}catch(E){new x.Notice(E.message)}else s()},g=T=>{T.stopPropagation(),Kw(t.id)},w=async T=>{T.stopPropagation();try{t.pinnedAt?await tn.unpinQuery(t.id):await tn.pinQuery(t.id),tn.editQuery({...t,pinnedAt:t.pinnedAt?"":Re.getDateTimeString(Date.now())})}catch(E){console.error(E)}},D=()=>{s(!1)},S=O.useMemo(()=>y.jsxs("div",{className:"action-btns-container",children:[y.jsxs("span",{className:"btn",onClick:w,children:[y.jsx("span",{ref:T=>{T&&x.setIcon(T,t.pinnedAt?"pin-off":"pin")},className:"icon-text"}),y.jsx("span",{className:"normal-text",children:t.pinnedAt?k("UNPIN"):k("PIN")})]}),y.jsxs("span",{className:"btn",onClick:g,children:[y.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&x.setIcon(T,"edit")},className:"icon-text"}),y.jsx("span",{className:"normal-text",children:k("EDIT")})]}),y.jsxs("span",{className:`btn delete-btn ${o?"final-confirm":""}`,onClick:p,onMouseLeave:D,children:[y.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&x.setIcon(T,"trash-2")},className:"icon-text"}),y.jsx("span",{className:"normal-text",children:k(o?"CONFIRM!":"DELETE")})]})]}),[t.pinnedAt,o]);return y.jsx(y.Fragment,{children:y.jsxs("div",{className:`query-item-container ${n?"active":""}`,onClick:u,children:[y.jsxs("div",{className:"query-text-container",children:[y.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&x.setIcon(T,"filter")},className:"icon-text"}),y.jsxs("span",{className:"query-text",children:[t.title,t.pinnedAt&&" 📌"]})]}),y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&x.setIcon(T,"more-horizontal")},className:"btn action-btn toggle-btn",onClick:d}),y.jsx("div",{className:`action-btns-wrapper ${r?"":"hidden"}`,onMouseLeave:m,children:S})]})]})})},E2=()=>{var p;const{locationState:{query:{tag:e}},dailyNotesState:{app:t},memoState:{tags:n,tagsNum:r,memos:a}}=O.useContext(wt),[o,s]=O.useState([]),[u,d]=O.useState(((p=t||app)==null?void 0:p.loadLocalStorage("thino-tag-sort-order"))||"alphabetical");O.useEffect(()=>{var w;const g=(w=t||app)==null?void 0:w.loadLocalStorage("thino-temp-tags");s(g||[])},[]),O.useEffect(()=>{Ie.updateTagsState()},[a]),O.useEffect(()=>{const g=Array.from(n).sort(),w={subTags:[]};for(const D of g){const S=D.split("/");let T=w,E="";for(let A=0;A{var g;Ie.initialized&&((g=t||app)==null||g.saveLocalStorage("thino-temp-tags",o))},[o]);const m=g=>{g.stopPropagation();const w=new x.Menu;for(const D of["alphabetical","alphabeticalReverse","byCount","byCountReverse"])w.addItem(S=>{S.setTitle(k(D)).onClick(()=>{d(D),t==null||t.saveLocalStorage("thino-tag-sort-order",D)}).setChecked(u===D)}),D==="alphabeticalReverse"&&w.addSeparator();w.showAtMouseEvent(g.nativeEvent)};return y.jsxs("div",{className:"tags-wrapper",children:[y.jsxs("div",{className:"tags-header title-text",children:[y.jsx("span",{className:"normal-text",children:k("Frequently Used Tags")}),y.jsx("span",{ref:g=>{g&&x.setIcon(g,"arrow-down-narrow-wide")},className:"tags-sort-btn",onClick:m})]}),y.jsxs("div",{className:"tags-container",children:[o.sort(TJ(u)).map((g,w)=>y.jsx(lC,{tag:g,tagQuery:e},g.text+"-"+w)),y.jsx(lo,{when:o.length<5&&Ie.initialized,children:y.jsxs("span",{className:"tag-tip-container",children:[k("Input")," ",y.jsxs("span",{className:"code-text",children:[k("#Tag")," "]}),k("to create tag"),"..."]})})]})]})},lC=e=>{const{tag:t,tagQuery:n}=e,r=n===t.text,a=t.subTags.length>0,[o,s]=_o(!1),u=()=>{r?We.setTagQuery(""):(Re.copyTextToClipboard(`#${t.text} `),["/","/recycle","/archive","/daily"].includes(We.getState().pathname)||We.setPathname("/"),We.setTagQuery(t.text))},d=m=>{m.stopPropagation(),s()};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:`tag-item-container ${r?"active":""}`,onClick:u,children:[y.jsxs("div",{className:"tag-text-container",children:[y.jsx("span",{ref:m=>{m&&x.setIcon(m,"hash")},className:"btn tag-btn"}),y.jsx("span",{className:"tag-text",children:t.key})]}),y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{className:"tag-count",children:t.count}),a?y.jsx("span",{ref:m=>{m&&x.setIcon(m,"chevron-right")},className:`btn action-btn toggle-btn ${o?"shown":""}`,onClick:d}):null]})]}),a?y.jsx("div",{className:`subtags-container ${o?"":"hidden"}`,children:t.subTags.map((m,p)=>y.jsx(lC,{tag:m,tagQuery:n},m.text+"-"+p))}):null]})},x2=new Intl.Collator(void 0,{usage:"sort",sensitivity:"base",numeric:!0}).compare,tw={alphabetical:(e,t)=>x2(e.text,t.text),alphabeticalReverse:(e,t)=>-x2(e.text,t.text),byCount:(e,t)=>t.count-e.count,byCountReverse:(e,t)=>e.count-t.count},TJ=(e="byCount")=>tw.hasOwnProperty(e)?tw[e]:tw.alphabetical;class Ke extends x.Setting{constructor(n,r){super(n);he(this,"settingTab");he(this,"name","");he(this,"desc","");this.settingTab=r}setName(n){return super.setName(n),this.name=n,this}setDesc(n){return super.setDesc(n),this.desc=n,this}setTab(n){const r=typeof this.name=="string"?this.name:this.name.textContent||"",a=typeof this.desc=="string"?this.desc:this.desc.textContent||"";return this.settingTab.addSettingToMasterSettingsList(n,this.settingEl,r,a),this}}class EJ extends x.Modal{constructor(n,r,a,o,s){super(n);he(this,"plugin");he(this,"settingTab");he(this,"target",5);he(this,"cb");this.app=n,this.settingTab=r,this.plugin=a,this.target=o,this.cb=s}onOpen(){var u;const{contentEl:n}=this;(u=n.parentElement)==null||u.classList.add("memo-save-location-modal"),n.createEl("h3",{text:k("Thino Daily Target")});const r=n.createDiv("modal-setting");new Ke(r,this.settingTab).setName(k("Target Thino Count")).addSlider(d=>{d.setDynamicTooltip().setValue(this.target).setLimits(1,30,1).onChange(async m=>{this.target=m})});const a=n.createDiv("button-group"),o=a.createEl("button",{text:k("Cancel")}),s=a.createEl("button",{text:k("Save")});s.onclick=async()=>{this.plugin.settings.MemoDailyTarget=this.target,this.settingTab.applySettingsUpdate(),this.cb(this.target),this.close()},o.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}const xJ=({allStat:e,todayTimeStamp:t,calendarType:n,handleCalendarTypeChange:r})=>{const{dailyNotesState:{app:a,settings:o},globalState:{manifest:s}}=O.useContext(wt),[u,d]=O.useState(),[m,p]=O.useState(5),[g,w]=O.useState(0),[D,S]=O.useState(0),[T,E]=O.useState(o.HeatmapColorScheme||"default"),A=O.useRef(null),N=O.useRef(null);O.useEffect(()=>{o.HeatmapColorScheme&&E(o.HeatmapColorScheme)},[o.HeatmapColorScheme]),O.useEffect(()=>{let F,H=5;s&&a&&(F=a==null?void 0:a.plugins.getPlugin(s.id),H=F==null?void 0:F.settings.MemoDailyTarget,d(F)),p(H)},[s,a]),O.useEffect(()=>{const F=e.find(L=>L.timestamp===t),H=F?F.count:0;S(H);const P=Math.min(100,H/m*100);w(P)},[e,m]),O.useEffect(()=>{x.requireApiVersion("1.4.4")&&(x.setTooltip(N.current,g.toFixed(2)+"%"),x.setTooltip(A.current,k("Set daily target")+` (${D}/${m})`))},[g,D]),O.useEffect(()=>{A.current&&(A.current.hasChildNodes()||x.setIcon(A.current,"crosshair"),x.requireApiVersion("1.4.4")&&x.setTooltip(N.current,g+"%"))},[A,m]);const R=O.useCallback(()=>{if(!u)return;new EJ(a,u==null?void 0:u.settingTab,u,m,H=>{p(H)}).open()},[u,m]);return y.jsx(y.Fragment,{children:y.jsxs("div",{className:`usage-daily-progress-wrapper heatmap-${T}`,children:[y.jsx("div",{ref:N,className:"daily-progress-bar",children:y.jsx("div",{className:"daily-progress-bar-inner",style:{width:`${g}%`}})}),y.jsx("div",{ref:A,className:"daily-progress-target",onClick:R}),y.jsx("div",{ref:F=>{F&&x.setIcon(F,n==="basic"?"layout-grid":"calendar"),F&&x.setTooltip&&x.setTooltip(F,k("Switch calendar type"))},className:"switch-calendar-type-btn",onClick:()=>r&&r(n==="basic"?"heatmap":"basic")})]})})},CJ=e=>{const{className:t,view:n,datestamp:r,handleDateStampChange:a,handleDateItemClick:o,handleMonthChange:s,dailyStat:u}=e,d=x.moment().startOf("day").valueOf(),[m,p]=O.useState(_h(r)),[g,w]=O.useState(null);O.useEffect(()=>{p(_h(r))},[r]);const D=new Date(m),S=D.getDay(),T=[];for(let N=0;N{const R=D.getFullYear(),F=D.getMonth()+1;let H=0;F===1&&N===-1?H=new Date(`${R-1}/12/1`).getTime():F===12&&N===1?H=new Date(`${R+1}/1/1`).getTime():H=new Date(`${R}/${F+N}/1`).getTime(),p(_h(H)),s&&s(H)};return y.jsxs("div",{className:`heatmap-date-picker-wrapper ${t}`,children:[y.jsxs("div",{className:"date-picker-header",children:[y.jsx("span",{ref:N=>{N&&x.setIcon(N,"chevron-left")},className:"btn btn-text",onClick:()=>A(-1)}),y.jsxs("span",{className:"normal-text",children:[y.jsx(zT,{year:D.getFullYear().toString(),handleYearChange:N=>{p(_h(new Date(`${N}/${D.getMonth()+1}/1`).getTime()))}}),y.jsx(UT,{month:D.getMonth().toString(),handleMonthChange:N=>{p(_h(new Date(`${D.getFullYear()}/${parseInt(N)}/1`).getTime()))}})]}),y.jsx("span",{ref:N=>{N&&x.setIcon(N,"chevron-right")},className:"btn btn-text",onClick:()=>A(1)})]}),y.jsxs("div",{className:"date-picker-day-container",children:[y.jsx("div",{className:"date-picker-day-header",children:k("weekDaysShort").map(N=>y.jsx("span",{className:"day-item",children:N},N))}),y.jsx("div",{className:"date-picker-day-content",children:T.map(N=>{if(N.date===0)return y.jsx("span",{className:"day-item null",children:""},N.datestamp);const R=u.find(P=>P.timestamp===N.datestamp)||{count:0,timestamp:N.datestamp,list:0},F=R.count-R.list,H=R.list;return y.jsxs("span",{className:`day-item ${N.datestamp===d?"current":""} ${N.datestamp===g?"selected":""} ${nw(R.count)}`,onClick:P=>{a(r,P.nativeEvent),w(N.datestamp===g?null:N.datestamp),o&&o(P,R)},onMouseOver:P=>{if(!R||!R.count)return;const L=new x.HoverPopover(n,P.currentTarget,100);MJ(L,{d:N,list:H,task:F})},children:[y.jsx("span",{className:"day-item-text",children:N.date}),y.jsx(y.Fragment,{children:R&&R.count!==0&&y.jsxs("span",{className:"day-item-dots",children:[F>0&&y.jsx("div",{className:`day-item-dot thino-task-dot ${nw(F)}`}),H>0&&y.jsx("div",{className:`day-item-dot thino-list-dot ${nw(H)}`})]})})]},N.datestamp)})})]})]})};function MJ(e,{d:t,list:n,task:r}){e.hoverEl.toggleClass("thino-hover-popover",!0);const a=e.hoverEl.createDiv({cls:"thino-hover-popover-content"});a.createDiv({cls:"thino-date-item",text:`${x.moment(t.datestamp).format("YYYY-MM-DD")}`});const o=a.createDiv({cls:"thino-task-item"});o.createSpan({cls:"thino-task-item-title-text",text:`${k("Task")}: `}),o.createSpan({cls:"thino-task-item-title-count",text:`${r}`});const s=a.createDiv({cls:"thino-list-item"});s.createSpan({cls:"thino-list-item-title-text",text:`${k("List")}: `}),s.createSpan({cls:"thino-list-item-title-count",text:`${n}`})}function NJ(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return((n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-n.getTime())/Ba}function _h(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}function nw(e){return e<=0?"":e<=1?"stat-day-L1-bg":e<=2?"stat-day-L2-bg":e<=4?"stat-day-L3-bg":"stat-day-L4-bg"}const C2={width:12,height:7},M2=(e,t)=>{const n=[];for(let r=0;r<=e;r++)n.push({timestamp:parseInt(x.moment(t).add(r,"days").format("x")),count:0,list:0});return n},N2=()=>{const e=parseInt(x.moment().endOf("day").format("x")),t=new Date(e).getDay()||7,n=parseInt(x.moment().startOf("day").format("x")),r=new Array(7-(t===7?1:t)).fill(0),a=(C2.width-1)*C2.height+t,o=parseInt(x.moment().startOf("day").subtract(a,"days").format("x")),s=x.moment().startOf("day").subtract(a,"days"),{memoState:{memos:u},dailyNotesState:{view:d,app:m,settings:p,verifyState:g}}=O.useContext(wt),[w,D]=Br(AJ(m||window.app)||"heatmap"),[S,T]=Br(x.moment().startOf("day").valueOf()),[E,A]=Br(p.HeatmapColorScheme||"default"),[N,R]=Br(M2(a,o)),[F,H]=Br(null),[P,L]=Br(null),[z,U,W]=Br(""),K=O.useRef(null),ae=O.useRef(null);O.useEffect(()=>{const se=M2(a,o),we=u.filter(Z=>!Z.deletedAt&&Z.rowStatus!=="ARCHIVED");for(const Z of we){const X=x.moment(Z.createdAt.replaceAll("/","-"),"YYYY-MM-DD HH:mm:ss").startOf("day").diff(s,"days");X>=0&&X{p.HeatmapColorScheme&&A(p.HeatmapColorScheme)},[p.HeatmapColorScheme]);const ce=O.useCallback((se,we)=>{var De;if(H(we),!ae.current)return;const{isMobileView:Z}=Qe.getState(),$=se.target,X=document.querySelector(".memos-sidebar-wrapper");ae.current.style.left=$.offsetLeft-(((De=K.current)==null?void 0:De.offsetLeft)??0)+"px";let ve=$.offsetTop;Z||(ve-=X==null?void 0:X.scrollTop),ae.current.style.top=ve+"px"},[]),fe=O.useCallback(()=>{H(null)},[]),ie=()=>{D(w==="heatmap"?"basic":"heatmap"),kJ(m,w==="heatmap"?"basic":"heatmap"),T(x.moment().startOf("day").valueOf())},ge=O.useCallback(async(se,we)=>{if(we.count===0)return;const Z=We.getState().query.duration,$=Z==null?void 0:Z.from,X=Z==null?void 0:Z.to,ve=x.moment($).diff(X,"day")==0;if($===we.timestamp&&ve)We.setFromAndToQuery(0,0),L(null),U(null);else if($!==we.timestamp&&$>0&&se.shiftKey){const De=x.moment(we.timestamp).endOf("day").diff(X,"day");$===0&&se.shiftKey?U("from"):De<0&&ve&&U("to"),x.moment($).isBefore(we.timestamp)?W.current==="to"?De<0?We.setFromAndToQuery(we.timestamp,X):(We.setFromAndToQuery(parseInt(x.moment(X).startOf("day").format("x")),parseInt(x.moment(we.timestamp).endOf("day").format("x"))),U("from")):W.current==="from"&&(De<0,We.setFromAndToQuery($,parseInt(x.moment(we.timestamp).endOf("day").format("x")))):W.current==="to"?We.setFromAndToQuery(we.timestamp,X):W.current==="from"&&(We.setFromAndToQuery(we.timestamp,parseInt(x.moment($).endOf("day").format("x"))),U("to"))}else if($===0&&se.shiftKey)We.setFromAndToQuery(we.timestamp,parseInt(x.moment().endOf("day").format("x")));else if(we.count>0&&(se.ctrlKey||se.metaKey)){const{app:De,dailyNotes:be}=rt.getState(),ke=kv(x.moment(we.timestamp),be);if(!x.Platform.isMobile)await De.workspace.getLeaf("split").openFile(ke);else{let Be=De.workspace.activeLeaf;Be===null&&(Be=De.workspace.getLeaf(!0)),Be.openFile(ke)}}else we.count>0&&!se.shiftKey&&!se.ctrlKey&&!se.metaKey&&(["/","/recycle"].includes(We.getState().pathname)||We.setPathname("/"),We.setFromAndToQuery(we.timestamp,Re.getTimeStampByDate(x.moment(we.timestamp+Ba).subtract(1,"days").endOf("day").format("YYYY-MM-DD HH:mm:ss"))),L(we))},[]),Te=O.useMemo(()=>y.jsx(CJ,{className:`heatmap-${E}`,view:d,datestamp:S,dailyStat:N,handleMonthChange:se=>{T(se)},handleDateStampChange:se=>{},handleDateItemClick:(se,we)=>ge(se,we)}),[JSON.stringify(N),d,S,E]);return y.jsxs(y.Fragment,{children:[w==="basic"&&Te,w==="heatmap"&&y.jsxs("div",{className:`usage-heat-map-wrapper heatmap-${E}`,ref:K,children:[y.jsxs("div",{className:"day-tip-text-container",children:[y.jsx("span",{className:"tip-text",children:k("weekDaysShort")[0]}),y.jsx("span",{className:"tip-text"}),y.jsx("span",{className:"tip-text",children:k("weekDaysShort")[2]}),y.jsx("span",{className:"tip-text"}),y.jsx("span",{className:"tip-text",children:k("weekDaysShort")[4]}),y.jsx("span",{className:"tip-text"}),y.jsx("span",{className:"tip-text",children:k("weekDaysShort")[6]})]}),y.jsxs("div",{ref:ae,className:"usage-detail-container pop-up "+(F?"":"hidden"),children:[F==null?void 0:F.count," thino ",k("on")," ",y.jsx("span",{className:"date-text",children:x.moment(F==null?void 0:F.timestamp,"x").format("YYYY/MM/DD ddd")})]}),y.jsxs("div",{className:"usage-heat-map",children:[N.map((se,we)=>{const Z=se.count,$=Z<=0?"":Z<=1?"stat-day-L1-bg":Z<=2?"stat-day-L2-bg":Z<=4?"stat-day-L3-bg":"stat-day-L4-bg";return y.jsx("span",{className:`stat-container ${$} ${P===se?"current":""} ${n===se.timestamp?"today":""}`,onMouseEnter:X=>ce(X,se),onMouseLeave:fe,onClick:X=>ge(X,se)},we)}),r.map((se,we)=>y.jsx("span",{className:"stat-container null"},we))]})]}),g&&y.jsx(xJ,{allStat:N,todayTimeStamp:n,calendarType:w,handleCalendarTypeChange:ie})]})};function kJ(e,t){try{e==null||e.saveLocalStorage("calendarType",t)}catch(n){console.error(n)}}function AJ(e){try{return(e==null?void 0:e.loadLocalStorage("calendarType"))||"heatmap"}catch(t){return console.error(t),"heatmap"}}const k2=()=>{const{dailyNotesState:{app:e,settings:t,verifyState:n}}=O.useContext(wt),r=[{name:k("Random Review"),path:"/review",iconID:"star"},{name:k("ARCHIVE"),path:"/archive",iconID:"archive"},{name:k("Recycle bin"),path:"/recycle",iconID:"recycle"}],a=O.useRef([]);return O.useEffect(()=>{a.current.forEach((o,s)=>{o&&x.setIcon(o,r[s].iconID)})},[t,a]),y.jsx(y.Fragment,{children:y.jsx("div",{className:"path-entry-wrapper",children:r.map((o,s)=>y.jsx(y.Fragment,{children:y.jsxs("div",{className:`path-entry-container ${We.getState().pathname===o.path?"active":""} ${t.DeleteThinoDirectly&&o.path==="/recycle"?"hidden":""} ${o.path==="/review"&&"pro"}`,onClick:async()=>{var m;const u=!x.Platform.isDesktop&&await((m=window.Capacitor)==null?void 0:m.Plugins.Device.getId()),d=x.Platform.isDesktop?await zn():u.identifier||u.uuid;if(!n&&(n==null?void 0:n.appId)!==d&&o.path==="/review"){fn();return}We.setPathname(o.path),We.clearQuery(),o.path==="/review"&&We.getState().pathname==="/review"&&e.workspace.trigger("refresh-review-memos")},children:[y.jsx("span",{ref:u=>a.current[s]=u,className:"path-entry-icon"}),y.jsx("span",{className:"path-entry-text",children:o.name})]},s)}))})})},A2=e=>{const{dailyNotesState:{settings:t},locationState:n,globalState:{isMobileView:r,showSiderbarInMobileView:a}}=O.useContext(wt),o=O.useRef(null),s=O.useMemo(()=>u=>{var m,p,g;const d=Qe.getState().showSiderbarInMobileView;if(!d){window.removeEventListener("click",s,{capture:!0});return}(m=o.current)!=null&&m.contains(u.target)||(g=(p=o.current)==null?void 0:p.parentNode)!=null&&g.contains(u.target)&&(d&&u.stopPropagation(),Qe.setShowSiderbarInMobileView(!1),window.removeEventListener("click",s,{capture:!0}))},[]);return O.useEffect(()=>{Qe.setShowSiderbarInMobileView(!1)},[n]),O.useEffect(()=>{a?document.body.classList.add(Hb):document.body.classList.remove(Hb)},[a]),O.useEffect(()=>{r&&a&&window.addEventListener("click",s,{capture:!0})},[r,a]),y.jsxs("aside",{className:mr("memos-sidebar-wrapper",e.className),ref:o,children:[e.children,y.jsx(SJ,{}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="right"?y.jsx(N2,{}):null:y.jsx(N2,{}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="left"?y.jsxs(y.Fragment,{children:[y.jsx(k2,{}),y.jsx(T2,{}),y.jsx(LT,{statusType:"sidebar"})]}):null:y.jsxs(y.Fragment,{children:[y.jsx(k2,{}),y.jsx(T2,{})]}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="right"?y.jsx(y.Fragment,{children:y.jsx(E2,{})}):null:y.jsx(y.Fragment,{children:y.jsx(E2,{})})]})},OJ=()=>{const{dailyNotesState:{settings:e}}=O.useContext(wt),[t,n]=q.useState(""),r=a=>{n(a.target.value)};return y.jsx("div",{className:"locked-screen-wrapper",children:y.jsxs("div",{className:"locked-screen-content",children:[y.jsx("div",{className:"locked-screen-header",children:y.jsx("div",{className:"locked-screen-header-title",children:k("Locked")})}),y.jsx("div",{className:"locked-screen-body",children:y.jsxs("div",{className:"locked-screen-body-content",children:[y.jsxs("div",{className:"locked-screen-body-content-text",children:[y.jsx("div",{className:"locked-screen-body-content-text-title",children:k("Thino is locked")}),y.jsx("div",{className:"locked-screen-body-content-text-desc",children:k("Please unlock Thino by input password")})]}),y.jsxs("div",{className:"locked-screen-body-content-inputer",children:[y.jsx("input",{onChange:r,value:t,type:"password",className:"locked-screen-body-content-input"}),y.jsx("button",{className:"locked-screen-body-content-btn",onClick:()=>{(e==null?void 0:e.password)===t?Qe.setLocked(!1):new x.Notice(k("Password is incorrect"))},children:k("Unlock")})]})]})})]})})};function FJ(){const{dailyNotesState:{settings:e,verifyState:t},locationState:{pathname:n},globalState:{isMobileView:r,memoListView:a,globalEditorShown:o,locked:s}}=O.useContext(wt),u=O.useRef(null);return O.useEffect(()=>{if(!e.needVerify){Qe.setLocked(!1);return}Qe.setLocked(!0)},[e==null?void 0:e.needVerify]),O.useEffect(()=>{if(!u.current)return;(async()=>{var g;const m=!x.Platform.isDesktop&&await((g=window.Capacitor)==null?void 0:g.Plugins.Device.getId()),p=x.Platform.isDesktop?await zn():m.identifier||m.uuid;!t||(t==null?void 0:t.appId)!==p?u.current.toggleClass("hide-pro",!0):u.current.toggleClass("hide-pro",!1)})()},[t,u.current]),y.jsxs(y.Fragment,{children:[s&&y.jsx(OJ,{}),!s&&o&&y.jsx(Cd,{editorType:"block"}),!s&&!o&&y.jsx("section",{ref:u,id:"page-wrapper","data-path":n,className:mr(`memos-${n==="/"?a:"list"}-view`,(e==null?void 0:e.DefaultThemeForThino)==="modern"?"modern":"classic"),children:y.jsxs(y.Fragment,{children:[y.jsx(A2,{sidebarPosition:"left",className:"left-sidebar"}),y.jsx("main",{className:"content-wrapper",children:JJ(n)}),(e==null?void 0:e.DefaultThemeForThino)==="modern"&&!r?y.jsx(A2,{sidebarPosition:"right",className:"right-sidebar"}):null]})})]})}const PJ={"*":y.jsx(FJ,{})},jJ=e=>{const{memo:t,handleDeletedMemoAction:n}=e,{dailyNotesState:r}=O.useContext(wt),a={...t,createdAtStr:Re.getDateTimeString(t.createdAt),deletedAtStr:Re.getDateTimeString(t.deletedAt||t.createdAt)},o=q.useRef(null),s=q.useRef(null),[u,d]=q.useState(""),[m,p]=_o(!1),g={restore:O.useRef(null),delete:O.useRef(null),source:O.useRef(null)};O.useEffect(()=>{s&&(x.setIcon(g.restore.current,"archive-restore"),x.setIcon(g.delete.current,"trash"),x.setIcon(g.source.current,"home"))},[s]),O.useEffect(()=>{if(!o.current||!s.current||o.current.hasChildNodes()&&t.content===u||!r.view)return;const E=r.view;d(t.content),o.current.hasChildNodes()&&o.current.empty();async function A(){var R;await x.MarkdownRenderer.render(r.app,t.content+` `,o.current,t.path,E);const N=(R=o.current)==null?void 0:R.querySelectorAll(".internal-link");N==null||N.forEach(F=>{const H=F,P=H.getAttribute("data-href");if(!P)return;r.app.metadataCache.getFirstLinkpathDest(P,t.path)||F.classList.add("is-unresolved"),H.addEventListener("mouseover",z=>{z.stopPropagation(),r.app.workspace.trigger("hover-link",{event:z,source:"thino",hoverParent:E.containerEl,targetEl:H,linktext:P,sourcePath:H.href})})})}A()},[t.content,s]);const w=async()=>{if(m)try{await Ie.deleteMemoById(a.id),n(a.id)}catch(E){new x.Notice(E.message)}else p()},D=async()=>{switch(a.sourceType){case"DAILY":await p1(a.id,a.path);break;case"CANVAS":await v1(a.id,a.path);break;case"MULTI":await m1(a.path);break;case"FILE":await g1(a.id,a.path);break}},S=async()=>{try{const E=await Ie.restoreMemoById(a.id),A=r.app,N=A==null?void 0:A.loadLocalStorage("tokenForSync");E&&E.webId&&N&&r.settings.startSync&&await AT(E.webId),E&&Ie.editMemo(E),n(a.id),new x.Notice(k("RESTORE SUCCEED"))}catch(E){new x.Notice(E.message)}},T=()=>{m&&p(!1)};return y.jsxs("div",{ref:s,className:`memo-wrapper ${"memos-"+a.id}`,onMouseLeave:T,children:[y.jsxs("div",{className:"memo-top-wrapper",children:[y.jsxs("span",{className:"time-text",children:[k("DELETE AT")," ",a.deletedAtStr]}),y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:E=>{E&&x.setIcon(E,"more-horizontal")},className:"btn more-action-btn"}),y.jsx("div",{className:"more-action-btns-wrapper",children:y.jsxs("div",{className:"more-action-btns-container",children:[y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:g.restore,className:"more-action-item-icon"}),y.jsx("span",{className:"btn restore-btn",onClick:S,children:k("RESTORE")})]}),y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:g.source,className:"more-action-item-icon"}),y.jsx("span",{className:"btn",onClick:D,children:k("SOURCE")})]}),y.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[y.jsx("span",{ref:g.delete,className:"more-action-item-icon"}),y.jsx("span",{className:`btn delete-btn ${m?"final-confirm":""}`,onClick:w,children:k(m?"CONFIRM!":"DELETE")})]})]})})]})]}),y.jsx("div",{ref:o,className:"memo-content-text",onContextMenu:E=>{E.preventDefault(),E.stopPropagation()}})]})},LJ=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:s,filter:u}=t,d=tn.getQueryById(u);return!!(r||a&&a.from{let g=!0;if(p.thinoType!==void 0&&n&&p.thinoType==="TASK-DONE"&&(g=!1),p.content.contains("comment:")&&(g=!1),d){const w=JSON.parse(d.querystring);Array.isArray(w)&&(g=$d(p,w))}if(r){const w=new Set;for(const D of Array.from(p.content.match(An)||[])){const T=D.replace(An,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match($n)||[])){const T=D.replace($n,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match(hr)||[])){const T=D.replace(hr,"$2").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}w.has(r)||(g=!1)}return a&&a.froma.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(p.content.match(An)!==null||p.content.match(hr)!==null||p.content.match($n)!==null)||o==="LINKED"&&p.content.match(Rc)===null||o==="IMAGED"&&p.content.match(_c)===null||o==="CONNECTED"&&p.content.match(Il)===null)&&(g=!1),s&&!p.content.toLowerCase().includes(s.toLowerCase())&&(g=!1),g}):e.filter(p=>!p.content.contains("comment:"))},RJ=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=O.useContext(wt),r=Yc(),[a,o]=O.useState([]),s=q.useRef(null);O.useEffect(()=>{const m=LJ({memos:n.filter(p=>p.deletedAt!==""&&p.deletedAt),query:e,HideDoneTasks:!1});o(m),r.setFinish()},[n,s.current,e]);const u=O.useCallback(m=>{o(p=>p.filter(g=>g.id!==m))},[]),d=O.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]);return y.jsxs("div",{className:"memo-trash-wrapper",ref:s,children:[y.jsxs("div",{className:"section-header-container",children:[y.jsxs("div",{className:"title-text",children:[y.jsx(lo,{when:t,children:y.jsx("button",{ref:m=>{m&&x.setIcon(m,"menu")},className:"btn action-btn clickable-icon",onClick:d})}),y.jsx("span",{className:"normal-text",children:k("Recycle bin")}),y.jsxs("span",{className:"go-home-btn",onClick:()=>{We.clearQuery(),We.setPathname("/")},children:["🏠 ",k("Return To Home Page")]})]}),y.jsx(Rv,{})]}),y.jsx(Om,{thinosCount:a.length,thinos:a}),r.isLoading?y.jsx("div",{className:"tip-text-container",children:y.jsx("span",{className:"tip-text",children:k("Fetching data...")})}):a.length===0?y.jsx("div",{className:"tip-text-container",children:y.jsx("span",{className:"tip-text",children:k("Here is No Memos.")})}):y.jsx("div",{className:"deleted-memos-container",children:a.map(m=>y.jsx(jJ,{memo:m,handleDeletedMemoAction:u},`${m.id}-${m.updatedAt}`))})]})},Rg="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='currentColor'%3e%3cpath%20d='M0%200h24v24H0V0z'%20fill='none'/%3e%3cpath%20d='M19%203H5c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h14c1.1%200%202-.9%202-2V5c0-1.1-.9-2-2-2zm0%2016H5V5h14v14zM17.99%209l-1.41-1.42-6.59%206.59-2.58-2.57-1.42%201.41%204%203.99z'/%3e%3c/svg%3e",_g="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='currentColor'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='none'%20d='M0%200h24v24H0V0z'/%3e%3cpath%20d='M19%205v14H5V5h14m0-2H5c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h14c1.1%200%202-.9%202-2V5c0-1.1-.9-2-2-2z'/%3e%3c/svg%3e",_J=()=>{const{globalState:e}=O.useContext(wt),{useTinyUndoHistoryCache:t,shouldHideImageUrl:n,shouldSplitMemoWord:r,shouldUseMarkdownParser:a}=e,o=`👋 你好呀~欢迎使用memos! * ✨ **开源项目**; * 😋 精美且细节的视觉样式; * 📑 体验优良的交互逻辑;`,s=()=>{Qe.setAppSetting({useTinyUndoHistoryCache:!t})},u=()=>{Qe.setAppSetting({shouldSplitMemoWord:!r})},d=()=>{Qe.setAppSetting({shouldHideImageUrl:!n})},m=()=>{Qe.setAppSetting({shouldUseMarkdownParser:!a})},p=async()=>{const g=Ie.getState().memos.map(S=>({...S})),w=JSON.stringify(g),D=document.createElement("a");D.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(w)),D.setAttribute("download","data.json"),D.style.display="none",document.body.appendChild(D),D.click(),document.body.removeChild(D)};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"section-container preferences-section-container",children:[y.jsx("p",{className:"title-text",children:"Memo 显示相关"}),y.jsx("div",{className:"demo-content-container memo-content-text",dangerouslySetInnerHTML:{__html:hw(o)}}),y.jsxs("label",{className:"form-label checkbox-form-label",onClick:u,children:[y.jsx("span",{className:"normal-text",children:"中英文内容自动间隔"}),y.jsx("img",{className:"icon-img",src:r?Rg:_g})]}),y.jsxs("label",{className:"form-label checkbox-form-label",onClick:m,children:[y.jsx("span",{className:"normal-text",children:"部分 markdown 格式解析"}),y.jsx("img",{className:"icon-img",src:a?Rg:_g})]}),y.jsxs("label",{className:"form-label checkbox-form-label",onClick:d,children:[y.jsx("span",{className:"normal-text",children:"隐藏图片链接地址"}),y.jsx("img",{className:"icon-img",src:n?Rg:_g})]})]}),y.jsxs("div",{className:"section-container preferences-section-container",children:[y.jsx("p",{className:"title-text",children:"编辑器"}),y.jsxs("label",{className:"form-label checkbox-form-label",onClick:s,children:[y.jsxs("span",{className:"normal-text",children:["启用"," ",y.jsx("a",{target:"_blank",href:"https://github.com/boojack/tiny-undo",onClick:g=>g.stopPropagation(),rel:"noreferrer",children:"tiny-undo"})]}),y.jsx("img",{className:"icon-img",src:t?Rg:_g})]})]}),y.jsxs("div",{className:"section-container hidden",children:[y.jsx("p",{className:"title-text",children:"其他"}),y.jsx("div",{className:"btn-container",children:y.jsx("button",{className:"btn export-btn",onClick:p,children:"导出数据(JSON)"})})]})]})},HJ=()=>{const{globalState:{isMobileView:e}}=O.useContext(wt);O.useEffect(()=>{Ie.fetchAllMemos()},[]);const t=O.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]);return y.jsxs("div",{className:"preference-wrapper",children:[y.jsx("div",{className:"section-header-container",children:y.jsxs("div",{className:"title-text",children:[y.jsx(lo,{when:e,children:y.jsx("button",{className:"action-btn",onClick:t})}),y.jsx("span",{className:"normal-text",children:"账号与设置"})]})}),y.jsx("div",{className:"sections-wrapper",children:y.jsx(_J,{})})]})},BJ=e=>{const{dailyNotesState:{app:t,settings:n,view:r}}=O.useContext(wt),{memo:a,handleUnarchivedMemoAction:o}=e,s=q.useRef(null),u=q.useRef(null),[d,m]=q.useState(""),p={...a,createdAtStr:Re.getDateTimeString(a.createdAt),deletedAtStr:Re.getDateTimeString(a.deletedAt||a.createdAt)},[g,w]=_o(!1),D={restore:O.useRef(null),delete:O.useRef(null),source:O.useRef(null)};O.useEffect(()=>{u&&(x.setIcon(D.restore.current,"archive-restore"),x.setIcon(D.delete.current,"trash"),x.setIcon(D.source.current,"home"))},[u]),O.useEffect(()=>{if(!s.current||!u.current||s.current.hasChildNodes()&&a.content===d||!r)return;m(a.content),s.current.hasChildNodes()&&s.current.empty();async function N(){var F;await x.MarkdownRenderer.render(t,a.content+` `,s.current,a.path,r);const R=(F=s.current)==null?void 0:F.querySelectorAll(".internal-link");R==null||R.forEach(H=>{const P=H,L=P.getAttribute("data-href");if(!L)return;t.metadataCache.getFirstLinkpathDest(L,a.path)||H.classList.add("is-unresolved"),P.addEventListener("mouseover",U=>{U.stopPropagation(),t.workspace.trigger("hover-link",{event:U,source:"thino",hoverParent:r.containerEl,targetEl:P,linktext:L,sourcePath:P.href})})})}N()},[a.content,u]);const S=async()=>{switch(p.sourceType){case"DAILY":await p1(p.id,p.path);break;case"CANVAS":await v1(p.id,p.path);break;case"MULTI":await m1(p.path);break;case"FILE":await g1(p.id,p.path);break}},T=async()=>{if(g)try{if(n.DeleteThinoDirectly)await Ie.deleteMemoById(p.id);else{const N=await Ie.hideMemoById(p.id);N&&Ie.editMemo(N)}}catch(N){new x.Notice(N.message)}else w()},E=async()=>{try{const N=await Ie.unarchiveMemo(p);N&&Ie.editMemo(N),o(p.id),new x.Notice(k("RESTORE SUCCEED"))}catch(N){new x.Notice(N.message)}},A=()=>{g&&w(!1)};return y.jsxs("div",{ref:u,className:`memo-wrapper ${"memos-"+p.id}`,onMouseLeave:A,children:[y.jsxs("div",{className:"memo-top-wrapper",children:[y.jsxs("span",{className:"time-text",children:[k("ARCHIVED AT")," ",p.updatedAt]}),y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:N=>{N&&x.setIcon(N,"more-horizontal")},className:"btn more-action-btn"}),y.jsx("div",{className:"more-action-btns-wrapper",children:y.jsxs("div",{className:"more-action-btns-container",children:[y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:D.restore,className:"more-action-item-icon"}),y.jsx("span",{className:"btn restore-btn",onClick:E,children:k("RESTORE")})]}),y.jsxs("div",{className:"more-action-menu-item",children:[y.jsx("span",{ref:D.source,className:"more-action-item-icon"}),y.jsx("span",{className:"btn",onClick:S,children:k("SOURCE")})]}),y.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[y.jsx("span",{ref:D.delete,className:"more-action-item-icon"}),y.jsx("span",{className:`btn delete-btn ${g?"final-confirm":""}`,onClick:T,children:k(g?"CONFIRM!":"DELETE")})]})]})})]})]}),y.jsx("div",{ref:s,className:"memo-content-text"})]})},YJ=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:s,filter:u}=t,d=tn.getQueryById(u);return!!(r||a&&a.from{let g=!0;if(p.thinoType!==void 0&&n&&p.thinoType==="TASK-DONE"&&(g=!1),p.content.contains("comment:")&&(g=!1),d){const w=JSON.parse(d.querystring);Array.isArray(w)&&(g=$d(p,w))}if(r){const w=new Set;for(const D of Array.from(p.content.match(An)||[])){const T=D.replace(An,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match($n)||[])){const T=D.replace($n,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match(hr)||[])){const T=D.replace(hr,"$2").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}w.has(r)||(g=!1)}return a&&a.froma.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(p.content.match(An)!==null||p.content.match(hr)!==null||p.content.match($n)!==null)||o==="LINKED"&&p.content.match(Rc)===null||o==="IMAGED"&&p.content.match(_c)===null||o==="CONNECTED"&&p.content.match(Il)===null)&&(g=!1),s&&!p.content.toLowerCase().includes(s.toLowerCase())&&(g=!1),g}):e.filter(p=>!p.content.contains("comment:"))},zJ=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=O.useContext(wt),r=Yc(),[a,o]=O.useState([]),s=q.useRef(null);O.useEffect(()=>{const p=YJ({memos:n.filter(g=>g.rowStatus==="ARCHIVED"&&g.deletedAt===""),query:e,HideDoneTasks:!1});o(p),r.setFinish()},[n,s.current,e]);const u=O.useCallback(p=>{o(g=>g.filter(w=>w.id!==p))},[]),d=O.useCallback(p=>{o(g=>g.filter(w=>w.id!==p))},[]),m=O.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]);return y.jsxs("div",{className:"memo-trash-wrapper",ref:s,children:[y.jsxs("div",{className:"section-header-container",children:[y.jsxs("div",{className:"title-text",children:[y.jsx(lo,{when:t,children:y.jsx("button",{ref:p=>{p&&x.setIcon(p,"menu")},className:"btn action-btn clickable-icon",onClick:m})}),y.jsx("span",{className:"normal-text",children:k("ARCHIVE")}),y.jsxs("span",{className:"go-home-btn",onClick:()=>{We.clearQuery(),We.setPathname("/")},children:["🏠 ",k("Return To Home Page")]})]}),y.jsx(Rv,{})]}),y.jsx(Om,{thinosCount:a.length,thinos:a}),r.isLoading?y.jsx("div",{className:"tip-text-container",children:y.jsx("p",{className:"tip-text",children:k("Fetching data...")})}):a.length===0?y.jsx("div",{className:"tip-text-container",children:y.jsx("p",{className:"tip-text",children:k("Here is No Memos.")})}):y.jsx("div",{className:"deleted-memos-container",children:a.map(p=>y.jsx(BJ,{memo:p,handleUnarchivedMemoAction:d,handleDeletedMemoAction:u},`${p.id}-${p.updatedAt}`))})]})},UJ=()=>{const{dailyNotesState:{app:e},locationState:{query:t},globalState:{isMobileView:n,changedByMemos:r},memoState:{memos:a}}=O.useContext(wt),o=Yc(),[s,u]=O.useState([]),[d,m]=O.useState([]),p=q.useRef(null),g=q.useRef(null),[w,D]=O.useState(!1),[S,T]=O.useState([]),E=q.useRef([]),A=O.useCallback(({memos:F,query:H,HideDoneTasks:P})=>{const{tag:L,duration:z,type:U,text:W,filter:K}=H,ae=tn.getQueryById(K);return!!(L||z&&z.from{let ie=!0;if(fe.thinoType!==void 0&&P&&fe.thinoType==="TASK-DONE"&&(ie=!1),fe.content.contains("comment:")&&(ie=!1),ae){const ge=JSON.parse(ae.querystring);Array.isArray(ge)&&(ie=$d(fe,ge))}if(L){const ge=new Set;for(const Te of Array.from(fe.content.match(An)||[])){const we=Te.replace(An,"$1").trim().split("/");let Z="";for(const $ of we)Z+=$,ge.add(Z),Z+="/"}for(const Te of Array.from(fe.content.match($n)||[])){const we=Te.replace($n,"$1").trim().split("/");let Z="";for(const $ of we)Z+=$,ge.add(Z),Z+="/"}for(const Te of Array.from(fe.content.match(hr)||[])){const we=Te.replace(hr,"$2").trim().split("/");let Z="";for(const $ of we)Z+=$,ge.add(Z),Z+="/"}ge.has(L)||(ie=!1)}return z&&z.fromz.to)&&(ie=!1),U&&(U==="NOT_TAGGED"&&(fe.content.match(An)!==null||fe.content.match($n)!==null)||U==="LINKED"&&fe.content.match(Rc)===null||U==="IMAGED"&&fe.content.match(_c)===null||U==="CONNECTED"&&fe.content.match(Il)===null)&&(ie=!1),W&&!fe.content.toLowerCase().includes(W.toLowerCase())&&(ie=!1),ie}):F},[]);O.useEffect(()=>{g.current&&(x.setIcon(g.current,"refresh-cw"),e.workspace.on("refresh-review-memos",R))},[g]),O.useEffect(()=>{if(!w)return;const F=[...S].sort(()=>Math.random()-Math.random()).slice(0,10);u(F),D(!1)},[w]),O.useEffect(()=>{if(!(S.length>0))return;const F=[...S].sort(()=>Math.random()-Math.random()).slice(0,10);u(F),D(!1)},[S]),O.useEffect(()=>{p.current&&(T(A({memos:a,query:t,HideDoneTasks:!1}).filter(F=>F.rowStatus!=="ARCHIVED"&&!(F.deletedAt!==""&&F.deletedAt))),o.setFinish(),We.clearQuery())},[a,p.current]),O.useEffect(()=>{if(r&&E.current.length>0){const F=S.filter(P=>E.current.includes(P.id)),H=E.current.map(P=>F.find(L=>L.id===P)).filter(P=>P!==void 0);m(H);return}E.current=s.map(F=>F.id),m(s)},[s]),O.useEffect(()=>{if(s.length===0)return;const F=A({memos:s,query:t,HideDoneTasks:!1});m(F)},[t]);const N=O.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]),R=()=>{D(!0)};return y.jsxs("div",{className:"memo-review-wrapper",ref:p,children:[y.jsx("div",{className:"section-header-container",children:y.jsxs("div",{className:"title-wrapper",children:[y.jsxs("div",{className:"title-btns-left-wrapper",children:[y.jsx(lo,{when:n,children:y.jsx("button",{ref:F=>{F&&x.setIcon(F,"menu")},className:"btn action-btn clickable-icon",onClick:N})}),y.jsx("span",{className:"normal-text",children:k("Random Review")}),y.jsx("span",{ref:g,onClick:R,className:"refresh-icon"})]}),y.jsx("div",{className:"title-btns-right-wrapper",children:y.jsxs("span",{className:"go-home-btn",onClick:()=>{We.setPathname("/")},children:["🏠 ",k("Return To Home Page")]})})]})}),y.jsx(Om,{}),o.isLoading?y.jsx("div",{className:"tip-text-container",children:y.jsx("span",{className:"tip-text",children:k("Fetching data...")})}):a.length===0?y.jsx("div",{className:"tip-text-container",children:y.jsx("span",{className:"tip-text",children:k("Here is No Memos.")})}):y.jsx("div",{className:"review-memos-container",children:d.map(F=>y.jsx(Ua,{memo:F},`${F==null?void 0:F.id}-${F.createdAt}`))})]})},VJ=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:s,filter:u}=t,d=tn.getQueryById(u);return!!(r||a&&a.from{let g=!0;if(p.thinoType!==void 0&&n&&p.thinoType==="TASK-DONE"&&(g=!1),p.content.contains("comment:")&&(g=!1),d){const w=JSON.parse(d.querystring);Array.isArray(w)&&(g=$d(p,w))}if(r){const w=new Set;for(const D of Array.from(p.content.match(An)||[])){const T=D.replace(An,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match($n)||[])){const T=D.replace($n,"$1").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}for(const D of Array.from(p.content.match(hr)||[])){const T=D.replace(hr,"$2").trim().split("/");let E="";for(const A of T)E+=A,w.add(E),E+="/"}w.has(r)||(g=!1)}return a&&a.froma.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(p.content.match(An)!==null||p.content.match(hr)!==null||p.content.match($n)!==null)||o==="LINKED"&&p.content.match(Rc)===null||o==="IMAGED"&&p.content.match(_c)===null||o==="CONNECTED"&&p.content.match(Il)===null)&&(g=!1),s&&!p.content.toLowerCase().includes(s.toLowerCase())&&(g=!1),g}):e.filter(p=>!p.content.contains("comment:"))},ZJ=O.forwardRef((e,t)=>{const{currentDate:n,setCurrentDateStamp:r}=e,[a,o]=O.useState(!1),s=Re.getDateStampByDate(Re.getDateString(n)),u=O.useRef(null);O.useEffect(()=>{u.current&&(!a&&x.setIcon(u.current,"more-horizontal"),a&&x.setIcon(u.current,"x"))},[u.current,a]);const d=m=>{r(m)};return O.useImperativeHandle(t,()=>({closeDatePicker:()=>{o(!1)}})),y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"date-card-container",children:[y.jsxs("div",{className:"date-container-details",children:[y.jsxs("div",{className:"details-text",children:[x.moment(s,"x").format("dddd")+" ",y.jsx("div",{className:"date-text",children:x.moment(s,"x").format("MMM")+" "+x.moment(s,"x").format("DD")})]}),y.jsx("div",{className:"details-logo-text",children:k("Daily Memos")})]}),y.jsxs("div",{className:"date-container-info",children:[y.jsxs("div",{className:"date-container-info-text",children:["Week ",y.jsx("div",{className:"week-text",children:x.moment(s,"x").format("ww")}),"of ",y.jsx("div",{className:"year-text",children:x.moment(s,"x").format("YYYY")})]}),y.jsx("div",{ref:u,onClick:()=>o(!a)})]})]}),y.jsx(Nm,{className:`date-picker ${a?"":"hidden"}`,datestamp:s,handleDateStampChange:d})]})}),WJ=({thino:e})=>{const t=O.useCallback(()=>{Gd(e)},[]);return y.jsxs("div",{className:"daily-thino-wrapper",children:[y.jsx("div",{className:"time-wrapper",onClick:t,children:y.jsx("span",{className:"normal-text",children:x.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm")})}),y.jsx("div",{className:"daily-thino-container",children:y.jsx(Ua,{memo:e})})]})},$J=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n},dailyNotesState:{settings:r,app:a}}=O.useContext(wt),o=Yc(),[s,u]=O.useState([]),[d,m]=O.useState(Re.getDateStampByDate(Re.getDateString(x.moment().format("YYYY-MM-DD HH:mm:ss")))),p=O.useRef(),g=O.useRef(null),w=q.useRef(null),D=O.useRef(null),[S,T]=O.useState(!1);O.useEffect(()=>{D.current&&(x.setIcon&&D&&!S&&x.setIcon(D.current,"share"),x.setIcon&&D&&S&&x.setIcon(D.current,"chrome"))},[D.current,S]),O.useEffect(()=>{const R=VJ({memos:n,query:e,HideDoneTasks:!1}).filter(F=>Re.getTimeStampByDate(F.createdAt)>=d&&Re.getTimeStampByDate(F.createdAt)F.deletedAt==="").sort((F,H)=>Re.getTimeStampByDate(F.createdAt)-Re.getTimeStampByDate(H.createdAt));u(R),o.setFinish()},[n,d,w.current,e]);const E=O.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]),A=async()=>{var N;p.current&&((N=p==null?void 0:p.current)==null||N.closeDatePicker()),T(!0),setTimeout(()=>{if(!g.current){T(!1);return}let R;document.body.hasClass("theme-dark")?R="#232323":R="#eaeaea",Uv(g.current,{backgroundColor:R,pixelRatio:window.devicePixelRatio*2}).then(F=>{if(r!=null&&r.AutoSaveWhenOnMobile&&x.Platform.isMobile){const H=F.split("base64,")[1];Av(H,"image/png").arrayBuffer().then(async L=>{let z;const U="png",W=ws();for(const K in W)if(W[K]instanceof x.TFile){z=W[K];break}z!==void 0&&await a.vault.createBinary(await vault.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,U,z),L)})}Vv({imgUrl:F}),T(!1)}).catch(()=>{T(!1)})},0)};return y.jsxs("div",{className:"daily-thinos-list-wrapper",ref:w,children:[y.jsxs("div",{className:"section-header-container",children:[y.jsxs("div",{className:"title-text",children:[y.jsx(lo,{when:t,children:y.jsx("button",{ref:N=>{N&&x.setIcon(N,"menu")},className:"btn action-btn clickable-icon",onClick:E})}),y.jsxs("span",{className:"go-home-btn",onClick:()=>{We.clearQuery(),We.setPathname("/")},children:["🏠 ",k("Return To Home Page")]})]}),y.jsxs("div",{className:"header-right-section",children:[y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"chevron-left")},className:"btn btn-text",onClick:()=>m(N=>N-Ba)}),y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"chevron-right")},className:"btn btn-text",onClick:()=>m(N=>N+Ba)}),y.jsx("span",{ref:D,className:mr("btn btn-text share-btn",S?"generating":""),onClick:A})]}),y.jsx(iC,{}),y.jsx(Rv,{})]})]}),y.jsx(Om,{thinosCount:s.length,thinos:s}),y.jsx("div",{className:"daily-thinos-view-wrapper",children:y.jsxs("div",{ref:g,className:"daily-thinos-view-container",children:[y.jsx(ZJ,{ref:p,currentDate:new Date(d),setCurrentDateStamp:m}),o.isLoading?y.jsx("div",{className:"tip-text-container",children:y.jsx("p",{className:"tip-text",children:k("Fetching data...")})}):s.length===0?y.jsx("div",{className:"tip-container",children:y.jsx("p",{className:"tip-text",children:k("Noooop!")})}):y.jsx("div",{className:"daily-thinos-list-container",children:s.map(N=>y.jsx(WJ,{thino:N},`${N.id}-${N.updatedAt}`))})]})})]})},GJ={"/recycle":y.jsx(RJ,{}),"/setting":y.jsx(HJ,{}),"/archive":y.jsx(zJ,{}),"/review":y.jsx(UJ,{}),"/daily":y.jsx($J,{}),"*":y.jsx(mJ,{})},cC=e=>t=>{for(const n of Object.keys(e))if(n===t)return e[n];return e["*"]},qJ=cC(PJ),JJ=cC(GJ);function KJ({app:e}){const{locationState:{pathname:t},dailyNotesState:{settings:n}}=O.useContext(wt);return O.useEffect(()=>{Ie.fetchAllMemos()},[]),!vI()&&!e.plugins.getPlugin("periodic-notes")&&(n!=null&&n.EnabledLocationList.find(r=>r.value==="DAILY"))&&new x.Notice(k("Check if you opened Daily Notes Plugin Or Periodic Notes Plugin")),y.jsx(Sl,{store:Ee,context:wt,children:qJ(t)})}const Hr="thino_view";class QJ extends x.EditorSuggest{constructor(n,r){super(n);he(this,"root");he(this,"editor");he(this,"cursor");he(this,"plugin");this.plugin=r,this.suggestEl.toggleClass("thino-date-selector",!0)}checkInMemosView(n){var o;const r=n.containerEl;if(!r)return!1;const a=(o=r.parentElement)==null?void 0:o.parentElement;return(a==null?void 0:a.classList.contains("common-editor-inputer"))||!1}onTrigger(n,r){const o=r.getLine(n.line)[n.ch-1];return this.checkInMemosView(r)&&o==="@"?(this.cursor=n,this.editor=r,x.Platform.isMobile?(new cE(this.app,"text",s=>{this.selectSuggestion(parseInt(s),new MouseEvent("click"))}).open(),null):{start:{line:n.line,ch:n.ch-1},end:n,query:""}):null}getSuggestions(){return[parseInt(x.moment().startOf("day").format("x"))]}renderSuggestion(n,r){r.empty(),this.root=hs.createRoot(r),this.root.render(y.jsx(q.StrictMode,{children:y.jsx(Nm,{className:"editor-date-picker",datestamp:n,handleDateStampChange:this.selectSuggestion.bind(this)})}))}selectSuggestion(n,r){var u,d,m;if(r instanceof KeyboardEvent||r instanceof PointerEvent&&!r.target.closest(".day-item"))return;const a=(u=this.app.workspace.getLeavesOfType("thino_view")[0])==null?void 0:u.view;(d=a==null?void 0:a.contentEl.find(".action-btn.list-or-task.list"))==null||d.click();let o="",s="";switch(this.plugin.settings.InsertDateFormat){case"Dataview":o="[due::",s="]";break;case"Tasks":o="📆";break}this.editor.replaceRange(o+x.moment(n).format("YYYY-MM-DD")+s,{line:this.cursor.line,ch:this.cursor.ch-1},this.cursor),(m=this.root)==null||m.unmount(),this.close()}}class XJ extends x.EditorSuggest{constructor(n,r){super(n);he(this,"root");he(this,"editor");he(this,"cursor");he(this,"plugin");he(this,"memos",[]);this.plugin=r,this.memos=Ie.getState().memos.filter(a=>!a.deletedAt&&a.rowStatus!=="ARCHIVED")}checkInMemosView(n){var o;const r=n.containerEl;if(!r)return!1;const a=(o=r.parentElement)==null?void 0:o.parentElement;return(a==null?void 0:a.classList.contains("common-editor-inputer"))||!1}fuzzySearchItemsOptimized(n,r){const a=x.prepareFuzzySearch(n);return r.map(o=>{const s=a(o.content);return s?{item:o,match:s}:null}).filter(Boolean)}onTrigger(n,r){if(!this.checkInMemosView(r))return null;const o=r.getLine(n.line).slice(0,n.ch);if(o.lastIndexOf("~")===-1)return null;const s=o.slice(o.lastIndexOf("~")+1,n.ch);if(o[o.lastIndexOf("~")-1]!==" "&&o.lastIndexOf("~")!==0)return null;const u=s.trim();return this.memos=Ie.getState().memos.filter(d=>!d.deletedAt&&d.rowStatus!=="ARCHIVED"),{start:{line:n.line,ch:n.ch-u.length},end:n,query:u}}getSuggestions(n){return n.query?this.fuzzySearchItemsOptimized(n.query,this.memos).sort((a,o)=>o.match.score-a.match.score).map(a=>a.item).map(a=>({time:a.createdAt,id:a.id,content:a.content})):this.memos.map(a=>({time:a.createdAt,id:a.id,content:a.content}))}renderSuggestion(n,r){r.toggleClass("thino-suggestion",!0),r.createEl("div",{cls:"thino-suggestion-time",text:n.time}),r.createEl("div",{cls:"thino-suggestion-container"}).createEl("div",{cls:"thino-suggestion-content",text:n.content})}selectSuggestion(n){const r=n.id;this.context.editor.replaceRange("MARK: [@THINO]("+r+")",{line:this.context.end.line,ch:this.context.start.ch-1},this.context.end)}}class eK{constructor(){he(this,"path","/fake-file-that-generated-for-thino.png");he(this,"basename","fake-file-that-generated-for-thino");he(this,"extension","png");he(this,"deleted",!1);he(this,"name","fake-file-that-generated-for-thino.png");he(this,"parent",null);he(this,"stat");he(this,"vault",null)}static[Symbol.hasInstance](t){return t instanceof x.TFile}setPath(t){}getNewPathAfterRename(t){}getShortName(){}cache(t){}updateCacheLimit(){}}function tK(e,t){try{const n=hs.createRoot(e);return n.render(y.jsx(q.StrictMode,{children:y.jsx(Sl,{store:Ee,context:wt,children:y.jsx(Cd,{editorType:"inline",destroy:t})})})),n}catch(n){console.error(n)}}class yl extends x.ItemView{constructor(n,r){super(n);he(this,"scope",new x.Scope(this.app.scope));he(this,"root");he(this,"mobileHeaderRoot");he(this,"plugin");he(this,"hoverPopover");he(this,"memosComponent");he(this,"editor",null);he(this,"navigation",!1);he(this,"file",new eK);he(this,"handleUpdateInstance",n=>{this.editor=n.editor});this.plugin=r,this.registerScope()}getDisplayText(){return"Thino"}getIcon(){return"Memos"}getViewType(){return Hr}getMode(){return"source"}registerScope(){const{scope:n}=this;n.register(["Mod"],"Enter",()=>{});for(let r=0;r{});n.register([],"i",r=>{const a=r.target;a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.hasClass("cm-line")||a.hasClass("cm-content")||(r.preventDefault(),this.plugin.app.workspace.trigger("focus-on-textarea"))}),n.register(["Mod"],"f",r=>{const a=r.target;a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.hasClass("cm-line")||a.hasClass("cm-content")||(r.preventDefault(),this.plugin.app.workspace.trigger("focus-on-searchBar"))}),n.register([],"o",r=>{const a=r.target;a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.hasClass("cm-line")||a.hasClass("cm-content")||(r.preventDefault(),this.plugin.app.workspace.trigger("focus-on-searchBar"))}),n.register([],"Escape",()=>{setTimeout(()=>{this.plugin.app.workspace.trigger("blur-on-memos")},20)})}async onFileDeleted(n){var d,m,p;const r=Zh(n,"day"),a=n.path.contains(".thino")&&n.path.contains(".canvas"),o=n.path.contains(".thino")&&n.path.contains(".md"),s=((d=this.plugin.settings)==null?void 0:d.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",u=(p=((m=n.parent)==null?void 0:m.path)||n.path)==null?void 0:p.contains(s==null?void 0:s.trim());(r||a&&this.plugin.settings.EnabledLocationList.find(g=>g.value==="CANVAS"))&&(await Ie.removeMemosInFile(n),Ie.updateTagsState()),u&&this.plugin.settings.EnabledLocationList.find(g=>g.value==="MULTI")&&(await Ie.removeMemosInFile(n,s),Ie.updateTagsState()),o&&this.plugin.settings.EnabledLocationList.find(g=>g.value==="FILE")&&(await Ie.removeMemosInFile(n),Ie.updateTagsState())}async onFileModified(n){var d;if(Qe.getState().changedByMemos){Qe.setChangedByMemos(!1);return}const r=Zh(n,"day"),a=n.path.contains(".thino")&&n.path.contains(".canvas"),o=n.path.contains(".thino")&&n.path.contains(".md"),s=((d=this.plugin.settings)==null?void 0:d.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",u=n.parent.path.contains(s==null?void 0:s.trim());if(r||a&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="CANVAS")){await Ie.updateMemosInFile(n),Ie.updateTagsState();return}u&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="MULTI")&&(await Ie.updateMemosInFile(n,s),Ie.updateTagsState()),o&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="FILE")&&(await Ie.updateMemosInFile(n),Ie.updateTagsState())}async onFileCreated(n){var r;if(this.app.workspace.layoutReady&&this.memosComponent){const a=Zh(n,"day"),o=n.path.contains(".thino")&&n.path.contains(".canvas"),s=n.path.contains(".thino")&&n.path.contains(".md"),u=((r=this.plugin.settings)==null?void 0:r.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",d=n.parent.path.contains(u==null?void 0:u.trim());if(a){await rt.updateDailyNotes(n,!1),await Ie.updateMemosInFile(n),Ie.updateTagsState();return}if(o&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="CANVAS")){await Ie.updateMemosInFile(n),Ie.updateTagsState();return}d&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="MULTI")&&(await Ie.updateMemosInFile(n,u),Ie.updateTagsState()),s&&this.plugin.settings.EnabledLocationList.find(m=>m.value==="FILE")&&(await Ie.updateMemosInFile(n),Ie.updateTagsState())}}async onResize(){var r;super.onResize();const n=this.leaf;if(n&&n.height!==0){if(n.view.containerEl.toggleClass("tiny-view",n.width<600),n.view.containerEl.toggleClass("waterfall-small-group",n.width<1300),n.width>950){n.view.containerEl.classList.toggle("mobile-view",!1),Qe.setIsMobileView(n.width<=950);return}if((r=this.plugin.settings)!=null&&r.ShowLeftSideBar&&!x.Platform.isMobile)return;n.view.containerEl.classList.toggle("mobile-view",!0),Qe.setIsMobileView(n.width<=950)}}appendToHeader(){const n=this.leaf.view.titleContainerEl;n&&(this.mobileHeaderRoot=hs.createRoot(n),this.mobileHeaderRoot.render(y.jsx(q.StrictMode,{children:y.jsx(Sl,{store:Ee,context:wt,children:y.jsx(ev,{})})})))}async onOpen(){this.navigation=this.plugin.settings.navigation,await this.onResize(),this.onFileCreated=this.onFileCreated.bind(this),this.onFileDeleted=this.onFileDeleted.bind(this),this.onFileModified=this.onFileModified.bind(this),x.Platform.isTablet&&document.body.toggleClass("is-tablet",!0),x.Platform.isMobile&&!x.Platform.isTablet&&this.appendToHeader(),this.registerEvent(this.app.vault.on("create",this.onFileCreated)),this.registerEvent(this.app.vault.on("delete",this.onFileDeleted)),this.registerEvent(this.app.vault.on("modify",x.debounce(this.onFileModified,2e3,!0)));try{this.root=hs.createRoot(this.contentEl),rt.setView(this),this.root.render(y.jsx(q.StrictMode,{children:y.jsx(KJ,{app:this.plugin.app})}))}catch(n){console.error(n)}}onunload(){super.onunload(),this.root.unmount()}}const O2={Memos:''};function nK(){Object.keys(O2).forEach(e=>{x.addIcon(e,O2[e])})}class F2 extends uE{fuzzySearchItemsOptimized(t,n){const r=x.prepareFuzzySearch(t);return n.map(a=>{const o=r(a.path);return o?{item:a,match:o,score:o.score}:null}).sort((a,o)=>(o==null?void 0:o.score)-(a==null?void 0:a.score)).filter(Boolean)}getSuggestions(t){const r=app.vault.getFiles().filter(o=>["png","jpg","jpeg","gif"].includes(o.extension)),a=t.toLowerCase();return this.fuzzySearchItemsOptimized(a,r).map(o=>o.item)}renderSuggestion(t,n){var o;const r=t.basename,a=((o=t.parent)==null?void 0:o.path)||"";n.toggleClass("thino-image-suggest-item",!0),n.createSpan({cls:"suggestion-name",text:r}),n.createSpan({cls:"suggestion-path",text:a})}selectSuggestion(t){this.inputEl.value=t.path,this.inputEl.trigger("input"),this.close()}}const ub=typeof Buffer=="function";typeof TextDecoder=="function"&&new TextDecoder;const P2=typeof TextEncoder=="function"?new TextEncoder:void 0,rK="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Vh=Array.prototype.slice.call(rK);(e=>{let t={};return e.forEach((n,r)=>t[n]=r),t})(Vh);const Di=String.fromCharCode.bind(String);typeof Uint8Array.from=="function"&&Uint8Array.from.bind(Uint8Array);const aK=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),oK=e=>{let t,n,r,a,o="";const s=e.length%3;for(let u=0;u255||(r=e.charCodeAt(u++))>255||(a=e.charCodeAt(u++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|a,o+=Vh[t>>18&63]+Vh[t>>12&63]+Vh[t>>6&63]+Vh[t&63]}return s?o.slice(0,s-3)+"===".substring(s):o},uC=typeof btoa=="function"?e=>btoa(e):ub?e=>Buffer.from(e,"binary").toString("base64"):oK,iK=ub?e=>Buffer.from(e).toString("base64"):e=>{let n=[];for(let r=0,a=e.length;r{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?Di(192|t>>>6)+Di(128|t&63):Di(224|t>>>12&15)+Di(128|t>>>6&63)+Di(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Di(240|t>>>18&7)+Di(128|t>>>12&63)+Di(128|t>>>6&63)+Di(128|t&63)}},lK=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,cK=e=>e.replace(lK,sK),j2=ub?e=>Buffer.from(e,"utf8").toString("base64"):P2?e=>iK(P2.encode(e)):e=>uC(cK(e)),uK=(e,t=!1)=>t?aK(j2(e)):j2(e),rw=x.Platform.isDesktop&&require("os"),dC=async()=>{var r,a;let e="";if(x.Platform.isDesktop)e=await zn();else{const o=await((r=window.Capacitor)==null?void 0:r.Plugins.Device.getId());e=o.identifier||o.uuid}let t;if(rw)t=JSON.stringify({hostname:rw.hostname(),platform:rw.platform(),machineid:e});else{const o=await((a=window.Capacitor)==null?void 0:a.Plugins.Device.getInfo()),s=o==null?void 0:o.model,u=o==null?void 0:o.platform;t=JSON.stringify({hostname:s||("mobile"+x.Platform.isMobile?Math.random().toString(36).substring(7):""),platform:u||"mobile",machineid:e})}return uK(t)},dK=async()=>{var t;let e="";if(x.Platform.isDesktop)e=await zn();else{const n=await((t=window.Capacitor)==null?void 0:t.Plugins.Device.getId());e=n.identifier||n.uuid}return e},fK={General:"chef-hat",Thino:"Memos",Theme:"brush",Share:"share-2",Advanced:"cog"},fC=[{value:"DAILY",target:"ProcessEntriesBelow",insert:"InsertAfter"},{value:"CANVAS",target:"MemoDefaultCanvasPath"},{value:"MULTI",target:"MemoDefaultMultiFilePath"},{value:"FILE",target:"MemoDefaultSingleFilePath"}],Oo={StartDate:"Sunday",InsertAfter:"# Journal",UserName:"THINO 😉",ProcessEntriesBelow:"",Language:"en",SaveMemoButtonLabel:"NOTE",SaveMemoButtonIcon:"✍️",ShareFooterStart:"{ThinoNum} Thino {UsedDay} Day",ShareFooterEnd:"✍️ by {UserName}",DefaultPrefix:"List",UseDailyOrPeriodic:"Daily",InsertDateFormat:"Tasks",DefaultEditorLocation:"Top",UseButtonToShowEditor:!1,FocusOnEditor:!0,OpenDailyMemosWithMemos:!0,HideDoneTasks:!1,ShowTaskLabel:!1,MobileAndDesktop:"All",OpenMemosAutomatically:!1,ShowTime:!0,ShowDate:!0,AddBlankLineWhenDate:!1,AutoSaveWhenOnMobile:!1,DeleteFileName:"delete",QueryFileName:"query",UseVaultTags:!1,SetCustomBackgroundImage:!1,SetCustomMemoFooter:!1,DefaultLightBackgroundImage:"",DefaultDarkBackgroundImage:"",DefaultMemoComposition:"{TIME} {CONTENT}",CommentOnMemos:!1,CommentsInOriginalNotes:!1,FetchMemosMark:"#memo",FetchMemosFromNote:!1,ShowCommentOnMemos:!1,ShowLeftSideBar:!1,MemoListView:"list",MemoSaveLocation:"DAILY",MemoOtherSaveLocation:{MemoDefaultCanvasPath:"basic.thino.canvas",MemoDefaultMultiFilePath:"Thino",MemoDefaultSingleFilePath:"basic.thino.md"},MemoDailyTarget:5,HeatmapColorScheme:"default",EnabledHttpApi:!1,HttpApiIpType:"localhost",HttpApiPort:"43999",AutoDownloadImage:!1,EditorType:"obsidian",EnabledLocationList:fC,DeleteThinoDirectly:!1,CaptureKey:{EnableCaptureKey:!1,OpenThinoGlobally:"CommandOrControl+Shift+T",ShowNearMouse:!1},startSync:!1,tokenForVerify:{},saveThinoType:"FILE",showDayMark:!1,dayMarkRange:"day",navigation:!1,password:"",needVerify:!1,addTagAutomatically:!1,addTagPosition:"End",addTagWithNewline:!1,chatViewStyle:"default",MomentsBackgroundImage:"https://images.pexels.com/photos/531767/pexels-photo-531767.jpeg",MomentsIcon:"https://images.pexels.com/photos/256514/pexels-photo-256514.jpeg",MomentsQuote:"Share your thino with the world",DefaultThemeForThino:"classic",LastUpdatedVersion:"0.0.0"};function hK({plugin:e}){const{dailyNotesState:{verifyState:t}}=O.useContext(wt),[n,r]=O.useState(!1),[a,o]=O.useState(!1),[s,u]=O.useState(""),[d,m]=O.useState("");O.useEffect(()=>{dK().then(w=>{m(w)})},[]);const p=async()=>{var T;const w=s,D=!x.Platform.isDesktop&&await((T=window.Capacitor)==null?void 0:T.Plugins.Device.getId()),S=x.Platform.isDesktop?await zn():D.identifier||D.uuid;w&&(e.settingTab.updateSettings("tokenForVerify",{...e.settings.tokenForVerify,[S]:w}),e.verify().then(E=>{E&&(r(!0),Qe.setRefresh(!0),setTimeout(()=>{e.settingTab.display()},200),e.registerToolbarCheck()),new x.Notice(k(E?"Verify successfully":"Failed to verify"))}).catch(E=>{new x.Notice(k("Failed to verify"))}))},g=async w=>{u(w)};return y.jsx("div",{className:"thino-verify-component",children:t?y.jsxs("div",{className:"thino-verify-content verified",children:[y.jsx("div",{className:"thino-verified-text",children:k("You have verified your account. Congrats!")}),y.jsx("div",{className:"thino-description-link",children:y.jsxs("p",{children:[k("If you have any questions, please contact us."),y.jsx("span",{className:"thino-url",onClick:()=>{const w=localStorage.getItem("language");w&&(w==="zh"||w==="zh-TW")?window.open("https://pkmer.cn"):window.open("https://thino.pkmer.net/en/")},children:"@ PKMer"})]})})]}):y.jsxs("div",{className:"thino-verify-content",children:[y.jsxs("div",{className:"thino-description-link",children:[k("You can buy a license from")+"->",y.jsxs("span",{className:"thino-url",onClick:()=>{const w=localStorage.getItem("language");w&&(w==="zh"||w==="zh-TW")?window.open("https://pkmer.cn/products/thino"):window.open("https://thino.pkmer.net/en/#price")},children:[" ","PKMer"]})]}),y.jsx("textarea",{className:"thino-verify-textarea",value:s,onChange:w=>g(w.target.value),placeholder:k("Input activation code here")}),y.jsxs("div",{className:"thino-button-container",children:[y.jsxs("div",{className:"thino-button-group",children:[y.jsx("button",{onClick:async()=>{try{const w=await dC();await navigator.clipboard.writeText(w),o(!0)}catch(w){console.error(w),new x.Notice("Failed to copy id");return}new x.Notice(k("Copied to clipboard Successfully"))},children:k("Copy Thino id")}),y.jsx("button",{onClick:()=>{if(!a){new x.Notice(k("Please copy Thino id first"));return}const w=localStorage.getItem("language");w&&(w==="zh"||w==="zh-TW")?window.open("https://pkmer.cn/products/UserProfile/#tab-21&getCode"):window.open("https://pkmer.net/en/userprofile/#tab-21&getCode"),r(!0)},children:k("Get activation code")}),s&&y.jsx(y.Fragment,{children:y.jsx("button",{onClick:async()=>{await p()},children:k("Verify")})})]}),n?y.jsx("p",{children:k("After you verify your account, please refresh this page.")}):""]}),y.jsxs("div",{className:"thino-description-link",children:[k("If you have any questions, please contact us."),y.jsx("span",{className:"thino-url",onClick:()=>{const w=localStorage.getItem("language");w&&(w==="zh"||w==="zh-TW")?window.open("https://pkmer.cn"):window.open("https://thino.pkmer.net/en/")},children:"@ PKMer"})]})]})})}class mK extends x.PluginSettingTab{constructor(n,r){super(n,r);he(this,"plugin");he(this,"applyDebounceTimer",0);he(this,"tabContent",new Map);he(this,"selectedTab","General");he(this,"search");he(this,"searchSettingInfo",new Map);he(this,"searchZeroState");he(this,"navigateEl");he(this,"passwordMatched",!1);he(this,"root");he(this,"debounceApplySettingsUpdate",x.debounce(async()=>{await this.plugin.saveSettings()},100,!0));he(this,"debounceDisplay",x.debounce(async()=>{await this.display()},300,!0));this.plugin=r}updateSettings(n,r){this.plugin.settings={...this.plugin.settings,[n]:r},this.applySettingsUpdate()}applySettingsUpdate(){this.debounceApplySettingsUpdate(),Ie.updateTagsState()}async hide(){var n;(n=this.root)==null||n.unmount(),this.passwordMatched=!1}async display(){var n;await this.plugin.loadSettings(),this.root&&((n=this.root)==null||n.unmount()),this.containerEl.empty(),this.containerEl.toggleClass("memos-settings",!0),x.Platform.isMobile&&this.containerEl.toggleClass("memos-mobile",!0),this.generateSettingsTitle(),this.addTabHeader()}generateSettingsTitle(){const n=this.containerEl.createDiv("memos-setting-title");n.createEl("h2",{text:"Thino"}),this.generateSearchBar(n)}addTabHeader(){const n=this.containerEl.createEl("nav",{cls:"memos-setting-header"});this.navigateEl=n.createDiv("memos-setting-tab-group");const r=this.containerEl.createDiv("memos-setting-content");this.updateOldData(),this.createTabAndContent("General",this.navigateEl,r,(a,o)=>this.generateGeneralSettings(o,a)),this.createTabAndContent("Thino",this.navigateEl,r,(a,o)=>this.generateMemosSettings(o,a)),this.createTabAndContent("Theme",this.navigateEl,r,(a,o)=>this.generateThemeSettings(o,a)),this.createTabAndContent("Share",this.navigateEl,r,(a,o)=>this.generateShareSettings(o,a)),this.createTabAndContent("Advanced",this.navigateEl,r,(a,o)=>this.generateAdvancedSettings(o,a)),this.createSearchZeroState(r)}updateOldData(){this.plugin.settings.UserName.startsWith("MEMO ")&&(this.plugin.settings.UserName="THINO 😉"),this.plugin.settings.ShareFooterStart.contains("{Memo")&&(this.plugin.settings.ShareFooterStart=this.plugin.settings.ShareFooterStart.replace("{MemosNum}","{ThinoNum}").replace("memos","thino")),this.applySettingsUpdate()}generateSearchBar(n){const r=new x.Setting(n);r.settingEl.style.border="none",r.addSearch(a=>{this.search=a}),this.search.setPlaceholder(k("Search all settings")),this.search.inputEl.oninput=()=>{for(const a of this.tabContent){const o=a[1];o.navButton.removeClass("memos-navigation-item-selected"),o.content.show(),o.heading.show();const s=this.search.getValue();this.selectedTab==""&&s.trim()!=""&&this.searchSettings(s.toLowerCase()),this.selectedTab=""}this.navigateEl.addClass("memos-setting-searching")},this.search.inputEl.onblur=()=>{this.navigateEl.removeClass("memos-setting-searching")},this.search.onChange(a=>{var o;if(a===""){this.triggerTabChange((o=this.tabContent.get("General"))==null?void 0:o.navButton,"General");return}this.searchSettings(a.toLowerCase())})}triggerTabChange(n,r){if(this.selectedTab==r)return;n.toggleClass("memos-navigation-item-selected",!0);const a=this.tabContent.get(r);if((a==null?void 0:a.content).show(),this.selectedTab!=""){const o=this.tabContent.get(this.selectedTab);o==null||o.navButton.removeClass("memos-navigation-item-selected"),(o==null?void 0:o.content).hide()}else{this.searchZeroState.hide();for(const o of this.searchSettingInfo)for(const s of o[1])s.containerEl.show();for(const o of this.tabContent){const s=o[1];s.heading.hide(),r!==o[0]&&s.content.hide()}}this.selectedTab=r}createTabAndContent(n,r,a,o){const s=this.selectedTab===n,u=r.createDiv("memos-navigation-item");u.toggleClass("memos-desktop",!0),x.setIcon(u.createEl("div",{cls:"memos-navigation-item-icon"}),fK[n]),u.createSpan({text:k(n)}),u.onclick=()=>{this.triggerTabChange(u,n)};const d=a.createDiv("memos-tab-settings"),m=d.createEl("h2",{cls:"memos-setting-heading",text:n+" Settings"});m.hide(),d.id=n.toLowerCase().replace(" ","-"),s?u.addClass("memos-navigation-item-selected"):d.hide(),o&&o(d,n),this.tabContent.set(n,{content:d,heading:m,navButton:u})}searchSettings(n){var o;const r=new Set,a=(s,u)=>{s.show(),r.has(u)||r.add(u)};for(const s of this.searchSettingInfo){const u=s[0],d=s[1];for(const m of d)if(n.trim()===""||(o=m.alias)!=null&&o.includes(n)||m.description.includes(n)||m.name.includes(n))a(m.containerEl,u);else if(m.options&&m.options.length>0)for(const p of m.options){if(p.description.toLowerCase().includes(n)||p.name.toLowerCase().includes(n)){a(m.containerEl,u);break}else if(p.options){for(const g of p.options)if(g.description.toLowerCase().includes(n)||g.value.toLowerCase().includes(n)){a(m.containerEl,u);break}}m.containerEl.hide()}else m.containerEl.hide()}for(const s of this.tabContent)r.has(s[0])?s[1].heading.show():s[1].heading.hide();r.size===0?this.searchZeroState.show():this.searchZeroState.hide()}addSettingToMasterSettingsList(n,r,a="",o="",s=[],u=""){var m;const d={containerEl:r,name:a.toLowerCase(),description:o.toLowerCase(),options:s,alias:u};this.searchSettingInfo.has(n)?(m=this.searchSettingInfo.get(n))==null||m.push(d):this.searchSettingInfo.set(n,[d])}createSearchZeroState(n){this.searchZeroState=n.createDiv(),this.searchZeroState.hide(),this.searchZeroState.createEl(x.Platform.isMobile?"h3":"h2",{text:"No settings match search"}).style.textAlign="center"}generateGeneralSettings(n,r){this.customHeading(n,r)}async generateThemeSettings(n,r){var d;const a=rt.getState().verifyState,o=!x.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=x.Platform.isDesktop?await zn():o.identifier||o.uuid,u=a&&(a==null?void 0:a.appId)===s;await this.customNameAndTheme(n,r,u)}async generateMemosSettings(n,r){var d;const a=rt.getState().verifyState,o=!x.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=x.Platform.isDesktop?await zn():o.identifier||o.uuid,u=a&&(a==null?void 0:a.appId)===s;this.addMemoSettings(n,r),this.addThinoProSettings(n,r,u)}generateShareSettings(n,r){this.copyMemosSettings(n,r),this.shareMemosSettings(n,r)}async generateAdvancedSettings(n,r){var d;this.saveDataSettings(n,r),this.fetchDataSettings(n,r),this.navigationSettings(n,r);const a=rt.getState().verifyState,o=!x.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=x.Platform.isDesktop?await zn():o.identifier||o.uuid,u=a&&(a==null?void 0:a.appId)===s;this.customFileNameSettings(n,r,u),this.setGlobalSettings(n,r,u)}async customNameAndTheme(n,r,a){new Ke(r,this).setName(k("Theme for Thino")).setDesc(k("Set the theme for Thino")).setTab(n).addDropdown(async s=>{s.addOption("modern","Modern"),s.addOption("classic","Classic"),s.setValue(this.plugin.settings.DefaultThemeForThino).onChange(async u=>{this.plugin.settings.DefaultThemeForThino=u,this.applySettingsUpdate()})}),new Ke(r,this).setTab(n).setHeading().setName(k("Theme Details"));let o;new Ke(r,this).setName(k("Heatmap Color Scheme")).setDesc(k("Set different color scheme for heatmap.")).setTab(n).addDropdown(async s=>{o=s,o.addOption("default","default"),o.addOption("gray","gray"),o.addOption("grass","grass"),o.addOption("frame","frame"),o.addOption("olive","olive"),o.addOption("ice","ice"),o.addOption("magenta","magenta"),o.setValue(this.plugin.settings.HeatmapColorScheme).onChange(async u=>{this.plugin.settings.HeatmapColorScheme=u,this.applySettingsUpdate()})}),new Ke(r,this).setName(k("Hide done tasks in Memo list")).setDesc(k("Hide all done tasks in Memo list. Show done tasks by default.")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.HideDoneTasks).onChange(async u=>{this.plugin.settings.HideDoneTasks=u,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Show Tasks Label")).setDesc(k("Show tasks label near the time text. False by default")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.ShowTaskLabel).onChange(async u=>{this.plugin.settings.ShowTaskLabel=u,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Save Memo button label")).setDesc(k("The text shown on the save Memo button in the UI. 'NOTEIT' by default.")).setTab(n).addText(s=>s.setPlaceholder(Oo.SaveMemoButtonLabel).setValue(this.plugin.settings.SaveMemoButtonLabel).onChange(async u=>{this.plugin.settings.SaveMemoButtonLabel=u,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Save Memo button icon")).setDesc(k("The icon shown on the save Memo button in the UI.")).setTab(n).addText(s=>s.setPlaceholder(Oo.SaveMemoButtonIcon).setValue(this.plugin.settings.SaveMemoButtonIcon).onChange(async u=>{this.plugin.settings.SaveMemoButtonIcon=u,this.applySettingsUpdate()})),x.Platform.isDesktop&&new Ke(r,this).setName(k("Always Show Leaf Sidebar on PC")).setDesc(k("Show left sidebar on PC even when the leaf width is less than 875px. False by default.")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.ShowLeftSideBar).onChange(async u=>{this.plugin.settings.ShowLeftSideBar=u,this.applySettingsUpdate()})),await this.getEditorLocation(r,n),new Ke(r,this).setHeading().setTab(n).setName(k("Pro Features")),this.addThinoDailyMarkSettings(n,r,a),new Ke(r,this).setName(k("Chat view style")).setDesc(k("Set the style of chat view")).setTab(n).addDropdown(async s=>{o=s,o.addOption("default","Default"),o.addOption("fluent","Fluent"),o.addOption("inline","Inline"),o.setValue(this.plugin.settings.chatViewStyle).onChange(async u=>{if(!a){fn();return}this.plugin.settings.chatViewStyle=u,this.applySettingsUpdate()})}),this.addThinoMomentsSettings(n,r,a)}addThinoDailyMarkSettings(n,r,a){let o;new Ke(r,this).setName(k("Show day mark on list mode")).setDesc(k("Show day mark on the top of daily range thino. False by default.")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.showDayMark).onChange(async u=>{if(!a){fn();return}this.plugin.settings.showDayMark=u,this.applySettingsUpdate(),this.debounceDisplay()})),this.plugin.settings.showDayMark&&new Ke(r,this).setName(k("Day mark range")).setDesc(k("Set the range of day mark. Day by default.")).setTab(n).addDropdown(async s=>{o=s,o.addOption("day","day"),o.addOption("week","week"),o.addOption("month","month"),o.addOption("quarter","quarter"),o.addOption("year","year"),o.setValue(this.plugin.settings.dayMarkRange).onChange(async u=>{this.plugin.settings.dayMarkRange=u,this.applySettingsUpdate()})})}addThinoMomentsSettings(n,r,a){new Ke(r,this).setTab(n).setName(k("Background image for moments view")).setDesc(k("Set the background image for moments view")).addText(o=>o.setPlaceholder("URL").setValue(this.plugin.settings.MomentsBackgroundImage).onChange(async s=>{a&&(this.plugin.settings.MomentsBackgroundImage=s,this.applySettingsUpdate())})),new Ke(r,this).setTab(n).setName(k("Icon for moments/chat view")).setDesc(k("Set the icon for moments/chat view")).addText(o=>o.setPlaceholder("URL").setValue(this.plugin.settings.MomentsIcon).onChange(async s=>{a&&(this.plugin.settings.MomentsIcon=s,this.applySettingsUpdate())})),new Ke(r,this).setTab(n).setName(k("Quote for moments view")).setDesc(k("Set the quote for moments view")).addText(o=>o.setPlaceholder("Input anything here").setValue(this.plugin.settings.MomentsQuote).onChange(async s=>{a&&(this.plugin.settings.MomentsQuote=s,this.applySettingsUpdate())}))}async getEditorLocation(n,r){let a;x.Platform.isMobile&&(new Ke(n,this).setName(k("Default editor position on mobile")).setDesc(k("Set the default editor position on Mobile, 'Top' by default.")).setTab(r).addDropdown(async o=>{a=o,a.addOption("Top",k("Top")),a.addOption("Bottom",k("Bottom")),a.setValue(this.plugin.settings.DefaultEditorLocation).onChange(async s=>{this.plugin.settings.DefaultEditorLocation=s,this.applySettingsUpdate(),setTimeout(()=>{this.display()},200)})}),this.plugin.settings.DefaultEditorLocation!=="Top"&&new Ke(n,this).setName(k("Use button to show editor on mobile")).setDesc(k("Set a float button to call editor on mobile. Only when editor located at the bottom works.")).setTab(r).addToggle(o=>o.setValue(this.plugin.settings.UseButtonToShowEditor).onChange(async s=>{this.plugin.settings.UseButtonToShowEditor=s,this.applySettingsUpdate()})))}customHeading(n,r){var D;new Ke(r,this).setName(k("User name in Memos")).setDesc(k("Set your user name here. 'Memos 😏' By default")).setTab(n).addText(S=>S.setPlaceholder(Oo.UserName).setValue(this.plugin.settings.UserName).onChange(async T=>{this.plugin.settings.UserName=T,this.applySettingsUpdate()}));let a=!1;const o=document.createDocumentFragment();o.createEl("span",{text:k("Connect to PKMer Sync, you can check it in ")});const s=localStorage.getItem("language");let u;s&&s==="zh"?u="https://pkmer.cn/products/UserProfile/#tab-21&activateSync":u="https://thino.pkmer.net/en/",o.createEl("a",{text:k("PKMer Sync"),attr:{href:u}});const d=!!((D=this.plugin.app)!=null&&D.loadLocalStorage("tokenForSync"));d&&new Ke(r,this).setHeading().setName(k("Sync service")).setTab(n),(s==="zh"||s==="zh-TW")&&new Ke(r,this).setName(k("Sync Thino via PKMer")).setDesc(o).setTab(n).addButton(S=>{var E;const T=(E=this.plugin.app)==null?void 0:E.loadLocalStorage("tokenForSync");S.setButtonText(k(T?"Unlink":"Link")).onClick(async()=>{var A;if(!T){const N=localStorage.getItem("language");N&&(N==="zh"||N==="zh-TW")?window.open("https://pkmer.cn/products/UserProfile/#tab-21&activateSync"):window.open("https://thino.pkmer.net/en/");return}if(!a){S.setButtonText(k("Confirm?")),a=!0;return}a=!1,T&&((A=this.plugin.app)==null||A.saveLocalStorage("tokenForSync",""),new x.Notice(k("Remove successfully"))),Qe.setRefresh(!0),setTimeout(()=>{this.display()},20)})}),(s==="zh"||s==="zh-TW")&&this.showSyncStatus(r,n),d&&new Ke(r,this).setHeading().setName(k("Pro verification status")).setTab(n);const m=document.createDocumentFragment(),p=m.createEl("div",{cls:"thino-activation"}),g=new Ke(r,this).setName(k("Activate Pro Version")).setDesc(m).setTab(n);g.settingEl.toggleClass("thino-activation-setting",!0),g.nameEl.toggleClass("thino-activation-title",!0),this.root=hs.createRoot(p),this.root.render(y.jsx(Sl,{store:Ee,context:wt,children:y.jsx(hK,{plugin:this.plugin})}));let w=!1;new Ke(r,this).setName(k("Deactivate")).setTab(n).addButton(S=>{S.setWarning().setButtonText(k("Remove")).onClick(async()=>{var A;if(!w){S.setButtonText(k("Confirm?")),w=!0;return}w=!1;const T=!x.Platform.isDesktop&&await((A=window.Capacitor)==null?void 0:A.Plugins.Device.getId()),E=x.Platform.isDesktop?await zn():T.identifier||T.uuid;this.plugin.settings.tokenForVerify[E]&&(delete this.plugin.settings.tokenForVerify[E],await this.plugin.saveSettings(),new x.Notice(k("Remove successfully"))),await this.plugin.verify(),Qe.setRefresh(!0),setTimeout(()=>{this.display()},20)})})}showSyncStatus(n,r){var o;(o=this.plugin.app)!=null&&o.loadLocalStorage("tokenForSync")&&(new Ke(n,this).setName(k("Save thino type when sync local")).setDesc(k("Set the default save thino type when sync local, FILE by default.")).setTab(r).addDropdown(async s=>{s.addOption("DAILY",k("DAILY")),s.addOption("FILE",k("FILE")),s.setValue(this.plugin.settings.saveThinoType).onChange(async u=>{this.plugin.settings.saveThinoType=u,this.applySettingsUpdate()})}),new Ke(n,this).setName(k("Sync Status")).setDesc(k("Start or stop sync")).setTab(r).addButton(s=>{s.setButtonText(this.plugin.settings.startSync?k("Stop"):k("Start")).onClick(async()=>{this.plugin.settings.startSync=!this.plugin.settings.startSync,await this.plugin.saveSettings(),Qe.setRefresh(!0),new x.Notice(this.plugin.settings.startSync?k("Start sync successfully"):k("Stop sync successfully")),setTimeout(()=>{this.display()},200)})}))}addMemoSettings(n,r){new Ke(r,this).setName(k("Use Tags In Vault")).setDesc(k("Use tags in vault rather than only in Memos. False by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.UseVaultTags).onChange(async s=>{this.plugin.settings.UseVaultTags=s,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Focus on editor when open memos")).setDesc(k("Focus on editor when open memos. Focus by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.FocusOnEditor).onChange(async s=>{this.plugin.settings.FocusOnEditor=s,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Open daily memos with open memos")).setDesc(k("Open daily memos with open memos. Open by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.OpenDailyMemosWithMemos).onChange(async s=>{this.plugin.settings.OpenDailyMemosWithMemos=s,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Open Memos when obsidian opens")).setDesc(k("When enable this, Memos will open when Obsidian opens. False by default.")).setTab(n).addDropdown(o=>{o.addOption("Desktop","Desktop"),o.addOption("Mobile","Mobile"),o.addOption("All","All"),o.setValue(this.plugin.settings.MobileAndDesktop).onChange(async s=>{this.plugin.settings.MobileAndDesktop=s,this.applySettingsUpdate()})}).addToggle(o=>o.setValue(this.plugin.settings.OpenMemosAutomatically).onChange(async s=>{this.plugin.settings.OpenMemosAutomatically=s,this.applySettingsUpdate()}));let a;new Ke(r,this).setName(k("Default prefix")).setDesc(k("Set the default prefix when create memo, 'List' by default.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("List",k("List")),a.addOption("Task",k("Task")),a.setValue(this.plugin.settings.DefaultPrefix).onChange(async s=>{this.plugin.settings.DefaultPrefix=s,this.applySettingsUpdate()})}),new Ke(r,this).setName(k("Default insert date format")).setDesc(k("Set the default date format when insert date by @, 'Tasks' by default.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("Tasks","Tasks"),a.addOption("Dataview","Dataview"),a.setValue(this.plugin.settings.InsertDateFormat).onChange(async s=>{this.plugin.settings.InsertDateFormat=s,this.applySettingsUpdate()})})}addThinoProSettings(n,r,a){new Ke(r,this).setHeading().setTab(n).setName(k("Pro Features")),new Ke(r,this).setName(k("Add tag automatically")).setDesc(k("Add tag to the end or beginning of the thino content when creating a thino and filtering tags")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.addTagAutomatically).onChange(async s=>{if(!a){fn();return}this.plugin.settings.addTagAutomatically=s,this.applySettingsUpdate(),this.debounceDisplay()})),this.plugin.settings.addTagAutomatically&&(new Ke(r,this).setName(k("Add tag position")).setDesc(k("Set the position of the tag when adding tag automatically")).setTab(n).addDropdown(async o=>{o.addOption("End",k("End")),o.addOption("Beginning",k("Beginning")),o.setValue(this.plugin.settings.addTagPosition).onChange(async s=>{this.plugin.settings.addTagPosition=s,this.applySettingsUpdate()})}),new Ke(r,this).setName(k("Add tag with new line")).setDesc(k("Add tag with new line when adding tag automatically")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.addTagWithNewline).onChange(async s=>{this.plugin.settings.addTagWithNewline=s,this.applySettingsUpdate()})))}memosCommentSettings(n,r){new Ke(r,this).setName(k("Allow Comments On Memos")).setDesc(k("You can comment on memos. False by default")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.CommentOnMemos).onChange(async o=>{this.plugin.settings.CommentOnMemos=o,this.applySettingsUpdate(),this.display()})),this.plugin.settings.CommentOnMemos&&(new Ke(r,this).setName(k("Always Show Memo Comments")).setDesc(k("Always show memo comments on memos. False by default")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.ShowCommentOnMemos).onChange(async o=>{this.plugin.settings.ShowCommentOnMemos=o,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Comments In Original DailyNotes/Notes")).setDesc(k("You should install Dataview Plugin ver 0.5.9 or later to use this feature.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.CommentsInOriginalNotes).onChange(async o=>{this.plugin.settings.CommentsInOriginalNotes=o,this.applySettingsUpdate()})))}copyMemosSettings(n,r){new Ke(r,this).setName(k("Show Time When Copy Results")).setDesc(k("Show time when you copy results, like 12:00. Copy time by default.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.ShowTime).onChange(async o=>{this.plugin.settings.ShowTime=o,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Show Date When Copy Results")).setDesc(k("Show date when you copy results, like [[2022-01-01]]. Copy date by default.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.ShowDate).onChange(async o=>{this.plugin.settings.ShowDate=o,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Add Blank Line Between Different Date")).setDesc(k("Add blank line when copy result with date. No blank line by default.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.AddBlankLineWhenDate).onChange(async o=>{this.plugin.settings.AddBlankLineWhenDate=o,this.applySettingsUpdate()}))}shareMemosSettings(n,r){new Ke(r,this).setName(k("Save Shared Image To Folder For Mobile")).setDesc(k("Save image to folder for mobile. False by Default")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.AutoSaveWhenOnMobile).onChange(async o=>{this.plugin.settings.AutoSaveWhenOnMobile=o,this.applySettingsUpdate()})),this.customMemoFooter(n,r),new Ke(r,this).setName(k("Custom Background Image")).setDesc(k("Set custom background image.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.SetCustomBackgroundImage).onChange(async o=>{this.plugin.settings.SetCustomBackgroundImage=o,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.SetCustomBackgroundImage&&(new Ke(r,this).setName(k("Background Image in Light Theme")).setDesc(k('Set background image in light theme. Set something like "Daily/one.png"')).setTab(n).addText(a=>{new F2(a.inputEl),a.setPlaceholder(Oo.DefaultLightBackgroundImage).setValue(this.plugin.settings.DefaultLightBackgroundImage).onChange(async o=>{this.plugin.settings.DefaultLightBackgroundImage=o,this.applySettingsUpdate()})}),new Ke(r,this).setName(k("Background Image in Dark Theme")).setDesc(k('Set background image in dark theme. Set something like "Daily/one.png"')).setTab(n).addText(a=>{new F2(a.inputEl),a.setPlaceholder(Oo.DefaultDarkBackgroundImage).setValue(this.plugin.settings.DefaultDarkBackgroundImage).onChange(async o=>{this.plugin.settings.DefaultDarkBackgroundImage=o,this.applySettingsUpdate()})}))}customMemoFooter(n,r){new Ke(r,this).setName(k("Custom Memo Footer")).setDesc(k("Set custom memo footer.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.SetCustomMemoFooter).onChange(async o=>{this.plugin.settings.SetCustomMemoFooter=o,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.SetCustomMemoFooter&&(new Ke(r,this).setName(k("Share Memos Image Footer Start")).setDesc(k("Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default")).setTab(n).addText(a=>a.setPlaceholder(Oo.ShareFooterStart).setValue(this.plugin.settings.ShareFooterStart).onChange(async o=>{this.plugin.settings.ShareFooterStart=o,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Share Memos Image Footer End")).setDesc(k("Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default")).setTab(n).addText(a=>a.setPlaceholder(Oo.ShareFooterEnd).setValue(this.plugin.settings.ShareFooterEnd).onChange(async o=>{this.plugin.settings.ShareFooterEnd=o,this.applySettingsUpdate()})))}saveDataSettings(n,r){new Ke(r,this).setName(k("Default Memo Composition")).setDesc(k('Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default')).setTab(n).addText(o=>o.setPlaceholder(Oo.DefaultMemoComposition).setValue(this.plugin.settings.DefaultMemoComposition).setDisabled(!0).onChange(async s=>{this.plugin.settings.DefaultMemoComposition=s,this.applySettingsUpdate()}));let a;new Ke(r,this).setName(k("Default Editor Mode")).setDesc(k("Live-Preview Mode OR Source Mode.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("obsidian",k("Live-preview")),a.addOption("memos",k("Source")),a.setValue(this.plugin.settings.EditorType).onChange(async s=>{this.plugin.settings.EditorType=s,this.applySettingsUpdate()})}),new Ke(r,this).setName(k("Delete Thino Directly")).setDesc(k("When delete thino directly, it will not be moved to trash. False by default.")).setTab(n).addToggle(o=>{o.setValue(this.plugin.settings.DeleteThinoDirectly).onChange(async s=>{this.plugin.settings.DeleteThinoDirectly=s,this.applySettingsUpdate()})})}async initHttpServer(n,r){var d;const a=rt.getState().verifyState,o=!x.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=x.Platform.isDesktop?await zn():o.identifier||o.uuid,u=a&&(a==null?void 0:a.appId)===s;new Ke(n,this).setName(k("Enable Local Http Server")).setTab(r).setDisabled(!u).addToggle(m=>m.setValue(this.plugin.settings.EnabledHttpApi).onChange(async p=>{if(!u){fn();return}this.plugin.settings.EnabledHttpApi=p,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.settings.EnabledHttpApi?this.plugin.initServer():this.plugin.stopServer(),this.display()},100)})),this.plugin.settings.EnabledHttpApi&&(new Ke(n,this).setName(k("Memos Http Server Port")).setDesc(k("Set memos http server port to listen. '43999' by default")).setTab(r).addText(m=>m.setPlaceholder(Oo.HttpApiPort).setValue(this.plugin.settings.HttpApiPort).onChange(async p=>{if(!u){fn();return}this.plugin.settings.HttpApiPort=p,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})),new Ke(n,this).setName(k("Auto Download Image")).setDesc(k("Auto download image when save to thino. 'false' by default")).setTab(r).setDisabled(!u).addToggle(m=>{m.setValue(this.plugin.settings.AutoDownloadImage).onChange(async p=>{if(!u){fn();return}this.plugin.settings.AutoDownloadImage=p,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})}),new Ke(n,this).setName(k("Thino Http IP Type")).setDesc(k("Set Thino http server ip to listen. 'localhost' by default")).setTab(r).addDropdown(m=>{m.addOption("localhost","localhost"),m.addOption("127.0.0.1","127.0.0.1"),m.setValue(this.plugin.settings.HttpApiIpType).onChange(async p=>{if(!a||(a==null?void 0:a.appId)!==s){fn();return}this.plugin.settings.HttpApiIpType=p,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})}))}fetchDataSettings(n,r){let a;new Ke(r,this).setName(k("Use which plugin's default configuration")).setDesc(k("Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("Daily",k("Daily")),a.addOption("Periodic","Periodic"),a.setValue(this.plugin.settings.UseDailyOrPeriodic).onChange(async s=>{this.plugin.settings.UseDailyOrPeriodic=s,this.applySettingsUpdate()})})}navigationSettings(n,r){new Ke(r,this).setName(k("Allow navigation from view to Thino or Thino to view")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.navigation).onChange(async o=>{this.plugin.settings.navigation=o,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Need password to unlock Thino")).setTab(n).addToggle(a=>{this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched&&(a.toggleEl.onclick=o=>{this.passwordMatched||(o.preventDefault(),new L2(this.app,this,this.plugin,s=>{a.setDisabled(!s),this.passwordMatched=s,this.debounceDisplay()}).open(),new x.Notice(k("Please input your password to change password settings")))}),a.setDisabled(this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched).setValue(this.plugin.settings.needVerify).onChange(async o=>{this.plugin.settings.needVerify=o,o&&(this.passwordMatched=!1),this.applySettingsUpdate(),this.debounceDisplay()})}),this.plugin.settings.needVerify&&new Ke(r,this).setName(k("Password to lock Thino")).setTab(n).addText(a=>{this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched&&(a.inputEl.onclick=o=>{this.passwordMatched||(o.preventDefault(),new L2(this.app,this,this.plugin,s=>{a.inputEl.readOnly=!s,this.passwordMatched=s,this.debounceDisplay()}).open(),new x.Notice(k("Please input your password to change password settings")))}),a.inputEl.readOnly=this.plugin.settings.password&&this.plugin.settings.needVerify&&!this.passwordMatched,a.inputEl.oncopy=()=>!1,a.inputEl.type="password",a.setValue(this.plugin.settings.password).onChange(async o=>{this.plugin.settings.password=o,this.applySettingsUpdate()})})}setGlobalSettings(n,r,a){new Ke(r,this).setHeading().setTab(n).setName(k("Pro Features")),new Ke(r,this).setName(k("Default save location")).setDesc(k('Set the default save location for thino. "DAILY" by default')).setTab(n).addDropdown(async o=>{for(const s of this.plugin.settings.EnabledLocationList)o.addOption(s.value,k(s.value));o.setValue(this.plugin.settings.MemoSaveLocation||this.plugin.settings.EnabledLocationList[0].value).onChange(async s=>{if(!a){fn();return}this.plugin.settings.MemoSaveLocation=s,this.applySettingsUpdate()})}),this.initHttpServer(r,n),new Ke(r,this).setName(k("Enable opening thino globally")).setDesc(k("Enable opening thino globally. False by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.CaptureKey.EnableCaptureKey).onChange(async s=>{if(!a){fn();return}this.plugin.settings.CaptureKey.EnableCaptureKey=s,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.CaptureKey.EnableCaptureKey&&(new Ke(r,this).setName(k("Key for opening thino globally")).setDesc(k("Set key for opening thino globally. CTRL + SHIFT + T by default.")).setTab(n).addText(o=>o.setPlaceholder(Oo.CaptureKey.OpenThinoGlobally).setValue(this.plugin.settings.CaptureKey.OpenThinoGlobally).onChange(async s=>{if(!a){fn();return}this.plugin.settings.CaptureKey.OpenThinoGlobally=s,this.applySettingsUpdate()})),new Ke(r,this).setName(k("Show thino near mouse")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.CaptureKey.ShowNearMouse).onChange(async s=>{if(!a){fn();return}this.plugin.settings.CaptureKey.ShowNearMouse=s,this.applySettingsUpdate()})))}checkInList(n){return this.plugin.settings.EnabledLocationList.find(r=>r.value===n)!==void 0}customFileNameSettings(n,r,a){var d;const o=document.createDocumentFragment(),s=o.createEl("div",{cls:"memo-save-location-desc"});for(const m of fC){const p=s.createEl("div",{cls:`memo-save-location-desc-item ${m.value}`}),g=p.createEl("span",{cls:"memo-save-location-desc-item-icon"});x.setIcon(g,((d=Md.find(E=>E.title===m.value))==null?void 0:d.icon)||""),p.createEl("span",{cls:"memo-save-location-desc-item-desc",text:`${k(m.value)}`});const w=p.createEl("span",{cls:"memo-save-location-desc-item-toggle"}),D=p.createEl("span",{cls:"memo-save-location-desc-item-setting"});m.value!=="DAILY"&&p.createEl("span",{cls:["memo-save-location-desc-item-pro","user-pro-badge"],text:"PRO"}),new x.ToggleComponent(w).setValue(this.checkInList(m.value)).onChange(async E=>{if(!a){fn();return}E?(await Ie.updateTypeMemos(m.value),this.plugin.settings.EnabledLocationList=[...this.plugin.settings.EnabledLocationList,m]):(await Ie.removeTypeMemos(m.value),this.plugin.settings.EnabledLocationList=this.plugin.settings.EnabledLocationList.filter(A=>A.value!==m.value)),this.plugin.settings.EnabledLocationList.length===1&&(this.plugin.settings.MemoSaveLocation=m.value),this.applySettingsUpdate(),setTimeout(()=>{this.display()},500)}).setDisabled(this.plugin.settings.EnabledLocationList.length===1&&this.checkInList(m.value)),new x.ExtraButtonComponent(D).setIcon("settings").onClick(()=>{new pK(this.app,this,this.plugin,m,a).open()})}const u=new Ke(r,this).setName(k("Save Location for Memos")).setDesc(o).setTab(n);u.settingEl.toggleClass("memo-save-location-setting",!0),u.nameEl.toggleClass("memo-save-location-title",!0)}}class pK extends x.Modal{constructor(n,r,a,o,s){super(n);he(this,"plugin");he(this,"settingTab");he(this,"LocationList");he(this,"target","");he(this,"insertTarget","");he(this,"verified");he(this,"updateValue",x.debounce(n=>{this.LocationList.value!=="DAILY"&&this.LocationList.value!=="MULTI"?this.target=n.trim()===""?"basic":n.trim():this.target=n.trim()===""&&this.LocationList.value==="MULTI"?"Memos":n.trim()},400,!0));this.verified=s,this.app=n,this.settingTab=r,this.plugin=a,this.LocationList=o,this.target=o.target!=="ProcessEntriesBelow"?a.settings.MemoOtherSaveLocation[o.target]:a.settings[o.target],this.insertTarget=a.settings.InsertAfter}onOpen(){var p;const{contentEl:n}=this;(p=n.parentElement)==null||p.classList.add("memo-save-location-modal"),this.titleEl.toggleClass("modal-title",!0),this.titleEl.setText(k("Save Location for Memos")+` [${k(this.LocationList.value)}]`),(this.LocationList.value==="FILE"||this.LocationList.value==="CANVAS")&&n.createDiv("modal-desc",g=>{g.setText(k('You can set folder name with file name like "folder/file"'))}),this.LocationList.value==="MULTI"&&n.createDiv("modal-desc",g=>{g.setText(k('You can set folder name like "folder1/folder2/folder3" to create sub-folder'))}),this.LocationList.value==="DAILY"&&n.createDiv("modal-desc",g=>{g.setText(k('You can set target heading like "# Heading" to control data location'))});const r=n.createDiv("modal-setting"),a=this.LocationList.value==="DAILY"?k("Process Memos below"):this.LocationList.value==="MULTI"?k("Set the folder name"):k("Set the filename"),o=k("Insert after heading");this.LocationList.value==="DAILY"&&new Ke(r,this.settingTab).setName(o).setDesc(k("If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.")).addText(g=>g.setPlaceholder(k("# Heading")).setValue(this.insertTarget).onChange(async w=>{this.insertTarget=w}));const s=new Ke(r,this.settingTab).setName(a).addText(g=>g.setPlaceholder(this.LocationList.value==="DAILY"?k("# Heading"):k("Set the filename for current location file")).setValue(this.LocationList.value!=="DAILY"&&this.LocationList.value!=="MULTI"?this.target.replace(/\.thino\.(canvas|md)/g,""):this.target).onChange(async w=>{const D=this.LocationList.value==="CANVAS"?".thino.canvas":this.LocationList.value==="FILE"?".thino.md":"";this.updateValue(w.replace(/\.thino\.(canvas|md)/g,"")+D)}));this.LocationList.value==="DAILY"&&s.setDesc(k("If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.")),this.LocationList.value!=="DAILY"&&this.LocationList.value!=="MULTI"&&s.controlEl.createEl("span",{text:`${this.LocationList.value==="FILE"?".thino.md":".thino.canvas"}`});const u=n.createDiv("button-group"),d=u.createEl("button",{text:k("Cancel")}),m=u.createEl("button",{text:k("Save")});m.onclick=async()=>{if(!this.verified&&this.LocationList.value!=="DAILY"){this.close(),fn();return}this.LocationList.target!=="ProcessEntriesBelow"?this.plugin.settings.MemoOtherSaveLocation[this.LocationList.target]=this.target:this.plugin.settings[this.LocationList.target]=this.target,this.LocationList.target==="ProcessEntriesBelow"&&(this.plugin.settings.InsertAfter=this.insertTarget),this.settingTab.applySettingsUpdate(),setTimeout(()=>{Ie.updateTypeMemos(this.LocationList.value)},1e3),this.close()},d.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}class L2 extends x.Modal{constructor(n,r,a,o){super(n);he(this,"plugin");he(this,"settingTab");this.cb=o,this.app=n,this.settingTab=r,this.plugin=a}onOpen(){var d;const{contentEl:n}=this;(d=n.parentElement)==null||d.classList.add("memo-save-location-modal"),this.titleEl.toggleClass("modal-title",!0),this.titleEl.setText(k("Password for Thino")),n.createDiv("modal-desc",m=>{m.setText(k("Please input your password to change password settings"))});const r=n.createDiv("modal-setting"),a=new Ke(r,this.settingTab).setName(k("Password")).addText(m=>m.setPlaceholder(k("Please input your password")).inputEl.type="password"),o=n.createDiv("button-group"),s=o.createEl("button",{text:k("Cancel")}),u=o.createEl("button",{text:k("Confirm?").replace(/(\?|?)/g,"")});u.onclick=async()=>{var m;a.controlEl.querySelector("input").value===this.plugin.settings.password?((m=this.cb)==null||m.call(this,!0),this.close()):new x.Notice(k("Password is incorrect"))},s.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}const gK=e=>{const{app:t,view:n}=Ee.getState().dailyNotesState,{memo:r}=e,a={...r,createdAtStr:Re.getDateTimeString(r.createdAt),timeStr:Re.getTimeString(r.createdAt)},o=q.useRef(null),s=q.useRef(null);O.useEffect(()=>{if(!s.current||!o.current||(s.current.hasChildNodes()&&s.current.children[0].detach(),!n))return;async function g(){var D;await x.MarkdownRenderer.render(t,r.content+` `,s.current,r.path,n);const w=(D=s.current)==null?void 0:D.querySelectorAll(".internal-link");w==null||w.forEach(S=>{const T=S,E=T.getAttribute("data-href");if(!E)return;t.metadataCache.getFirstLinkpathDest(E,r.path)||S.classList.add("is-unresolved"),T.addEventListener("mouseover",N=>{N.stopPropagation(),t.workspace.trigger("hover-link",{event:N,source:"thino",hoverParent:n.containerEl,targetEl:T,linktext:E,sourcePath:T.href})})})}g()},[e.memo.content]);const u=()=>{e.onClickThino&&e.onClickThino(a)},d=async(g,w,D)=>{var E;const S=((E=D.parentElement.dataset)==null?void 0:E.task)==="x"?"DONE":"TODO",T=[...(w==null?void 0:w.querySelectorAll("li.task-list-item"))||[]];for(const A of T)if(A===D||A===D.closest("li.task-list-item")){const N=T.indexOf(A),R=g.content.split(/\n/),F=[];for(let U=0;U{g.preventDefault();const w=g.target;if(w.tagName==="INPUT"&&w.hasClass("task-list-item-checkbox")){await d(a,o.current,w);return}};return O.useMemo(()=>y.jsxs("div",{ref:o,className:"daily-memo-wrapper",children:[y.jsx("div",{className:"time-wrapper",onClick:u,children:y.jsx("span",{className:"normal-text",children:a.timeStr})}),y.jsx("div",{className:"memo-content-container",children:y.jsx("div",{ref:s,onClick:m,className:"memo-content-text"})})]}),[r.content])},vK=e=>{const{memoState:{memos:t}}=O.useContext(wt),n=Yc(),[r,a]=O.useState([]),[o,s]=O.useState(Re.getDateStampByDate(Re.getDateString(e.currentDateStamp))),[u,d]=_o(!1),m=O.useRef(null),p=new Date(o),{vault:g}=Ee.getState().dailyNotesState.app,w=Ee.getState().dailyNotesState.settings,[D,S]=O.useState("");O.useEffect(()=>{(()=>{const R=t.filter(F=>Re.getTimeStampByDate(F.createdAt)>=o&&Re.getTimeStampByDate(F.createdAt)F.deletedAt==="").sort((F,H)=>Re.getTimeStampByDate(F.createdAt)-Re.getTimeStampByDate(H.createdAt));a(R),n.setFinish()})()},[o,t]);const T=async()=>{d(!1),setTimeout(()=>{m.current&&Uv(m.current,{backgroundColor:"#ffffff",pixelRatio:window.devicePixelRatio*2}).then(N=>{if(w!=null&&w.AutoSaveWhenOnMobile&&x.Platform.isMobile){const R=N.split("base64,")[1];Av(R,"image/png").arrayBuffer().then(async H=>{let P;const L="png",z=ws();for(const U in z)if(z[U]instanceof x.TFile){P=z[U];break}P!==void 0&&await g.createBinary(await g.getAvailablePathForAttachments(`Pasted Image ${x.moment().format("YYYYMMDDHHmmss")}`,L,P),H)})}Vv({imgUrl:N})}).catch(()=>{})},0)},E=N=>{s(N),d(!1)},A=O.useMemo(()=>y.jsxs("div",{className:"header-wrapper",children:[y.jsx("span",{className:"title-text",children:k("Daily Memos")}),y.jsxs("div",{className:"btns-container",children:[y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"chevron-left")},className:"btn btn-text",onClick:()=>s(N=>N-Ba)}),y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"chevron-right")},className:"btn btn-text",onClick:()=>s(N=>N+Ba)}),y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"share")},className:"btn btn-text share-btn",onClick:T}),y.jsx("span",{ref:N=>{x.setIcon&&N&&x.setIcon(N,"x")},className:"btn btn-text",onClick:()=>e.destroy()})]})]}),[]);return y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"dialog-header-container",children:A}),y.jsx("div",{className:"dialog-header-container",children:y.jsx("input",{onChange:N=>S(N.target.value),value:D,placeholder:k("Search")})}),y.jsxs("div",{className:"dialog-content-container",ref:m,children:[y.jsxs("div",{className:"date-card-container",onClick:()=>d(),children:[y.jsx("div",{className:"year-text",children:p.getFullYear()}),y.jsxs("div",{className:"date-container",children:[y.jsx("div",{className:"month-text",children:k("months")[p.getMonth()]}),y.jsx("div",{className:"date-text",children:p.getDate()}),y.jsx("div",{className:"day-text",children:k("weekDays")[p.getDay()]})]})]}),y.jsx(Nm,{className:`date-picker ${u?"":"hidden"}`,datestamp:o,handleDateStampChange:E}),n.isLoading?y.jsx("div",{className:"tip-container",children:y.jsx("span",{className:"tip-text",children:k("Loading...")})}):r.length===0?y.jsx("div",{className:"tip-container",children:y.jsx("span",{className:"tip-text",children:k("Noooop!")})}):y.jsx("div",{className:"dailymemos-wrapper",children:r.filter(N=>N.content.toLowerCase().includes(D.toLowerCase())).map(N=>y.jsx(gK,{memo:N,onClickThino:R=>{e.destroy(),Gd(R)}},`${N.id}-${N.updatedAt}`))})]})]})};function aw(e=Date.now()){xm({className:"daily-memo-diary-dialog"},vK,{currentDateStamp:e})}function uy(e){return e.split("-")[0]}function hC(e){return e.split("-")[1]}function db(e){return["top","bottom"].includes(uy(e))?"x":"y"}function mC(e){return e==="y"?"height":"width"}function R2(e){let{reference:t,floating:n,placement:r}=e;const a=t.x+t.width/2-n.width/2,o=t.y+t.height/2-n.height/2;let s;switch(uy(r)){case"top":s={x:a,y:t.y-n.height};break;case"bottom":s={x:a,y:t.y+t.height};break;case"right":s={x:t.x+t.width,y:o};break;case"left":s={x:t.x-n.width,y:o};break;default:s={x:t.x,y:t.y}}const u=db(r),d=mC(u);switch(hC(r)){case"start":s[u]=s[u]-(t[d]/2-n[d]/2);break;case"end":s[u]=s[u]+(t[d]/2-n[d]/2);break}return s}const yK=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:s}=n;let u=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:m}=R2({...u,placement:r}),p=r,g={};for(let w=0;wDK[t])}function SK(e,t){const n=hC(e)==="start",r=db(e),a=mC(r);let o=r==="x"?n?"right":"left":n?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Cv(o)),{main:o,cross:Cv(o)}}const IK={start:"end",end:"start"};function _2(e){return e.replace(/start|end/g,t=>IK[t])}function TK(e){const t=Cv(e);return[_2(e),t,_2(t)]}const EK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:s,initialPlacement:u}=t;if((n=o.flip)!=null&&n.skip)return{};const{mainAxis:d=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",flipAlignment:w=!0,...D}=e,S=uy(a),E=p||(S===u||!w?[Cv(u)]:TK(u)),A=[u,...E],N=await Xw(t,D),R=[];let F=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&R.push(N[S]),m){const{main:z,cross:U}=SK(a,s);R.push(N[z],N[U])}if(F=[...F,{placement:a,overflows:R}],!R.every(z=>z<=0)){var H,P;const z=((H=(P=o.flip)==null?void 0:P.index)!=null?H:0)+1,U=A[z];if(U)return{data:{index:z,overflows:F},reset:{placement:U}};let W="bottom";switch(g){case"bestFit":{var L;const K=(L=F.slice().sort((ae,ce)=>ae.overflows.filter(fe=>fe>0).reduce((fe,ie)=>fe+ie,0)-ce.overflows.filter(fe=>fe>0).reduce((fe,ie)=>fe+ie,0))[0])==null?void 0:L.placement;K&&(W=K);break}case"initialPlacement":W=u;break}return{data:{skip:!0},reset:{placement:W}}}return{}}}};function xK(e){let{placement:t,rects:n,value:r}=e;const a=uy(t),o=["left","top"].includes(a)?-1:1,s=typeof r=="function"?r({...n,placement:t}):r,{mainAxis:u,crossAxis:d}=typeof s=="number"?{mainAxis:s,crossAxis:0}:{mainAxis:0,crossAxis:0,...s};return db(a)==="x"?{x:d,y:u*o}:{x:u*o,y:d}}const CK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(t){const{x:n,y:r,placement:a,rects:o}=t,s=xK({placement:a,rects:o,value:e});return{x:n+s.x,y:r+s.y,data:s}}}};function fb(e){return(e==null?void 0:e.toString())==="[object Window]"}function Cl(e){if(e==null)return window;if(!fb(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function dy(e){return Cl(e).getComputedStyle(e)}function vs(e){return fb(e)?"":e?(e.nodeName||"").toLowerCase():""}function ys(e){return e instanceof Cl(e).HTMLElement}function Mv(e){return e instanceof Cl(e).Element}function MK(e){return e instanceof Cl(e).Node}function pC(e){const t=Cl(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function fy(e){const{overflow:t,overflowX:n,overflowY:r}=dy(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function NK(e){return["table","td","th"].includes(vs(e))}function gC(e){const t=navigator.userAgent.toLowerCase().includes("firefox"),n=dy(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)}const H2=Math.min,Kh=Math.max,Nv=Math.round;function Rd(e,t){t===void 0&&(t=!1);const n=e.getBoundingClientRect();let r=1,a=1;return t&&ys(e)&&(r=e.offsetWidth>0&&Nv(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Nv(n.height)/e.offsetHeight||1),{width:n.width/r,height:n.height/a,top:n.top/a,right:n.right/r,bottom:n.bottom/a,left:n.left/r,x:n.left/r,y:n.top/a}}function Ml(e){return((MK(e)?e.ownerDocument:e.document)||window.document).documentElement}function hy(e){return fb(e)?{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}:{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function vC(e){return Rd(Ml(e)).left+hy(e).scrollLeft}function kK(e){const t=Rd(e);return Nv(t.width)!==e.offsetWidth||Nv(t.height)!==e.offsetHeight}function AK(e,t,n){const r=ys(t),a=Ml(t),o=Rd(e,r&&kK(t));let s={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if(r||!r&&n!=="fixed")if((vs(t)!=="body"||fy(a))&&(s=hy(t)),ys(t)){const d=Rd(t,!0);u.x=d.x+t.clientLeft,u.y=d.y+t.clientTop}else a&&(u.x=vC(a));return{x:o.left+s.scrollLeft-u.x,y:o.top+s.scrollTop-u.y,width:o.width,height:o.height}}function my(e){return vs(e)==="html"?e:e.assignedSlot||e.parentNode||(pC(e)?e.host:null)||Ml(e)}function B2(e){return!ys(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function OK(e){let t=my(e);for(;ys(t)&&!["html","body"].includes(vs(t));){if(gC(t))return t;t=t.parentNode}return null}function e1(e){const t=Cl(e);let n=B2(e);for(;n&&NK(n)&&getComputedStyle(n).position==="static";)n=B2(n);return n&&(vs(n)==="html"||vs(n)==="body"&&getComputedStyle(n).position==="static"&&!gC(n))?t:n||OK(e)||t}function Y2(e){return{width:e.offsetWidth,height:e.offsetHeight}}function FK(e){let{rect:t,offsetParent:n,strategy:r}=e;const a=ys(n),o=Ml(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0};const u={x:0,y:0};if((a||!a&&r!=="fixed")&&((vs(n)!=="body"||fy(o))&&(s=hy(n)),ys(n))){const d=Rd(n,!0);u.x=d.x+n.clientLeft,u.y=d.y+n.clientTop}return{...t,x:t.x-s.scrollLeft+u.x,y:t.y-s.scrollTop+u.y}}function PK(e){const t=Cl(e),n=Ml(e),r=t.visualViewport;let a=n.clientWidth,o=n.clientHeight,s=0,u=0;return r&&(a=r.width,o=r.height,Math.abs(t.innerWidth/r.scale-r.width)<.01&&(s=r.offsetLeft,u=r.offsetTop)),{width:a,height:o,x:s,y:u}}function jK(e){var t;const n=Ml(e),r=hy(e),a=(t=e.ownerDocument)==null?void 0:t.body,o=Kh(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Kh(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0);let u=-r.scrollLeft+vC(e);const d=-r.scrollTop;return dy(a||n).direction==="rtl"&&(u+=Kh(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:s,x:u,y:d}}function yC(e){return["html","body","#document"].includes(vs(e))?e.ownerDocument.body:ys(e)&&fy(e)?e:yC(my(e))}function wC(e,t){var n;t===void 0&&(t=[]);const r=yC(e),a=r===((n=e.ownerDocument)==null?void 0:n.body),o=Cl(r),s=a?[o].concat(o.visualViewport||[],fy(r)?r:[]):r,u=t.concat(s);return a?u:u.concat(wC(my(s)))}function LK(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&pC(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function RK(e){const t=Rd(e),n=t.top+e.clientTop,r=t.left+e.clientLeft;return{top:n,left:r,x:r,y:n,right:r+e.clientWidth,bottom:n+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}function z2(e,t){return t==="viewport"?Qw(PK(e)):Mv(t)?RK(t):Qw(jK(Ml(e)))}function _K(e){const t=wC(my(e)),r=["absolute","fixed"].includes(dy(e).position)&&ys(e)?e1(e):e;return Mv(r)?t.filter(a=>Mv(a)&&LK(a,r)&&vs(a)!=="body"):[]}function HK(e){let{element:t,boundary:n,rootBoundary:r}=e;const o=[...n==="clippingParents"?_K(t):[].concat(n),r],s=o[0],u=o.reduce((d,m)=>{const p=z2(t,m);return d.top=Kh(p.top,d.top),d.right=H2(p.right,d.right),d.bottom=H2(p.bottom,d.bottom),d.left=Kh(p.left,d.left),d},z2(t,s));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}const BK={getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:AK(t,e1(n),r),floating:{...Y2(n),x:0,y:0}}},convertOffsetParentRelativeRectToViewportRelativeRect:e=>FK(e),getOffsetParent:e=>{let{element:t}=e;return e1(t)},isElement:e=>Mv(e),getDocumentElement:e=>{let{element:t}=e;return Ml(t)},getClippingClientRect:e=>HK(e),getDimensions:e=>{let{element:t}=e;return Y2(t)},getClientRects:e=>{let{element:t}=e;return t.getClientRects()}},YK=(e,t,n)=>yK(e,t,{platform:BK,...n});var zK=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,a,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[a]))return!1;for(a=r;a--!==0;){var s=o[a];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n};const UK=Xn(zK),ow=Qh.Facet.define({combine:e=>{var t,n;return{defaultPlacement:((t=e.find(r=>r.defaultPlacement))==null?void 0:t.defaultPlacement)||"top",padding:((n=e.find(r=>r.padding))==null?void 0:n.padding)||8}}}),bC=e=>e.split("-")[0],VK=e=>e==="x"?"y":"x",ZK=e=>["top","bottom"].includes(bC(e))?"x":"y",Hh=(e,t,n)=>Math.max(e,Math.min(t,n)),WK=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r],a)=>[n,t(r,n,a)])),$K=e=>e===void 0?e:typeof e=="number"?-e:WK(e,t=>t!==void 0?-t:t),GK=(e={})=>({name:"shift",fn:async t=>{const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:u=({x:E,y:A})=>({x:E,y:A}),editorMenu:d,...m}=e,p={x:n,y:r},g=await Xw(t,m),w=ZK(bC(a)),D=VK(w);let S=p[w],T=p[D];if(o){const E=w==="y"?"top":"left",A=w==="y"?"bottom":"right",N=S+g[E],R=S-g[A];if(d){const F=await Xw(t,{...m,boundary:d.dom,padding:$K(m.padding)});if((D==="y"?["top","bottom"]:["left","right"]).every(P=>F[P]<=0)){const P=t.rects.floating.width,L=S+F[E]-P,z=S-F[A]+P,U=Math.abs(g[E]-F[E]),W=Math.abs(g[A]-F[A]);U>=P||W({width:0,height:0,top:t,left:e,bottom:t,right:e,x:e,y:t}),KK=(e,t)=>{if(!e)return null;const n=Math.min(e.left,(t==null?void 0:t.left)??e.left),r=Math.max(e.right,(t==null?void 0:t.right)??e.right),a=Math.max(e.bottom,(t==null?void 0:t.bottom)??e.bottom)-Math.min(e.top,(t==null?void 0:t.top)??e.top),o=Math.min(e.top,(t==null?void 0:t.top)??e.top),s=o+a,u={left:n,right:r,top:o,bottom:s,width:0,height:a,x:o,y:n};return t&&(u.width=Math.abs(r-n)),u},QK=JK();class XK{constructor(t){he(this,"containerEl");he(this,"virtualEl");he(this,"toolbar",null);he(this,"isThinoView");he(this,"tooltipInfo");he(this,"inView",!0);he(this,"defaultPlacement");he(this,"editorMenu");he(this,"cachedRefRect",null);he(this,"readFromDOM",()=>{if(this.tooltipInfo){const{start:t}=this.tooltipInfo;let{end:n}=this.tooltipInfo;n&&t===n&&(n=void 0);const r=this.view.coordsAtPos(t);let a=n?this.view.coordsAtPos(n):null;if(r&&a&&r.top!==a.top){const s=this.view.contentDOM.getBoundingClientRect();a={left:s.right,right:s.right,top:r.top,bottom:r.bottom}}const o=KK(r,a);o&&(this.cachedRefRect=o,this.computePosition(o))}});this.view=t,this.containerEl=this.view.dom.parentElement,this.defaultPlacement=this.view.state.facet(ow).defaultPlacement,this.tooltipInfo=t.state.facet(t1),this.virtualEl={rect:QK,getBoundingClientRect(){return this.rect}},this.maybeMeasure(),this.editorMenu={currMenu:null,evtRef:t.state.field(x.editorInfoField)},this.isThinoView=this.checkThinoView()}get workspace(){return this.view.state.field(x.editorInfoField).app.workspace}checkThinoView(){return this.view.state.field(x.editorInfoField)&&this.view.state.field(x.editorInfoField)instanceof yl}shouldRemoveToolbar(t){const n=t??this.tooltipInfo;return!(n!=null&&n.end||this.editorMenu.currMenu)}onEditorMenuOpen(t){this.editorMenu.currMenu||(this.editorMenu.currMenu=t,this.cachedRefRect?this.computePosition(this.cachedRefRect):this.maybeMeasure(),!x.Platform.isMacOS&&this.tooltipInfo&&(this.createToolbar(),this.maybeMeasure()))}onEditorMenuClose(t){this.editorMenu.currMenu===t&&(this.editorMenu.currMenu=null),!x.Platform.isMacOS&&this.toolbar&&this.shouldRemoveToolbar()&&this.removeToolbar()}createToolbar(t){const n=t??this.tooltipInfo;if(!n)return;this.removeToolbar();const r=n.create(this.containerEl),a=this.view.state.field(x.editorInfoField);if(!a||!(a!=null&&a.editor))return;const o=a.editor.offsetToPos(n.start),s=n.end?a.editor.offsetToPos(n.end):o;this.workspace.trigger(qK,r,{from:o,to:s},a.editor,a),this.toolbar=r}removeToolbar(){this.toolbar&&(this.toolbar.hide(),this.toolbar=null)}update(t){if(!this.isThinoView)return;const n=t.state.facet(t1),r=n!==this.tooltipInfo&&!UK(n,this.tooltipInfo);r&&(this.tooltipInfo=n,this.shouldRemoveToolbar()?this.removeToolbar():n&&!this.toolbar&&this.createToolbar(n));const a=r||t.geometryChanged,o=t.state.facet(ow);o.defaultPlacement!=this.defaultPlacement&&(o.defaultPlacement=this.defaultPlacement),a&&this.maybeMeasure()}destroy(){this.editorMenu.currMenu=null,this.removeToolbar(),this.toolbar=null,this.view.state.field(x.editorInfoField).app.workspace.offref(this.editorMenu.evtRef)}async computePosition(t){if(!this.toolbar)return;this.virtualEl.rect=t;const{padding:n}=this.view.state.facet(ow),{x:r,y:a}=await YK(this.virtualEl,this.toolbar.dom,{placement:this.defaultPlacement,middleware:[CK({mainAxis:5}),EK({padding:n,boundary:this.view.scrollDOM}),GK({padding:n,boundary:this.view.scrollDOM,editorMenu:this.editorMenu.currMenu})]});Object.assign(this.toolbar.dom.style,{top:"0",left:"0",transform:`translate(${Math.round(r)}px,${Math.round(a)}px)`})}maybeMeasure(){this.view.inView&&this.toolbar&&this.view.requestMeasure({read:this.readFromDOM}),this.inView!=this.view.inView&&(this.inView=this.view.inView,this.inView||this.removeToolbar())}}const eQ=Ci.ViewPlugin.fromClass(XK,{eventHandlers:{scroll(){this.maybeMeasure()}}}),t1=Qh.Facet.define({enables:[eQ],combine:e=>e.filter(t=>t!=null).first()??null}),tQ=e=>{const t=iQ(e);t&&window.navigator.clipboard.writeText(t==null?void 0:t.getSelection())},nQ=e=>{e.commands.executeCommandById("editor:toggle-bold",e)},rQ=e=>{e.commands.executeCommandById("editor:toggle-strikethrough",e)},aQ=e=>{e.commands.executeCommandById("editor:toggle-highlight",e)},oQ=e=>{e.commands.executeCommandById("editor:toggle-italics",e)},iQ=e=>{const{editor:t}=e.field(x.editorInfoField);return t},U2=(e,t)=>{const n=e.selection.ranges[0];if(!n)return null;const{anchor:r,head:a,empty:o}=n,[s,u]=[r,a].sort();return{start:s,end:o?void 0:u,create:m=>new uQ(m).addSmallButton(g=>g.setClass("clickable-icon").setIcon("copy").onClick(()=>tQ(e))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("bold").onClick(()=>nQ(t))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("italic").onClick(()=>oQ(t))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("strikethrough").onClick(()=>rQ(t))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("highlighter").onClick(()=>aQ(t)))}},sQ=e=>Qh.StateField.define({create:t=>U2(t,e),update:(t,n)=>!n.docChanged&&!n.selection?t:U2(n.state,e),provide:t=>t1.from(t)}),lQ=e=>[sQ(e)];class cQ extends x.BaseComponent{constructor(n){super();he(this,"button");he(this,"disabled",!1);he(this,"dropdownOptions",[]);he(this,"menu");he(this,"menuOpened",!1);this.button=new x.ButtonComponent(n)}setDisabled(n){return this.button.setDisabled(n),this.disabled=n,this}setIcon(n){return this.button.setIcon(n),this}setClass(n){return this.button.setClass(n),this}setDropdownText(n){var d;const r=this.button.buttonEl.createDiv("mini-toolbar-text"),a=this.button.buttonEl.createDiv("mini-toolbar-icon-with-text");x.setIcon(a,"chevron-down");const o=(d=n.doc.lineAt(n.selection.ranges[0].from))==null?void 0:d.from,s=y0.syntaxTree(n).resolveInner(o+1),u=s.type.prop(y0.tokenClassNodeProp);return r.setText(this.detectFormat(u,s)||"Text"),this}setDropdownIcon(){const n=this.button.buttonEl.createDiv("mini-toolbar-highlight-icon"),r=this.button.buttonEl.createDiv("mini-toolbar-icon-with-icon");return x.setIcon(n,"highlighter"),x.setIcon(r,"chevron-down"),this}detectFormat(n,r){var a;if(!n)return"Text";if(n.includes("strong"))return"Bold";if(n.includes("em"))return"Italic";if(n.includes("strikethrough"))return"Strike";if(n.contains("hmd-codeblock"))return"CodeBlock";if(n.contains("hmd-inline-code"))return"Code";if(n.contains("formatting-header")){const o=n.match(/header-\d{1,}/);if(o)return"Heading "+o[0].slice(-1)}if(n.contains("formatting-list")||n.contains("hmd-list-indent")){if(r!=null&&r.parent){const o=(a=r.parent)==null?void 0:a.type.prop(y0.lineClassNodeProp);if(o!=null&&o.contains("HyperMD-task-line"))return"To-do list"}if(n.contains("formatting-list-ol"))return"Numbered list";if(n.contains("formatting-list-ul"))return"Bulleted list"}}setTooltip(n){return this.button.setTooltip(n),this}setOptionsList(n){return this.dropdownOptions=n,this}onClick(n){return this.dropdownOptions.length>0?(this.button.onClick(r=>this.showEditMenu(r)),this):(this.button.onClick(n),this)}showEditMenu(n){var s,u;if(this.menuOpened=!this.menuOpened,!this.menuOpened)return;this.menu=new x.Menu,this.menu.onHide(()=>{this.menuOpened=!1});const r=n.currentTarget,a=(s=n.currentTarget)==null?void 0:s.getBoundingClientRect(),o={x:a.left-6,y:a.bottom+6};for(let d=0;d<((u=this.dropdownOptions)==null?void 0:u.length);d++)this.menu.addItem(m=>{m.setIcon("zap").setTitle(this.dropdownOptions[d]).onClick(()=>{})});this.menu.setParentElement(r).showAtPosition(o)}then(n){return n(this),this}}class uQ extends x.Component{constructor(n){super();he(this,"dom");he(this,"smallBtnContainer");he(this,"unloading",!1);this.dom=n==null?void 0:n.createDiv({cls:"cm-mini-toolbar"},r=>r.style.position="absolute"),this.smallBtnContainer=this.dom}addSmallButton(n){return n(new cQ(this.smallBtnContainer)),this}hide(){return this.unload(),this.unloading?this:(this.unloading=!0,this.dom.detach(),this.unloading=!1,this)}}const dQ=Ci.Decoration.line({attributes:{"data-ph":k("What do you think now...")},class:"thino-editor-placeholder"}),fQ=Qh.StateField.define({create(){return Ci.Decoration.none},update(e,t){const n=t.state.field(x.editorInfoField);if(!(n!=null&&n.view)&&!((n==null?void 0:n.view)instanceof yl))return e;const r=new Qh.RangeSetBuilder,a=t.state.doc.toString(),o=t.state.doc.lineAt(0);return(a==null?void 0:a.length)==0&&r.add(o.from,o.from,dQ),r.finish()},provide:e=>Ci.EditorView.decorations.from(e)});function DC(e){return`userId:${e}`}function hQ(e,t){return`expiryDate:${t}:${e}`}function mQ(e){try{const t=DC(e==null?void 0:e.appId);return Kn.get([t])[t]||""}catch(t){return console.error(t),""}}function pQ(e,t){try{const n=DC(t==null?void 0:t.appId);return Kn.set({[n]:e}),{userId:e,key:n}}catch(n){console.error(n)}}function gQ(e,t){try{const n=hQ(mQ(t),t==null?void 0:t.appId);Kn.set({[n]:e})}catch(n){console.error(n)}}const vQ=Re.grabImageFromUrl,yQ=require("http"),wQ=require("url");function bQ(e){const t=e.indexOf(";base64,"),n=e.substring(5,t),r=e.substr(t+8),a=atob(r),o=new ArrayBuffer(a.length),s=new Uint8Array(o);for(let d=0;d{const{type:t}=e;if(t.startsWith("image"))try{return`${await y1.upload(e)}`}catch(n){new x.Notice(n)}};function DQ(e){const t=yQ.createServer(async function(n,r){r.setHeader("Access-Control-Allow-Origin","*"),r.setHeader("Access-Control-Allow-Methods","GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE"),r.setHeader("Access-Control-Allow-Headers","Access-Control-Allow-Headers, Origin, Authorization,Accept,x-client-id, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, hypothesis-client-version"),r.setHeader("Access-Control-Allow-Credentials","true");try{if(n.url){const a=wQ.parse(n.url,!0);if(a.pathname==="/create"&&n.method==="POST"){let o="";n.on("data",s=>{o+=s}),n.on("end",async()=>{const s=JSON.parse(o),{text:u,isList:d,type:m,imageList:p}=s;let g=u;if(!g){r.statusCode=200,r.setHeader("Content-Type","application/json"),r.end(JSON.stringify({status:"success",thino:null,link:null}));return}new RegExp(/(<([^>]+)>)/g).test(u)&&(g=x.htmlToMarkdown(u));let D=[];const S=[];if(e.AutoDownloadImage){const E=g.match(_c)||[];if(E.length>0){for(const A of E)try{const N=await vQ(A);if(N.size===0)continue;const R=new File([N],"image.png",{type:"image/png"}),F=await V2(R);S.push({oldUrl:A,newUrl:F})}catch(N){console.error(N)}S.forEach(A=>{g=g.replace(A.oldUrl,A.newUrl)}),p&&p.length>0&&(D=await Promise.all(p.map(async A=>{const N=bQ(A);return new File([N],"image.png",{type:"image/png"})})));for(const A of D){const N=await V2(A);g+=` ${N}`}}}const T=await Ie.createThino({content:g,isList:d,type:m});T&&(Ie.pushMemo(T),We.clearQuery()),r.statusCode=200,r.setHeader("Content-Type","application/json"),r.end(JSON.stringify({status:"success",thino:T,link:`obsidian://thino?openId=${T.id}`}))})}else if(a.pathname==="/search"&&n.method==="GET"){const o=a.query,{keyword:s}=o,u=Ie.getThinoViaKeyword(s);r.statusCode=200,r.setHeader("Content-Type","application/json");const d=JSON.stringify({status:"success",thinos:u});r.end(d)}else r.statusCode=404,r.end()}}catch(a){console.error(a),r.statusCode=500,r.end({status:"error",message:a.message})}});return{listen(n,r){try{t.listen({port:parseInt(r),host:n})}catch(a){console.error(a),new x.Notice(k("Thino - Failed to start HTTP server, please check the port is available."))}new x.Notice(`${k("Thino - Started HTTP server on port")} ${r}`)},close(){t.close(),new x.Notice(k("Thino - Terminated HTTP server"))}}}const{clipboard:gn}=x.Platform.isDesktop?require("electron"):"";class SQ{constructor(){he(this,"eventListeners");this.eventListeners={}}on(t,n){this.eventListeners[t]=this.eventListeners[t]||[],this.eventListeners[t].push(n)}once(t,n){n.$emitOnce=!0,this.on(t,n)}removeListener(t,n){if(this.eventListeners[t]){const r=this.eventListeners[t].findIndex(a=>a===n);r>=0&&this.eventListeners[t].splice(r,1)}}removeAllListeners(t){this.eventListeners[t]&&(this.eventListeners[t].length=0)}emit(t,...n){this.eventListeners[t]&&this.eventListeners[t].forEach(r=>{r.call(this,...n),r.$emitOnce&&this.removeListener(t,r)})}}const Dd=new SQ;let Bh=null,Z2=gn==null?void 0:gn.readText(),W2=gn==null?void 0:gn.readImage();gn&&(gn.on=(e,t)=>(Dd.on(e,t),gn),gn.once=(e,t)=>(Dd.once(e,t),gn),gn.off=(e,t)=>(t?Dd.removeListener(e,t):Dd.removeAllListeners(e),gn),gn.startWatching=()=>(Bh||(Bh=setInterval(()=>{IQ(Z2,Z2=gn==null?void 0:gn.readText())&&Dd.emit("text-changed"),TQ(W2,W2=gn==null?void 0:gn.readImage())&&Dd.emit("image-changed")},500)),gn),gn.stopWatching=()=>(Bh&&clearInterval(Bh),Bh=null,gn));function IQ(e,t){return t&&e!==t}function TQ(e,t){return!t.isEmpty()&&e.toDataURL()!==t.toDataURL()}var Q2;const iw=(Q2=require("electron"))==null?void 0:Q2.remote;var X2,eI;const $2=(eI=(X2=require("electron"))==null?void 0:X2.remote)==null?void 0:eI.screen;class EQ{constructor(t,n){he(this,"isRegisted");he(this,"leaf");he(this,"clipboard");he(this,"isScreenTop",!1);he(this,"currentSplitWindow");he(this,"intervalNum");he(this,"allowsCopy",!1);he(this,"plugin");he(this,"actionEl",null);this.app=t,this.plugin=n,this.isRegisted=!1,this.leaf=null,this.clipboard=gn}async onload(){x.Platform.isDesktop&&(this.initGlobalCopyEvents(),await this.registerAllShortcuts(),this.registerEvents())}registerEvents(){this.plugin.registerEvent(this.app.workspace.on("quit",()=>{iw.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally)}))}initGlobalCopyEvents(){this.plugin.addCommand({id:"init-global-copy-events",name:k("Global copy"),callback:()=>{this.allowsCopy=!this.allowsCopy,!this.allowsCopy&&this.clipboard.stopWatching(),this.allowsCopy&&this.clipboard.startWatching(),this.leaf&&this.allowsCopy&&(this.actionEl=this.leaf.view.addAction("clipboard-x","Stop global copying",()=>{var t;this.allowsCopy=!1,this.clipboard.stopWatching(),(t=this.actionEl)==null||t.remove()}))}})}onunload(){this.isRegisted&&(iw.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally),this.clipboard.off("text-changed"),this.clipboard.off("image-changed"),this.clipboard.stopWatching(),this.leaf&&this.leaf.detach())}getCurrentLeaf(){var n;return this.leaf?this.app.workspace.getLeavesOfType("thino_view").length>0&&!!this.app.workspace.getLeafById(this.leaf.id)?!0:((n=this.leaf)==null||n.detach(),this.currentSplitWindow.close(),this.currentSplitWindow=null,this.leaf=null,this.isScreenTop=!1,!1):!1}async registerAllShortcuts(){iw.globalShortcut.register(this.plugin.settings.CaptureKey.OpenThinoGlobally,()=>{this.getCurrentLeaf()?this.showThinoView():this.openThinoView()}),this.isRegisted=!0}showThinoView(){var r,a,o,s;const t=$2.getCursorScreenPoint(),n=(s=(o=(a=(r=this.leaf)==null?void 0:r.parent)==null?void 0:a.parent)==null?void 0:o.win)==null?void 0:s.electronWindow;if(n){if(n.setAlwaysOnTop(!this.isScreenTop,"screen"),this.leaf.setPinned(!this.isScreenTop),this.leaf.view.containerEl.toggleClass("thino-float-window",!0),n.isMinimized()&&n.restore(),n.focus(),this.plugin.settings.CaptureKey.ShowNearMouse){const{width:u,height:d}=n.getBounds();n.setBounds({x:t.x,y:t.y,width:u,height:d})}if(this.app.workspace.trigger("focus-on-textarea"),this.isScreenTop){this.isScreenTop=!1,setTimeout(()=>{n.setAlwaysOnTop(!1,"screen")},200);return}this.isScreenTop=!0}}openThinoView(){var o,s,u,d,m;this.leaf=this.app.workspace.openPopoutLeaf({size:{width:400,height:400}});const t=this.leaf;this.leaf.view.containerEl.toggleClass("thino-float-window",!0),this.leaf.setViewState({type:"thino_view"}),setTimeout(()=>{t.view.containerEl.classList.toggle("mobile-view",!0)},0),this.currentSplitWindow=(s=(o=this.leaf)==null?void 0:o.parent)==null?void 0:s.parent;const n=(m=(d=(u=this.leaf)==null?void 0:u.parent)==null?void 0:d.parent)==null?void 0:m.win.electronWindow;if(!n)return;n.setAlwaysOnTop(!this.isScreenTop,"screen"),this.leaf.setPinned(!this.isScreenTop),this.isScreenTop=!0;const r=this.app,a=p=>{var D,S,T;const g=$2.getCursorScreenPoint(),w=(T=(S=(D=t==null?void 0:t.parent)==null?void 0:D.parent)==null?void 0:S.win)==null?void 0:T.electronWindow;if(w){if(w.isMinimized()&&w.restore(),!this.isScreenTop&&this.plugin.settings.CaptureKey.ShowNearMouse){const{width:E,height:A}=w.getBounds();w.setBounds({x:g.x,y:g.y-200,width:E,height:A})}w.setAlwaysOnTop(!0,"screen"),r.workspace.trigger("focus-on-textarea"),r.workspace.trigger("send-to-thino",p,t)}};this.clipboard.on("text-changed",()=>{const p=this.clipboard.readText();a(p)}).on("image-changed",()=>{const p=this.clipboard.readImage();a(p)})}}class G2 extends x.EditorSuggest{constructor(n,r){super(n);he(this,"root");he(this,"editor");he(this,"cursor");he(this,"plugin");he(this,"tags");he(this,"type","customTag");he(this,"HASHTAG_REGEX",/(^|\s)#[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]*$/g);this.plugin=r}checkSettings(){return this.plugin.settings.UseVaultTags}checkInMemosView(n){var o;const r=n.containerEl;if(!r)return!1;const a=(o=r.parentElement)==null?void 0:o.parentElement;return(a==null?void 0:a.classList.contains("common-editor-inputer"))||!1}fuzzySearchItemsOptimized(n,r){const a=x.prepareFuzzySearch(n);return r.map(s=>{const u=a(s);return u?{item:s,match:u}:null}).filter(Boolean)}onTrigger(n,r){if(!this.checkInMemosView(r)||this.checkSettings())return null;this.tags=Ie.getState().tags,this.cursor=n,this.editor=r;const a=n.line,o=r.getLine(a),s=o.substr(0,n.ch);if(s.match(this.HASHTAG_REGEX)&&o.substr(n.ch,1)!=="#"){const u=s.lastIndexOf("#"),d=s.substr(u+1);return{start:{line:a,ch:u},end:{line:a,ch:n.ch},query:d}}return null}getSuggestions(n){return this.fuzzySearchItemsOptimized(n.query,this.tags).map(r=>r.item).sort((r,a)=>r.localeCompare(a))||[]}renderSuggestion(n,r){r.setText(n)}selectSuggestion(n){if(this.context){const r=this.context.editor,a=this.context.start,o=this.context.end;r.transaction({changes:[{from:a,to:o,text:"#"+n+" "}]}),setTimeout(function(){return r.focus()})}this.close()}}const hb=crypto,SC=e=>e instanceof CryptoKey,Hg=new TextEncoder,mb=new TextDecoder;function xQ(...e){const t=e.reduce((a,{length:o})=>a+o,0),n=new Uint8Array(t);let r=0;for(const a of e)n.set(a,r),r+=a.length;return n}const CQ=e=>{const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r{let t=e;t instanceof Uint8Array&&(t=mb.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return CQ(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class py extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(t){var n;super(t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}}class MQ extends py{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class gy extends py{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class xr extends py{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class NQ extends py{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}function ls(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Bg(e,t){return e.name===t}function lw(e){return parseInt(e.name.slice(4),10)}function kQ(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function AQ(e,t){if(t.length&&!t.some(n=>e.usages.includes(n))){let n="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();n+=`one of ${t.join(", ")}, or ${r}.`}else t.length===2?n+=`one of ${t[0]} or ${t[1]}.`:n+=`${t[0]}.`;throw new TypeError(n)}}function OQ(e,t,...n){switch(t){case"HS256":case"HS384":case"HS512":{if(!Bg(e.algorithm,"HMAC"))throw ls("HMAC");const r=parseInt(t.slice(2),10);if(lw(e.algorithm.hash)!==r)throw ls(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Bg(e.algorithm,"RSASSA-PKCS1-v1_5"))throw ls("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(lw(e.algorithm.hash)!==r)throw ls(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Bg(e.algorithm,"RSA-PSS"))throw ls("RSA-PSS");const r=parseInt(t.slice(2),10);if(lw(e.algorithm.hash)!==r)throw ls(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if(e.algorithm.name!=="Ed25519"&&e.algorithm.name!=="Ed448")throw ls("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!Bg(e.algorithm,"ECDSA"))throw ls("ECDSA");const r=kQ(t);if(e.algorithm.namedCurve!==r)throw ls(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}AQ(e,n)}function IC(e,t,...n){var r;if(n.length>2){const a=n.pop();e+=`one of type ${n.join(", ")}, or ${a}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&(r=t.constructor)!=null&&r.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const q2=(e,...t)=>IC("Key must be ",e,...t);function TC(e,t,...n){return IC(`Key for the ${e} algorithm must be `,t,...n)}const EC=e=>SC(e),xi=["CryptoKey"],FQ=(...e)=>{const t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(const r of t){const a=Object.keys(r);if(!n||n.size===0){n=new Set(a);continue}for(const o of a){if(n.has(o))return!1;n.add(o)}}return!0};function PQ(e){return typeof e=="object"&&e!==null}function J2(e){if(!PQ(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}const jQ=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if(typeof n!="number"||n<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}},ml=(e,t,n=0)=>{n===0&&(t.unshift(t.length),t.unshift(6));const r=e.indexOf(t[0],n);if(r===-1)return!1;const a=e.subarray(r,r+t.length);return a.length!==t.length?!1:a.every((o,s)=>o===t[s])||ml(e,t,r+1)},K2=e=>{switch(!0){case ml(e,[42,134,72,206,61,3,1,7]):return"P-256";case ml(e,[43,129,4,0,34]):return"P-384";case ml(e,[43,129,4,0,35]):return"P-521";case ml(e,[43,101,110]):return"X25519";case ml(e,[43,101,111]):return"X448";case ml(e,[43,101,112]):return"Ed25519";case ml(e,[43,101,113]):return"Ed448";default:throw new gy("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},LQ=async(e,t,n,r,a)=>{let o,s;const u=new Uint8Array(atob(n.replace(e,"")).split("").map(m=>m.charCodeAt(0))),d=t==="spki";switch(r){case"PS256":case"PS384":case"PS512":o={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},s=d?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":o={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.slice(-3)}`},s=d?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":o={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},s=d?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":o={name:"ECDSA",namedCurve:"P-256"},s=d?["verify"]:["sign"];break;case"ES384":o={name:"ECDSA",namedCurve:"P-384"},s=d?["verify"]:["sign"];break;case"ES512":o={name:"ECDSA",namedCurve:"P-521"},s=d?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const m=K2(u);o=m.startsWith("P-")?{name:"ECDH",namedCurve:m}:{name:m},s=d?[]:["deriveBits"];break}case"EdDSA":o={name:K2(u)},s=d?["verify"]:["sign"];break;default:throw new gy('Invalid or unsupported "alg" (Algorithm) value')}return hb.subtle.importKey(t,u,o,(a==null?void 0:a.extractable)??!1,s)},RQ=(e,t,n)=>LQ(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,n);async function _Q(e,t,n){if(typeof e!="string"||e.indexOf("-----BEGIN PUBLIC KEY-----")!==0)throw new TypeError('"spki" must be SPKI formatted string');return RQ(e,t,n)}const HQ=(e,t)=>{if(!(t instanceof Uint8Array)){if(!EC(t))throw new TypeError(TC(e,t,...xi,"Uint8Array"));if(t.type!=="secret")throw new TypeError(`${xi.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}},BQ=(e,t,n)=>{if(!EC(t))throw new TypeError(TC(e,t,...xi));if(t.type==="secret")throw new TypeError(`${xi.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if(n==="sign"&&t.type==="public")throw new TypeError(`${xi.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if(n==="decrypt"&&t.type==="public")throw new TypeError(`${xi.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n==="verify"&&t.type==="private")throw new TypeError(`${xi.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n==="encrypt"&&t.type==="private")throw new TypeError(`${xi.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)},YQ=(e,t,n)=>{e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?HQ(e,t):BQ(e,t,n)};function zQ(e,t,n,r,a){if(a.crit!==void 0&&r.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(s=>typeof s!="string"||s.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;n!==void 0?o=new Map([...Object.entries(n),...t.entries()]):o=t;for(const s of r.crit){if(!o.has(s))throw new gy(`Extension Header Parameter "${s}" is not recognized`);if(a[s]===void 0)throw new e(`Extension Header Parameter "${s}" is missing`);if(o.get(s)&&r[s]===void 0)throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`)}return new Set(r.crit)}const UQ=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(n=>typeof n!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};function VQ(e,t){const n=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new gy(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function ZQ(e,t,n){if(SC(t))return OQ(t,e,n),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(q2(t,...xi));return hb.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[n])}throw new TypeError(q2(t,...xi,"Uint8Array"))}const WQ=async(e,t,n,r)=>{const a=await ZQ(e,t,"verify");jQ(e,a);const o=VQ(e,a.algorithm);try{return await hb.subtle.verify(o,a,n,r)}catch{return!1}};async function $Q(e,t,n){if(!J2(e))throw new xr("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new xr('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new xr("JWS Protected Header incorrect type");if(e.payload===void 0)throw new xr("JWS Payload missing");if(typeof e.signature!="string")throw new xr("JWS Signature missing or incorrect type");if(e.header!==void 0&&!J2(e.header))throw new xr("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{const T=sw(e.protected);r=JSON.parse(mb.decode(T))}catch{throw new xr("JWS Protected Header is invalid")}if(!FQ(r,e.header))throw new xr("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a={...r,...e.header},o=zQ(xr,new Map([["b64",!0]]),n==null?void 0:n.crit,r,a);let s=!0;if(o.has("b64")&&(s=r.b64,typeof s!="boolean"))throw new xr('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:u}=a;if(typeof u!="string"||!u)throw new xr('JWS "alg" (Algorithm) Header Parameter missing or invalid');const d=n&&UQ("algorithms",n.algorithms);if(d&&!d.has(u))throw new MQ('"alg" (Algorithm) Header Parameter value not allowed');if(s){if(typeof e.payload!="string")throw new xr("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new xr("JWS Payload must be a string or an Uint8Array instance");let m=!1;typeof t=="function"&&(t=await t(r,e),m=!0),YQ(u,t,"verify");const p=xQ(Hg.encode(e.protected??""),Hg.encode("."),typeof e.payload=="string"?Hg.encode(e.payload):e.payload);let g;try{g=sw(e.signature)}catch{throw new xr("Failed to base64url decode the signature")}if(!await WQ(u,t,g,p))throw new NQ;let D;if(s)try{D=sw(e.payload)}catch{throw new xr("Failed to base64url decode the payload")}else typeof e.payload=="string"?D=Hg.encode(e.payload):D=e.payload;const S={payload:D};return e.protected!==void 0&&(S.protectedHeader=r),e.header!==void 0&&(S.unprotectedHeader=e.header),m?{...S,key:t}:S}async function GQ(e,t,n){if(e instanceof Uint8Array&&(e=mb.decode(e)),typeof e!="string")throw new xr("Compact JWS must be a string or Uint8Array");const{0:r,1:a,2:o,length:s}=e.split(".");if(s!==3)throw new xr("Invalid Compact JWS");const u=await $Q({payload:a,protected:r,signature:o},t,n),d={payload:u.payload,protectedHeader:u.protectedHeader};return typeof t=="function"?{...d,key:u.key}:d}const qQ={webId:"globe-2",pinned:"pin",archived:"archive",visibility:"eye",deleted:"trash"};class JQ extends Ci.WidgetType{constructor(n,r,a,o,s){super();he(this,"error",!1);this.view=n,this.plugin=r,this.target=a,this.type=o,this.to=s}eq(n){return this.target===n.target}toDOM(){const n=createSpan();return n.toggleClass("thino-inline-widget",!0),x.setIcon(n,qQ[this.type]||"help-circle"),x.setTooltip&&x.setTooltip(n,this.target),n}}function KQ(e){class t{constructor(a){he(this,"view");he(this,"match",new Ci.MatchDecorator({regexp:/\[(webId|pinned|archived|visibility|deleted)::([^\]]+)\]/g,decorate:(a,o,s,u,d)=>{this.shouldRender(d,o,s)&&a(o,s,Ci.Decoration.replace({widget:new JQ(d,e,u[0],u[1],s)}))}}));he(this,"decorations",Ci.Decoration.none);this.view=a,this.updateDecorations(a)}update(a){this.updateDecorations(a.view,a)}destroy(){this.decorations=Ci.Decoration.none}updateDecorations(a,o){!o||this.decorations.size===0?this.decorations=this.match.createDeco(a):this.decorations=this.match.updateDeco(o,this.decorations)}isLivePreview(a){return a.field(x.editorLivePreviewField)}shouldRender(a,o,s){return!a.state.selection.ranges.some(d=>d.from<=o?d.to>=o:d.from<=s)&&this.isLivePreview(a.state)}}const n={decorations:r=>r.decorations.update({filter:(a,o,s)=>{const u=s.spec.widget;return u&&u.error?!1:a===o||!r.view.state.selection.ranges.filter(d=>{const m=d.from,p=d.to;return m<=a?p>=a:m<=o}).length}})};return Ci.ViewPlugin.fromClass(t,n)}const QQ=e=>e.ctrlKey!==void 0||e.metaKey!==void 0||e.shiftKey!==void 0||e.altKey!==void 0,Yg=()=>{new x.Notice(k("Open Memos Successfully"))},zg=[{id:"open-thino-in-left-sidebar",shortName:k("Left sidebar"),name:k("Open thino in left sidebar"),icon:"arrow-left",location:"left",cb:Yg,modKeys:"shift"},{id:"open-thino-in-right-sidebar",shortName:k("Right sidebar"),name:k("Open thino in right sidebar"),icon:"arrow-right",location:"right",cb:Yg,modKeys:["ctrl","meta"]},{id:"open-thino-in-float",shortName:k("Float window"),name:k("Open thino in float window"),icon:"layout",location:"float",cb:Yg,modKeys:"alt"},{id:"open-thino-in-center",shortName:k("Center window"),name:k("Open thino in center window"),icon:"tv-2",location:"center",cb:Yg,modKeys:void 0}];class XQ extends x.Plugin{constructor(){super(...arguments);he(this,"settings");he(this,"settingTab");he(this,"triggerBySelf",!1);he(this,"updatedID","");he(this,"debounceTimer",0);he(this,"apiHttpServer",null);he(this,"captureService",null);he(this,"loaded",!1)}async onload(){await this.loadSettings(),nK(),this.registerRibbon(),await this.verify(),this.checkVersionAndShowChangeLog(),this.settingTab=new mK(this.app,this),this.addSettingTab(this.settingTab),this.initEditor(),this.initURIHandler(),this.registerMobileEvent(),this.registerCommands(),this.registerCanvasNodeMemos(),this.registerHoverEvent(),this.registerEditorSuggest(new QJ(this.app,this)),this.registerEditorExtension([fQ]),this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this)),this.registerView(Hr,n=>new yl(n,this))}async loadSettings(){this.settings=Object.assign({},Oo,await this.loadData()),rt.setSettings(this.settings)}async saveSettings(){await this.saveData(this.settings),rt.setSettings(this.settings)}onunload(){var r;this.app.workspace.detachLeavesOfType(Hr),Ie.clearMemos(),Ee.dispatch({type:"CLEAR_MEMOS",payload:null}),Ee.dispatch({type:"CLEAR_FILES",payload:null}),Ee.dispatch({type:"CLEAR_VIEW",payload:null});const n=document.body.find(".dialog-wrapper");n&&((r=n.parentElement)==null||r.detach()),this.apiHttpServer&&(this.apiHttpServer.close(),this.apiHttpServer=null),this.captureService&&this.captureService.onunload(),new x.Notice(k("Close Memos Successfully"))}initEditor(){const n=()=>{const r=this.app.embedRegistry;if(!r)return!1;const a=r.embedByExtension.md,o=createEl("div"),s=a({app:this.app,containerEl:o},null,null);if(s.editable=!0,s.set(""),s.showEditor(),!s.editMode)return!1;const u=Object.getPrototypeOf(Object.getPrototypeOf(s.editMode));return rt.setEditor(u),o.detach(),!0};this.app.workspace.onLayoutReady(()=>{n()||this.app.workspace.onLayoutReady(()=>{setTimeout(()=>{n()},100)})}),this.register(cv(x.MetadataCache.prototype,{getFileCache:r=>function(a){return!(a!=null&&a.path)&&!a?null:r.call(this,a)}}))}initApp(){rt.setApp(this.app)}initURIHandler(){this.registerObsidianProtocolHandler("thino",async n=>{var s,u,d;if(!n)return;if(n.userid)try{const m=n.userid;pQ(m,this.app),gQ(x.moment().add(30,"days").valueOf(),this.app),Qe.setRefresh(!0)}catch(m){console.error(m),new x.Notice(k("Failed to verify"))}if(n.token)try{const m=n.token;(s=this.app)==null||s.saveLocalStorage("tokenForSync",m),setTimeout(()=>{this.app.setting.open(),this.app.setting.openTabById(this.manifest.id||"obsidian-memos"),this.settingTab.display()},200),new x.Notice(k("Saved sync token successfully"))}catch(m){console.error(m),new x.Notice(k("Failed to save"))}if(n.copyToken){this.app.setting.open(),this.app.setting.openTabById(this.manifest.id??"obsidian-memos");const m=await dC();await navigator.clipboard.writeText(m),new x.Notice(k("Copied app id successfully"))}const r=(u=rt.getState())==null?void 0:u.verifyState,a=!x.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),o=x.Platform.isDesktop?await zn():a.identifier||a.uuid;if(!(!r||(r==null?void 0:r.appId)!==o)){if(n.content){const m=n.type,p=decodeURI(n.content)!==n.content?decodeURI(n.content):n.content,g=n.task,w=await Ie.createThino({content:p,type:m,isList:!!g});if(!w)return;Ie.pushMemo(w),We.clearQuery()}n.openId&&await Ie.openThinoByID(n.openId)}})}initGlobalManifest(){Qe.setPluginManifest(this.manifest)}stopServer(){this.apiHttpServer&&(this.apiHttpServer.close(),this.apiHttpServer=null)}async initServer(){var o,s;if(x.Platform.isMobile||!this.settings.EnabledHttpApi)return;const n=(o=rt.getState())==null?void 0:o.verifyState,r=!x.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),a=x.Platform.isDesktop?await zn():r.identifier||r.uuid;!n||(n==null?void 0:n.appId)!==a||(this.apiHttpServer=DQ(this.settings),this.initServerPort())}initServerPort(){this.apiHttpServer&&this.settings.EnabledHttpApi&&this.apiHttpServer.listen(this.settings.HttpApiIpType,this.settings.HttpApiPort)}async initCaptureService(){var o,s;if(x.Platform.isMobile||!this.settings.CaptureKey.EnableCaptureKey)return;const n=(o=rt.getState())==null?void 0:o.verifyState,r=!x.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),a=x.Platform.isDesktop?await zn():r.identifier||r.uuid;!n||(n==null?void 0:n.appId)!==a||(this.captureService=new EQ(this.app,this),await this.captureService.onload())}registerMobileEvent(){x.Platform.isMobile&&(this.registerEvent(this.app.workspace.on("receive-text-menu",(n,r)=>{n.addItem(a=>{a.setIcon("popup-open").setTitle(k("Insert as Memo")).onClick(async()=>{const o=await Ie.createMemoDaily(r,!1);Ie.pushMemo(o)})})})),this.registerEvent(this.app.workspace.on("receive-files-menu",(n,r)=>{n.addItem(a=>{a.setIcon("popup-open").setTitle(k("Insert file as memo content")).onClick(async()=>{const o=r.map(u=>this.app.fileManager.generateMarkdownLink(u,u.path)),s=await Ie.createMemoDaily(o.join(` `),!1);Ie.pushMemo(s)})})})))}registerCommands(){zg.forEach(n=>{this.addCommand({id:n.id,name:n.name,callback:()=>this.openMemos(n.location,n.cb),hotkeys:[]})}),x.Platform.isDesktop&&this.addCommand({id:"show-thino-editor",name:k("Show thino editor"),checkCallback:n=>{if(Ie.initialized&&rt.initialized)return n||new aC(this.app).open(),!0}}),this.addCommand({id:"lock-thino",name:k("Lock thino"),checkCallback:n=>{if(this.app.workspace.getActiveViewOfType(yl)&&this.settings.needVerify)return n||Qe.setLocked(!0),!0}}),this.addCommand({id:"copy-debug-info",name:k("Copy debug info"),callback:()=>{try{const n={settings:{...this.settings,tokenForVerify:"***"},manifest:this.manifest,obsidianVer:this.app.version,platform:x.Platform.resourcePathPrefix};navigator.clipboard.writeText(JSON.stringify(n,null,2)),new x.Notice(k("Debug info copied to clipboard"))}catch(n){console.error(n)}}}),this.addCommand({id:"toggle-minimal-thino",name:k("Toggle minimal mode"),callback:()=>{const n=document.body.hasClass("minimal-thino");document.body.toggleClass("minimal-thino",!n)}}),this.addCommand({id:"focus-on-thino-editor",name:k("Focus on thino editor"),callback:()=>this.focusOnEditor(),hotkeys:[]}),this.addCommand({id:"reinit-thino-sync",name:k("ReSync web thinos to local"),callback:()=>{pJ(this.app)}}),this.addCommand({id:"init-thino-sync",name:k("Sync local thinos to web"),callback:async()=>{var r;if(!((r=this.app)==null?void 0:r.loadLocalStorage("tokenForSync"))){new x.Notice(k("Please input token first"));return}if(!this.settings.startSync){new x.Notice(k("Please enable sync first"));return}try{await Ie.initSync()}catch(a){console.error(a),new x.Notice(k("Init Failed"))}}}),this.addCommand({id:"show-daily-thino",name:k("Show daily thino dialog"),callback:()=>this.openDailyMemo(),hotkeys:[]}),this.addCommand({id:"focus-on-search-bar",name:k("Focus on search bar"),callback:()=>this.searchIt(),hotkeys:[]}),this.addCommand({id:"show-thino-in-popover",name:k("Show-thino in popover(Hover editor)"),callback:()=>this.showInPopover(),hotkeys:[]})}async onLayoutReady(){this.initApp(),await this.initServer(),this.initGlobalManifest(),await this.initMemos(),this.autoOpenMemos(),this.registerThinoWidget(),await this.registerToolbarCheck(),await this.initCaptureService(),rt.setPlugin(this);const n=this.app.workspace.editorSuggest.suggests.findIndex(r=>r.type==="customTag");n!==-1?(this.app.workspace.editorSuggest.suggests.splice(n,1),this.app.workspace.editorSuggest.suggests.unshift(new G2(this.app,this))):this.app.workspace.editorSuggest.suggests.unshift(new G2(this.app,this))}async initMemos(){try{await this.initDailyNotes()}catch(n){console.error(n)}rt.getState(),Ie.getState(),await Ie.fetchAllMemos()}async initDailyNotes(){this.settings.EnabledLocationList.find(n=>n.value==="DAILY")&&await rt.fechLocalDailyNotes()}registerCanvasNodeMemos(){if(!x.requireApiVersion("1.2.0"))return;const n=o=>{clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{setTimeout(async()=>{const s=o.canvas.getData(),u=s.nodes.find(d=>d.id===o.id);if(u&&(r(u),o.canvas.setData(s),Ie.getMemoById(o.id))){const m=await Ie.updateMemo(o.id,u.text,u.thinoType);Ie.editMemo(m)}o.canvas.requestSave(!0)},0)},800)},r=o=>{o.createdAt||(o.createdAt=x.moment().format("YYYY-MM-DD HH:mm:ss")),o.updatedAt=x.moment().format("YYYY-MM-DD HH:mm:ss"),o.deletedAt=o.deletedAt?o.deletedAt:"",o.pinned=o.pinned?o.pinned:!1,o.visibility=o.visibility?o.visibility:"PUBLIC",o.rowStatus=o.rowStatus?o.rowStatus:"NORMAL",o.thinoType=o.thinoType?o.thinoType:"JOURNAL",o.hasId=o.hasId?o.hasId:"",o.linkId=o.linkId?o.linkId:"",o.resourceList=[]},a=()=>{var w,D;const o=(w=this.app.workspace.getLeavesOfType("canvas").first())==null?void 0:w.view;if(!o||!(o==null?void 0:o.canvas))return!1;const u=((D=this.app.workspace.getLeavesOfType("canvas").first())==null?void 0:D.view).canvas.nodes.values(),m=Array.from(u).filter(S=>S.text!==void 0);if(!m||m.length===0)return!1;const p=m[0].child;if(!p)return!1;const g=cv(p.constructor.prototype,{save:S=>function(...T){S.call(this,...T),this.node.isEditing&&n(this.node)}});return this.register(g),!0};this.app.workspace.onLayoutReady(()=>{if(!a()){const o=this.app.workspace.on("layout-change",()=>{a()&&this.app.workspace.offref(o)});this.registerEvent(o)}})}registerHoverEvent(){this.registerHoverLinkSource("thino",{defaultMod:!0,display:"Thino"})}registerRibbon(){this.addRibbonIcon("Memos",k("ribbonIconTitle"),async n=>{if(n.button===2){n.preventDefault();const r=new x.Menu;zg.forEach(a=>{r.addItem(o=>{o.setTitle(a.shortName).setIcon(a.icon).onClick(async()=>{await this.openMemos(a.location,a.cb)})})}),r.showAtMouseEvent(n);return}for(let r=0;rn[`${s}Key`];if(typeof a.modKeys=="string"&&o(a.modKeys)||Array.isArray(a.modKeys)&&a.modKeys.some(o)){await this.openMemos(a.location,a.cb);break}}})}registerThinoWidget(){this.registerEditorExtension([KQ(this)])}async registerToolbarCheck(){var o,s;if(this.loaded)return;const n=(o=rt.getState())==null?void 0:o.verifyState,r=!x.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),a=x.Platform.isDesktop?await zn():r.identifier||r.uuid;!n||(n==null?void 0:n.appId)!==a||(this.registerEditorExtension([lQ(this.app)]),this.registerEditorSuggest(new XJ(this.app,this)),this.loaded=!0)}async verify(){var a;let n="";if(x.Platform.isDesktop)n=await zn();else{const o=await((a=window.Capacitor.Plugins.Device)==null?void 0:a.getId());if(!o)return;n=o.identifier||o.uuid}async function r(o){if(!o)return rt.setVerifyState(null),!1;const d=await _Q(`-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr+i4MLzI40gGFHl7gdRH UL1mH0NcWEs1/IBYDDbc9ALbvUGwDaUcVIKke+b+F4T7qISexyGd5qV0s1vNYeCk iCTq4w3+CFDurIFYAgQYTcV6K5pL8Bpb79FEclsTnAcKgiuzKBxPZ1djKxbgnmFj +PE+EcmX+JJK9hG1O8X+YFJoPJWl225eCoysONickiI7Ndwu9YLR8pIUb1VMyJSy cMR87z466Nc5Hx2QhwyuiiQYL3Ru4WkNF3AVWgqeOlhBDybFFwDaV7OOMTiYtH46 3iKx6azEVS8W/gYfrW+hKp2VziPPw3oxouP/wCes/4qRlXkwyjSwtfLtpE4Rsa4+ swIDAQAB -----END PUBLIC KEY-----`,"RS256");try{const{payload:m}=await GQ(o,d),p=JSON.parse(new TextDecoder().decode(m));return!p||p.iss!=="pkmer"||p.type!=="thino"||p.appId!==n?!1:(rt.setVerifyState(p),!0)}catch(m){console.error(m)}}return await r(this.settings.tokenForVerify[n])}async checkVersionAndShowChangeLog(){const n=this.manifest.version,r=this.settings.LastUpdatedVersion;n!==r&&(this.settings.LastUpdatedVersion=n,await this.saveSettings(),this.showChangeLog())}showChangeLog(){new pb(this.app,this.manifest.version).open()}autoOpenMemos(){this.app.workspace.getLeavesOfType(Hr).length>0||this.settings.MobileAndDesktop==="Mobile"&&x.Platform.isDesktop||this.settings.MobileAndDesktop==="Desktop"&&x.Platform.isMobile||this.settings.OpenMemosAutomatically&&this.openMemos()}async openDailyMemo(){const n=this.app.workspace.getLeavesOfType(Hr);if(!this.settings.OpenDailyMemosWithMemos){aw();return}if(n.length>0){aw();return}await this.openMemos(),aw()}async openMemos(n="center",r){const a=this.app.workspace;if(a.getLeavesOfType(Hr).length>0){const s=a.getLeavesOfType(Hr)[0];a.setActiveLeaf(s),a.revealLeaf(s);return}a.detachLeavesOfType(Hr);let o;switch(n){case"left":o=a.getLeftLeaf(!1);break;case"right":o=a.getRightLeaf(!1);break;case"float":o=a.getLeaf("window");break;default:o=a.getLeaf(!1);break}if(o&&(await o.setViewState({type:Hr}),a.revealLeaf(o)),this.settings.FocusOnEditor){const s=o.view.containerEl.querySelector("textarea");s&&s.focus()}r==null||r()}searchIt(){const n=this.app.workspace,r=n.getLeavesOfType(Hr);if(!(r.length>0)){this.openMemos();return}const a=r[0];n.setActiveLeaf(a),a.view.containerEl.querySelector(".search-bar-inputer .text-input").focus()}async focusOnEditor(){if(!(this.app.workspace.getLeavesOfType(Hr).length>0)){await this.openMemos();return}this.app.workspace.trigger("focus-on-textarea")}changeStatus(){const n=this.app.workspace,r=n.getLeavesOfType(Hr);if(!(r.length>0)){new x.Notice(k("Please Open Memos First"));return}const a=r[0];n.setActiveLeaf(a),a.view.containerEl.querySelector(".list-or-task").click()}async showInPopover(){var o,s,u;const n=this.app.workspace;if(n.detachLeavesOfType(Hr),!this.app.plugins.getPlugin("obsidian-hover-editor")){new x.Notice(k("Please install obsidian-hover-editor plugin first"));return}const a=await((o=this.app.plugins.getPlugin("obsidian-hover-editor"))==null?void 0:o.spawnPopover());a&&(await a.setViewState({type:Hr}),n.revealLeaf(a),a.view.containerEl.classList.add("mobile-view"),(s=this.settings)!=null&&s.FocusOnEditor&&a.view.containerEl.querySelector("textarea")!==void 0&&((u=a.view.containerEl.querySelector("textarea"))==null||u.focus()))}}class pb extends x.Modal{constructor(n,r){super(n);he(this,"component");this.version=r}async onOpen(){const{contentEl:n}=this;n.createEl("h2",{text:k("Thino update info")+` version ${this.version}`});try{n.createEl("h3",{text:k("Latest version")});const r=n.createDiv("current-change-log");n.createEl("hr"),n.createEl("h3",{text:k("Previous version")});const a=n.createDiv("prev-change-log"),s=await x.requestUrl("https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md");this.component=new x.Component;const[u,d]=this.getLatestVersionContent(s.text);await x.MarkdownRenderer.render(this.app,u,r,"",this.component),await x.MarkdownRenderer.render(this.app,d,a,"",this.component)}catch(r){console.error(r),n.createEl("p",{text:k("Failed to load changelog")}),n.createEl("a",{text:k("View online"),attr:{href:"https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md",target:"_blank"}})}}getLatestVersionContent(n){const r=/^# .+/gm,a=[...n.matchAll(r)];if(a.length===0)return[n,""];const o=a[0].index||0;a[0][0].length;let s=n.length;a.length>1&&(s=a[1].index||n.length);const u=n.substring(o,s).trim(),d=n.substring(s).trim();return[u,d]}onClose(){var r;const{contentEl:n}=this;n.empty(),(r=this.component)==null||r.unload()}}exports.ChangeLogModal=pb;exports.default=XQ;