vault backup: 2025-07-11 12:09:29
This commit is contained in:
1 parent
c092536731
commit
cd8074af5c
8 files changed
+493
-12
No files matched your search
Vendored
+2
-1
@@ -23,5 +23,6 @@
|
||||
"quickadd",
|
||||
"periodic-notes",
|
||||
"editing-toolbar",
|
||||
"rss-reader"
|
||||
"rss-reader",
|
||||
"obsidian-memos"
|
||||
]
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"FirstLoaded": false,
|
||||
"StartDate": "Sunday",
|
||||
"InsertAfter": "",
|
||||
"UserName": "THINO 😉",
|
||||
"ProcessEntriesBelow": "",
|
||||
"Language": "en",
|
||||
"SaveMemoButtonLabel": "NOTE",
|
||||
"SaveMemoButtonIcon": "",
|
||||
"ShareFooterStart": "{ThinoNum} Thino {UsedDay} Day",
|
||||
"ShareFooterEnd": "✍️ by {UserName}",
|
||||
"DefaultPrefix": "List",
|
||||
"DefaultTimePrefix": "HH:mm",
|
||||
"UseDailyOrPeriodic": "Daily",
|
||||
"InsertDateFormat": "Tasks",
|
||||
"DefaultEditorLocation": "Top",
|
||||
"UseButtonToShowEditor": false,
|
||||
"FocusOnEditor": true,
|
||||
"OpenDailyMemosWithMemos": true,
|
||||
"HideDoneTasks": false,
|
||||
"ShowTaskLabel": true,
|
||||
"AppendDateWhenTaskDone": false,
|
||||
"MobileAndDesktop": "All",
|
||||
"OpenMemosAutomatically": false,
|
||||
"ShowScrollbar": false,
|
||||
"ShowTime": true,
|
||||
"ShowDate": true,
|
||||
"AddBlankLineWhenDate": false,
|
||||
"AutoSaveWhenOnMobile": false,
|
||||
"DeleteFileName": "delete",
|
||||
"QueryFileName": "query",
|
||||
"UseVaultTags": false,
|
||||
"SetCustomBackgroundImage": false,
|
||||
"SetCustomMemoFooter": false,
|
||||
"DefaultLightBackgroundImage": "",
|
||||
"DefaultDarkBackgroundImage": "",
|
||||
"DefaultLightBackgroundImageForClean": "",
|
||||
"DefaultDarkBackgroundImageForClean": "",
|
||||
"DefaultMemoComposition": "{TIME} {CONTENT}",
|
||||
"CommentOnMemos": false,
|
||||
"CommentsInOriginalNotes": false,
|
||||
"FetchMemosMark": "#memo",
|
||||
"FetchMemosFromNote": false,
|
||||
"ShowCommentOnMemos": false,
|
||||
"ShowLeftSideBar": false,
|
||||
"MemoListView": "list",
|
||||
"MemoSaveLocation": "DAILY",
|
||||
"MemoOtherSaveLocation": {
|
||||
"MemoDefaultCanvasPath": "basic.thino.canvas",
|
||||
"MemoDefaultMultiFilePath": "Thino",
|
||||
"MemoDefaultSingleFilePath": "basic.thino.md"
|
||||
},
|
||||
"MemoDailyTarget": 5,
|
||||
"HeatmapColorScheme": "default",
|
||||
"EnabledHttpApi": false,
|
||||
"HttpApiIpType": "127.0.0.1",
|
||||
"HttpApiPort": "43999",
|
||||
"AutoDownloadImage": false,
|
||||
"EditorType": "obsidian",
|
||||
"EnabledLocationList": [
|
||||
{
|
||||
"value": "DAILY",
|
||||
"target": "ProcessEntriesBelow",
|
||||
"insert": "InsertAfter"
|
||||
}
|
||||
],
|
||||
"DeleteThinoDirectly": false,
|
||||
"CaptureKey": {
|
||||
"EnableCaptureKey": false,
|
||||
"OpenThinoGlobally": "CommandOrControl+Shift+T",
|
||||
"ShowNearMouse": false
|
||||
},
|
||||
"startSync": false,
|
||||
"tokenForVerify": {},
|
||||
"saveThinoType": "FILE",
|
||||
"showDayMark": false,
|
||||
"dayMarkRange": "day",
|
||||
"navigation": false,
|
||||
"password": "",
|
||||
"needVerify": false,
|
||||
"addTagAutomatically": false,
|
||||
"addTagPosition": "End",
|
||||
"addTagWithNewline": false,
|
||||
"chatViewStyle": "default",
|
||||
"MomentsBackgroundImage": "https://images.pexels.com/photos/531767/pexels-photo-531767.jpeg",
|
||||
"MomentsIcon": "https://images.pexels.com/photos/256514/pexels-photo-256514.jpeg",
|
||||
"MomentsQuote": "Share your thino with the world",
|
||||
"DefaultThemeForThino": "modern",
|
||||
"LastUpdatedVersion": "2.7.16",
|
||||
"ShareToThinoWithText": false,
|
||||
"ShareToThinoWithTextAppend": "",
|
||||
"ShareToThinoWithTextPrepend": "",
|
||||
"ShareToThinoWithTextNewline": "none",
|
||||
"hidePinnedGroup": false,
|
||||
"DifferentInsertTarget": false,
|
||||
"InsertAfterForTask": "",
|
||||
"ProcessContentTarget": "custom",
|
||||
"InsertType": "custom",
|
||||
"ShareAppendType": "preset",
|
||||
"SharePrependType": "preset",
|
||||
"SetFileNameAfterCreate": false,
|
||||
"TagForFileTypeFiles": "thino/file",
|
||||
"TagForMultiTypeFiles": "thino/multi",
|
||||
"MinHeightForShare": "200px",
|
||||
"ThinoMaxHeight": 0,
|
||||
"ThinoCollapsedHeight": 100,
|
||||
"OptimizeForCallout": true,
|
||||
"AppendOrPrependTextViaServer": false,
|
||||
"AppendViaServer": "",
|
||||
"PrependViaServer": "",
|
||||
"WithNewLineViaServer": "none",
|
||||
"SupportSelectOtherView": false,
|
||||
"WaitTemplaterToFinishParse": false,
|
||||
"NavbarButton": false,
|
||||
"AlwaysShowStatusText": false,
|
||||
"FilterByMetadata": false,
|
||||
"ShowSourcePath": false,
|
||||
"ShowUpdateMessage": true,
|
||||
"SyncManually": false,
|
||||
"MemoFixedPrefix": "",
|
||||
"MemoFixedSuffix": "",
|
||||
"UseMemoFixedStrings": false,
|
||||
"enableWordCount": false,
|
||||
"maxWordCount": 0,
|
||||
"enableReferenceLinksGroup": false,
|
||||
"doubleClickBehavior": "edit-thino",
|
||||
"useMobileViewDefaultHeader": false,
|
||||
"IgnoreFolderForMultiType": [],
|
||||
"UseBlockLinkWhenDragging": false,
|
||||
"ShowScrollToTopButton": true,
|
||||
"ZoomImageWhenViewing": false,
|
||||
"ViewArchiveInRandomReview": false,
|
||||
"DraggingBehavior": "block-link"
|
||||
}
|
||||
+318
@@ -0,0 +1,318 @@
|
||||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("obsidian"),a1=require("@codemirror/language"),_p=require("@codemirror/state"),Bi=require("@codemirror/view");function QV(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(r,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var ur=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Je(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var N9={exports:{}},_h={},O9={exports:{}},At={},CN;function eW(){if(CN)return At;CN=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),i=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.iterator;function p(G){return G===null||typeof G!="object"?null:(G=h&&G[h]||G["@@iterator"],typeof G=="function"?G:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,b={};function y(G,J,ee){this.props=G,this.context=J,this.refs=b,this.updater=ee||m}y.prototype.isReactComponent={},y.prototype.setState=function(G,J){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,J,"setState")},y.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function S(){}S.prototype=y.prototype;function x(G,J,ee){this.props=G,this.context=J,this.refs=b,this.updater=ee||m}var E=x.prototype=new S;E.constructor=x,w(E,y.prototype),E.isPureReactComponent=!0;var C=Array.isArray,M=Object.prototype.hasOwnProperty,k={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function F(G,J,ee){var ie,fe={},he=null,we=null;if(J!=null)for(ie in J.ref!==void 0&&(we=J.ref),J.key!==void 0&&(he=""+J.key),J)M.call(J,ie)&&!O.hasOwnProperty(ie)&&(fe[ie]=J[ie]);var Ne=arguments.length-2;if(Ne===1)fe.children=ee;else if(1<Ne){for(var Ae=Array(Ne),Te=0;Te<Ne;Te++)Ae[Te]=arguments[Te+2];fe.children=Ae}if(G&&G.defaultProps)for(ie in Ne=G.defaultProps,Ne)fe[ie]===void 0&&(fe[ie]=Ne[ie]);return{$$typeof:e,type:G,key:he,ref:we,props:fe,_owner:k.current}}function R(G,J){return{$$typeof:e,type:G.type,key:J,ref:G.ref,props:G.props,_owner:G._owner}}function B(G){return typeof G=="object"&&G!==null&&G.$$typeof===e}function Y(G){var J={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(ee){return J[ee]})}var H=/\/+/g;function Z(G,J){return typeof G=="object"&&G!==null&&G.key!=null?Y(""+G.key):J.toString(36)}function W(G,J,ee,ie,fe){var he=typeof G;(he==="undefined"||he==="boolean")&&(G=null);var we=!1;if(G===null)we=!0;else switch(he){case"string":case"number":we=!0;break;case"object":switch(G.$$typeof){case e:case t:we=!0}}if(we)return we=G,fe=fe(we),G=ie===""?"."+Z(we,0):ie,C(fe)?(ee="",G!=null&&(ee=G.replace(H,"$&/")+"/"),W(fe,J,ee,"",function(Te){return Te})):fe!=null&&(B(fe)&&(fe=R(fe,ee+(!fe.key||we&&we.key===fe.key?"":(""+fe.key).replace(H,"$&/")+"/")+G)),J.push(fe)),1;if(we=0,ie=ie===""?".":ie+":",C(G))for(var Ne=0;Ne<G.length;Ne++){he=G[Ne];var Ae=ie+Z(he,Ne);we+=W(he,J,ee,Ae,fe)}else if(Ae=p(G),typeof Ae=="function")for(G=Ae.call(G),Ne=0;!(he=G.next()).done;)he=he.value,Ae=ie+Z(he,Ne++),we+=W(he,J,ee,Ae,fe);else if(he==="object")throw J=String(G),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.");return we}function K(G,J,ee){if(G==null)return G;var ie=[],fe=0;return W(G,ie,"","",function(he){return J.call(ee,he,fe++)}),ie}function V(G){if(G._status===-1){var J=G._result;J=J(),J.then(function(ee){(G._status===0||G._status===-1)&&(G._status=1,G._result=ee)},function(ee){(G._status===0||G._status===-1)&&(G._status=2,G._result=ee)}),G._status===-1&&(G._status=0,G._result=J)}if(G._status===1)return G._result.default;throw G._result}var ne={current:null},Q={transition:null},te={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:Q,ReactCurrentOwner:k};return At.Children={map:K,forEach:function(G,J,ee){K(G,function(){J.apply(this,arguments)},ee)},count:function(G){var J=0;return K(G,function(){J++}),J},toArray:function(G){return K(G,function(J){return J})||[]},only:function(G){if(!B(G))throw Error("React.Children.only expected to receive a single React element child.");return G}},At.Component=y,At.Line truncated
|
||||
`);a.length===0&&await e.vault.adapter.write(qc(e),JSON.stringify({queries:[]},null,2));const i=[];for(let s=0;s<a.length;s++){const l=s,u="Memos";let f="未命名";const h=a[s];let p=A.moment().format("YYYY/MM/DD HH:mm:ss"),m="[]";const w=h.match(/^\d{14,16}/);w&&(p=A.moment(w[0].slice(0,14),"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:ss"));const b=h.match(/\[\{(.+)\}\]/);b&&(m=b[0]);const y=h.match(/\s(.+)\s\[\{/);y&&(f=y[0].slice(1,-3)),i.push({id:l,pinnedAt:"",createdAt:p,updatedAt:p,title:f,querystring:m,userId:u})}await e.vault.adapter.write(qc(e),JSON.stringify({queries:i},null,2))}},NG=async()=>{const{app:e}=Se.getState().dailyNotesState;return await X9(e,qc(e))||await J9(e),await Cf(e)||[]},OG=(e,t)=>({createdAt:A.moment().format("YYYY/MM/DD HH:mm:ss"),id:e,pinnedAt:"",querystring:t,title:I("Temp Filter"),updatedAt:A.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"}),PG=async(e,t)=>{const n=await Cf(Se.getState().dailyNotesState.app)||[],r={createdAt:A.moment().format("YYYY/MM/DD HH:mm:ss"),id:A.moment().format("YYYYMMDDHHmmss")+n.length,pinnedAt:"",querystring:t,title:e,updatedAt:A.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"};return n.push(r),await rg(Se.getState().dailyNotesState.app,n),r};function ru(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(typeof e!="object")return e===t;if(Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!ru(e[o],t[o]))return!1;return!0}if(e.constructor!==t.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp)return e.toString()===t.toString();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o)||!ru(e[o],t[o]))return!1;return!0}function jG(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:typeof e=="object"?Object.keys(e).length===0:!1}function LG(e,t,n){let r;function o(){r=void 0}function a(...i){const s=Date.now();if(r===void 0){r=s,e.apply(this,i);return}s-r>=t&&(r=s,e.apply(this,i))}return a.cancel=o,a}function qv(e){const t=e.match(/^#+/);return t?t[0].length:0}function NN(e,t){const n=e.split(`
|
||||
`);let r="",o=[],a=!1,i=1;for(let s=0;s<n.length;s++){const l=n[s];if(l.startsWith("#")&&/^#{1,6}\s/g.test(l)){if(a&&qv(l)<=qv(t))break;r=l,r===t?(a=!0,i=s+1):a&&qv(l)>qv(t)?o.push(l):(a=!1,o=[])}else a&&o.push(l)}return t?jG(o)?{content:"",startLine:-1}:{content:o.join(`
|
||||
`),startLine:i}:{content:e,startLine:0}}function oC(e){const t={};for(const n of e)n.parent&&n.parent>0&&(t[n.position.start.line]=n.parent);return t}function RG(e,t,n){const r={},o=(p,m)=>{for(;p[m]!==void 0&&p[m]!==m;)m=p[m];return m},a=Ze.getState().app,i=n.split(`
|
||||
`),s=t+i.length-1,l=a.metadataCache.getFileCache(e)?.listItems,u={};if(!l)return[];const f=p=>{const m=/^(-|\*|\d\.)\s/,w=/(\[.\]\s)?/,b=/(\d{1,2}:\d{2}(:\d{2})?)(-\d{1,2}:\d{2}(:\d{2})?)?\s?/;return new RegExp(m.source+w.source+b.source).test(p)};return l.forEach(p=>{const m=p.position.start.line,w=p.position.end.line;if(m>=t&&w<=s){const b=m-t,y=w-t,S=i.slice(b,y+1),x=S.join(`
|
||||
`);if(p.parent&&p.parent>0&&(r[p.position.start.line]=p.parent),p.parent&&u[p.parent]){if(m-p.parent===1){const C=i[b]?.match(/^(\s*)/);C&&(u[p.parent].indent=C[0])}const E=new RegExp("^"+u[p.parent].indent);u[p.parent].content+=`
|
||||
`+x.split(`
|
||||
`).map(C=>C?.replace(E,"")).join(`
|
||||
`)}else if(p.parent&&u[o(r,p.parent)]){const E=new RegExp("^"+u[o(r,p.parent)].indent);u[o(r,p.parent)].content+=`
|
||||
`+x.split(`
|
||||
`).map(C=>C?.replace(E,"")).join(`
|
||||
`)}else if(f(x)||new RegExp(yG).test(x)){u[m]||(u[m]={content:"",blockId:"",indent:""});const E=S.length>1&&S[1]?.match(/^(\s*)/);E&&(u[m].indent=E[0]),u[m].content=x.split(`
|
||||
`).map(C=>C?.replace(u[m].indent,"")).join(`
|
||||
`),u[m].blockId=p.id}}}),Object.keys(u).map(p=>{const m=parseInt(p);return{line:u[m].content,blockId:u[m].blockId||"",index:m}})}async function FG(e,t){let n=t.vault.getAbstractFileByPath(e);return n||(new A.Notice(I("File not found for the given thino path, is creating a new file")),n=await t.vault.create(e,'{"nodes": [], "edges": []}'),Ge.setChangedByMemos(!0)),n}async function HG(e,t){let n;try{n=await t.vault.read(e)}catch(o){console.error(o),n=await t.vault.cachedRead(e)}const r=t.metadataCache.getFileCache(e)?.frontmatterPosition;return r?n.slice(r.end.offset+1):n}function BG(e){const t=e.split(/\r?\n/),n=[];let r=!1,o=[],a="";for(let i=0;i<t.length;i++){const s=t[i];s.startsWith("> [!thino]")?(r&&(n.push({metadata:a,content:o.join(`
|
||||
`).trim()}),o=[]),r=!0,a=s.replace("> [!thino]","").trim()):r&&s.startsWith(">")?o.push(s.replace(/^> /,"")):r&&!s.startsWith(">")&&(r=!1,n.push({metadata:a,content:o.join(`
|
||||
`).trim()}),o=[],a="")}return r&&n.push({metadata:a,content:o.join(`
|
||||
`).trim()}),n}async function _G(e,t={}){const{maxRetries:n=3,retryDelay:r=200,useExponentialBackoff:o=!0,forceReread:a=!1}=t;return Q9(e,0,n,r,o,a)}async function Q9(e,t,n,r,o,a){try{const{vault:i,metadataCache:s}=Se.getState().dailyNotesState.app;if(a)await i.read(e);else try{await i.cachedRead(e)}catch{await i.read(e)}s.getFileCache(e),await new Promise(f=>setTimeout(f,150));const u=s.getFileCache(e)?.listItems||[];return!0}catch(i){if(console.warn(`Failed to refresh file cache for ${e.path} (attempt ${t+1}):`,i),t<n){const s=o?r*Math.pow(2,t):r;return await new Promise(l=>setTimeout(l,s)),Q9(e,t+1,n,r,o,a)}return!1}}async function YG(e,t,n,r){const o=n.replace(/\s?\[pinned::[^\]]+\]/g,"").replace(/\s?\[visibility::[^\]]+\]/g,"").replace(/\s?\[archived::[^\]]+\]/g,"").replace(/\s?\[deleted::[^\]]+\]/g,"").replace(/\s?\[webId::[^\]]+\]/g,"").replace(/\s\^([0-9a-zA-Z-]+)($|\s|\n)/g,"").trim(),a=eF(o);let i=null,s=0;for(const l of e){if(!l.position)continue;const h=t.slice(l.position.start.line,l.position.end.line+1).join(`
|
||||
`).replace(/^- \d{2}:\d{2}\s*/,"").replace(/^- \[.\]\s*\d{2}:\d{2}\s*/,"").replace(/^- \[.\]\s*/,"").replace(/^- /,"").replace(/\s?\[pinned::[^\]]+\]/g,"").replace(/\s?\[visibility::[^\]]+\]/g,"").replace(/\s?\[archived::[^\]]+\]/g,"").replace(/\s?\[deleted::[^\]]+\]/g,"").replace(/\s?\[webId::[^\]]+\]/g,"").replace(/\s\^([0-9a-zA-Z-]+)($|\s|\n)/g,"").trim(),p=UG(o,h,a);if(p===1)return l;p>s&&p>.8&&(i=l,s=p)}return i&&s>.8?i:(console.warn(`⚠️ Could not find memo by content for memo ${r.slice(-6)} (best score: ${s.toFixed(2)})`),null)}function eF(e){const t=e.split(/\s+/).filter(a=>a.length>3),n=[...new Set(t)].slice(0,5).join(" "),r=e.substring(0,30),o=e.length>30?e.substring(e.length-30):"";return`${r}|${o}|${n}`}function UG(e,t,n){if(e===t)return 1;const r=eF(t);if(n===r)return .95;const o=Math.min(e.length,t.length)/Math.max(e.length,t.length);if(o<.5)return 0;const a=new Set(e.toLowerCase().split(/\s+/)),i=new Set(t.toLowerCase().split(/\s+/)),s=new Set([...a].filter(h=>i.has(h))),l=new Set([...a,...i]),u=s.size/l.size,f=e.length>20&&t.includes(e.substring(0,Math.min(50,e.length)))?.3:0;return Math.max(u,f)*o}function zG(e,t){const n=/%%(.*?)%%/,r=e.match(n);if(!r)return e;const o=r[1].trim(),a={};o.split(" ").forEach(s=>{const[l,u]=s.slice(1,-1).split("::");a[l]=u});for(const s of Object.keys(t))if(s!=="id"&&s!=="content"){if(s==="rowStatus"&&t.rowStatus==="ARCHIVED"){a.archived="true";continue}else if(s==="rowStatus"&&t.rowStatus==="NORMAL"){delete a.archived;continue}if(s==="deleted"&&t.deleted){const l=A.moment().format("YYYYMMDDHHmmss");a.deleted=l}else typeof t[s]=="boolean"?t[s]?a[s]="true":delete a[s]:t[s]&&(typeof t[s]=="string"||typeof t[s]=="boolean")&&(a[s]=t[s])}const i=Object.entries(a).map(([s,l])=>`[${s}::${l}]`).join(" ");return e.replace(n,`%% ${i} %%`)}async function Va(e,t){if(!e.sourceType||e.sourceType!=="MULTI")return e;const{vault:n,fileManager:r}=Se.getState().dailyNotesState.app,o=n.getAbstractFileByPath(e.path);if(!o)return e;const a=A.moment();if(await r.processFrontMatter(o,i=>{(t.pinned!==void 0||t.thinoType||t.rowStatus||t.visibility||t.deleted)&&Ge.setChangedByMemos(!0),t.id&&(i.id=t.id),t.thinoType&&(i.thinoType=t.thinoType),t.rowStatus&&(i.rowStatus=t.rowStatus),t.visibility&&(i.visibility=t.visibility),t.webId&&(i.webId=t.webId),t.pinned!==void 0&&(i.pinned=t.pinned),t.deleted!==void 0&&(i.deletedAt=t.deleted?a.format("YYYY/MM/DD HH:mm:ss"):""),i.createdAt||(i.createdAt=a.format("YYYY/MM/DD HH:mm:ss")),i.updatedAt=a.format("YYYY/MM/DD HH:mm:ss")}),t.content){const i=await n.read(o);let s=i;const l=t.content.replace(/\$/g,"$$$$");s=i.replace(e.content,l),await n.modify(o,s)}return Ge.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:A.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned!==void 0?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 Pi(e,t){if(!e.sourceType||e.sourceType!=="FILE")return e;const{vault:n}=Se.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const o=A.moment();let a="";try{a=await n.read(r)}catch(S){console.error(S),a=await n.cachedRead(r)}const i=a.split(/\r?\n/),s=i.findIndex(S=>S.includes("id::"+e.id)||S.includes("Id::"+e.id)||e.webId&&S.includes(e.webId)),l=i[s];if(!l)return e;const u=zG(l,t);if(!l)return e;const f=u+`
|
||||
`,h=i.findIndex((S,x)=>x>s&&S.trim()==="");let p="";h===-1&&(p=i.slice(s+1).join(`
|
||||
`)),h!==-1&&(p=i.slice(s+1,h).join(`
|
||||
`));let m=p;t?.content&&(m=t.content.split(/\r?\n/).map(C=>"> "+C).join(`
|
||||
`));const b=(f+m).split(/\r?\n/);i.splice(s,h!==-1?h-s:i.length-s,...b);const y=i.join(`
|
||||
`);return await n.modify(r,y),Ge.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:A.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned!==void 0?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 ji(e,t){if(!e.sourceType||e.sourceType!=="CANVAS")return e;const{vault:n}=Se.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const o=await n.read(r),a=JSON.parse(o),i=a.nodes.find(u=>u.id===e.id);if(!i)return e;t.content&&(i.text=t.content),t.thinoType&&(i.thinoType=t.thinoType),t.rowStatus&&(i.rowStatus=t.rowStatus),t.visibility&&(i.visibility=t.visibility),t.pinned!==void 0&&(i.pinned=t.pinned),t.webId&&(i.webId=t.webId);const s=A.moment();t.deleted!==void 0&&(i.deletedAt=t.deleted?s.format("YYYY/MM/DD HH:mm:ss"):""),i.updatedAt=s.format("YYYY/MM/DD HH:mm:ss");const l=JSON.stringify(a,null,2);return await n.modify(r,l),Ge.setChangedByMemos(!0),{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:A.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?s.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}function tF(e,t,n){const r=[];if(!t.find(l=>l.position.start.line===e))return r;const i=(n[e]||"").match(/^(\s*)/),s=i?i[1].length:0;for(const l of t){const u=l.position.start.line;if(u<=e)continue;const h=(n[u]||"").match(/^(\s*)/);if((h?h[1].length:0)>s){let m=!0;for(const w of t){const b=w.position.start.line;if(b>e&&b<u){const S=(n[b]||"").match(/^(\s*)/);if((S?S[1].length:0)<=s){m=!1;break}}}m&&r.push(u)}else break}return r}async function Zo(e,t){nF()||new A.Notice(I("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,metadataCache:r}=Se.getState().dailyNotesState.app,o=Se.getState().dailyNotesState.app,{settings:a}=Se.getState().dailyNotesState,i=e.id.toString().slice(0,14),s=A.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(A.moment(i,"YYYYMMDDHHmmss"))?A.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):A.moment(i,"YYYYMMDDHHmmss"),l=A.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(s,"day"),u=e.path,f=n.getAbstractFileByPath(u)||n.getAbstractFileByPath(e.path);if(!f)return new A.Notice(I("Please check your daily note plugin OR periodic notes plugin settings")),e;const p=(await n.read(f)).split(`
|
||||
`);let m=r.getFileCache(f),w=m?.listItems||[];if(w.length===0&&(await _G(f)&&(m=r.getFileCache(f),w=m?.listItems||[],w.length>0),w.length===0)){console.warn(`⚠️ No list items found for memo ${e.id.slice(-6)} even after cache refresh. This might be a newly created memo.`);const G={...e,content:t.content||e.content,thinoType:t.thinoType||e.thinoType,updatedAt:A.moment().format("YYYY/MM/DD HH:mm:ss"),pinned:t.pinned!==void 0?t.pinned:e.pinned,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,webId:t.webId||e.webId,deletedAt:t.deleted?A.moment().format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt||""};return console.warn(`Returning updated memo without file modification for memo ${e.id.slice(-6)}`),G}const b=parseInt(e.id.slice(14));let y=b;oC(w);let S=w.find(te=>te.position.start.line===b);if(!S&&e.content&&(S=await YG(w,p,e.content,e.id)),!S&&e.hasId&&(S=w.find(te=>te.position?p.slice(te.position.start.line,te.position.end.line+1).join(`
|
||||
`).includes(`^${e.hasId}`):!1)),!S){console.warn(`⚠️ List item not found after all search strategies for memo ${e.id.slice(-6)}. Original line: ${b}. This might indicate a line number mismatch.`);const te={...e,content:t.content||e.content,thinoType:t.thinoType||e.thinoType,updatedAt:A.moment().format("YYYY/MM/DD HH:mm:ss"),pinned:t.pinned!==void 0?t.pinned:e.pinned,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,webId:t.webId||e.webId,deletedAt:t.deleted?A.moment().format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt||""};return console.warn(`Returning updated memo without file modification for memo ${e.id.slice(-6)}`),te}const x=S.position.start.line,E=tF(x,w,p);if(E.length>0){const te=E.map(G=>{const J=w.find(ee=>ee.position.start.line===G);return J?J.position.end.line:-1});y=Math.max(...te,S.position.end.line)}else y=S.position.end.line;const C=w.find(te=>te.position.start.line>x&&(!te.parent||te.parent<=0));C&&y>=C.position.start.line&&(console.warn(`⚠️ Limiting endLine to prevent including next block. Original: ${y}, Limited: ${C.position.start.line-1}`),y=C.position.start.line-1);const M=p.slice(x,y+1),k=M.join(`
|
||||
`);let O=k;const F=o.vault.getConfig("useTab")===void 0||app.vault.getConfig("useTab")===!0,R=F?1:o.vault.getConfig("tabSize"),B=(F?" ":" ").repeat(R),Y=k.match(/\s\^([0-9a-zA-Z-]+)($|\s|\n)/),H=t.hasId!==void 0?t.hasId:Y?Y[1]:e.hasId||null,Z=M[0]||"",W=bu(Z);let K;W.fullTimeMatch?K=W.fullTimeMatch:K=l?A.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 V=K;!W.fullTimeMatch&&a.DefaultTimePrefix!=="HH:mm"&&(V=A.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format(a.DefaultTimePrefix));const ne={pinned:k.includes("[pinned::true]"),deleted:k.match(/\[deleted::([^\]]+)\]/)?.[1]||"",archived:k.includes("[archived::true]"),webId:k.match(/\[webId::([^\]]+)\]/)?.[1]||"",visibility:k.match(/\[visibility::"([^"]+)"\]/)?.[1]||""};if(k.match(/^(- \[.\] |- |(\*|\d{1,2}\.) )/)?.[0],t.content){const te=t.thinoType?t.thinoType==="TASK-TODO"?"- [ ] ":t.thinoType==="TASK-DONE"?"- [x] ":t.thinoType.startsWith("TASK")?`- [${t.thinoType.slice(5)}] `:"- ":e.thinoType==="TASK-TODO"?"- [ ] ":e.thinoType==="TASK-DONE"?"- [x] ":e.thinoType.startsWith("TASK")?`- [${e.thinoType.slice(5)}] `:"- ",G=[];if((t.pinned!==void 0?t.pinned:ne.pinned)&&G.push("[pinned::true]"),t.deleted||t.deleted!==!1&&ne.deleted){const fe=t.deleted?A.moment().format("YYYYMMDDHHmmss"):ne.deleted;G.push(`[deleted::${fe}]`)}(t.rowStatus==="ARCHIVED"||t.rowStatus!=="NORMAL"&&ne.archived)&&G.push("[archived::true]"),(t.webId!==void 0?t.webId:ne.webId)&&G.push(`[webId::${t.webId!==void 0?t.webId:ne.webId}]`),(t.visibility||ne.visibility)&&G.push(`[visibility::"${t.visibility||ne.visibility}"]`);const J=H?`^${H}`:"",ee=t.content.trim().split(`
|
||||
`).length>1;/^((-|\*|\d\.|>)\s|```)/g.test(t.content);const ie=t.content.trim().split(`
|
||||
`);if(/(^(-|\*|\d\.|>)\s)/g.test(ie[ie.length-1]),ee){const fe=ie.map(we=>B+we);let he=!1;for(let we=fe.length-1;we>=0;we--)if(!/(^(-|\*|\d\.|>)\s)/g.test(fe[we].trim())){fe[we]=fe[we]+(H?` ${J}`:""),he=!0;break}!he&&H&&(fe[fe.length-1]+=` ${J}`),O=`${te}${V}
|
||||
${fe.join(`
|
||||
`)} ${G.join(" ")}`.trim()}else O=`${te}${V} ${t.content.trim()} ${G.join(" ")}`.trim()+(J?` ${J}`:"")}else{if(t.thinoType){const te=t.thinoType==="TASK-TODO"?"- [ ] ":t.thinoType==="TASK-DONE"?"- [x] ":t.thinoType.startsWith("TASK")?`- [${t.thinoType.slice(5)}] `:"- ";O=O.replace(/^((- \[.\] )|((-|\*) ))/,te)}if(t.rowStatus&&(t.rowStatus==="ARCHIVED"?O.includes("[archived::")?O=O.replace(/\[archived::(true|false)\]/,"[archived::true]"):O+=(O.endsWith(" ")?"":" ")+"[archived::true]":t.rowStatus==="NORMAL"&&(O=O.replace(/\s?\[archived::(true|false)\]/,""))),t.visibility){const te=`[visibility::"${t.visibility}"]`;O.includes("[visibility::")?O=O.replace(/\[visibility::"(PUBLIC|PROTECTED)"\]/,te):O+=(O.endsWith(" ")?"":" ")+te}if(t.pinned!==void 0&&(t.pinned?O.includes("[pinned::")?O=O.replace(/\[pinned::(true|false)\]/,"[pinned::true]"):O+=(O.endsWith(" ")?"":" ")+"[pinned::true]":O=O.replace(/\s?\[pinned::(true|false)\]/,"")),t.webId!==void 0&&(O.includes("[webId::")?t.webId===""?O=O.replace(/\s?\[webId::([^\]]+)\]/,""):O=O.replace(/\[webId::([^\]]+)\]/,`[webId::${t.webId}]`):t.webId!==""&&(O+=(O.endsWith(" ")?"":" ")+`[webId::${t.webId}]`)),t.deleted!==void 0){const te=A.moment();if(t.deleted){const G=`[deleted::${te.format("YYYYMMDDHHmmss")}]`;O.includes("[deleted::")?O=O.replace(/\[deleted::([^\]]+)\]/,G):O+=(O.endsWith(" ")?"":" ")+G}else O=O.replace(/\s?\[deleted::([^\]]+)\]/,"")}if(t.hasId!==void 0||H){const te=t.hasId!==void 0?t.hasId:H;O=O.replace(/\s\^([0-9a-zA-Z-]+)($|\s|\n)/g,""),te&&(O=O.trimEnd(),O+=` ^${te}`)}}if(O!==k){const te=y-x+1,G=O.trim().split(`
|
||||
`);te>10&&G.length<te/2&&console.warn(`⚠️ Safety check: Replacing ${te} lines with ${G.length} lines for memo ${e.id.slice(-6)}. This might indicate content mixing.`);const J=(k.match(/^- \d{2}:\d{2}/gm)||[]).length;if(J>1){console.warn(`⚠️ Safety check: Original content contains ${J} memo-like structures. Limiting replacement to single memo.`);const fe=k.match(/^- \d{2}:\d{2}.*$/m);if(fe){const he=k.indexOf(fe[0]),we=k.substring(he+fe[0].length).match(/^- \d{2}:\d{2}/m);if(we){const Ne=x+k.substring(0,he+fe[0].length+k.substring(he+fe[0].length).indexOf(we[0])).split(`
|
||||
`).length-1;y=Math.min(y,Ne-1)}}}const ee=y-x+1;p.splice(x,ee,O.trim()),await n.modify(f,p.join(`
|
||||
`)),Ge.setChangedByMemos(!0);const ie=A.moment();return{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:A.moment().format("YYYY/MM/DD HH:mm:ss"),content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,hasId:t.hasId??e.hasId,deletedAt:t.deleted?ie.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}return e}async function VG(e,t,n){const{vault:r,metadataCache:o}=Se.getState().dailyNotesState.app||window.app,a=r.getFileByPath(e);if(!a)return;const i=o.getFileCache(a)?.listItems||[];oC(i);const s=[],l=r.getConfig("useTab")===void 0||app.vault.getConfig("useTab")===!0,u=l?1:r.getConfig("tabSize"),f=(l?" ":" ").repeat(u),h=A.moment(),m=(await r.read(a)).split(`
|
||||
`);return t.map(b=>{const y=parseInt(b.id.slice(14));let S=i.find(O=>O.position.start.line===y);if(!S&&b.content&&(S=i.find(O=>{if(!O.position)return!1;const B=m.slice(O.position.start.line,O.position.end.line+1).join(`
|
||||
`).replace(/^- \d{2}:\d{2}\s*/,"").replace(/^- \[.\]\s*\d{2}:\d{2}\s*/,"").replace(/^- \[.\]\s*/,"").replace(/^- /,"").trim(),Y=b.content.trim();return B.includes(Y.substring(0,50))})),!S)return console.warn(`⚠️ Bulk update: Could not find memo ${b.id.slice(-6)} at line ${y}`),null;const x=S.position.start.line,C=tF(x,i,m).map(O=>{const F=i.find(R=>R.position.start.line===O);return F?F.position.end.line:-1});let M=Math.max(...C,S.position.end.line);const k=i.find(O=>O.position.start.line>x&&(!O.parent||O.parent<=0));return k&&M>=k.position.start.line&&(console.warn(`⚠️ Bulk update: Limiting endLine to prevent including next block. Original: ${M}, Limited: ${k.position.start.line-1}`),M=k.position.start.line-1),{id:b.id,start:x,end:M}}).filter(Boolean).forEach(b=>{const S=m.slice(b.start,b.end+1).join(`
|
||||
`),x=S.split(`
|
||||
`),E=x.length-1,M=x[E].trim();let k=S;const O=/\[(pinned|archived|deleted|webId|visibility)::[^\]]*\]\s*$/.test(M),F=(R,B)=>R.split(`
|
||||
`).length>1&&(/```/g.test(M)||!O)?R+`
|
||||
`+f+B:R+(R.endsWith(" ")?"":" ")+B;if(n==="delete"){const R="[deleted::"+h.format("YYYYMMDDHHmmss")+"]";k=k.replace(/\[deleted::([^\]]+)\]/,""),k=F(k,R)}if(n==="restoreFromDelete"&&(k=k.replace(/ ?\[deleted::([^\]]+)\]/,"")),n==="archive"){const R="[archived::true]";k.includes("[archived::")?k=k.replace(/\[archived::(true|false)\]/,R):k=F(k,R)}n==="restoreFromArchive"&&(k=k.replace(/ ?\[archived::(true|false)\]/,"")),n==="deleteForever"?m.splice(b.start,b.end-b.start+1):m.splice(b.start,b.end-b.start+1,k),s.push({...t.find(R=>R.id===b.id),deletedAt:n==="delete"?h.format("YYYY/MM/DD HH:mm:ss"):"",rowStatus:n==="archive"?"ARCHIVED":"NORMAL"})}),await r.modify(a,m.join(`
|
||||
`)),Ge.setChangedByMemos(!0),s}const WG=e=>{switch(e?.sourceType){case"CANVAS":return ji(e,{id:e.id,pinned:!0});case"DAILY":return Zo(e,{id:e.id,pinned:!0});case"MULTI":return Va(e,{id:e.id,pinned:!0});case"FILE":return Pi(e,{id:e.id,pinned:!0})}},GG=e=>{switch(e?.sourceType){case"CANVAS":return ji(e,{id:e.id,pinned:!1});case"DAILY":return Zo(e,{id:e.id,pinned:!1});case"MULTI":return Va(e,{id:e.id,pinned:!1});case"FILE":return Pi(e,{id:e.id,pinned:!1})}},ZG=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 qG(e,t){if(!t)return 0;const{vault:n}=Se.getState().dailyNotesState.app,r=e?.DefaultMemoComposition,o=e?.ProcessEntriesBelow&&e?.ProcessContentTarget!=="whole"?e?.ProcessEntriesBelow:"",a=e?.ProcessContentTarget!=="whole"?e?.DifferentInsertTarget?e?.InsertAfterForTask?e?.InsertAfterForTask:"":o:"";let i;try{i=await n.read(t)}catch(w){console.error(w),i=await n.cachedRead(t)}let s;r!=""&&/{TIME}/g.test(r)&&/{CONTENT}/g.test(r)?s="(-|\\*) (\\[(.{1})\\]\\s)?"+r.replace(/{TIME}/g,"((\\<time\\>)?\\d{1,2}:\\d{2}(\\:\\d{2})?)?").replace(/ {CONTENT}/g,""):s="(-|\\*) (\\[(.{1})\\]\\s)?((\\<time\\>)?\\d{1,2}\\:\\d{2}(\\:\\d{2})?)?";const l=new RegExp(s,"g"),u=(i.match(l)||[]).length,f=new RegExp(o.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g"),h=new RegExp(a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g"),p=(i.match(f)||[]).length,m=(i.match(h)||[]).length;return i=null,p||m?u:0}function ON(e,t,n,r,o){const a=Se.getState().dailyNotesState.app||window.app,i=xd(o,"day")||A.moment(o.stat.ctime),s=RG(o,n,t),l=a?.metadataCache.getFileCache(o),u={frontmatter:l?.frontmatter||{},tags:l?.frontmatter?.tags||[]};for(const f of s){KG(i,f,e);const{rawText:h,memoType:p}=$G(f),{content:m,pinned:w,archived:b,deleted:y,deletedAtStr:S,webId:x,visibility:E}=XG(h,f),C=Qw(m);r.push({id:i.format("YYYYMMDDHHmmss")+`${f.index}`,content:m.trim(),createdAt:i.format("YYYY/MM/DD HH:mm:ss"),updatedAt:i.format("YYYY/MM/DD HH:mm:ss"),thinoType:p,hasId:f.blockId?f.blockId:"",linkId:C,path:o.path,deletedAt:y?A.moment(S,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",rowStatus:b?"ARCHIVED":"NORMAL",visibility:E,pinned:w,creatorName:"Thino",resourceList:[],sourceType:"DAILY",webId:x,fileInfo:u})}}function KG(e,t,n){const r=bu(t.line);if(r.startHour&&r.startMin)e.hours(parseInt(r.startHour)),e.minutes(parseInt(r.startMin)),r.startSec?e.seconds(parseInt(r.startSec)):e.seconds(0);else{const o=JG(n.DefaultMemoComposition,t.line),a=QG(n.DefaultMemoComposition,t.line),i=eZ(t.line);e.hours(parseInt(o)),e.minutes(parseInt(a)),i?e.seconds(parseInt(i)):e.seconds(0)}}function $G(e){let t=nZ(e.line),n;if(/^\s*[-*]\s(\[(.)\])\s/g.test(e.line)){const r=tZ(e.line);t=rZ(e.line),n=ZG(r)}else n="JOURNAL";return{rawText:t,memoType:n}}function XG(e,t){if(!e)return{content:"",pinned:!1,archived:!1,deleted:!1,deletedAtStr:"",webId:"",visibility:"PRIVATE"};let n=e.trim().replaceAll(/<br>/g,`
|
||||
`);const r=new RegExp(/\[(pinned|PINNED)::true\]/,"g").test(e),o=new RegExp(/\[(archived|ARCHIVED)::true\]/,"g").test(e),a=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").test(e),i=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(e)?.[2],s=new RegExp(/\[(webId|WEBID)::([^\]]*)\]/,"g").exec(e)?.[2],l=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(e)?"PUBLIC":"PRIVATE";return n=n.replace(/\s?\[pinned::[^\]]+\]/g,"").replace(/\s?\[visibility::[^\]]+\]/g,"").replace(/\s?\[archived::[^\]]+\]/g,"").replace(/\s?\[deleted::[^\]]+\]/g,"").replace(/\s?\[webId::[^\]]+\]/g,""),t.blockId&&(n=n.replace("^"+t.blockId,"")),{content:n,pinned:r,archived:o,deleted:a,deletedAtStr:i,webId:s,visibility:l}}function Qw(e){const t=[],n=/(?:\[\[([^\]|]+)#\^([a-zA-Z0-9-]+)(?:\|[^\]]+)?\]\])|(?:\[.+?\]\(([^)]+)#\^([a-zA-Z0-9-]+)\))/g;let r;for(;(r=n.exec(e))!==null;)r[1]&&r[2]?t.push(`${r[1]}#^${r[2]}`):r[3]&&r[4]&&t.push(`${r[3]}#^${r[4]}`);return t}function bu(e){const t=/((\d{1,2}):(\d{2})(:(\d{2}))?)-(\d{1,2}):(\d{2})(:(\d{2}))?/,n=/(\d{1,2}):(\d{2})(:(\d{2}))?/,r=e.match(t);if(r)return{startHour:r[2],startMin:r[3],startSec:r[5],endHour:r[6],endMin:r[7],endSec:r[9],fullTimeMatch:r[0]};const o=e.match(n);return o?{startHour:o[1],startMin:o[2],startSec:o[4],fullTimeMatch:o[0]}:{startHour:"",startMin:"",fullTimeMatch:""}}const JG=(e,t)=>{const n=bu(t);if(n.startHour)return n.startHour;let r;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?r="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)"):r="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)",new RegExp(r,"").exec(t)?.[6]},QG=(e,t)=>{const n=bu(t);if(n.startMin)return n.startMin;let r;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?r="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)"):r="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)",new RegExp(r,"").exec(t)?.[7]},eZ=e=>{const t=bu(e);if(t.startSec)return t.startSec;const n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\d{1,2})\\:(\\d{2})\\:(\\d{2})(.*)";return new RegExp(n,"").exec(e)?.[7]},tZ=e=>/^\s*[\-\*]\s(\[(.{1})\])\s(.*)/.exec(e)?.[2],nF=()=>Yp()?!0:(new A.Notice(I("Check if you opened Daily Notes Plugin Or Periodic Notes Plugin")),!1);function nZ(e){const t=bu(e);return t.fullTimeMatch?e.replace(new RegExp(`^(-|\\*|\\d\\.) (${t.fullTimeMatch})\\s(.*)`),"$3"):e.replace(/^(-|\*|\d\.) (\d{1,2}:\d{2}(:\d{2})?)\s(.*)/g,"$4")}function rZ(e){return oZ(e)}const oZ=e=>{const t=bu(e);if(t.fullTimeMatch)return new RegExp(`^(-|\\*|\\d\\.)\\s+\\[.\\]\\s(${t.fullTimeMatch})\\s([\\w\\W]*)`).exec(e)?.[3];const n="^(-|\\*|\\d\\.)\\s+\\[.\\]\\s(\\d{1,2}:\\d{2}(:\\d{2})?)\\s([\\w\\W]*)";return new RegExp(n,"").exec(e)?.[4]};async function rF(e,t=!1){const n=Se.getState().dailyNotesState.app,r=n.vault.getFileByPath(e.path);if(r&&e.hasId)return t?"!"+n.fileManager.generateMarkdownLink(r,"","#^"+e.hasId,e.id):e.hasId?n.fileManager.generateMarkdownLink(r,"","#^"+e.hasId,e.id):`[@THINO](${e.id})`;const o=je.randomId(6);return await Zo(e,{id:e.id,hasId:o}),r?t?"!"+n.fileManager.generateMarkdownLink(r,"","#^"+o,e.id):n.fileManager.generateMarkdownLink(r,"","#^"+o,e.id):`[@THINO](${e.id})`}async function oF(e,t){if(!e)return t;const n=Se.getState().dailyNotesState.app||window.app,r=Se.getState().dailyNotesState.settings,o=await HG(e,n),a=r.IgnoreFolderForMultiType;if(new Set(a.filter(h=>h!=="")).has(e.parent?.path))return t;let l=A.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss");const u=n?.metadataCache.getFileCache(e),f={frontmatter:u?.frontmatter||{},tags:u?.frontmatter?.tags||[]};await n.fileManager.processFrontMatter(e,h=>{if(h.id||(h.id=je.randomId(16)),h.createdAt?l=A.moment(h.createdAt,"YYYY/MM/DD HH:mm:ss").isValid()?h.createdAt:l:h.createdAt=l,!o.trim())return t;const p=!!h.pinned,m=h.rowStatus&&h.rowStatus==="ARCHIVED",w=!!h.deletedAt,b=h.deletedAt?h.deletedAt:"",y=h.visibility?h.visibility:"PRIVATE",S=h.thinoType?h.thinoType:"JOURNAL",x=h.webId?h.webId:"",E=h.id?h.id:"",C=h.hasId?h.hasId:"",M=h.linkId?h.linkId:"",k=e.path,O="Memo",F="MULTI",R=[];return t.push({id:E,content:o,createdAt:l,updatedAt:l,deletedAt:w?A.moment(b,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:p,rowStatus:m?"ARCHIVED":"NORMAL",visibility:y,thinoType:S,hasId:C,linkId:M,path:k,creatorName:O,sourceType:F,resourceList:R,webId:x,fileInfo:f}),t})}async function TI(e,t){if(!e)return t;const{vault:n,metadataCache:r}=Se.getState().dailyNotesState.app||window.app;let o;try{o=await n.read(e)}catch(y){console.error(y),o=await n.cachedRead(e)}if(!o)return;const a=A.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss"),i=A.moment(e.stat.mtime).format("YYYY/MM/DD HH:mm:ss"),s=e.path,l="Thino",u="FILE",f="",h=[],p=[],m=r.getFileCache(e),w={frontm
Line truncated
|
||||
`);){const r=n.indexOf(`
|
||||
`);t.push(n.slice(0,r)),n=n.slice(r+1)}return t.push(n),t}async function SZ({content:e,isList:t,name:n}){const r=Se.getState().dailyNotesState.settings,o=A.moment(),a=je.randomId(16),i=r?.MemoOtherSaveLocation.MemoDefaultMultiFilePath||"Thino",s=n||`${o.format("YYYYMMDD")}-${a}`,l=`${i}/${s}.md`,u={id:a,content:e,deletedAt:"",path:l,createdAt:o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:o.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:[],pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"MULTI",fileInfo:{tags:[],frontmatter:{}}},f=Ze.getState().app||window.app,{vault:h,fileManager:p}=f,m=h.getAbstractFileByPath(i);(!m||!(m instanceof A.TFolder))&&(new A.Notice(I("Folder not found for the given thino path, is creating a new folder")),await h.createFolder(i)),Ge.setChangedByMemos(!0);let w;const b=f.vault.getFileByPath(l);b?w=await h.create(`${i}/${o.format("YYYYMMDD")}-${a}.md`,e):w=await h.create(l,e),await p.processFrontMatter(w,x=>{x.id=a,x.createdAt=o.format("YYYY/MM/DD HH:mm:ss"),x.updatedAt=o.format("YYYY/MM/DD HH:mm:ss"),x.thinoType=t?"JOURNAL":"TASK-TODO"}),(!n||b)&&r?.SetFileNameAfterCreate&&f.fileManager.promptForFileRename(w);const y=f.metadataCache.getFileCache(w),S={tags:y?.frontmatter?.tags||[],frontmatter:y?.frontmatter||{}};return{...u,fileInfo:S}}async function TZ({content:e,isList:t}){const n=Se.getState().dailyNotesState.settings,r=A.moment(),o=je.randomId(16),a=n?.MemoOtherSaveLocation.MemoDefaultSingleFilePath||"basic.thino.md",i={id:o,content:e,deletedAt:"",path:a,createdAt:r.format("YYYY/MM/DD HH:mm:ss"),updatedAt:r.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:[],pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE",fileInfo:{tags:[],frontmatter:{}}},s=Ze.getState().app,{vault:l}=s;let u=l.getAbstractFileByPath(a);(!u||!(u instanceof A.TFile))&&(new A.Notice(I("File not found for the given thino path, is creating a new file")),u=await l.create(a,""));const f=s.metadataCache.getFileCache(u),h={tags:f?.frontmatter?.tags||[],frontmatter:f?.frontmatter||{}};let p="";try{p=await l.read(u)||await l.cachedRead(u)}catch(E){console.error(E),new A.Notice(I("Failed to read current daily note, check if it exists."))}const m=p.indexOf(`# ${r.format("YYYY-MM-DD")}`);let w=p.indexOf(`
|
||||
#`,m+1);w===-1&&(w=p.length);const b=`> [!thino] ${r.format("YYYY/MM/DD HH:mm:ss")} %% [id::${o}] [thinoType::${t?"JOURNAL":"TASK-TODO"}] %%`,y=e.replace(/\n/g,`
|
||||
> `),S=`
|
||||
${b}
|
||||
> ${y}
|
||||
`;let x;if(m===-1){const E=`# ${r.format("YYYY-MM-DD")}`;x=`${p.substring(0,w)}
|
||||
${E}${S}
|
||||
${p.substring(w)}`}else x=`${p.substring(0,w)}${S}${p.substring(w)}`;return setTimeout(async()=>{Ge.setChangedByMemos(!0),await l.modify(u,x)},200),{...i,fileInfo:h}}async function jN(e){const t=Se.getState().dailyNotesState.settings,n=A.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),r=e.id,o=t?.MemoOtherSaveLocation.MemoDefaultSingleFilePath||"basic.thino.md",a={id:r,content:e.content,deletedAt:e.deletedAt||"",path:o,createdAt:n.format("YYYY/MM/DD HH:mm:ss"),updatedAt:n.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType||"JOURNAL",hasId:"",linkId:[],pinned:e.pinned,visibility:"PUBLIC",rowStatus:e.rowStatus||"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE",webId:e.id,fileInfo:e?.fileInfo},i=Ze.getState().app,{vault:s}=i;let l=s.getAbstractFileByPath(o);(!l||!(l instanceof A.TFile))&&(new A.Notice(I("File not found for the given thino path, is creating a new file")),l=await s.create(o,""));let u="";try{u=await s.read(l)||await s.cachedRead(l)}catch(x){console.error(x),new A.Notice(I("Failed to read current daily note, check if it exists."))}const f=i.metadataCache.getFileCache(l),h={tags:f?.frontmatter?.tags||[],frontmatter:f?.frontmatter||{}},p=u.indexOf(`# ${n.format("YYYY-MM-DD")}`);let m=u.indexOf(`
|
||||
#`,p+1);m===-1&&(m=u.length);const w=`> [!thino] ${n.format("YYYY/MM/DD HH:mm:ss")} %% [id::${r}] [thinoType::JOURNAL]${e.rowStatus==="ARCHIVED"?" [archived::true]":""}${e.pinned===!0?" [pinned::true]":""}${e.deletedAt?` [deleted::${e.deletedAt}]`:""}${e.id?` [webId::${e.id}]`:""} %%`,b=e.content.replace(/\n/g,`
|
||||
> `),y=`
|
||||
${w}
|
||||
> ${b}
|
||||
`;let S;if(p===-1){const x=`# ${n.format("YYYY-MM-DD")}`;S=`${u.substring(0,m)}
|
||||
${x}${y}
|
||||
${u.substring(m)}`}else S=`${u.substring(0,m)}${y}${u.substring(m)}`;return Ge.setChangedByMemos(!0),await s.modify(l,S),{...a,fileInfo:h}}async function xZ({content:e,isList:t}){const r=Se.getState().dailyNotesState.settings?.MemoOtherSaveLocation.MemoDefaultCanvasPath||"basic.thino.canvas",o=A.moment(),a=je.randomId(16),i={id:a,content:e,deletedAt:"",path:r,createdAt:o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:o.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:[],pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"CANVAS",fileInfo:{tags:[],frontmatter:{}}},s=Ze.getState().app,{vault:l}=s,u=await FG(r,s);if(!u||!(u instanceof A.TFile)){new A.Notice(I("File not found for the given thino path, is creating a new file"));return}const f=await l.read(u),h=JSON.parse(f);if(h.nodes.find(y=>y.id===i.id))return;let m;h.nodes.length>0&&(m=[...h.nodes].reduce((y,S)=>{if(!y.createdAt)return S;const x=A.moment(y.createdAt,"YYYY/MM/DD HH:mm:ss"),E=A.moment(S.createdAt,"YYYY/MM/DD HH:mm:ss");return x.isAfter(E)?y:S}));const w=m?{x:m.x,y:m.y+100,width:m.width,height:m.height}:{x:0,y:0,width:200,height:100};h.nodes.push({...w,type:"text",id:a,text:e,deletedAt:"",createdAt:o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:o.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:[],pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[]}),Ge.setChangedByMemos(!0);const b=JSON.stringify(h,null,2);return await l.modify(u,b),i}async function s1(e,t,n,r){const{vault:o}=Se.getState().dailyNotesState.app||window.app,a=Se.getState().dailyNotesState.app||window.app,i=Se.getState().dailyNotesState.settings,s=a.vault.getConfig("useTab")===void 0||window.app.vault.getConfig("useTab")===!0,l=s?1:a.vault.getConfig("tabSize"),u=(s?" ":" ").repeat(l),f=e.split(`
|
||||
`).join(`
|
||||
`+u),h=n||A.moment(),{DifferentInsertTarget:p,InsertAfterForTask:m,InsertType:w}=i,b=h.format(i.DefaultTimePrefix||"HH:mm");let y="",S="";i.UseMemoFixedStrings&&(y=lb(i.MemoFixedPrefix||"",h),S=lb(i.MemoFixedSuffix||"",h));const x=w==="end"?"":t?i.InsertAfter:p&&m||i.InsertAfter,E=a?.loadLocalStorage("tokenForSync");let C="";try{!r&&e&&E&&i.startSync&&(C=(await aC({content:e,thinoType:"DAILY",thinoStatus:t?"JOURNAL":"TASK-TODO"})).id)}catch(G){console.error(G)}const M=y?y+(y.endsWith(" ")?"":" ")+f:f,k=S?M+(M.endsWith(" ")?"":" ")+S:M,O=t?"- ":"- [ ] ",F=i?.DefaultMemoComposition?`${O}${i?.DefaultMemoComposition?.replace(/{TIME}/g,b).replace(/{CONTENT}/g,(k.split(`
|
||||
`).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(k)?`
|
||||
`+u:"")+k)}${k.split(`
|
||||
`).length>1&&/((-|\*|\d\.|>)\s|```)/g.test(k.split(`
|
||||
`)[k.split(`
|
||||
`).length-1])&&C?`
|
||||
`+u:" "}${C?`[webId::${C}]`:""}`:`${O}${b} ${k.split(`
|
||||
`).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(k)?`
|
||||
`+u:""}${k}${k.split(`
|
||||
`).length>1&&/((-|\*|\d\.|>)\s|```)/g.test(k.split(`
|
||||
`)[k.split(`
|
||||
`).length-1])&&C?`
|
||||
`+u:" "}${C?`[webId::${C}]`:""}`,R=Xs(),B=qw(h,R),Y="fake"+je.randomId(16);let H=!1;const Z=a.plugins.getPlugin("templater-obsidian");let W;if(B?W=B:(Z?.templater&&Z?.settings.trigger_on_file_creation&&(le.setWaitingForTemplater({origin:e,date:h,isList:t,id:Y,type:C?"web":"local"}),H=!0),W=await je.createDailyNoteCheck(h)),!W){new A.Notice(I("Failed to create daily note, check if it exists."));return}if(B||await Ze.fechLocalDailyNotes(),Z&&Z?.templater&&Z?.settings.trigger_on_file_creation&&H)return Ge.setChangedByMemos(!0),{id:Y,content:k,deletedAt:"",createdAt:h.format("YYYY/MM/DD HH:mm:ss"),updatedAt:h.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",path:W.path,hasId:"",linkId:[],webId:C,pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:{tags:[],frontmatter:{}}};let K="";try{K=await o.read(W)||await o.cachedRead(W)}catch(G){console.error(G),new A.Notice(I("Failed to read current daily note, check if it exists."))}const V=a.metadataCache.getFileCache(W),ne={tags:V?.frontmatter?.tags||[],frontmatter:V?.frontmatter||{}},Q=await sF(x,F,K);await o.modify(W,Q.content);const te=Q.posNum===-1?lF(Q.content).length-(F.split(`
|
||||
`).length-1)-1:Q.posNum+1;return Ge.setChangedByMemos(!0),{id:h.format("YYYYMMDDHHmm")+"00"+te,content:k,deletedAt:"",createdAt:h.format("YYYY/MM/DD HH:mm:ss"),updatedAt:h.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",path:W.path,hasId:"",linkId:[],webId:C,pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:ne}}async function LN(e){const{vault:t}=Se.getState().dailyNotesState.app||window.app,n=Se.getState().dailyNotesState.app||window.app,{DefaultMemoComposition:r,InsertAfter:o,DefaultTimePrefix:a,DifferentInsertTarget:i,InsertAfterForTask:s,InsertType:l,UseMemoFixedStrings:u,MemoFixedPrefix:f,MemoFixedSuffix:h}=Se.getState().dailyNotesState.settings;let p=(e.pinned?" [pinned::true]":"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.visibility==="PRIVATE"?' [visibility::"PRIVATE"]':"");if(e.id){const ee=" [webId::"+e.id+"]";p+=ee}const m=A.moment();if(e.deletedAt){const ee=" [deleted::"+m.format("YYYYMMDDHHmmss")+"]";p+=ee}const w=n.vault.getConfig("useTab")===void 0||n.vault.getConfig("useTab")===!0,b=w?1:n.vault.getConfig("tabSize"),y=(w?" ":" ").repeat(b),S=e.content.split(`
|
||||
`).join(`
|
||||
`+y),x=A.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss");let E="",C="";u&&(E=lb(f||"",x),C=lb(h||"",x));const M=E?E+(E.endsWith(" ")?"":" ")+S:S,k=C?M+(M.endsWith(" ")?"":" ")+C:M,O=x.format(a||"HH:mm"),F=!e.thinoType||e.thinoType==="JOURNAL"?"- ":e.thinoType==="TASK-TODO"?"- [ ] ":"- [x] ",R=r?`${F}${r?.replace(/{TIME}/g,O).replace(/{CONTENT}/g,(k.split(`
|
||||
`).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(k)?`
|
||||
`+y:"")+k)}${k.split(`
|
||||
`).length>1&&/```/g.test(k.split(`
|
||||
`)[k.split(`
|
||||
`).length-1])&&p.trim()?`
|
||||
`+y:" "}${p}`:`${F}${O} ${k.split(`
|
||||
`).length>1||/^((-|\*|\d\.|>)\s|```)/g.test(k)?`
|
||||
`+y:""}${k}${k.split(`
|
||||
`).length>1&&/```/g.test(k.split(`
|
||||
`)[k.split(`
|
||||
`).length-1])&&p.trim()?`
|
||||
`+y:" "}${p}`,B=Xs(),Y=qw(x,B),H="fake"+je.randomId(16);let Z=!1;const W=n.plugins.getPlugin("templater-obsidian");let K;if(Y?K=Y:(W?.templater&&W?.settings.trigger_on_file_creation&&(le.setWaitingForTemplater({origin:e.content,date:x,isList:e.thinoType&&e.thinoType==="JOURNAL",id:H,type:"local"}),Z=!0),K=await je.createDailyNoteCheck(x)),!K){new A.Notice(I("Failed to create daily note, check if it exists.")),new A.Notice(I("Your content has been copied to clipboard, and inserted into the editor. Please try it again")),await navigator.clipboard.writeText(e.content);const ee=n.workspace.getLeavesOfType("thino_view").first();n.workspace.trigger("send-to-thino",e.content,ee);return}if(Y||await Ze.fechLocalDailyNotes(),W&&W?.templater&&W?.settings.trigger_on_file_creation&&Z)return Ge.setChangedByMemos(!0),{id:H,content:e.content,deletedAt:e.deletedAt??"",createdAt:x.format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType||"JOURNAL",path:K.path,hasId:"",linkId:[],pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.webId||e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:e?.fileInfo||{tags:[],frontmatter:{}}};const V=n.metadataCache.getFileCache(K),ne={tags:V?.frontmatter?.tags||[],frontmatter:V?.frontmatter||{}};let Q="";try{Q=await t.read(K)||await t.cachedRead(K)}catch(ee){console.error(ee),new A.Notice(I("Failed to read current daily note, check if it exists."))}const te=l==="end"?"":e.thinoType&&i&&s||o,G=await sF(te,R,Q);await t.modify(K,G.content);const J=G.posNum===-1?lF(G.content).length-1:G.posNum+1;return Ge.setChangedByMemos(!0),{id:x.format("YYYYMMDDHHmm")+"00"+J,content:e.content,deletedAt:e.deletedAt??"",createdAt:x.format("YYYY/MM/DD HH:mm:ss"),updatedAt:x.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType||"JOURNAL",path:K.path,hasId:"",linkId:[],pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY",fileInfo:ne}}async function sF(e,t,n){const r=new RegExp(`(s*?)${await bZ(e)}(s*?)`),o=wZ(n),a=o.findIndex(u=>r.test(u)),i=e?.trim()===""?!0:a===-1,s=o.slice(a+1).findIndex(u=>/(^#+ |---|^\^[a-zA-Z0-9-]{2,}$)/.test(u)),l=s!==-1;if(l){let u;for(let f=s+a;f>a;f--)if(!/^[\s\n ]*$/.test(o[f])){u=f;break}return u||(u=a),await RN(t,n,i?-1:u,l)}else return await RN(t,n,o.length-1,l)}async function RN(e,t,n,r){if(n<-1)throw new Error("Invalid position");if(n===-1)return{content:`${t}
|
||||
${e}`,posNum:-1};const o=t.split(`
|
||||
`),a=o.slice(0,n+1).join(`
|
||||
`),i=o.slice(n+1).join(`
|
||||
`),s=i.trim().length>0;return{content:`${a}${!s&&!r||!a.endsWith(`
|
||||
`)?`
|
||||
`:""}${e}${(s||r?`
|
||||
`:"")+i}`,posNum:n}}const lF=e=>e.split(/\r?\n/);async function IZ(e){const t=Se.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof A.TFile)){new A.Notice(I("File not found for the given thino path"));return}await t.vault.delete(n)}async function kZ(e){const t=Se.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof A.TFile)){new A.Notice(I("File not found for the given thino path"));return}const o=(await t.vault.read(n)).split(`
|
||||
`),a=o.findIndex(l=>l.includes(e.id));if(a===-1){new A.Notice(I("Thino not found"));return}const i=o.findIndex((l,u)=>u>a&&l.trim()==="");i===-1?o.splice(a,o.length-a):o.splice(a,i-a);const s=o.join(`
|
||||
`);if(!s){new A.Notice(I("Thino not found"));return}Ge.setChangedByMemos(!0),await t.vault.modify(n,s)}async function EZ(e){const t=Se.getState().dailyNotesState.app,n=t.metadataCache.getFirstLinkpathDest("",e.path);if(!n){new A.Notice(I("File not found for the given thino path"));return}const r=await t.vault.read(n),o=JSON.parse(r),a=o.nodes,i=a.findIndex(f=>f.id===e.id);if(i===-1){new A.Notice(I("Thino not found"));return}a.splice(i,1);const s=o.edges;s.filter(f=>f.fromNode===e.id||f.toNode===e.id).forEach(f=>{const h=s.findIndex(p=>p.id===f.id);h!==-1&&s.splice(h,1)}),Ge.setChangedByMemos(!0);const u=JSON.stringify(o,null,2);await t.vault.modify(n,u)}async function CZ(e){nF()||new A.Notice(I("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,metadataCache:n}=Se.getState().dailyNotesState.app,r=e.path,o=t.getAbstractFileByPath(r);if(!o){new A.Notice(I("Please check your daily note plugin OR periodic notes plugin settings"));return}const a=await t.read(o),i=a.split(`
|
||||
`),l=n.getFileCache(o)?.listItems||[],u=parseInt(e.id.slice(14));let f=u;function h(b,y){const S=[];for(const x in y)y[x]===b&&S.push(parseInt(x),...h(parseInt(x),y));return S}const p=oC(l),m=l.find(b=>b.position.start.line===u),w=h(u,p);if(w.length>0){const b=w.map(y=>{const S=l.find(x=>x.position.start.line===y);return S?S.position.end.line:-1});f=Math.max(...b,m.position.end.line)}else f=m.position.end.line;if(!a){new A.Notice(I("Thino not found"));return}Ge.setChangedByMemos(!0),i.splice(u,f-u+1),await t.modify(o,i.join(`
|
||||
`))}async function MZ(){const{vault:e,metadataCache:t}=Se.getState().dailyNotesState.app,n=Se.getState().dailyNotesState.settings,o=Xw()+"/"+n.DeleteFileName+".md",a=[],i=t.getFirstLinkpathDest("",o);if(i instanceof A.TFile){let s=await e.read(i),l=DZ(s);if(l.length===0)return a;for(let u=0;u<l.length;u++){const f=l[u];if(/- /.test(f)){const p=AZ(f).slice(0,13),m=A.moment(p,"YYYYMMDDHHmmss"),w=OZ(l[u]),b=A.moment(w.slice(0,13),"YYYYMMDDHHmmss"),y=NZ(l[u]);a.push({id:w,content:y,user_id:1,createdAt:m.format("YYYY/MM/DD HH:mm:SS"),updatedAt:m.format("YYYY/MM/DD HH:mm:SS"),deletedAt:b})}else continue}l=null,s=null}return a}const DZ=e=>e.split(/\r?\n/),AZ=e=>/^- (\d{14})(\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e)?.[1],NZ=e=>/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e)?.[2],OZ=e=>/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e)?.[4];async function PZ(e){const t=await Cf(Se.getState().dailyNotesState.app)||[],n=t.findIndex(r=>r.id===e);t.splice(n,1),await rg(Se.getState().dailyNotesState.app,t)}const jZ=async e=>{const{app:t}=Se.getState().dailyNotesState,n=await Cf(t)||[],r=n.find(o=>o.id===e);if(r){const o=A.moment().format("YYYY/MM/DD HH:mm:ss");return r.pinnedAt=o,await rg(t,n),o}else{new A.Notice(I("Query not found"));return}},LZ=async e=>{const{app:t}=Se.getState().dailyNotesState,n=await Cf(t)||[],r=n.find(o=>o.id===e);if(r){r.pinnedAt="",await rg(t,n);return}else{new A.Notice(I("Query not found"));return}};var xI;(e=>{async function t(b){return await PN(b)}e.getMyMemos=t;async function n(b){return await PN([b])}e.updateSpecificTypeMemo=n;function r(){return MZ()}e.getMyDeletedMemos=r;function o(b){const y=le.getMemoById(b);if(y)switch(y?.sourceType){case"DAILY":return Zo(y,{id:y.id,deleted:!1});case"CANVAS":return ji(y,{id:y.id,deleted:!1});case"MULTI":return Va(y,{id:y.id,deleted:!1});case"FILE":return Pi(y,{id:y.id,deleted:!1})}}e.restoreMemo=o;function a(b){return kZ(b)}e.deleteMemoInSingleFile=a;function i(b){return IZ(b)}e.deleteMemoInMultiFiles=i;function s(b){return CZ(b)}e.deleteMemoInDailyNote=s;function l(b){return EZ(b)}e.deleteMemoInCanvas=l;function u(){return NG()}e.getMyQueries=u;async function f(b,y){return await PG(b,y)}e.createQuery=f;function h(b,y,S){return cZ(b,y,S)}e.updateQuery=h;function p(b){return PZ(b)}e.deleteQueryById=p;function m(b){return jZ(b)}e.pinQuery=m;function w(b){return LZ(b)}e.unpinQuery=w})(xI||(xI={}));const xo=xI;async function RZ(e,t,n,r,o){const{vault:a,metadataCache:i}=Se.getState().dailyNotesState.app===void 0?app:Se.getState().dailyNotesState.app;Se.getState().dailyNotesState.settings;const s=e.replace(/\n/g,"<br>");if(n===void 0)return;const l=i.getFirstLinkpathDest("",n),u=A.moment(),f=u.format("YYYYMMDDHHmmss");r.slice(14);const h=" ",p=f+" "+s.trim(),m=h+"- "+f+" "+s.trim();if(l){const w=await a.read(l),b=0,y=await FZ(m,w,b);if(await a.modify(l,y.content),t)return{id:f+(b+1),content:p,deletedAt:"",createdAt:u.format("YYYY/MM/DD HH:mm:ss"),updatedAt:A.moment().format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",path:l.path,hasId:"",linkId:[o]}}}async function FZ(e,t,n){const r=t.split(`
|
||||
`),o=r.slice(0,n+1).join(`
|
||||
`),a=r.slice(n+1).join(`
|
||||
`);return/^\s*$/g.test(r[n+1])?{content:`${o}
|
||||
${e}
|
||||
${a}`,posNum:n}:{content:`${o}
|
||||
${e}
|
||||
${a}`,posNum:n}}function HZ(e,t,n){const r=t.workspace.getLeavesOfType("markdown");for(const o of r)if(o.view?.file?.path===e){t.workspace.revealLeaf(o);try{return o.view.setEphemeralState({line:n}),!0}catch(i){return console.error(i),!1}}return!1}const sC=async e=>{const t=Ze.getState().app,n=t.workspace.getLeavesOfType("markdown");for(const a of n)if(a.view?.file?.path===e){t.workspace.revealLeaf(a);return}const r=t.metadataCache.getFirstLinkpathDest("",e);if(!r){new A.Notice(I("File not found for the given thino path"));return}await t.workspace.getLeaf(!0).openFile(r)},lC=async(e,t)=>{const{app:n}=Ze.getState(),r=parseInt(e.slice(14));if(HZ(t,n,r))return;const o=n.metadataCache.getFirstLinkpathDest("",t);if(!A.Platform.isMobile)await n.workspace.getLeaf(!0).openFile(o,{eState:{line:r}});else{let a=n.workspace.activeLeaf;a===null&&(a=n.workspace.getLeaf(!0)),await a.openFile(o,{eState:{line:r}})}},cC=async(e,t)=>{const n=Ze.getState().app,r=n.metadataCache.getFirstLinkpathDest("",t);if(!r){new A.Notice(I("File not found for the given thino path"));return}let o="";try{o=await n.vault.read(r)}catch(u){console.error(u),o=await n.vault.cachedRead(r)}const i=o.split(/\r?\n/).findIndex(u=>u.contains(e)),s=n.workspace.getLeavesOfType("markdown");for(const u of s)if(u.view?.file?.path===r.path){n.workspace.revealLeaf(u);try{u.view.editor?.setCursor({line:i,ch:1});return}catch(h){console.error(h)}}const l=n.workspace.getLeaf(!0);await l.openFile(r,{eState:{line:i}});try{l.view.editor?.setCursor({line:i,ch:1})}catch(u){console.error(u)}},uC=async(e,t)=>{const n=Ze.getState().app,r=(s,l)=>{const u=Array.from(s.nodes.values())?.find(f=>f.id===l);return u?(s.selectOnly(u),s.zoomToSelection(),!0):!1},o=n.workspace.getLeavesOfType("canvas");for(const s of o){const l=s.view;if(l?.file?.path===t&&(n.workspace.revealLeaf(s),r(l.canvas,e)))return}const a=n.metadataCache.getFirstLinkpathDest("",t);if(!a){new A.Notice(I("File not found for the given thino path"));return}const i=n.workspace.getLeaf(!0);await i.openFile(a),setTimeout(()=>{r(i.view?.canvas,e)},10)};class BZ{initialized=!1;getState(){return Se.getState().memoState}async fetchAllMemos(){const t=Ze.getState().settings;je.checkDailyInMulti(t);const n=await xo.getMyMemos(t.EnabledLocationList.map(a=>a.value)),r=[...n.memos],o=[...n.commentMemos];return Se.dispatch({type:"SET_MEMOS",payload:{memos:r}}),Se.dispatch({type:"SET_COMMENT_MEMOS",payload:{commentMemos:o}}),this.initialized||(this.initialized=!0,Ge.setLoaded(!0)),r}async updateTypeMemos(t){const n=await xo.updateSpecificTypeMemo(t),r=this.getState().memos.filter(o=>o.sourceType!==t);Se.dispatch({type:"SET_MEMOS",payload:{memos:[...r,...n.memos]}})}async removeTypeMemos(t){const n=this.getState().memos.filter(r=>r.sourceType!==t);Se.dispatch({type:"SET_MEMOS",payload:{memos:[...n]}})}async fetchDeletedMemos(){const t=await xo.getMyDeletedMemos();return t.sort((n,r)=>je.getTimeStampByDate(r.deletedAt)-je.getTimeStampByDate(n.deletedAt)),t}pushMemo(t){Se.dispatch({type:"INSERT_MEMO",payload:{memo:{...t}}})}pushCommentMemo(t){Se.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 finishWaitingForTemplaterThinos(){const t=this.getState().preparingUpdateMemo;if(t.length!==0)for(const n of t){const r=this.getMemoById(n.id),o=n.type==="local"?await s1(n.origin,n.isList,n.date,!0):await LN(r);await this.replaceOldThinoWithNewThino(n.id,o),Se.dispatch({type:"REMOVE_PARTICULAR_PREPARE_UPDATE_THINO",payload:{id:n.id}})}}async replaceOldThinoWithNewThino(t,n){this.getMemoById(t)&&Se.dispatch({type:"REPLACE_MEMO_BY_ID",payload:{id:t,memo:n}})}async updateMemoById(t,n,r){const o=this.getMemoByWebId(t);if(!o)return;let a=null;const i=r?{}:{content:n.content,rowStatus:n.rowStatus,pinned:n.pinned,deleted:!!n.deletedAt,thinoType:n.thinoType||"JOURNAL"};if(K9({...o,deleted:!!n.deletedAt},{...i,webId:n.id}))return o;switch(o.sourceType){case"DAILY":a=await Zo(o,{id:o.id,webId:n.id,...i});break;case"CANVAS":a=await ji(o,{id:o.id,webId:n.id,...i});break;case"MULTI":a=await Va(o,{id:o.id,webId:n.id,...i});break;case"FILE":a=await Pi(o,{id:o.id,webId:n.id,...i});break}if(!a)return o;Se.dispatch({type:"EDIT_MEMO",payload:a})}async archiveThinoBulk(t){const n=[];for(const r of t){let o;switch(r.sourceType){case"DAILY":o=await Zo(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(o);break;case"CANVAS":o=await ji(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(o);break;case"MULTI":o=await Va(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(o);break;case"FILE":o=await Pi(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(o);break}}return n.length>0?(Se.dispatch({type:"ARCHIVE_MEMO_BY_ID_BULK",payload:n}),n):t}async dealWithDailyThinoBulk(t,n,r){const o=await VG(t,n,r);return r=
Line truncated
|
||||
`+J+c}var ie=!1;function fe(c,d){if(!c||ie)return"";ie=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(xe){var T=xe}Reflect.construct(c,[],d)}else{try{d.call()}catch(xe){T=xe}c.call(d.prototype)}else{try{throw Error()}catch(xe){T=xe}c()}}catch(xe){if(xe&&T&&typeof xe.stack=="string"){for(var N=xe.stack.split(`
|
||||
`),L=T.stack.split(`
|
||||
`),q=N.length-1,ae=L.length-1;1<=q&&0<=ae&&N[q]!==L[ae];)ae--;for(;1<=q&&0<=ae;q--,ae--)if(N[q]!==L[ae]){if(q!==1||ae!==1)do if(q--,ae--,0>ae||N[q]!==L[ae]){var se=`
|
||||
`+N[q].replace(" at new "," at ");return c.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",c.displayName)),se}while(1<=q&&0<=ae);break}}}finally{ie=!1,Error.prepareStackTrace=v}return(c=c?c.displayName||c.name:"")?ee(c):""}function he(c){switch(c.tag){case 5:return ee(c.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return c=fe(c.type,!1),c;case 11:return c=fe(c.type.render,!1),c;case 1:return c=fe(c.type,!0),c;default:return""}}function we(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case O:return"Fragment";case k:return"Portal";case R:return"Profiler";case F:return"StrictMode";case Z:return"Suspense";case W:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case Y:return(c.displayName||"Context")+".Consumer";case B:return(c._context.displayName||"Context")+".Provider";case H:var d=c.render;return c=c.displayName,c||(c=d.displayName||d.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case K:return d=c.displayName||null,d!==null?d:we(c.type)||"Memo";case V:d=c._payload,c=c._init;try{return we(c(d))}catch{}}return null}function Ne(c){var d=c.type;switch(c.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=d.render,c=c.displayName||c.name||"",d.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return we(d);case 8:return d===F?"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 d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function Ae(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function Te(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function Fe(c){var d=Te(c)?"checked":"value",v=Object.getOwnPropertyDescriptor(c.constructor.prototype,d),T=""+c[d];if(!c.hasOwnProperty(d)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var N=v.get,L=v.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return N.call(this)},set:function(q){T=""+q,L.call(this,q)}}),Object.defineProperty(c,d,{enumerable:v.enumerable}),{getValue:function(){return T},setValue:function(q){T=""+q},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function We(c){c._valueTracker||(c._valueTracker=Fe(c))}function ke(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var v=d.getValue(),T="";return c&&(T=Te(c)?c.checked?"true":"false":c.value),c=T,c!==v?(d.setValue(c),!0):!1}function Ie(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}function ce(c,d){var v=d.checked;return G({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??c._wrapperState.initialChecked})}function Pe(c,d){var v=d.defaultValue==null?"":d.defaultValue,T=d.checked!=null?d.checked:d.defaultChecked;v=Ae(d.value!=null?d.value:v),c._wrapperState={initialChecked:T,initialValue:v,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function Oe(c,d){d=d.checked,d!=null&&E(c,"checked",d,!1)}function Ve(c,d){Oe(c,d);var v=Ae(d.value),T=d.type;if(v!=null)T==="number"?(v===0&&c.value===""||c.value!=v)&&(c.value=""+v):c.value!==""+v&&(c.value=""+v);else if(T==="submit"||T==="reset"){c.removeAttribute("value");return}d.hasOwnProperty("value")?ot(c,d.type,v):d.hasOwnProperty("defaultValue")&&ot(c,d.type,Ae(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(c.defaultChecked=!!d.defaultChecked)}function tt(c,d,v){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var T=d.type;if(!(T!=="submit"&&T!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+c._wrapperState.initialValue,v||d===c.value||(c.value=d),c.defaultValue=d}v=c.name,v!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,v!==""&&(c.name=v)}function ot(c,d,v){(d!=="number"||Ie(c.ownerDocument)!==c)&&(v==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+v&&(c.defaultValue=""+v))}var st=Array.isArray;function wt(c,d,v,T){if(c=c.options,d){d={};for(var N=0;N<v.length;N++)d["$"+v[N]]=!0;for(v=0;v<c.length;v++)N=d.hasOwnProperty("$"+c[v].value),c[v].selected!==N&&(c[v].selected=N),N&&T&&(c[v].defaultSelected=!0)}else{for(v=""+Ae(v),d=null,N=0;N<c.length;N++){if(c[N].value===v){c[N].selected=!0,T&&(c[N].defaultSelected=!0);return}d!==null||c[N].disabled||(d=c[N])}d!==null&&(d.selected=!0)}}function Ot(c,d){if(d.dangerouslyS
Line truncated
|
||||
`).replace(fV,"")}function sv(c,d,v){if(d=WA(d),WA(c)!==d&&v)throw Error(n(425))}function lv(){}var $S=null,XS=null;function JS(c,d){return c==="textarea"||c==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var QS=typeof setTimeout=="function"?setTimeout:void 0,hV=typeof clearTimeout=="function"?clearTimeout:void 0,GA=typeof Promise=="function"?Promise:void 0,pV=typeof queueMicrotask=="function"?queueMicrotask:typeof GA<"u"?function(c){return GA.resolve(null).then(c).catch(mV)}:QS;function mV(c){setTimeout(function(){throw c})}function eT(c,d){var v=d,T=0;do{var N=v.nextSibling;if(c.removeChild(v),N&&N.nodeType===8)if(v=N.data,v==="/$"){if(T===0){c.removeChild(N),Si(d);return}T--}else v!=="$"&&v!=="$?"&&v!=="$!"||T++;v=N}while(v);Si(d)}function pl(c){for(;c!=null;c=c.nextSibling){var d=c.nodeType;if(d===1||d===3)break;if(d===8){if(d=c.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return c}function ZA(c){c=c.previousSibling;for(var d=0;c;){if(c.nodeType===8){var v=c.data;if(v==="$"||v==="$!"||v==="$?"){if(d===0)return c;d--}else v==="/$"&&d++}c=c.previousSibling}return null}var Zu=Math.random().toString(36).slice(2),Ii="__reactFiber$"+Zu,Ih="__reactProps$"+Zu,fs="__reactContainer$"+Zu,tT="__reactEvents$"+Zu,gV="__reactListeners$"+Zu,vV="__reactHandles$"+Zu;function bc(c){var d=c[Ii];if(d)return d;for(var v=c.parentNode;v;){if(d=v[fs]||v[Ii]){if(v=d.alternate,d.child!==null||v!==null&&v.child!==null)for(c=ZA(c);c!==null;){if(v=c[Ii])return v;c=ZA(c)}return d}c=v,v=c.parentNode}return null}function kh(c){return c=c[Ii]||c[fs],!c||c.tag!==5&&c.tag!==6&&c.tag!==13&&c.tag!==3?null:c}function qu(c){if(c.tag===5||c.tag===6)return c.stateNode;throw Error(n(33))}function cv(c){return c[Ih]||null}var nT=[],Ku=-1;function ml(c){return{current:c}}function vn(c){0>Ku||(c.current=nT[Ku],nT[Ku]=null,Ku--)}function dn(c,d){Ku++,nT[Ku]=c.current,c.current=d}var gl={},jr=ml(gl),vo=ml(!1),wc=gl;function $u(c,d){var v=c.type.contextTypes;if(!v)return gl;var T=c.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===d)return T.__reactInternalMemoizedMaskedChildContext;var N={},L;for(L in v)N[L]=d[L];return T&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=d,c.__reactInternalMemoizedMaskedChildContext=N),N}function yo(c){return c=c.childContextTypes,c!=null}function uv(){vn(vo),vn(jr)}function qA(c,d,v){if(jr.current!==gl)throw Error(n(168));dn(jr,d),dn(vo,v)}function KA(c,d,v){var T=c.stateNode;if(d=d.childContextTypes,typeof T.getChildContext!="function")return v;T=T.getChildContext();for(var N in T)if(!(N in d))throw Error(n(108,Ne(c)||"Unknown",N));return G({},v,T)}function dv(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||gl,wc=jr.current,dn(jr,c),dn(vo,vo.current),!0}function $A(c,d,v){var T=c.stateNode;if(!T)throw Error(n(169));v?(c=KA(c,d,wc),T.__reactInternalMemoizedMergedChildContext=c,vn(vo),vn(jr),dn(jr,c)):vn(vo),dn(vo,v)}var hs=null,fv=!1,rT=!1;function XA(c){hs===null?hs=[c]:hs.push(c)}function yV(c){fv=!0,XA(c)}function vl(){if(!rT&&hs!==null){rT=!0;var c=0,d=Ke;try{var v=hs;for(Ke=1;c<v.length;c++){var T=v[c];do T=T(!0);while(T!==null)}hs=null,fv=!1}catch(N){throw hs!==null&&(hs=hs.slice(c+1)),as(sl,vl),N}finally{Ke=d,rT=!1}}return null}var Xu=[],Ju=0,hv=null,pv=0,sa=[],la=0,Sc=null,ps=1,ms="";function Tc(c,d){Xu[Ju++]=pv,Xu[Ju++]=hv,hv=c,pv=d}function JA(c,d,v){sa[la++]=ps,sa[la++]=ms,sa[la++]=Sc,Sc=c;var T=ps;c=ms;var N=32-qn(T)-1;T&=~(1<<N),v+=1;var L=32-qn(d)+N;if(30<L){var q=N-N%5;L=(T&(1<<q)-1).toString(32),T>>=q,N-=q,ps=1<<32-qn(d)+N|v<<N|T,ms=L+c}else ps=1<<L|v<<N|T,ms=c}function oT(c){c.return!==null&&(Tc(c,1),JA(c,1,0))}function aT(c){for(;c===hv;)hv=Xu[--Ju],Xu[Ju]=null,pv=Xu[--Ju],Xu[Ju]=null;for(;c===Sc;)Sc=sa[--la],sa[la]=null,ms=sa[--la],sa[la]=null,ps=sa[--la],sa[la]=null}var Ho=null,Bo=null,Tn=!1,Ha=null;function QA(c,d){var v=fa(5,null,null,0);v.elementType="DELETED",v.stateNode=d,v.return=c,d=c.deletions,d===null?(c.deletions=[v],c.flags|=16):d.push(v)}function e2(c,d){switch(c.tag){case 5:var v=c.type;return d=d.nodeType!==1||v.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(c.stateNode=d,Ho=c,Bo=pl(d.firstChild),!0):!1;case 6:return d=c.pendingProps===""||d.nodeType!==3?null:d,d!==null?(c.stateNode=d,Ho=c,Bo=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(v=Sc!==null?{id:ps,overflow:ms}:null,c.memoizedState={dehydrated:d,treeContext:v,retryLane:1073741824},v=fa(18,null,null,0),v.stateNode=d,v.return=c,c.child=v,Ho=c,Bo=null,!0):!1;default:return!1}}function iT(c){return(c.mode&1)!==0&&(c.flags&128)===0}function sT(c){if(Tn){var d=Bo;if(d){var v=d;if(!e2(c,d)){if(iT(c))throw Error(n(418));d=pl(v.nextSibling);var T=Ho;d&&e2(c,d)?QA(T,v):(c.flags=c.flags&-4097|2,Tn=!1,Ho=c)}}else{if(iT(c))throw Error(n(418));c.flags=c.flags&-4097|2,Tn=!1,Ho=c}}}function t2(c){for(c=c.
Line truncated
|
||||
Error generating stack: `+L.message+`
|
||||
`+L.stack}return{value:c,source:d,stack:N,digest:null}}function DT(c,d,v){return{value:c,source:null,stack:v??null,digest:d??null}}function AT(c,d){try{console.error(d.value)}catch(v){setTimeout(function(){throw v})}}var CV=typeof WeakMap=="function"?WeakMap:Map;function R2(c,d,v){v=vs(-1,v),v.tag=3,v.payload={element:null};var T=d.value;return v.callback=function(){jv||(jv=!0,WT=T),AT(c,d)},v}function F2(c,d,v){v=vs(-1,v),v.tag=3;var T=c.type.getDerivedStateFromError;if(typeof T=="function"){var N=d.value;v.payload=function(){return T(N)},v.callback=function(){AT(c,d)}}var L=c.stateNode;return L!==null&&typeof L.componentDidCatch=="function"&&(v.callback=function(){AT(c,d),typeof T!="function"&&(Sl===null?Sl=new Set([this]):Sl.add(this));var q=d.stack;this.componentDidCatch(d.value,{componentStack:q!==null?q:""})}),v}function H2(c,d,v){var T=c.pingCache;if(T===null){T=c.pingCache=new CV;var N=new Set;T.set(d,N)}else N=T.get(d),N===void 0&&(N=new Set,T.set(d,N));N.has(v)||(N.add(v),c=YV.bind(null,c,d,v),d.then(c,c))}function B2(c){do{var d;if((d=c.tag===13)&&(d=c.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return c;c=c.return}while(c!==null);return null}function _2(c,d,v,T,N){return c.mode&1?(c.flags|=65536,c.lanes=N,c):(c===d?c.flags|=65536:(c.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(d=vs(-1,1),d.tag=2,bl(v,d,1))),v.lanes|=1),c)}var MV=C.ReactCurrentOwner,bo=!1;function Xr(c,d,v,T){d.child=c===null?h2(d,null,v,T):nd(d,c.child,v,T)}function Y2(c,d,v,T,N){v=v.render;var L=d.ref;return td(d,N),T=xT(c,d,v,T,L,N),v=IT(),c!==null&&!bo?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~N,ys(c,d,N)):(Tn&&v&&oT(d),d.flags|=1,Xr(c,d,T,N),d.child)}function U2(c,d,v,T,N){if(c===null){var L=v.type;return typeof L=="function"&&!JT(L)&&L.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(d.tag=15,d.type=L,z2(c,d,L,T,N)):(c=_v(v.type,null,T,d,d.mode,N),c.ref=d.ref,c.return=d,d.child=c)}if(L=c.child,!(c.lanes&N)){var q=L.memoizedProps;if(v=v.compare,v=v!==null?v:bh,v(q,T)&&c.ref===d.ref)return ys(c,d,N)}return d.flags|=1,c=kl(L,T),c.ref=d.ref,c.return=d,d.child=c}function z2(c,d,v,T,N){if(c!==null){var L=c.memoizedProps;if(bh(L,T)&&c.ref===d.ref)if(bo=!1,d.pendingProps=T=L,(c.lanes&N)!==0)c.flags&131072&&(bo=!0);else return d.lanes=c.lanes,ys(c,d,N)}return NT(c,d,v,T,N)}function V2(c,d,v){var T=d.pendingProps,N=T.children,L=c!==null?c.memoizedState:null;if(T.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null,transitions:null},dn(id,_o),_o|=v;else{if(!(v&1073741824))return c=L!==null?L.baseLanes|v:v,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:c,cachePool:null,transitions:null},d.updateQueue=null,dn(id,_o),_o|=c,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},T=L!==null?L.baseLanes:v,dn(id,_o),_o|=T}else L!==null?(T=L.baseLanes|v,d.memoizedState=null):T=v,dn(id,_o),_o|=T;return Xr(c,d,N,v),d.child}function W2(c,d){var v=d.ref;(c===null&&v!==null||c!==null&&c.ref!==v)&&(d.flags|=512,d.flags|=2097152)}function NT(c,d,v,T,N){var L=yo(v)?wc:jr.current;return L=$u(d,L),td(d,N),v=xT(c,d,v,T,L,N),T=IT(),c!==null&&!bo?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~N,ys(c,d,N)):(Tn&&T&&oT(d),d.flags|=1,Xr(c,d,v,N),d.child)}function G2(c,d,v,T,N){if(yo(v)){var L=!0;dv(d)}else L=!1;if(td(d,N),d.stateNode===null)Dv(c,d),c2(d,v,T),gT(d,v,T,N),T=!0;else if(c===null){var q=d.stateNode,ae=d.memoizedProps;q.props=ae;var se=q.context,xe=v.contextType;typeof xe=="object"&&xe!==null?xe=ca(xe):(xe=yo(v)?wc:jr.current,xe=$u(d,xe));var Re=v.getDerivedStateFromProps,He=typeof Re=="function"||typeof q.getSnapshotBeforeUpdate=="function";He||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(ae!==T||se!==xe)&&u2(d,q,T,xe),yl=!1;var Le=d.memoizedState;q.state=Le,bv(d,T,q,N),se=d.memoizedState,ae!==T||Le!==se||vo.current||yl?(typeof Re=="function"&&(mT(d,v,Re,T),se=d.memoizedState),(ae=yl||l2(d,v,ae,T,Le,se,xe))?(He||typeof q.UNSAFE_componentWillMount!="function"&&typeof q.componentWillMount!="function"||(typeof q.componentWillMount=="function"&&q.componentWillMount(),typeof q.UNSAFE_componentWillMount=="function"&&q.UNSAFE_componentWillMount()),typeof q.componentDidMount=="function"&&(d.flags|=4194308)):(typeof q.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=T,d.memoizedState=se),q.props=T,q.state=se,q.context=xe,T=ae):(typeof q.componentDidMount=="function"&&(d.flags|=4194308),T=!1)}else{q=d.stateNode,o2(c,d),ae=d.memoizedProps,xe=d.type===d.elementType?ae:Ba(d.type,ae),q.props=xe,He=d.pendingProps,Le=q.context,se=v.contextType,typeof se=="object"&&se!==null?se=ca(se):(se=yo(v)?wc:jr.current,se=$u(d,se));var Xe=v.getDerivedStateFromProps;(Re=typeof Xe=="function"||typeof q.getSnapshotBeforeUpdate=="function")||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(ae!==He||Le!==se)&&u2(d,q,T,se),yl=
Line truncated
|
||||
`)[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 pn(e=!1){return new Promise((t,n)=>{l$(d$[process.platform],{},(r,o)=>{if(r)return n(new Error(`Error while obtaining machine id: ${r.stack}`));const a=p$(o.toString());return t(e?a:h$(a))})})}const KN={list:"align-left",waterfall:"layout-grid",calendar:"calendar",minimal:"list",table:"table",chat:"message-square",moments:"chrome",flow:"workflow"},m$=({className:e})=>{const{dailyNotesState:{app:t,view:n,verifyState:r,settings:o},globalState:{manifest:a,isMobileView:i}}=D.useContext(it),s=D.useRef(null),l=D.useRef(null),[u,f]=D.useState(()=>(window.app||t)?.loadLocalStorage("thinoListView")||"list"),[h,p]=D.useState(null),m=D.useCallback(()=>{if(!n?.leaf||n.leaf.height===0||!h?.settings)return;const S=h.settings.MemoListView;if(h.settings.SupportSelectOtherView||S==="chat"||S==="moments"||S==="flow")return;const x=n.leaf.width>950?S:"list";f(x),Ge.setMemoListView(x)},[n,h]);D.useEffect(()=>{if(!a||!t)return;const S=t.plugins.getPlugin(a.id);if(S){p(S);const x=S.settings?.MemoListView||"list";f(x),Ge.setMemoListView(x)}},[a,t]),D.useEffect(()=>{if(!(!t||!n||!h?.settings))return m(),l.current||(l.current=t.workspace.on("resize",m),n.registerEvent(l.current)),()=>{l.current&&(t.workspace.offref(l.current),l.current=null)}},[t,n,h,m]),D.useEffect(()=>{s.current&&(A.setIcon(s.current,KN[u]),Ge.setMemoListView(u),A.requireApiVersion("1.4.4")&&A.setTooltip(s.current,I("Switch view")))},[u]);const w=D.useMemo(()=>{const S=[{view:"list",title:I("List")},{view:"chat",title:I("Chat")},{view:"moments",title:I("Moments")}];return(!i||o?.SupportSelectOtherView)&&S.push({view:"waterfall",title:I("Waterfall")},{view:"calendar",title:I("Calendar")},{view:"table",title:I("Table")}),S},[i,o?.SupportSelectOtherView]),b=D.useCallback(async S=>{try{const x=!A.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),E=A.Platform.isDesktop?await pn():x?.identifier||x?.uuid;if(!r||r.appId!==E){It();return}const C=async k=>{u!==k&&(Ge.setMemoListView(k),h&&(h.settings.MemoListView=k,await h.saveSettings()),f(k))},M=new A.Menu;w.forEach(({view:k,title:O})=>{M.addItem(F=>{F.setChecked(u===k).setIcon(KN[k]).setTitle(O).onClick(()=>C(k))})}),M.showAtMouseEvent(S.nativeEvent)}catch(x){console.error("Error handling view switcher click:",x)}},[r,u,h,w]),y=D.useMemo(()=>`memos-view-switcher-wrapper ${e||""} pro`.trim(),[e]);return g.jsx("div",{className:y,ref:s,onClick:b})},g$=()=>{const e=D.useRef(null);return D.useEffect(()=>{e&&(A.setIcon(e.current,"calendar-check"),A.setTooltip&&A.setTooltip(e.current,I("Daily Memos")))},[e]),g.jsx("div",{className:"memos-review-entry-wrapper",ref:e,onClick:()=>{Ye.setPathname("/daily")}})},d1=()=>({type:"initialText",value:"",timestamp:Date.now(),selectionStart:0,selectionEnd:0}),$N={initialValue:"",interval:300};class v${constructor(t,n=$N){this.listeners=[],this.runUndo=()=>{const r=this.actions[this.currentIndex].selectionStart;this.currentIndex>0&&this.currentIndex--,this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(r,r),this.dispatchChange()},this.runRedo=()=>{this.currentIndex<this.actions.length-1&&this.currentIndex++;const r=this.actions[this.currentIndex].selectionEnd;this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(r,r),this.dispatchChange()},this.getActions=()=>this.actions,this.setState=(r,o)=>{this.actions=[...r],this.currentIndex=o<this.actions.length?o:this.actions.length-1,this.dispatchChange()},this.resetState=()=>{this.actions=[d1()],this.currentIndex=0,this.dispatchChange()},this.destroy=()=>{this.rmEventListeners()},this.subscribe=r=>{this.listeners.push(r)},this.handleElementKeydown=r=>{const o=r;o.key==="z"&&!o.shiftKey&&(o.metaKey||o.ctrlKey)?(r.preventDefault(),this.runUndo()):(o.key==="z"&&o.shiftKey&&(o.metaKey||o.ctrlKey)||o.key==="y"&&(o.metaKey||o.ctrlKey))&&(r.preventDefault(),this.runRedo())},this.handleElementInput=r=>{const o=r,a=this.actions[this.currentIndex];this.pushNewAction({type:o.inputType,value:this.element.value,timestamp:Date.now(),selectionStart:this.element.selectionEnd-(this.element.value.length-a.value.length),selectionEnd:this.element.selectionEnd})},this.addEventListeners=()=>{this.element.addEventListener("keydown",this.handleElementKeydown),this.element.addEventListener("input",this.handleElementInput)},this.rmEventListeners=()=>{this.element.removeEventListener("keydown",this.handleElementKeydown),this.element.removeEventListener("input",this.handleElementInput)},this.pushNewAction=r=>{const o=this.actions[this.currentIndex];o&&o.type===r.type&&r.timestamp-o.timestamp<this.config.interval?this.actions[th
Line truncated
|
||||
|
||||
Check the documentation or create issue if you think it's bug. https://github.com/webscopeio/react-textarea-autocomplete/issues`))},L$=[".","^","$","*","+","-","?","(",")","[","]","{","}","\\","|"],$v=function(t){return A$(t).map(function(n){return L$.includes(n)?"\\".concat(n):n}).join("")},R$=function(e){r0(t,e);function t(){return sg(this,t),n0(this,_d(t).apply(this,arguments))}return t0(t,[{key:"componentDidMount",value:function(){var r=this.props.boundariesElement;if(typeof r=="string"){var o=document.querySelector(r);if(!o)throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");this.containerElem=o}else if(r instanceof HTMLElement)this.containerElem=r;else throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");if(!this.containerElem||!this.containerElem.contains(this.ref))throw new Error("RTA: Invalid prop boundariesElement: it has to be one of the parents of the RTA.")}},{key:"componentDidUpdate",value:function(){var r,o,a=this.props.top||0,i=this.props.left||0,s=[],l=[],u=0,f=0,h=this.containerElem.getBoundingClientRect(),p=this.ref.getBoundingClientRect(),m=this.props.textareaRef.getBoundingClientRect(),w=window.getComputedStyle(this.ref),b=parseInt(w.getPropertyValue("margin-top"),10),y=parseInt(w.getPropertyValue("margin-bottom"),10),S=parseInt(w.getPropertyValue("margin-left"),10),x=parseInt(w.getPropertyValue("margin-right"),10),E=b+y+m.top+a+p.height,C=S+x+m.left+i+p.width;C>h.right&&m.left+i>p.width?(f=i-p.width,s.push(Cl.X.LEFT),l.push(Cl.X.RIGHT)):(f=i,s.push(Cl.X.RIGHT),l.push(Cl.X.LEFT)),E>h.bottom&&m.top+a>p.height?(u=a-p.height,s.push(Cl.Y.TOP),l.push(Cl.Y.BOTTOM)):(u=a,s.push(Cl.Y.BOTTOM),l.push(Cl.Y.TOP)),this.props.renderToBody&&(u+=m.top,f+=m.left),this.ref.style.top="".concat(u,"px"),this.ref.style.left="".concat(f,"px"),(r=this.ref.classList).remove.apply(r,l),(o=this.ref.classList).add.apply(o,s)}},{key:"render",value:function(){var r=this,o=this.props,a=o.style,i=o.className,s=o.innerRef,l=o.children,u=o.renderToBody,f=document.body,h=_.createElement("div",{ref:function(m){r.ref=m,s(m)},className:"rta__autocomplete ".concat(i||""),style:a},l);return u&&f!==null?hC.createPortal(h,f):h}}]),t}(_.Component),PF=function(e){r0(t,e);function t(n){var r;sg(this,t),r=n0(this,_d(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=zc.add(Wo.ESC,r._closeAutocomplete))},r.escListenerDestroy=function(){r.escListener&&(zc.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 l=r.textareaRef,u=l.selectionStart,f=l.selectionEnd;return u===f?null:r.state.value.substr(u,f-u)},r.setCaretPosition=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;r.textareaRef&&(r.textareaRef.focus(),r.textareaRef.setSelectionRange(l,l))},r.getCaretPosition=function(){if(!r.textareaRef)return 0;var l=r.textareaRef.selectionEnd;return l},r._handleCaretChange=function(l){var u=function(){var p=r.getCaretPosition()-1;r.lastTrigger=r.lastTrigger?p:0};if(l.type==="keydown"){var f=l.keyCode||l.which;switch(f){case Wo.UP:case Wo.DOWN:r._isAutocompleteOpen()||u();break;case Wo.LEFT:case Wo.RIGHT:u();break}return}u()},r._onSelect=function(l){var u=r.state,f=u.selectionEnd,h=u.currentTrigger,p=u.value,m=r.props.onItemSelected;if(h){var w=r._getTextToReplace(h);if(!w){r._closeAutocomplete();return}var b=w(l);if(!b){r._closeAutocomplete();return}m&&m({currentTrigger:h,item:l});var y=function(B,Y,H){switch(B){case"start":return H;case"next":case"end":return H+Y.length;default:if(!Number.isInteger(B))throw new Error('RTA: caretPosition should be "start", "next", "end" or number.');return B}},S=p.slice(0,f),x=$v(h),E=S.length-S.lastIndexOf(h),C=S.search(new RegExp("(?!".concat(x,")$")))-E,M=b.caretPosition==="next"?"".concat(b.text," "):b.text,k=y(b.caretPosition,M,C),O=S.substring(0,C)+M,F=p.replace(S,O);r.setState({value:F,dataLoading:!1},function(){var R=r.tokenRegExpEnding.exec(M),B=R?R[0].length:1;r.lastTrigger=k&&k-B,r.textareaRef.value=F,r.textareaRef.selectionEnd=k,r._changeHandler();var Y=r.textareaRef.scrollTop;r.setCaretPosition(k),window.chrome&&(r.textareaRef.scrollTop=Y)})}},r._getTextToReplace=function(l){var u=r.props.trigger[l];if(!l||!u)return null;var f=u.output;return function(h){if(typeof h=="object"&&(!f||typeof f!="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(f){var p=f(h,l);if(p===void 0||typeof p=="number")throw new Error(`Output functor should return string or object in shape {text: string
Line truncated
|
||||
Got "`.concat(String(p),'". Check the implementation for trigger "').concat(l,`"
|
||||
|
||||
See https://github.com/webscopeio/react-textarea-autocomplete#trigger-type for more information.
|
||||
`));if(p===null)return null;if(typeof p=="string")return{text:p,caretPosition:JN};if(!p.text&&typeof p.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(l,`"
|
||||
`));if(!p.caretPosition)throw new Error('Output "caretPosition" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(l,`"
|
||||
`));return p}if(typeof h!="string")throw new Error(`Output item should be string
|
||||
`);return{text:"".concat(l).concat(h).concat(l),caretPosition:JN}}},r._getCurrentTriggerSettings=function(){var l=r.state.currentTrigger;return l?r.props.trigger[l]:null},r._getValuesFromProvider=function(){var l=r.state,u=l.currentTrigger,f=l.actualToken,h=r._getCurrentTriggerSettings();if(!(!u||!h)){var p=h.dataProvider,m=h.component;if(typeof p!="function")throw new Error("Trigger provider has to be a function!");r.setState({dataLoading:!0});var w=p(f);w instanceof Promise||(w=Promise.resolve(w)),w.then(function(b){if(!Array.isArray(b))throw new Error("Trigger provider has to provide an array!");if(typeof m!="function")throw new Error("Component should be defined!");if(u===r.state.currentTrigger){if(!b.length){r._closeAutocomplete();return}r.setState({dataLoading:!1,data:b,component:m})}}).catch(function(b){return QN(b.message)})}},r._getSuggestions=function(){var l=r.state,u=l.currentTrigger,f=l.data;return!u||!f||f&&!f.length?null:f},r._createRegExp=function(){var l=r.props.trigger;r.tokenRegExp=new RegExp("(".concat(Object.keys(l).sort(function(u,f){return u<f?1:u>f?-1:0}).map(function(u){return $v(u)}).join("|"),")((?:(?!\\1)[^\\s])*$)")),r.tokenRegExpEnding=new RegExp("(".concat(Object.keys(l).sort(function(u,f){return u<f?1:u>f?-1:0}).map(function(u){return $v(u)}).join("|"),")$"))},r._closeAutocomplete=function(){var l=r.state.currentTrigger;r.escListenerDestroy(),r.setState({data:null,dataLoading:!1,currentTrigger:null},function(){l&&r._onItemHighlightedHandler(null)})},r._cleanUpProps=function(){var l=k$({},r.props),u=["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 f in l)u.includes(f)&&delete l[f];return l},r._changeHandler=function(l){var u=r.props,f=u.trigger,h=u.onChange,p=u.minChar,m=u.onCaretPositionChange,w=u.movePopupAsYouType,b=r.state,y=b.top,S=b.left,x=l;x||(x=new x$("change",{bubbles:!0}),r.textareaRef.dispatchEvent(x));var E=x.target||r.textareaRef,C=E.selectionEnd,M=E.value;if(r.lastValueBubbledEvent=M,h&&x&&(x.persist&&x.persist(),h(new Proxy(x,{get:function(G,J,ee){return J==="target"?E:Reflect.get(G,J,ee)}}))),m){var k=r.getCaretPosition();m(k)}r.setState({value:M});var O=function(){var G=w$(E,C),J=G.top,ee=G.left;r.setState({top:J-r.textareaRef.scrollTop||0,left:ee})},F=function(G){r.lastTrigger=C-G,r._closeAutocomplete(),O()};if(C<=r.lastTrigger){var R=M.slice(0,C),B=r.tokenRegExp.exec(R);F(B?B[0].length:0)}var Y=M.slice(r.lastTrigger,C),H=r.tokenRegExp.exec(Y),Z=H&&H[0],W=H&&H[1]||null,K=W?W.length-1:0,V=r.tokenRegExpEnding.exec(Y);if(V?F(V[0].length):r._isAutocompleteOpen()||r._closeAutocomplete(),(!Z||Z.length<=p+K)&&(r.state.currentTrigger&&!f[r.state.currentTrigger].allowWhitespace||!r.state.currentTrigger)){r._closeAutocomplete();return}if(W&&f[W].afterWhitespace&&!/\s/.test(M[C-Z.length-1])&&M[C-Z.length-1]!==void 0){r._closeAutocomplete();return}if(r.state.currentTrigger&&f[r.state.currentTrigger].allowWhitespace){if(H=new RegExp("".concat($v(r.state.currentTrigger),".*$")).exec(M.slice(0,C)),Z=H&&H[0],!Z){r._closeAutocomplete();return}W=Object.keys(f).find(function(te){return te.slice(0,K+1)===Z.slice(0,K+1)})||null}var ne=Z.slice(1);if(W){(w||y===null&&S===null||r.state.currentTrigger!==W)&&O(),r.escListenerInit();var Q=r._getTextToReplace(W);r.setState({selectionEnd:C,currentTrigger:W,textToReplace:Q,actualToken:ne},function(){try{r._getValuesFromProvider()}catch(te){QN(te.message)}})}},r._selectHandler=function(l){var u=r.props,f=u.onCaretPositionChange,h=u.onSelect;if(f){var p=r.getCaretPosition();f(p)}h&&(l.persist(),h(l))},r._shouldStayOpen=function(l){var u=l.relatedTarget;return u===null&&(u=document.activeElement),!!(r.dropdownRef&&u instanceof Node&&r.dropdownRef.contains(u))},r._onClick=function(l){var u=r.props.onClick;u&&(l.persist(),u(l)),!r._shouldStayOpen(l)&&r._closeAutocomplete()},r._onBlur=function(l){var u=r.props.onBlur;u&&(l.persist(),u(l)),!r._shouldStayOpen(l)&&r._closeAutocomplete()},r._onScrollHandler=function(){r._closeAutocomplete()},r._onItemHighlightedHandler=function(l){var u=r.props.onItemHighlighted,f=r.state.currentTrigger;if(u)if(typeof u=="function")u({currentTrigger:f,item:l});else throw new Error("`onItemHighlighted` has to be a function")},r._dropdownScroll=function(l){var u=r.props.scrollToItem;if(u){if(u===!0){j$(r.dropdownRef,l);return}if(typeof u!="function"||u.length!==2)throw new Error("`scrollToItem` has to be boolean (true for default implementation) or function with two parameters: container, item.");u(r.dropdownRef,l)}},r._isAutocompleteOpen=function(){var l=r.state,u=l.dataLoading,f=l.currentTrigger,h=r._getSuggestions();return!!((u|
Line truncated
|
||||
`,Pe.id);else{const Oe=ce.toPNG(),Ve=new Blob([Oe],{type:"image/png"}),tt=new File([Ve],"image.png",{type:"image/png",lastModified:Date.now()});if(!tt)return;const ot=await te(tt);ot&&b.current?.insertText(ot+`
|
||||
`,Pe.id)}})))},[b,s,a]),D.useEffect(()=>{i&&f(i.DefaultPrefix==="List")},[i?.DefaultPrefix]),D.useEffect(()=>{if(i){if(i.EnabledLocationList.length===1){H(i.EnabledLocationList[0].value);return}H(i.MemoSaveLocation||"DAILY")}},[i?.MemoSaveLocation,i?.EnabledLocationList]),D.useEffect(()=>{if(!i||!B.current)return;const ce=Up.find(Oe=>Oe.title===Y)?.icon;A.setIcon(B.current,ce),A.requireApiVersion("1.4.4")&&A.setTooltip(B.current,I("Thino Save To: ")+Y),Z.current=Y;const Pe=o.manifest;if(Pe){const Oe=a?.plugins.getPlugin(Pe.id);if(Oe){if(Oe.settings.MemoSaveLocation===Y)return;Oe.settings.MemoSaveLocation=Y,Oe.saveSettings()}}},[Y,p]),D.useEffect(()=>{b.current&&i&&i.MemoSaveLocation&&H(i.MemoSaveLocation)},[B,i]),D.useEffect(()=>{if(!b.current||!i||A.Platform.isDesktop||o.globalEditorShown)return;const ce=i.UseButtonToShowEditor&&i.DefaultEditorLocation==="Bottom";if(A.Platform.isDesktop){m(!0);return}if(t&&t==="inline"){m(!0);return}if(m(A.Platform.isMobile&&!ce),!ce||o.memoListView==="chat")return;const Pe=document.body.find(".memolist-scrollview");Pe&&(Pe.onscroll=()=>{if(o.globalEditorShown)return;if(!o.memoListView&&Ge.getState().memoListView==="chat"){Pe.onscroll=null;return}const Oe=b.current.getContent();A.Platform.isMobile&&ce&&!Oe&&m(!1)})},[o.globalEditorShown,t,b]);const W=()=>{C(!1)};D.useEffect(()=>{if(a&&(o.markMemoId||o.editMemoId?.trim()&&o.editMemoId!==y.current.editMemoId)){const ce=a.workspace.getLeavesOfType("thino_view");ce.length>0&&a.workspace.revealLeaf(ce[0])}if(o.markMemoId){const ce=le.getMemoById(o.markMemoId);if(ce&&ce.sourceType==="DAILY")rF(ce).then(Pe=>{const Oe=`${I("MARK")}: ${Pe}`;b.current?.insertText(Oe),b.current?.focus(),Ge.setMarkMemoId("")});else{const Pe=`${I("MARK")}: [@THINO](${o.markMemoId})`;b.current?.insertText(Pe),b.current?.focus(),Ge.setMarkMemoId("")}return}if(o.editMemoId?.trim()&&o.editMemoId!==y.current.editMemoId){const ce=le.getMemoById(o.editMemoId);if(ce)switch(f(ce.thinoType==="JOURNAL"),i.EditorType){case"memos":b.current?.setContent(ce.content.replace(/ \^\S{6}$/,"")||""),b.current?.focus();break;case"obsidian":b.current?.clear(!1),b.current?.setContent(ce.content.replace(/ \^\S{6}$/,"")||""),b.current?.focus();break}}y.current=o},[o.markMemoId,o.editMemoId]),D.useEffect(()=>{!b.current||S||i.EditorType==="memos"&&(b.current?.element.addEventListener("paste",K),b.current?.element.addEventListener("drop",V),b.current?.element.addEventListener("click",ne),x(!0))},[b.current]);const K=async ce=>{if(ce.clipboardData&&ce.clipboardData.files.length>0){ce.preventDefault();const Pe=ce.clipboardData.files;for(const Oe of Pe){const Ve=await te(Oe);Ve&&b.current?.insertText(Ve)}}},V=async ce=>{if(ce.dataTransfer&&ce.dataTransfer.files.length>0){ce.preventDefault();const Pe=ce.dataTransfer.files;for(const Oe of Pe){const Ve=await te(Oe);Ve&&b.current?.insertText(Ve)}}},ne=()=>{ie(b.current?.element.value||"")},Q=async(ce,Pe)=>{const Oe=ce.ctrlKey||ce.metaKey,Ve=ce.altKey;if(ce.key==="Escape"&&o.globalEditorShown&&(Ge.setGlobalEditorShown(!1),ce.preventDefault()),Oe&&ce.key==="Enter"){ce.preventDefault(),ce.stopPropagation(),await J(b.current?.getContent()),b.current?.clear(!0);return}if(Ve)for(let tt=0;tt<i.EnabledLocationList.length;tt++)ce.key===(tt+1).toString()&&H(i.EnabledLocationList[tt].value);setTimeout(()=>{})},te=D.useCallback(async ce=>{const{type:Pe}=ce;if(Pe.startsWith("image"))try{return`${await dC.upload(ce)}`}catch(Oe){new A.Notice(Oe)}},[]),G=D.useCallback(async ce=>{if(i.enableWordCount){const Pe=!A.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),Oe=A.Platform.isDesktop?await pn():Pe.identifier||Pe.uuid;if(!(l&&l?.appId===Oe))return It(),!1;if(i.maxWordCount===0)return!0;const tt=ce.replace(/```[^\S\r\n]*[a-z]*\n.*?\n```/g,""),ot=je.getWordCount(tt),st=i.maxWordCount||1e3;return!(ot>st&&st>0)}return!0},[i.enableWordCount,i.maxWordCount]),J=async ce=>{if(!ce||ce.trim()===""){new A.Notice(I("Content cannot be empty"));return}const Pe=Ze.getState().settings,Oe=Pe?.addTagAutomatically,Ve=Pe?.addTagWithNewline,tt=Pe?.addTagPosition,st=(pJ()||[]).filter(an=>!ce.includes(`#${an}`)),wt=async(an,mn)=>{mn=mn.replaceAll(" "," "),Jv("");try{if(!an){let qe;switch(Z.current){case"CANVAS":qe=await le.createMemoCanvas({text:mn,isList:h.current});break;case"MULTI":qe=await le.createMemoMultiFile({content:mn,isList:h.current});break;case"DAILY":qe=await le.createMemoDaily(mn,h.current);break;case"FILE":qe=await le.createMemoSingleFile({content:mn,isList:h.current});break}if(!qe)return;le.pushMemo(qe),(!Oe||st.length===0)&&Ye.clearQuery();const Tt=(a||Ze.getState().app)?.loadLocalStorage("tokenForSync");qe&&Tt&&i.startSync&&setTimeout(async()=>{try{if(Z.current!=="DAILY"){const Et=await aC({content:mn,thinoType:"FILE",thinoStatus:qe.thinoType==="JOURNAL"?"JOURNAL":qe.thinoType==="TASK-TODO"?"TASK-TODO":"TASK-DONE"});await le.updateMemoById(qe.id,Et,!0)}}catch(Et){console.error(Et)}},200);return}const Fn=le.getMemoById(an);if(Fn&&(Fn.
Line truncated
|
||||
`:""}${ce}`:`${ce} ${Ve?`
|
||||
`:""}${st.map(an=>`#${an}`).join(" ")}`:ce;await wt(Ot,Wt),Jv("")},ee=D.useCallback(()=>{Ge.setEditMemoId(""),b.current?.setContent(""),Jv("")},[]),ie=D.useCallback(ce=>{if(Jv(ce??""),!b.current)return;const Pe=b.current.getContent(),Oe=b.current.element.selectionStart,Ve=Pe.slice(0,Oe),tt=Pe.slice(Oe);(Ve.endsWith("@")||Ve.endsWith("📆"))&&tt.startsWith(" ")||(Ve.endsWith("@")||Ve.endsWith("📆"))&&tt===""?(Fe(),C(!0)):C(!1),setTimeout(()=>{b.current?.focus()})},[i.EditorType]),fe=ce=>{if(!b.current||!i)return;ce&&(W(),f(!1));const Pe=b.current.getContent(),Oe=b.current.element.selectionStart,Ve=Pe.slice(0,Oe),tt=Pe.slice(Oe),ot=A.moment(ce);if(Ve.endsWith("@"))switch(i.InsertDateFormat){case"Dataview":b.current.element.value=Pe.slice(0,b.current.element.selectionStart-1)+"[due:: "+ot.format("YYYY-MM-DD")+"]"+tt,b.current.element.setSelectionRange(Oe+17,Oe+17),b.current.focus(),ie(b.current.element.value);break;case"Tasks":b.current.element.value=Pe.slice(0,b.current.element.selectionStart-1)+"📅 "+ot.format("YYYY-MM-DD")+tt,b.current.element.setSelectionRange(Oe+11,Oe+11),b.current.focus(),ie(b.current.element.value)}else{b.current.element.value=Ve+ot.format("YYYY-MM-DD")+tt,b.current.element.setSelectionRange(Oe+10,Oe+10),b.current.focus(),ie(b.current.element.value);return}},he=()=>{b.current&&f()},we=async()=>{const ce=!A.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),Pe=A.Platform.isDesktop?await pn():ce.identifier||ce.uuid;return!l||l?.appId!==Pe?(It(),!1):!0},Ne=async ce=>{if(!await we())return;const Pe=new A.Menu;i.EnabledLocationList.forEach(ot=>{Pe.addItem(st=>{st.setTitle(I(ot.value)).setIcon(Up.find(wt=>wt.title===ot.value)?.icon??"file").setChecked(Y===ot.value).onClick(()=>{H(ot.value)})})});let Oe=ce.target,Ve=null;for(;!Oe.hasClass("location-wrapper")&&(Ve=Oe.parentElement,Ve);)Oe=Ve;const tt=Oe.getBoundingClientRect();setTimeout(()=>{Pe.showAtPosition({x:tt.x,y:tt.bottom,width:tt.width,left:!1,overlap:!0})},200)},Ae=D.useCallback(async ce=>{const Pe=await RF(a,r?"modal":"view"),Oe=new A.Menu;if(Oe.dom.addClass("history-menu"),Pe.length===0){Oe.addItem(Ve=>{Ve.setTitle(I("No history")),Ve.setIcon("file-clock"),Ve.setDisabled(!0)}),Oe.showAtMouseEvent(ce.nativeEvent);return}Pe.forEach(Ve=>{Oe.addItem(tt=>{tt.titleEl.addClass("history-item"),tt.titleEl.createEl("span",{text:`${Ve.content.length} chars`}),tt.titleEl.createEl("span",{text:A.moment(Ve.timestamp).format("YYYY-MM-DD HH:mm:ss")}),tt.onClick(()=>{b.current?.updateContent(Ve.content)}),tt.dom.onmouseover=ot=>{const st=new A.HoverPopover(s,tt.dom,1e3);st.hoverEl.createEl("div",{text:"History content:",cls:"history-popover-title"}),st.hoverEl.createEl("div",{cls:"history-popover-content"},wt=>{A.MarkdownRenderer.render(a,Ve.content,wt,"",s)}),st.hoverEl.addClass("history-popover"),st.load(),s.addChild(st),setTimeout(()=>{st.unload()},1e3)}})}),Oe.showAtMouseEvent(ce.nativeEvent)},[a]),Te=D.useCallback(()=>{if(!(!b.current&&i.EditorType==="memos"))switch(i.EditorType){case"obsidian":b.current?.focus(),b.current?.insertTag();break;case"memos":{const ce=b.current.getContent(),Pe=b.current.element.selectionStart,Oe=ce.slice(0,Pe),Ve=ce.slice(Pe);let tt=Oe+"# "+Ve,ot=Oe.length+1;Oe.endsWith("#")&&Ve.startsWith(" ")&&(tt=Oe.slice(0,Oe.length-1)+Ve.slice(1),ot=Oe.length-1),b.current.element.value=tt,b.current.element.setSelectionRange(ot,ot),b.current.focus();const st=new Event("input",{bubbles:!0,cancelable:!0});b.current.element.dispatchEvent(st),ie(b.current.element.value)}}},[a]),Fe=D.useCallback(()=>{if(!b.current||!k.current||!i||!a)return;const Oe=a.workspace.getLeavesOfType(Yr)[0].view.containerEl,Ve=280,tt=Oe.clientWidth,{x:ot,y:st}=mJ(b.current.element);let wt,Ot;A.Platform.isMobile?(window.innerWidth-ot>Ve?wt=(ot+Ve+16>tt,ot+18):window.innerWidth-ot<Ve?wt=(ot+Ve+16>tt,ot+34):wt=b.current.element.clientWidth/2,i.DefaultEditorLocation==="Bottom"&&window.innerWidth>875?Ot=st+4:i.DefaultEditorLocation==="Bottom"&&window.innerWidth<=875?Ot=st+19:i.DefaultEditorLocation==="Top"&&window.innerWidth<=875&&(Ot=st+36)):(wt=(ot+Ve+16>tt,ot+18),Ot=st+34),M(ot),k.current.style.left=`${wt}px`,k.current.style.top=`${Ot}px`},[i,a]),We=D.useCallback(()=>{const ce=document.createElement("input");document.body.appendChild(ce),ce.type="file",ce.multiple=!1,ce.accept="image/png, image/gif, image/jpeg",ce.onchange=async()=>{if(!ce.files||ce.files.length===0)return;const Pe=ce.files[0],Oe=await te(Pe);Oe&&b.current?.insertText(Oe),document.body.removeChild(ce)},ce.click()},[]),ke=!!o.editMemoId,Ie=D.useMemo(()=>({className:"memo-editor",inputerType:i.EditorType||"obsidian",modal:r,initialContent:gJ(),placeholder:I("What do you think now..."),showConfirmBtn:!0,showCancelBtn:ke,showTools:!0,onConfirmBtnClick:J,onCancelBtnClick:ee,onContentChange:ie,onCheckCount:G}),[ke,i.EditorType]);return g.jsxs(g.Fragment,{children:[!o.globalEditorShown&&t==="block"&&g.jsx("div",{ref:ce=>{w.current=ce,ce&&A.setIcon&&A.setIcon(ce,"plus-circle")},Line truncated
|
||||
`},"")),p+r+y.replace(/ \^\S{6}/g,"")+`
|
||||
`+S},"");return e.reduce((h,p)=>{const m=t?.ShowDate?`- [[${A.moment(p.date,"YYYY-MM-DD").format(n)}]]
|
||||
`:"",w=f(p.have),b=t?.ShowDate&&t?.AddBlankLineWhenDate&&!t?.CommentOnMemos?`
|
||||
`:"";return h+m+w+b},"").replace(/<br>/g,`
|
||||
`)},wJ=[{label:I("Today"),value:A.moment().format("YYYY-MM-DD")},{label:I("Yesterday"),value:A.moment().subtract(1,"days").format("YYYY-MM-DD")},{label:I("Last 7 days"),value:A.moment().subtract(7,"days").format("YYYY-MM-DD")},{label:I("Last 30 days"),value:A.moment().subtract(30,"days").format("YYYY-MM-DD")},{label:I("Last 90 days"),value:A.moment().subtract(90,"days").format("YYYY-MM-DD")},{label:I("Last 180 days"),value:A.moment().subtract(180,"days").format("YYYY-MM-DD")},{label:I("Last 365 days"),value:A.moment().subtract(365,"days").format("YYYY-MM-DD")}],o6=e=>{const{handleValueChange:t,setShownStatus:n}=e;return g.jsxs(g.Fragment,{children:[e.type==="icon"&&g.jsx("div",{className:"quick-date-btn-group",children:wJ.map((r,o)=>g.jsx("div",{className:"btn action-btn quick-date-btn",onClick:()=>{t(r.value),n&&n(!1)},children:r.label},o))}),g.jsx(a0,{className:"calendar-date-picker",datestamp:e?.defaultValue||A.moment().startOf("day").valueOf(),handleDateStampChange:(r,o)=>{t(e.type==="icon"?A.moment(r).format("YYYY-MM-DD"):r.toString()),n&&n(!1)}})]})},bb=e=>{const{handleValueChange:t}=e,[n,r]=_.useState(!1),o=_.useRef(null),a=_.useRef(null),i=s0(a.current,o.current,{placement:"bottom-start"});return cg(o,()=>{r(!1)}),g.jsxs(g.Fragment,{children:[g.jsx("span",{ref:l=>{a.current=l,l&&e.type==="icon"&&A.setIcon(l,"calendar")},className:`btn calendar-btn ${e.type==="icon"?"icon-btn":"text-btn"}`,onClick:()=>{!A.Platform.isMobile&&r(!n),!A.Platform.isMobile&&i?.update&&i?.update(),A.Platform.isMobile&&new a6(Ze.getState().app,e.type,t).open()},children:e.type==="text"&&e.defaultValue?e.defaultText?e.defaultText:A.moment(e.defaultValue,"x").subtract(e.startOrEnd==="end"?1:0,"days").format("YYYY/MM/DD"):""}),g.jsx("div",{className:`menu-btns-popup ${n?"":"thino-hidden"}`,ref:o,style:i.styles.popper,children:g.jsx(o6,{type:e.defaultText?"icon":e.type,handleValueChange:t,setShownStatus:r})})]})};class a6 extends A.Modal{root;type;handleValueChange;constructor(t,n,r){super(t),this.type=n,this.handleValueChange=r}onOpen(){const{contentEl:t}=this;this.root=ag(t),this.root.render(g.jsx(o6,{type:this.type,handleValueChange:this.handleValueChange.bind(this),setShownStatus:n=>{!n&&this.close()}}))}onClose(){this.root?.unmount()}}const SJ=(e,t)=>(e%t+t)%t;class TJ{owner;values;suggestions;selectedItem;containerEl;constructor(t,n,r){this.owner=t,this.containerEl=n,n.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),n.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),r.register([],"ArrowUp",o=>{if(!o.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",o=>{if(!o.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",o=>{if(!o.isComposing)return this.useSelectedItem(o),!1})}onSuggestionClick(t,n){t.preventDefault();const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1),this.useSelectedItem(t)}onSuggestionMouseover(t,n){const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1)}setSuggestions(t){this.containerEl.empty();const n=[];t.forEach(r=>{const o=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,o),n.push(o)}),this.values=t,this.suggestions=n,this.setSelectedItem(0,!1)}useSelectedItem(t){const n=this.values[this.selectedItem];n&&this.owner.selectSuggestion(n,t)}setSelectedItem(t,n){const r=SJ(t,this.suggestions.length),o=this.suggestions[this.selectedItem],a=this.suggestions[r];o?.removeClass("is-selected"),a?.addClass("is-selected"),this.selectedItem=r,n&&a.scrollIntoView(!1)}}class i6{inputEl;popper;scope;suggestEl;suggest;cb;constructor(t,n){this.inputEl=t,this.scope=new A.Scope,this.cb=n,this.suggestEl=createDiv("suggestion-container");const r=this.suggestEl.createDiv("suggestion");this.suggest=new TJ(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",o=>{o.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=r6(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:o})=>{const a=`${r.rects.reference.width}px`;r.styles.popper.width!==a&&(r.styles.popper.width=a,o.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){app.keymap.popScope(this.scope),this.suggest.se
Line truncated
|
||||
`:""}${F}`:`${F} ${M?`
|
||||
`:""}${E.map(R=>`#${R}`).join(" ")}`),O&&O.content!==F){const R=await le.updateMemo(O.id,F?.trim());k.push(R)}}k.length>0&&le.editMemoBulk(k),k.length>0&&Ye.clearQuery()};return g.jsxs("div",{className:"thino-tag-operation",children:[g.jsx("div",{className:"tag-operation-title",children:I("Tag Bulk Edit")}),g.jsxs("div",{className:"tag-operation-content",children:[r.length>0&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"tag-operation-content-title exist-tags",children:[g.jsx("div",{className:"name",children:I("Exist Tags")}),g.jsx("div",{className:"desc",children:I("Click to remove exist tag")})]}),g.jsx("div",{className:"tag-operation-content-tags exist-tags",children:r.map(x=>g.jsx("div",{className:qt("tag-operation-content-tag",s.includes(x)&&"tag-operation-content-tag-removed"),onClick:()=>{s.includes(x)||l([...s,x]),s.includes(x)&&l(s.filter(E=>E!==x)),a.includes(x)&&i(a.filter(E=>E!==x))},children:x},x))})]}),g.jsxs("div",{className:"tag-operation-content-title selected-tags",children:[g.jsx("div",{className:"name",children:I("Selected Tags")}),g.jsx("div",{className:"desc",children:I("Click to remove selected tag")})]}),g.jsx("div",{className:"tag-operation-content-tags selected-tags",children:a.map(x=>g.jsx("div",{className:"tag-operation-content-tag",onClick:()=>{i(a.filter(E=>E!==x))},children:x},x))}),g.jsx("div",{className:"tag-operation-content-inputer",children:g.jsx("input",{placeholder:I("Input to select exist tag"),ref:w,onKeyDown:x=>{x.key==="Enter"&&b(w.current.value)}})}),g.jsxs("div",{className:"tag-operation-settings",children:[g.jsx("div",{ref:f}),g.jsx("div",{ref:h})]}),g.jsxs("div",{className:"tag-operation-content-btn-group",children:[g.jsx("button",{className:"cancel-btn",onClick:n,children:I("Cancel")}),g.jsx("button",{className:"save-btn",onClick:y,children:I("Save")})]})]})]})},MI=new Map,_l=async(e,t=!0)=>{const{vault:n,metadataCache:r}=Ze.getState().app;if(t&&MI.has(e))return Promise.resolve(MI.get(e));if(e.contains("data:image"))return e;let o;const a=await n.adapter.exists(A.normalizePath(e));let i="";try{if(!a&&!/(http|https)/g.test(e)&&!e.includes("data:image")){let s;if(e.startsWith("app://")){const l=A.normalizePath(decodeURIComponent(e).replace(A.Platform.resourcePathPrefix,"").replace(/\?(.*)$/,"").replace(A.normalizePath(app?.vault.adapter.basePath),""));i=A.normalizePath(decodeURIComponent(l))}else{if(s=r.getFirstLinkpathDest(e,""),!s){new A.Notice(I("File not exist"));return}i=s.path}}else i=e}catch(s){console.error(s)}if(i){if(/(http|https)/g.test(i))if(i.startsWith("http://localhost")){let s=i;s=s.replace("http://localhost/_capacitor_file_",""),s=decodeURIComponent(s).replace(/\?(.*)$/,"").replace(app?.vault.adapter.basePath,""),s=A.normalizePath(decodeURIComponent(s));const l=await n.adapter.readBinary(s),u=new Uint8Array(l);o=new Blob([u],{type:"image/png"})}else try{const s=await A.requestUrl(e),l=new Uint8Array(s.arrayBuffer);o=new Blob([l],{type:"image/png"})}catch{}else if(i){const s=await n.adapter.readBinary(i),l=new Uint8Array(s);o=new Blob([l],{type:"image/png"})}return o?await MJ(o,e):""}},MJ=(e,t)=>new Promise(n=>{const r=new FileReader;r.onloadend=()=>{const o=r.result;MI.set(t,o),n(o)},r.readAsDataURL(e)}),mp=async e=>{if(!e.style.backgroundImage.includes("url(")&&!e.style.backgroundImage.includes("http"))return;let t=e.style.backgroundImage.includes("url(")?e.style.backgroundImage.slice(5,-2):e.style.backgroundImage;return t?(t.startsWith("http://localhost")&&(t=t.replace("http://localhost/_capacitor_file_",""),t=decodeURIComponent(t).replace(/\?(.*)$/,"").replace(app?.vault.adapter.basePath,""),t=A.normalizePath(decodeURIComponent(t))),await _l(t)):void 0},DJ=async e=>e.getAttribute("src")?e?.src?.startsWith("http://localhost")?await _l(e.getAttribute("path")||A.normalizePath(e?.parentElement.getAttribute("src"))):await _l(e.getAttribute("src")):void 0,gt=BJ(),wb=_J(),s6=YJ(),l6=UJ(),Nc={copyDefaultStyles:!0,imagePlaceholder:void 0,cacheBust:!1,useCredentials:!1,httpTimeout:3e4,styleCaching:"strict",corsImg:void 0},Pt={toSvg:c6,toPng:OJ,toJpeg:PJ,toBlob:jJ,toPixelData:NJ,toCanvas:LJ,impl:{fontFaces:s6,images:l6,util:gt,inliner:wb,urlCache:[],options:{}}},CC=(typeof Node<"u"?Node.ELEMENT_NODE:void 0)||1,Vy=(typeof global<"u"?global.getComputedStyle:void 0)||(typeof window<"u"?window.getComputedStyle:void 0)||globalThis.getComputedStyle,AJ=(typeof global<"u"?global.atob:void 0)||(typeof window<"u"?window.atob:void 0)||globalThis.atob;function c6(e,t){Pt.impl.util.getWindow(e),t=t||{},RJ(t);let n=[];return Promise.resolve(e).then(r).then(function(l){return u6(l,t,null)}).then(FJ).then(HJ).then(i).then(s).then(o).then(a);function r(l){if(l.nodeType===CC)return l;const u=l,f=l.parentNode,h=document.createElement("span");return f.replaceChild(h,u),h.append(l),n.push({parent:f,child:u,wrapper:h}),h}function o(l){for(;n.length>0;){const u=n.pop();u.parent.replaceChild(u.child,u.wrapper)}return l}function a(l){return Pt.impl.urlCache=[],qJ(),l}fuLine truncated
|
||||
`)})}function t(){return Promise.resolve(gt.asArray(document.styleSheets)).then(r).then(n).then(function(a){return a.map(o)});function n(a){return a.filter(function(i){return i.type===CSSRule.FONT_FACE_RULE}).filter(function(i){return wb.shouldProcess(i.style.getPropertyValue("src"))})}function r(a){const i=[];return a.forEach(function(s){if(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(s),"cssRules"))try{gt.asArray(s.cssRules||[]).forEach(i.push.bind(i))}catch(l){console.error(`domtoimage: Error while reading CSS rules from ${s.href}`,l.toString())}}),i}function o(a){return{resolve:function(){const s=(a.parentStyleSheet||{}).href;return wb.inlineAll(a.cssText,s)},src:function(){return a.style.getPropertyValue("src")}}}}}function UJ(){return{inlineAll:t,impl:{newImage:e}};function e(n){return{inline:r};function r(o){return gt.isDataUrl(n.src)?Promise.resolve():Promise.resolve(n.src).then(o||gt.getAndEncode).then(function(a){return new Promise(function(i){n.onload=i,n.onerror=i,n.src=a})})}}function t(n){if(!gt.isElement(n))return Promise.resolve(n);return r(n).then(function(){return gt.isHTMLImageElement(n)?e(n).inline():Promise.all(gt.asArray(n.childNodes).map(function(o){return t(o)}))});function r(o){const i=["background","background-image"].map(function(s){const l=o.style.getPropertyValue(s),u=o.style.getPropertyPriority(s);return l?wb.inlineAll(l).then(function(f){o.style.setProperty(s,f,u)}):Promise.resolve()});return Promise.all(i).then(function(){return o})}}}function zJ(e,t,n,r){const o=["background-clip"].indexOf(t)>=0;r?(e.setProperty(t,n,r),o&&e.setProperty(`-webkit-${t}`,n,r)):(e.setProperty(t,n),o&&e.setProperty(`-webkit-${t}`,n))}function VJ(e,t,n,r,o){const a=Pt.impl.options.copyDefaultStyles?GJ(e,t):{},i=o.style;gt.asArray(n).forEach(function(s){const l=n.getPropertyValue(s),u=a[s],f=r?r.getPropertyValue(s):void 0;if(l!==u||r&&l!==f){const h=n.getPropertyPriority(s);zJ(i,s,l,h)}})}let Qv=null,Wy={};const WJ=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"];function GJ(e,t){const n=s(t),r=l(n);if(Wy[r])return Wy[r];const o=ZJ(),a=u(o.document,n),i=f(o,a);return h(a),Wy[r]=i,i;function s(p){const m=[];do{if(p.nodeType===CC){const w=p.tagName;if(m.push(w),WJ.includes(w))break}p=p.parentNode}while(p);return m}function l(p){return e.styleCaching==="relaxed"?p.filter((m,w,b)=>w===0||w===b.length-1).join(">"):p.join(">")}function u(p,m){let w=p.body;do{const b=m.pop(),y=p.createElement(b);w.appendChild(y),w=y}while(m.length>0);return w.textContent="",w}function f(p,m){const w={},b=p.getComputedStyle(m);return gt.asArray(b).forEach(function(y){w[y]=y==="width"||y==="height"?"auto":b.getPropertyValue(y)}),w}function h(p){do{const m=p.parentElement;m!==null&&m.removeChild(p),p=m}while(p&&p.tagName!=="BODY")}}function ZJ(){if(Vo)return Vo.contentWindow;const e=document.characterSet||"UTF-8",t=document.doctype,n=t?`<!DOCTYPE ${r(t.name)} ${r(t.publicId)} ${r(t.systemId)}`.trim()+">":"";return Vo=document.createElement("iframe"),Vo.id="domtoimage-sandbox-"+gt.uid(),Vo.className="domtoimage-thino",Vo.style.visibility="hidden",Vo.style.position="fixed",document.body.appendChild(Vo),o(Vo,n,e,"domtoimage-sandbox");function r(a){if(a){const i=document.createElement("div");return i.innerText=a,i.innerHTML}else return""}function o(a,i,s,l){try{return a.contentWindow.document.write(`${i}<html><head><meta charset='${s}'><title>${l}</title></head><body></body></html>`),a.contentWindow}catch{}const u=document.createElement("meta");u.setAttribute("charset",s);try{const f=document.implementation.createHTMLDocument(l);f.head.appendChild(u);const h=i+f.documentElement.outerHTML;return a.setAttribute("srcdoc",h),a.contentWindow}catch{}return a.contentDocument.head.appendChild(u),a.contentDocument.title=l,a.contentWindow}}function qJ(){Vo&&(document.body.removeChild(Vo),Vo=null),Qv&&clearTimeout(Qv),Qv=setTimeout(()=>{Qv=null,Wy={}},20*1e3)}async function KJ(e,t,n){return await Pt.toCanvas(e,{width:e.clientWidth,height:e.clientHeight,quality:1,scale:2,requestUrl:A.requestUrl,type:n})}const l0=async(e,t)=>(await KJ(e,!0,"image/jpeg")).toDataURL(),hO=async e=>{e.startsWith("http")&&(e=await _l(e));const t=e.split("base64,")[1],n=Jw(t,"image/png");await d6(n),new A.Notice(I("Send to clipboard successfully"))},$J=async(e,t)=>{const n=await e.vault.adapter.exists(t);let r="";if(n)r=t;else{const s=e.metadataCache.getFirstLinkpathDest(t,"");if(!s){new A.Notice(I("File not exist"));return}r=s.path}const o=await e.vault.adapter.readBinary(r),a=new Uint8Array(o),i=new Blob([a],{type:"image/png"});await d6(i)},d6=async e=>{const t=new ClipboardItem({"image/png":e});await window.navigator.clipboard.write([t])},pO=1.1,mO=300,gO=20,XJ=({destroy:e,imgUrl:t,filepath:n,otherIMGEls:r,currentIndLine truncated
|
||||
|
||||
Before: <div {...getCollapseProps({style: {padding: 10}})}>{children}</div>
|
||||
|
||||
After: <div {...getCollapseProps()}>
|
||||
<div style={{padding: 10}}>
|
||||
{children}
|
||||
</div>
|
||||
</div>`)},D.useEffect(()=>{t(e)},[e])}var fQ=typeof window>"u"?D.useEffect:D.useLayoutEffect;function hQ({duration:e,easing:t="cubic-bezier(0.4, 0, 0.2, 1)",onTransitionStateChange:n=()=>{},isExpanded:r,defaultExpanded:o=!1,hasDisabledAnimation:a,id:i,...s}={}){const l=f6(n),u=sQ(i?`${i}`:void 0),[f,h]=QJ(r,o),p=D.useRef(f),[m,w]=D.useState(!1),b=tQ(),y=a??b,S=D.useRef(),x=D.useRef(),E=D.useRef(null),[C,M]=D.useState(null);dQ(E);const k=`${s.collapsedHeight||0}px`;function O(F){if(!E.current)return;const R=E.current;for(const B in F){const Y=F[B];Y?R.style[B]=Y:R.style.removeProperty(B)}}return fQ(()=>{if(!E.current||f===p.current)return;p.current=f;function R(H){return y?0:e??cQ(H)}const B=H=>`height ${R(H)}ms ${t}`,Y=H=>{function Z(){f?(O({height:"",overflow:"",transition:"",display:""}),l("expandEnd")):(O({transition:""}),l("collapseEnd")),w(!1)}x.current&&yO(x.current),x.current=lQ(Z,H)};return w(!0),f?S.current=requestAnimationFrame(()=>{l("expandStart"),O({display:"block",overflow:"hidden",height:k}),S.current=requestAnimationFrame(()=>{l("expanding");const H=bO(E);Y(R(H)),E.current&&(E.current.style.transition=B(H),E.current.style.height=`${H}px`)})}):S.current=requestAnimationFrame(()=>{l("collapseStart");const H=bO(E);Y(R(H)),O({transition:B(H),height:`${H}px`}),S.current=requestAnimationFrame(()=>{l("collapsing"),O({height:k,overflow:"hidden"})})}),()=>{S.current&&cancelAnimationFrame(S.current),x.current&&yO(x.current)}},[f,k,y,e,t,l]),{isExpanded:f,setExpanded:h,getToggleProps(F){const{disabled:R,onClick:B,refKey:Y,...H}={refKey:"ref",onClick(){},disabled:!1,...F},Z=C?C.tagName==="BUTTON":void 0,W=F?.[Y||"ref"],K={id:`react-collapsed-toggle-${u}`,"aria-controls":`react-collapsed-panel-${u}`,"aria-expanded":f,onClick(Q){R||(B?.(Q),h(te=>!te))},[Y||"ref"]:wO(W,M)},V={type:"button",disabled:R?!0:void 0},ne={"aria-disabled":R?!0:void 0,role:"button",tabIndex:R?-1:0};return Z===!1?{...K,...ne,...H}:Z===!0?{...K,...V,...H}:{...K,...V,...ne,...H}},getCollapseProps(F){const{style:R,refKey:B}={refKey:"ref",style:{},...F},Y=F?.[B||"ref"];return{id:`react-collapsed-panel-${u}`,"aria-hidden":!f,"aria-labelledby":`react-collapsed-toggle-${u}`,role:"region",...F,[B||"ref"]:wO(E,Y),style:{boxSizing:"border-box",...!m&&!f?{display:k==="0px"?"none":"block",height:k,overflow:"hidden"}:{},...R}}}}}const h6=D.memo(({memoId:e,showOutgoingLinks:t=!0,showIncomingLinks:n=!0})=>{const[r,o]=D.useState([]),[a,i]=D.useState([]),[s,l]=D.useState(null),[u,f]=D.useState(!1),[h,p]=D.useState(!1),m=D.useRef(null);D.useEffect(()=>{!s&&!u&&!h&&(f(!0),(async()=>{const y=le.getMemoById(e);y&&l(y),f(!1)})())},[e,s,u,h]),D.useEffect(()=>{s&&!h&&!u&&(f(!0),(async()=>{try{if(t){const y=[],S=[...s.content.matchAll(yu)];for(const E of S)if(E&&E.length===3){const C=E[2],M=le.getMemoById(C);M&&y.push({...M,createdAtStr:je.getDateTimeString(M.createdAt),dateStr:je.getDateString(M.createdAt)})}const x=Qw(s.content);for(const E of x){const[C,M]=E.split("#^"),k=M;if(C&&k){const O=await le.getLinkedMemoByBlockId(k,C);O&&(y.some(F=>F.id===O.id)||y.push({...O,createdAtStr:je.getDateTimeString(O.createdAt),dateStr:je.getDateString(O.createdAt)}))}}o([...y])}if(n){const y=await le.getLinkedMemos(s.id);let S=[];s.hasId&&s.path&&(S=await le.getLinkedMemosByLinkId(s.hasId,s.path));const x=[...y,...S],E=Array.from(new Map(x.map(C=>[C.id,C])).values());i(E.sort((C,M)=>je.getTimeStampByDate(M.createdAt)-je.getTimeStampByDate(C.createdAt)).map(C=>({...C,createdAtStr:je.getDateTimeString(C.createdAt),dateStr:je.getDateString(C.createdAt)})))}p(!0)}catch(y){console.error("Error fetching linked memos:",y)}f(!1)})())},[s,t,n,h,u]);const w=D.useCallback(b=>{Ja(b)},[]);return g.jsxs("div",{className:qt("reference-links-group",u?"loading":"loaded"),ref:m,children:[u&&g.jsx("div",{className:"links-loading",children:g.jsx("span",{className:"loading-text",children:I("Loading...")})}),h&&g.jsxs(g.Fragment,{children:[t&&r.length>0&&g.jsx("div",{className:"links-section outgoing-links",children:g.jsx("div",{className:"links-list",children:r.map(b=>{const y=sb(zp(b.content)).replaceAll(`
|
||||
`," ");return g.jsxs("div",{"aria-label":`${I("Linked")} ${b.content}`,className:"link-item",onClick:()=>w(b),children:[g.jsx("div",{className:"link-icon",ref:S=>S&&A.setIcon(S,"circle-dot")}),g.jsxs("div",{className:"link-date",children:[b.dateStr,":"]}),g.jsx("div",{className:"link-content",children:y})]},b.id)})})}),n&&a.length>0&&g.jsx("div",{className:"links-section incoming-links",children:g.jsx("div",{className:"links-list",children:a.map(b=>{const y=sb(zp(b.content)).replaceAll(`
|
||||
`," ");return g.jsxs("div",{"aria-label":`${I("Linked by")} ${b.content}`,className:"link-item",onClick:()=>w(b),children:[g.jsx("div",{className:"link-icon",ref:S=>S&&A.setIcon(S,"circle-dot-dashed")}),g.jsxs("div",{className:"link-date",children:[b.dateStr,":"]}),g.jsx("div",{className:"link-content",children:y})]},b.id)})})}),h&&!u&&r.length===0&&a.length===0&&null]})]})},(e,t)=>e.memoId===t.memoId&&e.showIncomingLinks===t.showIncomingLinks&&e.showOutgoingLinks===t.showOutgoingLinks),pQ=e=>{const{dailyNotesState:{app:t,view:n,settings:r},globalState:{memoListView:o}}=D.useContext(it),{getCollapseProps:a,getToggleProps:i,isExpanded:s,setExpanded:l}=hQ({defaultExpanded:!0,collapsedHeight:r?.ThinoCollapsedHeight??100}),{memo:u,handleMemoContentClick:f,handleMemoDoubleClick:h}=e,p=_.useRef(null),[m,w]=_.useState(""),b=_.useRef(m),y=_.useRef(0),[S,x]=_.useState(!1),[E,C]=_.useState(!1),M=A.debounce((O,F,R)=>{for(const B of O){const{height:Y}=B.contentRect,H=F?.ThinoMaxHeight||340,Z=Y>H;x(Z),l(!Z),R.disconnect()}},500);D.useEffect(()=>{if(u.content!==b.current){if(r?.OptimizeForCallout&&u.content.split("> [!").length>3&&u.content.split(`
|
||||
`).length>10&&!E){const O=p.current.createEl("button");O.setText(I("Render content")),O.onclick=async()=>{C(!0),await k()};const F=p.current.createEl("textarea");F.setText(u.content),F.disabled=!0,p.current?.toggleClass(["raw-content"],!0),l(!0),x(!1);return}k()}},[u.content]),D.useEffect(()=>{E&&y.current!==r?.ThinoMaxHeight&&(p?.current.hasChildNodes()&&C(!1),k())},[r?.ThinoMaxHeight]),D.useEffect(()=>{if(!E)return;const O=p.current;if(!O)return;if(!r?.ThinoMaxHeight){l(!0),x(!1);return}const F=new ResizeObserver(R=>{M(R,r,F)});return F.observe(O),()=>F.disconnect()},[E]);const k=async()=>{p.current&&n&&t&&u.content!==b.current&&(p.current.empty(),await A.MarkdownRenderer.render(t,u.content,p.current,u.path,n),p.current?.querySelectorAll(".internal-link")?.forEach(F=>{const R=F,B=R.getAttribute("data-href");if(!B)return;t.metadataCache.getFirstLinkpathDest(B,u.path)||F.classList.add("is-unresolved"),R.addEventListener("mouseover",H=>{H.stopPropagation(),t.workspace.trigger("hover-link",{event:H,source:"thino",hoverParent:n.containerEl,targetEl:R,linktext:B,sourcePath:R.href})})})),b.current=u.content,p.current?.toggleClass(["markdown-rendered"],!0),p.current?.toggleClass(["raw-content"],!1),C&&C(!0),y.current=r?.ThinoMaxHeight||340};return g.jsxs(g.Fragment,{children:[S&&o==="moments"&&g.jsxs(g.Fragment,{children:[g.jsx("button",{className:"thino-collapse-button",...i({style:{display:"block",marginTop:2}}),children:I(s?"Collapse":"Expand")}),!s&&r?.ThinoCollapsedHeight!==0&&g.jsx("div",{className:"thino-collapse-shadowOverlay",onDoubleClick:h})]}),g.jsx("div",{...a({style:{margin:0}}),ref:p,className:"memo-content-text",onClick:O=>f(O,u),onDoubleClick:h,onContextMenu:O=>{O.preventDefault()}}),o==="list"&&r?.enableReferenceLinksGroup&&g.jsx(h6,{memoId:u.id}),S&&o!=="moments"&&g.jsxs(g.Fragment,{children:[!s&&r?.ThinoCollapsedHeight!==0&&g.jsx("div",{className:"thino-collapse-shadowOverlay",onDoubleClick:h}),g.jsx("button",{className:"thino-collapse-button",...i({style:{display:"block",marginTop:2}}),children:I(s?"Collapse":"Expand")})]})]})},p6=D.memo(pQ,(e,t)=>e.memo.content===t.memo.content),mQ=e=>{const[t,n]=D.useState({...e.memo,createdAtStr:je.getDateTimeString(e.memo.createdAt)}),[r,o]=D.useState([]),[a,i]=D.useState([]);D.useEffect(()=>{(async()=>{try{const h=[],p=[...t.content.matchAll(yu)];for(const x of p)if(x&&x.length===3){const E=x[2],C=le.getMemoById(E);C&&h.push({...C,createdAtStr:je.getDateTimeString(C.createdAt),dateStr:je.getDateString(C.createdAt)})}const m=Qw(t.content);for(const x of m){const[E,C]=x.split("#^"),M=C;if(E&&M){const k=await le.getLinkedMemoByBlockId(M,E);k&&(h.some(O=>O.id===k.id)||h.push({...k,createdAtStr:je.getDateTimeString(k.createdAt),dateStr:je.getDateString(k.createdAt)}))}}o([...h]);const w=await le.getLinkedMemos(t.id);let b=[];t.hasId&&t.path&&(b=await le.getLinkedMemosByLinkId(t.hasId,t.path));const y=[...w,...b],S=Array.from(new Map(y.map(x=>[x.id,x])).values());i(S.sort((x,E)=>je.getTimeStampByDate(E.createdAt)-je.getTimeStampByDate(x.createdAt)).map(x=>({...x,createdAtStr:je.getDateTimeString(x.createdAt),dateStr:je.getDateString(x.createdAt)})))}catch(h){console.error("Error fetching linked memos:",h)}})()},[t.id,t.hasId,t.path]);const s=D.useCallback(async f=>{const h=f.target;if(h.className==="memo-link-text"){const p=h.dataset?.value,m=le.getMemoById(p??"");if(m){const w={...m,createdAtStr:je.getDateTimeString(m.createdAt)};o([]),i([]),n(w)}else new A.Notice(I("Thino not found")),h.classList.remove("memo-link-text")}},[]),l=D.useCallback(f=>{o([]),i([]),n({...f,createdAtStr:je.getDateTimeString(f.createdAt)})},[t.id]),u=D.useCallback(()=>{e.destroy(),Ge.setEditMemoId(t.id)},[t.id]);return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"memo-card-container",children:[g.jsxs("div",{className:"header-container",children:[g.jsx("span",{className:"time-text",children:t.createdAtStr}),g.jsxs("div",{className:"btns-container",children:[g.jsx("button",{ref:f=>{f&&A.setIcon(f,"edit")},className:"btn edit-btn",onClick:u}),g.jsx("button",{ref:f=>{f&&A.setIcon(f,"x")},className:"btn close-btn",onClick:e.destroy})]})]}),g.jsx("div",{className:"memo-container",children:g.jsx("div",{className:"memo-content-text",children:g.jsx(p6,{memo:t,handleMemoContentClick:s,handleMemoDoubleClick:()=>{}})})}),g.jsx("div",{className:"layer-container"})]}),r.length>0?g.jsxs("div",{className:"linked-memos-wrapper",children:[g.jsxs("span",{className:"normal-text",children:[I("LINKED")," ",r.length," THINO"," "]}),r.map(f=>{const h=sb(zp(f.content)).replaceAll(`
|
||||
`," ");return g.jsxs("div",{className:"linked-memo-container",onClick:()=>l(f),children:[g.jsxs("span",{className:"time-text",children:[f.dateStr," "]}),h]},f.id)})]}):null,a.length>0?g.jsxs("div",{className:"linked-memos-wrapper",children:[g.jsxs("span",{className:"normal-text",children:[a.length," THINO ",I("LINK TO THE")," THINO"]}),a.map(f=>{const h=sb(zp(f.content)).replaceAll(`
|
||||
`," ");return g.jsxs("div",{className:"linked-memo-container",onClick:()=>l(f),children:[g.jsxs("span",{className:"time-text",children:[f.dateStr," "]}),h]},f.id)})]}):null]})};function Ja(e){e0({className:"memo-card-dialog"},mQ,{memo:e})}function gQ({mouseEnterDelayMS:e=0,mouseLeaveDelayMS:t=0}={}){const[n,r]=D.useState(!1);let o,a;return[n,{onMouseEnter:()=>{clearTimeout(a),o=window.setTimeout(()=>r(!0),e)},onMouseLeave:()=>{clearTimeout(o),a=window.setTimeout(()=>r(!1),t)}}]}const vQ=e=>{const{memo:t,memoListView:n,handlePinMemoClick:r,handleFixMemoClick:o,handleSourceMemoClick:a,handleShowMemoStoryDialog:i,handleCopyMemoClick:s,handleEditMemoClick:l,handleGenMemoImageBtnClick:u,handleMarkMemoClick:f,handleArchiveMemo:h,handleDeleteMemoClick:p,handleSplitMemoClick:m,handleCopyEmbedLink:w,handleReferenceLinksGroupClick:b}=e,y=Ye.getState().query.tag,S=Se.getState().dailyNotesState.settings,x=S.EnabledLocationList.find(Z=>Z.value==="MULTI"),[E,C]=Nf(!1),M=D.useRef(null),k={pinRef:D.useRef(null),fixRef:D.useRef(null),typeRef:D.useRef(null),referenceLinksGroupRef:D.useRef(null),moreRef:D.useRef(null)},[O,F]=gQ({mouseEnterDelayMS:500}),R=D.useRef();D.useEffect(()=>{if(!k.typeRef)return;const Z=Up.find(W=>W.title===t.sourceType);A.setIcon(k.typeRef.current,Z.icon),A.requireApiVersion("1.4.4")&&A.setTooltip(k.typeRef.current,t.path),k.fixRef&&(A.setIcon(k.fixRef.current,"shield-alert"),A.requireApiVersion("1.4.4")&&A.setTooltip(k.fixRef.current,"Update Thino property")),k.referenceLinksGroupRef&&S?.enableReferenceLinksGroup&&(A.setIcon(k.referenceLinksGroupRef.current,"link"),A.requireApiVersion("1.4.4")&&A.setTooltip(k.referenceLinksGroupRef.current,"Reference links group"))},[k.typeRef,k.referenceLinksGroupRef]),D.useEffect(()=>{k.pinRef&&(t.pinned?(A.setIcon(k.pinRef.current,"pin-off"),A.requireApiVersion("1.4.4")&&A.setTooltip(k.pinRef.current,I("UNPIN"))):(A.setIcon(k.pinRef.current,"pin"),A.requireApiVersion("1.4.4")&&A.setTooltip(k.pinRef.current,I("PIN"))))},[k.pinRef,t.pinned]);const B=A.debounce(()=>{if(O&&k.moreRef.current){if(R.current&&R.current._loaded||R.current?.useNativeMenu||document.body.find(".more-action-btns-wrapper"))return;const Z=Y(),W=k.moreRef.current.getBoundingClientRect();Z.showAtPosition({x:W.left,y:W.bottom})}},200);D.useEffect(()=>{B()},[O]);const Y=()=>{const Z=new A.Menu;return Z.dom.toggleClass(["more-action-btns-wrapper"],!0),Z.useNativeMenu?(Z.setNoIcon(),Z.addItem(W=>{W.setTitle(I("COPY")).onClick(s)}),Z.addItem(W=>{W.setTitle(I("EDIT")).onClick(l)}),Z.addItem(W=>{W.setTitle(I("SHARE")).onClick(u)})):Z.addItem(W=>{const K=W.dom;W.dom.empty(),W.dom.toggleClass(["more-action-btn-group","more-action-menu-item"],!0);const V=K.createEl("span");new A.ExtraButtonComponent(V).setIcon("copy"),V.toggleClass(["menu-item-icon","more-action-item-icon"],!0),V.onclick=te=>{te.stopPropagation(),te.preventDefault(),s(),Z.close()};const ne=K.createEl("span");ne.toggleClass(["menu-item-icon","more-action-item-icon"],!0),ne.onclick=te=>{te.stopPropagation(),te.preventDefault(),l(),Z.close()},new A.ExtraButtonComponent(ne).setIcon("pencil");const Q=K.createEl("span");Q.toggleClass(["menu-item-icon","more-action-item-icon"],!0),Q.onclick=te=>{te.stopPropagation(),te.preventDefault(),u(),Z.close()},new A.ExtraButtonComponent(Q).setIcon("share-2")}),Z.addSeparator(),t.sourceType==="DAILY"&&(Z.addItem(W=>{W.setIcon("copy").setTitle(I("Copy embed link")).onClick(()=>{w(!0)})}),Z.addItem(W=>{W.setIcon("copy").setTitle(I("Copy link")).onClick(()=>{w(!1)})}),Z.addSeparator()),Z.addItem(W=>{W.setIcon("book-open").setTitle(I("READ")).onClick(()=>i(new MouseEvent("click")))}),Z.addItem(W=>{W.setIcon("bookmark").setTitle(I("MARK")).onClick(f)}),/(^|\n)#{1,6}\s/g.exec(t.content)?.length>1&&x&&Z.addItem(W=>{W.setIcon("separator-horizontal").setTitle(I("SPLIT")).onClick(m)}),Z.addItem(W=>{W.setIcon("home").setTitle(I("SOURCE")).onClick(()=>a(t))}),Z.addSeparator(),Z.addItem(W=>{W.setWarning(!0).setIcon("archive").setTitle(I("ARCHIVE").toUpperCase()).onClick(()=>h(t))}),Z.addItem(W=>{W.setWarning(!0).setIcon("trash").setTitle(S.DeleteThinoDirectly?I("DELETE"):I("TRASH BOX").toUpperCase().toUpperCase()).onClick(K=>{if(Z.useNativeMenu)p(),Z.close();else if(K.stopPropagation(),K.preventDefault(),!E){C(!0),W.setTitle(I("CONFIRM!")).onClick(V=>{p(),Z.close()});return}})}),Z.addSeparator(),Z.addItem(W=>{W.setDisabled(!0).setTitle(je.getWordCount(t.content.replace(/```[^\S\r\n]*[a-z]*\n.*?\n```/g,""))+` ${I("words")}`)}),Z.onHide(()=>{C(!1)}),R.current=Z,Z},H=Z=>{Y().showAtMouseEvent(Z.nativeEvent)};return g.jsxs("div",{ref:M,className:"memo-top-right-wrapper",children:[y&&S.FilterByMetadata?t.content.includes(y)?g.jsx("span",{className:"tag-text tag-in-content",children:I("Matched via tag in content")}):t.fileInfo?.tags.includes(y)?g.jsx("span",{className:"tag-text tag-in-file",children:I("Matched via tag in file")}):null:null,g.jsxs("div",{className:"btns-container",children:[g.jsx("span",{ref:k.fixRef,classNam
Line truncated
|
||||
`),o=new Array(n).join("#")+" ",a=new Array(n+1).join("#")+" ",i=[];let s=[];return r.forEach((l,u)=>{l.startsWith(a)?(s.length>0&&(i.push(s),s=[]),s.push(l)):s.length>0&&!l.startsWith(o)?s.push(l):s.length>0&&(i.push(s),s=[]),u===r.length-1&&s.length>0&&i.push(s)}),i}onChooseSuggestion(t,n){this.selectSuggestion(t,n)}renderSuggestion(t,n){n.setText(t.title)}getSuggestions(){return[{id:"splitByHeading1",title:I("Split by Heading 1")},{id:"splitByHeading2",title:I("Split by Heading 2")},{id:"splitByHeading3",title:I("Split by Heading 3")}]}async selectSuggestion(t,n){let r=[];if(t.id==="splitByHeading1"?r=this.contentSplitByHeading(this.thino.content,1):t.id==="splitByHeading2"?r=this.contentSplitByHeading(this.thino.content,2):t.id==="splitByHeading3"&&(r=this.contentSplitByHeading(this.thino.content,3)),r.length===0){new A.Notice("No headings found"),this.close();return}const o=this.ensureUniqueFileNames(r);for(const s of r){const l=r.indexOf(s),u=await le.createThino({content:s.join(`
|
||||
`),name:o[l],type:"MULTI",isList:!0});le.pushMemo(u)}let a=this.thino.content;r.forEach((s,l)=>{a=a.replace(s.join(`
|
||||
`),`[[${o[l]}]]`)});const i=await le.updateMemo(this.thino.id,a);i&&le.editMemo(i),this.close()}}const wQ=async(e,t,n)=>{const r=n.getAttribute("href"),o=n.className;if(o.contains("tag"))SQ(n.innerText.slice(1));else if(o.contains("internal-link")){const a=n.getAttribute("data-href"),i=le.getMemoById(a??"");i?Ja(i):await e.workspace.openLinkText(a,a,!A.Platform.isMobile&&t.navigation!==!0)}else r&&window.open(r,"_blank")},SQ=e=>{const t=Ye.getState().query.tag;Ye.setTagQuery(t.contains(",")?t.split(",").includes(e)?t.split(",").filter(n=>n!==e).join(","):t+","+e:t===e?"":e)},TQ=(e,t)=>{const n=t?.getAttribute("src"),r=t?.parentElement.getAttribute("src"),o=[...e?.querySelectorAll("img")||[]],a=o.indexOf(t);Wd({imgUrl:n,filepath:n.startsWith("app")?r:void 0,otherIMGEls:o,currentIndex:a})},xQ=e=>{const t=e.dataset?.value,n=le.getMemoById(t??"");n?Ja(n):(new A.Notice("Thino Not Found"),e.classList.remove("memo-link-text"))},IQ=async(e,t,n,r)=>{const o=e?.AppendDateWhenTaskDone?" ✅ "+A.moment().format("YYYY-MM-DD"):"",a=r.parentElement.dataset?.task==="x"?"DONE":"TODO",i=[...n?.querySelectorAll("li.task-list-item")||[]];for(const s of i)if(s===r||s===r.closest("li.task-list-item")){const l=i.indexOf(s),u=t.content.split(/\n/),f=[];for(let y=0;y<u.length;y++)/^\s*(-|\*|\d+\.)\s\[.\]\s/.test(u[y])&&f.push(y);const h=f[l],p=u[h],m=p.match(/^\s*(-|\*|\d+\.)\s\[.\]\s/)[0];let w=p.replace(/^\s*(-|\*|\d+\.)\s\[.\]\s/,m.replace(/\[.\]/,a==="TODO"?"[x]":"[ ]"))+(a==="TODO"?o:"");e.AppendDateWhenTaskDone&&a!=="TODO"&&(w=w.replace(/ ✅ \d{4}-\d{2}-\d{2}/g,"")),u[h]=w;const b=u.join(`
|
||||
`).trim();if(t&&t.content!==b){const y=await le.updateMemo(t.id,b);le.editMemo(y)}}},kQ=e=>{const{globalState:{editMemoId:t,memoListView:n},dailyNotesState:{app:r,view:o,settings:a,verifyState:i},locationState:{pathname:s}}=D.useContext(it),{memo:l,type:u="inline"}=e,f=D.useRef(null),h=D.useRef(null),[p,m]=D.useState(!1),w=D.useRef(null),[b,y]=D.useState(!1);D.useEffect(()=>{p&&setTimeout(()=>{Ge.setEditMemoId(l.id)},100)},[p]),D.useEffect(()=>{(s==="/review"||s==="/daily")&&t!==l.id&&p&&m(!1)},[t]),D.useEffect(()=>{w.current&&!b&&f.current&&(r.dragManager.handleDrag(w.current,ee=>{r.dragManager.updateSource([f.current],"is-dragging");const ie=le.getMemoById(l.id);if(ee.dataTransfer.setData("text/plain",l.content),ee.dataTransfer.setData("text/uri-list",l.content),ee.dataTransfer.setData("Text",l.content),a?.DraggingBehavior==="block-link")if(ie?.sourceType==="DAILY"){const fe=r.vault.getFileByPath(ie.path);let he=ie.hasId;return ie.hasId||(he=je.randomId(6),Zo(ie,{id:ie.id,hasId:he})),{type:"link",icon:"lucide-link",title:fe.basename,linktext:`${ie.path}#^${he}`,sourcePath:ie.path,file:fe,memo:ie,blockId:he,source:"thino-plugin"}}else return null;else if(a?.DraggingBehavior==="text")return null}),y(!0))},[w.current,f.current,a?.DraggingBehavior]);const S=ee=>{if(ee.ctrlKey||ee.metaKey){const ie=A.moment(l.createdAt,"YYYY/MM/DD HH:mm:ss");Ye.setFromAndToQuery(ie.startOf("day").valueOf(),ie.endOf("day").valueOf());return}Ja(l)},x=()=>{if(a?.UseButtonToShowEditor&&a?.DefaultEditorLocation==="Bottom"){const ee=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.thino-hidden)");ee&&ee.trigger("click")}Ge.setMarkMemoId(l.id)},E=async()=>{const ee=!A.Platform.isDesktop&&await window.Capacitor?.Plugins.Device.getId(),ie=A.Platform.isDesktop?await pn():ee.identifier||ee.uuid;if(!i||i?.appId!==ie){It();return}l.pinned?await le.unpinMemoById(l.id):await le.pinMemoById(l.id)},C=()=>{if(a?.UseButtonToShowEditor&&a?.DefaultEditorLocation==="Bottom"&&A.Platform.isMobile){const ee=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.thino-hidden)");ee&&ee.trigger("click")}(s==="/review"||s==="/daily")&&m(!0),s!=="/review"&&s!=="/daily"&&Ge.setEditMemoId(l.id)},M=async ee=>{ee.sourceType==="MULTI"&&ee.id.trim()===""&&await le.updateMemoProperty(ee)},k=async ee=>{await le.openThinoByID(ee.id)},O=async ee=>{try{const ie=await le.archiveMemo(ee);ie&&le.editMemo(ie)}catch(ie){console.error(ie),new A.Notice(ie.message)}},F=async()=>{try{if(a.DeleteThinoDirectly)await le.deleteMemoById(l.id);else{const ee=await le.hideMemoById(l.id);ee&&le.editMemo(ee)}}catch(ee){new A.Notice(ee.message)}Ge.getState().editMemoId===l.id&&Ge.setEditMemoId("")},R=()=>{if(h.current&&!h.current.confirmStatus){h.current&&h.current.toggleConfirm(!1);return}},B=()=>{Yc(l)},Y=async()=>{const ee=await le.updateMemo(l.id,l.content,l.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");ee&&le.editMemo(ee)},H=async()=>{navigator.clipboard.writeText(l.content).then(()=>{new A.Notice(I("COPY SUCCEED"))}).catch(()=>{new A.Notice(I("COPY FAILED"))})},Z=async()=>{new bQ(r,l).open()},W=ee=>{if(!ee||ee.target.tagName==="INPUT")return;switch(a?.doubleClickBehavior||"edit-thino"){case"open-thino":Ja(l);break;case"edit-thino":C();break;case"go-to-source":k(l);break;case"do-nothing":break;default:C();break}},K=async(ee,ie)=>{ee.preventDefault(),ee.stopPropagation();const fe=ee.target;if(ee.ctrlKey||ee.metaKey){await k(ie);return}if(fe.tagName==="A"){await wQ(r,o,fe);return}if(fe.tagName==="IMG"){TQ(f.current,fe);return}if(fe.tagName==="A"&&fe.getAttribute("href")){const he=fe.getAttribute("href");window.open(he,"_blank");return}if(fe.className==="memo-link-text"){xQ(fe);return}if(fe.tagName==="INPUT"&&fe.hasClass("task-list-item-checkbox")){await IQ(a,ie,f.current,fe);return}},V=async ee=>{const ie=await rF(l,ee);navigator.clipboard.writeText(ie),new A.Notice(I("COPY SUCCEED"))},ne=ee=>{const ie=new A.Menu;ie.dom.toggleClass("memo-context-menu",!0);const fe=window.getSelection();fe?.toString().length>0&&ie.addItem(he=>{he.setIcon("copy").setTitle(I("Copy selected text")).onClick(()=>{navigator.clipboard.writeText(fe.toString()).then(()=>{new A.Notice(I("COPY SUCCEED"))}).catch(()=>{new A.Notice(I("COPY FAILED"))})})}).addSeparator(),l.sourceType==="DAILY"&&(ie.addItem(he=>{he.setIcon("link").setTitle(I("Copy embed link")).onClick(()=>{V(!0)})}),ie.addItem(he=>{he.setIcon("link").setTitle(I("Copy link")).onClick(()=>{V(!1)})}),ie.addSeparator()),a?.enableReferenceLinksGroup&&n!=="list"&&ie.addItem(he=>{he.setIcon("link").setTitle(I("Reference links group")).onClick(()=>Q(ee))}),ie.addItem(he=>{he.setIcon("copy").setTitle(I("Copy thino").toLocaleUpperCase()).onClick(async()=>{await H(),ie.close()})}).addItem(he=>{he.setIcon("book-open").setTitle(I("READ")).onClick(()=>S(ee))}).addItem(he=>{he.setIcon(l.pinned?"pin-off":"pin").setTitle(l.pinned?I("UNPIN"):I("PIN")).onClick(E)}).addItem(he=
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ks(e,t){return w6(e)||$Q(e,t)||MC(e,t)||S6()}function jn(){return jn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}var XQ=function(e,t,n,r,o,a,i,s){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,a,i,s],f=0;l=new Error(t.replace(/%s/g,function(){return u[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},JQ=XQ;const $p=Je(JQ);var QQ=function(){};function eee(e,t){var n={};return Object.keys(e).forEach(function(r){n[Gy(r)]=QQ}),n}function CO(e,t){return e[t]!==void 0}function Gy(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}function tee(e){return!!e&&(typeof e!="function"||e.prototype&&e.prototype.isReactComponent)}function nee(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ib(e,t)}function T6(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function x6(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r??null}this.setState(t.bind(this))}function I6(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}T6.__suppressDeprecationWarning=!0;x6.__suppressDeprecationWarning=!0;I6.__suppressDeprecationWarning=!0;function ree(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var n=null,r=null,o=null;if(typeof t.componentWillMount=="function"?n="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?o="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(o="UNSAFE_componentWillUpdate"),n!==null||r!==null||o!==null){var a=e.displayName||e.name,i=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
||||
|
||||
`+a+" uses "+i+" but also contains the following legacy lifecycles:"+(n!==null?`
|
||||
`+n:"")+(r!==null?`
|
||||
`+r:"")+(o!==null?`
|
||||
`+o:"")+`
|
||||
|
||||
The above lifecycles should be removed. Learn more about this warning here:
|
||||
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=T6,t.componentWillReceiveProps=x6),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=I6;var s=t.componentDidUpdate;t.componentDidUpdate=function(u,f,h){var p=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:h;s.call(this,u,f,p)}}return e}var oee="/Users/jquense/src/uncontrollable/src/uncontrollable.js";function k6(e,t,n){n===void 0&&(n=[]);var r=e.displayName||e.name||"Component",o=tee(e),a=Object.keys(t),i=a.map(Gy);o||!n.length||$p(!1);var s=function(u){nee(f,u);function f(){for(var p,m=arguments.length,w=new Array(m),b=0;b<m;b++)w[b]=arguments[b];p=u.call.apply(u,[this].concat(w))||this,p.handlers=Object.create(null),a.forEach(function(S){var x=t[S],E=function(M){if(p.props[x]){var k;p._notifying=!0;for(var O=arguments.length,F=new Array(O>1?O-1:0),R=1;R<O;R++)F[R-1]=arguments[R];(k=p.props)[x].apply(k,[M].concat(F)),p._notifying=!1}p.unmounted||p.setState(function(B){var Y,H=B.values;return{values:jn(Object.create(null),H,(Y={},Y[S]=M,Y))}})};p.handlers[x]=E}),n.length&&(p.attachRef=function(S){p.inner=S});var y=Object.create(null);return a.forEach(function(S){y[S]=p.props[Gy(S)]}),p.state={values:y,prevProps:{}},p}var h=f.prototype;return h.shouldComponentUpdate=function(){return!this._notifying},f.getDerivedStateFromProps=function(m,w){var b=w.values,y=w.prevProps,S={values:jn(Object.create(null),b),prevProps:{}};return a.forEach(function(x){S.prevProps[x]=m[x],!CO(m,x)&&CO(y,x)&&(S.values[x]=m[Gy(x)])}),S},h.componentWillUnmount=function(){this.unmounted=!0},h.render=function(){var m=this,w=this.props,b=w.innerRef,y=c0(w,["innerRef"]);i.forEach(function(x){delete y[x]});var S={};return a.forEach(function(x){var E=m.props[x];S[x]=E!==void 0?E:m.state.values[x]}),_.createElement(e,jn({},y,S,this.handlers,{ref:b||this.attachRef}))},f}(_.Component);ree(s),s.displayName="Uncontrolled("+r+")",s.propTypes=jn({innerRef:function(){}},eee(t)),n.forEach(function(u){s.prototype[u]=function(){var h;return(h=this.inner)[u].apply(h,arguments)}});var l=s;return _.forwardRef&&(l=_.forwardRef(function(u,f){return _.createElement(s,jn({},u,{innerRef:f,__source:{fileName:oee,lineNumber:128},__self:this}))}),l.propTypes=s.propTypes),l.ControlledComponent=e,l.deferControlTo=function(u,f,h){return f===void 0&&(f={}),k6(u,jn({},t,f),h)},l}function E6(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=E6(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function er(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=E6(e))&&(r&&(r+=" "),r+=t);return r}var C6={exports:{}},y1,MO;function aee(){if(MO)return y1;MO=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return y1=e,y1}var b1,DO;function iee(){if(DO)return b1;DO=1;var e=aee();function t(){}function n(){}return n.resetWarningCache=t,b1=function(){function r(i,s,l,u,f,h){if(h!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},b1}C6.exports=iee()();var see=C6.exports;const de=Je(see);var kb="milliseconds",Xp="seconds",Jp="minutes",Qp="hours",au="day",Gd="week",em="month",iu="year",su="decade",lu="century",M6={milliseconds:1,seconds:1e3,minutes:60*1e3,hours:60*60*1e3,day:24*60*60*1e3,week:7*24*60*60*1e3},lee={month:1,year:12,decade:10*12,century:100*12};function cee(e){return[31,uee(e),31,30,31,30,31,31,30,31,30,31]}function uee(e){return e%4===0&&e%100!==0||e%400===0?29:28}function ri(e,t,n){switch(e=new Date(e),n){case kb:case Xp:case Jp:case Qp:case au:case Gd:return dee(e,t*M6[n]);case em:case iu:case su:case lu:return fee(e,t*lee[n])}throw new TypeError('Invalid units: "'+n+'"')}function dee(e,t){var n=new Date(+e+t);return hee(e,n)}function fee(e,t){var n=e.getFullYear(),r=e.getMonth(),o=e.getDate(),a=n*12+r+t,i=Math.trunc(a/12),s=a%12,l=Math.min(o,cee(i)[s]),u=new Date(e);return u.setFullYear(i),u.setDate(1),u.setMonth(s),u.setDate(l),u}function hee(e,t){var n=e.getTimezoneOffset(),r=t.getTimezoneOffset(),o=r-n;return new Date(+t+o*M6.minutes)}function tm(e,t,n){return ri(e,-t,n)}function Er(e,t,n){switch(e=new Date(e),t){case lu:case su:case iu:e=Cb(e,0);case em:e=P6(e,1);case Gd:case au:e=om(e,0);case Qp:e=Zd(e,0);case Jp:e=rm(e,0);case Xp:e=nm(
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zy(e){return vee(e)||L6(e)||MC(e)||yee()}function bee(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(o);++r<o;)a[r]=e[r+t];return a}var NC=bee;function wee(e,t){return e===t||e!==e&&t!==t}var mg=wee,See=typeof ur=="object"&&ur&&ur.Object===Object&&ur,R6=See,Tee=R6,xee=typeof self=="object"&&self&&self.Object===Object&&self,Iee=Tee||xee||Function("return this")(),ai=Iee,kee=ai,Eee=kee.Symbol,jf=Eee,NO=jf,F6=Object.prototype,Cee=F6.hasOwnProperty,Mee=F6.toString,Zh=NO?NO.toStringTag:void 0;function Dee(e){var t=Cee.call(e,Zh),n=e[Zh];try{e[Zh]=void 0;var r=!0}catch{}var o=Mee.call(e);return r&&(t?e[Zh]=n:delete e[Zh]),o}var Aee=Dee,Nee=Object.prototype,Oee=Nee.toString;function Pee(e){return Oee.call(e)}var jee=Pee,OO=jf,Lee=Aee,Ree=jee,Fee="[object Null]",Hee="[object Undefined]",PO=OO?OO.toStringTag:void 0;function Bee(e){return e==null?e===void 0?Hee:Fee:PO&&PO in Object(e)?Lee(e):Ree(e)}var Js=Bee;function _ee(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ea=_ee;const Lf=Je(Ea);var Yee=Js,Uee=Ea,zee="[object AsyncFunction]",Vee="[object Function]",Wee="[object GeneratorFunction]",Gee="[object Proxy]";function Zee(e){if(!Uee(e))return!1;var t=Yee(e);return t==Vee||t==Wee||t==zee||t==Gee}var d0=Zee;const Mt=Je(d0);var qee=9007199254740991;function Kee(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=qee}var OC=Kee,$ee=d0,Xee=OC;function Jee(e){return e!=null&&Xee(e.length)&&!$ee(e)}var Rf=Jee,Qee=9007199254740991,ete=/^(?:0|[1-9]\d*)$/;function tte(e,t){var n=typeof e;return t=t??Qee,!!t&&(n=="number"||n!="symbol"&&ete.test(e))&&e>-1&&e%1==0&&e<t}var PC=tte,nte=mg,rte=Rf,ote=PC,ate=Ea;function ite(e,t,n){if(!ate(n))return!1;var r=typeof t;return(r=="number"?rte(n)&&ote(t,n.length):r=="string"&&t in n)?nte(n[t],e):!1}var Ff=ite,ste=/\s/;function lte(e){for(var t=e.length;t--&&ste.test(e.charAt(t)););return t}var cte=lte,ute=cte,dte=/^\s+/;function fte(e){return e&&e.slice(0,ute(e)+1).replace(dte,"")}var hte=fte;function pte(e){return e!=null&&typeof e=="object"}var ii=pte,mte=Js,gte=ii,vte="[object Symbol]";function yte(e){return typeof e=="symbol"||gte(e)&&mte(e)==vte}var Hf=yte,bte=hte,jO=Ea,wte=Hf,LO=NaN,Ste=/^[-+]0x[0-9a-f]+$/i,Tte=/^0b[01]+$/i,xte=/^0o[0-7]+$/i,Ite=parseInt;function kte(e){if(typeof e=="number")return e;if(wte(e))return LO;if(jO(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=jO(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=bte(e);var n=Tte.test(e);return n||xte.test(e)?Ite(e.slice(2),n?2:8):Ste.test(e)?LO:+e}var H6=kte,Ete=H6,RO=1/0,Cte=17976931348623157e292;function Mte(e){if(!e)return e===0?e:0;if(e=Ete(e),e===RO||e===-RO){var t=e<0?-1:1;return t*Cte}return e===e?e:0}var B6=Mte,Dte=B6;function Ate(e){var t=Dte(e),n=t%1;return t===t?n?t-n:t:0}var _6=Ate,Nte=NC,Ote=Ff,Pte=_6,jte=Math.ceil,Lte=Math.max;function Rte(e,t,n){(n?Ote(e,t,n):t===void 0)?t=1:t=Lte(Pte(t),0);var r=e==null?0:e.length;if(!r||t<1)return[];for(var o=0,a=0,i=Array(jte(r/t));o<r;)i[a++]=Nte(e,o,o+=t);return i}var Fte=Rte;const Hte=Je(Fte);function gg(e){return e&&e.ownerDocument||document}function Bte(e){var t=gg(e);return t&&t.defaultView||window}function _te(e,t){return Bte(e).getComputedStyle(e,t)}var Yte=/([A-Z])/g;function Ute(e){return e.replace(Yte,"-$1").toLowerCase()}var zte=/^ms-/;function ey(e){return Ute(e).replace(zte,"-ms-")}var Vte=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function Wte(e){return!!(e&&Vte.test(e))}function Sd(e,t){var n="",r="";if(typeof t=="string")return e.style.getPropertyValue(ey(t))||_te(e).getPropertyValue(ey(t));Object.keys(t).forEach(function(o){var a=t[o];!a&&a!==0?e.style.removeProperty(ey(o)):Wte(o)?r+=o+"("+a+") ":n+=ey(o)+": "+a+";"}),r&&(n+="transform: "+r+";"),e.style.cssText+=";"+n}function am(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}function Gte(e){return"nodeType"in e&&e.nodeType===document.DOCUMENT_NODE}function jC(e){return"window"in e&&e.window===e?e:Gte(e)&&e.defaultView||!1}function Y6(e){var t=e==="pageXOffset"?"scrollLeft":"scrollTop";function n(r,o){var a=jC(r);if(o===void 0)return a?a[e]:r[t];a?a.scrollTo(a[e],o):r[t]=o}return n}const U6=Y6("pageXOffset"),z6=Y6("pageYOffset");function Xc(e){var t=gg(e),n={top:0,left:0,height:0,width:0},r=t&&t.documentElement;return!r||!am(r,e)||(e.getBoundingClientRect!==void 0&&(n=e.getBoundingClientRect()),n={top:n.top+z6(r)-(r.clientTop||0),left:n.left+U6(r)-(r.clientLeft||0),width:n.width,height:n.height}),n}var Zte=function(t){return!!t&&"offsetParent"in t};function qte(e){for(var t=gg(e),n=e&&e.offsetParent;Zte(n)&&n.nodeName!=="HTML"&&Sd(n,"position")==="static";)n=n.offsetParent;return n||t.documentElement}var Kte=function(t){return t.nodeName&&t.nodeName.toLowerCase()};function V6(e,t){var n={top:0,left:0},r;if(Sd(e,"posi
Line truncated
|
||||
`)[0].slice(0,20),r=_.useRef(null),o=_.useRef(null),a=_.useRef(null);D.useEffect(()=>{if(o.current)return A.setIcon(o.current,"calendar"),()=>{r.current&&(r.current=null)}},[r]);const i=D.useCallback(l=>{a.current&&(a.current.unmount(),a.current=null),a.current=l},[]),s=D.useCallback(l=>{if(!r.current||!A.Keymap.isModifier(l.nativeEvent,"Mod"))return;const u=new A.HoverPopover(Ze.getState().view,r.current,100),f=bve(u,t);i(f)},[r.current]);return g.jsxs("span",{className:"rbc-event-renderer","data-source-type":t.sourceType,"data-thino-type":t.thinoType,"data-thino-id":t.id,ref:r,"aria-label":t.path,onMouseOver:s,children:[g.jsx(Sve,{event:e}),g.jsx("span",{children:n})]})}const Sve=({event:e})=>{const t=_.useRef(null),n=e.resource;D.useEffect(()=>{t.current&&A.setIcon(t.current,n.thinoType==="JOURNAL"?"calendar":n.thinoType==="TASK-TODO"?"square":"check-square")},[n?.thinoType,t]);const r=D.useCallback(async o=>{o.stopPropagation(),o.preventDefault(),await(async()=>{const i=await le.updateMemo(n.id,n.content,n.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");i&&le.editMemo(i)})()},[n?.thinoType,n?.id,n?.content]);return g.jsx(g.Fragment,{children:g.jsxs("span",{className:"rbc-event-icon-group",children:[g.jsx("span",{className:"rbc-event-icon",ref:t,onClick:r}),g.jsx("span",{className:qt("rbc-event-time","thino-hidden"),children:g.jsx("span",{className:"rbc-event-time-text",children:A.moment(e.start).format("HH:mm")})})]})})};function aH({views:e,view:t,messages:n,onView:r}){return e.map(o=>g.jsx("button",{type:"button",className:qt({"rbc-active":t===o}),onClick:()=>r(o),children:n[o]},o))}aH.propTypes={messages:de.object,onView:de.func,view:de.string,views:de.array};function iH({date:e,label:t,localizer:{messages:n},onNavigate:r,onView:o,view:a,views:i}){const s={previous:D.useRef(null),today:D.useRef(null),next:D.useRef(null)};D.useEffect(()=>{s&&(A.setIcon(s.previous.current,"chevron-left"),A.setIcon(s.today.current,"dot"),A.setIcon(s.next.current,"chevron-right"))},[s]);const l=D.useMemo(()=>g.jsxs(g.Fragment,{children:[g.jsx("button",{ref:s.previous,type:"button",onClick:()=>r(Id.PREVIOUS),"aria-label":n.previous,children:"<"}),g.jsx("button",{ref:s.today,type:"button",onClick:()=>r(Id.TODAY),"aria-label":n.today,children:"•"}),g.jsx("button",{ref:s.next,type:"button",onClick:()=>r(Id.NEXT),"aria-label":n.next,children:">"})]}),[n]);return g.jsxs("div",{className:"rbc-toolbar",children:[g.jsx("span",{className:qt("rbc-btn-group","thino-view-custom-toolbar"),children:l}),g.jsx("span",{className:"rbc-toolbar-label",children:g.jsx(bb,{type:"text",handleValueChange:u=>{r(Id.DATE,A.moment(u,"YYYY-MM-DD").format("YYYY-MM-DDTHH:mm:ssZ"))},defaultText:t+(a==="week"?A.moment(e.valueOf(),"x").format(" [W]WW"):""),defaultValue:A.moment(e.valueOf(),"x").valueOf()})}),g.jsx("span",{className:"rbc-btn-group",children:g.jsx(aH,{view:a,views:i,messages:n,onView:o})})]})}iH.propTypes={date:de.instanceOf(Date),label:de.string,localizer:de.object,messages:de.object,onNavigate:de.func,onView:de.func,view:de.string,views:de.array};function Tve({event:e,children:t,showPopup:n,callRender:r,...o}){const a=D.useRef(null),i=D.useRef(null),s=D.useCallback(l=>{if(!l.isTrusted){r();return}i.current=l.nativeEvent.target,i.current&&(i.current.hasClass("rbc-event")||(i.current=i.current.closest(".rbc-event")),a.current!==null?(window.clearTimeout(a.current),a.current=null):a.current=window.setTimeout(()=>{n(e,i.current),a.current=null},250))},[e,n]);return g.jsx(g.Fragment,{children:g.jsx("div",{className:"rbc-event-wrapper","aria-describedby":"thino",onClick:s,children:t})})}const xve=vve(A.moment),Ive=({event:e})=>{const t=e.resource;return g.jsx(g.Fragment,{children:g.jsx(no,{memo:t})})},kve=e=>{const{thinos:t}=e,[n,r]=_.useState([]),[o,a]=_.useState(app?.loadLocalStorage("thino-calendar-view")||"month"),[i,s]=_.useState(null),l=_.useRef(null),u=_.useRef(null),[f,h]=_.useState(!1),p=D.useRef(null),[m,w]=D.useState(new Date);D.useEffect(()=>()=>{l.current&&(l.current=null),u.current&&(u.current=null),p.current&&(p.current=null)},[]),D.useEffect(()=>{const H=t.map(Z=>{const W=A.moment(Z.createdAt,"YYYY/MM/DD HH:mm:ss"),K=W.clone().add(1,"minute");return{title:Z.content,start:new Date(W.format("YYYY-MM-DDTHH:mm:ss")),end:new Date(K.format("YYYY-MM-DDTHH:mm:ss")),resource:Z}});r(H)},[t]),D.useEffect(()=>{app?.saveLocalStorage("thino-calendar-view",o)},[o]),D.useEffect(()=>{i&&f&&s(t.find(H=>H.id===i.id))},[t,i,f]),D.useEffect(()=>{i&&p.current.update()},[i]),p.current=s0(l.current,u.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,4]}}]});const b=D.useCallback(()=>{p.current.update(),p.current.update()},[]),y=D.useCallback((H,Z)=>{s(null),C(),p.current.state.elements.reference=Z,s(H.resource),M()},[]),S=D.useCallback(()=>{C(),s(null)},[]),x=D.useCallback((H,Z,W)=>{if(E(H),Z==="week"||Z==="day"){const K=l.current.find(".rbc-event-wrapper");if(l.current.closest(".memolist-wrapper"),K){K.children[0]?.clic
Line truncated
|
||||
`,Nye="\uFEFF",yH=e=>Object.assign({},Dye,e);let Oye=class extends Error{constructor(t){super(t),this.name="CsvGenerationError"}},Pye=class extends Error{constructor(t){super(t),this.name="EmptyHeadersError"}};var Sg=e=>e,ni=e=>e,M0=Sg,qd=Sg,e3=Sg,t3=Sg,jye=function(e,t){return t=='"'&&e.indexOf('"')>-1?e.replace(/"/g,'""'):e},Lye=e=>e3(typeof e=="object"?e.key:e),Rye=e=>t3(typeof e=="object"?e.displayLabel:e),Fye=(e,...t)=>t.reduce((n,r)=>r(n),e),Hye=e=>t=>e.useBom?M0(ni(t)+Nye):t,Bye=e=>t=>e.showTitle?uM(M0(ni(t)+e.title))(qd("")):t,uM=e=>t=>M0(ni(e)+ni(t)+Aye),bH=e=>(t,n)=>_ye(e)(qd(t+n)),_ye=e=>t=>Sg(ni(t)+e.fieldSeparator),Yye=(e,t)=>n=>{if(!e.showColumnHeaders)return n;if(t.length<1)throw new Pye("Option to show headers but none supplied. Make sure there are keys in your collection or that you've supplied headers through the config options.");let r=qd("");for(let o=0;o<t.length;o++){const a=Rye(t[o]);r=bH(e)(r,wH(e,a))}return r=qd(ni(r).slice(0,-1)),uM(n)(r)},Uye=(e,t,n)=>r=>{let o=r;for(var a=0;a<n.length;a++){let i=qd("");for(let s=0;s<t.length;s++){const l=Lye(t[s]),u=typeof n[a][ni(l)]>"u"?e.replaceUndefinedWith:n[a][ni(l)];i=bH(e)(i,wH(e,u))}i=qd(ni(i).slice(0,-1)),o=uM(o)(i)}return o},zye=ni,n3=e=>+e===e&&(!isFinite(e)||!!(e%1)),wH=(e,t)=>{if(e.decimalSeparator==="locale"&&n3(t))return t.toLocaleString();if(e.decimalSeparator!=="."&&n3(t))return t.toString().replace(".",e.decimalSeparator);if(typeof t=="string"){let n=t;return(e.quoteStrings||e.fieldSeparator&&t.indexOf(e.fieldSeparator)>-1||e.quoteCharacter&&t.indexOf(e.quoteCharacter)>-1||t.indexOf(`
|
||||
`)>-1||t.indexOf("\r")>-1)&&(n=e.quoteCharacter+jye(t,e.quoteCharacter)+e.quoteCharacter),n}if(typeof t=="boolean"&&e.boolDisplay){const n=t?"true":"false";return e.boolDisplay[n]}return t},Vye=e=>t=>{const n=yH(e),r=n.useKeysAsHeaders?Object.keys(t[0]):n.columnHeaders;let o=Fye(M0(""),Hye(n),Bye(n),Yye(n,r),Uye(n,r,t));if(ni(o).length<1)throw new Oye("Output is empty. Is your data formatted correctly?");return o};const Wye=({thino:e})=>{const t=D.useRef(null);D.useEffect(()=>(t.current&&A.setIcon(t.current,"pin"),()=>{t.current&&(t.current=null)}),[t]);const n=D.useCallback(async()=>{e.pinned?await le.unpinMemoById(e.id):await le.pinMemoById(e.id)},[e]);return g.jsx("span",{ref:t,className:qt("pinned-status",e.pinned?"pinned":"not-pinned"),onClick:n})},Gye=({thino:e})=>{const t=D.useRef(null);D.useEffect(()=>(t.current&&A.setIcon(t.current,e.thinoType==="JOURNAL"?"calendar":"check-square"),()=>{t.current&&(t.current=null)}),[t,e?.thinoType]);const n=D.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const r=await le.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");r&&le.editMemo(r)},[e]);return g.jsx(g.Fragment,{children:e.thinoType!=="JOURNAL"?g.jsx("input",{className:qt("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}):g.jsx("span",{ref:t,className:"thino-type-status"})})},Zye=({id:e,path:t})=>{const n=D.useRef(null);D.useEffect(()=>(n.current&&A.setIcon(n.current,"link"),()=>{n.current&&(n.current=null)}),[]);const r=D.useCallback(()=>{!e||!t||le.openThinoByID(e)},[e,t]);return g.jsxs("span",{className:"source-thino",onClick:r,children:[g.jsx("span",{children:t}),g.jsx("span",{ref:n,className:"source-thino-icon"})]})},qye=({id:e,sourceType:t})=>{const n=D.useRef(null);D.useEffect(()=>(n.current&&A.setIcon(n.current,Up.find(o=>o.title===t)?.icon||"list"),()=>{n.current&&(n.current=null)}),[]);const r=D.useCallback(async()=>{e&&await le.openThinoByID(e)},[e]);return g.jsx("span",{ref:n,className:"source-type-icon",onClick:r})},r3=(e,t,n,r)=>{const o=Tye(e.getValue(t),n);return r({itemRank:o}),o.passed},o3=(e,t,n)=>{let r=0;return e.columnFiltersMeta[n]&&(r=kye(e.columnFiltersMeta[n]?.itemRank,t.columnFiltersMeta[n]?.itemRank)),r===0?Td.alphanumeric(e,t,n):r},Kye=yH({fieldSeparator:",",decimalSeparator:".",useKeysAsHeaders:!0}),$ye=e=>e+`
|
||||
`;function Xye({thinos:e,isFiltering:t}){_.useReducer(()=>({}),{})[1];const[n,r]=_.useState([]),[o,a]=_.useState(""),i=_.useMemo(()=>[{header:I("Basic Info"),footer:m=>m.column.id,columns:[{accessorKey:"createdAt",header:()=>g.jsx("span",{className:"create-at-header-cell",children:I("Created At")}),cell:m=>m.getValue(),footer:m=>m.column.id,enableColumnFilter:!1},{accessorFn:m=>m.content,id:"content",header:()=>g.jsx("span",{className:"thino-header-cell",children:I("Thino")}),cell:m=>g.jsx(no,{memo:m.row.original,type:"table"}),footer:m=>m.column.id,filterFn:"fuzzy",sortingFn:o3},{accessorFn:m=>m.thinoType,id:"thinoType",cell:m=>g.jsx(Gye,{thino:m.row.original}),header:()=>g.jsx("span",{children:I("Thino Type")}),footer:m=>m.column.id},{accessorFn:m=>m.sourceType,id:"sourceType",cell:m=>g.jsx(qye,{id:m.row.original.id,sourceType:m.getValue()}),header:()=>g.jsx("span",{children:I("Source Type")}),footer:m=>m.column.id}]},{header:I("Additional Info"),footer:m=>m.column.id,columns:[{accessorKey:"pinned",header:()=>g.jsx("span",{children:I("Pinned Status")}),cell:m=>g.jsx(Wye,{thino:m.row.original}),footer:m=>m.column.id,filterFn:"fuzzy",sortingFn:o3},{accessorKey:"rowStatus",header:()=>g.jsx("span",{children:I("Row status")}),cell:m=>g.jsx("span",{children:m.getValue()==="NORMAL"?"":m.getValue()}),footer:m=>m.column.id},{accessorKey:"path",header:()=>I("Path"),cell:m=>g.jsx(Zye,{id:m.row.original.id,path:m.getValue()}),footer:m=>m.column.id}]}],[]),[s,l]=_.useState(()=>e),u=()=>l(m=>e);D.useEffect(()=>{u()},[e]);const f=yye({data:s,columns:i,filterFns:{fuzzy:r3},initialState:{pagination:{pageSize:20}},state:{columnFilters:n,globalFilter:o},onColumnFiltersChange:r,onGlobalFilterChange:a,globalFilterFn:r3,getCoreRowModel:aye(),getFilteredRowModel:lye(),getSortedRowModel:fye(),getPaginationRowModel:pye(),getFacetedRowModel:cye(),getFacetedUniqueValues:uye(),getFacetedMinMaxValues:dye(),debugTable:!1,debugHeaders:!1,debugColumns:!1});_.useEffect(()=>{f.getState().columnFilters[0]?.id==="createdAt"&&f.getState().sorting[0]?.id!=="createdAt"&&f.setSorting([{id:"createdAt",desc:!1}])},[f.getState().columnFilters[0]?.id]);async function h(m,w){const b=I("Created At"),y=I("Updated At"),S=I("Content"),x=I("Path"),E=m.map(F=>({[b]:F.createdAt,[y]:F.updatedAt,[S]:F.content,Thino:`=hyperlink("obsidian://thino?openId=${F.id}","${F.id}")`,[x]:`=hyperlink("obsidian://open?path=${A.normalizePath(F.path)},"${F.path}")`})),C=Vye(Kye)(E),M=Ze.getState().app||window.app,k=$ye(zye(C));return{file:await M.vault.create(`${w}-${je.randomId(6)}.csv`,k),app:M}}async function p(m){const{file:w,app:b}=await h(m.map(x=>x.original),"thino-export"),y=document.createDocumentFragment(),S=y.createEl("div",{cls:"export-file-btn-group"});y.createEl("div",{cls:"open-file-button"}),new A.Setting(S).setName(I("Exported CSV file")).addButton(x=>{x.setButtonText(I("Open File")).onClick(()=>{const E=A.normalizePath(w.path);b.openWithDefaultApp(E)})}),new A.Notice(y)}return g.jsxs("div",{className:"table-view",children:[g.jsxs("div",{children:[g.jsx($y,{value:o||"",onChange:m=>a(String(m)),className:"table-search-bar",placeholder:I("Search all columns...")}),A.Platform.isDesktop&&(o||n.length>0||t)&&g.jsx("button",{className:"mod-cta",disabled:f.getPrePaginationRowModel().rows.length===0,onClick:()=>p(f.getPrePaginationRowModel().rows),children:I("Export to CSV")})]}),g.jsxs("table",{className:"thino-table",children:[g.jsx("thead",{children:f.getHeaderGroups().map(m=>g.jsx("tr",{children:m.headers.map(w=>g.jsx("th",{colSpan:w.colSpan,children:w.isPlaceholder?null:g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:qt(w.column.getCanSort()?"filter-header":"","table-header",w.column.id==="content"?"content-header":""),onClick:w.column.getToggleSortingHandler(),children:[$P(w.column.columnDef.header,w.getContext()),{asc:" 🔼",desc:" 🔽"}[w.column.getIsSorted()]??null]}),w.column.getCanFilter()?g.jsx(Qye,{column:w.column,table:f}):null]})},w.id))},m.id))}),g.jsx("tbody",{children:f.getRowModel().rows.map(m=>g.jsx("tr",{className:qt(m.getValue("pinned")?"pinned":""),children:m.getVisibleCells().map(w=>g.jsx("td",{children:$P(w.column.columnDef.cell,w.getContext())},w.id))},m.id))})]}),g.jsxs("div",{className:"table-nav-bar",children:[g.jsx("button",{className:"prev-start-btn",onClick:()=>f.setPageIndex(0),disabled:!f.getCanPreviousPage(),children:"<<"}),g.jsx("button",{className:"prev-btn",onClick:()=>f.previousPage(),disabled:!f.getCanPreviousPage(),children:"<"}),g.jsx("button",{className:"next-btn",onClick:()=>f.nextPage(),disabled:!f.getCanNextPage(),children:">"}),g.jsx("button",{className:"next-end-btn",onClick:()=>f.setPageIndex(f.getPageCount()-1),disabled:!f.getCanNextPage(),children:">>"}),g.jsxs("span",{className:"table-page-info",children:[g.jsx("div",{children:I("Page")}),g.jsxs("strong",{children:[f.getState().pagination.pageIndex+1," of ",f.getPageCount()]})]}),g.jsxs("span",{className:"table-page-jump",children:["| ",I("Go to page"),":"Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Li(e,t){return m0e(e)||Oke(e,t)||U7(e,t)||qEe()}var z7={exports:{}};(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],o=0;o<arguments.length;o++){var a=arguments[o];if(a){var i=typeof a;if(i==="string"||i==="number")r.push(a);else if(Array.isArray(a)){if(a.length){var s=n.apply(null,a);s&&r.push(s)}}else if(i==="object")if(a.toString===Object.prototype.toString)for(var l in a)t.call(a,l)&&a[l]&&r.push(l);else r.push(a.toString())}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(z7);var KEe=z7.exports;const YM=Je(KEe);var V7={exports:{}},fx,Ij;function $Ee(){if(Ij)return fx;Ij=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return fx=e,fx}var hx,kj;function XEe(){if(kj)return hx;kj=1;var e=$Ee();function t(){}function n(){}return n.resetWarningCache=t,hx=function(){function r(i,s,l,u,f,h){if(h!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var a={array:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},hx}V7.exports=XEe()();var JEe=V7.exports;const _t=Je(JEe);var UM=_.createContext({scrollTo:function(){return 0},scrollToBottom:function(){return 0},scrollToEnd:function(){return 0},scrollToStart:function(){return 0},scrollToTop:function(){return 0}});UM.displayName="ScrollToBottomFunctionContext";function G0(){return D.useContext(UM)}function QEe(){var e=G0(),t=e.scrollToEnd;return t}var zM=_.createContext({atBottom:!0,atEnd:!0,atStart:!1,atTop:!0,mode:"bottom"});zM.displayName="ScrollToBottomState1Context";var VM=_.createContext({animating:!1,animatingToEnd:!1,sticky:!0});VM.displayName="ScrollToBottomState2Context";var WM=_.createContext({animating:!1,animatingToEnd:!1,atBottom:!0,atEnd:!0,atStart:!1,atTop:!0,mode:"bottom",sticky:!0});WM.displayName="ScrollToBottomStateContext";var Ej=[WM,zM,VM];function eCe(e){return D.useContext(Ej[e]||Ej[0])}function tCe(){var e=eCe(2),t=e.sticky;return[t]}var Z0=_.createContext({offsetHeight:0,scrollHeight:0,setTarget:function(){return 0},styleToClassName:function(){return""}});Z0.displayName="ScrollToBottomInternalContext";function nCe(){return D.useContext(Z0)}function GM(){var e=nCe(),t=e.styleToClassName;return t}var rCe={backgroundColor:"rgba(0, 0, 0, .2)",borderRadius:10,borderWidth:0,bottom:5,cursor:"pointer",height:20,outline:0,position:"absolute",right:20,width:20,"&:hover":{backgroundColor:"rgba(0, 0, 0, .4)"},"&:active":{backgroundColor:"rgba(0, 0, 0, .6)"}},ZM=function(t){var n=t.children,r=t.className,o=tCe(),a=Li(o,1),i=a[0],s=GM()(rCe),l=QEe();return!i&&_.createElement("button",{className:YM(s,(r||"")+""),onClick:l,type:"button"},n)};ZM.defaultProps={children:void 0,className:""};ZM.propTypes={children:_t.any,className:_t.string};var W7={exports:{}},oCe=on,aCe=jo,Cj=si.f;oCe({target:"Object",stat:!0,forced:Object.defineProperty!==Cj,sham:!aCe},{defineProperty:Cj});var iCe=Mr,G7=iCe.Object,sCe=W7.exports=function(t,n,r){return G7.defineProperty(t,n,r)};G7.defineProperty.sham&&(sCe.sham=!0);var lCe=W7.exports,cCe=lCe,Z7=cCe,uCe=Z7,dCe=uCe,fCe=dCe,hCe=fCe,pCe=hCe;const mCe=Je(pCe);var gCe=Dg,vCe=gCe.f("iterator"),yCe=vCe,bCe=yCe,wCe=bCe,SCe=wCe,TCe=SCe,xCe=TCe,ICe=xCe;const kCe=Je(ICe);function um(e){"@babel/helpers - typeof";return um=typeof Ed=="function"&&typeof kCe=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Ed=="function"&&t.constructor===Ed&&t!==Ed.prototype?"symbol":typeof t},um(e)}var ECe=Dg,CCe=ECe.f("toPrimitive"),MCe=CCe,DCe=MCe,ACe=DCe,NCe=ACe,OCe=NCe,PCe=OCe,jCe=PCe;const LCe=Je(jCe);function RCe(e,t){if(um(e)!="object"||!e)return e;var n=e[LCe];if(n!==void 0){var r=n.call(e,t);if(um(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FCe(e){var t=RCe(e,"string");return um(t)=="symbol"?t:t+""}function HCe(e,t,n){return t=FCe(t),t in e?mCe(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BCe(e){if(RH(e))return lk(e)}function _Ce(e){if(typeof Ed<"u"&&F7(e)!=null||e["@@iterator"]!=null)return Y7(e)}function YCe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ft(e){return BCe(e)||_Ce(e)||U7(e)||YCe()}var py=function(e){return e&&e.Math==Math&&e},ta=py(typeof globalThis=="object"&&globalThis)||py(typeof window=="object"&&window)||py(typeof self=="object"&&self)||py(typeof ur=="object"&&ur)||function(){return this}()||Function("return this")(),qM={},li=function(e){try{return!!e()}catch{return!0}},UCe=li,Iu=!UCe(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),q7={},K7={}.propertyIsEnumerable,$7=Object.getOwnPropertyDescriptor,zCe=$7&&!K7.call({1:2},1);q7.f=zCe?function(t){var n=$7(this,t);return!!n&&n.enumerable}:K7;var X7=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},VCe={}.toString,KM=function(e){return VCe.call(e).slice(8,-1)},WCe=li,GCe=KM,ZCe="".split,qCe=WCe(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return GCe(e)=="String"?ZCe.call(e,""):Object(e)}:Object,q0=function(e){if(e==null)throw TypeError("Can't call method on "+e);return e},KCe=qCe,$Ce=q0,$M=function(e){return KCe($Ce(e))},Ca=function(e){return typeof e=="function"},XCe=Ca,K0=function(e){return typeof e=="object"?e!==null:XCe(e)},px=ta,JCe=Ca,QCe=function(e){return JCe(e)?e:void 0},$0=function(e,t){return arguments.length<2?QCe(px[e]):px[e]&&px[e][t]},eMe=$0,tMe=eMe("navigator","userAgent")||"",J7=ta,mx=tMe,Mj=J7.process,Dj=J7.Deno,Aj=Mj&&Mj.versions||Dj&&Dj.version,Nj=Aj&&Aj.v8,Ai,Bb;Nj?(Ai=Nj.split("."),Bb=Ai[0]<4?1:Ai[0]+Ai[1]):mx&&(Ai=mx.match(/Edge\/(\d+)/),(!Ai||Ai[1]>=74)&&(Ai=mx.match(/Chrome\/(\d+)/),Ai&&(Bb=Ai[1])));var nMe=Bb&&+Bb,Oj=nMe,rMe=li,Q7=!!Object.getOwnPropertySymbols&&!rMe(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Oj&&Oj<41}),oMe=Q7,eB=oMe&&!Symbol.sham&&typeof Symbol.iterator=="symbol",aMe=Ca,iMe=$0,sMe=eB,tB=sMe?function(e){return typeof e=="symbol"}:function(e){var t=iMe("Symbol");return aMe(t)&&Object(e)instanceof t},lMe=function(e){try{return String(e)}catch{return"Object"}},cMe=Ca,uMe=lMe,dMe=function(e){if(cMe(e))return e;throw TypeError(uMe(e)+" is not a function")},fMe=dMe,nB=function(e,t){var n=e[t];return n==null?void 0:fMe(n)},gx=Ca,vx=K0,hMe=function(e,t){var n,r;if(t==="string"&&gx(n=e.toString)&&!vx(r=n.call(e))||gx(n=e.valueOf)&&!vx(r=n.call(e))||t!=="string"&&gx(n=e.toString)&&!vx(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},rB={exports:{}},Pj=ta,XM=function(e,t){try{Object.defineProperty(Pj,e,{value:t,configurable:!0,writable:!0})}catch{Pj[e]=t}return t},pMe=ta,mMe=XM,jj="__core-js_shared__",gMe=pMe[jj]||mMe(jj,{}),JM=gMe,Lj=JM;(rB.exports=function(e,t){return Lj[e]||(Lj[e]=t!==void 0?t:{})})("versions",[]).push({version:"3.18.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var QM=rB.exports,vMe=q0,oB=function(e){return Object(vMe(e))},yMe=oB,bMe={}.hasOwnProperty,ku=Object.hasOwn||function(t,n){return bMe.call(yMe(t),n)},wMe=0,SMe=Math.random(),aB=function(e){return"Symbol("+String(e===void 0?"":e)+")_"+(++wMe+SMe).toString(36)},TMe=ta,xMe=QM,Rj=ku,IMe=aB,Fj=Q7,kMe=eB,Xh=xMe("wks"),Op=TMe.Symbol,EMe=kMe?Op:Op&&Op.withoutSetter||IMe,Pg=function(e){return(!Rj(Xh,e)||!(Fj||typeof Xh[e]=="string"))&&(Fj&&Rj(Op,e)?Xh[e]=Op[e]:Xh[e]=EMe("Symbol."+e)),Xh[e]},Hj=K0,Bj=tB,CMe=nB,MMe=hMe,DMe=Pg,AMe=DMe("toPrimitive"),NMe=function(e,t){if(!Hj(e)||Bj(e))return e;var n=CMe(e,AMe),r;if(n){if(t===void 0&&(t="default"),r=n.call(e,t),!Hj(r)||Bj(r))return r;throw TypeError("Can't convert object to primitive value")}return t===void 0&&(t="number"),MMe(e,t)},OMe=NMe,PMe=tB,iB=function(e){var t=OMe(e,"string");return PMe(t)?t:String(t)},jMe=ta,_j=K0,ck=jMe.document,LMe=_j(ck)&&_j(ck.createElement),sB=function(e){return LMe?ck.createElement(e):{}},RMe=Iu,FMe=li,HMe=sB,lB=!RMe&&!FMe(function(){return Object.defineProperty(HMe("div"),"a",{get:function(){return 7}}).a!=7}),BMe=Iu,_Me=q7,YMe=X7,UMe=$M,zMe=iB,VMe=ku,WMe=lB,Yj=Object.getOwnPropertyDescriptor;qM.f=BMe?Yj:function(t,n){if(t=UMe(t),n=zMe(n),WMe)try{return Yj(t,n)}catch{}if(VMe(t,n))return YMe(!_Me.f.call(t,n),t[n])};var jg={},GMe=K0,Jl=function(e){if(GMe(e))return e;throw TypeError(String(e)+" is not an object")},ZMe=Iu,qMe=lB,Uj=Jl,KMe=iB,zj=Object.defineProperty;jg.f=ZMe?zj:function(t,n,r){if(Uj(t),n=KMe(n),Uj(r),qMe)try{return zj(t,n,r)}catch{}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[n]=r.value),t};var $Me=Iu,XMe=jg,JMe=X7,X0=$Me?function(e,t,n){return XMe.f(e,t,JMe(1,n))}:function(e,t,n){return e[t]=n,e},cB={exports:{}},QMe=Ca,uk=JM,eDe=Function.toString;QMe(uk.inspectSource)||(uk.inspectSource=function(e){return eDe.call(e)});var uB=uk.inspectSource,tDe=ta,nDe=Ca,rDe=uB,Vj=tDe.WeakMap,oDe=nDe(Vj)&&/native code/.test(rDe(Vj)),aDe=QM,iDe=aB,Wj=aDe("keys"),dB=function(e){return Wj[e]||(Wj[e]=iDe(e))},eD={},sDe=oDe,lDe=ta,cDe=X0,yx=ku,bx=JM,uDe=dB,dDe=eD,Gj="Object already initialize
Line truncated
|
||||
`)&&e.flags==="s")}),QAe=li,e2e=ta,t2e=e2e.RegExp,n2e=QAe(function(){var e=t2e("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),r2e=Q0,o2e=SB,e4=aD,a2e=QM,i2e=qAe,s2e=fB.get,l2e=JAe,c2e=n2e,Yb=RegExp.prototype.exec,u2e=a2e("native-string-replace",String.prototype.replace),gk=Yb,vk=function(){var e=/a/,t=/b*/g;return Yb.call(e,"a"),Yb.call(t,"a"),e.lastIndex!==0||t.lastIndex!==0}(),EB=e4.UNSUPPORTED_Y||e4.BROKEN_CARET,yk=/()??/.exec("")[1]!==void 0,d2e=vk||yk||EB||l2e||c2e;d2e&&(gk=function(t){var n=this,r=s2e(n),o=r2e(t),a=r.raw,i,s,l,u,f,h,p;if(a)return a.lastIndex=n.lastIndex,i=gk.call(a,o),n.lastIndex=a.lastIndex,i;var m=r.groups,w=EB&&n.sticky,b=o2e.call(n),y=n.source,S=0,x=o;if(w&&(b=b.replace("y",""),b.indexOf("g")===-1&&(b+="g"),x=o.slice(n.lastIndex),n.lastIndex>0&&(!n.multiline||n.multiline&&o.charAt(n.lastIndex-1)!==`
|
||||
`)&&(y="(?: "+y+")",x=" "+x,S++),s=new RegExp("^(?:"+y+")",b)),yk&&(s=new RegExp("^"+y+"$(?!\\s)",b)),vk&&(l=n.lastIndex),u=Yb.call(w?s:n,x),w?u?(u.input=u.input.slice(S),u[0]=u[0].slice(S),u.index=n.lastIndex,n.lastIndex+=u[0].length):n.lastIndex=0:vk&&u&&(n.lastIndex=n.global?u.index+u[0].length:l),yk&&u&&u.length>1&&u2e.call(u[0],s,function(){for(f=1;f<arguments.length-2;f++)arguments[f]===void 0&&(u[f]=void 0)}),u&&m)for(u.groups=h=i2e(null),f=0;f<m.length;f++)p=m[f],h[p[0]]=u[p[1]];return u});var iD=gk,f2e=bAe,t4=iD;f2e({target:"RegExp",proto:!0,forced:/./.exec!==t4},{exec:t4});var n4=Lg,h2e=iD,r4=li,CB=Pg,p2e=X0,m2e=CB("species"),xx=RegExp.prototype,g2e=function(e,t,n,r){var o=CB(e),a=!r4(function(){var u={};return u[o]=function(){return 7},""[e](u)!=7}),i=a&&!r4(function(){var u=!1,f=/a/;return e==="split"&&(f={},f.constructor={},f.constructor[m2e]=function(){return f},f.flags="",f[o]=/./[o]),f.exec=function(){return u=!0,null},f[o](""),!u});if(!a||!i||n){var s=/./[o],l=t(o,""[e],function(u,f,h,p,m){var w=f.exec;return w===h2e||w===xx.exec?a&&!m?{done:!0,value:s.call(f,h,p)}:{done:!0,value:u.call(h,f,p)}:{done:!1}});n4(String.prototype,e,l[0]),n4(xx,o,l[1])}r&&p2e(xx[o],"sham",!0)},v2e=J0,y2e=Q0,b2e=q0,w2e=function(e){return function(t,n){var r=y2e(b2e(t)),o=v2e(n),a=r.length,i,s;return o<0||o>=a?e?"":void 0:(i=r.charCodeAt(o),i<55296||i>56319||o+1===a||(s=r.charCodeAt(o+1))<56320||s>57343?e?r.charAt(o):i:e?r.slice(o,o+2):(i-55296<<10)+(s-56320)+65536)}},S2e={charAt:w2e(!0)},T2e=S2e.charAt,x2e=function(e,t,n){return t+(n?T2e(e,t).length:1)},I2e=oB,k2e=Math.floor,E2e="".replace,C2e=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,M2e=/\$([$&'`]|\d{1,2})/g,D2e=function(e,t,n,r,o,a){var i=n+e.length,s=r.length,l=M2e;return o!==void 0&&(o=I2e(o),l=C2e),E2e.call(a,l,function(u,f){var h;switch(f.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(i);case"<":h=o[f.slice(1,-1)];break;default:var p=+f;if(p===0)return u;if(p>s){var m=k2e(p/10);return m===0?u:m<=s?r[m-1]===void 0?f.charAt(1):r[m-1]+f.charAt(1):u}h=r[p-1]}return h===void 0?"":h})},A2e=Jl,N2e=Ca,O2e=KM,P2e=iD,j2e=function(e,t){var n=e.exec;if(N2e(n)){var r=n.call(e,t);return r!==null&&A2e(r),r}if(O2e(e)==="RegExp")return P2e.call(e,t);throw TypeError("RegExp#exec called on incompatible receiver")},L2e=g2e,R2e=li,F2e=Jl,H2e=Ca,B2e=J0,_2e=gB,md=Q0,Y2e=q0,U2e=x2e,z2e=nB,V2e=D2e,W2e=j2e,G2e=Pg,bk=G2e("replace"),Z2e=Math.max,q2e=Math.min,K2e=function(e){return e===void 0?e:String(e)},$2e=function(){return"a".replace(/./,"$0")==="$0"}(),o4=function(){return/./[bk]?/./[bk]("a","$0")==="":!1}(),X2e=!R2e(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$<a>")!=="7"});L2e("replace",function(e,t,n){var r=o4?"$":"$0";return[function(a,i){var s=Y2e(this),l=a==null?void 0:z2e(a,bk);return l?l.call(a,s,i):t.call(md(s),a,i)},function(o,a){var i=F2e(this),s=md(o);if(typeof a=="string"&&a.indexOf(r)===-1&&a.indexOf("$<")===-1){var l=n(t,i,s,a);if(l.done)return l.value}var u=H2e(a);u||(a=md(a));var f=i.global;if(f){var h=i.unicode;i.lastIndex=0}for(var p=[];;){var m=W2e(i,s);if(m===null||(p.push(m),!f))break;var w=md(m[0]);w===""&&(i.lastIndex=U2e(s,_2e(i.lastIndex),h))}for(var b="",y=0,S=0;S<p.length;S++){m=p[S];for(var x=md(m[0]),E=Z2e(q2e(B2e(m.index),s.length),0),C=[],M=1;M<m.length;M++)C.push(K2e(m[M]));var k=m.groups;if(u){var O=[x].concat(C,E,s);k!==void 0&&O.push(k);var F=md(a.apply(void 0,O))}else F=V2e(x,s,E,C,k,a);E>=y&&(b+=s.slice(y,E)+F,y=E+x.length)}return b+s.slice(y)}]},!X2e||!$2e||o4);var J2e=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",Q2e=TypeError,eNe=function(e,t){if(e<t)throw new Q2e("Not enough arguments");return e},MB=Cr,tNe=dM,nNe=Zr,rNe=J2e,oNe=MH,aNe=H0,iNe=eNe,sNe=MB.Function,lNe=/MSIE .\./.test(oNe)||rNe&&function(){var e=MB.Bun.version.split(".");return e.length<3||e[0]==="0"&&(e[1]<3||e[1]==="3"&&e[2]==="0")}(),DB=function(e,t){var n=t?2:1;return lNe?function(r,o){var a=iNe(arguments.length,1)>n,i=nNe(r)?r:sNe(r),s=a?aNe(arguments,n):[],l=a?function(){tNe(i,this,s)}:i;return t?e(l,o):e(l)}:e},cNe=on,AB=Cr,uNe=DB,a4=uNe(AB.setInterval,!0);cNe({global:!0,bind:!0,forced:AB.setInterval!==a4},{setInterval:a4});var dNe=on,NB=Cr,fNe=DB,i4=fNe(NB.setTimeout,!0);dNe({global:!0,bind:!0,forced:NB.setTimeout!==i4},{setTimeout:i4});var hNe=Mr,pNe=hNe.setInterval,mNe=pNe;const gNe=Je(mNe);var vNe=tr,OB=function(e,t){var n=[][e];return!!n&&vNe(function(){n.call(null,t||function(){return 1},1)})},yNe=on,bNe=fM,wNe=zH.indexOf,SNe=OB,wk=bNe([].indexOf),PB=!!wk&&1/wk([1],1,-0)<0,TNe=PB||!SNe("indexOf");yNe({target:"Array",proto:!0,forced:TNe},{indexOf:function(t){var n=arguments.length>1?arguments[1]:void 0;return PB?wk(this,t,n)||0:wNe(this,t,n)}});var xNe=xu,INe=xNe("Array","indexOf"),kNe=tl,ENe=INe,Ix=Array.prototype,CNe=function(e){var t=e.indexOf;return e===Ix||kNe(Ix,e)&&t===Ix.indexOf?ENe:t},MNe=CNe,DNe=MNe,ANe=DNe;const NNe=Je(ANe);var s4=A0,ONe=TypeError,PNe=Line truncated
|
||||
`,M.current,s.path,i)}R()},[C,M,e,i,s,a]),D.useEffect(()=>{y&&(S(!1),E(""),setTimeout(async()=>{await k()},wI))},[t,h,p,m,w,b]),D.useEffect(()=>{y||setTimeout(async()=>{await k()},wI)},[]);const{memos:O}=Se.getState().memoState,F=Qje(O);return g.jsxs("div",{className:qt("memo-container",t),ref:C,style:{fontFamily:h!=="default"?h:void 0},children:[g.jsx(Ps,{when:x!=="",children:g.jsx("img",{className:"memo-shortcut-img",onClick:f,src:x})}),g.jsxs("div",{className:"memo-background",children:[g.jsx("div",{className:"property-image",style:{backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"}}),g.jsx("span",{className:"background-container"}),g.jsxs("div",{className:"thino-user-header",children:[g.jsx("div",{className:"thino-user-icon",ref:R=>{if(l?.MomentsIcon){R?.empty();return}l?.MomentsIcon||R&&A.setIcon(R,"Memos")},style:{backgroundImage:`url("${n}")`}}),g.jsxs("div",{className:"thino-user-info",children:[g.jsx("div",{className:"thino-user-name",children:l?.UserName}),l?.MomentsQuote&&g.jsx("div",{className:"thino-user-quote",children:l?.MomentsQuote})]})]}),g.jsx("div",{ref:M,className:"memo-content-text",style:{minHeight:l.MinHeightForShare||"200px",fontSize:`${b}px`}}),g.jsx("div",{className:"thino-time-footer",children:e.createdAt}),g.jsxs("div",{className:"watermark-container",children:[g.jsx("span",{className:"normal-text footer-start",children:m==="heatmap"?g.jsx("div",{className:"footer-heatmap",children:g.jsx(e4e,{data:F})}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"property-social-icons"}),g.jsx("span",{className:"name-text",children:r})]})}),g.jsx("span",{className:"normal-text footer-end",children:g.jsx("span",{className:"name-text",children:w||"THINO"})})]})]})]})},n4e=e=>{const{memo:t,destroy:n}=e,{memos:r}=Se.getState().memoState,{view:o,app:a,settings:i,verifyState:s}=Se.getState().dailyNotesState,l={...t,createdAtStr:je.getDateTimeString(t.createdAt)},[u,f]=D.useState(!1),h=D.useRef(null),p=D.useRef(null),m=D.useRef(null),[w,b]=D.useState(e.style||(a||window.app).loadLocalStorage("memoShareDialogStyle")||"clean"),[y,S]=D.useState(""),[x,E]=D.useState((a||window.app).loadLocalStorage("memoShareDialogFont")||"default"),[C,M]=D.useState((a||window.app).loadLocalStorage("memoShareDialogBackground")||"default"),k=D.useRef(null),[O,F]=D.useState((a||window.app).loadLocalStorage("memoShareDialogLeftContent")||"default"),[R,B]=D.useState((a||window.app).loadLocalStorage("memoShareDialogRightContent")||""),[Y,H]=D.useState(parseInt((a||window.app).loadLocalStorage("memoShareDialogFontSize")||"14")),[Z,W]=_.useState(i?.MomentsIcon),K=[{value:"default",label:I("Default font")},{value:"serif",label:"Serif"},{value:"sans-serif",label:"Sans Serif"},{value:"monospace",label:"Monospace"},{value:"Georgia",label:"Georgia"},{value:"Times New Roman",label:"Times New Roman"},{value:"Arial",label:"Arial"},{value:"Helvetica",label:"Helvetica"},{value:"Courier New",label:"Courier New"}],V=[{value:"default",label:I("Default background")},{value:"custom",label:I("Select local image")},{value:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImEiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjEwMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNmZmNkYjIiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmI3YjciLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48cmVjdCB3aWR0aD0iNDAwIiBoZWlnaHQ9IjQwMCIgZmlsbD0idXJsKCNhKSIvPjwvc3ZnPg==",label:I("Orange gradient")},{value:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImIiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjEwMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNhZGJlZmYiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNhM2E4ZjUiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48cmVjdCB3aWR0aD0iNDAwIiBoZWlnaHQ9IjQwMCIgZmlsbD0idXJsKCNiKSIvPjwvc3ZnPg==",label:I("Blue gradient")},{value:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImMiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjEwMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNjZGZiZjAiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNhM2Y0YzQiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48cmVjdCB3aWR0aD0iNDAwIiBoZWlnaHQ9IjQwMCIgZmlsbD0idXJsKCNjKSIvPjwvc3ZnPg==",label:I("Green gradient")},{value:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImQiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjEwMCUiPjxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNmZGNmZGYiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmYmNmZTgiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48cmVjdCB3aWR0aD0iNDAwIiBoZWlnaHQ9IjQwMCIgZmlsbD0idXJsKCNkKSIvPjwvc3ZnPg==",label:I("Pink gradient")}];D.useEffect(()=>{if(!i?.MomentsIcon||!a)return;const Ie=a.vault.adapter.getResourcePath(A.normalizePath(i.MomentsIcon));Ie&&!
Line truncated
|
||||
`,i.current,o.path,r),i.current?.querySelectorAll(".internal-link")?.forEach(x=>{const E=x,C=E.getAttribute("data-href");if(!C)return;t.metadataCache.getFirstLinkpathDest(C,o.path)||x.classList.add("is-unresolved"),E.addEventListener("mouseover",k=>{k.stopPropagation(),t.workspace.trigger("hover-link",{event:k,source:"thino",hoverParent:r.containerEl,targetEl:E,linktext:C,sourcePath:E.href})})})}y()},[o.content,s]);const p=async()=>{switch(f.sourceType){case"DAILY":await lC(f.id,f.path);break;case"CANVAS":await uC(f.id,f.path);break;case"MULTI":await sC(f.path);break;case"FILE":await cC(f.id,f.path);break}},m=async()=>{try{if(n.DeleteThinoDirectly)await le.deleteMemoById(f.id);else{const y=await le.hideMemoById(f.id);y&&le.editMemo(y)}}catch(y){new A.Notice(y.message)}},w=async()=>{try{const y=await le.unarchiveMemo(f);y&&le.editMemo(y),a(f.id),new A.Notice(I("RESTORE SUCCEED"))}catch(y){new A.Notice(y.message)}},b=y=>{y.stopPropagation();const S=new A.Menu;S.addItem(x=>{x.setTitle(I("RESTORE")).setIcon("archive-restore").onClick(w)}),S.addItem(x=>{x.setTitle(I("SOURCE")).setIcon("home").onClick(p)}),S.addItem(x=>{x.setTitle(I("DELETE")).setIcon("trash").setWarning(!0).onClick(()=>{const E=new A.Menu;E.addItem(C=>{C.setTitle(I("CONFIRM!")).setIcon("trash").setWarning(!0).onClick(m)}),E.addItem(C=>{C.setTitle(I("Cancel")).setIcon("x").onClick(()=>{})}),E.showAtMouseEvent(y.nativeEvent)})}),S.showAtMouseEvent(y.nativeEvent)};return g.jsxs("div",{ref:s,className:`memo-wrapper ${"memos-"+f.id}`,children:[g.jsxs("div",{className:"memo-top-wrapper",children:[g.jsxs("span",{className:"time-text",children:[I("ARCHIVED AT")," ",f.updatedAt]}),g.jsx("div",{className:"btns-container",children:g.jsx("span",{ref:h,className:"btn more-action-btn",onClick:b})})]}),g.jsx("div",{ref:i,className:"memo-content-text"})]})},Rs=({title:e,showSidebar:t=!1,onShowSidebarClick:n,showHomeButton:r=!0,children:o,rightContent:a})=>{const i=D.useCallback(()=>{n?n():Ge.setShowSiderbarInMobileView(!0)},[n]),s=D.useCallback(()=>{Ye.clearQuery(),Ye.setPathname("/")},[]);return g.jsxs("div",{className:"section-header-container",children:[g.jsx("div",{className:"title-wrapper",children:g.jsx("div",{className:"title-btns-left-wrapper",children:g.jsxs("div",{className:"title-text",children:[t&&g.jsx(Ps,{when:!0,children:g.jsx("button",{ref:l=>{l&&A.setIcon(l,"menu")},className:"btn action-btn clickable-icon",onClick:i})}),e&&g.jsx("span",{className:"normal-text",children:e}),r&&g.jsxs("button",{className:"go-home-btn",onClick:s,children:["🏠 ",I("Return To Home Page")]}),o]})})}),a&&g.jsx("div",{className:"title-btns-right-wrapper",children:a})]})},Es=e=>{const t=new Map;for(const n of e){const r=n.path;t.has(r)||t.set(r,[]),t.get(r)?.push(n)}return Array.from(t).map(([n,r])=>({path:n,thinos:r}))},o4e=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n},dailyNotesState:{plugin:r}}=D.useContext(it),o=Ql(),[a,i]=D.useState([]),s=_.useRef(null),l=_.useRef(null);D.useEffect(()=>{l.current&&A.setIcon(l.current,"more-horizontal")},[l]),D.useEffect(()=>{Bl({memos:n,query:e,filterOptions:{filterDoneTasks:!1,onlyFilterType:"archived"},plugin:r}).then(w=>{i(w)}),o.setFinish()},[n,s.current,e]);const u=D.useCallback(w=>{i(b=>b.filter(y=>y.id!==w))},[]),f=D.useCallback(w=>{i(b=>b.filter(y=>y.id!==w))},[]);D.useCallback(()=>{Ge.setShowSiderbarInMobileView(!0)},[]);const h=async()=>{if(!(a?.length>0))return;if(!await Hi()){It();return}const w=[...a];try{const b=w.filter(E=>E.sourceType==="DAILY"),y=w.filter(E=>E.sourceType!=="DAILY"),S=await le.unarchiveThinoBulk(y);for(const E of S)E&&le.editMemo(E);const x=Es(b);for(const{path:E,thinos:C}of x)await le.dealWithDailyThinoBulk(E,C,"restoreFromArchive");new A.Notice(I("RESTORE SUCCEED")),Ye.clearQuery()}catch(b){console.error("error",b),new A.Notice(b.message)}},p=async()=>{if(!(a?.length>0))return;if(!await Hi()){It();return}const w=[...a],b=Ze.getState().settings.DeleteThinoDirectly;try{const y=w.filter(E=>E.sourceType==="DAILY"),S=w.filter(E=>E.sourceType!=="DAILY");for(const E of S)if(b)await le.deleteMemoById(E.id);else{const C=await le.hideMemoById(E.id);C&&le.editMemo(C)}const x=Es(y);for(const{path:E,thinos:C}of x)await le.dealWithDailyThinoBulk(E,C,b?"deleteForever":"delete");Ye.clearQuery()}catch(y){console.error("error",y),new A.Notice(y.message)}},m=w=>{const b=new A.Menu;b.addItem(y=>{y.setTitle(I("Bulk restore")).setIcon("archive").onClick(async()=>{new Ka(app,I("RESTORE"),async S=>{S==="confirm"&&await h()}).open()})}).addItem(y=>{y.setTitle(I("Bulk delete")).setIcon("trash").onClick(async()=>{new Ka(app,I("DELETE"),async S=>{S==="confirm"&&await p()}).open()})}),b.showAtMouseEvent(w.nativeEvent)};return g.jsxs("div",{className:"memo-trash-wrapper",ref:s,children:[g.jsx(Rs,{showSidebar:t,rightContent:g.jsx("div",{className:"header-right-section",children:g.jsx(ig,{})}),children:g.jsx("span",{ref:l,className:"menu-popup-btn",onClick:m})}),g.jsx(Hg,{thinosCount:a
Line truncated
|
||||
${W.content.split(`
|
||||
`).map(V=>V.trim()?`> ${V}
|
||||
`:`>
|
||||
`)}
|
||||
|
||||
`+(K===t.length-1?`
|
||||
|
||||
`:`
|
||||
|
||||
------
|
||||
|
||||
`)});const Z={createdAt:A.moment().format("YYYY/MM/DD HH:mm:ss"),updatedAt:A.moment().format("YYYY/MM/DD HH:mm:ss"),content:H.replace(/(^|\n),>/g,`
|
||||
>`),id:"temp-"+Math.random().toString(36).substr(2,9),thinoType:"JOURNAL",sourceType:"DAILY",rowStatus:"NORMAL",visibility:"PRIVATE",pinned:!1,creatorName:"thino",deletedAt:"",path:"",resourceList:[]};Yc(Z,"clean")})}),B.addSeparator(),o){case"/":B.addItem(Y=>{Y.setTitle(I("Bulk tag operation")).setIcon("hash").onClick(async()=>{await k()})}).addItem(Y=>{Y.setTitle(I("Bulk archive")).setIcon("archive").onClick(async()=>{new Ka(i,I("ARCHIVE"),async H=>{H==="confirm"&&await M()}).open()})}).addItem(Y=>{Y.setTitle(I("Bulk delete")).setIcon("trash").onClick(async()=>{new Ka(i,I("DELETE"),async H=>{H==="confirm"&&await S()}).open()})});break;case"/archive":B.addItem(Y=>{Y.setTitle(I("Bulk restore")).setIcon("archive").onClick(async()=>{new Ka(i,I("RESTORE"),async H=>{H==="confirm"&&await E()}).open()})}).addItem(Y=>{Y.setTitle(I("Bulk delete")).setIcon("trash").onClick(async()=>{new Ka(i,I("DELETE"),async H=>{H==="confirm"&&await S()}).open()})});break;case"/recycle":B.addItem(Y=>{Y.setTitle(I("Bulk restore")).setIcon("archive-restore").onClick(async()=>{new Ka(i,I("RESTORE"),async H=>{H==="confirm"&&await C()}).open()})}).addItem(Y=>{Y.setTitle(I("Bulk delete")).setIcon("trash").onClick(async()=>{new Ka(i,I("DELETE"),async H=>{H==="confirm"&&await x()}).open()})});break}B.showAtMouseEvent(R.nativeEvent)};return g.jsxs("div",{className:`filter-query-container ${w?"":"thino-hidden"}`,children:[g.jsxs("div",{className:"filter-query",children:[g.jsx("span",{className:"tip-text",children:I("FILTER")}),g.jsxs("div",{"data-filter-type":"query",className:"filter-item-container "+(m?"":"thino-hidden"),onClick:()=>{Ye.setMemoFilter("")},children:[g.jsx("span",{className:"icon-text",children:"🔖"})," ",m?.title]}),g.jsxs("div",{"data-filter-type":"tag",className:"filter-item-container "+(s?"":"thino-hidden"),onClick:()=>{Ye.setTagQuery("")},children:[g.jsx("span",{className:"icon-text",children:"🏷️"})," ",s]}),g.jsxs("div",{"data-filter-type":"type",className:"filter-item-container "+(u?"":"thino-hidden"),onClick:()=>{Ye.setMemoTypeQuery("")},children:[g.jsx("span",{className:"icon-text",children:"📦"})," ",o$(u)]}),l&&l.from<l.to&&g.jsxs("div",{"data-filter-type":"date",className:"filter-item-container",children:[g.jsxs("div",{className:"day-picker-component-group",children:[g.jsx("span",{className:"icon-text",children:"🗓️"})," ",g.jsx(bb,{type:"text",startOrEnd:"start",defaultValue:A.moment(l.from,"x").valueOf(),handleValueChange:R=>{const B=A.moment(l.to,"x"),Y=A.moment(R,"x"),H=Y.isAfter(B)||Y.isSame(B);Ye.setFromAndToQuery(H?B.startOf("day").valueOf():A.moment(R,"x").startOf("day").valueOf(),l.to)}}),g.jsx("span",{children:I("to")}),g.jsx(bb,{type:"text",startOrEnd:"end",defaultValue:A.moment(l.to,"x").add(1,"days").valueOf(),handleValueChange:R=>{const B=A.moment(l.from,"x"),Y=A.moment(R,"x"),H=Y.isBefore(B)||Y.isSame(B),Z=A.moment(R,"x").endOf("day").valueOf();Ye.setFromAndToQuery(l.from,H?B.endOf("day").valueOf():Z)}})]}),g.jsx("div",{ref:R=>R&&A.setIcon(R,"x"),className:"btn close-btn",onClick:()=>{Ye.setFromAndToQuery(0,0)}})]}),g.jsxs("div",{className:"filter-item-container "+(f?"":"thino-hidden"),onClick:()=>{Ye.setTextQuery("")},children:[g.jsx("span",{className:"icon-text",children:"🔍"})," ",f]}),g.jsxs("div",{className:"filter-item-container "+(p?"":"thino-hidden"),onClick:()=>{Ye.setPathQuery("")},children:[g.jsx("span",{className:"icon-text",children:"📦"})," ",g.jsx("span",{className:"path-text",children:p})]})]}),g.jsxs("div",{className:"thino-filter-items",children:[e&&g.jsx("div",{className:"thinos-count",children:`${e?`${e} Thinos `:""}`}),g.jsx("div",{ref:b,className:"btn memo-action-menu",onClick:F})]})]})},Uc=async e=>{const{app:t,settings:n}=Ze.getState();if(!n.startSync||!t?.loadLocalStorage("tokenForSync"))return;const r=await gZ(e);if(!r||r.length===0)return;r.sort((i,s)=>A.moment(i.createdAt,"YYYY/MM/DD HH:mm:ss").isAfter(A.moment(s.createdAt,"YYYY/MM/DD HH:mm:ss"))?1:-1);const o=r.filter(i=>!i.deleted),a=r.filter(i=>i.deleted);for(let i=0;i<o.length;i++){const s=o[i],l=await le.createOrPatchThinoFromWeb(s);l&&le.pushMemo(l)}for(let i=0;i<a.length;i++){const s=a[i],l=le.getMemoByWebId(s.id);l&&await le.deleteMemoById(l.id,"local")}le.updateTagsState(),c4e(t)};function s4e(){const{settings:e,app:t,view:n}=Ze.getState(),{globalState:{loaded:r,memoListView:o}}=D.useContext(it),a=A.Platform.isMobile&&e.DefaultEditorLocation==="Bottom",i=_.useRef(null),[s,l]=_.useState([]),[u,f]=_.useState((window.app||t).loadLocalStorage("thinoListView")||"list"),[h,p]=D.useState(()=>_je(t||window.app)),m=b=>{p(b)};D.useEffect(()=>{o===u||!o||(f(o),t&&t?.saveLocalStorage("thinoListView",o))},[o]),D.useEffect(()=>{if(e.SyncManually||!t||!r||!n||!t?.loadLocalStorage("tokenForSync")||!e.startSync)return;i.current=window.setInterval(async()=>{const S=Ik(t);await Uc(S)},3e4),n.registerInterval(i.current);const y=Ik(t);return Uc(y),()=>{i.current&&window.clearInterval(i.current)}},[n,t,r,e.startSync
Line truncated
|
||||
`&&P.push(`
|
||||
`),pe!==null&&P.push(w(""+pe)),null;case"input":P.push(H("input")),Ke=bt=ze=pe=null;for(Ce in X)if(n.call(X,Ce)&&(ht=X[Ce],ht!=null))switch(Ce){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,"input"));case"defaultChecked":Ke=ht;break;case"defaultValue":ze=ht;break;case"checked":bt=ht;break;case"value":pe=ht;break;default:k(P,oe,Ce,ht)}return bt!==null?k(P,oe,"checked",bt):Ke!==null&&k(P,oe,"checked",Ke),pe!==null?k(P,oe,"value",pe):ze!==null&&k(P,oe,"value",ze),P.push("/>"),null;case"menuitem":P.push(H("menuitem"));for(var co in X)if(n.call(X,co)&&(pe=X[co],pe!=null))switch(co){case"children":case"dangerouslySetInnerHTML":throw Error(t(400));default:k(P,oe,co,pe)}return P.push(">"),null;case"title":P.push(H("title")),pe=null;for(tn in X)if(n.call(X,tn)&&(Ce=X[tn],Ce!=null))switch(tn){case"children":pe=Ce;break;case"dangerouslySetInnerHTML":throw Error(t(434));default:k(P,oe,tn,Ce)}return P.push(">"),pe;case"listing":case"pre":P.push(H(z)),Ce=pe=null;for(Ke in X)if(n.call(X,Ke)&&(ze=X[Ke],ze!=null))switch(Ke){case"children":pe=ze;break;case"dangerouslySetInnerHTML":Ce=ze;break;default:k(P,oe,Ke,ze)}if(P.push(">"),Ce!=null){if(pe!=null)throw Error(t(60));if(typeof Ce!="object"||!("__html"in Ce))throw Error(t(61));X=Ce.__html,X!=null&&(typeof X=="string"&&0<X.length&&X[0]===`
|
||||
`?P.push(`
|
||||
`,X):P.push(""+X))}return typeof pe=="string"&&pe[0]===`
|
||||
`&&P.push(`
|
||||
`),pe;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":P.push(H(z));for(var uo in X)if(n.call(X,uo)&&(pe=X[uo],pe!=null))switch(uo){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,z));default:k(P,oe,uo,pe)}return P.push("/>"),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return R(P,X,z,oe);case"html":return ve.insertionMode===0&&P.push("<!DOCTYPE html>"),R(P,X,z,oe);default:if(z.indexOf("-")===-1&&typeof X.is!="string")return R(P,X,z,oe);P.push(H(z)),Ce=pe=null;for(ht in X)if(n.call(X,ht)&&(ze=X[ht],ze!=null))switch(ht){case"children":pe=ze;break;case"dangerouslySetInnerHTML":Ce=ze;break;case"style":M(P,oe,ze);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:i(ht)&&typeof ze!="function"&&typeof ze!="symbol"&&P.push(" ",ht,'="',w(ze),'"')}return P.push(">"),O(P,Ce,pe),pe}}function W(P,z,X){if(P.push('<!--$?--><template id="'),X===null)throw Error(t(395));return P.push(X),P.push('"></template>')}function K(P,z,X,oe){switch(X.insertionMode){case 0:case 1:return P.push('<div hidden id="'),P.push(z.segmentPrefix),z=oe.toString(16),P.push(z),P.push('">');case 2:return P.push('<svg aria-hidden="true" style="display:none" id="'),P.push(z.segmentPrefix),z=oe.toString(16),P.push(z),P.push('">');case 3:return P.push('<math aria-hidden="true" style="display:none" id="'),P.push(z.segmentPrefix),z=oe.toString(16),P.push(z),P.push('">');case 4:return P.push('<table hidden id="'),P.push(z.segmentPrefix),z=oe.toString(16),P.push(z),P.push('">');case 5:return P.push('<table hidden><tbody id="'),P.push(z.segmentPrefix),z=oe.toString(16),P.push(z),P.push('">');case 6:return P.push('<table hidden><tr id="'),P.push(z.segmentPrefix),z=oe.toString(16),P.push(z),P.push('">');case 7:return P.push('<table hidden><colgroup id="'),P.push(z.segmentPrefix),z=oe.toString(16),P.push(z),P.push('">');default:throw Error(t(397))}}function V(P,z){switch(z.insertionMode){case 0:case 1:return P.push("</div>");case 2:return P.push("</svg>");case 3:return P.push("</math>");case 4:return P.push("</table>");case 5:return P.push("</tbody></table>");case 6:return P.push("</tr></table>");case 7:return P.push("</colgroup></table>");default:throw Error(t(397))}}var ne=/[<\u2028\u2029]/g;function Q(P){return JSON.stringify(P).replace(ne,function(z){switch(z){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}function te(P,z){return z=z===void 0?"":z,{bootstrapChunks:[],startInlineScript:"<script>",placeholderPrefix:z+"P:",segmentPrefix:z+"S:",boundaryPrefix:z+"B:",idPrefix:z,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,generateStaticMarkup:P}}function G(P,z,X,oe){return X.generateStaticMarkup?(P.push(w(z)),!1):(z===""?P=oe:(oe&&P.push("<!-- -->"),P.push(w(z)),P=!0),P)}var J=Object.assign,ee=Symbol.for("react.element"),ie=Symbol.for("react.portal"),fe=Symbol.for("react.fragment"),he=Symbol.for("react.strict_mode"),we=Symbol.for("react.profiler"),Ne=Symbol.for("react.provider"),Ae=Symbol.for("react.context"),Te=Symbol.for("react.forward_ref"),Fe=Symbol.for("react.suspense"),We=Symbol.for("react.suspense_list"),ke=Symbol.for("react.memo"),Ie=Symbol.for("react.lazy"),ce=Symbol.for("react.scope"),Pe=Symbol.for("react.debug_trace_mode"),Oe=Symbol.for("react.legacy_hidden"),Ve=Symbol.for("react.default_value"),tt=Symbol.iterator;function ot(P){if(P==null)return null;if(typeof P=="function")return P.displayName||P.name||null;if(typeof P=="string")return P;switch(P){case fe:return"Fragment";case ie:return"Portal";case we:return"Profiler";case he:return"StrictMode";case Fe:return"Suspense";case We:return"SuspenseList"}if(typeof P=="object")switch(P.$$typeof){case Ae:return(P.displayName||"Context")+".Consumer";case Ne:return(P._context.displayName||"Context")+".Provider";case Te:var z=P.render;return P=P.displayName,P||(P=z.displayName||z.name||"",P=P!==""?"ForwardRef("+P+")":"ForwardRef"),P;case ke:return z=P.displayName||null,z!==null?z:ot(P.type)||"Memo";case Ie:z=P._payload,P=P._init;try{return ot(P(z))}catch{}}return null}var st={};function wt(P,z){if(P=P.contextTypes,!P)return st;var X={},oe;for(oe in P)X[oe]=z[oe];return X}var Ot=null;function Wt(P,z){if(P!==z){P.context._currentValue2=P.parentValue,P=P.parent;var X=z.parent;if(P===null){if(X!==null)throw Error(t(401))}else{if(X===null)throw Error(t(401));Wt(P,X)}z.context._currentValue2=z.value}}function an(P){P.context._currentValue2=P.parentValue,P=P.parent,P!==null&&an(P)}function mn(P){var z=P.parent;z!==null&&mn(z),P.co
Line truncated
|
||||
`),wt=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Ot=new Map;function Wt(j){var U=Ot.get(j);if(U===void 0){if(!wt.test(j))throw Error(t(65,j));U=u("<"+j),Ot.set(j,U)}return U}var an=u("<!DOCTYPE html>");function mn(j,U,$,re,be){switch(U){case"select":j.push(Wt("select"));var ge=null,Me=null;for(vt in $)if(h.call($,vt)){var _e=$[vt];if(_e!=null)switch(vt){case"children":ge=_e;break;case"dangerouslySetInnerHTML":Me=_e;break;case"defaultValue":case"value":break;default:Ie(j,re,vt,_e)}}return j.push(ce),Oe(j,Me,ge),ge;case"option":Me=be.selectedValue,j.push(Wt("option"));var ft=_e=null,xt=null,vt=null;for(ge in $)if(h.call($,ge)){var ln=$[ge];if(ln!=null)switch(ge){case"children":_e=ln;break;case"selected":xt=ln;break;case"dangerouslySetInnerHTML":vt=ln;break;case"value":ft=ln;default:Ie(j,re,ge,ln)}}if(Me!=null)if($=ft!==null?""+ft:Ve(_e),B(Me)){for(re=0;re<Me.length;re++)if(""+Me[re]===$){j.push(tt);break}}else""+Me===$&&j.push(tt);else xt&&j.push(tt);return j.push(ce),Oe(j,vt,_e),_e;case"textarea":j.push(Wt("textarea")),vt=Me=ge=null;for(_e in $)if(h.call($,_e)&&(ft=$[_e],ft!=null))switch(_e){case"children":vt=ft;break;case"value":ge=ft;break;case"defaultValue":Me=ft;break;case"dangerouslySetInnerHTML":throw Error(t(91));default:Ie(j,re,_e,ft)}if(ge===null&&Me!==null&&(ge=Me),j.push(ce),vt!=null){if(ge!=null)throw Error(t(92));if(B(vt)&&1<vt.length)throw Error(t(93));ge=""+vt}return typeof ge=="string"&&ge[0]===`
|
||||
`&&j.push(st),ge!==null&&j.push(l(O(""+ge))),null;case"input":j.push(Wt("input")),ft=vt=_e=ge=null;for(Me in $)if(h.call($,Me)&&(xt=$[Me],xt!=null))switch(Me){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,"input"));case"defaultChecked":ft=xt;break;case"defaultValue":_e=xt;break;case"checked":vt=xt;break;case"value":ge=xt;break;default:Ie(j,re,Me,xt)}return vt!==null?Ie(j,re,"checked",vt):ft!==null&&Ie(j,re,"checked",ft),ge!==null?Ie(j,re,"value",ge):_e!==null&&Ie(j,re,"value",_e),j.push(Pe),null;case"menuitem":j.push(Wt("menuitem"));for(var Pr in $)if(h.call($,Pr)&&(ge=$[Pr],ge!=null))switch(Pr){case"children":case"dangerouslySetInnerHTML":throw Error(t(400));default:Ie(j,re,Pr,ge)}return j.push(ce),null;case"title":j.push(Wt("title")),ge=null;for(ln in $)if(h.call($,ln)&&(Me=$[ln],Me!=null))switch(ln){case"children":ge=Me;break;case"dangerouslySetInnerHTML":throw Error(t(434));default:Ie(j,re,ln,Me)}return j.push(ce),ge;case"listing":case"pre":j.push(Wt(U)),Me=ge=null;for(ft in $)if(h.call($,ft)&&(_e=$[ft],_e!=null))switch(ft){case"children":ge=_e;break;case"dangerouslySetInnerHTML":Me=_e;break;default:Ie(j,re,ft,_e)}if(j.push(ce),Me!=null){if(ge!=null)throw Error(t(60));if(typeof Me!="object"||!("__html"in Me))throw Error(t(61));$=Me.__html,$!=null&&(typeof $=="string"&&0<$.length&&$[0]===`
|
||||
`?j.push(st,l($)):j.push(l(""+$)))}return typeof ge=="string"&&ge[0]===`
|
||||
`&&j.push(st),ge;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":j.push(Wt(U));for(var mo in $)if(h.call($,mo)&&(ge=$[mo],ge!=null))switch(mo){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,U));default:Ie(j,re,mo,ge)}return j.push(Pe),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return ot(j,$,U,re);case"html":return be.insertionMode===0&&j.push(an),ot(j,$,U,re);default:if(U.indexOf("-")===-1&&typeof $.is!="string")return ot(j,$,U,re);j.push(Wt(U)),Me=ge=null;for(xt in $)if(h.call($,xt)&&(_e=$[xt],_e!=null))switch(xt){case"children":ge=_e;break;case"dangerouslySetInnerHTML":Me=_e;break;case"style":Ae(j,re,_e);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:b(xt)&&typeof _e!="function"&&typeof _e!="symbol"&&j.push(Te,l(xt),Fe,l(O(_e)),We)}return j.push(ce),Oe(j,Me,ge),ge}}var Fn=u("</"),qe=u(">"),mt=u('<template id="'),Tt=u('"></template>'),Et=u("<!--$-->"),Lt=u('<!--$?--><template id="'),mr=u('"></template>'),gr=u("<!--$!-->"),Da=u("<!--/$-->"),ao=u("<template"),Zn=u('"'),qr=u(' data-dgst="');u(' data-msg="'),u(' data-stck="');var io=u("></template>");function En(j,U,$){if(o(j,Lt),$===null)throw Error(t(395));return o(j,$),a(j,mr)}var na=u('<div hidden id="'),Dr=u('">'),Ct=u("</div>"),so=u('<svg aria-hidden="true" style="display:none" id="'),lo=u('">'),ra=u("</svg>"),Hn=u('<math aria-hidden="true" style="display:none" id="'),oa=u('">'),Ar=u("</math>"),ui=u('<table hidden id="'),Aa=u('">'),rs=u("</table>"),di=u('<table hidden><tbody id="'),Du=u('">'),fi=u("</tbody></table>"),ol=u('<table hidden><tr id="'),al=u('">'),hi=u("</tr></table>"),Au=u('<table hidden><colgroup id="'),il=u('">'),ac=u("</colgroup></table>");function Na(j,U,$,re){switch($.insertionMode){case 0:case 1:return o(j,na),o(j,U.segmentPrefix),o(j,l(re.toString(16))),a(j,Dr);case 2:return o(j,so),o(j,U.segmentPrefix),o(j,l(re.toString(16))),a(j,lo);case 3:return o(j,Hn),o(j,U.segmentPrefix),o(j,l(re.toString(16))),a(j,oa);case 4:return o(j,ui),o(j,U.segmentPrefix),o(j,l(re.toString(16))),a(j,Aa);case 5:return o(j,di),o(j,U.segmentPrefix),o(j,l(re.toString(16))),a(j,Du);case 6:return o(j,ol),o(j,U.segmentPrefix),o(j,l(re.toString(16))),a(j,al);case 7:return o(j,Au),o(j,U.segmentPrefix),o(j,l(re.toString(16))),a(j,il);default:throw Error(t(397))}}function pi(j,U){switch(U.insertionMode){case 0:case 1:return a(j,Ct);case 2:return a(j,ra);case 3:return a(j,Ar);case 4:return a(j,rs);case 5:return a(j,fi);case 6:return a(j,hi);case 7:return a(j,ac);default:throw Error(t(397))}}var Nu=u('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),ic=u('$RS("'),os=u('","'),mi=u('")<\/script>'),as=u('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),sc=u('$RC("'),Ou=u('","'),Pu=u('")<\/script>'),sn=u('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),vr=u('$RX("'),sl=u('"'),ll=u(")<\/script>"),gi=u(","),ju=/[<\u2028\u2029]/g;function Oa(j){return JSON.stringify(j).replace(ju,function(U){switch(U){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var Lo=Object.assign,Kr=Symbol.for("react.element"),is=Symbol.for("react.portal"),qn=Symbol.for("react.fragment"),lc=Symbol.for("react.strict_mode"),cc=Symbol.for("react.profiler"),uc=Symbol.for("react.provider"),Pa=Symbol.for("react.context"),ss=Symbol.for("react.forward_ref"),vi=Symbol.for("react.suspense"),yi=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),X=Symbol.for("react.scope"),oe=Symbol.for("react.debug_trace_mode"),ve=Symbol.for("react.legacy_hidden"),pe=Symbol.for("react.default_value"),Ce=Symbol.iterator;function ze(j){if(j==null)return null;if(typeof j=="function")return j.displayName||j.name||null;if(typeof j=="string")return j;switch(j){case qn:return"Fragment";case is:return"Portal";case cc:return"Profiler";case lc:return"StrictMode";case vi:return"Suspense";case yi:return"SuspenseList"}if(t
Line truncated
|
||||
`,a.current,t.path,w),a.current?.querySelectorAll(".internal-link")?.forEach(S=>{const x=S,E=x.getAttribute("data-href");if(!E)return;r.app.metadataCache.getFirstLinkpathDest(E,t.path)||S.classList.add("is-unresolved"),x.addEventListener("mouseover",M=>{M.stopPropagation(),r.app.workspace.trigger("hover-link",{event:M,source:"thino",hoverParent:w.containerEl,targetEl:x,linktext:E,sourcePath:x.href})})})}b()},[t.content,i]);const f=async()=>{try{await le.deleteMemoById(o.id),n(o.id)}catch(w){new A.Notice(w.message)}},h=async()=>{switch(o.sourceType){case"DAILY":await lC(o.id,o.path);break;case"CANVAS":await uC(o.id,o.path);break;case"MULTI":await sC(o.path);break;case"FILE":await cC(o.id,o.path);break}},p=async()=>{try{const w=await le.restoreMemoById(o.id),y=r.app?.loadLocalStorage("tokenForSync");w&&w.webId&&y&&r.settings.startSync&&await Vp(w.webId),w&&le.editMemo(w),n(o.id),new A.Notice(I("RESTORE SUCCEED"))}catch(w){new A.Notice(w.message)}},m=w=>{w.stopPropagation();const b=new A.Menu;b.addItem(y=>{y.setTitle(I("RESTORE")).setIcon("archive-restore").onClick(p)}),b.addItem(y=>{y.setTitle(I("SOURCE")).setIcon("home").onClick(h)}),b.addItem(y=>{y.setTitle(I("DELETE")).setIcon("trash").setWarning(!0).onClick(()=>{const S=new A.Menu;S.addItem(x=>{x.setTitle(I("CONFIRM!")).setIcon("trash").setWarning(!0).onClick(f)}),S.addItem(x=>{x.setTitle(I("Cancel")).setIcon("x").onClick(()=>{})}),S.showAtMouseEvent(w.nativeEvent)})}),b.showAtMouseEvent(w.nativeEvent)};return g.jsxs("div",{ref:i,className:`memo-wrapper ${"memos-"+o.id}`,children:[g.jsxs("div",{className:"memo-top-wrapper",children:[g.jsxs("span",{className:"time-text",children:[I("DELETE AT")," ",o.deletedAtStr]}),g.jsx("div",{className:"btns-container",children:g.jsx("span",{ref:u,className:"btn more-action-btn",onClick:m})})]}),g.jsx("div",{ref:a,className:"memo-content-text",onContextMenu:w=>{w.preventDefault(),w.stopPropagation()}})]})},ID=({isLoading:e,isEmpty:t,emptyMessage:n=I("Here is No Memos.")})=>e?g.jsx("div",{className:"tip-text-container",children:g.jsx("span",{className:"tip-text",children:I("Fetching data...")})}):t?g.jsx("div",{className:"tip-text-container",children:g.jsx("span",{className:"tip-text",children:n})}):null,W4e=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n},dailyNotesState:{app:r,plugin:o}}=D.useContext(it),a=Ql(),[i,s]=D.useState([]),l=_.useRef(null),u=_.useRef(null);D.useEffect(()=>{u.current&&A.setIcon(u.current,"more-horizontal")},[u]),D.useEffect(()=>{Bl({memos:n,query:e,filterOptions:{filterDoneTasks:!1,onlyFilterType:"deleted"},plugin:o}).then(b=>{s(b)}),a.setFinish()},[n,l.current,e]);const f=D.useCallback(b=>{s(y=>y.filter(S=>S.id!==b))},[]),h=async()=>{if(!(i?.length>0))return;if(!await Hi()){It();return}const b=[...i],y=Ze.getState().settings.startSync,S=r?.loadLocalStorage("tokenForSync");try{const x=b.filter(M=>M.sourceType==="DAILY"),E=b.filter(M=>M.sourceType!=="DAILY");for(const M of E){const k=await le.restoreMemoById(M.id);k&&k.webId&&S&&y&&await Vp(k.webId),k&&le.editMemo(k)}const C=Es(x);for(const{path:M,thinos:k}of C){const O=await le.dealWithDailyThinoBulk(M,k,"restoreFromDelete");for(const F of O)F&&F.webId&&S&&y&&await Vp(F.webId)}Ye.clearQuery(),new A.Notice(I("RESTORE SUCCEED"))}catch(x){new A.Notice(x.message)}},p=async()=>{if(!(i?.length>0))return;if(!await Hi()){It();return}const b=[...i],y=Ze.getState().settings,S=r?.loadLocalStorage("tokenForSync");try{const x=b.filter(M=>M.sourceType==="DAILY"),E=b.filter(M=>M.sourceType!=="DAILY");for(const M of E)await le.deleteMemoById(M.id);const C=Es(x);for(const{path:M,thinos:k}of C){const O=await le.dealWithDailyThinoBulk(M,k,"deleteForever");if(!(!S||!y.startSync))for(const F of O)F&&F.webId&&await iC(F.webId)}Ye.clearQuery(),new A.Notice(I("DELETE SUCCEED"))}catch(x){console.error("error",x),new A.Notice(x.message)}},m=b=>{const y=new A.Menu;y.addItem(S=>{S.setTitle(I("Bulk restore")).setIcon("archive-restore").onClick(async()=>{new Ka(r,I("RESTORE"),async x=>{x==="confirm"&&await h()}).open()})}).addItem(S=>{S.setTitle(I("Bulk delete")).setIcon("trash").onClick(async()=>{new Ka(r,I("DELETE"),async x=>{x==="confirm"&&await p()}).open()})}),y.showAtMouseEvent(b.nativeEvent)},w=g.jsx(g.Fragment,{children:g.jsx("div",{className:"header-right-section",children:g.jsx(ig,{})})});return g.jsxs("div",{className:"memo-trash-wrapper",ref:l,children:[g.jsx(Rs,{showSidebar:t,rightContent:w,children:g.jsx("span",{ref:u,className:"menu-popup-btn",onClick:m})}),g.jsx(Hg,{thinosCount:i.length,thinos:i}),g.jsx(ID,{isLoading:a.isLoading,isEmpty:i.length===0}),!a.isLoading&&i.length>0&&g.jsx("div",{className:"deleted-memos-container",children:i.map(b=>g.jsx(V4e,{memo:b,handleDeletedMemoAction:f},`${b.id}-${b.updatedAt}`))})]})},G4e=()=>{const{globalState:e}=D.useContext(it),{useTinyUndoHistoryCache:t,shouldHideImageUrl:n,shouldSplitMemoWord:r,shouldUseMarkdownParser:o}=e,a=`👋 你好呀~欢迎使用memos!
|
||||
* ✨ **开源项目**;
|
||||
* 😋 精美且细节的视觉样式;
|
||||
* 📑 体验优良的交互逻辑;`,i=()=>{Ge.setAppSetting({useTinyUndoHistoryCache:!t})},s=()=>{Ge.setAppSetting({shouldSplitMemoWord:!r})},l=()=>{Ge.setAppSetting({shouldHideImageUrl:!n})},u=()=>{Ge.setAppSetting({shouldUseMarkdownParser:!o})},f=async()=>{const h=le.getState().memos.map(w=>({...w})),p=JSON.stringify(h),m=document.createElement("a");m.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(p)),m.setAttribute("download","data.json"),m.style.display="none",document.body.appendChild(m),m.click(),document.body.removeChild(m)};return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"section-container preferences-section-container",children:[g.jsx("p",{className:"title-text",children:"Memo 显示相关"}),g.jsx("div",{className:"demo-content-container memo-content-text",dangerouslySetInnerHTML:{__html:zp(a)}}),g.jsx("label",{className:"form-label checkbox-form-label",onClick:s,children:g.jsx("span",{className:"normal-text",children:"中英文内容自动间隔"})}),g.jsx("label",{className:"form-label checkbox-form-label",onClick:u,children:g.jsx("span",{className:"normal-text",children:"部分 markdown 格式解析"})}),g.jsx("label",{className:"form-label checkbox-form-label",onClick:l,children:g.jsx("span",{className:"normal-text",children:"隐藏图片链接地址"})})]}),g.jsxs("div",{className:"section-container preferences-section-container",children:[g.jsx("p",{className:"title-text",children:"编辑器"}),g.jsxs("label",{className:"form-label checkbox-form-label",onClick:i,children:[g.jsxs("span",{className:"normal-text",children:["启用"," ",g.jsx("a",{target:"_blank",href:"https://github.com/boojack/tiny-undo",onClick:h=>h.stopPropagation(),rel:"noreferrer",children:"tiny-undo"})]}),g.jsx("img",{className:"icon-img",src:t?checkboxActive:checkbox})]})]}),g.jsxs("div",{className:"section-container thino-hidden",children:[g.jsx("p",{className:"title-text",children:"其他"}),g.jsx("div",{className:"btn-container",children:g.jsx("button",{className:"btn export-btn",onClick:f,children:"导出数据(JSON)"})})]})]})},Z4e=()=>{const{globalState:{isMobileView:e}}=D.useContext(it);D.useEffect(()=>{le.fetchAllMemos()},[]);const t=D.useCallback(()=>{Ge.setShowSiderbarInMobileView(!0)},[]);return g.jsxs("div",{className:"preference-wrapper",children:[g.jsx("div",{className:"section-header-container",children:g.jsxs("div",{className:"title-text",children:[g.jsx(Ps,{when:e,children:g.jsx("button",{className:"action-btn",onClick:t})}),g.jsx("span",{className:"normal-text",children:"账号与设置"})]})}),g.jsx("div",{className:"sections-wrapper",children:g.jsx(G4e,{})})]})},q4e=()=>{const{dailyNotesState:{app:e,plugin:t,settings:n},locationState:{query:r},globalState:{isMobileView:o,changedByMemos:a},memoState:{memos:i}}=D.useContext(it),s=Ql(),[l,u]=D.useState([]),[f,h]=D.useState([]),p=_.useRef(null),m=_.useRef(null),[w,b]=D.useState(!1),[y,S]=D.useState([]),x=_.useRef([]);D.useEffect(()=>{m.current&&(A.setIcon(m.current,"refresh-cw"),e.workspace.on("refresh-review-memos",E))},[m]),D.useEffect(()=>{if(!w)return;if(r){Bl({memos:i,query:r,filterOptions:{filterDoneTasks:!1,filterArchived:!n.ViewArchiveInRandomReview},plugin:t}).then(M=>{const k=[...M].sort(()=>Math.random()-Math.random()).slice(0,10);u(k),b(!1)});return}const C=[...y].sort(()=>Math.random()-Math.random()).slice(0,10);u(C),b(!1)},[w,n.ViewArchiveInRandomReview]),D.useEffect(()=>{if(!(y.length>0))return;const C=[...y].sort(()=>Math.random()-Math.random()).slice(0,10);u(C),b(!1)},[y]),D.useEffect(()=>{p.current&&(Bl({memos:i,query:r,filterOptions:{filterDoneTasks:!1,filterArchived:!n.ViewArchiveInRandomReview},plugin:t}).then(C=>{S(C.filter(M=>M.rowStatus!=="ARCHIVED"&&!(M.deletedAt!==""&&M.deletedAt)))}),s.setFinish(),Ye.clearQuery())},[i,p.current,n.ViewArchiveInRandomReview]),D.useEffect(()=>{if(a&&x.current.length>0){const C=y.filter(k=>x.current.includes(k.id)),M=x.current.map(k=>C.find(O=>O.id===k)).filter(k=>k!==void 0);h(M);return}x.current=l.map(C=>C.id),h(l)},[l]),D.useEffect(()=>{l.length!==0&&Bl({memos:l,query:r,filterOptions:{filterDoneTasks:!1,filterArchived:!1},plugin:t}).then(C=>{h(C)})},[r]);const E=()=>{b(!0)};return g.jsxs("div",{className:"memo-review-wrapper",ref:p,children:[g.jsx(Rs,{showSidebar:o,children:g.jsx("span",{ref:m,onClick:E,className:"refresh-icon"})}),g.jsx(Hg,{}),g.jsx(ID,{isLoading:s.isLoading,isEmpty:i.length===0}),!s.isLoading&&i.length>0&&g.jsx("div",{className:"review-memos-container",children:f.map(C=>g.jsx(no,{memo:C},`${C?.id}-${C.createdAt}`))})]})};function C_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=C_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=C_(e))&&(r&&(r+=" "),r+=t);return r}function K4e(e){return e==null}var $4e=K4e;const jt=Je($4e);va
Line truncated
|
||||
A`).concat(i,",").concat(i,",0,1,1,").concat(2*s,",").concat(a,`
|
||||
H`).concat(ma,"M").concat(2*s,",").concat(a,`
|
||||
A`).concat(i,",").concat(i,",0,1,1,").concat(s,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return _.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(ma/8,"h").concat(ma,"v").concat(ma*3/4,"h").concat(-ma,"z"),className:"recharts-legend-icon"});if(_.isValidElement(r.legendIcon)){var u=u5e({},r);return delete u.legendIcon,_.cloneElement(r.legendIcon,u)}return _.createElement(AD,{fill:l,cx:a,cy:a,size:ma,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,o=this.props,a=o.payload,i=o.iconSize,s=o.layout,l=o.formatter,u=o.inactiveColor,f={x:0,y:0,width:ma,height:ma},h={display:s==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(m,w){var b=m.formatter||l,y=zt(mm(mm({"recharts-legend-item":!0},"legend-item-".concat(w),!0),"inactive",m.inactive));if(m.type==="none")return null;var S=Mt(m.value)?null:m.value;Hs(!Mt(m.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var x=m.inactive?u:m.color;return _.createElement("li",_k({className:y,style:h,key:"legend-item-".concat(w)},Xb(r.props,m,w)),_.createElement(Nk,{width:i,height:i,viewBox:f,style:p},r.renderIcon(m)),_.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},b?b(S,m,w):S))})}},{key:"render",value:function(){var r=this.props,o=r.payload,a=r.layout,i=r.align;if(!o||!o.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?i:"left"};return _.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(D.PureComponent);mm(ND,"displayName","Legend");mm(ND,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});function b5e(e){return e!==e}var w5e=b5e;function S5e(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}var T5e=S5e,x5e=c8,I5e=w5e,k5e=T5e;function E5e(e,t,n){return t===t?k5e(e,t,n):x5e(e,I5e,n)}var C5e=E5e,M5e=C5e;function D5e(e,t){var n=e==null?0:e.length;return!!n&&M5e(e,t,0)>-1}var A5e=D5e;function N5e(e,t,n){for(var r=-1,o=e==null?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}var O5e=N5e;function P5e(){}var j5e=P5e,_x=a8,L5e=j5e,R5e=_C,F5e=1/0,H5e=_x&&1/R5e(new _x([,-0]))[1]==F5e?function(e){return new _x(e)}:L5e,B5e=H5e,_5e=q6,Y5e=A5e,U5e=O5e,z5e=$6,V5e=B5e,W5e=_C,G5e=200;function Z5e(e,t,n){var r=-1,o=Y5e,a=e.length,i=!0,s=[],l=s;if(n)i=!1,o=U5e;else if(a>=G5e){var u=t?null:V5e(e);if(u)return W5e(u);i=!1,o=z5e,l=new _5e}else l=t?[]:s;e:for(;++r<a;){var f=e[r],h=t?t(f):f;if(f=n||f!==0?f:0,i&&h===h){for(var p=l.length;p--;)if(l[p]===h)continue e;t&&l.push(h),s.push(f)}else o(l,h,n)||(l!==s&&l.push(h),s.push(f))}return s}var q5e=Z5e,K5e=Qs,$5e=q5e;function X5e(e,t){return e&&e.length?$5e(e,K5e(t)):[]}var J5e=X5e;const lL=Je(J5e);function nY(e,t,n){return t===!0?lL(e,n):Mt(t)?lL(e,t):e}function nf(e){"@babel/helpers - typeof";return nf=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},nf(e)}var Q5e=["ref"];function cL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ss(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cL(Object(n),!0).forEach(function(r){uS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function e9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oY(r.key),r)}}function t9e(e,t,n){return t&&uL(e.prototype,t),n&&uL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function n9e(e,t,n){return t=ow(t),r9e(e,rY()?Reflect.construct(t,n||[],ow(e).constructor):t.apply(e,n))}function r9e(e,t){if(t&&(nf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return o9e(e)}function o9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rY=function(){return!!e})()}function ow(e){return ow=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ow(e)}function a9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("SupeLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h9e(e,t){if(e){if(typeof e=="string")return fL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fL(e,t)}}function fL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p9e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}function m9e(e){if(Array.isArray(e))return e}function hL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Yx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hL(Object(n),!0).forEach(function(r){g9e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g9e(e,t,n){return t=v9e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v9e(e){var t=y9e(e,"string");return gm(t)=="symbol"?t:t+""}function y9e(e,t){if(gm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function b9e(e){return Array.isArray(e)&&Qn(e[0])&&Qn(e[1])?e.join(" ~ "):e}var w9e=function(t){var n=t.separator,r=n===void 0?" : ":n,o=t.contentStyle,a=o===void 0?{}:o,i=t.itemStyle,s=i===void 0?{}:i,l=t.labelStyle,u=l===void 0?{}:l,f=t.payload,h=t.formatter,p=t.itemSorter,m=t.wrapperClassName,w=t.labelClassName,b=t.label,y=t.labelFormatter,S=t.accessibilityLayer,x=S===void 0?!1:S,E=function(){if(f&&f.length){var H={padding:0,margin:0},Z=(p?T0(f,p):f).map(function(W,K){if(W.type==="none")return null;var V=Yx({display:"block",paddingTop:4,paddingBottom:4,color:W.color||"#000"},s),ne=W.formatter||h||b9e,Q=W.value,te=W.name,G=Q,J=te;if(ne&&G!=null&&J!=null){var ee=ne(Q,te,W,K,f);if(Array.isArray(ee)){var ie=d9e(ee,2);G=ie[0],J=ie[1]}else G=ee}return _.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(K),style:V},Qn(J)?_.createElement("span",{className:"recharts-tooltip-item-name"},J):null,Qn(J)?_.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,_.createElement("span",{className:"recharts-tooltip-item-value"},G),_.createElement("span",{className:"recharts-tooltip-item-unit"},W.unit||""))});return _.createElement("ul",{className:"recharts-tooltip-item-list",style:H},Z)}return null},C=Yx({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),M=Yx({margin:0},u),k=!jt(b),O=k?b:"",F=zt("recharts-default-tooltip",m),R=zt("recharts-tooltip-label",w);k&&y&&f!==void 0&&f!==null&&(O=y(b,f));var B=x?{role:"status","aria-live":"assertive"}:{};return _.createElement("div",zk({className:F,style:C},B),_.createElement("p",{className:R,style:M},_.isValidElement(O)?O:"".concat(O)),E())};function vm(e){"@babel/helpers - typeof";return vm=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},vm(e)}function Ty(e,t,n){return t=S9e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S9e(e){var t=T9e(e,"string");return vm(t)=="symbol"?t:t+""}function T9e(e,t){if(vm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tp="recharts-tooltip-wrapper",x9e={visibility:"hidden"};function I9e(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return zt(tp,Ty(Ty(Ty(Ty({},"".concat(tp,"-right"),$e(n)&&t&&$e(t.x)&&n>=t.x),"".concat(tp,"-left"),$e(n)&&t&&$e(t.x)&&n<t.x),"".concat(tp,"-bottom"),$e(r)&&t&&$e(t.y)&&r>=t.y),"".concat(tp,"-top"),$e(r)&&t&&$e(t.y)&&r<t.y))}function pL(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,o=e.offsetTopLeft,a=e.position,i=e.reverseDirection,s=e.tooltipDimension,l=e.viewBox,u=e.viewBoxDimension;if(a&&$e(a[r]))return a[r];var f=n[r]-s-o,h=n[r]+o;if(t[r])return i[r]?f:h;if(i[r]){var p=f,m=l[r];return p<m?Math.max(h,l[r]):Math.max(f,l[r])}var w=h+s,b=l[r]+u;return w>b?Math.ma
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fFe(e,t){if(e){if(typeof e=="string")return TL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TL(e,t)}}function TL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hFe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}function pFe(e){if(Array.isArray(e))return e}var mFe=D.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,o=r===void 0?{width:-1,height:-1}:r,a=e.width,i=a===void 0?"100%":a,s=e.height,l=s===void 0?"100%":s,u=e.minWidth,f=u===void 0?0:u,h=e.minHeight,p=e.maxHeight,m=e.children,w=e.debounce,b=w===void 0?0:w,y=e.id,S=e.className,x=e.onResize,E=e.style,C=E===void 0?{}:E,M=D.useRef(null),k=D.useRef();k.current=x,D.useImperativeHandle(t,function(){return Object.defineProperty(M.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),M.current},configurable:!0})});var O=D.useState({containerWidth:o.width,containerHeight:o.height}),F=uFe(O,2),R=F[0],B=F[1],Y=D.useCallback(function(Z,W){B(function(K){var V=Math.round(Z),ne=Math.round(W);return K.containerWidth===V&&K.containerHeight===ne?K:{containerWidth:V,containerHeight:ne}})},[]);D.useEffect(function(){var Z=function(te){var G,J=te[0].contentRect,ee=J.width,ie=J.height;Y(ee,ie),(G=k.current)===null||G===void 0||G.call(k,ee,ie)};b>0&&(Z=cY(Z,b,{trailing:!0,leading:!1}));var W=new ResizeObserver(Z),K=M.current.getBoundingClientRect(),V=K.width,ne=K.height;return Y(V,ne),W.observe(M.current),function(){W.disconnect()}},[Y,b]);var H=D.useMemo(function(){var Z=R.containerWidth,W=R.containerHeight;if(Z<0||W<0)return null;Hs(Vc(i)||Vc(l),`The width(%s) and height(%s) are both fixed numbers,
|
||||
maybe you don't need to use a ResponsiveContainer.`,i,l),Hs(!n||n>0,"The aspect(%s) must be greater than zero.",n);var K=Vc(i)?Z:i,V=Vc(l)?W:l;n&&n>0&&(K?V=K/n:V&&(K=V*n),p&&V>p&&(V=p)),Hs(K>0||V>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
||||
please check the style of container, or the props width(%s) and height(%s),
|
||||
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
||||
height and width.`,K,V,i,l,f,h,n);var ne=!Array.isArray(m)&&Fs(m.type).endsWith("Chart");return _.Children.map(m,function(Q){return _.isValidElement(Q)?D.cloneElement(Q,xy({width:K,height:V},ne?{style:xy({height:"100%",width:"100%",maxHeight:V,maxWidth:K},Q.props.style)}:{})):Q})},[n,m,l,p,h,f,R,i]);return _.createElement("div",{id:y?"".concat(y):void 0,className:zt("recharts-responsive-container",S),style:xy(xy({},C),{},{width:i,height:l,minWidth:f,minHeight:h,maxHeight:p}),ref:M},H)}),uY=function(t){return null};uY.displayName="Cell";function bm(e){"@babel/helpers - typeof";return bm=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},bm(e)}function xL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Zk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xL(Object(n),!0).forEach(function(r){gFe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gFe(e,t,n){return t=vFe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vFe(e){var t=yFe(e,"string");return bm(t)=="symbol"?t:t+""}function yFe(e,t){if(bm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gd={widthCache:{},cacheCount:0},bFe=2e3,wFe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},IL="recharts_measurement_span";function SFe(e){var t=Zk({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var jp=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||nh.isSsr)return{width:0,height:0};var r=SFe(n),o=JSON.stringify({text:t,copyStyle:r});if(gd.widthCache[o])return gd.widthCache[o];try{var a=document.getElementById(IL);a||(a=document.createElement("span"),a.setAttribute("id",IL),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var i=Zk(Zk({},wFe),r);Object.assign(a.style,i),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return gd.widthCache[o]=l,++gd.cacheCount>bFe&&(gd.cacheCount=0,gd.widthCache={}),l}catch{return{width:0,height:0}}},TFe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function wm(e){"@babel/helpers - typeof";return wm=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},wm(e)}function sw(e,t){return EFe(e)||kFe(e,t)||IFe(e,t)||xFe()}function xFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IFe(e,t){if(e){if(typeof e=="string")return kL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kL(e,t)}}function kL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kFe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}function EFe(e){if(Array.isArray(e))return e}function CFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,DFe(r.key),r)}}function MFe(e,t,n){return t&&EL(e.prototype,t),n&&EL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function DFe(e){var t=AFe(e,"string");return wm(t)=="symbol"?t:t+""}function AFe(e,t){if(wm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var CL=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ML=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,NFe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,OFe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,dY={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},PFe=Object.keys(dY),Cd="NaN";function jFe(e,t){return e*dY[t]}var Iy=function(){function e(t,n){CFe(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!NFe.test(n)&&(this.num=NaN,this.unit=""),PFe.includes(n)&&(this.num=jFe(t,n),this.unit="px")}return MFe(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,o=(r=OFe.exec(n))!==null&&r!==void 0?r:[],a=sw(o,3),i=a[1],s=a[2];return new e(parseFloat(i),s??"")}}])}();function fY(e){if(e.includes(Cd))return Cd;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=CL.exec(t))!==null&&n!==void 0?n:[],o=sw(r,4),a=o[1],i=o[2],s=o[3],l=Iy.parse(a??""),u=Iy.parse(s??""),f=i==="*"?l.multiply(u):l.divide(u);if(f.isNaN())return Cd;t=t.replace(CL,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,p=(h=ML.exec(t))!==null&&h!==void 0?h:[],m=sw(p,4),w=m[1],b=m[2],y=m[3],S=Iy.parse(w??""),x=Iy.parse(y??""),E=b==="+"?S.add(x):S.subtract(x);if(E.isNaN())return Cd;t=t.replace(ML,E.toString())}return t}var DL=/\(([^()]*)\)/;function LFe(e){for(var t=e;t.includes("(");){var n=DL.exec(t),r=sw(n,2),o=r[1];t=t.replace(DL,fY(o))}return t}function RFe(e){var t=e.replace(/\s+/g,"");return t=LFe(t),t=fY(t),t}function FFe(e){try{return RFe(e)}catch{return Cd}}function zx(e){var t=FFe(e.slice(5,-1));return t===Cd?"":t}var HFe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],BFe=["dx","dy","angle","className","breakAll"];function qk(){return qk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qk.apply(this,arguments)}function AL(e,t){if(e==null)return{};var n=_Fe(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _Fe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function NL(e,t){return VFe(e)||zFe(e,t)||UFe(e,t)||YFe()}function YFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UFe(e,t){if(e){if(typeof e=="string")return OL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OL(e,t)}}function OL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zFe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}function VFe(e){if(Array.isArray(e))return e}var hY=/[ \f\n\r\t\v\u2028\u2029]+/,pY=function(t){var n=t.children,r=t.breakAll,o=t.style;try{var a=[];jt(n)||(r?a=n.toString().split(""):a=n.toString().split(hY));var i=a.map(function(l){return{word:l,width:jp(l,o).width}}),s=r?0:jp(" ",o).width;return{wordsWithComputedWidth:i,spaceWidth:s}}catch{return null}},WFe=function(t,n,r,o,a){var i=t.maxLines,s=t.children,l=t.style,u=t.breakAll,f=$e(i),h=s,p=function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return K.reduce(function(V,ne){var Q=ne.word,te=ne.width,G=V[V.length-1];if(G&&(o==null||a||G.width+te+r<Number(o)))G.words.push(Q),G.width+=te+r;else{var J={words:[Q],width:te};V.push(J)}return V},[])},m=p(n),w=function(K){return K.reduce(function(V,ne){return V.width>ne.width?V:ne})};if(!f)return m;for(var b="…",y=function(K){var V=h.slice(0,K),ne=pY({breakAll:u,style:l,children:V+b}).wordsWithComputedWidth,Q=p(ne),te=Q.length>i||w(Q).width>Number(o);return[te,Q]},S=0,x=h.length-1,E=0,C;S<=x&&E<=h.length-1;){var M=Math.floor((S+x)/2),k=M-1,O=y(k),F=NL(O,2),R=F[0],B=F[1],Y=y(M),H=NL(Y,1),Z=H[0];if(!R&&!Z&&(S=M+1),R&&Z&&(x=M-1),!R&&Z){C=B;break}E++}return C||m},PL=function(t){var n=jt(t)?[]:t.toString().split(hY);return[{words:n}]},GFe=function(t){var n=t.width,r=t.scaleToFit,o=t.children,a=t.style,i=t.breakAll,s=t.maxLines;if((n||r)&&!nh.isSsr){var l,u,f=pY({breakAll:i,children:o,style:a});if(f){var h=f.wordsWithComputedWidth,p=f.spaceWidth;l=h,u=p}else return PL(o);return WFe({breakAll:i,children:o,maxLines:s,style:a},l,u,n,r)}return PL(o)},jL="#808080",lw=function(t){var n=t.x,r=n===void 0?0:n,o=t.y,a=o===void 0?0:o,i=t.lineHeight,s=i===void 0?"1em":i,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,h=f===void 0?!1:f,p=t.textAnchor,m=p===void 0?"start":p,w=t.verticalAnchor,b=w===void 0?"end":w,y=t.fill,S=y===void 0?jL:y,x=AL(t,HFe),E=D.useMemo(function(){return GFe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:h,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,h,x.style,x.width]),C=x.dx,M=x.dy,k=x.angle,O=x.className,F=x.breakAll,R=AL(x,BFe);if(!Qn(r)||!Qn(a))return null;var B=r+($e(C)?C:0),Y=a+($e(M)?M:0),H;switch(b){case"start":H=zx("calc(".concat(u,")"));break;case"middle":H=zx("calc(".concat((E.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:H=zx("calc(".concat(E.length-1," * -").concat(s,")"));break}var Z=[];if(h){var W=E[0].width,K=x.width;Z.push("scale(".concat(($e(K)?K/W:1)/W,")"))}return k&&Z.push("rotate(".concat(k,", ").concat(B,", ").concat(Y,")")),Z.length&&(R.transform=Z.join(" ")),_.createElement("text",qk({},Rt(R,!0),{x:B,y:Y,className:zt("recharts-text",O),textAnchor:m,fill:S.includes("url")?jL:S}),E.map(function(V,ne){var Q=V.words.join(F?"":" ");return _.createElement("tspan",{x:B,dy:ne===0?H:s,key:"".concat(Q,"-").concat(ne)},Q)}))};function zl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ZFe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function PD(e){let t,n,r;e.length!==2?(t=zl,n=(s,l)=>zl(e(s),l),r=(s,l)=>e(s)-l):(t=e===zl||e===ZFe?e:qFe,n=e,r=e);function o(s,l,u=0,f=s.length){if(u<f){if(t(l,l)!==0)return f;do{const h=u+f>>>1;n(s[h],l)<0?u=h+1:f=h}while(u<f)}return u}function a(s,l,u=0,f=s.length){if(u<f){if(t(l,l)!==0)return f;do{const h=u+f>>>1;n(s[h],l)<=0?u=h+1:f=h}while(u<f)}return u}function i(s,l,u=0,f=s.length){const h=o(s,l,u,f-1);return h>u&&r(s[h-1],l)>-r(s[h],l)?h-1:h}return{left:o,center:i,right:a}}function qFe(){return 0}function mY(e){return e===null?NaN:+e}function*KFe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const $Fe=PD(zl),Ug=$Fe.right;PD(mY).center;class LL extends Map{constructor(t,n=QFe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,o]of t)this.set(r,o)}get(t){return super.get(RL(this,t))}has(t){return super.has(RL(this,t))}set(t,n){return super.set(XFe(this,t),n)}delete(t){return super.delete(JFe(this,t))}}function RL({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function XFe({_intern:e,_key:t},n){co
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JHe(e,t){if(e){if(typeof e=="string")return nE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nE(e,t)}}function QHe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function e7e(e){if(Array.isArray(e))return nE(e)}function nE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var t7e=function(t){return t},eU={},tU=function(t){return t===eU},SR=function(t){return function n(){return arguments.length===0||arguments.length===1&&tU(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},n7e=function e(t,n){return t===1?n:SR(function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];var i=o.filter(function(s){return s!==eU}).length;return i>=t?n.apply(void 0,o):e(t-i,SR(function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];var f=o.map(function(h){return tU(h)?l.shift():h});return n.apply(void 0,$He(f).concat(l))}))})},bS=function(t){return n7e(t.length,t)},rE=function(t,n){for(var r=[],o=t;o<n;++o)r[o-t]=o;return r},r7e=bS(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),o7e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return t7e;var o=n.reverse(),a=o[0],i=o.slice(1);return function(){return i.reduce(function(s,l){return l(s)},a.apply(void 0,arguments))}},oE=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},nU=function(t){var n=null,r=null;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return n&&a.every(function(s,l){return s===n[l]})||(n=a,r=t.apply(void 0,a)),r}};function a7e(e){var t;return e===0?t=1:t=Math.floor(new rn(e).abs().log(10).toNumber())+1,t}function i7e(e,t,n){for(var r=new rn(e),o=0,a=[];r.lt(t)&&o<1e5;)a.push(r.toNumber()),r=r.add(n),o++;return a}var s7e=bS(function(e,t,n){var r=+e,o=+t;return r+n*(o-r)}),l7e=bS(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),c7e=bS(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const wS={rangeStep:i7e,getDigitCount:a7e,interpolateNumber:s7e,uninterpolateNumber:l7e,uninterpolateTruncation:c7e};function aE(e){return f7e(e)||d7e(e)||rU(e)||u7e()}function u7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d7e(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function f7e(e){if(Array.isArray(e))return iE(e)}function Cm(e,t){return m7e(e)||p7e(e,t)||rU(e,t)||h7e()}function h7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rU(e,t){if(e){if(typeof e=="string")return iE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iE(e,t)}}function iE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p7e(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,a=void 0;try{for(var i=e[Symbol.iterator](),s;!(r=(s=i.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&i.return!=null&&i.return()}finally{if(o)throw a}}return n}}function m7e(e){if(Array.isArray(e))return e}function oU(e){var t=Cm(e,2),n=t[0],r=t[1],o=n,a=r;return n>r&&(o=r,a=n),[o,a]}function aU(e,t,n){if(e.lte(0))return new rn(0);var r=wS.getDigitCount(e.toNumber()),o=new rn(10).pow(r),a=e.div(o),i=r!==1?.05:.1,s=new rn(Math.ceil(a.div(i).toNumber())).add(n).mul(i),l=s.mul(o);return t?l:new rn(Math.ceil(l))}function g7e(e,t,n){var r=1,o=new rn(e);if(!o.isint()&&n){var a=Math.abs(e);a<1?(r=new rn(10).pow(wS.getDigitCount(e)-1),o=new rn(Math.floor(o.div(r).toNumber())).mul(r)):a>1&&(o=new rn(Math.floor(e)))}else e===0?o=new rn(Math.floor((t-1)/2)):n||(o=new rn(Math.floor(e)));var i=Math.floor((t-1)/2),s=o7e(r7e(function(l){return o.add(new rn(l-i).mul(r)).toNumber()}),rE);return s(0,t)}function iU(e,t,n,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new rn(0),tickMin:new rn(0),tickMax:new rn(0)};var a=aU(new rn(t).sub(e).div(n-1),r,o),i;e<=0&&t>=0?i=new rn(0):(i=new rn(e).add(t).div(2),i=i.sub(new rn(i).mod(a)));var s=Math.ceil(i.sub(e).div(a).toNumber()),l=Math.ceil(new rn(t).sub(i).div(a).toNumber()),u=s+l+1;return u>n?iU(e,t,n,r,o+1):(u<n&&(l=t>0?l+(n-u):l,s=t>0?s:s+(n-u)),{step:a,tickMin:i.sub(new rn(s).mul(a)),tickMax:i.add(new rn(l).mul(a))})}function v7e(e){var t=Cm(e,2),n=t[0],r=t[1],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=Math.max(o,2),s=oU([n,r]),l=Cm(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var h=f===1/0?[u].concat(aE(rE(0,o-1).map(function(){return 1/0}))):[].concat(aE(rE(0,o-1).map(function(){return-1/0})),[f]);return n>r?oE(h):h}if(u===f)return g7e(u,o,a);var p=iU(u,f,i,a),m=p.step,w=p.tickMin,b=p.tickMax,y=wS.rangeStep(w,b.add(new rn(.1).mul(m)),m);return n>r?oE(y):y}function y7e(e,t){var n=Cm(e,2),r=n[0],o=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=oU([r,o]),s=Cm(i,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[r,o];if(l===u)return[l];var f=Math.max(t,2),h=aU(new rn(u).sub(l).div(f-1),a,0),p=[].concat(aE(wS.rangeStep(new rn(l),new rn(u).sub(new rn(.99).mul(h)),h)),[u]);return r>o?oE(p):p}var b7e=nU(v7e),w7e=nU(y7e),S7e="Invariant failed";function mu(e,t){throw new Error(S7e)}var T7e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function cf(e){"@babel/helpers - typeof";return cf=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},cf(e)}function ww(){return ww=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ww.apply(this,arguments)}function x7e(e,t){return C7e(e)||E7e(e,t)||k7e(e,t)||I7e()}function I7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k7e(e,t){if(e){if(typeof e=="string")return TR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TR(e,t)}}function TR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E7e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}function C7e(e){if(Array.isArray(e))return e}function M7e(e,t){if(e==null)return{};var n=D7e(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function D7e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function A7e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N7e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cU(r.key),r)}}function O7e(e,t,n){return t&&N7e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function P7e(e,t,n){return t=Sw(t),j7e(e,sU()?Reflect.construct(t,n||[],Sw(e).constructor):t.apply(e,n))}function j7e(e,t){if(t&&(cf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return L7e(e)}function L7e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sU=function(){return!!e})()}function Sw(e){return Sw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sw(e)}function R7e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sE(e,t)}function sE(e,t){return sE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},sE(e,t)}function lU(e,t,n){return t=cU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cU(e){var t=F7e(e,"string");return cf(t)=="symbol"?t:t+""}function F7e(e,t){if(cf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Gg=function(e){function t(){return A7e(this,t),P7e(this,t,arguments)}return R7e(t,e),O7e(t,[{key:"render",value:function(){var r=this.props,o=r.offset,a=r.layout,i=r.width,s=r.dataKey,l=r.data,u=r.dataPointFormatter,f=r.xAxis,h=r.yAxis,p=M7e(r,T7e),m=Rt(p,!1);this.props.direction==="x"&&f.type!=="number"&&mu();var w=l.map(function(b){var y=u(b,s),S=y.x,x=y.y,E=y.value,C=y.errorVal;if(!C)return null;var M=[],k,O;if(Array.isArray(C)){var F=x7e(C,2);k=F[0],O=F[1]}else k=O=C;if(a==="vertical"){var R=f.scale,B=x+o,Y=B+i,H=B-i,Z=R(E-k),W=R(E+O);M.push({x1:W,y1:Y,x2:W,y2:H}),M.push({x1:Z,y1:B,x2:W,y2:B}),M.push({x1:Z,y1:Y,x2:Z,y2:H})}else if(a==="horizontal"){var K=h.scale,V=S+o,ne=V-i,Q=V+i,te=K(E-k),G=K(E+O);M.push({x1:ne,y1:G,x2:Q,y2:G}),M.push({x1:V,y1:te,x2:V,y2:G}),M.push({x1:ne,y1:te,x2:Q,y2:te})}return _.createElement(_n,ww({className:"recharts-errorBar",key:"bar-".concat(M.map(function(J){return"".concat(J.x1,"-").concat(J.x2,"-").concat(J.y1,"-").concat(J.y2)}))},m),M.map(function(J){return _.createElement("line",ww({},J,{key:"line-".concat(J.x1,"-").concat(J.x2,"-").concat(J.y1,"-").concat(J.y2)}))}))});return _.createElement(_n,{className:"recharts-errorBars"},w)}}])}(_.Component);lU(Gg,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});lU(Gg,"displayName","ErrorBar");function Mm(e){"@babel/helpers - typeof";return Mm=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},Mm(e)}function xR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}funct
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U7e(e,t){if(e){if(typeof e=="string")return lE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lE(e,t)}}function z7e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function V7e(e){if(Array.isArray(e))return lE(e)}function lE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ln(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(r){Rd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rd(e,t,n){return t=W7e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W7e(e){var t=G7e(e,"string");return Dm(t)=="symbol"?t:t+""}function G7e(e,t){if(Dm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qo(e,t,n){return jt(e)||jt(t)?n:Qn(t)?ya(e,t,n):Mt(t)?t(e):n}function Rp(e,t,n,r){var o=GHe(e,function(s){return Qo(s,t)});if(n==="number"){var a=o.filter(function(s){return $e(s)||parseFloat(s)});return a.length?[yS(a),vS(a)]:[1/0,-1/0]}var i=r?o.filter(function(s){return!jt(s)}):o;return i.map(function(s){return Qn(s)||s instanceof Date?s:""})}var Z7e=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,i=-1,s=(n=r?.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u<s;u++){var f=u>0?o[u-1].coordinate:o[s-1].coordinate,h=o[u].coordinate,p=u>=s-1?o[0].coordinate:o[u+1].coordinate,m=void 0;if(ei(h-f)!==ei(p-h)){var w=[];if(ei(p-h)===ei(l[1]-l[0])){m=p;var b=h+l[1]-l[0];w[0]=Math.min(b,(b+f)/2),w[1]=Math.max(b,(b+f)/2)}else{m=f;var y=p+l[1]-l[0];w[0]=Math.min(h,(y+h)/2),w[1]=Math.max(h,(y+h)/2)}var S=[Math.min(h,(m+h)/2),Math.max(h,(m+h)/2)];if(t>S[0]&&t<=S[1]||t>=w[0]&&t<=w[1]){i=o[u].index;break}}else{var x=Math.min(f,p),E=Math.max(f,p);if(t>(x+h)/2&&t<=(E+h)/2){i=o[u].index;break}}}else for(var C=0;C<s;C++)if(C===0&&t<=(r[C].coordinate+r[C+1].coordinate)/2||C>0&&C<s-1&&t>(r[C].coordinate+r[C-1].coordinate)/2&&t<=(r[C].coordinate+r[C+1].coordinate)/2||C===s-1&&t>(r[C].coordinate+r[C-1].coordinate)/2){i=r[C].index;break}return i},rA=function(t){var n,r=t,o=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ln(Ln({},t.type.defaultProps),t.props):t.props,i=a.stroke,s=a.fill,l;switch(o){case"Line":l=i;break;case"Area":case"Radar":l=i&&i!=="none"?i:s;break;default:l=s;break}return l},q7e=function(t){var n=t.barSize,r=t.totalSize,o=t.stackGroups,a=o===void 0?{}:o;if(!a)return{};for(var i={},s=Object.keys(a),l=0,u=s.length;l<u;l++)for(var f=a[s[l]].stackGroups,h=Object.keys(f),p=0,m=h.length;p<m;p++){var w=f[h[p]],b=w.items,y=w.cateAxisId,S=b.filter(function(O){return Fs(O.type).indexOf("Bar")>=0});if(S&&S.length){var x=S[0].type.defaultProps,E=x!==void 0?Ln(Ln({},x),S[0].props):S[0].props,C=E.barSize,M=E[y];i[M]||(i[M]=[]);var k=jt(C)?n:C;i[M].push({item:S[0],stackList:S.slice(1),barSize:jt(k)?void 0:hu(k,r,0)})}}return i},K7e=function(t){var n=t.barGap,r=t.barCategoryGap,o=t.bandSize,a=t.sizeList,i=a===void 0?[]:a,s=t.maxBarSize,l=i.length;if(l<1)return null;var u=hu(n,o,0,!0),f,h=[];if(i[0].barSize===+i[0].barSize){var p=!1,m=o/l,w=i.reduce(function(C,M){return C+M.barSize||0},0);w+=(l-1)*u,w>=o&&(w-=(l-1)*u,u=0),w>=o&&m>0&&(p=!0,m*=.9,w=l*m);var b=(o-w)/2>>0,y={offset:b-u,size:0};f=i.reduce(function(C,M){var k={item:M.item,position:{offset:y.offset+y.size+u,size:p?m:M.barSize}},O=[].concat(IR(C),[k]);return y=O[O.length-1].position,M.stackList&&M.stackList.length&&M.stackList.forEach(function(F){O.push({item:F,position:y})}),O},h)}else{var S=hu(r,o,0,!0);o-2*S-(l-1)*u<=0&&(u=0);var x=(o-2*S-(l-1)*u)/l;x>1&&(x>>=0);var E=s===+s?Math.min(x,s):x;f=i.reduce(function(C,M,k){var O=[].concat(IR(C),[{item:M.item,position:{offset:S+(x+u)*k+(x-E)/2,size:E}}]);return M.stackList&&M.stackList.length&&M.stackList.forEach(function(F){O.push({item:F,position:O[O.length-1].position})}),O},h)}return f},$7e=function(t,n,r,o){var a=r.children,i=r.width,s=r.margin,l=
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xBe(e,t){if(e){if(typeof e=="string")return uE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uE(e,t)}}function IBe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kBe(e){if(Array.isArray(e))return uE(e)}function uE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EBe(e,t){if(e==null)return{};var n=CBe(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function CBe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LR(Object(n),!0).forEach(function(r){MBe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MBe(e,t,n){return t=DBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DBe(e){var t=ABe(e,"string");return Nm(t)=="symbol"?t:t+""}function ABe(e,t){if(Nm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Om(){return Om=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Om.apply(this,arguments)}var NBe=function(t){var n=t.value,r=t.formatter,o=jt(t.children)?n:t.children;return Mt(r)?r(o):o},OBe=function(t,n){var r=ei(n-t),o=Math.min(Math.abs(n-t),360);return r*o},PBe=function(t,n,r){var o=t.position,a=t.viewBox,i=t.offset,s=t.className,l=a,u=l.cx,f=l.cy,h=l.innerRadius,p=l.outerRadius,m=l.startAngle,w=l.endAngle,b=l.clockWise,y=(h+p)/2,S=OBe(m,w),x=S>=0?1:-1,E,C;o==="insideStart"?(E=m+x*i,C=b):o==="insideEnd"?(E=w-x*i,C=!b):o==="end"&&(E=w+x*i,C=b),C=S<=0?C:!C;var M=kr(u,f,y,E),k=kr(u,f,y,E+(C?1:-1)*359),O="M".concat(M.x,",").concat(M.y,`
|
||||
A`).concat(y,",").concat(y,",0,1,").concat(C?0:1,`,
|
||||
`).concat(k.x,",").concat(k.y),F=jt(t.id)?Yg("recharts-radial-line-"):t.id;return _.createElement("text",Om({},r,{dominantBaseline:"central",className:zt("recharts-radial-bar-label",s)}),_.createElement("defs",null,_.createElement("path",{id:F,d:O})),_.createElement("textPath",{xlinkHref:"#".concat(F)},n))},jBe=function(t){var n=t.viewBox,r=t.offset,o=t.position,a=n,i=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,f=a.startAngle,h=a.endAngle,p=(f+h)/2;if(o==="outside"){var m=kr(i,s,u+r,p),w=m.x,b=m.y;return{x:w,y:b,textAnchor:w>=i?"start":"end",verticalAnchor:"middle"}}if(o==="center")return{x:i,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(o==="centerTop")return{x:i,y:s,textAnchor:"middle",verticalAnchor:"start"};if(o==="centerBottom")return{x:i,y:s,textAnchor:"middle",verticalAnchor:"end"};var y=(l+u)/2,S=kr(i,s,y,p),x=S.x,E=S.y;return{x,y:E,textAnchor:"middle",verticalAnchor:"middle"}},LBe=function(t){var n=t.viewBox,r=t.parentViewBox,o=t.offset,a=t.position,i=n,s=i.x,l=i.y,u=i.width,f=i.height,h=f>=0?1:-1,p=h*o,m=h>0?"end":"start",w=h>0?"start":"end",b=u>=0?1:-1,y=b*o,S=b>0?"end":"start",x=b>0?"start":"end";if(a==="top"){var E={x:s+u/2,y:l-h*o,textAnchor:"middle",verticalAnchor:m};return Xn(Xn({},E),r?{height:Math.max(l-r.y,0),width:u}:{})}if(a==="bottom"){var C={x:s+u/2,y:l+f+p,textAnchor:"middle",verticalAnchor:w};return Xn(Xn({},C),r?{height:Math.max(r.y+r.height-(l+f),0),width:u}:{})}if(a==="left"){var M={x:s-y,y:l+f/2,textAnchor:S,verticalAnchor:"middle"};return Xn(Xn({},M),r?{width:Math.max(M.x-r.x,0),height:f}:{})}if(a==="right"){var k={x:s+u+y,y:l+f/2,textAnchor:x,verticalAnchor:"middle"};return Xn(Xn({},k),r?{width:Math.max(r.x+r.width-k.x,0),height:f}:{})}var O=r?{width:u,height:f}:{};return a==="insideLeft"?Xn({x:s+y,y:l+f/2,textAnchor:x,verticalAnchor:"middle"},O):a==="insideRight"?Xn({x:s+u-y,y:l+f/2,textAnchor:S,verticalAnchor:"middle"},O):a==="insideTop"?Xn({x:s+u/2,y:l+p,textAnchor:"middle",verticalAnchor:w},O):a==="insideBottom"?Xn({x:s+u/2,y:l+f-p,textAnchor:"middle",verticalAnchor:m},O):a==="insideTopLeft"?Xn({x:s+y,y:l+p,textAnchor:x,verticalAnchor:w},O):a==="insideTopRight"?Xn({x:s+u-y,y:l+p,textAnchor:S,verticalAnchor:w},O):a==="insideBottomLeft"?Xn({x:s+y,y:l+f-p,textAnchor:x,verticalAnchor:m},O):a==="insideBottomRight"?Xn({x:s+u-y,y:l+f-p,textAnchor:S,verticalAnchor:m},O):Lf(a)&&($e(a.x)||Vc(a.x))&&($e(a.y)||Vc(a.y))?Xn({x:s+hu(a.x,u),y:l+hu(a.y,f),textAnchor:"end",verticalAnchor:"end"},O):Xn({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},RBe=function(t){return"cx"in t&&$e(t.cx)};function Vr(e){var t=e.offset,n=t===void 0?5:t,r=EBe(e,wBe),o=Xn({offset:n},r),a=o.viewBox,i=o.position,s=o.value,l=o.children,u=o.content,f=o.className,h=f===void 0?"":f,p=o.textBreakAll;if(!a||jt(s)&&jt(l)&&!D.isValidElement(u)&&!Mt(u))return null;if(D.isValidElement(u))return D.cloneElement(u,o);var m;if(Mt(u)){if(m=D.createElement(u,o),D.isValidElement(m))return m}else m=NBe(o);var w=RBe(a),b=Rt(o,!0);if(w&&(i==="insideStart"||i==="insideEnd"||i==="end"))return PBe(o,m,b);var y=w?jBe(o):LBe(o);return _.createElement(lw,Om({className:zt("recharts-label",h)},b,y,{breakAll:p}),m)}Vr.displayName="Label";var vU=function(t){var n=t.cx,r=t.cy,o=t.angle,a=t.startAngle,i=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,h=t.x,p=t.y,m=t.top,w=t.left,b=t.width,y=t.height,S=t.clockWise,x=t.labelViewBox;if(x)return x;if($e(b)&&$e(y)){if($e(h)&&$e(p))return{x:h,y:p,width:b,height:y};if($e(m)&&$e(w))return{x:m,y:w,width:b,height:y}}return $e(h)&&$e(p)?{x:h,y:p,width:0,height:0}:$e(n)&&$e(r)?{cx:n,cy:r,startAngle:a||o||0,endAngle:i||o||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:S}:t.viewBox?t.viewBox:{}},FBe=function(t,n){return t?t===!0?_.createElement(Vr,{key:"label-implicit",viewBox:n}):Qn(t)?_.createElement(Vr,{key:"label-implicit",viewBox:n,value:t}):D.isValidElement(t)?t.type===Vr?D.cloneElement(t,{key:"label-implicit",viewBox:n}):_.createElement(Vr,{key:"label-implicit",content:t,viewBox:n}):Mt(t)?_.createElement(Vr,{key:"label-implicit",content:t,viewBox:n}):Lf(t)?_.createElement(Vr,Om({viewBox:n},t,{key:"label-implicit"})):null:null},HBe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var o=t.children,a=vU(t),i=ba(o,Vr).map(function(l,u){return D.cloneElement(l,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return i;var s=FBe(t.label,n||a);return[s].concat(SBe(i))};Vr.parseViewBox=vU;Vr.renderCallByParent=HBe;function Pm(e){"@babel/helpers - typeof";return Pm=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},Pm(e)}var BBe=["valueAccessor"],_Be=["data","dataKey","clockWise","id","textBreakAll"];function YBe(e){return WBe(e)||VBe(e)||zBe(e)||UBe()}function UBe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zBe(e,t){if(e){if(typeof e=="string")return dE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dE(e,t)}}function VBe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function WBe(e){if(Array.isArray(e))return dE(e)}function dE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Iw(){return Iw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iw.apply(this,arguments)}function RR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function FR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RR(Object(n),!0).forEach(function(r){GBe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GBe(e,t,n){return t=ZBe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZBe(e){var t=qBe(e,"string");return Pm(t)=="symbol"?t:t+""}function qBe(e,t){if(Pm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function HR(e,t){if(e==null)return{};var n=KBe(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KBe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var $Be=function(t){return Array.isArray(t.value)?Ipe(t.value):t.value};function Vl(e){var t=e.valueAccessor,n=t===void 0?$Be:t,r=HR(e,BBe),o=r.data,a=r.dataKey,i=r.clockWise,s=r.id,l=r.textBreakAll,u=HR(r,_Be);return!o||!o.length?null:_.createElement(_n,{className:"recharts-label-list"},o.map(function(f,h){var p=jt(a)?n(f,h):Qo(f&&f.payload,a),m=jt(s)?{}:{id:"".concat(s,"-").concat(h)};return _.createElement(Vr,Iw({},Rt(f,!0),u,m,{parentViewBox:f.parentViewBox,value:p,textBreakAll:l,viewBox:Vr.parseViewBox(jt(i)?f:FR(FR({},f),{},{clockWise:i})),key:"label-".concat(h),index:h}))}))}Vl.displayName="LabelList";function XBe(e,t){return e?e===!0?_.createElement(Vl,{key:"labelList-implicit",data:t}):_.isValidElement(e)||Mt(e)?_.createElement(Vl,{key:"labelList-implicit",data:t,content:e}):Lf(e)?_.createElement(Vl,Iw({data:t},e,{key:"labelList-implicit"})):null:null}function JBe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,o=ba(r,Vl).map(function(i,s){return D.cloneElement(i,{data:t,key:"labelList-".concat(s)})});if(!n)return o;var a=XBe(e.label,t);return[a].concat(YBe(o))}Vl.renderCallByParent=JBe;function jm(e){"@babel/helpers - typeof";return jm=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},jm(e)}function fE(){return fE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fE.apply(this,arguments)}function BR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function _R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BR(Object(n),!0).forEach(function(r){QBe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QBe(e,t,n){return t=e_e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e_e(e){var t=t_e(e,"string");return jm(t)=="symbol"?t:t+""}function t_e(e,t){if(jm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e
Line truncated
|
||||
A `).concat(a,",").concat(a,`,0,
|
||||
`).concat(+(Math.abs(l)>180),",").concat(+(i>u),`,
|
||||
`).concat(h.x,",").concat(h.y,`
|
||||
`);if(o>0){var m=kr(n,r,o,i),w=kr(n,r,o,u);p+="L ".concat(w.x,",").concat(w.y,`
|
||||
A `).concat(o,",").concat(o,`,0,
|
||||
`).concat(+(Math.abs(l)>180),",").concat(+(i<=u),`,
|
||||
`).concat(m.x,",").concat(m.y," Z")}else p+="L ".concat(n,",").concat(r," Z");return p},r_e=function(t){var n=t.cx,r=t.cy,o=t.innerRadius,a=t.outerRadius,i=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,h=ei(f-u),p=Dy({cx:n,cy:r,radius:a,angle:u,sign:h,cornerRadius:i,cornerIsExternal:l}),m=p.circleTangency,w=p.lineTangency,b=p.theta,y=Dy({cx:n,cy:r,radius:a,angle:f,sign:-h,cornerRadius:i,cornerIsExternal:l}),S=y.circleTangency,x=y.lineTangency,E=y.theta,C=l?Math.abs(u-f):Math.abs(u-f)-b-E;if(C<0)return s?"M ".concat(w.x,",").concat(w.y,`
|
||||
a`).concat(i,",").concat(i,",0,0,1,").concat(i*2,`,0
|
||||
a`).concat(i,",").concat(i,",0,0,1,").concat(-i*2,`,0
|
||||
`):yU({cx:n,cy:r,innerRadius:o,outerRadius:a,startAngle:u,endAngle:f});var M="M ".concat(w.x,",").concat(w.y,`
|
||||
A`).concat(i,",").concat(i,",0,0,").concat(+(h<0),",").concat(m.x,",").concat(m.y,`
|
||||
A`).concat(a,",").concat(a,",0,").concat(+(C>180),",").concat(+(h<0),",").concat(S.x,",").concat(S.y,`
|
||||
A`).concat(i,",").concat(i,",0,0,").concat(+(h<0),",").concat(x.x,",").concat(x.y,`
|
||||
`);if(o>0){var k=Dy({cx:n,cy:r,radius:o,angle:u,sign:h,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),O=k.circleTangency,F=k.lineTangency,R=k.theta,B=Dy({cx:n,cy:r,radius:o,angle:f,sign:-h,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),Y=B.circleTangency,H=B.lineTangency,Z=B.theta,W=l?Math.abs(u-f):Math.abs(u-f)-R-Z;if(W<0&&i===0)return"".concat(M,"L").concat(n,",").concat(r,"Z");M+="L".concat(H.x,",").concat(H.y,`
|
||||
A`).concat(i,",").concat(i,",0,0,").concat(+(h<0),",").concat(Y.x,",").concat(Y.y,`
|
||||
A`).concat(o,",").concat(o,",0,").concat(+(W>180),",").concat(+(h>0),",").concat(O.x,",").concat(O.y,`
|
||||
A`).concat(i,",").concat(i,",0,0,").concat(+(h<0),",").concat(F.x,",").concat(F.y,"Z")}else M+="L".concat(n,",").concat(r,"Z");return M},o_e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},bU=function(t){var n=_R(_R({},o_e),t),r=n.cx,o=n.cy,a=n.innerRadius,i=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,u=n.cornerIsExternal,f=n.startAngle,h=n.endAngle,p=n.className;if(i<a||f===h)return null;var m=zt("recharts-sector",p),w=i-a,b=hu(s,w,0,!0),y;return b>0&&Math.abs(f-h)<360?y=r_e({cx:r,cy:o,innerRadius:a,outerRadius:i,cornerRadius:Math.min(b,w/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:h}):y=yU({cx:r,cy:o,innerRadius:a,outerRadius:i,startAngle:f,endAngle:h}),_.createElement("path",fE({},Rt(n,!0),{className:m,d:y,role:"img"}))};function Lm(e){"@babel/helpers - typeof";return Lm=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},Lm(e)}function hE(){return hE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hE.apply(this,arguments)}function YR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function UR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YR(Object(n),!0).forEach(function(r){a_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function a_e(e,t,n){return t=i_e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i_e(e){var t=s_e(e,"string");return Lm(t)=="symbol"?t:t+""}function s_e(e,t){if(Lm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zR={curveBasisClosed:BRe,curveBasisOpen:_Re,curveBasis:HRe,curveBumpX:IRe,curveBumpY:kRe,curveLinearClosed:YRe,curveLinear:lS,curveMonotoneX:URe,curveMonotoneY:zRe,curveNatural:VRe,curveStep:WRe,curveStepAfter:ZRe,curveStepBefore:GRe},Ay=function(t){return t.x===+t.x&&t.y===+t.y},ip=function(t){return t.x},sp=function(t){return t.y},l_e=function(t,n){if(Mt(t))return t;var r="curve".concat(iS(t));return(r==="curveMonotone"||r==="curveBump")&&n?zR["".concat(r).concat(n==="vertical"?"Y":"X")]:zR[r]||lS},c_e=function(t){var n=t.type,r=n===void 0?"linear":n,o=t.points,a=o===void 0?[]:o,i=t.baseLine,s=t.layout,l=t.connectNulls,u=l===void 0?!1:l,f=l_e(r,s),h=u?a.filter(function(b){return Ay(b)}):a,p;if(Array.isArray(i)){var m=u?i.filter(function(b){return Ay(b)}):i,w=h.map(function(b,y){return UR(UR({},b),{},{base:m[y]})});return s==="vertical"?p=Sy().y(sp).x1(ip).x0(function(b){return b.base.x}):p=Sy().x(ip).y1(sp).y0(function(b){return b.base.y}),p.defined(Ay).curve(f),p(w)}return s==="vertical"&&$e(i)?p=Sy().y(sp).x1(ip).x0(i):$e(i)?p=Sy().x(ip).y1(sp).y0(i):p=U_().x(ip).y(sp),p.defined(Ay).curve(f),p(h)},pE=function(t){var n=t.className,r=t.points,o=t.path,a=t.pathRef;if((!r||!r.length)&&!o)return null;var i=r&&r.length?c_e(t):o;return _.createElement("path",hE({},Rt(t,!1),$b(t),{className:zt("recharts-curve",n),d:i,ref:a}))},u_e=Object.getOwnPropertyNames,d_e=Object.getOwnPropertySymbols,f_e=Object.prototype.hasOwnProperty;function VR(e,t){return function(r,o,a){return e(r,o,a)&&t(r,o,a)}}function Ny(e){return function(n,r,o){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,o);var a=o.cache,i=a.get(n),s=a.get(r);if(i&&s)return i===r&&s===n;a.set(n,r),a.set(r,n);var l=e(n,r,o);return a.delete(n),a.delete(r),l}}function WR(e){return u_e(e).concat(d_e(e))}var wU=Object.hasOwn||function(e,t){return f_e.call(e,t)};function Mu(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var SU="_owner",GR=Object.getOwnPropertyDescriptor,ZR=Object.keys;function h_e(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function p_e(e,t){return Mu(e.getTime(),t.getTime())}function m_e(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function g_e(e,t){return e===t}function qR(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var o=new Array(r),a=e.entries(),i,s,l=0;(i=a.next())&&!i.done;){for(var u=t.entries(),f=!1,h=0;(s=u.next())&&!s.done;){if(o[h]){h++;continue}var p=i.value,m=s.value;if(n.equals(p[0],m[0],l,h,e,t,n)&&n.equals(p[1],m[1],p[0],m[0],e,t,n)){f=o[h]=!0;break}h++}if(!f)return!1;l++}return!0}var
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V_e(e,t){if(e){if(typeof e=="string")return QR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return QR(e,t)}}function QR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function W_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function G_e(e){if(Array.isArray(e))return e}function Z_e(){var e={},t=function(){return null},n=!1,r=function o(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var i=a,s=U_e(i),l=s[0],u=s.slice(1);if(typeof l=="number"){JR(o.bind(null,u),l);return}o(l),JR(o.bind(null,u));return}mE(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){n=!0},start:function(a){n=!1,r(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function Rm(e){"@babel/helpers - typeof";return Rm=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},Rm(e)}function e5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function t5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e5(Object(n),!0).forEach(function(r){TU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TU(e,t,n){return t=q_e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q_e(e){var t=K_e(e,"string");return Rm(t)==="symbol"?t:String(t)}function K_e(e,t){if(Rm(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rm(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $_e=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,o){return r.filter(function(a){return o.includes(a)})})},X_e=function(t){return t},J_e=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Fp=function(t,n){return Object.keys(n).reduce(function(r,o){return t5(t5({},r),{},TU({},o,t(o,n[o])))},{})},n5=function(t,n,r){return t.map(function(o){return"".concat(J_e(o)," ").concat(n,"ms ").concat(r)}).join(",")};function Q_e(e,t){return nYe(e)||tYe(e,t)||xU(e,t)||eYe()}function eYe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tYe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}function nYe(e){if(Array.isArray(e))return e}function rYe(e){return iYe(e)||aYe(e)||xU(e)||oYe()}function oYe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xU(e,t){if(e){if(typeof e=="string")return gE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gE(e,t)}}function aYe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iYe(e){if(Array.isArray(e))return gE(e)}function gE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var kw=1e-4,IU=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},kU=function(t,n){return t.map(function(r,o){return r*Math.pow(n,o)}).reduce(function(r,o){return r+o})},r5=function(t,n){return function(r){var o=IU(t,n);return kU(o,r)}},sYe=function(t,n){return function(r){var o=IU(t,n),a=[].concat(rYe(o.map(function(i,s){return i*s}).slice(1)),[0]);return kU(a,r)}},o5=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0],a=n[1],i=n[2],s=n[3];if(n.length===1)switch(n[0]){case"linear":o=0,a=0,i=1,s=1;break;case"ease":o=.25,a=.1,i=.25,s=1;break;case"ease-in":o=.42,a=0,i=1,s=1;break;case"ease-out":o=.42,a=0,i=.58,s=1;break;case"ease-in-out":o=0,a=0,i=.58,s=1;break;default:var l=n[0].split("(");if(l[0]==="cubic-bezier"&&l[1].split(")")[0].split(",").length===4){var u=l[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),f=Q_e(u,4);o=f[0],a=f[1],i=f[2],s=f[3]}}var h=r5(o,i),p=r5(a,s),m=sYe(o,i),w=function(S){return S>1?1:S<0?0:S},b=function(S){for(var x=S>1?1:S,E=x,C=0;C<8;++C){var M=h(E)-x,k=m(E);if(Math.abs(M-x)<kw||k<kw)return p(E);E=w(E-M/k)}return p(E)};return b.isStepper=!1,b},lYe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,o=t.damping,a=o===void 0?8:o,i=t.dt,s=i===void 0?17:i,l=function(f,h,p){var m=-(f-h)*r,w=p*a,b=p+(m-w)*s/1e3,y=p*s/1e3+f;return Math.abs(y-h)<kw&&Math.abs(b)<kw?[h,0]:[y,b]};return l.isStepper=!0,l.dt=s,l},cYe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(typeof o=="string")switch(o){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return o5(o);case"spring":return lYe();default:if(o.split("(")[0]==="cubic-bezier")return o5(o)}return typeof o=="function"?o:null};function Fm(e){"@babel/helpers - typeof";return Fm=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},Fm(e)}function a5(e){return fYe(e)||dYe(e)||EU(e)||uYe()}function uYe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dYe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fYe(e){if(Array.isArray(e))return yE(e)}function i5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Tr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i5(Object(n),!0).forEach(function(r){vE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vE(e,t,n){return t=hYe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hYe(e){var t=pYe(e,"string");return Fm(t)==="symbol"?t:String(t)}function pYe(e,t){if(Fm(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fm(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mYe(e,t){return yYe(e)||vYe(e,t)||EU(e,t)||gYe()}function gYe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EU(e,t){if(e){if(typeof e=="string")return yE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yE(e,t)}}function yE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vYe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}function yYe(e){if(Array.isArray(e))return e}var Ew=function(t,n,r){return t+(n-t)*r},bE=function(t){var n=t.from,r=t.to;return n!==r},bYe=function e(t,n,r){var o=Fp(function(a,i){if(bE(i)){var s=t(i.from,i.to,i.velocity),l=mYe(s,2),u=l[0],f=l[1];return Tr(Tr({},i),{},{from:u,velocity:f})}return i},n);return r<1?Fp(function(a,i){return bE(i)?Tr(Tr({},i),{},{velocity:Ew(i.velocity,o[a].velocity,r),from:Ew(i.from,o[a].from,r)}):i},n):e(t,o,r-1)};const wYe=function(e,t,n,r,o){var a=$_e(e,t),i=a.reduce(function(y,S){return Tr(Tr({},y),{},vE({},S,[e[S],t[S]]))},{}),s=a.reduce(function(y,S){return Tr(Tr({},y),{},vE({},S,{from:e[S],velocity:0,to:t[S]}))},{}),l=-1,u,f,h=function(){return null},p=function(){return Fp(function(S,x){return x.from},s)},m=function(){return!Object.values(s).filter(bE).length},w=function(S){u||(u=S);var x=S-u,E=x/n.dt;s=bYe(n,s,E),o(Tr(Tr(Tr({},e),t),p())),u=S,m()||(l=requestAnimationFrame(h))},b=function(S){f||(f=S);var x=(S-f)/r,E=Fp(function(M,k){return Ew.apply(void 0,a5(k).concat([n(x)]))},i);if(o(Tr(Tr(Tr({},e),t),E)),x<1)l=requestAnimationFrame(h);else{var C=Fp(function(M,k){return Ew.apply(void 0,a5(k).concat([n(1)]))},i);o(Tr(Tr(Tr({},e),t),C))}};return h=n.isStepper?w:b,function(){return requestAnimationFrame(h),function(){cancelAnimationFrame(l)}}};function uf(e){"@babel/helpers - typeof";return uf=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},uf(e)}var SYe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function TYe(e,t){if(e==null)return{};var n=xYe(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xYe(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,a;for(a=0;a<r.length;a++)o=r[a],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Qx(e){return CYe(e)||EYe(e)||kYe(e)||IYe()}function IYe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kYe(e,t){if(e){if(typeof e=="string")return wE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wE(e,t)}}function EYe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CYe(e){if(Array.isArray(e))return wE(e)}function wE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function za(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s5(Object(n),!0).forEach(function(r){yp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yp(e,t,n){return t=CU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MYe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DYe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,CU(r.key),r)}}function AYe(e,t,n){return t&&DYe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function CU(e){var t=NYe(e,"string");return uf(t)==="symbol"?t:String(t)}function NYe(e,t){if(uf(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uf(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OYe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&SE(e,t)}function SE(e,t){return SE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},SE(e,t)}function PYe(e){var t=jYe();return function(){var r=Cw(e),o;if(t){var a=Cw(this).constructor;o=Reflect.construct(r,arguments,a)}else o=r.apply(this,arguments);return TE(this,o)}}function TE(e,t){if(t&&(uf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xE(e)}function xE(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jYe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cw(e){return Cw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Cw(e)}var qs=function(e){OYe(n,e);var t=PYe(n);function n(r,o){var a;MYe(this,n),a=t.call(this,r,o);var i=a.props,s=i.isActive,l=i.attributeName,u=i.from,f=i.to,h=i.steps,p=i.children,m=i.duration;if(a.handleStyleChange=a.handleStyleChange.bind(xE(a)),a.changeStyle=a.changeStyle.bind(xE(a)),!s||m<=0)return a.state={style:{}},typeof p=="function"&&(a.state={style:f}),TE(a);if(h&&h.length)a.state={style:h[0].style};else if(u){if(typeof p=="function")return a.state={style:u},TE(a);a.state={style:l?yp({},l,u):u}}else a.state={style:{}};return a}return AYe(n,[{key:"componentDidMount",value:function(){var o=this.props,a=o.isActive,i=o.canBegin;this.mounted=!0,!(!a||!i)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(o){var a=this.props,i=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,f=a.to,h=a.from,p=this.state.style;if(s){if(!i){var m={style:l?yp({},l,f):f};this.state&&p&&(l&&p[l]!==f||!l&&p!==f)&&this.setState(m);return}if(!(__e(o.to,f)&&o.canBegin&&o.isActive)){var w=!o.canBegin||!o.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=w||u?h:o.to;if(this.state&&p){var y={style:l?yp({},l,b):b};(l&&p[l]!==b||!l&&p!==b)&&this.setState(y)}this.runAnimation(za(za({},this.props),{},{from:b,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var o=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),o&&o()}},{key:"handleStyleChange",value:function(o){this.changeStyle(o)}},{key:"changeStyle",value:function(o){this.mounted&&this.setState({style:o})}},{key:"runJSAnimation",
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FYe(e,t){if(e){if(typeof e=="string")return l5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l5(e,t)}}function l5(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function HYe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}function BYe(e){if(Array.isArray(e))return e}function c5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function u5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c5(Object(n),!0).forEach(function(r){_Ye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Ye(e,t,n){return t=YYe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YYe(e){var t=UYe(e,"string");return Hm(t)=="symbol"?t:t+""}function UYe(e,t){if(Hm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var d5=function(t,n,r,o,a){var i=Math.min(Math.abs(r)/2,Math.abs(o)/2),s=o>=0?1:-1,l=r>=0?1:-1,u=o>=0&&r>=0||o<0&&r<0?1:0,f;if(i>0&&a instanceof Array){for(var h=[0,0,0,0],p=0,m=4;p<m;p++)h[p]=a[p]>i?i:a[p];f="M".concat(t,",").concat(n+s*h[0]),h[0]>0&&(f+="A ".concat(h[0],",").concat(h[0],",0,0,").concat(u,",").concat(t+l*h[0],",").concat(n)),f+="L ".concat(t+r-l*h[1],",").concat(n),h[1]>0&&(f+="A ".concat(h[1],",").concat(h[1],",0,0,").concat(u,`,
|
||||
`).concat(t+r,",").concat(n+s*h[1])),f+="L ".concat(t+r,",").concat(n+o-s*h[2]),h[2]>0&&(f+="A ".concat(h[2],",").concat(h[2],",0,0,").concat(u,`,
|
||||
`).concat(t+r-l*h[2],",").concat(n+o)),f+="L ".concat(t+l*h[3],",").concat(n+o),h[3]>0&&(f+="A ".concat(h[3],",").concat(h[3],",0,0,").concat(u,`,
|
||||
`).concat(t,",").concat(n+o-s*h[3])),f+="Z"}else if(i>0&&a===+a&&a>0){var w=Math.min(i,a);f="M ".concat(t,",").concat(n+s*w,`
|
||||
A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t+l*w,",").concat(n,`
|
||||
L `).concat(t+r-l*w,",").concat(n,`
|
||||
A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t+r,",").concat(n+s*w,`
|
||||
L `).concat(t+r,",").concat(n+o-s*w,`
|
||||
A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t+r-l*w,",").concat(n+o,`
|
||||
L `).concat(t+l*w,",").concat(n+o,`
|
||||
A `).concat(w,",").concat(w,",0,0,").concat(u,",").concat(t,",").concat(n+o-s*w," Z")}else f="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(o," h ").concat(-r," Z");return f},zYe=function(t,n){if(!t||!n)return!1;var r=t.x,o=t.y,a=n.x,i=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),f=Math.max(a,a+s),h=Math.min(i,i+l),p=Math.max(i,i+l);return r>=u&&r<=f&&o>=h&&o<=p}return!1},VYe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},oA=function(t){var n=u5(u5({},VYe),t),r=D.useRef(),o=D.useState(-1),a=LYe(o,2),i=a[0],s=a[1];D.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var C=r.current.getTotalLength();C&&s(C)}catch{}},[]);var l=n.x,u=n.y,f=n.width,h=n.height,p=n.radius,m=n.className,w=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isAnimationActive,x=n.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||h!==+h||f===0||h===0)return null;var E=zt("recharts-rectangle",m);return x?_.createElement(qs,{canBegin:i>0,from:{width:f,height:h,x:l,y:u},to:{width:f,height:h,x:l,y:u},duration:b,animationEasing:w,isActive:x},function(C){var M=C.width,k=C.height,O=C.x,F=C.y;return _.createElement(qs,{canBegin:i>0,from:"0px ".concat(i===-1?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,isActive:S,easing:w},_.createElement("path",Mw({},Rt(n,!0),{className:E,d:d5(O,F,M,k,p),ref:r})))}):_.createElement("path",Mw({},Rt(n,!0),{className:E,d:d5(l,u,f,h,p)}))};function IE(){return IE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IE.apply(this,arguments)}var aA=function(t){var n=t.cx,r=t.cy,o=t.r,a=t.className,i=zt("recharts-dot",a);return n===+n&&r===+r&&o===+o?_.createElement("circle",IE({},Rt(t,!1),$b(t),{className:i,cx:n,cy:r,r:o})):null};function Bm(e){"@babel/helpers - typeof";return Bm=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},Bm(e)}var WYe=["x","y","top","left","width","height","className"];function kE(){return kE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kE.apply(this,arguments)}function f5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function GYe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f5(Object(n),!0).forEach(function(r){ZYe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZYe(e,t,n){return t=qYe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qYe(e){var t=KYe(e,"string");return Bm(t)=="symbol"?t:t+""}function KYe(e,t){if(Bm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $Ye(e,t){if(e==null)return{};var n=XYe(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XYe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var JYe=function(t,n,r,o,a,i){return"M".concat(t,",").concat(a,"v").concat(o,"M").concat(i,",").concat(n,"h").concat(r)},QYe=function(t){var n=t.x,r=n===void 0?0:n,o=t.y,a=o===void 0?0:o,i=t.top,s=i===void 0?0:i,l=t.left,u=l===void 0?0:l,f=t.width,h=f===void 0?0:f,p=t.height,m=p===void 0?0:p,w=t.className,b=$Ye(t,WYe),y=GYe({x:r,y:a,top:s,left:u,width:h,height:m},b);return!$e(r)||!$e(a)||!$e(h)||!$e(m)||!$e(s)||!$e(u)?null:_.createElement("path",kE({},Rt(y,!0),{className:zt("recharts-cross",w),d:JYe(r,a,h,m,s,u)}))},eUe=Js,tUe=ii,nUe="[object Boolean]";function rUe(e){return e===!0||e===!1||tUe(e)&&eUe(e)==nUe}var oUe=rUe;const aUe=Je(oUe);function _m(e){"@babel/helpers - typeof";return _m=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},_m(e)}function Dw(){return Dw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arg
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lUe(e,t){if(e){if(typeof e=="string")return h5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h5(e,t)}}function h5(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cUe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}function uUe(e){if(Array.isArray(e))return e}function p5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function m5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p5(Object(n),!0).forEach(function(r){dUe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dUe(e,t,n){return t=fUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fUe(e){var t=hUe(e,"string");return _m(t)=="symbol"?t:t+""}function hUe(e,t){if(_m(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_m(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var g5=function(t,n,r,o,a){var i=r-o,s;return s="M ".concat(t,",").concat(n),s+="L ".concat(t+r,",").concat(n),s+="L ".concat(t+r-i/2,",").concat(n+a),s+="L ".concat(t+r-i/2-o,",").concat(n+a),s+="L ".concat(t,",").concat(n," Z"),s},pUe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},mUe=function(t){var n=m5(m5({},pUe),t),r=D.useRef(),o=D.useState(-1),a=iUe(o,2),i=a[0],s=a[1];D.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var E=r.current.getTotalLength();E&&s(E)}catch{}},[]);var l=n.x,u=n.y,f=n.upperWidth,h=n.lowerWidth,p=n.height,m=n.className,w=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||h!==+h||p!==+p||f===0&&h===0||p===0)return null;var x=zt("recharts-trapezoid",m);return S?_.createElement(qs,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:p,x:l,y:u},to:{upperWidth:f,lowerWidth:h,height:p,x:l,y:u},duration:b,animationEasing:w,isActive:S},function(E){var C=E.upperWidth,M=E.lowerWidth,k=E.height,O=E.x,F=E.y;return _.createElement(qs,{canBegin:i>0,from:"0px ".concat(i===-1?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,easing:w},_.createElement("path",Dw({},Rt(n,!0),{className:x,d:g5(O,F,C,M,k),ref:r})))}):_.createElement("g",null,_.createElement("path",Dw({},Rt(n,!0),{className:x,d:g5(l,u,f,h,p)})))},gUe=["option","shapeType","propTransformer","activeClassName","isActive"];function Ym(e){"@babel/helpers - typeof";return Ym=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},Ym(e)}function vUe(e,t){if(e==null)return{};var n=yUe(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function yUe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function v5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Aw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v5(Object(n),!0).forEach(function(r){bUe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bUe(e,t,n){return t=wUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wUe(e){var t=SUe(e,"string");return Ym(t)=="symbol"?t:t+""}function SUe(e,t){if(Ym(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ym(r)!="object")return r;t
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uVe(e,t){if(e){if(typeof e=="string")return P5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P5(e,t)}}function P5(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dVe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}function fVe(e){if(Array.isArray(e))return e}function AE(){return AE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AE.apply(this,arguments)}var hVe=function(t,n){var r;return _.isValidElement(t)?r=_.cloneElement(t,n):Mt(t)?r=t(n):r=_.createElement("line",AE({},n,{className:"recharts-reference-line-line"})),r},pVe=function(t,n,r,o,a,i,s,l,u){var f=a.x,h=a.y,p=a.width,m=a.height;if(r){var w=u.y,b=t.y.apply(w,{position:i});if(Ki(u,"discard")&&!t.y.isInRange(b))return null;var y=[{x:f+p,y:b},{x:f,y:b}];return l==="left"?y.reverse():y}if(n){var S=u.x,x=t.x.apply(S,{position:i});if(Ki(u,"discard")&&!t.x.isInRange(x))return null;var E=[{x,y:h+m},{x,y:h}];return s==="top"?E.reverse():E}if(o){var C=u.segment,M=C.map(function(k){return t.apply(k,{position:i})});return Ki(u,"discard")&&tze(M,function(k){return!t.isInRange(k)})?null:M}return null};function mVe(e){var t=e.x,n=e.y,r=e.segment,o=e.xAxisId,a=e.yAxisId,i=e.shape,s=e.className,l=e.alwaysShow,u=Kze(),f=VU(o),h=WU(a),p=Jze();if(!u||!p)return null;Hs(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=iA({x:f.scale,y:h.scale}),w=Qn(t),b=Qn(n),y=r&&r.length===2,S=pVe(m,w,b,y,p,e.position,f.orientation,h.orientation,e);if(!S)return null;var x=lVe(S,2),E=x[0],C=E.x,M=E.y,k=x[1],O=k.x,F=k.y,R=Ki(e,"hidden")?"url(#".concat(u,")"):void 0,B=O5(O5({clipPath:R},Rt(e,!0)),{},{x1:C,y1:M,x2:O,y2:F});return _.createElement(_n,{className:zt("recharts-reference-line",s)},hVe(i,B),Vr.renderCallByParent(e,Lze({x1:C,y1:M,x2:O,y2:F})))}var fA=function(e){function t(){return eVe(this,t),rVe(this,t,arguments)}return iVe(t,e),nVe(t,[{key:"render",value:function(){return _.createElement(mVe,this.props)}}])}(_.Component);dA(fA,"displayName","ReferenceLine");dA(fA,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function NE(){return NE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NE.apply(this,arguments)}function mf(e){"@babel/helpers - typeof";return mf=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},mf(e)}function j5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function L5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j5(Object(n),!0).forEach(function(r){IS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gVe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vVe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,KU(r.key),r)}}function yVe(e,t,n){return t&&vVe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function bVe(e,t,n){return t=Rw(t),wVe(e,qU()?Reflect.construct(t,n||[],Rw(e).constructor):t.apply(e,n))}function wVe(e,t){if(t&&(mf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SVe(e)}function SVe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qU=function(){return!!e})()}function Rw(e){return Rw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototyp
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vWe(e,t){if(e){if(typeof e=="string")return RE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return RE(e,t)}}function yWe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bWe(e){if(Array.isArray(e))return RE(e)}function RE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function W5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rz(r.key),r)}}function SWe(e,t,n){return t&&W5(e.prototype,t),n&&W5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function TWe(e,t,n){return t=_w(t),xWe(e,nz()?Reflect.construct(t,n||[],_w(e).constructor):t.apply(e,n))}function xWe(e,t){if(t&&(yf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return IWe(e)}function IWe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nz=function(){return!!e})()}function _w(e){return _w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_w(e)}function kWe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&FE(e,t)}function FE(e,t){return FE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},FE(e,t)}function Za(e,t,n){return t=rz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rz(e){var t=EWe(e,"string");return yf(t)=="symbol"?t:t+""}function EWe(e,t){if(yf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Zg=function(e){function t(){var n;wWe(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return n=TWe(this,t,[].concat(o)),Za(n,"state",{isAnimationFinished:!0,totalLength:0}),Za(n,"generateSimpleStrokeDasharray",function(i,s){return"".concat(s,"px ").concat(i-s,"px")}),Za(n,"getStrokeDasharray",function(i,s,l){var u=l.reduce(function(S,x){return S+x});if(!u)return n.generateSimpleStrokeDasharray(s,i);for(var f=Math.floor(i/u),h=i%u,p=s-i,m=[],w=0,b=0;w<l.length;b+=l[w],++w)if(b+l[w]>h){m=[].concat(bd(l.slice(0,w)),[h-b]);break}var y=m.length%2===0?[0,p]:[p];return[].concat(bd(t.repeat(l,f)),bd(m),y).map(function(S){return"".concat(S,"px")}).join(", ")}),Za(n,"id",Yg("recharts-line-")),Za(n,"pathRef",function(i){n.mainCurve=i}),Za(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Za(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return kWe(t,e),SWe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,o){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,i=a.points,s=a.xAxis,l=a.yAxis,u=a.layout,f=a.children,h=ba(f,Gg);if(!h)return null;var p=function(b,y){return{x:b.x,y:b.y,value:b.value,errorVal:Qo(b.payload,y)}},m={clipPath:r?"url(#clipPath-".concat(o,")"):null};return _.createElement(_n,m,h.map(function(w){return _.cloneElement(w,{key:"bar-".concat(w.props.dataKey),data:i,xAxis:s,yAxis:l,layout:u,dataPointFormatter:p})}))}},{key:"renderDots",value:function(r,o,a){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,f=s.dataKey,h=Rt(this.props,!1),p=Rt(l,!0),m=u.map(function(b,y){var S=Yo(Yo(Yo({key:"dot-".concat(y),r:3},h),p),{},{value:b.value,dataKey:f,cx:b.x,cy:b.y,index:y,payload:b.payload});return t.renderDotItem(l,S)}),w={clipPath:r?"url(#clipPath-".concat(o?"":"dots-").concat(a,")"):null};retur
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GWe(e,t){if(e){if(typeof e=="string")return UE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UE(e,t)}}function ZWe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qWe(e){if(Array.isArray(e))return UE(e)}function UE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var zE=function(t,n,r,o,a){var i=ba(t,fA),s=ba(t,kS),l=[].concat(G5(i),G5(s)),u=ba(t,CS),f="".concat(o,"Id"),h=o[0],p=n;if(l.length&&(p=l.reduce(function(b,y){if(y.props[f]===r&&Ki(y.props,"extendDomain")&&$e(y.props[h])){var S=y.props[h];return[Math.min(b[0],S),Math.max(b[1],S)]}return b},p)),u.length){var m="".concat(h,"1"),w="".concat(h,"2");p=u.reduce(function(b,y){if(y.props[f]===r&&Ki(y.props,"extendDomain")&&$e(y.props[m])&&$e(y.props[w])){var S=y.props[m],x=y.props[w];return[Math.min(b[0],S,x),Math.max(b[1],S,x)]}return b},p)}return a&&a.length&&(p=a.reduce(function(b,y){return $e(y)?[Math.min(b[0],y),Math.max(b[1],y)]:b},p)),p},uz={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(l,u,f){this.fn=l,this.context=u,this.once=f||!1}function a(l,u,f,h,p){if(typeof f!="function")throw new TypeError("The listener must be a function");var m=new o(f,h||l,p),w=n?n+u:u;return l._events[w]?l._events[w].fn?l._events[w]=[l._events[w],m]:l._events[w].push(m):(l._events[w]=m,l._eventsCount++),l}function i(l,u){--l._eventsCount===0?l._events=new r:delete l._events[u]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],f,h;if(this._eventsCount===0)return u;for(h in f=this._events)t.call(f,h)&&u.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},s.prototype.listeners=function(u){var f=n?n+u:u,h=this._events[f];if(!h)return[];if(h.fn)return[h.fn];for(var p=0,m=h.length,w=new Array(m);p<m;p++)w[p]=h[p].fn;return w},s.prototype.listenerCount=function(u){var f=n?n+u:u,h=this._events[f];return h?h.fn?1:h.length:0},s.prototype.emit=function(u,f,h,p,m,w){var b=n?n+u:u;if(!this._events[b])return!1;var y=this._events[b],S=arguments.length,x,E;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),S){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,f),!0;case 3:return y.fn.call(y.context,f,h),!0;case 4:return y.fn.call(y.context,f,h,p),!0;case 5:return y.fn.call(y.context,f,h,p,m),!0;case 6:return y.fn.call(y.context,f,h,p,m,w),!0}for(E=1,x=new Array(S-1);E<S;E++)x[E-1]=arguments[E];y.fn.apply(y.context,x)}else{var C=y.length,M;for(E=0;E<C;E++)switch(y[E].once&&this.removeListener(u,y[E].fn,void 0,!0),S){case 1:y[E].fn.call(y[E].context);break;case 2:y[E].fn.call(y[E].context,f);break;case 3:y[E].fn.call(y[E].context,f,h);break;case 4:y[E].fn.call(y[E].context,f,h,p);break;default:if(!x)for(M=1,x=new Array(S-1);M<S;M++)x[M-1]=arguments[M];y[E].fn.apply(y[E].context,x)}}return!0},s.prototype.on=function(u,f,h){return a(this,u,f,h,!1)},s.prototype.once=function(u,f,h){return a(this,u,f,h,!0)},s.prototype.removeListener=function(u,f,h,p){var m=n?n+u:u;if(!this._events[m])return this;if(!f)return i(this,m),this;var w=this._events[m];if(w.fn)w.fn===f&&(!p||w.once)&&(!h||w.context===h)&&i(this,m);else{for(var b=0,y=[],S=w.length;b<S;b++)(w[b].fn!==f||p&&!w[b].once||h&&w[b].context!==h)&&y.push(w[b]);y.length?this._events[m]=y.length===1?y[0]:y:i(this,m)}return this},s.prototype.removeAllListeners=function(u){var f;return u?(f=n?n+u:u,this._events[f]&&i(this,f)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(uz);var KWe=uz.exports;const $We=Je(KWe);var nI=new $We,rI="recharts.syncMouseEvents";function Zm(e){"@babel/helpers - typeof";return Zm=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},Zm(e)}function XWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JWe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,dz(r.key),r)}}function QWe(e,t,n){return t&&JWe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function oI(e,t,n){return t=dz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dz(e){var t=eGe(e,"string");return Zm(t)=="symbol"?t:t+""}function eGe(e,t){if(Zm(e)!="object"|
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fGe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,a,i,s=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(f){u=!0,o=f}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}function hGe(e){if(Array.isArray(e))return e}function K5(e,t){if(e==null)return{};var n=pGe(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pGe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function mGe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gGe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mz(r.key),r)}}function vGe(e,t,n){return t&&gGe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yGe(e,t,n){return t=zw(t),bGe(e,hz()?Reflect.construct(t,n||[],zw(e).constructor):t.apply(e,n))}function bGe(e,t){if(t&&(Sf(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wGe(e)}function wGe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hz=function(){return!!e})()}function zw(e){return zw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zw(e)}function SGe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&VE(e,t)}function VE(e,t){return VE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},VE(e,t)}function Tf(e){return IGe(e)||xGe(e)||pz(e)||TGe()}function TGe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pz(e,t){if(e){if(typeof e=="string")return WE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return WE(e,t)}}function xGe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IGe(e){if(Array.isArray(e))return WE(e)}function WE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$5(Object(n),!0).forEach(function(r){pt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pt(e,t,n){return t=mz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mz(e){var t=kGe(e,"string");return Sf(t)=="symbol"?t:t+""}function kGe(e,t){if(Sf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Sf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EGe={xAxis:["bottom","top"],yAxis:["left","right"]},CGe={width:"100%",height:"100%"},gz={x:0,y:0};function Py(e){return e}var MGe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},DGe=function(t,n,r,o){var a=n.find(function(f){return f&&f.index===r});if(a){if(t==="horizontal")return{x:a.coordinate,y:o.y};if(t==="vertical")return{x:o.x,y:a.coordinate};if(t==="centric"){var i=a.coordinate,s=o.radius;return Ee(Ee(Ee({},o),kr(o.cx,o.cy,s,i)),{},{angle:i,radius:s})}var l=a.coordinate,u=o.angle;return Ee(Ee(Ee({},o),kr(o.cx,o.cy,l,u)),{},{angle:u,radius:l})}return gz},MS=function(t,n){var r=n.graphicalItems,o=n.dataStartIndex,a=n.dataEndIndex,i=(r??[]).reduce(function(s,l){var u=l.props.data;return u&&u.length?[].concat(Tf(s),Tf(u)):s},[]);return i.length>0?i:t&&t.length&&$e(o)&&$e(a)?t.slice(o,a+1):[]};function vz(e){return e==="number"?[0,"auto"]:void 0}var GE=function(t,n,r,o){var a=t.graphicalItems,i=t.tooltipAxis,s=MS(n,t);return r<0||!a||!a.length||r>=s.length?null:a.reduce(function(l,u){var f,h=(f=u.props.data)!==null&&f!==void 0?f:n;h&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(h=h.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(i.dataKey&&!i.allowDuplicatedCategory){var m=h===void 0?s:h;p=Kb(m,i.dataKey,o)}else p=h&&h[r]||s[r];return p?[].concat(Tf(l),[gU(u,p)]):l},[])},X5=function(t,n,r,o){var a=o||{x:t.chartX,y:t.chartY},i=MGe(a,r),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=Z7e(i,s,u,l);if(f>=0&&u){var h=u[f]&&u[f].value,p=GE(t,n,f,h),m=DGe(r,s,f,a);return{activeTooltipIndex:f,activeLabel:h,activePayload:p,activeCoordinate:m}}return null},AGe=function(t,n){var r=n.axes,o=n.graphicalItems,a=n.axisType,i=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,u=n.dataEndIndex,f=t.layout,h=t.children,p=t.stackOffset,m=hU(f,a);return r.reduce(function(w,b){var y,S=b.type.defaultProps!==void 0?Ee(Ee({},b.type.defaultProps),b.props):b.props,x=S.type,E=S.dataKey,C=S.allowDataOverflow,M=S.allowDuplicatedCategory,k=S.scale,O=S.ticks,F=S.includeHidden,R=S[i];if(w[R])return w;var B=MS(t.data,{graphicalItems:o.filter(function(ee){var ie,fe=i in ee.props?ee.props[i]:(ie=ee.type.defaultProps)===null||ie===void 0?void 0:ie[i];return fe===R}),dataStartIndex:l,dataEndIndex:u}),Y=B.length,H,Z,W;nGe(S.domain,C,x)&&(H=cE(S.domain,null,C),m&&(x==="number"||k!=="auto")&&(W=Rp(B,E,"category")));var K=vz(x);if(!H||H.length===0){var V,ne=(V=S.domain)!==null&&V!==void 0?V:K;if(E){if(H=Rp(B,E,x),x==="category"&&m){var Q=pLe(H);M&&Q?(Z=H,H=im(0,Y)):M||(H=NR(ne,H,b).reduce(function(ee,ie){return ee.indexOf(ie)>=0?ee:[].concat(Tf(ee),[ie])},[]))}else if(x==="category")M?H=H.filter(function(ee){return ee!==""&&!jt(ee)}):H=NR(ne,H,b).reduce(function(ee,ie){return ee.indexOf(ie)>=0||ie===""||jt(ie)?ee:[].concat(Tf(ee),[ie])},[]);else if(x==="number"){var te=J7e(B,o.filter(function(ee){var ie,fe,he=i in ee.props?ee.props[i]:(ie=ee.type.defaultProps)===null||ie===void 0?void 0:ie[i],we="hide"in ee.props?ee.props.hide:(fe=ee.type.defaultProps)===null||fe===void 0?void 0:fe.hide;return he===R&&(F||!we)}),E,a,f);te&&(H=te)}m&&(x==="number"||k!=="auto")&&(W=Rp(B,E,"category"))}else m?H=im(0,Y):s&&s[R]&&s[R].hasStack&&x==="number"?H=p==="expand"?[0,1]:mU(s[R].stackGroups,l,u):H=fU(B,o.filter(function(ee){var ie=i in ee.props?ee
Line truncated
|
||||
${o} [data-chart=${e}] {
|
||||
${n.map(([a,i])=>{const s=i.theme?.[r]||i.color;return s?` --color-${a}: ${s};`:null}).join(`
|
||||
`)}
|
||||
}
|
||||
`).join(`
|
||||
`)}}):null},kp=Ri;function jy({active:e,payload:t,className:n,indicator:r="dot",hideLabel:o=!1,hideIndicator:a=!1,label:i,labelFormatter:s,labelClassName:l,formatter:u,color:f,nameKey:h,labelKey:p}){const{config:m}=yZe(),w=D.useMemo(()=>{if(o||!t?.length)return null;const[y]=t,S=`${p||y?.dataKey||y?.name||"value"}`,x=n9(m,y,S),E=!p&&typeof i=="string"?m[i]?.label||i:x?.label;return s?g.jsx("div",{className:qo("th:font-medium",l),children:s(E,t)}):E?g.jsx("div",{className:qo("th:font-medium",l),children:E}):null},[i,s,t,o,l,m,p]);if(!e||!t?.length)return null;const b=t.length===1&&r!=="dot";return g.jsxs("div",{className:qo("th:border-border/50 th:bg-background th:grid th:min-w-[8rem] th:items-start th:gap-1.5 th:rounded-lg th:border th:px-2.5 th:py-1.5 th:text-xs th:shadow-xl",n),children:[b?null:w,g.jsx("div",{className:"th:grid th:gap-1.5",children:t.map((y,S)=>{const x=`${h||y.name||y.dataKey||"value"}`,E=n9(m,y,x),C=f||y.payload.fill||y.color;return g.jsx("div",{className:qo("[&>svg]:th:text-muted-foreground th:flex th:w-full th:flex-wrap th:items-stretch th:gap-2 [&>svg]:th:h-2.5 [&>svg]:th:w-2.5",r==="dot"&&"th:items-center"),children:u&&y?.value!==void 0&&y.name?u(y.value,y.name,y,S,y.payload):g.jsxs(g.Fragment,{children:[E?.icon?g.jsx(E.icon,{}):!a&&g.jsx("div",{className:qo("th:shrink-0 th:rounded-[2px] th:border-(--color-border) th:bg-(--color-bg)",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":b&&r==="dashed"}),style:{"--color-bg":C,"--color-border":C}}),g.jsxs("div",{className:qo("th:flex th:flex-1 th:justify-between th:leading-none",b?"th:items-end":"th:items-center"),children:[g.jsxs("div",{className:"th:grid th:gap-1.5",children:[b?w:null,g.jsx("span",{className:"th:text-muted-foreground",children:E?.label||y.name})]}),y.value&&g.jsx("span",{className:"th:text-foreground th:font-mono th:font-medium th:tabular-nums",children:y.value.toLocaleString()})]})]})},y.dataKey)})})]})}function n9(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let o=n;return n in t&&typeof t[n]=="string"?o=t[n]:r&&n in r&&typeof r[n]=="string"&&(o=r[n]),o in e?e[o]:e[n]}const wZe={item:{label:"Item",color:"var(--chart-3)"}};function SZe({memos:e}){const[t,n]=D.useState([]);D.useEffect(()=>{const o=[{period:"00:00-03:00",count:0},{period:"03:00-06:00",count:0},{period:"06:00-09:00",count:0},{period:"09:00-12:00",count:0},{period:"12:00-15:00",count:0},{period:"15:00-18:00",count:0},{period:"18:00-21:00",count:0},{period:"21:00-24:00",count:0}];e.forEach(a=>{const i=new Date(a.createdAt).getHours();i<3?o[0].count++:i<6?o[1].count++:i<9?o[2].count++:i<12?o[3].count++:i<15?o[4].count++:i<18?o[5].count++:i<21?o[6].count++:o[7].count++}),n(o)},[e]);const r=D.useMemo(()=>{if(t.length===0)return[0,0];const o=Math.max(...t.map(a=>a.count));return[0,Math.ceil(o)]},[t]);return g.jsx("div",{className:"twp",children:g.jsxs(bp,{className:"th:w-full th:h-full th:flex th:flex-col th:rounded th:mb-4",children:[g.jsx(wp,{className:"th:flex th:flex-row th:flex-wrap th:gap-2 th:py-2 sm:th:gap-0 th:justify-between th:border-border th:border-b",children:g.jsxs("div",{className:"th:flex th:flex-col th:gap-1",children:[g.jsx(Sp,{children:I("Time Distribution")}),g.jsx(Tp,{children:I("When do you write thinos")})]})}),g.jsx(xp,{className:"th:w-full th:h-full th:my-4 th:h-96",children:g.jsx(Ip,{config:wZe,className:"th:aspect-auto th:h-full th:w-full",children:g.jsxs(ib,{data:t,margin:{top:20,right:10,left:0,bottom:10},children:[g.jsx(Dd,{strokeDasharray:"3 3"}),g.jsx(Ns,{dataKey:"period",tickLine:!1,tickMargin:10,axisLine:!1}),g.jsx(Os,{domain:r,allowDecimals:!1}),g.jsx(kp,{content:g.jsx(TZe,{})}),g.jsx($i,{dataKey:"count",fill:"var(--chart-2)",radius:[4,4,0,0]})]})})})]})})}const TZe=({active:e,payload:t})=>{if(e&&t&&t.length){const n=t[0].payload;return g.jsxs("div",{className:"th:p-2 th:border th:border-border th:bg-secondary th:rounded th:shadow",children:[g.jsx("p",{className:"th:font-bold",children:n.period}),g.jsxs("p",{children:[n.count," thinos"]})]})}return null},xZe=D.forwardRef((e,t)=>{const{currentDate:n,setCurrentDateStamp:r,showTimeDistributionChart:o}=e,[a,i]=D.useState(!1),s=je.getDateStampByDate(je.getDateString(n)),l=D.useRef(null);D.useEffect(()=>{l.current&&A.setIcon(l.current,"more-horizontal")},[l.current]);const u=f=>{r(f)};return D.useImperativeHandle(t,()=>({closeDatePicker:()=>{i(!1)}})),g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"date-card-container",children:[g.jsxs("div",{className:"date-container-details",children:[g.jsxs("div",{className:"details-text",children:[A.moment(s,"x").format("dddd"),g.jsx("div",{className:"date-text",children:A.moment(s,"x").format("MMM")+A.moment(s,"x").format("DD")})]}),g.jsx("div",{className:"details-logo-text",children:I("Daily Memos")})]}),g.jsxs("div",{className:"date-container-info",children:[g.jsxs("div",{className:"da
Line truncated
|
||||
-H "Authorization: ${this.authHeader}" \\
|
||||
-H "Content-Type: application/json" \\
|
||||
-d '{"text": "Hello from API", "type": "DAILY"}'`;const u=t.createDiv("expiry-info"),f=this.expiryHours>=24?`⏰ This token will expire in ${Math.floor(this.expiryHours/24)} day(s).`:`⏰ This token will expire in ${this.expiryHours} hour(s).`;u.createEl("p",{text:f,cls:"expiry-warning"});const h=t.createDiv("button-group"),p=h.createEl("button",{text:"Copy Token"});p.onclick=async()=>{await navigator.clipboard.writeText(this.token),new A.Notice("Token copied to clipboard")};const m=h.createEl("button",{text:"Copy Auth Header"});m.onclick=async()=>{await navigator.clipboard.writeText(this.authHeader),new A.Notice("Authorization header copied to clipboard")};const w=h.createEl("button",{text:"Close"});w.onclick=()=>this.close()}onClose(){const{contentEl:t}=this;t.empty()}}class m9 extends A.Modal{constructor(t,n,r,o){super(t),this.cb=o,this.app=t,this.settingTab=n,this.plugin=r}plugin;settingTab;onOpen(){const{contentEl:t}=this;t.parentElement?.classList.add("memo-save-location-modal"),this.titleEl.toggleClass("modal-title",!0),this.titleEl.setText(I("Password for Thino")),t.createDiv("modal-desc",s=>{s.setText(I("Please input your password to change password settings"))});const n=t.createDiv("modal-setting"),r=new De(n,this.settingTab).setName(I("Password")).addText(s=>{s.setPlaceholder(I("Please input your password")).inputEl.type="password"}),o=t.createDiv("button-group"),a=o.createEl("button",{text:I("Cancel")}),i=o.createEl("button",{cls:"thino-password-confirm-btn",text:I("Confirm?").replace(/(\?|?)/g,"")});i.onclick=async()=>{r.controlEl.querySelector("input").value===this.plugin.settings.password?(this.cb?.(!0),this.close()):new A.Notice(I("Password is incorrect"))},a.onclick=async()=>{this.close()}}onClose(){const{contentEl:t}=this;t.empty()}}class Gqe extends A.Modal{plugin;constructor(t,n){super(t),this.plugin=n}onOpen(){const{contentEl:t}=this;t.parentElement?.classList.add("api-documentation-modal"),this.titleEl.setText("Thino API Documentation");const n=t.createDiv("api-doc-container"),r=n.createDiv("api-section");r.createEl("h2",{text:"Overview"}),r.createEl("p",{text:"The Thino HTTP API allows you to interact with your thinos programmatically. All endpoints require authentication using a Bearer token."});const o=r.createDiv("server-info");o.createEl("strong",{text:"Server Address: "}),o.createSpan({text:`http://${this.plugin.settings.HttpApiIpType}:${this.plugin.settings.HttpApiPort}`});const a=n.createDiv("api-section");a.createEl("h2",{text:"Authentication"}),a.createEl("p",{text:'All API requests require a Bearer token in the Authorization header. Generate a token using the "Generate Token" button above.'});const i=a.createDiv("code-example");i.createEl("h4",{text:"Authorization Header Format:"}),i.createEl("pre").createEl("code",{text:"Authorization: Bearer <your-token-here>"});const l=n.createDiv("api-section");l.createEl("h2",{text:"API Endpoints"}),this.createEndpointSection(l,{title:"Create Thino",method:"POST",endpoint:"/create",description:"Create a new thino with text content and optional images",parameters:[{name:"text",type:"string",required:!0,description:"The content of the thino"},{name:"isList",type:"boolean",required:!1,description:"Whether to format as list item (default: false)"},{name:"type",type:"string",required:!1,description:"Save location type (DAILY, CANVAS, MULTI, FILE)"},{name:"imageList",type:"array",required:!1,description:"Array of base64 encoded images"},{name:"sourceLink",type:"string",required:!1,description:"Source URL to append to the thino"}],examples:{curl:this.generateCurlExample("POST","/create",{text:"This is my new thino",isList:!1,type:"DAILY"}),python:this.generatePythonExample("POST","/create",{text:"This is my new thino",isList:!1,type:"DAILY"}),nodejs:this.generateNodeExample("POST","/create",{text:"This is my new thino",isList:!1,type:"DAILY"})}}),this.createEndpointSection(l,{title:"Search Thinos",method:"GET",endpoint:"/search",description:"Search for thinos containing specific keywords",parameters:[{name:"keyword",type:"string",required:!0,description:"Search keyword"}],examples:{curl:this.generateCurlExample("GET","/search?keyword=meeting"),python:this.generatePythonExample("GET","/search?keyword=meeting"),nodejs:this.generateNodeExample("GET","/search?keyword=meeting")}}),this.createEndpointSection(l,{title:"List Thinos",method:"GET",endpoint:"/list",description:"Get a list of recent thinos",parameters:[{name:"count",type:"number",required:!1,description:"Number of thinos to return (1-100, default: 10)"}],examples:{curl:this.generateCurlExample("GET","/list?count=20"),python:this.generatePythonExample("GET","/list?count=20"),nodejs:this.generateNodeExample("GET","/list?count=20")}}),this.createEndpointSection(l,{title:"Get Settings Info",method:"GET",endpoint:"/info",description:"Get current plugin settings information",parameters:[{name:"getSettings",type:"boolean",required:!0,description:"Must be true to retrieve settings"}],example
Line truncated
|
||||
-H "Authorization: Bearer <your-token>"`;return r&&t!=="GET"&&(a+=` \\
|
||||
-H "Content-Type: application/json" \\
|
||||
-d '${JSON.stringify(r,null,2)}'`),a}generatePythonExample(t,n,r){let a=`import requests
|
||||
import json
|
||||
|
||||
url = "${`http://${this.plugin.settings.HttpApiIpType}:${this.plugin.settings.HttpApiPort}`}${n}"
|
||||
headers = {
|
||||
"Authorization": "Bearer <your-token>"`;return r&&t!=="GET"&&(a+=`,
|
||||
"Content-Type": "application/json"`),a+=`
|
||||
}`,r&&t!=="GET"?a+=`
|
||||
|
||||
data = ${JSON.stringify(r,null,4)}
|
||||
|
||||
response = requests.${t.toLowerCase()}(url, headers=headers, json=data)`:a+=`
|
||||
|
||||
response = requests.${t.toLowerCase()}(url, headers=headers)`,a+=`
|
||||
print(response.json())`,a}generateNodeExample(t,n,r){let a=`const fetch = require('node-fetch');
|
||||
|
||||
const url = '${`http://${this.plugin.settings.HttpApiIpType}:${this.plugin.settings.HttpApiPort}`}${n}';
|
||||
const options = {
|
||||
method: '${t}',
|
||||
headers: {
|
||||
'Authorization': 'Bearer <your-token>'`;return r&&t!=="GET"&&(a+=`,
|
||||
'Content-Type': 'application/json'`),a+=`
|
||||
}`,r&&t!=="GET"&&(a+=`,
|
||||
body: JSON.stringify(${JSON.stringify(r,null,8)})`),a+=`
|
||||
};
|
||||
|
||||
fetch(url, options)
|
||||
.then(response => response.json())
|
||||
.then(data => console.log(data))
|
||||
.catch(error => console.error('Error:', error));`,a}onClose(){const{contentEl:t}=this;t.empty()}}function AS(e){return e.split("-")[0]}function Rz(e){return e.split("-")[1]}function vA(e){return["top","bottom"].includes(AS(e))?"x":"y"}function Fz(e){return e==="y"?"height":"width"}function g9(e){let{reference:t,floating:n,placement:r}=e;const o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2;let i;switch(AS(r)){case"top":i={x:o,y:t.y-n.height};break;case"bottom":i={x:o,y:t.y+t.height};break;case"right":i={x:t.x+t.width,y:a};break;case"left":i={x:t.x-n.width,y:a};break;default:i={x:t.x,y:t.y}}const s=vA(r),l=Fz(s);switch(Rz(r)){case"start":i[s]=i[s]-(t[l]/2-n[l]/2);break;case"end":i[s]=i[s]+(t[l]/2-n[l]/2);break}return i}const Zqe=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n;let s=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:l,y:u}=g9({...s,placement:r}),f=r,h={};for(let p=0;p<a.length;p++){const{name:m,fn:w}=a[p],{x:b,y,data:S,reset:x}=await w({x:l,y:u,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:s,platform:i,elements:{reference:e,floating:t}});if(l=b??l,u=y??u,h={...h,[m]:S??{}},x){typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(s=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:l,y:u}=g9({...s,placement:f})),p=-1;continue}}return{x:l,y:u,placement:f,strategy:o,middlewareData:h}};function qqe(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kqe(e){return typeof e!="number"?qqe(e):{top:e,right:e,bottom:e,left:e}}function QE(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function eC(e,t){t===void 0&&(t={});const{x:n,y:r,platform:o,rects:a,elements:i,strategy:s}=e,{boundary:l="clippingParents",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=t,m=Kqe(p),b=i[h?f==="floating"?"reference":"floating":f],y=await o.getClippingClientRect({element:await o.isElement(b)?b:b.contextElement||await o.getDocumentElement({element:i.floating}),boundary:l,rootBoundary:u}),S=QE(await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:f==="floating"?{...a.floating,x:n,y:r}:a.reference,offsetParent:await o.getOffsetParent({element:i.floating}),strategy:s}));return{top:y.top-S.top+m.top,bottom:S.bottom-y.bottom+m.bottom,left:y.left-S.left+m.left,right:S.right-y.right+m.right}}const $qe={left:"right",right:"left",bottom:"top",top:"bottom"};function Ww(e){return e.replace(/left|right|bottom|top/g,t=>$qe[t])}function Xqe(e,t){const n=Rz(e)==="start",r=vA(e),o=Fz(r);let a=r==="x"?n?"right":"left":n?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Ww(a)),{main:a,cross:Ww(a)}}const Jqe={start:"end",end:"start"};function v9(e){return e.replace(/start|end/g,t=>Jqe[t])}function Qqe(e){const t=Ww(e);return[v9(e),t,v9(t)]}const eKe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s}=t;if((n=a.flip)!=null&&n.skip)return{};const{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",flipAlignment:p=!0,...m}=e,w=AS(o),y=f||(w===s||!p?[Ww(s)]:Qqe(s)),S=[s,...y],x=await eC(t,m),E=[];let C=((r=a.flip)==null?void 0:r.overflows)||[];if(l&&E.push(x[w]),u){const{main:F,cross:R}=Xqe(o,i);E.push(x[F],x[R])}if(C=[...C,{placement:o,overflows:E}],!E.every(F=>F<=0)){var M,k;const F=((M=(k=a.flip)==null?void 0:k.index)!=null?M:0)+1,R=S[F];if(R)return{data:{index:F,overflows:C},reset:{placement:R}};let B="bottom";switch(h){case"bestFit":{var O;const Y=(O=C.slice().sort((H,Z)=>H.overflows.filter(W=>W>0).reduce((W,K)=>W+K,0)-Z.overflows.filter(W=>W>0).reduce((W,K)=>W+K,0))[0])==null?void 0:O.placement;Y&&(B=Y);break}case"initialPlacement":B=s;break}return{data:{skip:!0},reset:{placement:B}}}return{}}}};function tKe(e){let{placement:t,rects:n,value:r}=e;const o=AS(t),a=["left","top"].includes(o)?-1:1,i=typeof r=="function"?r({...n,placement:t}):r,{mainAxis:s,crossAxis:l}=typeof i=="number"?{mainAxis:i,crossAxis:0}:{mainAxis:0,crossAxis:0,...i};return vA(o)==="x"?{x:l,y:s*a}:{x:s*a,y:l}}const nKe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(t){const{x:n,y:r,placement:o,rects:a}=t,i=tKe({placement:o,rects:a,value:e});return{x:n+i.x,y:r+i.y,data:i}}}};function yA(e){return e?.toString()==="[object Window]"}function rc(e){if(e==null)return window;if(!yA(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function NS(e){return rc(e).getComputedStyle(e)}function Ks(e){return yA(e)?"":e?(e.nodeName||"").toLowerCase():""}function $s(e){return e instanceof rc(e).HTMLElement}function Gw(e){return e instanceof rc(e).Element}function rKe(e){return e instanceof rc(e).Node}function Hz(e){const t=rc(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function OS(e){const{overflow:t,overflowX:n,overflowY:r}=NS(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function oKe(e){return["table"
Line truncated
|
||||
\r
|
||||
`)})}async handleRequest(t,n){if(!t.url){this.sendErrorResponse(n,400,"Invalid request");return}const r=ZKe.parse(t.url,!0),o=r.pathname;if(t.method==="OPTIONS"){n.statusCode=200,n.setHeader("Content-Length","0"),n.end();return}const i=t.headers.authorization;if(!i){this.sendErrorResponse(n,401,"Missing authorization header");return}const s=this.tokenManager.extractTokenFromHeader(i);if(!s){this.sendErrorResponse(n,401,"Invalid authorization format");return}if(!await this.tokenManager.validateToken(s)){this.sendErrorResponse(n,401,"Invalid or expired token");return}if(!await this.tokenManager.isUserVerified()){this.sendErrorResponse(n,403,"Pro license required");return}const f=t.socket.remoteAddress||"unknown";if(!this.checkRateLimit(f)){this.sendErrorResponse(n,429,"Too many requests");return}try{switch(o){case"/create":await this.handleCreateRequest(t,n);break;case"/search":await this.handleSearchRequest(t,n,r.query);break;case"/list":await this.handleListRequest(t,n,r.query);break;case"/info":await this.handleInfoRequest(t,n,r.query);break;default:this.sendErrorResponse(n,404,"Not found");break}}catch(h){console.error("Route handling error:",h),this.sendErrorResponse(n,500,"Internal server error")}}async handleCreateRequest(t,n){if(t.method!=="POST"){this.sendErrorResponse(n,405,"Method not allowed");return}let r="",o=0;const a=10*1024*1024;t.on("data",i=>{if(o+=i.length,o>a){this.sendErrorResponse(n,413,"Request too large");return}r+=i.toString()}),t.on("end",async()=>{try{const i=this.validateAndSanitizeInput(JSON.parse(r)),s=await this.processCreateRequest(i);n.statusCode=200,n.setHeader("Content-Type","application/json"),n.end(JSON.stringify(s))}catch(i){console.error("Create request error:",i),this.sendErrorResponse(n,400,"Invalid request data")}}),t.on("error",i=>{console.error("Request stream error:",i),this.sendErrorResponse(n,400,"Request error")})}async handleSearchRequest(t,n,r){if(t.method!=="GET"){this.sendErrorResponse(n,405,"Method not allowed");return}const o=this.sanitizeInput(r.keyword);if(!o){this.sendErrorResponse(n,400,"Invalid keyword");return}try{const a=le.getThinoViaKeyword(o);n.statusCode=200,n.setHeader("Content-Type","application/json"),n.end(JSON.stringify({status:"success",thinos:a}))}catch(a){console.error("Search error:",a),this.sendErrorResponse(n,500,"Search failed")}}async handleListRequest(t,n,r){if(t.method!=="GET"){this.sendErrorResponse(n,405,"Method not allowed");return}const o=r.count,a=Math.min(Math.max(parseInt(o)||10,1),100);try{const i=le.getState().memos.slice(0,a);n.statusCode=200,n.setHeader("Content-Type","application/json"),n.end(JSON.stringify({status:"success",thinos:i}))}catch(i){console.error("List error:",i),this.sendErrorResponse(n,500,"List failed")}}async handleInfoRequest(t,n,r){if(t.method!=="GET"){this.sendErrorResponse(n,405,"Method not allowed");return}if(!r.getSettings){this.sendErrorResponse(n,400,"Missing getSettings parameter");return}try{const o=Ze.getState().settings;n.statusCode=200,n.setHeader("Content-Type","application/json"),n.end(JSON.stringify({status:"success",infoSettings:o}))}catch(o){console.error("Info error:",o),this.sendErrorResponse(n,500,"Info retrieval failed")}}validateAndSanitizeInput(t){if(!t||typeof t!="object")throw new Error("Invalid request data");return{text:this.sanitizeInput(t.text||""),isList:!!t.isList,type:this.sanitizeInput(t.type||""),imageList:Array.isArray(t.imageList)?t.imageList.slice(0,10):[],sourceLink:this.sanitizeInput(t.sourceLink||"")}}sanitizeInput(t){return typeof t!="string"?"":t.replace(/[<>]/g,"").replace(/javascript:/gi,"").replace(/data:/gi,"").substring(0,1e4)}async processCreateRequest(t){const{text:n,isList:r,type:o,imageList:a,sourceLink:i}=t;if(!n)return{status:"success",thino:null,link:null};let s=n;if(/<[a-zA-Z][^>]*>/g.test(n)&&(s=A.htmlToMarkdown(n)),i)try{const h=decodeURIComponent(i);s=`${s} [source](<${h}>)`}catch(h){console.warn("Failed to decode source link:",h)}this.settings.AutoDownloadImage&&a.length>0&&(s=await this.processImages(s,a)),this.plugin.settings?.AppendOrPrependTextViaServer&&(s=this.formatText(s));const u=o||this.settings.MemoSaveLocation,f=await le.createThino({content:s,isList:r,type:u});return f&&(le.pushMemo(f),Ye.clearQuery()),{status:"success",thino:f,link:f?`obsidian://thino?openId=${f.id}`:null}}async processImages(t,n){try{const r=t.match($w)||[],o=[];for(const i of r.slice(0,5))try{const s=await je.grabImageFromUrl(i);if(s.size===0)continue;const l=new File([s],"image.png",{type:"image/png"}),u=await this.handleUploadFile(l);u&&o.push({oldUrl:i,newUrl:u})}catch(s){console.error("Error processing image URL:",s)}o.forEach(i=>{t=t.replace(i.oldUrl,i.newUrl)});const a=[];for(const i of n.slice(0,5))try{if(typeof i=="string"&&i.startsWith("data:image/")){const s=this.base64ImageToBlob(i),l=new File([s],"image.png",{type:"image/png"}),u=await this.handleUploadFile(l);u&&a.push(u)}}catch(s){console.error("Error processing base64 image:",s)}a.length>0&&(t+
Line truncated
|
||||
`+a.join(`
|
||||
`))}catch(r){console.error("Error processing images:",r)}return t}base64ImageToBlob(t){const n=t.indexOf(";base64,");if(n===-1)throw new Error("Invalid base64 image format");const r=t.substring(5,n),o=t.substr(n+8);if(!/^[A-Za-z0-9+/]*={0,2}$/.test(o))throw new Error("Invalid base64 characters");const a=atob(o),i=new ArrayBuffer(a.length),s=new Uint8Array(i);for(let l=0;l<a.length;l++)s[l]=a.charCodeAt(l);return new Blob([i],{type:r})}async handleUploadFile(t){const{type:n}=t;if(!n.startsWith("image"))return null;try{return`${await dC.upload(t)}`}catch(r){return console.error("Upload error:",r),new A.Notice(r),null}}formatText(t){const n=this.settings;return`${n?.PrependViaServer||""}${n?.WithNewLineViaServer==="prepend"||n?.WithNewLineViaServer==="both"?`
|
||||
`:""}${t}${n?.WithNewLineViaServer==="append"||n?.WithNewLineViaServer==="both"?`
|
||||
`:""}${n?.AppendViaServer||""}`}sendErrorResponse(t,n,r){t.statusCode=n,t.setHeader("Content-Type","application/json"),t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Allow-Methods","GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE"),t.setHeader("Access-Control-Allow-Headers","Origin, X-Requested-With, Content-Type, Accept, Authorization, Cache-Control, Pragma"),t.end(JSON.stringify({status:"error",message:r}))}rateLimitMap=new Map;checkRateLimit(t){const n=Date.now(),r=6e4,o=100,a=this.rateLimitMap.get(t);return!a||n>a.resetTime?(this.rateLimitMap.set(t,{count:1,resetTime:n+r}),!0):a.count>=o?!1:(a.count++,!0)}async listen(t,n){try{await this.initializeWorker(),this.server.listen({port:parseInt(n),host:t},()=>{this.isServerRunning=!0,new A.Notice(`${I("Thino - Started HTTP server on port")} ${n}`)})}catch(r){throw console.error("Failed to start server:",r),new A.Notice(I("Thino - Failed to start HTTP server, please check the port is available.")),r}}close(){this.server&&this.isServerRunning&&this.server.close(()=>{this.isServerRunning=!1,new A.Notice(I("Thino - Terminated HTTP server"))}),this.worker&&(this.worker.terminate(),this.worker=null)}isRunning(){return this.isServerRunning}}function KKe(e,t){const n=new qKe(e,t);return{listen(r,o){n.listen(r,o)},close(){n.close()}}}const{clipboard:Ur}=A.Platform.isDesktop?require("electron"):"";class $Ke{eventListeners;constructor(){this.eventListeners={}}on(t,n){this.eventListeners[t]=this.eventListeners[t]||[],this.eventListeners[t].push(n)}once(t,n){n.$emitOnce=!0,this.on(t,n)}removeListener(t,n){if(this.eventListeners[t]){const r=this.eventListeners[t].findIndex(o=>o===n);r>=0&&this.eventListeners[t].splice(r,1)}}removeAllListeners(t){this.eventListeners[t]&&(this.eventListeners[t].length=0)}emit(t,...n){this.eventListeners[t]&&this.eventListeners[t].forEach(r=>{r.call(this,...n),r.$emitOnce&&this.removeListener(t,r)})}}const wd=new $Ke;let pp=null,x9=Ur?.readText(),I9=Ur?.readImage();Ur&&(Ur.on=(e,t)=>(wd.on(e,t),Ur),Ur.once=(e,t)=>(wd.once(e,t),Ur),Ur.off=(e,t)=>(t?wd.removeListener(e,t):wd.removeAllListeners(e),Ur),Ur.startWatching=()=>(pp||(pp=setInterval(()=>{XKe(x9,x9=Ur?.readText())&&wd.emit("text-changed"),JKe(I9,I9=Ur?.readImage())&&wd.emit("image-changed")},500)),Ur),Ur.stopWatching=()=>(pp&&clearInterval(pp),pp=null,Ur));function XKe(e,t){return t&&e!==t}function JKe(e,t){return!t.isEmpty()&&e.toDataURL()!==t.toDataURL()}const mI=require("electron")?.remote,k9=require("electron")?.remote?.screen;class QKe{constructor(t,n){this.app=t,this.plugin=n,this.isRegisted=!1,this.leaf=null,this.clipboard=Ur}isRegisted;leaf;clipboard;isScreenTop=!1;currentSplitWindow;intervalNum;allowsCopy=!1;plugin;actionEl=null;async onload(){A.Platform.isDesktop&&(this.initGlobalCopyEvents(),await this.registerAllShortcuts(),this.registerEvents())}registerEvents(){this.plugin.registerEvent(this.app.workspace.on("quit",()=>{mI.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally)}))}initGlobalCopyEvents(){this.plugin.addCommand({id:"init-global-copy-events",name:I("Global copy"),callback:()=>{this.allowsCopy=!this.allowsCopy,!this.allowsCopy&&this.clipboard.stopWatching(),this.allowsCopy&&this.clipboard.startWatching(),this.leaf&&this.allowsCopy&&(this.actionEl=this.leaf.view.addAction("clipboard-x","Stop global copying",()=>{this.allowsCopy=!1,this.clipboard.stopWatching(),this.actionEl?.remove()}))}})}onunload(){this.isRegisted&&(mI.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally),this.clipboard.off("text-changed"),this.clipboard.off("image-changed"),this.clipboard.stopWatching(),this.leaf&&this.leaf.detach())}getCurrentLeaf(){return this.leaf?this.app.workspace.getLeavesOfType("thino_view").length>0&&!!this.app.workspace.getLeafById(this.leaf.id)?!0:(this.leaf?.detach(),this.currentSplitWindow.close(),this.currentSplitWindow=null,this.leaf=null,this.isScreenTop=!1,!1):!1}async registerAllShortcuts(){mI?.globalShortcut?.register(this.plugin.settings.CaptureKey.OpenThinoGlobally,()=>{this.getCurrentLeaf()?this.showThinoView():this.openThinoView()}),this.isRegisted=!0}showThinoView(){const t=k9.getCursorScreenPoint(),n=this.leaf?.parent?.parent?.win?.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:r,height:o}=n.getBounds();n.setBounds({x:t.x,y:t.y,width:r,height:o})}if(this.app.workspace.trigger("focus-on-textarea"),this.isScreenTop){this.isScreenTop=!1,setTimeout(()=>{n.setAlwaysOnTop(!1,"screen")},200);return}this.isScreenTop=!0}}openThinoView(){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.claLine truncated
|
||||
`:" ";switch(t[l==="prepend"?"SharePrependType":"ShareAppendType"]){case"none":u();break;case"preset":t.ShareToThinoWithText&&(l==="prepend"?a=t.ShareToThinoWithTextPrepend+h:i=h+t.ShareToThinoWithTextAppend),u();break;case"input":{const p="Thino "+I(l==="prepend"?"Prepend text":"Append text");new Kz(e,p,m=>{l==="prepend"?a=m.trim()+(m.trim()?h:""):i=(m.trim()?h:"")+m,u()}).open();break}case"selectTags":new kJ(e,p=>{const m=p.length>0?p.map(w=>"#"+w).join(" "):"";l==="prepend"?a=m.trim()+(m.trim()?h:""):i=(m.trim()?h:"")+m.trim(),u()}).open();break;default:f(new Error("Invalid configuration type."))}});Promise.all([s("append"),s("prepend")]).then(()=>n(a,i)).then(()=>r()).catch(o)})}const k$e=e=>{const t=e.embedRegistry;if(!t)return!1;const n=t.embedByExtension.md,r=n({app:e,containerEl:createDiv()},null,null);return r.editable=!0,r.set(""),r.showEditor(),Object.getPrototypeOf(Object.getPrototypeOf(r.editMode)).constructor};async function TA(e){try{const t=e.app.internalPlugins.plugins["daily-notes"];let n;n={settings:{...e.settings,tokenForVerify:"***"},plugins:Object.keys(e.app.plugins.plugins),manifest:e.manifest,platform:A.Platform.resourcePathPrefix},t&&(n={...n,dailyNotePluginInfo:{options:t.instance.options}}),await navigator.clipboard.writeText(`\`\`\`json
|
||||
${JSON.stringify(n,null,2)}
|
||||
\`\`\``),new A.Notice(I("Debug info copied to clipboard"))}catch(t){console.error(t)}}class E$e extends A.Plugin{settings;settingTab;thinoWorkerManager;triggerBySelf=!1;updatedID="";debounceTimer=0;apiHttpServer=null;captureService=null;loaded=!1;MarkdownEditor;async onload(){this.MarkdownEditor=k$e(this.app),Ze.setPlugin(this),await this.loadSettings(),Tqe(),this.registerRibbon(),await this.verify();try{this.settings.ShowUpdateMessage&&await this.checkVersionAndShowChangeLog()}catch(t){console.error(t)}this.settingTab=new zqe(this.app,this),this.addSettingTab(this.settingTab),this.initApp(),this.initEditor(),this.initURIHandler(),this.registerMobileEvent(),this.registerCommands(),this.registerCanvasNodeMemos(),this.registerHoverEvent(),this.registerLinkOpen(),this.registerCodeBlocks(),A.Platform.isMobile&&this.registerMobileNavbar(),this.updateLayoutSettings(),this.registerEditorContextMenu(),this.registerEditorSuggest(new Sqe(this.app,this)),this.registerEditorExtension([YKe]),this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this)),this.registerView(Yr,t=>new Hd(t,this)),this.thinoWorkerManager=new DF(this.app,this),this.addChild(this.thinoWorkerManager)}async loadSettings(){this.settings=Object.assign({},Uo,await this.loadData()),Ze.setSettings(this.settings)}async saveSettings(){await this.saveData(this.settings),Ze.setSettings(this.settings)}onunload(){this.app.workspace.detachLeavesOfType(Yr),le.clearMemos(),Se.dispatch({type:"CLEAR_MEMOS",payload:null}),Se.dispatch({type:"CLEAR_FILES",payload:null}),Se.dispatch({type:"CLEAR_VIEW",payload:null});const t=document.body.find(".dialog-wrapper");if(t&&t.parentElement?.detach(),this.apiHttpServer&&(this.apiHttpServer.close(),this.apiHttpServer=null),this.captureService&&this.captureService.onunload(),A.Platform.isMobile){const n=this.app.mobileNavbar;n&&n.showThinoBtnEl&&this.settings?.NavbarButton&&(n.showThinoBtnEl.detach(),n.showThinoBtnEl=null)}new A.Notice(I("Close Memos Successfully"))}initEditor(){this.register(Ep(A.MetadataCache.prototype,{getFileCache:n=>function(r){return!r?.path&&!r?null:n.call(this,r)}})),(n=>{const r=n.app.embedRegistry.embedByExtension.md({app:n.app,containerEl:document.createElement("div")},null,"");r.editable=!0,r.showEditor();const o=Object.getPrototypeOf(Object.getPrototypeOf(r.editMode)),a=Ep(o.constructor.prototype,{triggerClickableToken:i=>async function(...s){if(s[0].type==="internal-link"){if(this.editorEl.closest(".memo-editor-wrapper")){const l=le.getMemoById(s[0].text??"");if(l){Ja(l);return}return i.apply(this,s)}return i.apply(this,s)}return i.apply(this,s)}});this.register(a),r.unload()})(this)}initApp(){Ze.setApp(this.app)}initURIHandler(){this.registerObsidianProtocolHandler("thino",async t=>{if(!t)return;if(t.openSettings&&(this.app.setting.open(),this.app.setting.openTabById(this.manifest.id||"obsidian-memos")),t.userid)try{const a=t.userid;VKe(a,this.app),WKe(A.moment().add(30,"days").valueOf(),this.app),Ge.setRefresh(!0)}catch(a){console.error(a),new A.Notice(I("Failed to verify"))}if(t.token)try{const a=t.token;this.app?.saveLocalStorage("tokenForSync",a),setTimeout(()=>{this.app.setting.open(),this.app.setting.openTabById(this.manifest.id||"obsidian-memos"),this.settingTab.display()},200),new A.Notice(I("Saved sync token successfully"))}catch(a){console.error(a),new A.Notice(I("Failed to save"))}if(t.copyToken){this.app.setting.open(),this.app.setting.openTabById(this.manifest.id??"obsidian-memos");const a=await Lz();await navigator.clipboard.writeText(a),new A.Notice(I("Copied app id successfully"))}const n=Ze.getState()?.verifyState,r=!A.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),o=A.Platform.isDesktop?await pn():r?.identifier||r?.uuid;if(!(!n||n?.appId!==o)){if(t.content){const a=t.type,i=decodeURI(t.content)!==t.content?decodeURI(t.content):t.content,s=t.task,l=await le.createThino({content:i,type:a,isList:!!s});if(!l)return;le.pushMemo(l),Ye.clearQuery()}t.openId&&await le.openThinoByID(t.openId)}})}initGlobalManifest(){Ge.setPluginManifest(this.manifest)}stopServer(){this.apiHttpServer&&(this.apiHttpServer.close(),this.apiHttpServer=null)}async stopEnableList(){const t=Ze.getState()?.verifyState,n=!A.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),r=A.Platform.isDesktop?await pn():n?.identifier||n?.uuid;if(!t||t?.appId!==r){this.settings.EnabledLocationList=[{value:"DAILY",target:"ProcessEntriesBelow",insert:"InsertAfter"}],this.settingTab.debounceApplySettingsUpdate();return}}async initServer(){if(A.Platform.isMobile||!this.settings.EnabledHttpApi)return;const t=Ze.getState()?.verifyState,n=!A.Platform.isDesktop&&await window.Capacitor?.Plugins.Device?.getId(),r=A.Platform.isDesktop?await pn():n?.identifier||n?.uuid;!t||t?.appId!==r||(this.apiHttpServer=KKe(this,this.settings),this.initServerPort())}initServerPort(){this.apiHttpServer&&this.settings.EnabledHttpApi&&this.apiHttpServer.listen(this.settings.HttpApiIpType,this.settings.HttpApiPort)Line truncated
|
||||
`);try{await A9(this.app,this.settings,async(i,s)=>{a=i+a+s;const l=await le.createThino({content:a,type:this.settings.MemoSaveLocation||"DAILY",isList:!0});le.pushMemo(l)})}catch(i){console.error("Configuration failed:",i);return}})})})))}registerCommands(){_y.forEach(t=>{this.addCommand({id:t.id,name:t.name,callback:()=>this.openMemos(t.location,t.cb),hotkeys:[]})}),["Modern","Clean","Minimal","Gradient"].forEach(t=>{this.addCommand({id:`share-thino-via-${t.toLowerCase()}`,name:I("Share thino")+` [${I(t)}]`,editorCallback:(n,r)=>{const o=n.getSelection();if(o.length===0)return;const a={id:`temp-${Date.now()}`,content:o,createdAt:A.moment().format("YYYY-MM-DD HH:mm:ss"),updatedAt:A.moment().format("YYYY-MM-DD HH:mm:ss"),deletedAt:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",thinoType:"JOURNAL",hasId:"",linkId:[],resourceList:[],creatorName:"thino",sourceType:"DAILY",path:r.file.path,fileInfo:{tags:[],frontmatter:{}}};Yc(a,t.toLowerCase(),r)}})}),this.addCommand({id:"focus-mode",name:"Focus mode",callback:()=>{const t=document.body.hasClass("thino-focus");document.body.toggleClass("thino-focus",!t)}}),this.addCommand({id:"hide-side-bar",name:I("Toggle sidebar visibility"),callback:()=>{const t=Ge.getState().isMobileView,n=document.body.hasClass("thino-hide-side-bar");document.body.toggleClass("thino-hide-side-bar",t?!1:!n)}}),this.addCommand({id:"hide-tags",name:I("Toggle tags visibility"),callback:()=>{const t=document.body.hasClass("thino-hide-tags");document.body.toggleClass("thino-hide-tags",!t)}}),this.addCommand({id:"hide-query-list",name:I("Toggle query list visibility"),callback:()=>{const t=document.body.hasClass("thino-hide-query-list");document.body.toggleClass("thino-hide-query-list",!t)}}),this.addCommand({id:"insert-task",name:I("Insert task"),checkCallback:t=>{const n=this.app.plugins.getPlugin("obsidian-tasks-plugin"),r=this.app.workspace.getLeavesOfType("thino_view").first();if(n&&r)return t||this.app.plugins.plugins["obsidian-tasks-plugin"].apiV1.createTaskLineModal().then(a=>{const i=this.app.workspace.activeEditor;i&&i.editor?.insertText(a)}),!0}}),this.addCommand({id:"show-thino-editor",name:I("Show thino editor"),checkCallback:t=>{if(le.initialized&&Ze.initialized){if(!t){if(!Ze.getState().view){new A.Notice(I("Please open thino first"));return}new DI(this.app).open()}return!0}}}),this.addCommand({id:"lock-thino",name:I("Lock thino"),checkCallback:t=>{if(this.app.workspace.getActiveViewOfType(Hd)&&this.settings.needVerify)return t||Ge.setLocked(!0),!0}}),this.addCommand({id:"copy-debug-info",name:I("Copy debug info"),callback:async()=>{await TA(this)}}),this.addCommand({id:"insert-editor",name:I("Insert editor"),checkCallback:t=>{const n=this.app.workspace.getActiveViewOfType(A.MarkdownView);if(n&&n?.getViewType()==="markdown")return t||n.editor.replaceSelection("\n```thino\n{\n editor: false\n}\n```\n"),!0}}),this.addCommand({id:"toggle-minimal-thino",name:I("Toggle minimal mode"),callback:()=>{const t=document.body.hasClass("minimal-thino");document.body.toggleClass("minimal-thino",!t)}}),this.addCommand({id:"focus-on-thino-editor",name:I("Focus on thino editor"),callback:()=>this.focusOnEditor(),hotkeys:[]}),this.addCommand({id:"reinit-thino-sync",name:I("ReSync web thinos to local"),callback:()=>{l4e(this.app)}}),this.addCommand({id:"init-thino-sync",name:I("Sync local thinos to web"),callback:async()=>{if(!this.app?.loadLocalStorage("tokenForSync")){new A.Notice(I("Please input token first"));return}if(!this.settings.startSync){new A.Notice(I("Please enable sync first"));return}try{await le.initSync()}catch(n){console.error(n),new A.Notice(I("Init Failed"))}}}),this.addCommand({id:"show-daily-thino",name:I("Show daily thino"),callback:()=>this.openDailyMemo(),hotkeys:[]}),this.addCommand({id:"focus-on-search-bar",name:I("Focus on search bar"),callback:()=>this.searchIt(),hotkeys:[]}),this.addCommand({id:"show-thino-in-popover",name:I("Show-thino in popover(Hover editor)"),callback:()=>this.showInPopover(),hotkeys:[]})}async onLayoutReady(){await this.stopEnableList(),await this.initServer(),this.initGlobalManifest(),await this.initMemos(),this.autoOpenMemos(),this.registerThinoWidget(),await this.registerToolbarCheck(),await this.initCaptureService();const t=this.app.workspace.editorSuggest.suggests.findIndex(n=>n.type==="customTag");t!==-1?(this.app.workspace.editorSuggest.suggests.splice(t,1),this.app.workspace.editorSuggest.suggests.unshift(new E9(this.app,this))):this.app.workspace.editorSuggest.suggests.unshift(new E9(this.app,this))}async initMemos(){try{await this.initDailyNotes()}catch(t){console.error(t)}Ze.getState(),le.getState(),await le.fetchAllMemos()}async initDailyNotes(){this.settings.EnabledLocationList.find(t=>t.value==="DAILY")&&await Ze.fechLocalDailyNotes()}registerCanvasNodeMemos(){if(!A.requireApiVersion("1.2.0")||!this.settings.EnabledLocationList.find(o=>o.value==="CANVAS"))return;const t=o=>{clearTimeout(this.debounceTimer),this.debounceTimer=wi
Line truncated
|
||||
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:s}=await w$e(r,i),l=JSON.parse(new TextDecoder().decode(s));return!l||l.iss!=="pkmer"||l.type!=="thino"||l.appId!==t?!1:(Ze.setVerifyState(l),!0)}catch(s){console.error(s)}}return await n(this.settings.tokenForVerify[t])}async checkVersionAndShowChangeLog(){const t=this.manifest.version,n=this.settings.LastUpdatedVersion;t!==n&&(this.settings.LastUpdatedVersion=t,await this.saveSettings(),this.showChangeLog())}showChangeLog(){new RS(this.app,this.manifest.version).open()}autoOpenMemos(){this.app.workspace.getLeavesOfType(Yr).length>0||this.settings.MobileAndDesktop==="Mobile"&&A.Platform.isDesktop||this.settings.MobileAndDesktop==="Desktop"&&A.Platform.isMobile||this.settings.OpenMemosAutomatically&&this.openMemos()}async openDailyMemo(){if(this.app.workspace.getLeavesOfType(Yr).length>0){Ye.setPathname("/daily");return}await this.openMemos(),Ye.setPathname("/daily")}async openMemos(t="center",n){const r=this.app.workspace;if(r.getLeavesOfType(Yr).length>0){const i=r.getLeavesOfType(Yr)[0];return r.setActiveLeaf(i),r.revealLeaf(i),i}r.detachLeavesOfType(Yr);let o;switch(t){case"left":o=r.getLeftLeaf(!1);break;case"right":o=r.getRightLeaf(!1);break;case"float":o=r.getLeaf("window");break;default:o=r.getLeaf(!0);break}if(o)return await o.setViewState({type:Yr}),r.revealLeaf(o),o;const a=o.view.containerEl.querySelector("textarea");return a?(a.focus(),o):(n?.(),o)}async searchIt(){const t=this.app.workspace,n=t.getLeavesOfType(Yr);if(!(n.length>0)){const o=await this.openMemos();setTimeout(()=>{o.view.containerEl.find(".search-bar-inputer .text-input").focus(),this.app.workspace.trigger("focus-on-searchbar")},300);return}const r=n[0];t.revealLeaf(r),setTimeout(()=>{r.view.containerEl.find(".search-bar-inputer .text-input").focus(),this.app.workspace.trigger("focus-on-searchbar")},300)}async focusOnEditor(){if(!(this.app.workspace.getLeavesOfType(Yr).length>0)){await this.openMemos();return}this.app.workspace.trigger("focus-on-textarea")}changeStatus(){const t=this.app.workspace,n=t.getLeavesOfType(Yr);if(!(n.length>0)){new A.Notice(I("Please Open Memos First"));return}const r=n[0];t.setActiveLeaf(r),r.view.containerEl.querySelector(".list-or-task").click()}async showInPopover(){const t=this.app.workspace;if(t.detachLeavesOfType(Yr),!this.app.plugins.getPlugin("obsidian-hover-editor")){new A.Notice(I("Please install obsidian-hover-editor plugin first"));return}const r=await this.app.plugins.getPlugin("obsidian-hover-editor")?.spawnPopover();r&&(await r.setViewState({type:Yr}),t.revealLeaf(r),r.view.containerEl.classList.add("mobile-view"),this.settings?.FocusOnEditor&&r.view.containerEl.querySelector("textarea")!==void 0&&r.view.containerEl.querySelector("textarea")?.focus())}}class RS extends A.Modal{constructor(t,n){super(t),this.version=n}component;async onOpen(){const{contentEl:t}=this;this.containerEl.toggleClass("thino-changelog-modal",!0),t.createEl("h2",{text:I("Thino update info"),cls:"thino-changelog-title"}).createDiv({cls:"thino-changelog-version",text:`${this.version}`});try{t.createEl("h3",{text:I("Latest version")});const r=t.createDiv("current-change-log");t.createEl("hr"),t.createEl("h3",{text:I("Previous version")});const o=t.createDiv("prev-change-log"),i=await A.requestUrl("https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md");this.component=new A.Component;const[s,l]=this.getLatestVersionContent(i.text);let u=s,f=l;try{const h=localStorage.getItem("language"),p=h&&(h==="zh"||h==="zh-TW");u=p?s.replaceAll("> [!tips]+","> [!tips]-").replaceAll("> [!note]-","> [!note]+"):s,f=p?l.replaceAll("> [!tips]+","> [!tips]-").replaceAll("> [!note]-","> [!note]+"):l}catch(h){console.error(h)}await A.MarkdownRenderer.render(this.app,u,r,"",this.component),await A.MarkdownRenderer.render(this.app,f,o,"",this.component)}catch(r){console.error(r),t.createEl("p",{text:I("Failed to load changelog")}),t.createEl("a",{text:I("View online"),attr:{href:"https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md",target:"_blank"}})}}getLatestVersionContent(t){const n=/^# .+/gm,r=[...t.matchAll(n)];if(r.length===0)return[t,""];const o=r[0].index||0;let a=t.length;r.length>1&&(a=r[1].index||t.length);const i=t.substring(o,a).trim(),s=t.substring(a).trim();return[i,s]}onClose(){const{contentEl:t}=this;t.empty(),this.component?.unload()}}class Kz extends A.Modal{constructor(t,n,r){super(t),this.title=n,this.callback=r}inputEl;callback;onOpen(){const{contentEl:t}=this;this.setTitle(this.title),this.containerEl.toggleClass(["thino-input-dialog","thino-bulk-action-dialog","tag-actions"],!0),this.inputEl=t.createEl("input",{attr:{type:"text"}}),this.inputEl.focus(),new A.Setting(t).addButton(n=>{n.setButtonText(I("OK")).onClick(()=>{this.close()})})}onClose(){this.contentEl.empty(),this.callback(this.inputEl.value)}}exports.ChangeLogModal=RS;exports.InputModal=Kz;exports.default=E$e;exports.getCurrentDebugInfo=TA;
|
||||
|
||||
/* nosourcemap */
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "obsidian-memos",
|
||||
"name": "Thino",
|
||||
"description": "Capturing ideas and save them into daily notes. (Closed source)",
|
||||
"version": "2.7.16",
|
||||
"author": "Boninall",
|
||||
"authorUrl": "https://github.com/Quorafind/",
|
||||
"isDesktopOnly": false,
|
||||
"minAppVersion": "1.0.0"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
div[data-type=thino_view] #root{flex-direction:row;justify-content:flex-start;align-items:flex-start;width:100%;height:100%;display:flex}div[data-type=thino_view]{font-family:var(--font-interface),-apple-system,BlinkMacSystemFont,"PingFang SC","Noto Sans","Noto Sans CJK SC","Microsoft YaHei UI","Microsoft YaHei","WenQuanYi Micro Hei",sans-serif,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";-webkit-font-smoothing:subpixel-antialiased}body.hide-pro .pro{display:none!important}body.hide-pro .user-pro-badge{visibility:hidden!important}div[data-type=thino_view] .view-content:not(.images-wrapper) img{cursor:pointer;border-radius:var(--radius-s);max-width:100%}div[data-type=thino_view] .view-content:has(>.modern){padding:var(--size-4-4)}div[data-type=thino_view].mobile-view .view-content:has(>.modern){padding:var(--size-2-2)}div[data-type=thino_view]{box-sizing:border-box;color:var(--memos-text-hover);-webkit-tap-highlight-color:transparent;margin:0;padding:0}div[data-type=thino_view] .callout{border:unset}div[data-type=thino_view] code{border-radius:4px;padding:2px 4px;font-family:ubuntu-mono,SFMono-Regular,Menlo,Consolas,PT Mono,Liberation Mono,Courier,monospace}div[data-type=thino_view] pre,div[data-type=thino_view] pre *{font-family:ubuntu-mono,SFMono-Regular,Menlo,Consolas,PT Mono,Liberation Mono,Courier,monospace}div[data-type=thino_view] textarea{resize:none}div[data-type=thino_view] label,div[data-type=thino_view] input:not([type=checkbox]),div[data-type=thino_view] button:not(:-webkit-any(.rdp,.mod-cta)),div[data-type=thino_view] textarea,div[data-type=thino_view] img{user-select:none;-webkit-tap-highlight-color:transparent;background-color:transparent;border:none;outline:none}div[data-type=thino_view] label,div[data-type=thino_view] input:not([type=checkbox]),div[data-type=thino_view] button:not(:is(.rdp,.mod-cta)),div[data-type=thino_view] textarea,div[data-type=thino_view] img{user-select:none;-webkit-tap-highlight-color:transparent;background-color:transparent;border:none;outline:none}div[data-type=thino_view] input:not([type=checkbox]):-webkit-autofill{box-shadow:0 0 0 30px var(--memos-memo-bg)inset!important}div[data-type=thino_view] input:not([type=checkbox]):-webkit-autofill:hover{box-shadow:0 0 0 30px var(--memos-memo-bg)inset!important}div[data-type=thino_view] input:not([type=checkbox]):-webkit-autofill:focus{box-shadow:0 0 0 30px var(--memos-memo-bg)inset!important}div[data-type=thino_view] input:not([type=checkbox]):-webkit-autofill:active{box-shadow:0 0 0 30px var(--memos-memo-bg)inset!important}div[data-type=thino_view] a:not(:has(svg)){cursor:pointer;text-underline-offset:2px}div[data-type=thino_view] a:not(:has(svg)):hover{background-color:var(--memos-bg-lightgray)}div[data-type=thino_view] a.tag{border:unset}div[data-type=thino_view] a.is-unresolved{cursor:pointer;color:var(--memos-text-unresolved-blue);text-underline-offset:2px}div[data-type=thino_view] a.is-unresolved:hover{background-color:var(--memos-bg-gray)}div[data-type=thino_view] .btn:not(.mod-cta){border:unset;background-color:unset;font-size:unset;user-select:none;cursor:pointer;text-align:center;justify-content:center;align-items:center;display:flex}div[data-type=thino_view] hr.menu-hr{border-top:1px solid;margin:0}.thino-hidden{display:none!important}.dialog-wrapper .btn-group,.dialog-wrapper .btns-container{fill:var(--memos-memo-bg-primary);justify-content:center;align-items:center;gap:var(--size-2-2);display:flex}.dialog-wrapper button.btn{box-shadow:none}.dialog-wrapper .btn{border:unset;background-color:unset;font-size:unset;user-select:none;cursor:pointer;text-align:center;justify-content:center;align-items:center;display:flex}.dialog-wrapper hr.menu-hr{margin:0}.dialog-wrapper svg:not(.svg-icon){fill:var(--memos-text-muted)}.thino-url{color:var(--memos-text-blue);text-decoration:underline}.thino-inline-widget{vertical-align:middle;display:inline-block}.suggestion-container:has(.thino-image-suggest-item){width:200px;min-width:200px}.suggestion-container:has(.thino-image-suggest-item) .thino-image-suggest-item{justify-content:center;align-items:flex-start;gap:var(--size-2-2);flex-direction:column;display:flex}.suggestion-container:has(.thino-image-suggest-item) .thino-image-suggest-item .suggestion-name{font-size:var(--thino-ui-small);color:var(--memos-text-black)}.suggestion-container:has(.thino-image-suggest-item) .thino-image-suggest-item .suggestion-path{font-size:var(--font-ui-smaller);color:var(--memos-text-faint)}.is-mobile div[data-type=thino_view].tiny-view:not(.using-default-header) .view-header-nav-buttons,.is-mobile div[data-type=thino_view].tiny-view:not(.using-default-header) .view-actions{display:none}.is-mobile div[data-type=thino_view].tiny-view .view-header-title-container .memos-review-entry-wrapper{display:none!important}.is-mobile div[data-type=thino_view].tiny-view .section-header-container>.memos-header-search-section .thino-inliLine truncated
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"queries": []
|
||||
}
|
||||
Vendored
+21
-10
@@ -13,15 +13,26 @@
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "00-待办计划/2025-07 待办事宜.md",
|
||||
"file": "01-工作日记/2025-07-11.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "2025-07 待办事宜"
|
||||
"title": "2025-07-11"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "cd9ade1557b4c3ac",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "thino_view",
|
||||
"state": {},
|
||||
"icon": "Memos",
|
||||
"title": "Thino"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"currentTab": 1
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
@@ -175,13 +186,12 @@
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"file": "00-待办计划/2025-07 待办事宜.md",
|
||||
"followCursor": false,
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-list",
|
||||
"title": "2025-07 待办事宜 的大纲"
|
||||
"title": "大纲"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -272,17 +282,19 @@
|
||||
"obsidian-importer:Open Importer": false,
|
||||
"copilot:Open Copilot Chat": false,
|
||||
"DEVONlink-obsidian:DEVONlink": false,
|
||||
"periodic-notes:Open today": false
|
||||
"periodic-notes:Open today": false,
|
||||
"obsidian-memos:Thino": false
|
||||
}
|
||||
},
|
||||
"active": "6142e96e86443372",
|
||||
"active": "cd9ade1557b4c3ac",
|
||||
"lastOpenFiles": [
|
||||
"02-技术评测/关于RSS.md",
|
||||
"01-工作日记/2025-07-11.md",
|
||||
"README.md",
|
||||
"00-待办计划/2025-07 待办事宜.md",
|
||||
"02-技术评测/关于RSS.md",
|
||||
"10-WebClipper/AList的开源替代:OpenList.md",
|
||||
"01-工作日记/2025-07-10.md",
|
||||
"01-工作日记/2025-07-09.md",
|
||||
"00-待办计划/2025-07 待办事宜.md",
|
||||
"30-RSS/网文精选/从皮甲到铁铠:蒙古战马的防护升级与骑兵巅峰.md",
|
||||
"30-RSS/RSS阅读/阅读样本.md",
|
||||
"20-我的收藏夹/21-浏览器收藏/开源项目/OnlyOffice/Hidocs文档在线预览平台提供office文档在线预览服务.md",
|
||||
@@ -290,7 +302,6 @@
|
||||
"40-Podcast/podnotes/和Emily一起练口语(附中英双语字幕)-【发音版】美国人说“我超喜欢”时,常会用这句话!.md",
|
||||
"40-Podcast/podnotes/陈说历史-雍正帝怎么死的?唐朝为何不建长城?方孝孺真的被诛十族?能否称刘邦为汉高祖?等.md",
|
||||
"01-工作日记/2025-07-08.md",
|
||||
"README.md",
|
||||
"40-Podcast/podnotes",
|
||||
"40-Podcast",
|
||||
"01-工作日记/2025-07-07.md",
|
||||
|
||||
Reference in new issue
Block a user