From 79b44dbf6ca4ac2e2575e448f6c94407c6800758 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Wed, 24 Jul 2024 08:46:38 +0300 Subject: [PATCH] vault backup: 2024-07-24 08:46:38 --- .obsidian/plugins/home-tab/data.json | 26 +- .obsidian/plugins/homepage/main.js | 4 +- .obsidian/plugins/homepage/manifest.json | 2 +- .obsidian/plugins/homepage/styles.css | 55 +- .../obsidian-enhancing-export/data.json | 60 - .../lua/citefilter.lua | 6 - .../lua/markdown+hugo.lua | 5 - .../lua/markdown.lua | 237 -- .../lua/math_block.lua | 68 - .../obsidian-enhancing-export/lua/pdf.lua | 12 - .../lua/polyfill.lua | 61 - .../obsidian-enhancing-export/lua/url.lua | 18 - .../plugins/obsidian-enhancing-export/main.js | 30 - .../obsidian-enhancing-export/manifest.json | 10 - .../obsidian-enhancing-export/styles.css | 1 - .../textemplate/dissertation.tex | 1162 ------ .../textemplate/neurips.sty | 373 -- .../textemplate/neurips.tex | 159 - .../obsidian-excalidraw-plugin/data.json | 4 +- .../obsidian-excalidraw-plugin/main.js | 12 +- .../obsidian-excalidraw-plugin/manifest.json | 2 +- .obsidian/plugins/obsidian-git/main.js | 3487 ++++++++--------- .obsidian/plugins/obsidian-git/manifest.json | 7 +- .obsidian/plugins/obsidian-git/styles.css | 6 +- .../plugins/obsidian-icon-folder/data.json | 3 +- .../plugins/obsidian-icon-folder/main.js | 1186 +++--- .../obsidian-icon-folder/manifest.json | 2 +- .../plugins/recent-files-obsidian/data.json | 16 +- .obsidian/plugins/templater-obsidian/main.js | 66 +- .../plugins/templater-obsidian/manifest.json | 2 +- _inbox/Уроки от English Galaxy.md | 13 + knowledge/english/Present Simple.md | 2 +- 32 files changed, 2295 insertions(+), 4802 deletions(-) delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/data.json delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/citefilter.lua delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/markdown+hugo.lua delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/markdown.lua delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/math_block.lua delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/pdf.lua delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/polyfill.lua delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/url.lua delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/main.js delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/manifest.json delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/styles.css delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/textemplate/dissertation.tex delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/textemplate/neurips.sty delete mode 100644 .obsidian/plugins/obsidian-enhancing-export/textemplate/neurips.tex create mode 100644 _inbox/Уроки от English Galaxy.md diff --git a/.obsidian/plugins/home-tab/data.json b/.obsidian/plugins/home-tab/data.json index 11211ce4..c7fc6193 100644 --- a/.obsidian/plugins/home-tab/data.json +++ b/.obsidian/plugins/home-tab/data.json @@ -23,25 +23,17 @@ "markdownOnly": false, "unresolvedLinks": false, "recentFilesStore": [ + { + "filepath": "_inbox/2024-07-24 1721799892.md", + "timestamp": 1721799892756 + }, + { + "filepath": "knowledge/english/Present Simple.md", + "timestamp": 1721799803766 + }, { "filepath": "Home.md", - "timestamp": 1721718323869 - }, - { - "filepath": "_inbox/Приемка квартиры с черновым ремонтом.md", - "timestamp": 1721714211262 - }, - { - "filepath": "_inbox/Черновая отделка.md", - "timestamp": 1721714210394 - }, - { - "filepath": "projects/Ремонт квартиры/Проект. Ремонт квартиры.md", - "timestamp": 1721714029423 - }, - { - "filepath": "_inbox/Мне нравится.md", - "timestamp": 1721711740934 + "timestamp": 1721799720640 } ], "bookmarkedFileStore": [], diff --git a/.obsidian/plugins/homepage/main.js b/.obsidian/plugins/homepage/main.js index 2a329888..7138be26 100644 --- a/.obsidian/plugins/homepage/main.js +++ b/.obsidian/plugins/homepage/main.js @@ -1,2 +1,2 @@ -"use strict";var We=Object.create;var Y=Object.defineProperty;var Ye=Object.getOwnPropertyDescriptor;var Ue=Object.getOwnPropertyNames;var Be=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var je=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),qe=(n,t)=>{for(var e in t)Y(n,e,{get:t[e],enumerable:!0})},me=(n,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ue(t))!Ke.call(n,i)&&i!==e&&Y(n,i,{get:()=>t[i],enumerable:!(a=Ye(t,i))||a.enumerable});return n};var ze=(n,t,e)=>(e=n!=null?We(Be(n)):{},me(t||!n||!n.__esModule?Y(e,"default",{value:n,enumerable:!0}):e,n)),$e=n=>me(Y({},"__esModule",{value:!0}),n);var xe=je(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});var g=require("obsidian"),te="YYYY-MM-DD",ae="gggg-[W]ww",Ne="YYYY-MM",be="YYYY-[Q]Q",ke="YYYY";function F(n){let t=window.app.plugins.getPlugin("periodic-notes");return t&&t.settings?.[n]?.enabled}function O(){try{let{internalPlugins:n,plugins:t}=window.app;if(F("daily")){let{format:o,folder:s,template:c}=t.getPlugin("periodic-notes")?.settings?.daily||{};return{format:o||te,folder:s?.trim()||"",template:c?.trim()||""}}let{folder:e,format:a,template:i}=n.getPluginById("daily-notes")?.instance?.options||{};return{format:a||te,folder:e?.trim()||"",template:i?.trim()||""}}catch(n){console.info("No custom daily note settings found!",n)}}function L(){try{let n=window.app.plugins,t=n.getPlugin("calendar")?.options,e=n.getPlugin("periodic-notes")?.settings?.weekly;if(F("weekly"))return{format:e.format||ae,folder:e.folder?.trim()||"",template:e.template?.trim()||""};let a=t||{};return{format:a.weeklyNoteFormat||ae,folder:a.weeklyNoteFolder?.trim()||"",template:a.weeklyNoteTemplate?.trim()||""}}catch(n){console.info("No custom weekly note settings found!",n)}}function x(){let n=window.app.plugins;try{let t=F("monthly")&&n.getPlugin("periodic-notes")?.settings?.monthly||{};return{format:t.format||Ne,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom monthly note settings found!",t)}}function H(){let n=window.app.plugins;try{let t=F("quarterly")&&n.getPlugin("periodic-notes")?.settings?.quarterly||{};return{format:t.format||be,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom quarterly note settings found!",t)}}function C(){let n=window.app.plugins;try{let t=F("yearly")&&n.getPlugin("periodic-notes")?.settings?.yearly||{};return{format:t.format||ke,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom yearly note settings found!",t)}}function Te(...n){let t=[];for(let a=0,i=n.length;a{let Z=a(),X=n.clone().set({hour:Z.get("hour"),minute:Z.get("minute"),second:Z.get("second")});return M&&X.add(parseInt(v,10),w),f?X.format(f.substring(1).trim()):X.format(o)}).replace(/{{\s*yesterday\s*}}/gi,n.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,n.clone().add(1,"d").format(o)));return t.foldManager.save(p,m),p}catch(p){console.error(`Failed to create file: '${d}'`,p),new g.Notice("Unable to create new file.")}}function Xe(n,t){return t[T(n,"day")]??null}function et(){let{vault:n}=window.app,{folder:t}=O(),e=n.getAbstractFileByPath(g.normalizePath(t));if(!e)throw new ne("Failed to find daily notes folder");let a={};return g.Vault.recurseChildren(e,i=>{if(i instanceof g.TFile){let o=E(i,"day");if(o){let s=T(o,"day");a[s]=i}}}),a}var ie=class extends Error{};function tt(){let{moment:n}=window,t=n.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)e.push(e.shift()),t--;return e}function at(n){return tt().indexOf(n.toLowerCase())}async function Ae(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=L(),[o,s]=await A(e),c=n.format(a),m=await R(i,c);try{let r=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,P,D,M,v)=>{let w=window.moment(),f=n.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(D,10),M),v?f.format(v.substring(1).trim()):f.format(a)}).replace(/{{\s*title\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(d,p,P)=>{let D=at(p);return n.weekday(D).format(P.trim())}));return window.app.foldManager.save(r,s),r}catch(r){console.error(`Failed to create file: '${m}'`,r),new g.Notice("Unable to create new file.")}}function nt(n,t){return t[T(n,"week")]??null}function it(){let n={};if(!Se())return n;let{vault:t}=window.app,{folder:e}=L(),a=t.getAbstractFileByPath(g.normalizePath(e));if(!a)throw new ie("Failed to find weekly notes folder");return g.Vault.recurseChildren(a,i=>{if(i instanceof g.TFile){let o=E(i,"week");if(o){let s=T(o,"week");n[s]=i}}}),n}var oe=class extends Error{};async function Ee(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=x(),[o,s]=await A(e),c=n.format(a),m=await R(i,c);try{let r=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,P,D,M,v)=>{let w=window.moment(),f=n.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(D,10),M),v?f.format(v.substring(1).trim()):f.format(a)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(r,s),r}catch(r){console.error(`Failed to create file: '${m}'`,r),new g.Notice("Unable to create new file.")}}function ot(n,t){return t[T(n,"month")]??null}function st(){let n={};if(!Fe())return n;let{vault:t}=window.app,{folder:e}=x(),a=t.getAbstractFileByPath(g.normalizePath(e));if(!a)throw new oe("Failed to find monthly notes folder");return g.Vault.recurseChildren(a,i=>{if(i instanceof g.TFile){let o=E(i,"month");if(o){let s=T(o,"month");n[s]=i}}}),n}var se=class extends Error{};async function rt(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=H(),[o,s]=await A(e),c=n.format(a),m=await R(i,c);try{let r=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,P,D,M,v)=>{let w=window.moment(),f=n.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(D,10),M),v?f.format(v.substring(1).trim()):f.format(a)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(r,s),r}catch(r){console.error(`Failed to create file: '${m}'`,r),new g.Notice("Unable to create new file.")}}function lt(n,t){return t[T(n,"quarter")]??null}function ct(){let n={};if(!Oe())return n;let{vault:t}=window.app,{folder:e}=H(),a=t.getAbstractFileByPath(g.normalizePath(e));if(!a)throw new se("Failed to find quarterly notes folder");return g.Vault.recurseChildren(a,i=>{if(i instanceof g.TFile){let o=E(i,"quarter");if(o){let s=T(o,"quarter");n[s]=i}}}),n}var re=class extends Error{};async function dt(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=C(),[o,s]=await A(e),c=n.format(a),m=await R(i,c);try{let r=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,P,D,M,v)=>{let w=window.moment(),f=n.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return P&&f.add(parseInt(D,10),M),v?f.format(v.substring(1).trim()):f.format(a)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(r,s),r}catch(r){console.error(`Failed to create file: '${m}'`,r),new g.Notice("Unable to create new file.")}}function pt(n,t){return t[T(n,"year")]??null}function ut(){let n={};if(!Le())return n;let{vault:t}=window.app,{folder:e}=C(),a=t.getAbstractFileByPath(g.normalizePath(e));if(!a)throw new re("Failed to find yearly notes folder");return g.Vault.recurseChildren(a,i=>{if(i instanceof g.TFile){let o=E(i,"year");if(o){let s=T(o,"year");n[s]=i}}}),n}function gt(){let{app:n}=window,t=n.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let e=n.plugins.getPlugin("periodic-notes");return e&&e.settings?.daily?.enabled}function Se(){let{app:n}=window;if(n.plugins.getPlugin("calendar"))return!0;let t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.weekly?.enabled}function Fe(){let{app:n}=window,t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.monthly?.enabled}function Oe(){let{app:n}=window,t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.quarterly?.enabled}function Le(){let{app:n}=window,t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.yearly?.enabled}function mt(n){let t={day:O,week:L,month:x,quarter:H,year:C}[n];return t()}function ht(n,t){return{day:Me,month:Ee,week:Ae}[n](t)}l.DEFAULT_DAILY_NOTE_FORMAT=te;l.DEFAULT_MONTHLY_NOTE_FORMAT=Ne;l.DEFAULT_QUARTERLY_NOTE_FORMAT=be;l.DEFAULT_WEEKLY_NOTE_FORMAT=ae;l.DEFAULT_YEARLY_NOTE_FORMAT=ke;l.appHasDailyNotesPluginLoaded=gt;l.appHasMonthlyNotesPluginLoaded=Fe;l.appHasQuarterlyNotesPluginLoaded=Oe;l.appHasWeeklyNotesPluginLoaded=Se;l.appHasYearlyNotesPluginLoaded=Le;l.createDailyNote=Me;l.createMonthlyNote=Ee;l.createPeriodicNote=ht;l.createQuarterlyNote=rt;l.createWeeklyNote=Ae;l.createYearlyNote=dt;l.getAllDailyNotes=et;l.getAllMonthlyNotes=st;l.getAllQuarterlyNotes=ct;l.getAllWeeklyNotes=it;l.getAllYearlyNotes=ut;l.getDailyNote=Xe;l.getDailyNoteSettings=O;l.getDateFromFile=E;l.getDateFromPath=Ze;l.getDateUID=T;l.getMonthlyNote=ot;l.getMonthlyNoteSettings=x;l.getPeriodicNoteSettings=mt;l.getQuarterlyNote=lt;l.getQuarterlyNoteSettings=H;l.getTemplateInfo=A;l.getWeeklyNote=nt;l.getWeeklyNoteSettings=L;l.getYearlyNote=pt;l.getYearlyNoteSettings=C});var vt={};qe(vt,{default:()=>J});module.exports=$e(vt);var b=require("obsidian");var N=require("obsidian");var He=require("obsidian");var he=require("obsidian");function k(n){return n?n.extension=="md"?n.path.slice(0,-3):n.path:""}function fe(n){return n.split("/").slice(-1)[0].contains(".")?n:`${n}.md`}function we(n){let t=n.vault.getFiles().filter(e=>["md","canvas"].contains(e.extension));if(t.length){let e=Math.floor(Math.random()*t.length);return k(t[e])}}function ye(n){return n.workspace.getActiveViewOfType(he.View)?.getViewType()=="empty"}function ee(n,t){return n.localeCompare(t,void 0,{sensitivity:"accent"})===0}function U(n){return new Promise(t=>setTimeout(t,n))}function ve(n,t){n.workspace.iterateRootLeaves(e=>{!e.view||!t.contains(e.view.getViewType())||e.detach()})}var u=ze(xe()),le={["Daily Note"]:{noun:"day",adjective:"daily",create:u.createDailyNote,get:u.getDailyNote,getAll:u.getAllDailyNotes},["Weekly Note"]:{noun:"week",adjective:"weekly",create:u.createWeeklyNote,get:u.getWeeklyNote,getAll:u.getAllWeeklyNotes},["Monthly Note"]:{noun:"month",adjective:"monthly",create:u.createMonthlyNote,get:u.getMonthlyNote,getAll:u.getAllMonthlyNotes},["Yearly Note"]:{noun:"year",adjective:"yearly",create:u.createYearlyNote,get:u.getYearlyNote,getAll:u.getAllYearlyNotes}},B=["Daily Note","Weekly Note","Monthly Note","Yearly Note"],Ce="Date-dependent file",ce="Date-dependent notes in Homepage have been removed. Set your Homepage as a Periodic or Daily Note instead.";async function Re(n,t){let e=t.communityPlugins["periodic-notes"],a=le[n],i=(0,He.moment)().startOf(a.noun),o;if(_e(e)){let s=a.getAll();Object.keys(s).length?o=a.get(i,s)||await a.create(i):o=await a.create(i)}else e.cache.initialize(),o=e.getPeriodicNote(a.noun,i)||await e.createPeriodicNote(a.noun,i);return k(o)}function Ie(n,t){if(n=="Daily Note"&&t.internalPlugins["daily-notes"]?.enabled)return!0;let e=t.communityPlugins["periodic-notes"];if(!e)return!1;if(_e(e)){let a=le[n].adjective;return e.settings[a]?.enabled}else{let a=le[n].noun;return e?.calendarSetManager?.getActiveSet()[a]?.enabled}}function K(n){let t=n.internalPlugins["daily-notes"];return t?.enabled&&t?.instance.options.autorun}function _e(n){return(n?.manifest.version||"0").startsWith("0")}var y=require("obsidian");var h=require("obsidian");var j=class extends h.AbstractInputSuggest{getSuggestions(e){let a=this.app.vault.getAllLoadedFiles(),i=[],o=e.toLowerCase();return a.forEach(s=>{s instanceof h.TFile&&["md","canvas"].contains(s.extension)&&s.path.toLowerCase().contains(o)&&i.push(s)}),i}renderSuggestion(e,a){e.extension=="md"?a.setText(k(e)):(a.setText(e.path.slice(0,-7)),a.insertAdjacentHTML("beforeend",''))}selectSuggestion(e){this.textInputEl.value=k(e),this.textInputEl.trigger("input"),this.close()}},q=class extends h.AbstractInputSuggest{getSuggestions(e){let a=Object.keys(this.app.internalPlugins.plugins.workspaces?.instance.workspaces),i=e.toLowerCase();return a.filter(o=>o.toLowerCase().contains(i))}renderSuggestion(e,a){a.setText(e)}selectSuggestion(e){this.textInputEl.value=e,this.textInputEl.trigger("input"),this.close()}},z=class{constructor(t){this.app=t.plugin.app,this.homepage=t.plugin.homepage,this.tab=t,this.container=t.containerEl.createDiv({cls:"nv-command-box"}),this.dropzone=document.createElement("div"),this.dropzone.className="nv-command-pill nv-dropzone",this.dropzone.addEventListener("dragenter",e=>e.preventDefault()),this.dropzone.addEventListener("dragover",e=>e.preventDefault()),this.dropzone.addEventListener("drop",()=>this.terminateDrag()),this.update()}update(){this.container.innerHTML="",this.activeDrag=null,this.activeCommand=null;for(let t of this.homepage.data.commands){let e=this.app.commands.findCommand(t.id),a=this.container.createDiv({cls:"nv-command-pill",text:e?.name??t.id,attr:{draggable:!0}});a.addEventListener("dragstart",o=>{o.dataTransfer.effectAllowed="move",this.activeCommand=this.homepage.data.commands.splice(this.indexOf(a),1)[0],this.activeDrag=a,this.dropzone.style.width=`${a.clientWidth}px`,this.dropzone.style.height=`${a.clientHeight}px`}),a.addEventListener("dragover",o=>this.moveDropzone(a,o)),a.addEventListener("drop",o=>o.preventDefault()),a.addEventListener("dragend",()=>this.terminateDrag());let i=new h.ButtonComponent(a).setIcon("route").setClass("clickable-icon").setClass("nv-command-period").onClick(o=>this.showMenu(t,o));t.period!="Both"&&(i.setClass("nv-command-selected"),i.setIcon(""),i.buttonEl.createSpan({text:t.period})),new h.ButtonComponent(a).setIcon("trash-2").setClass("clickable-icon").setClass("nv-command-delete").onClick(()=>this.delete(t)),e||(a.classList.add("nv-command-invalid"),a.prepend((0,h.getIcon)("ban")),(0,h.setTooltip)(a,"This command can't be found, so it won't be executed. It may belong to a disabled plugin.",{delay:.001}))}new h.ButtonComponent(this.container).setClass("nv-command-add-button").setButtonText("Add...").onClick(()=>{new de(this.tab).open()})}delete(t){this.homepage.data.commands.remove(t),this.homepage.save(),this.update()}showMenu(t,e){let a=new h.Menu;for(let i of Object.values($))a.addItem(o=>{o.setTitle(i),o.setChecked(t.period==i),o.onClick(()=>{t.period=i,this.homepage.save(),this.update()})});a.showAtMouseEvent(e)}indexOf(t){return Array.from(this.container.children).indexOf(t)}moveDropzone(t,e){if(!this.activeDrag)return;this.activeDrag.hidden=!0;let a=t.getBoundingClientRect();e.xawait this.copyDebugInfo()})}sanitiseNote(e){return e===null||e.match(/^\s*$/)!==null?null:(0,y.normalizePath)(e)}display(){let e=this.plugin.homepage.data.kind=="Workspace",a=this.plugin.homepage.data.kind,i=K(this.plugin),o=!1,s=e?q:j;this.containerEl.empty(),this.elements={};let c=new y.Setting(this.containerEl).setName("Homepage").addDropdown(async d=>{for(let p of Object.values(I)){if(!this.plugin.hasRequiredPlugin(p))if(p==this.plugin.homepage.data.kind)o=!0;else{d.selectEl.createEl("option",{text:p,attr:{disabled:!0}});continue}d.addOption(p,p)}d.setValue(this.plugin.homepage.data.kind),d.onChange(async p=>{this.plugin.homepage.data.kind=p,await this.plugin.homepage.save(),this.display()})});c.settingEl.id="nv-main-setting";let m=c.settingEl.createEl("article",{text:ft[a],attr:{id:"nv-desc"}});o&&m.createDiv({text:"The plugin required for this homepage type isn't available.",cls:"mod-warning"}),ge.includes(a)?c.addText(d=>{d.setDisabled(!0)}):c.addText(d=>{new s(this.app,d.inputEl),d.setPlaceholder(S.value),d.setValue(S.value==this.plugin.homepage.data.value?"":this.plugin.homepage.data.value),d.onChange(async p=>{this.plugin.homepage.data.value=this.sanitiseNote(p)||S.value,await this.plugin.homepage.save()})}),this.addToggle("Open on startup","When launching Obsidian, open the homepage.","openOnStartup",d=>this.display()),i&&(this.elements.openOnStartup.descEl.createDiv({text:`This setting has been disabled, as it isn't compatible with Daily Notes' "Open daily note on startup" functionality. To use it, disable the Daily Notes setting.`,attr:{class:"mod-warning"}}),this.disableSetting("openOnStartup")),this.addToggle("Open when empty","When there are no tabs open, open the homepage.","openWhenEmpty"),this.addToggle("Use when opening normally","Use homepage settings when opening it normally, such as from a link or the file browser.","alwaysApply");let r=new y.Setting(this.containerEl).setName("Separate mobile homepage").setDesc("For mobile devices, store the homepage and its settings separately.").addToggle(d=>d.setValue(this.plugin.settings.separateMobile).onChange(async p=>{this.plugin.settings.separateMobile=p,this.plugin.homepage=this.plugin.getHomepage(),await this.plugin.saveSettings(),this.display()}));if(this.plugin.settings.separateMobile){let d=y.Platform.isMobile?"desktop":"mobile",p=document.createElement("div");r.setClass("nv-mobile-setting"),p.className="mod-warning nv-mobile-info",p.innerHTML=`Mobile settings are stored separately. Therefore, changes to other settings will not affect - ${d} devices. To edit ${d} settings, use a ${d} device.`,r.settingEl.append(p)}this.addHeading("Commands","commandsHeading"),this.containerEl.createDiv({cls:"nv-command-desc setting-item-description",text:"Select commands that will be executed when opening the homepage."}),this.commandBox=new z(this),this.addHeading("Vault environment","vaultHeading"),this.addDropdown("Opening method","Determine how extant tabs and views are affected on startup.","openMode",Q),this.addDropdown("Manual opening method","Determine how extant tabs and views are affected when opening with commands or the ribbon button.","manualOpenMode",Q),this.addToggle("Pin","Pin the homepage when opening.","pin"),this.addToggle("Hide release notes","Never display release notes when Obsidian updates.","hideReleaseNotes"),this.addToggle("Auto-create","When the homepage doesn't exist, create a note with its name.","autoCreate"),this.elements.autoCreate.descEl.createDiv({text:"If this vault is synced using unofficial services, this may lead to content being overwritten.",cls:"mod-warning"}),this.addHeading("Opened view","paneHeading"),this.addDropdown("Homepage view","Choose what view to open the homepage in.","view",ue),this.addToggle("Revert view on close","When navigating away from the homepage, restore the default view.","revertView"),this.addToggle("Auto-scroll","When opening the homepage, scroll to the bottom and focus on the last line.","autoScroll"),"dataview"in this.plugin.communityPlugins&&(this.addToggle("Refresh Dataview","Always attempt to reload Dataview views when opening the homepage.","refreshDataview"),this.elements.refreshDataview.descEl.createDiv({text:"Requires Dataview auto-refresh to be enabled.",attr:{class:"mod-warning"}})),y.Platform.isMobile||new y.ButtonComponent(this.containerEl).setButtonText("Copy debug info").setClass("nv-debug-button").onClick(async()=>await this.copyDebugInfo()),(e||a==="Nothing")&&this.disableSettings("openWhenEmpty","alwaysApply","vaultHeading","openMode","manualOpenMode","autoCreate","pin"),(e||["Nothing","Graph view"].includes(a))&&this.disableSettings("paneHeading","view","revertView","autoScroll","refreshDataview"),(!this.plugin.homepage.data.openOnStartup||i)&&this.disableSetting("openMode"),B.includes(this.plugin.homepage.data.kind)&&this.disableSetting("autoCreate")}disableSetting(e){this.elements[e]?.settingEl.setAttribute("nv-greyed","")}disableSettings(...e){e.forEach(a=>this.disableSetting(a))}addHeading(e,a){let i=new y.Setting(this.containerEl).setHeading().setName(e);this.elements[a]=i}addDropdown(e,a,i,o,s){let c=new y.Setting(this.containerEl).setName(e).setDesc(a).addDropdown(async m=>{for(let r of Object.values(o))m.addOption(r,r);m.setValue(this.plugin.homepage.data[i]),m.onChange(async r=>{this.plugin.homepage.data[i]=r,await this.plugin.homepage.save(),s&&s(r)})});return this.elements[i]=c,c}addToggle(e,a,i,o){let s=new y.Setting(this.containerEl).setName(e).setDesc(a).addToggle(c=>c.setValue(this.plugin.homepage.data[i]).onChange(async m=>{this.plugin.homepage.data[i]=m,await this.plugin.homepage.save(),o&&o(m)}));return this.elements[i]=s,s}async copyDebugInfo(){let e=this.app.vault.config,a={...this.settings,_defaultViewMode:e.defaultViewMode||"default",_livePreview:e.livePreview!==void 0?e.livePreview:"default",_focusNewTab:e.focusNewTab!==void 0?e.focusNewTab:"default",_plugins:Object.keys(this.plugin.communityPlugins),_internalPlugins:Object.values(this.plugin.internalPlugins).flatMap(i=>i.enabled?[i.instance.id]:[]),_obsidianVersion:window.electron.ipcRenderer.sendSync("version")};await navigator.clipboard.writeText(JSON.stringify(a)),new y.Notice("Copied homepage debug information to clipboard")}};var Ve=["markdown","canvas","kanban"],wt=[...Ve,"audio","graph","image","pdf","video"],V="Main Homepage",W="Mobile Homepage",Q=(a=>(a.ReplaceAll="Replace all open notes",a.ReplaceLast="Replace last note",a.Retain="Keep open notes",a))(Q||{}),ue=(i=>(i.Default="Default view",i.Reading="Reading view",i.Source="Editing view (Source)",i.LivePreview="Editing view (Live Preview)",i))(ue||{}),I=(r=>(r.File="File",r.Workspace="Workspace",r.Random="Random file",r.Graph="Graph view",r.None="Nothing",r.DailyNote="Daily Note",r.WeeklyNote="Weekly Note",r.MonthlyNote="Monthly Note",r.YearlyNote="Yearly Note",r))(I||{}),$=(a=>(a.Both="Both",a.Startup="Startup only",a.Manual="Manual only",a))($||{}),ge=["Random file","Graph view","Nothing",...B],_=class{constructor(t,e){this.lastView=void 0;this.openedViews=new WeakMap;this.name=t,this.plugin=e,this.app=e.app;let a=this.plugin.settings.homepages[t];a?this.data=Object.assign(S,a):(this.plugin.settings.homepages[t]={...S},this.data=this.plugin.settings.homepages[t])}async open(t=!1){if(!this.plugin.hasRequiredPlugin(this.data.kind)){new N.Notice("Homepage cannot be opened due to plugin unavailablity.");return}if(this.data.kind==="Workspace")await this.launchWorkspace();else if(this.data.kind!=="Nothing"){let a=this.plugin.loaded?this.data.manualOpenMode:this.data.openMode;t&&(a="Keep open notes"),await this.launchLeaf(a)}if(!this.data.commands)return;let e=this.plugin.loaded?"Startup only":"Manual only";for(let{id:a,period:i}of this.data.commands)i!==e&&this.app.commands.executeCommandById(a)}async launchWorkspace(){let t=this.plugin.internalPlugins.workspaces?.instance;if(!(this.data.value in t.workspaces)){new N.Notice(`Cannot find the workspace "${this.data.value}" to use as the homepage.`);return}t.loadWorkspace(this.data.value),await U(100)}async launchLeaf(t){let e;if(this.computedValue=await this.computeValue(),this.plugin.executing=!0,!(K(this.plugin)&&!this.plugin.loaded)){if(t!=="Replace all open notes"){let a=this.getOpened();if(a.length>0){this.app.workspace.setActiveLeaf(a[0]),await this.configure(a[0]);return}else t=="Keep open notes"&&ye(this.app)&&(t="Replace last note")}t!=="Keep open notes"&&this.app.workspace.getActiveViewOfType(N.View)?.leaf.setPinned(!1),t==="Replace all open notes"&&(this.app.workspace?.floatingSplit?.children&&(await U(0),this.app.workspace.floatingSplit.children.forEach(a=>a.win.close())),ve(this.app,wt),await U(0),this.app.workspace.iterateRootLeaves(a=>this.app.workspace.setActiveLeaf(a))),this.data.kind==="Graph view"?e=await this.launchGraph(t):e=await this.launchNote(t),e&&await this.configure(e)}}async launchGraph(t){if(t==="Keep open notes"){let e=this.app.workspace.getLeaf("tab");this.app.workspace.setActiveLeaf(e)}return this.app.commands.executeCommandById("graph:open"),this.app.workspace.getActiveViewOfType(N.View)?.leaf}async launchNote(t){let e=this.app.metadataCache.getFirstLinkpathDest(this.computedValue,"/");if(!e){if(!this.data.autoCreate){new N.Notice(`Homepage "${this.computedValue}" does not exist.`);return}e=await this.app.vault.create(fe(this.computedValue),"")}let a=await this.app.vault.cachedRead(e),i=this.app.workspace.getLeaf(t=="Keep open notes");return await i.openFile(e),this.app.workspace.setActiveLeaf(i),a!==await this.app.vault.read(e)&&await this.app.vault.modify(e,a),i}async configure(t){this.plugin.executing=!1;let e=t.view;if(!(e instanceof N.MarkdownView)){this.data.pin&&e.leaf.setPinned(!0);return}let a=e.getState();if(this.data.revertView&&(this.lastView=new WeakRef(e)),this.data.autoScroll){let i=e.editor.lineCount();a.mode=="preview"?e.previewMode.applyScroll(i-4):(e.editor.setCursor(i),e.editor.focus())}if(this.data.pin&&e.leaf.setPinned(!0),this.data.view!="Default view"){switch(this.data.view){case"Editing view (Live Preview)":case"Editing view (Source)":a.mode="source",a.source=this.data.view!="Editing view (Live Preview)";break;case"Reading view":a.mode="preview";break}await e.leaf.setViewState({type:"markdown",state:a}),this.plugin.loaded&&this.data.refreshDataview&&this.plugin.communityPlugins.dataview?.index.touch()}}getOpened(){return this.data.kind=="Graph view"?this.app.workspace.getLeavesOfType("graph"):Ve.flatMap(e=>this.app.workspace.getLeavesOfType(e)).filter(e=>ee(k(e.view.file),this.computedValue))}async computeValue(){let t=this.data.value;switch(this.data.kind){case"Random file":let e=we(this.app);e&&(t=e);break;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":t=await Re(this.data.kind,this.plugin);break}return t}async save(){this.plugin.settings.homepages[this.name]=this.data,await this.plugin.saveSettings()}async setToActiveFile(){this.data.value=k(this.app.workspace.getActiveFile()),await this.save(),new N.Notice(`The homepage has been changed to "${this.data.value}".`)}canSetToFile(){return this.app.workspace.getActiveFile()!==null&&!ge.includes(this.data.kind)}async revertView(){if(this.lastView==null||this.data.view=="Default view")return;let t=this.lastView.deref();if(!t||ee(k(t.file),this.computedValue))return;let e=t.getState(),a=this.app.vault.config,i=a.defaultViewMode||"source",o=a.livePreview!==void 0?!a.livePreview:!1;t.leaf.getViewState().type=="markdown"&&(i!=e.mode||o!=e.source)&&(e.mode=i,e.source=o,await t.leaf.setViewState({type:"markdown",state:e,active:!0})),this.lastView=void 0}async openWhenEmpty(){if(!this.plugin.loaded||this.plugin.executing)return;let t=this.app.workspace.getActiveViewOfType(N.View)?.leaf;t?.getViewState().type!=="empty"||t.parentSplit.children.length!=1||await this.open(!0)}async apply(){let t=this.app.workspace.getActiveViewOfType(N.FileView);if(!t)return;let e=k(t.file);this.openedViews.get(t)!==e&&(this.openedViews.set(t,e),e===await this.computeValue()&&this.plugin.loaded&&!this.plugin.executing&&await this.configure(t.leaf))}};var yt='',J=class extends b.Plugin{constructor(){super(...arguments);this.newRelease=!1;this.loaded=!1;this.executing=!1;this.onLayoutChange=async()=>{this.homepage.data.revertView&&await this.homepage.revertView(),this.homepage.data.openWhenEmpty&&await this.homepage.openWhenEmpty(),this.homepage.data.alwaysApply&&await this.homepage.apply()}}async onload(){let e=document.body.querySelector(".progress-bar");this.patchReleaseNotes(),this.showInterstitial(e),this.settings=await this.loadSettings(),this.internalPlugins=this.app.internalPlugins.plugins,this.communityPlugins=this.app.plugins.plugins,this.homepage=this.getHomepage(),this.app.workspace.onLayoutReady(async()=>{let a=this.homepage.data.openOnStartup&&e&&!await this.hasUrlParams();this.patchNewTabPage(),a&&await this.homepage.open(),this.loaded=!0,this.unpatchReleaseNotes(),this.interstitial?.detach()}),(0,b.addIcon)("homepage",yt),this.addRibbonIcon("homepage","Open homepage",a=>this.homepage.open(a.button==1||a.button==2||b.Keymap.isModifier(a,"Mod"))).setAttribute("id","nv-homepage-icon"),this.registerEvent(this.app.workspace.on("layout-change",this.onLayoutChange)),this.addSettingTab(new G(this.app,this)),this.addCommand({id:"open-homepage",name:"Open homepage",callback:()=>this.homepage.open()}),this.addCommand({id:"set-to-active-file",name:"Set to active file",checkCallback:a=>{if(a)return this.homepage.canSetToFile();this.homepage.setToActiveFile()}}),console.log(`Homepage: ${this.homepage.data.value} (method: ${this.homepage.data.openMode}, view: ${this.homepage.data.view}, kind: ${this.homepage.data.kind})`)}async onunload(){this.app.workspace.off("layout-change",this.onLayoutChange),this.unpatchNewTabPage()}getHomepage(){return this.settings.separateMobile&&b.Platform.isMobile?(W in this.settings.homepages||(this.settings.homepages[W]={...this.settings.homepages?.[V]},this.settings.homepages[W].commands=[...this.settings.homepages?.[V]?.commands]),new _(W,this)):new _(V,this)}async loadSettings(){let e=await this.loadData();return e?.version!==4?e?this.upgradeSettings(e):Object.assign({},pe):e}async saveSettings(){await this.saveData(this.settings)}showInterstitial(e){e&&(this.interstitial=createDiv({cls:"progress-bar nv-homepage-interstitial"}),document.body.insertBefore(this.interstitial,e))}async hasUrlParams(){let e,a;if(b.Platform.isMobile){let i=await window.Capacitor.Plugins.App.getLaunchUrl();if(!i)return!1;let o=new URL(i.url);a=Array.from(o.searchParams.keys()),e=o.hostname}else if(window.OBS_ACT)a=Object.keys(window.OBS_ACT),e=window.OBS_ACT.action;else return!1;return["open","advanced-uri"].includes(e)&&["file","filepath","workspace"].some(i=>a.includes(i))}hasRequiredPlugin(e){switch(e){case"Workspace":return this.internalPlugins.workspaces?.enabled;case"Graph view":return this.internalPlugins.graph?.enabled;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":return Ie(e,this);default:return!0}}patchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.nvOrig_checkForNewTab=e.checkForNewTab,e.checkForNewTab=async a=>{if(!(this&&this.executing))return await e.nvOrig_checkForNewTab(a)})}unpatchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.checkForNewTab=e._checkForNewTab)}patchReleaseNotes(){this.app.nvOrig_showReleaseNotes=this.app.showReleaseNotes,this.app.showReleaseNotes=()=>this.newRelease=!0}unpatchReleaseNotes(){this.newRelease&&!this.homepage.data.hideReleaseNotes&&this.app.nvOrig_showReleaseNotes(),this.app.showReleaseNotes=this.app.nvOrig_showReleaseNotes}upgradeSettings(e){if(e.version==3){let i=e,o=!1;for(let s of Object.values(i.homepages))s.commands=s.commands.map(c=>({id:c,period:"Both"})),s.kind==Ce&&(o=!0,s.kind="Daily Note");return o&&new b.Notice(ce),i.version=4,this.saveData(i),i}let a=Object.assign({},pe);return e.workspaceEnabled?(e.value=e.workspace,e.kind="Workspace"):e.momentFormat?(e.kind="Daily Note",new b.Notice(ce)):(e.value=e.defaultNote,e.kind="File"),e.commands=[],delete e.workspace,delete e.momentFormat,delete e.defaultNote,delete e.useMoment,delete e.workspaceEnabled,a.homepages[V]=e,this.saveData(a),a}}; +"use strict";var Ye=Object.create;var Y=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var Ue=Object.getOwnPropertyNames;var Ke=Object.getPrototypeOf,je=Object.prototype.hasOwnProperty;var qe=(a,t)=>()=>(t||a((t={exports:{}}).exports,t),t.exports),ze=(a,t)=>{for(var e in t)Y(a,e,{get:t[e],enumerable:!0})},me=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ue(t))!je.call(a,i)&&i!==e&&Y(a,i,{get:()=>t[i],enumerable:!(n=Be(t,i))||n.enumerable});return a};var Ge=(a,t,e)=>(e=a!=null?Ye(Ke(a)):{},me(t||!a||!a.__esModule?Y(e,"default",{value:a,enumerable:!0}):e,a)),$e=a=>me(Y({},"__esModule",{value:!0}),a);var Ce=qe(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});var g=require("obsidian"),te="YYYY-MM-DD",ne="gggg-[W]ww",be="YYYY-MM",ke="YYYY-[Q]Q",Pe="YYYY";function F(a){let t=window.app.plugins.getPlugin("periodic-notes");return t&&t.settings?.[a]?.enabled}function O(){try{let{internalPlugins:a,plugins:t}=window.app;if(F("daily")){let{format:o,folder:s,template:c}=t.getPlugin("periodic-notes")?.settings?.daily||{};return{format:o||te,folder:s?.trim()||"",template:c?.trim()||""}}let{folder:e,format:n,template:i}=a.getPluginById("daily-notes")?.instance?.options||{};return{format:n||te,folder:e?.trim()||"",template:i?.trim()||""}}catch(a){console.info("No custom daily note settings found!",a)}}function L(){try{let a=window.app.plugins,t=a.getPlugin("calendar")?.options,e=a.getPlugin("periodic-notes")?.settings?.weekly;if(F("weekly"))return{format:e.format||ne,folder:e.folder?.trim()||"",template:e.template?.trim()||""};let n=t||{};return{format:n.weeklyNoteFormat||ne,folder:n.weeklyNoteFolder?.trim()||"",template:n.weeklyNoteTemplate?.trim()||""}}catch(a){console.info("No custom weekly note settings found!",a)}}function x(){let a=window.app.plugins;try{let t=F("monthly")&&a.getPlugin("periodic-notes")?.settings?.monthly||{};return{format:t.format||be,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom monthly note settings found!",t)}}function C(){let a=window.app.plugins;try{let t=F("quarterly")&&a.getPlugin("periodic-notes")?.settings?.quarterly||{};return{format:t.format||ke,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom quarterly note settings found!",t)}}function H(){let a=window.app.plugins;try{let t=F("yearly")&&a.getPlugin("periodic-notes")?.settings?.yearly||{};return{format:t.format||Pe,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom yearly note settings found!",t)}}function Te(...a){let t=[];for(let n=0,i=a.length;n{let Z=n(),X=a.clone().set({hour:Z.get("hour"),minute:Z.get("minute"),second:Z.get("second")});return E&&X.add(parseInt(v,10),w),f?X.format(f.substring(1).trim()):X.format(o)}).replace(/{{\s*yesterday\s*}}/gi,a.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,a.clone().add(1,"d").format(o)));return t.foldManager.save(p,m),p}catch(p){console.error(`Failed to create file: '${d}'`,p),new g.Notice("Unable to create new file.")}}function et(a,t){return t[P(a,"day")]??null}function tt(){let{vault:a}=window.app,{folder:t}=O(),e=a.getAbstractFileByPath(g.normalizePath(t));if(!e)throw new ae("Failed to find daily notes folder");let n={};return g.Vault.recurseChildren(e,i=>{if(i instanceof g.TFile){let o=M(i,"day");if(o){let s=P(o,"day");n[s]=i}}}),n}var ie=class extends Error{};function nt(){let{moment:a}=window,t=a.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)e.push(e.shift()),t--;return e}function at(a){return nt().indexOf(a.toLowerCase())}async function Me(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=L(),[o,s]=await A(e),c=a.format(n),m=await R(i,c);try{let r=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,T,D,E,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return T&&f.add(parseInt(D,10),E),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*title\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(d,p,T)=>{let D=at(p);return a.weekday(D).format(T.trim())}));return window.app.foldManager.save(r,s),r}catch(r){console.error(`Failed to create file: '${m}'`,r),new g.Notice("Unable to create new file.")}}function it(a,t){return t[P(a,"week")]??null}function ot(){let a={};if(!Fe())return a;let{vault:t}=window.app,{folder:e}=L(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new ie("Failed to find weekly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=M(i,"week");if(o){let s=P(o,"week");a[s]=i}}}),a}var oe=class extends Error{};async function Se(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=x(),[o,s]=await A(e),c=a.format(n),m=await R(i,c);try{let r=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,T,D,E,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return T&&f.add(parseInt(D,10),E),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(r,s),r}catch(r){console.error(`Failed to create file: '${m}'`,r),new g.Notice("Unable to create new file.")}}function st(a,t){return t[P(a,"month")]??null}function rt(){let a={};if(!Oe())return a;let{vault:t}=window.app,{folder:e}=x(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new oe("Failed to find monthly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=M(i,"month");if(o){let s=P(o,"month");a[s]=i}}}),a}var se=class extends Error{};async function lt(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=C(),[o,s]=await A(e),c=a.format(n),m=await R(i,c);try{let r=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,T,D,E,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return T&&f.add(parseInt(D,10),E),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(r,s),r}catch(r){console.error(`Failed to create file: '${m}'`,r),new g.Notice("Unable to create new file.")}}function ct(a,t){return t[P(a,"quarter")]??null}function dt(){let a={};if(!Le())return a;let{vault:t}=window.app,{folder:e}=C(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new se("Failed to find quarterly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=M(i,"quarter");if(o){let s=P(o,"quarter");a[s]=i}}}),a}var re=class extends Error{};async function pt(a){let{vault:t}=window.app,{template:e,format:n,folder:i}=H(),[o,s]=await A(e),c=a.format(n),m=await R(i,c);try{let r=await t.create(m,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(d,p,T,D,E,v)=>{let w=window.moment(),f=a.clone().set({hour:w.get("hour"),minute:w.get("minute"),second:w.get("second")});return T&&f.add(parseInt(D,10),E),v?f.format(v.substring(1).trim()):f.format(n)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(r,s),r}catch(r){console.error(`Failed to create file: '${m}'`,r),new g.Notice("Unable to create new file.")}}function ut(a,t){return t[P(a,"year")]??null}function gt(){let a={};if(!xe())return a;let{vault:t}=window.app,{folder:e}=H(),n=t.getAbstractFileByPath(g.normalizePath(e));if(!n)throw new re("Failed to find yearly notes folder");return g.Vault.recurseChildren(n,i=>{if(i instanceof g.TFile){let o=M(i,"year");if(o){let s=P(o,"year");a[s]=i}}}),a}function mt(){let{app:a}=window,t=a.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let e=a.plugins.getPlugin("periodic-notes");return e&&e.settings?.daily?.enabled}function Fe(){let{app:a}=window;if(a.plugins.getPlugin("calendar"))return!0;let t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.weekly?.enabled}function Oe(){let{app:a}=window,t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.monthly?.enabled}function Le(){let{app:a}=window,t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.quarterly?.enabled}function xe(){let{app:a}=window,t=a.plugins.getPlugin("periodic-notes");return t&&t.settings?.yearly?.enabled}function ht(a){let t={day:O,week:L,month:x,quarter:C,year:H}[a];return t()}function ft(a,t){return{day:Ae,month:Se,week:Me}[a](t)}l.DEFAULT_DAILY_NOTE_FORMAT=te;l.DEFAULT_MONTHLY_NOTE_FORMAT=be;l.DEFAULT_QUARTERLY_NOTE_FORMAT=ke;l.DEFAULT_WEEKLY_NOTE_FORMAT=ne;l.DEFAULT_YEARLY_NOTE_FORMAT=Pe;l.appHasDailyNotesPluginLoaded=mt;l.appHasMonthlyNotesPluginLoaded=Oe;l.appHasQuarterlyNotesPluginLoaded=Le;l.appHasWeeklyNotesPluginLoaded=Fe;l.appHasYearlyNotesPluginLoaded=xe;l.createDailyNote=Ae;l.createMonthlyNote=Se;l.createPeriodicNote=ft;l.createQuarterlyNote=lt;l.createWeeklyNote=Me;l.createYearlyNote=pt;l.getAllDailyNotes=tt;l.getAllMonthlyNotes=rt;l.getAllQuarterlyNotes=dt;l.getAllWeeklyNotes=ot;l.getAllYearlyNotes=gt;l.getDailyNote=et;l.getDailyNoteSettings=O;l.getDateFromFile=M;l.getDateFromPath=Xe;l.getDateUID=P;l.getMonthlyNote=st;l.getMonthlyNoteSettings=x;l.getPeriodicNoteSettings=ht;l.getQuarterlyNote=ct;l.getQuarterlyNoteSettings=C;l.getTemplateInfo=A;l.getWeeklyNote=it;l.getWeeklyNoteSettings=L;l.getYearlyNote=ut;l.getYearlyNoteSettings=H});var Nt={};ze(Nt,{default:()=>J});module.exports=$e(Nt);var b=require("obsidian");var N=require("obsidian");var He=require("obsidian");var he=require("obsidian");function k(a){return a?a.extension=="md"?a.path.slice(0,-3):a.path:""}function fe(a){return a.split("/").slice(-1)[0].contains(".")?a:`${a}.md`}function we(a){let t=a.vault.getFiles().filter(e=>["md","canvas"].contains(e.extension));if(t.length){let e=Math.floor(Math.random()*t.length);return k(t[e])}}function ye(a){return a.workspace.getActiveViewOfType(he.View)?.getViewType()=="empty"}function ee(a,t){return a.localeCompare(t,void 0,{sensitivity:"accent"})===0}function B(a){return new Promise(t=>setTimeout(t,a))}function ve(a,t){a.workspace.iterateRootLeaves(e=>{!e.view||!t.contains(e.view.getViewType())||e.detach()})}function Ne(a){let t=new Promise(e=>{let n=async()=>{e(),a.workspace.off("layout-change",n)};a.workspace.on("layout-change",n)});return Promise.race([t,new Promise(e=>setTimeout(e,1500))])}var u=Ge(Ce()),le={["Daily Note"]:{noun:"day",adjective:"daily",create:u.createDailyNote,get:u.getDailyNote,getAll:u.getAllDailyNotes},["Weekly Note"]:{noun:"week",adjective:"weekly",create:u.createWeeklyNote,get:u.getWeeklyNote,getAll:u.getAllWeeklyNotes},["Monthly Note"]:{noun:"month",adjective:"monthly",create:u.createMonthlyNote,get:u.getMonthlyNote,getAll:u.getAllMonthlyNotes},["Yearly Note"]:{noun:"year",adjective:"yearly",create:u.createYearlyNote,get:u.getYearlyNote,getAll:u.getAllYearlyNotes}},U=["Daily Note","Weekly Note","Monthly Note","Yearly Note"],Re="Date-dependent file",ce="Date-dependent notes in Homepage have been removed. Set your Homepage as a Periodic or Daily Note instead.";async function Ie(a,t){let e=t.communityPlugins["periodic-notes"],n=le[a],i=(0,He.moment)().startOf(n.noun),o;if(_e(e)){let s=n.getAll();Object.keys(s).length?o=n.get(i,s)||await n.create(i):o=await n.create(i)}else e.cache.initialize(),o=e.getPeriodicNote(n.noun,i)||await e.createPeriodicNote(n.noun,i);return k(o)}function Ve(a,t){if(a=="Daily Note"&&t.internalPlugins["daily-notes"]?.enabled)return!0;let e=t.communityPlugins["periodic-notes"];if(!e)return!1;if(_e(e)){let n=le[a].adjective;return e.settings[n]?.enabled}else{let n=le[a].noun;return e?.calendarSetManager?.getActiveSet()[n]?.enabled}}function K(a){let t=a.internalPlugins["daily-notes"];return t?.enabled&&t?.instance.options.autorun}function _e(a){return(a?.manifest.version||"0").startsWith("0")}var y=require("obsidian");var h=require("obsidian");var j=class extends h.AbstractInputSuggest{getSuggestions(e){let n=this.app.vault.getAllLoadedFiles(),i=[],o=e.toLowerCase();return n.forEach(s=>{s instanceof h.TFile&&["md","canvas"].contains(s.extension)&&s.path.toLowerCase().contains(o)&&i.push(s)}),i}renderSuggestion(e,n){e.extension=="md"?n.setText(k(e)):(n.setText(e.path.slice(0,-7)),n.insertAdjacentHTML("beforeend",''))}selectSuggestion(e){this.textInputEl.value=k(e),this.textInputEl.trigger("input"),this.close()}},q=class extends h.AbstractInputSuggest{getSuggestions(e){let n=Object.keys(this.app.internalPlugins.plugins.workspaces?.instance.workspaces),i=e.toLowerCase();return n.filter(o=>o.toLowerCase().contains(i))}renderSuggestion(e,n){n.setText(e)}selectSuggestion(e){this.textInputEl.value=e,this.textInputEl.trigger("input"),this.close()}},z=class{constructor(t){this.app=t.plugin.app,this.homepage=t.plugin.homepage,this.tab=t,this.container=t.containerEl.createDiv({cls:"nv-command-box"}),this.dropzone=document.createElement("div"),this.dropzone.className="nv-command-pill nv-dropzone",this.dropzone.addEventListener("dragenter",e=>e.preventDefault()),this.dropzone.addEventListener("dragover",e=>e.preventDefault()),this.dropzone.addEventListener("drop",()=>this.terminateDrag()),this.update()}update(){this.container.innerHTML="",this.activeDrag=null,this.activeCommand=null;for(let t of this.homepage.data.commands){let e=this.app.commands.findCommand(t.id),n=this.container.createDiv({cls:"nv-command-pill",attr:{draggable:!0}});n.addEventListener("dragstart",o=>{o.dataTransfer.effectAllowed="move",this.activeCommand=this.homepage.data.commands.splice(this.indexOf(n),1)[0],this.activeDrag=n,this.dropzone.style.width=`${n.clientWidth}px`,this.dropzone.style.height=`${n.clientHeight}px`}),n.addEventListener("dragover",o=>this.moveDropzone(n,o)),n.addEventListener("drop",o=>o.preventDefault()),n.addEventListener("dragend",()=>this.terminateDrag()),n.createSpan({cls:"nv-command-text",text:e?.name??t.id});let i=new h.ButtonComponent(n).setIcon("route").setClass("clickable-icon").setClass("nv-command-period").onClick(o=>this.showMenu(t,o,i));t.period!="Both"&&(i.setClass("nv-command-selected"),i.setIcon(""),i.buttonEl.createSpan({text:t.period})),new h.ButtonComponent(n).setIcon("trash-2").setClass("clickable-icon").setClass("nv-command-delete").onClick(()=>this.delete(t)),e||(n.classList.add("nv-command-invalid"),n.prepend((0,h.getIcon)("ban")),(0,h.setTooltip)(n,"This command can't be found, so it won't be executed. It may belong to a disabled plugin.",{delay:.001}))}new h.ButtonComponent(this.container).setClass("nv-command-add-button").setButtonText("Add...").onClick(()=>{new de(this.tab).open()})}delete(t){this.homepage.data.commands.remove(t),this.homepage.save(),this.update()}showMenu(t,e,n){let i=new h.Menu;for(let s of Object.values(G))i.addItem(c=>{c.setTitle(s),c.setChecked(t.period==s),c.onClick(()=>{t.period=s,this.homepage.save(),this.update()})});let o=n.buttonEl.getBoundingClientRect();i.showAtPosition({x:o.x-22,y:o.y+o.height+8})}indexOf(t){return Array.from(this.container.children).indexOf(t)}moveDropzone(t,e){if(!this.activeDrag)return;this.activeDrag.hidden=!0;let n=t.getBoundingClientRect();e.xawait this.copyDebugInfo()})}sanitiseNote(e){return e===null||e.match(/^\s*$/)!==null?null:(0,y.normalizePath)(e)}display(){let e=this.plugin.homepage.data.kind=="Workspace",n=this.plugin.homepage.data.kind,i=K(this.plugin),o=!1,s=e?q:j;this.containerEl.empty(),this.elements={};let c=new y.Setting(this.containerEl).setName("Homepage").addDropdown(async d=>{for(let p of Object.values(I)){if(!this.plugin.hasRequiredPlugin(p))if(p==this.plugin.homepage.data.kind)o=!0;else{d.selectEl.createEl("option",{text:p,attr:{disabled:!0}});continue}d.addOption(p,p)}d.setValue(this.plugin.homepage.data.kind),d.onChange(async p=>{this.plugin.homepage.data.kind=p,await this.plugin.homepage.save(),this.display()})});c.settingEl.id="nv-main-setting";let m=c.settingEl.createEl("article",{text:wt[n],attr:{id:"nv-desc"}});o&&m.createDiv({text:"The plugin required for this homepage type isn't available.",cls:"mod-warning"}),ge.includes(n)?c.addText(d=>{d.setDisabled(!0)}):c.addText(d=>{new s(this.app,d.inputEl),d.setPlaceholder(S.value),d.setValue(S.value==this.plugin.homepage.data.value?"":this.plugin.homepage.data.value),d.onChange(async p=>{this.plugin.homepage.data.value=this.sanitiseNote(p)||S.value,await this.plugin.homepage.save()})}),this.addToggle("Open on startup","When launching Obsidian, open the homepage.","openOnStartup",d=>this.display()),i&&(this.elements.openOnStartup.descEl.createDiv({text:`This setting has been disabled, as it isn't compatible with Daily Notes' "Open daily note on startup" functionality. To use it, disable the Daily Notes setting.`,attr:{class:"mod-warning"}}),this.disableSetting("openOnStartup")),this.addToggle("Open when empty","When there are no tabs open, open the homepage.","openWhenEmpty"),this.addToggle("Use when opening normally","Use homepage settings when opening it normally, such as from a link or the file browser.","alwaysApply");let r=new y.Setting(this.containerEl).setName("Separate mobile homepage").setDesc("For mobile devices, store the homepage and its settings separately.").addToggle(d=>d.setValue(this.plugin.settings.separateMobile).onChange(async p=>{this.plugin.settings.separateMobile=p,this.plugin.homepage=this.plugin.getHomepage(),await this.plugin.saveSettings(),this.display()}));if(this.plugin.settings.separateMobile){let d=y.Platform.isMobile?"desktop":"mobile",p=document.createElement("div");r.setClass("nv-mobile-setting"),p.className="mod-warning nv-mobile-info",p.innerHTML=`Mobile settings are stored separately. Therefore, changes to other settings will not affect + ${d} devices. To edit ${d} settings, use a ${d} device.`,r.settingEl.append(p)}this.addHeading("Commands","commandsHeading"),this.containerEl.createDiv({cls:"nv-command-desc setting-item-description",text:"Select commands that will be executed when opening the homepage."}),this.commandBox=new z(this),this.addHeading("Vault environment","vaultHeading"),this.addDropdown("Opening method","Determine how extant tabs and views are affected on startup.","openMode",Q),this.addDropdown("Manual opening method","Determine how extant tabs and views are affected when opening with commands or the ribbon button.","manualOpenMode",Q),this.addToggle("Pin","Pin the homepage when opening.","pin"),this.addToggle("Hide release notes","Never display release notes when Obsidian updates.","hideReleaseNotes"),this.addToggle("Auto-create","When the homepage doesn't exist, create a note with its name.","autoCreate"),this.elements.autoCreate.descEl.createDiv({text:"If this vault is synced using unofficial services, this may lead to content being overwritten.",cls:"mod-warning"}),this.addHeading("Opened view","paneHeading"),this.addDropdown("Homepage view","Choose what view to open the homepage in.","view",ue),this.addToggle("Revert view on close","When navigating away from the homepage, restore the default view.","revertView"),this.addToggle("Auto-scroll","When opening the homepage, scroll to the bottom and focus on the last line.","autoScroll"),"dataview"in this.plugin.communityPlugins&&(this.addToggle("Refresh Dataview","Always attempt to reload Dataview views when opening the homepage.","refreshDataview"),this.elements.refreshDataview.descEl.createDiv({text:"Requires Dataview auto-refresh to be enabled.",attr:{class:"mod-warning"}})),y.Platform.isMobile||new y.ButtonComponent(this.containerEl).setButtonText("Copy debug info").setClass("nv-debug-button").onClick(async()=>await this.copyDebugInfo()),(e||n==="Nothing")&&this.disableSettings("openWhenEmpty","alwaysApply","vaultHeading","openMode","manualOpenMode","autoCreate","pin"),(e||["Nothing","Graph view"].includes(n))&&this.disableSettings("paneHeading","view","revertView","autoScroll","refreshDataview"),(!this.plugin.homepage.data.openOnStartup||i)&&this.disableSetting("openMode"),U.includes(this.plugin.homepage.data.kind)&&this.disableSetting("autoCreate")}disableSetting(e){this.elements[e]?.settingEl.setAttribute("nv-greyed","")}disableSettings(...e){e.forEach(n=>this.disableSetting(n))}addHeading(e,n){let i=new y.Setting(this.containerEl).setHeading().setName(e);this.elements[n]=i}addDropdown(e,n,i,o,s){let c=new y.Setting(this.containerEl).setName(e).setDesc(n).addDropdown(async m=>{for(let r of Object.values(o))m.addOption(r,r);m.setValue(this.plugin.homepage.data[i]),m.onChange(async r=>{this.plugin.homepage.data[i]=r,await this.plugin.homepage.save(),s&&s(r)})});return this.elements[i]=c,c}addToggle(e,n,i,o){let s=new y.Setting(this.containerEl).setName(e).setDesc(n).addToggle(c=>c.setValue(this.plugin.homepage.data[i]).onChange(async m=>{this.plugin.homepage.data[i]=m,await this.plugin.homepage.save(),o&&o(m)}));return this.elements[i]=s,s}async copyDebugInfo(){let e=this.app.vault.config,n={...this.settings,_defaultViewMode:e.defaultViewMode||"default",_livePreview:e.livePreview!==void 0?e.livePreview:"default",_focusNewTab:e.focusNewTab!==void 0?e.focusNewTab:"default",_plugins:Object.keys(this.plugin.communityPlugins),_internalPlugins:Object.values(this.plugin.internalPlugins).flatMap(i=>i.enabled?[i.instance.id]:[]),_obsidianVersion:window.electron.ipcRenderer.sendSync("version")};await navigator.clipboard.writeText(JSON.stringify(n)),new y.Notice("Copied homepage debug information to clipboard")}};var We=["markdown","canvas","kanban"],yt=[...We,"audio","graph","image","pdf","video"],_="Main Homepage",W="Mobile Homepage",Q=(n=>(n.ReplaceAll="Replace all open notes",n.ReplaceLast="Replace last note",n.Retain="Keep open notes",n))(Q||{}),ue=(i=>(i.Default="Default view",i.Reading="Reading view",i.Source="Editing view (Source)",i.LivePreview="Editing view (Live Preview)",i))(ue||{}),I=(r=>(r.File="File",r.Workspace="Workspace",r.Random="Random file",r.Graph="Graph view",r.None="Nothing",r.DailyNote="Daily Note",r.WeeklyNote="Weekly Note",r.MonthlyNote="Monthly Note",r.YearlyNote="Yearly Note",r))(I||{}),G=(n=>(n.Both="Both",n.Startup="Startup only",n.Manual="Manual only",n))(G||{}),ge=["Random file","Graph view","Nothing",...U],V=class{constructor(t,e){this.lastView=void 0;this.openedViews=new WeakMap;this.name=t,this.plugin=e,this.app=e.app;let n=this.plugin.settings.homepages[t];n?this.data=Object.assign({},S,n):(this.plugin.settings.homepages[t]={...S},this.data=this.plugin.settings.homepages[t])}async open(t=!1){if(!this.plugin.hasRequiredPlugin(this.data.kind)){new N.Notice("Homepage cannot be opened due to plugin unavailablity.");return}if(this.data.kind==="Workspace")await this.launchWorkspace();else if(this.data.kind!=="Nothing"){let n=this.plugin.loaded?this.data.manualOpenMode:this.data.openMode;t&&(n="Keep open notes"),await this.launchLeaf(n)}if(this.data.commands.length<1)return;let e=this.plugin.loaded?"Startup only":"Manual only";await Ne(this.app);for(let{id:n,period:i}of this.data.commands)i!==e&&this.app.commands.executeCommandById(n)}async launchWorkspace(){let t=this.plugin.internalPlugins.workspaces?.instance;if(!(this.data.value in t.workspaces)){new N.Notice(`Cannot find the workspace "${this.data.value}" to use as the homepage.`);return}t.loadWorkspace(this.data.value),await B(100)}async launchLeaf(t){let e;if(this.computedValue=await this.computeValue(),this.plugin.executing=!0,!(K(this.plugin)&&!this.plugin.loaded)){if(t!=="Replace all open notes"){let n=this.getOpened();if(n.length>0){this.app.workspace.setActiveLeaf(n[0]),await this.configure(n[0]);return}else t=="Keep open notes"&&ye(this.app)&&(t="Replace last note")}t!=="Keep open notes"&&this.app.workspace.getActiveViewOfType(N.View)?.leaf.setPinned(!1),t==="Replace all open notes"&&(this.app.workspace?.floatingSplit?.children&&(await B(0),this.app.workspace.floatingSplit.children.forEach(n=>n.win.close())),ve(this.app,yt),await B(0),this.app.workspace.iterateRootLeaves(n=>this.app.workspace.setActiveLeaf(n))),this.data.kind==="Graph view"?e=await this.launchGraph(t):e=await this.launchNote(t),e&&await this.configure(e)}}async launchGraph(t){if(t==="Keep open notes"){let e=this.app.workspace.getLeaf("tab");this.app.workspace.setActiveLeaf(e)}return this.app.commands.executeCommandById("graph:open"),this.app.workspace.getActiveViewOfType(N.View)?.leaf}async launchNote(t){let e=this.app.metadataCache.getFirstLinkpathDest(this.computedValue,"/");if(!e){if(!this.data.autoCreate){new N.Notice(`Homepage "${this.computedValue}" does not exist.`);return}e=await this.app.vault.create(fe(this.computedValue),"")}let n=await this.app.vault.cachedRead(e),i=this.app.workspace.getLeaf(t=="Keep open notes");return await i.openFile(e),this.app.workspace.setActiveLeaf(i),n!==await this.app.vault.read(e)&&await this.app.vault.modify(e,n),i}async configure(t){this.plugin.executing=!1;let e=t.view;if(!(e instanceof N.MarkdownView)){this.data.pin&&e.leaf.setPinned(!0);return}let n=e.getState();if(this.data.revertView&&(this.lastView=new WeakRef(e)),this.data.autoScroll){let i=e.editor.lineCount();n.mode=="preview"?e.previewMode.applyScroll(i-4):(e.editor.setCursor(i),e.editor.focus())}if(this.data.pin&&e.leaf.setPinned(!0),this.data.view!="Default view"){switch(this.data.view){case"Editing view (Live Preview)":case"Editing view (Source)":n.mode="source",n.source=this.data.view!="Editing view (Live Preview)";break;case"Reading view":n.mode="preview";break}await e.leaf.setViewState({type:"markdown",state:n}),this.plugin.loaded&&this.data.refreshDataview&&this.plugin.communityPlugins.dataview?.index.touch()}}getOpened(){return this.data.kind=="Graph view"?this.app.workspace.getLeavesOfType("graph"):We.flatMap(e=>this.app.workspace.getLeavesOfType(e)).filter(e=>ee(k(e.view.file),this.computedValue))}async computeValue(){let t=this.data.value;switch(this.data.kind){case"Random file":let e=we(this.app);e&&(t=e);break;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":t=await Ie(this.data.kind,this.plugin);break}return t}async save(){this.plugin.settings.homepages[this.name]=this.data,await this.plugin.saveSettings()}async setToActiveFile(){this.data.value=k(this.app.workspace.getActiveFile()),await this.save(),new N.Notice(`The homepage has been changed to "${this.data.value}".`)}canSetToFile(){return this.app.workspace.getActiveFile()!==null&&!ge.includes(this.data.kind)}async revertView(){if(this.lastView==null||this.data.view=="Default view")return;let t=this.lastView.deref();if(!t||ee(k(t.file),this.computedValue))return;let e=t.getState(),n=this.app.vault.config,i=n.defaultViewMode||"source",o=n.livePreview!==void 0?!n.livePreview:!1;t.leaf.getViewState().type=="markdown"&&(i!=e.mode||o!=e.source)&&(e.mode=i,e.source=o,await t.leaf.setViewState({type:"markdown",state:e,active:!0})),this.lastView=void 0}async openWhenEmpty(){if(!this.plugin.loaded||this.plugin.executing)return;let t=this.app.workspace.getActiveViewOfType(N.View)?.leaf;t?.getViewState().type!=="empty"||t.parentSplit.children.length!=1||await this.open(!0)}async apply(){let t=this.app.workspace.getActiveViewOfType(N.FileView);if(!t)return;let e=k(t.file);this.openedViews.get(t)!==e&&(this.openedViews.set(t,e),e===await this.computeValue()&&this.plugin.loaded&&!this.plugin.executing&&await this.configure(t.leaf))}};var vt='',J=class extends b.Plugin{constructor(){super(...arguments);this.newRelease=!1;this.loaded=!1;this.executing=!1;this.onLayoutChange=async()=>{this.homepage.data.revertView&&await this.homepage.revertView(),this.homepage.data.openWhenEmpty&&await this.homepage.openWhenEmpty(),this.homepage.data.alwaysApply&&await this.homepage.apply()}}async onload(){let e=document.body.querySelector(".progress-bar");this.patchReleaseNotes(),this.showInterstitial(e),this.settings=await this.loadSettings(),this.internalPlugins=this.app.internalPlugins.plugins,this.communityPlugins=this.app.plugins.plugins,this.homepage=this.getHomepage(),this.app.workspace.onLayoutReady(async()=>{let n=this.homepage.data.openOnStartup&&e&&!await this.hasUrlParams();this.patchNewTabPage(),n&&await this.homepage.open(),this.loaded=!0,this.unpatchReleaseNotes(),this.interstitial?.detach()}),(0,b.addIcon)("homepage",vt),this.addRibbonIcon("homepage","Open homepage",n=>this.homepage.open(n.button==1||n.button==2||b.Keymap.isModifier(n,"Mod"))).setAttribute("id","nv-homepage-icon"),this.registerEvent(this.app.workspace.on("layout-change",this.onLayoutChange)),this.addSettingTab(new $(this.app,this)),this.addCommand({id:"open-homepage",name:"Open homepage",callback:()=>this.homepage.open()}),this.addCommand({id:"set-to-active-file",name:"Set to active file",checkCallback:n=>{if(n)return this.homepage.canSetToFile();this.homepage.setToActiveFile()}})}async onunload(){this.app.workspace.off("layout-change",this.onLayoutChange),this.unpatchNewTabPage()}getHomepage(){return this.settings.separateMobile&&b.Platform.isMobile?(W in this.settings.homepages||(this.settings.homepages[W]={...this.settings.homepages?.[_]},this.settings.homepages[W].commands=[...this.settings.homepages?.[_]?.commands]),new V(W,this)):new V(_,this)}async loadSettings(){let e=await this.loadData();return e?.version!==4?e?this.upgradeSettings(e):Object.assign({},pe):e}async saveSettings(){await this.saveData(this.settings)}showInterstitial(e){e&&(this.interstitial=createDiv({cls:"progress-bar nv-homepage-interstitial"}),document.body.insertBefore(this.interstitial,e))}async hasUrlParams(){let e,n;if(b.Platform.isMobile){let i=await window.Capacitor.Plugins.App.getLaunchUrl();if(!i)return!1;let o=new URL(i.url);n=Array.from(o.searchParams.keys()),e=o.hostname}else if(window.OBS_ACT)n=Object.keys(window.OBS_ACT),e=window.OBS_ACT.action;else return!1;return["open","advanced-uri"].includes(e)&&["file","filepath","workspace"].some(i=>n.includes(i))}hasRequiredPlugin(e){switch(e){case"Workspace":return this.internalPlugins.workspaces?.enabled;case"Graph view":return this.internalPlugins.graph?.enabled;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":return Ve(e,this);default:return!0}}patchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.nvOrig_checkForNewTab=e.checkForNewTab,e.checkForNewTab=async n=>{if(!(this&&this.executing))return await e.nvOrig_checkForNewTab(n)})}unpatchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.checkForNewTab=e._checkForNewTab)}patchReleaseNotes(){this.app.nvOrig_showReleaseNotes=this.app.showReleaseNotes,this.app.showReleaseNotes=()=>this.newRelease=!0}unpatchReleaseNotes(){this.newRelease&&!this.homepage.data.hideReleaseNotes&&this.app.nvOrig_showReleaseNotes(),this.app.showReleaseNotes=this.app.nvOrig_showReleaseNotes}upgradeSettings(e){if(e.version==3){let i=e,o=!1;for(let s of Object.values(i.homepages))s.commands=s.commands.map(c=>({id:c,period:"Both"})),s.kind==Re&&(o=!0,s.kind="Daily Note");return o&&new b.Notice(ce),i.version=4,this.saveData(i),i}let n=Object.assign({},pe);return e.workspaceEnabled?(e.value=e.workspace,e.kind="Workspace"):e.momentFormat?(e.kind="Daily Note",new b.Notice(ce)):(e.value=e.defaultNote,e.kind="File"),e.commands=[],delete e.workspace,delete e.momentFormat,delete e.defaultNote,delete e.useMoment,delete e.workspaceEnabled,n.homepages[_]=e,this.saveData(n),n}}; diff --git a/.obsidian/plugins/homepage/manifest.json b/.obsidian/plugins/homepage/manifest.json index 469ff383..e0a337b4 100644 --- a/.obsidian/plugins/homepage/manifest.json +++ b/.obsidian/plugins/homepage/manifest.json @@ -1,7 +1,7 @@ { "id": "homepage", "name": "Homepage", - "version": "4.0.2", + "version": "4.0.3", "minAppVersion": "1.4.10", "description": "Open a specified note, canvas, or workspace on startup, or set it for quick access later.", "author": "novov", diff --git a/.obsidian/plugins/homepage/styles.css b/.obsidian/plugins/homepage/styles.css index a8605be7..4b3cd34f 100644 --- a/.obsidian/plugins/homepage/styles.css +++ b/.obsidian/plugins/homepage/styles.css @@ -63,6 +63,17 @@ padding: 5px 0 0; } +.nv-mobile-setting { + flex-wrap: wrap; + row-gap: var(--size-2-2); +} + +.nv-mobile-setting .nv-mobile-info { + font-size: var(--font-ui-smaller); + width: 100%; + margin-right: var(--size-4-18); +} + .nv-command-desc { padding: 1.2em 0 0; border-top: 1px solid var(--background-modifier-border); @@ -166,17 +177,45 @@ max-width: auto; } -.is-phone .nv-command-pill button, .is-phone .nv-command-add-button { - width: auto; +.is-phone .nv-mobile-setting { + row-gap: var(--size-4-2); } -.nv-mobile-setting { - flex-wrap: wrap; - row-gap: var(--size-2-2); +.is-phone .nv-mobile-setting .setting-item-info { + max-width: calc(100% - 100px); } -.nv-mobile-setting .nv-mobile-info { - font-size: var(--font-ui-smaller); +.is-phone .nv-mobile-setting { + row-gap: var(--size-4-2); +} + +.is-phone .nv-mobile-setting .setting-item-info { + max-width: calc(100% - 100px); +} + +.is-phone .nv-command-pill { width: 100%; - margin-right: var(--size-4-18); + border: none; + background: none; + padding: 0 0 var(--size-4-2); + display: flex; + gap: var(--size-4-4); + align-items: baseline; +} + +.is-phone .nv-command-pill .nv-command-text { + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; +} + +.is-phone .nv-command-pill, .is-phone .nv-command-add-button { + font-size: var(--font-ui-medium); + justify-content: space-between; +} + +.is-phone .nv-command-pill button { + line-height: var(--font-ui-medium); + height: 100%; + margin: 0 !important; } diff --git a/.obsidian/plugins/obsidian-enhancing-export/data.json b/.obsidian/plugins/obsidian-enhancing-export/data.json deleted file mode 100644 index 6294d7f2..00000000 --- a/.obsidian/plugins/obsidian-enhancing-export/data.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "items": [ - { - "name": "Markdown" - }, - { - "name": "Markdown (Hugo)" - }, - { - "name": "Html" - }, - { - "name": "TextBundle" - }, - { - "name": "Typst" - }, - { - "name": "PDF" - }, - { - "name": "Word (.docx)" - }, - { - "name": "OpenOffice" - }, - { - "name": "RTF" - }, - { - "name": "Epub" - }, - { - "name": "Latex" - }, - { - "name": "Media Wiki" - }, - { - "name": "reStructuredText" - }, - { - "name": "Textile" - }, - { - "name": "OPML" - }, - { - "name": "Bibliography" - } - ], - "defaultExportDirectoryMode": "Auto", - "openExportedFile": true, - "env": {}, - "showExportProgressBar": true, - "lastExportDirectory": { - "darwin": "/Users/struchkov/Downloads" - }, - "lastExportType": "RTF" -} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/citefilter.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/citefilter.lua deleted file mode 100644 index 01700edd..00000000 --- a/.obsidian/plugins/obsidian-enhancing-export/lua/citefilter.lua +++ /dev/null @@ -1,6 +0,0 @@ --- credits to tarleb — StackExchange: https://tex.stackexchange.com/questions/392070/pandoc-markdown-create-self-contained-bib-file-from-cited-references -function Pandoc(d) - d.meta.references = pandoc.utils.references(d) - d.meta.bibliography = nil - return d -end diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/markdown+hugo.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/markdown+hugo.lua deleted file mode 100644 index 9341fd9f..00000000 --- a/.obsidian/plugins/obsidian-enhancing-export/lua/markdown+hugo.lua +++ /dev/null @@ -1,5 +0,0 @@ -package.path=package.path..";" ..debug.getinfo(1).source:match("(.*[/\\])"):sub(2) .. "?.lua" - -Mode='hugo' - -require('markdown') \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/markdown.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/markdown.lua deleted file mode 100644 index 60711482..00000000 --- a/.obsidian/plugins/obsidian-enhancing-export/lua/markdown.lua +++ /dev/null @@ -1,237 +0,0 @@ -package.path=debug.getinfo(1).source:gsub('@',''):sub(0):match('(.*[/\\])'):sub(0) .. '?.lua' .. ';' .. package.path - -require("polyfill") -local url = require('url') - -local pandoc=pandoc -local PANDOC_STATE=PANDOC_STATE - -PANDOC_VERSION:must_be_at_least '3.1.7' - -os.text = pandoc.text - -local PATH = pandoc.path -local doc_dir = nil -local media_dir = nil - -if Mode == nil then - Mode = 'default' -end - --- print("Mode: "..Mode) - -if PANDOC_STATE.output_file then - local output_file = PANDOC_STATE.output_file - doc_dir = PATH.directory(output_file) - if PANDOC_WRITER_OPTIONS.variables["media_dir"] then - media_dir = tostring(PANDOC_WRITER_OPTIONS.variables["media_dir"]) - else - media_dir = PATH.split_extension(output_file) - if Mode ~= 'hugo' then - media_dir = media_dir .. '-media' - end - end -end -assert(doc_dir, "doc_dir is nil") -assert(media_dir, "media_dir is nil") - - -local function get_absolute_path(file_path) - if PATH.is_absolute(file_path) then - return file_path - end - for _, dir in pairs(PANDOC_STATE.resource_path) do - local full_path = PATH.join({dir, file_path}) - if os.exists(full_path) then - return full_path - end - end - for _, file in pairs(PANDOC_STATE.input_files) do - if not PATH.is_absolute(file) then - file = PATH.join({pandoc.system.get_working_directory(), file_path}) - end - local dir = PATH.directory(file) - local full_path = PATH.join({dir, file_path}) - if os.exists(full_path) then - return full_path - end - end - return nil -end - -local function get_output_file(file_path) - if media_dir then - local new_file_name = pandoc.utils.sha1(file_path) - local _, new_file_ext = PATH.split_extension(file_path) - file_path = new_file_name .. new_file_ext - local full_path = PATH.join({media_dir, file_path}) - return full_path - else - return nil - end -end - -local function extract_media(file_path) - os.mkdir(media_dir) - file_path = url.decode(file_path) - local abs_path = get_absolute_path(file_path) - local file = get_output_file(file_path) - if abs_path and file then - if not os.exists(file) then - os.copy(abs_path, file) - end - local rel_path = PATH.make_relative(file, doc_dir, false) - local parts = PATH.split(rel_path) - for i,v in ipairs(parts) do - parts[i] = url.encode(v) - end - local encoded_rel_path = table.concat(parts, "/") - if Mode == 'hugo' then - encoded_rel_path = '../' .. encoded_rel_path - end - return encoded_rel_path - end -end - -local function raw(s) - return pandoc.RawInline('markdown', s) -end - -function Image(el) - local src = extract_media(el.src) - if src then - el.src = src - end - return el -end - -function Space() - return raw(' ') -end - -function SoftBreak() - return raw('\n') -end - -function RawInline(el) - if el.format == "html" then - el.format = 'markdown' - el.text = string.gsub(el.text, ']+>', function(img) - return string.gsub(img, 'src="([^"]+)"', function(url) - if string.find(url, '^[Hh][Tt][Tt][Pp][Ss]?://') == nil then - local extract_media_url = extract_media(url) - if extract_media_url then - return 'src="' .. extract_media_url .. '"' - end - return '123' - end - return 'src="' .. url .. '"' - end) - end) - end - return el -end - -function RawBlock(el) - if el.format == "html" then - el.format = 'markdown' - end - return el -end - -function Math(el) - if Mode == 'hugo' then - if el.mathtype == 'DisplayMath' then - return raw('{{< mathjax >}}\n$$' .. el.text .. '$$\n{{}}') - else - el.text = string.gsub(el.text, '\\[\\{\\}]', function (v) - return '\\' .. v - end) - el.text = string.gsub(el.text, '_', function (v) - return '\\' .. v - end) - end - end - return el -end - -local function headerLink(input) - -- github style section link - return "#"..input:gsub(' ', '-') -end - - -local function insertLink(content, linkDescription) - local descriptionText = table.concat(linkDescription, "") - - if string.find(descriptionText, '|') then - local target, desc = descriptionText:match("(.*)|(.*)") - table.insert(content, pandoc.Link(desc, headerLink(target))) - else - table.insert(content, pandoc.Link(descriptionText, headerLink(descriptionText))) - end -end - -function Para(el) - local content = el.content - content = ProcessMath(content) - content = ProcessInternalLinks(content) - el.content = content - return el -end - -function ProcessMath(elements) - local content = {} - local in_display_math = false - for _, item in pairs(elements) do - if item.t == 'Str'and item.text == "$$" then - in_display_math = not in_display_math - else - if in_display_math then - if item.t == 'RawInline' and item.format == 'tex' then - local n = pandoc.Math('DisplayMath', '\n' .. item.text .. '\n') - table.insert(content, Math(n)) - else - table.insert(content, item) - end - else - table.insert(content, item) - end - end - end - return content -end - -function ProcessInternalLinks(elements) - local content = {} - local in_section_link = false - local linkDescription = {} - - for _, item in pairs(elements) do - if item.t == 'Str' and string.starts_with(item.text, '[[#') then - in_section_link = true - table.insert(linkDescription, string.sub(item.text, 4)) - elseif in_section_link then - if string.ends_with(item.text, ']]') then - table.insert(linkDescription, string.sub(item.text, 1, -3)) - insertLink(content, linkDescription) - in_section_link = false - linkDescription = {} - else - table.insert(linkDescription, item.text) - end - else - table.insert(content, item) - end - end - return content -end - -function Plain(el) - el.content = ProcessInternalLinks(el.content) - return el -end - -function Pandoc(el) - return el -end diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/math_block.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/math_block.lua deleted file mode 100644 index 380d96a9..00000000 --- a/.obsidian/plugins/obsidian-enhancing-export/lua/math_block.lua +++ /dev/null @@ -1,68 +0,0 @@ -traverse = 'topdown' - -math_block_text = nil -function process(el) - - -- MathBlock start or end - if el.t == 'Str' and el.text == '$$' then - if math_block_text == nil then -- start - math_block_text = '' - else -- end - local math_block = pandoc.Math('DisplayMath', '\n' .. math_block_text .. '\n') - math_block_text = nil - return math_block - end - return {} - end - - if math_block_text then - if (el.t == 'RawInline' or el.t == 'RawBlock') and el.format == 'tex' then - math_block_text = math_block_text .. el.text - return {} - elseif el.t == 'Str' then - math_block_text = math_block_text .. el.text - return {} - elseif el.t == 'SoftBreak' or el.t == 'BulletList' then - return {} - end - end - return el -end - -function RawInline(el) - return process(el) -end - -function RawBlock(el) - return process(el) -end - -function Str(el) - return process(el) -end - -function SoftBreak(el) - return process(el) -end - -function Header(el) - return process(el) -end - -function Para(el) - return process(el) -end - -function Plain(el) - return process(el) -end - -function BulletList(el) - return process(el) -end - - - - - - diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/pdf.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/pdf.lua deleted file mode 100644 index 05fc651a..00000000 --- a/.obsidian/plugins/obsidian-enhancing-export/lua/pdf.lua +++ /dev/null @@ -1,12 +0,0 @@ - -return { - { - Math = function (elem) - if elem.text:find("^%s*\\begin{") ~= nil then - return pandoc.RawInline('tex', elem.text) - else - return elem - end - end, - } -} diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/polyfill.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/polyfill.lua deleted file mode 100644 index 1e8f3e55..00000000 --- a/.obsidian/plugins/obsidian-enhancing-export/lua/polyfill.lua +++ /dev/null @@ -1,61 +0,0 @@ -os.platform = nil -if os.platform == nil then - local libExt = package.cpath:match("%p[\\|/]?\\.%p(%a+)") - if libExt == 'dll' then - os.platform = "Windows" - elseif libExt == 'so' then - os.platform = "Linux" - elseif libExt == 'dylib' then - os.platform = "MacOS" - end -end - - -os.copy = function(src, dest) - if os.platform == "Windows" then - src = string.gsub(src, "/", "\\") - src = os.text.toencoding(src) - dest = os.text.toencoding(dest) - os.execute('copy "' .. src .. '" "' .. dest .. '" >NUL') - else - os.execute('cp "' .. src .. '" "' .. dest .. '"') - end -end - -os.mkdir = function(dir) - if os.exists(dir) then - return - end - if os.platform == "Windows" then - dir = os.text.toencoding(dir) - os.execute('mkdir "' .. dir .. '"') - else - os.execute('mkdir -p "' .. dir .. '"') - end -end - -os.exists = function(path) - if os.platform == "Windows" then - path = string.gsub(path, "/", "\\") - path = os.text.toencoding(path) - local _, _, code = os.execute('if exist "' .. path .. '" (exit 0) else (exit 1)') - return code == 0 - else - local _, _, code = os.execute('test -e "' .. path .. '"') - return code == 0 - end -end - -string.starts_with = function(str, start) - return str:sub(1, #start) == start -end - -string.ends_with = function(str, ending) - return ending == "" or str:sub(-#ending) == ending -end - - -return { - os = os, - string = string -} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/url.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/url.lua deleted file mode 100644 index 47981462..00000000 --- a/.obsidian/plugins/obsidian-enhancing-export/lua/url.lua +++ /dev/null @@ -1,18 +0,0 @@ -local function encode (str) - str = string.gsub (str, "([^0-9a-zA-Z !'()*._~-])", -- locale independent - function (c) return string.format ("%%%02X", string.byte(c)) end) - str = string.gsub (str, " ", "%%20") - return str - end - - -local function decode (str) - str = string.gsub (str, "%%20", " ") - str = string.gsub (str, "%%(%x%x)", function(h) return string.char(tonumber(h,16)) end) - return str -end - -return { - encode = encode, - decode = decode -} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-enhancing-export/main.js b/.obsidian/plugins/obsidian-enhancing-export/main.js deleted file mode 100644 index 84a999a1..00000000 --- a/.obsidian/plugins/obsidian-enhancing-export/main.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict";var Al=(e,t,l)=>{if(!t.has(e))throw TypeError("Cannot "+l)};var Yl=(e,t,l)=>(Al(e,t,"read from private field"),l?l.call(e):t.get(e)),xl=(e,t,l)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,l)},yl=(e,t,l,n)=>(Al(e,t,"write to private field"),n?n.call(e,l):t.set(e,l),l);/*! -THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source, please visit the github repository https://github.com/mokeyish/obsidian-enhancing-export . -*/Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const We=require("obsidian"),tc=require("child_process"),Nt=require("process"),mn=require("electron"),Gn=require("fs"),de=require("path"),lc=require("util");function bl(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const n=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,n.get?n:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const nc=bl(We),Se=bl(mn),Ut=bl(Gn),ft={Markdown:{name:"Markdown",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/markdown.lua" -s -o "${outputPath}" -t commonmark_x-attributes',extension:".md"},"Markdown (Hugo)":{name:"Markdown (Hugo)",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/markdown+hugo.lua" -s -o "${outputPath}" -t commonmark_x-attributes',extension:".md"},Html:{name:"Html",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/math_block.lua" --embed-resources --standalone --metadata title="${currentFileName}" -s -o "${outputPath}" -t html',customArguments:'--mathjax="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg-full.js"',extension:".html"},TextBundle:{name:"TextBundle",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/markdown.lua" -V media_dir="${outputDir}/${outputFileName}.textbundle/assets" -s -o "${outputDir}/${outputFileName}.textbundle/text.md" -t commonmark_x-attributes',extension:".md"},Typst:{name:"Typst",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/markdown.lua" -s -o "${outputPath}" -t typst',extension:".typ"},PDF:{name:"PDF",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/pdf.lua" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } -o "${outputPath}" -t pdf',customArguments:"--pdf-engine=pdflatex",optionsMeta:{textemplate:"preset:textemplate"},extension:".pdf"},"Word (.docx)":{name:"Word (.docx)",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -o "${outputPath}" -t docx',extension:".docx"},OpenOffice:{name:"OpenOffice",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -o "${outputPath}" -t odt',extension:".odt"},RTF:{name:"RTF",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t rtf',extension:".rtf"},Epub:{name:"Epub",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -o "${outputPath}" -t epub',extension:".epub"},Latex:{name:"Latex",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } --extract-media="${outputDir}" -s -o "${outputPath}" -t latex',optionsMeta:{textemplate:"preset:textemplate"},extension:".tex"},"Media Wiki":{name:"Media Wiki",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t mediawiki',extension:".mediawiki"},reStructuredText:{name:"reStructuredText",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t rst',extension:".rst"},Textile:{name:"Textile",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t textile',extension:".textile"},OPML:{name:"OPML",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t opml',extension:".opml"},"Bibliography (.bib)":{name:"Bibliography",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/citefilter.lua" -o "${outputPath}" --to=bibtex "${currentPath}"',extension:".bib"},Custom:{name:"Custom",type:"custom",command:"your command",targetFileExtensions:".ext"}};function Be(e,t,l){return typeof t=="string"&&t.trim()===""&&(t=void 0),l instanceof Array?l.reduce((n,c)=>Be(n,t,c),e):(l??(l=Nt.platform),{...e??{},[l]:t})}function ue(e,t){e??(e={});const l=e[t??Nt.platform],n=e["*"];return n&&typeof n=="object"?Object.assign({},n,l):l??n}function L(e,...t){return function(...l){const n=l[l.length-1]||{},c=[e[0]];return t.forEach(function(i,s){const a=Number.isInteger(i)?l[i]:n[i];c.push(a,e[s+1])}),c.join("")}}function cl(e,t){return t=t??{},new Promise((l,n)=>{tc.exec(e,t,(c,i,s)=>{if(c){n(c),console.error(i,c);return}if(s&&s!==""){n(s),console.error(i,c);return}(i==null?void 0:i.trim().length)===0&&localStorage.getItem("debug-plugin")==="1"&&console.log(i),l(i)})})}function cc(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.substring(1,e.length-1):e}function il(e,t={}){for(;;)try{const l=Object.keys(t).filter(ic),n=l.map(c=>t[c]);return new Function(...l,`{ return \`${e.replaceAll("\\","\\\\")}\` }`).bind(t)(...n)}catch(l){if(l instanceof ReferenceError&&l.message.endsWith("is not defined")){const n=l.message.substring(0,l.message.indexOf(" ")),c=Object.keys(t).filter(i=>i.toLowerCase()===n.toLowerCase()).map(i=>t[i])[0]??`\${${n}}`;t[n]=c}else throw l}}const ic=e=>{if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0},sc={textemplate:{title:"Latex Template",type:"dropdown",options:[{name:"None",value:null},{name:"Dissertation",value:"dissertation.tex"},{name:"Academic Paper",value:"neurips.tex"}]}},ot=(()=>{let e={};return e=Be(e,{HOME:"${HOME}",PATH:"${PATH}",TEXINPUTS:"${pluginDir}/textemplate/:"},"*"),e=Be(e,{TEXINPUTS:"${pluginDir}/textemplate/;",PATH:"${HOME}\\AppData\\Local\\Pandoc;${PATH}"},"win32"),e=Be(e,{PATH:"/opt/homebrew/bin:/usr/local/bin:/Library/TeX/texbin:${PATH}"},"darwin"),e})(),tt={items:Object.values(ft).filter(e=>e.type!=="custom"),pandocPath:void 0,defaultExportDirectoryMode:"Auto",openExportedFile:!0,env:ot,showExportProgressBar:!0};function hn(e){var t;return e.type==="pandoc"?e.extension:e.type==="custom"?(t=e.targetFileExtensions)==null?void 0:t.split(",")[0]:""}function In(e,t){return e=Object.assign({},ue(ot),e),t=Object.assign({HOME:process.env.HOME??process.env.USERPROFILE},process.env,t??{}),Object.fromEntries(Object.entries(e).map(([l,n])=>[l,il(n,t)]))}function ac(e){return e?Object.fromEntries(Object.entries(e).map(([t,l])=>[t,typeof l=="string"?sc[l.startsWith("preset:")?l.substring(7):""]:l])):{}}const rc=(e,t)=>e===t,Re=Symbol("solid-proxy"),sl=Symbol("solid-track"),At={equals:rc};let Cn=Vn;const ke=1,Yt=2,Wn={owned:null,cleanups:null,context:null,owner:null};var T=null;let jt=null,oc=null,P=null,ie=null,He=null,vt=0;function Te(e,t){const l=P,n=T,c=e.length===0,i=n,s=c?Wn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=c?e:()=>e(()=>D(()=>St(s)));T=s,P=null;try{return qe(a,!0)}finally{P=l,T=n}}function oe(e,t){t=t?Object.assign({},At,t):At;const l={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=c=>(typeof c=="function"&&(c=c(l.value)),Rn(l,c));return[Xn.bind(l),n]}function ne(e,t,l){const n=Zl(e,t,!1,ke);bt(n)}function Fe(e,t,l){Cn=Zc;const n=Zl(e,t,!1,ke);n.user=!0,He?He.push(n):bt(n)}function le(e,t,l){l=l?Object.assign({},At,l):At;const n=Zl(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=l.equals||void 0,bt(n),Xn.bind(n)}function Xt(e){return qe(e,!1)}function D(e){if(P===null)return e();const t=P;P=null;try{return e()}finally{P=t}}function pn(e){Fe(()=>D(e))}function _e(e){return T===null||(T.cleanups===null?T.cleanups=[e]:T.cleanups.push(e)),e}function al(){return P}function dc(e,t){const l=Symbol("context");return{id:l,Provider:Gc(l),defaultValue:e}}function gc(e){return T&&T.context&&T.context[e.id]!==void 0?T.context[e.id]:e.defaultValue}function fn(e){const t=le(e),l=le(()=>rl(t()));return l.toArray=()=>{const n=l();return Array.isArray(n)?n:n!=null?[n]:[]},l}function Xn(){if(this.sources&&this.state)if(this.state===ke)bt(this);else{const e=ie;ie=null,qe(()=>yt(this),!1),ie=e}if(P){const e=this.observers?this.observers.length:0;P.sources?(P.sources.push(this),P.sourceSlots.push(e)):(P.sources=[this],P.sourceSlots=[e]),this.observers?(this.observers.push(P),this.observerSlots.push(P.sources.length-1)):(this.observers=[P],this.observerSlots=[P.sources.length-1])}return this.value}function Rn(e,t,l){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&qe(()=>{for(let c=0;c1e6)throw ie=[],new Error},!1)),t}function bt(e){if(!e.fn)return;St(e);const t=vt;uc(e,e.value,t)}function uc(e,t,l){let n;const c=T,i=P;P=T=e;try{n=e.fn(t)}catch(s){return e.pure&&(e.state=ke,e.owned&&e.owned.forEach(St),e.owned=null),e.updatedAt=l+1,Yn(s)}finally{P=i,T=c}(!e.updatedAt||e.updatedAt<=l)&&(e.updatedAt!=null&&"observers"in e?Rn(e,n):e.value=n,e.updatedAt=l)}function Zl(e,t,l,n=ke,c){const i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:T,context:T?T.context:null,pure:l};return T===null||T!==Wn&&(T.owned?T.owned.push(i):T.owned=[i]),i}function xt(e){if(e.state===0)return;if(e.state===Yt)return yt(e);if(e.suspense&&D(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;l--)if(e=t[l],e.state===ke)bt(e);else if(e.state===Yt){const n=ie;ie=null,qe(()=>yt(e,t[0]),!1),ie=n}}function qe(e,t){if(ie)return e();let l=!1;t||(ie=[]),He?l=!0:He=[],vt++;try{const n=e();return bc(l),n}catch(n){l||(He=null),ie=null,Yn(n)}}function bc(e){if(ie&&(Vn(ie),ie=null),e)return;const t=He;He=null,t.length&&qe(()=>Cn(t),!1)}function Vn(e){for(let t=0;t=0;t--)St(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function mc(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Yn(e,t=T){throw mc(e)}function rl(e){if(typeof e=="function"&&!e.length)return rl(e());if(Array.isArray(e)){const t=[];for(let l=0;lc=D(()=>(T.context={...T.context,[e]:n.value},fn(()=>n.children))),void 0),c}}const hc=Symbol("fallback");function Jl(e){for(let t=0;t1?[]:null;return _e(()=>Jl(i)),()=>{let r=e()||[],C,u;return r[sl],D(()=>{let Y=r.length,X,M,O,b,j,k,z,$,w;if(Y===0)s!==0&&(Jl(i),i=[],n=[],c=[],s=0,a&&(a=[])),l.fallback&&(n=[hc],c[0]=Te(be=>(i[0]=be,l.fallback())),s=1);else if(s===0){for(c=new Array(Y),u=0;u=k&&$>=k&&n[z]===r[$];z--,$--)O[$]=c[z],b[$]=i[z],a&&(j[$]=a[z]);for(X=new Map,M=new Array($+1),u=$;u>=k;u--)w=r[u],C=X.get(w),M[u]=C===void 0?-1:C,X.set(w,u);for(C=k;C<=z;C++)w=n[C],u=X.get(w),u!==void 0&&u!==-1?(O[u]=c[C],b[u]=i[C],a&&(j[u]=a[C]),u=M[u],X.set(w,u)):i[C]();for(u=k;ue(t||{}))}function Gt(){return!0}const Bl={get(e,t,l){return t===Re?l:e.get(t)},has(e,t){return t===Re?!0:e.has(t)},set:Gt,deleteProperty:Gt,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Gt,deleteProperty:Gt}},ownKeys(e){return e.keys()}};function Cc(e,...t){if(Re in e){const c=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Bl));return i.push(new Proxy({get(s){return c.has(s)?void 0:e[s]},has(s){return c.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!c.has(s))}},Bl)),i}const l={},n=t.map(()=>({}));for(const c of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,c),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,r=0;for(const C of t)C.includes(c)&&(a=!0,s?n[r][c]=i.value:Object.defineProperty(n[r],c,i)),++r;a||(s?l[c]=i.value:Object.defineProperty(l,c,i))}return[...n,l]}const xn=e=>`Stale read from <${e}>.`;function yn(e){const t="fallback"in e&&{fallback:()=>e.fallback};return le(Ic(()=>e.each,e.children,t||void 0))}function Rt(e){const t=e.keyed,l=le(()=>e.when,void 0,{equals:(n,c)=>t?n===c:!n==!c});return le(()=>{const n=l();if(n){const c=e.children;return typeof c=="function"&&c.length>0?D(()=>c(t?n:()=>{if(!D(l))throw xn("Show");return e.when})):c}return e.fallback},void 0,void 0)}function Wc(e){let t=!1;const l=(i,s)=>(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],n=fn(()=>e.children),c=le(()=>{let i=n();Array.isArray(i)||(i=[i]);for(let s=0;s{const[i,s,a]=c();if(i<0)return e.fallback;const r=a.children;return typeof r=="function"&&r.length>0?D(()=>r(t?s:()=>{if(D(c)[0]!==i)throw xn("Match");return a.when})):r},void 0,void 0)}function Fl(e){return e}const pc=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],fc=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...pc]),Xc=new Set(["innerHTML","textContent","innerText","children"]),Rc=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Vc=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function Ac(e,t){const l=Vc[e];return typeof l=="object"?l[t]?l.$:void 0:l}const Yc=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),xc=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),yc={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Jc(e,t,l){let n=l.length,c=t.length,i=n,s=0,a=0,r=t[c-1].nextSibling,C=null;for(;su-a){const M=t[s];for(;a{const s=document.createElement("template");return s.innerHTML=e,s.content.firstChild},i=()=>(n||(n=c())).cloneNode(!0);return i.cloneNode=i,i}function ml(e,t=window.document){const l=t[Hl]||(t[Hl]=new Set);for(let n=0,c=e.length;nc.call(e,l[1],i))}else e.addEventListener(t,l)}function Fc(e,t,l={}){const n=Object.keys(t||{}),c=Object.keys(l);let i,s;for(i=0,s=c.length;ic.children=dt(e,t.children,c.children)),ne(()=>typeof t.ref=="function"?kt(t.ref,e):t.ref=e),ne(()=>Nc(e,t,l,!0,c,!0)),c}function kt(e,t,l){return D(()=>e(t,l))}function se(e,t,l,n){if(l!==void 0&&!n&&(n=[]),typeof t!="function")return dt(e,t,n,l);ne(c=>dt(e,t(),c,l),n)}function Nc(e,t,l,n,c={},i=!1){t||(t={});for(const s in c)if(!(s in t)){if(s==="children")continue;c[s]=vl(e,s,null,c[s],l,i)}for(const s in t){if(s==="children")continue;const a=t[s];c[s]=vl(e,s,a,c[s],l,i)}}function vc(e){return e.toLowerCase().replace(/-([a-z])/g,(t,l)=>l.toUpperCase())}function Nl(e,t,l){const n=t.trim().split(/\s+/);for(let c=0,i=n.length;c-1&&yc[t.split(":")[0]];h?Bc(e,h,t,l):Ne(e,Rc[t]||t,l)}return l}function Sc(e){const t=`$$${e.type}`;let l=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==l&&Object.defineProperty(e,"target",{configurable:!0,value:l}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return l||document}});l;){const n=l[t];if(n&&!l.disabled){const c=l[`${t}Data`];if(c!==void 0?n.call(l,c,e):n.call(l,e),e.cancelBubble)return}l=l._$host||l.parentNode||l.host}}function dt(e,t,l,n,c){for(;typeof l=="function";)l=l();if(t===l)return l;const i=typeof t,s=n!==void 0;if(e=s&&l[0]&&l[0].parentNode||e,i==="string"||i==="number")if(i==="number"&&(t=t.toString()),s){let a=l[0];a&&a.nodeType===3?a.data!==t&&(a.data=t):a=document.createTextNode(t),l=Ue(e,l,n,a)}else l!==""&&typeof l=="string"?l=e.firstChild.data=t:l=e.textContent=t;else if(t==null||i==="boolean")l=Ue(e,l,n);else{if(i==="function")return ne(()=>{let a=t();for(;typeof a=="function";)a=a();l=dt(e,a,l,n)}),()=>l;if(Array.isArray(t)){const a=[],r=l&&Array.isArray(l);if(ol(a,t,l,c))return ne(()=>l=dt(e,a,l,n,!0)),()=>l;if(a.length===0){if(l=Ue(e,l,n),s)return l}else r?l.length===0?Sl(e,a,n):Jc(e,l,a):(l&&Ue(e),Sl(e,a));l=a}else if(t.nodeType){if(Array.isArray(l)){if(s)return l=Ue(e,l,n,t);Ue(e,l,null,t)}else l==null||l===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);l=t}}return l}function ol(e,t,l,n){let c=!1;for(let i=0,s=t.length;i=0;s--){const a=t[s];if(c!==a){const r=a.parentNode===e;!i&&!s?r?e.replaceChild(c,a):e.insertBefore(c,l):r&&a.remove()}else i=!0}}else e.insertBefore(c,l);return[c]}const kc="http://www.w3.org/2000/svg";function wc(e,t=!1){return t?document.createElementNS(kc,e):document.createElement(e)}function Ec(e){const[t,l]=Cc(e,["component"]),n=le(()=>t.component);return le(()=>{const c=n();switch(typeof c){case"function":return D(()=>c(l));case"string":const i=xc.has(c),s=wc(c,i);return Hc(s,l,i),s}})}/** - * @license - * Copyright (c) 2016, Contributors - * SPDX-License-Identifier: ISC - */function ct(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let l="",n=!1;const c=e.match(/^-+/);for(let i=c?c[0].length:0;i0?n+=`${t}${l.charAt(c)}`:n+=s}return n}function Fn(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}/** - * @license - * Copyright (c) 2016, Contributors - * SPDX-License-Identifier: ISC - */function Kc(e){if(Array.isArray(e))return e.map(s=>typeof s!="string"?s+"":s);e=e.trim();let t=0,l=null,n=null,c=null;const i=[];for(let s=0;s{typeof g=="number"&&(b.nargs[o]=g,b.keys.push(o))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([o,g])=>{typeof g=="function"&&(b.coercions[o]=g,b.keys.push(o))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(o){b.configs[o]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([o,g])=>{(typeof g=="boolean"||typeof g=="function")&&(b.configs[o]=g)})),te(n.key,s,n.default,b.arrays),Object.keys(r).forEach(function(o){(b.aliases[o]||[]).forEach(function(g){r[g]=r[o]})});let z=null;ec();let $=[];const w=Object.assign(Object.create(null),{_:[]}),be={};for(let o=0;o=3&&(V(A[1],b.arrays)?o=f(o,A[1],c,A[2]):V(A[1],b.nargs)!==!1?o=p(o,A[1],c,A[2]):R(A[1],A[2],!0));else if(g.match(k)&&a["boolean-negation"])A=g.match(k),A!==null&&Array.isArray(A)&&A.length>=2&&(d=A[1],R(d,V(d,b.arrays)?[!1]:!1));else if(g.match(/^--.+/)||!a["short-option-groups"]&&g.match(/^-[^-]+/))A=g.match(/^--?(.+)/),A!==null&&Array.isArray(A)&&A.length>=2&&(d=A[1],V(d,b.arrays)?o=f(o,d,c):V(d,b.nargs)!==!1?o=p(o,d,c):(J=c[o+1],J!==void 0&&(!J.match(/^-/)||J.match(j))&&!V(d,b.bools)&&!V(d,b.counts)||/^(true|false)$/.test(J)?(R(d,J),o++):R(d,ze(d))));else if(g.match(/^-.\..+=/))A=g.match(/^-([^=]+)=([\s\S]*)$/),A!==null&&Array.isArray(A)&&A.length>=3&&R(A[1],A[2]);else if(g.match(/^-.\..+/)&&!g.match(j))J=c[o+1],A=g.match(/^-(.\..+)/),A!==null&&Array.isArray(A)&&A.length>=2&&(d=A[1],J!==void 0&&!J.match(/^-/)&&!V(d,b.bools)&&!V(d,b.counts)?(R(d,J),o++):R(d,ze(d)));else if(g.match(/^-[^-]+/)&&!g.match(j)){y=g.slice(1,-1).split(""),Z=!1;for(let ae=0;aeo!=="--"&&o.includes("-")).forEach(o=>{delete w[o]}),a["strip-aliased"]&&[].concat(...Object.keys(s).map(o=>s[o])).forEach(o=>{a["camel-case-expansion"]&&o.includes("-")&&delete w[o.split(".").map(g=>ct(g)).join(".")],delete w[o]});function Ze(o){const g=I("_",o);(typeof g=="string"||typeof g=="number")&&w._.push(g)}function p(o,g,W,Z){let d,y=V(g,b.nargs);if(y=typeof y!="number"||isNaN(y)?1:y,y===0)return Ae(Z)||(z=Error(O("Argument unexpected for: %s",g))),R(g,ze(g)),o;let A=Ae(Z)?0:1;if(a["nargs-eats-options"])W.length-(o+1)+A0&&(R(g,Z),J--),d=o+1;d0||A&&typeof A=="number"&&d.length>=A||(y=W[J],/^-/.test(y)&&!j.test(y)&&!Qe(y)));J++)o=J,d.push(_(g,y,i))}return typeof A=="number"&&(A&&d.length1&&a["dot-notation"]&&(b.aliases[d[0]]||[]).forEach(function(y){let A=y.split(".");const J=[].concat(d);J.shift(),A=A.concat(J),(b.aliases[o]||[]).includes(A.join("."))||K(w,A,Z)}),V(o,b.normalize)&&!V(o,b.arrays)&&[o].concat(b.aliases[o]||[]).forEach(function(A){Object.defineProperty(be,A,{enumerable:!0,get(){return g},set(J){g=typeof J=="string"?Ye.normalize(J):J}})})}function N(o,g){b.aliases[o]&&b.aliases[o].length||(b.aliases[o]=[g],X[g]=!0),b.aliases[g]&&b.aliases[g].length||N(g,o)}function _(o,g,W){W&&(g=Uc(g)),(V(o,b.bools)||V(o,b.counts))&&typeof g=="string"&&(g=g==="true");let Z=Array.isArray(g)?g.map(function(d){return I(o,d)}):I(o,g);return V(o,b.counts)&&(Ae(Z)||typeof Z=="boolean")&&(Z=Lt()),V(o,b.normalize)&&V(o,b.arrays)&&(Array.isArray(g)?Z=g.map(d=>Ye.normalize(d)):Z=Ye.normalize(g)),Z}function I(o,g){return!a["parse-positional-numbers"]&&o==="_"||!V(o,b.strings)&&!V(o,b.bools)&&!Array.isArray(g)&&(Fn(g)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${g}`)))||!Ae(g)&&V(o,b.numbers))&&(g=Number(g)),g}function m(o){const g=Object.create(null);E(g,b.aliases,r),Object.keys(b.configs).forEach(function(W){const Z=o[W]||g[W];if(Z)try{let d=null;const y=Ye.resolve(Ye.cwd(),Z),A=b.configs[W];if(typeof A=="function"){try{d=A(y)}catch(J){d=J}if(d instanceof Error){z=d;return}}else d=Ye.require(y);H(d)}catch(d){d.name==="PermissionDenied"?z=d:o[W]&&(z=Error(O("Invalid JSON config file: %s",Z)))}})}function H(o,g){Object.keys(o).forEach(function(W){const Z=o[W],d=g?g+"."+W:W;typeof Z=="object"&&Z!==null&&!Array.isArray(Z)&&a["dot-notation"]?H(Z,d):(!S(w,d.split("."))||V(d,b.arrays)&&a["combine-arrays"])&&R(d,Z)})}function B(){typeof C<"u"&&C.forEach(function(o){H(o)})}function F(o,g){if(typeof u>"u")return;const W=typeof u=="string"?u:"",Z=Ye.env();Object.keys(Z).forEach(function(d){if(W===""||d.lastIndexOf(W,0)===0){const y=d.split("__").map(function(A,J){return J===0&&(A=A.substring(W.length)),ct(A)});(g&&b.configs[y.join(".")]||!g)&&!S(o,y)&&R(y.join("."),Z[d])}})}function x(o){let g;const W=new Set;Object.keys(o).forEach(function(Z){if(!W.has(Z)&&(g=V(Z,b.coercions),typeof g=="function"))try{const d=I(Z,g(o[Z]));[].concat(b.aliases[Z]||[],Z).forEach(y=>{W.add(y),o[y]=d})}catch(d){z=d}})}function v(o){return b.keys.forEach(g=>{~g.indexOf(".")||typeof o[g]>"u"&&(o[g]=void 0)}),o}function E(o,g,W,Z=!1){Object.keys(W).forEach(function(d){S(o,d.split("."))||(K(o,d.split("."),W[d]),Z&&(M[d]=!0),(g[d]||[]).forEach(function(y){S(o,y.split("."))||K(o,y.split("."),W[d])}))})}function S(o,g){let W=o;a["dot-notation"]||(g=[g.join(".")]),g.slice(0,-1).forEach(function(d){W=W[d]||{}});const Z=g[g.length-1];return typeof W!="object"?!1:Z in W}function K(o,g,W){let Z=o;a["dot-notation"]||(g=[g.join(".")]),g.slice(0,-1).forEach(function(q){q=kl(q),typeof Z=="object"&&Z[q]===void 0&&(Z[q]={}),typeof Z[q]!="object"||Array.isArray(Z[q])?(Array.isArray(Z[q])?Z[q].push({}):Z[q]=[Z[q],{}],Z=Z[q][Z[q].length-1]):Z=Z[q]});const d=kl(g[g.length-1]),y=V(g.join("."),b.arrays),A=Array.isArray(W);let J=a["duplicate-arguments-array"];!J&&V(d,b.nargs)&&(J=!0,(!Ae(Z[d])&&b.nargs[d]===1||Array.isArray(Z[d])&&Z[d].length===b.nargs[d])&&(Z[d]=void 0)),W===Lt()?Z[d]=Lt(Z[d]):Array.isArray(Z[d])?J&&y&&A?Z[d]=a["flatten-duplicate-arrays"]?Z[d].concat(W):(Array.isArray(Z[d][0])?Z[d]:[Z[d]]).concat([W]):!J&&!!y==!!A?Z[d]=W:Z[d]=Z[d].concat([W]):Z[d]===void 0&&y?Z[d]=A?W:[W]:J&&!(Z[d]===void 0||V(d,b.counts)||V(d,b.bools))?Z[d]=[Z[d],W]:Z[d]=W}function te(...o){o.forEach(function(g){Object.keys(g||{}).forEach(function(W){b.aliases[W]||(b.aliases[W]=[].concat(s[W]||[]),b.aliases[W].concat(W).forEach(function(Z){if(/-/.test(Z)&&a["camel-case-expansion"]){const d=ct(Z);d!==W&&b.aliases[W].indexOf(d)===-1&&(b.aliases[W].push(d),X[d]=!0)}}),b.aliases[W].concat(W).forEach(function(Z){if(Z.length>1&&/[A-Z]/.test(Z)&&a["camel-case-expansion"]){const d=Bn(Z,"-");d!==W&&b.aliases[W].indexOf(d)===-1&&(b.aliases[W].push(d),X[d]=!0)}}),b.aliases[W].forEach(function(Z){b.aliases[Z]=[W].concat(b.aliases[W].filter(function(d){return Z!==d}))}))})})}function V(o,g){const W=[].concat(b.aliases[o]||[],o),Z=Object.keys(g),d=W.find(y=>Z.includes(y));return d?g[d]:!1}function Ge(o){const g=Object.keys(b);return[].concat(g.map(Z=>b[Z])).some(function(Z){return Array.isArray(Z)?Z.includes(o):Z[o]})}function ce(o,...g){return[].concat(...g).some(function(Z){const d=o.match(Z);return d&&Ge(d[1])})}function Ve(o){if(o.match(j)||!o.match(/^-[^-]+/))return!1;let g=!0,W;const Z=o.slice(1).split("");for(let d=0;dV(o,b.arrays)?(z=Error(O("Invalid configuration: %s, opts.count excludes opts.array.",o)),!0):V(o,b.nargs)?(z=Error(O("Invalid configuration: %s, opts.count excludes opts.narg.",o)),!0):!1)}return{aliases:Object.assign({},b.aliases),argv:Object.assign(be,w),configuration:a,defaulted:Object.assign({},M),error:z,newAliases:Object.assign({},X)}}}function zc(e){const t=[],l=Object.create(null);let n=!0;for(Object.keys(e).forEach(function(c){t.push([].concat(e[c],c))});n;){n=!1;for(let c=0;cjc,format:lc.format,normalize:de.normalize,resolve:de.resolve,require:e=>{if(typeof require<"u")return require(e);if(e.match(/\.json$/))return JSON.parse(Gn.readFileSync(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),Zt=function(t,l){return Hn.parse(t.slice(),l).argv};Zt.detailed=function(e,t){return Hn.parse(e.slice(),t)};Zt.camelCase=ct;Zt.decamelize=Bn;Zt.looksLikeNumber=Fn;const Lc={exportToOo:"导出为......",exportWithPrevious:"使用上一次设置导出",exportSuccessNotice:L`导出文件 ${0} 成功!`,exportCommandOutputMessage:L`命令:${0}`,exportErrorOutputMessage:L`命令 ${0},错误:${1}`,pleaseOpenFile:"请打开一个文件先。",preparing:L`正在生成 "${0}" ......`,exportDialog:{fileName:"文件名",type:"类型",exportTo:"导出到",title:L`导出为 ${0}`,export:"导出",selectExportFolder:"请选择导出文件夹",overwriteConfirmation:"覆盖提示"},messageBox:{yes:"是",no:"否",ok:"确认",cancel:"取消"},overwriteConfirmationDialog:{replace:"替换",title:L`"${0}" 已经存在。您要替换它吗?`,message:L`"${0}" 文件夹中已有相同的文件或文件夹,若替换,则会覆盖其当前内容。`},settingTab:{title:"导出设置",general:"通用",name:"名称",customLocation:"自定义",pandocVersion:L`版本: ${0}`,pandocVersionWithWarning:L`Version: ${0}, 请升级版本到 ${1}`,pandocNotFound:"找不到 Pandoc,请填写 Pandoc 文件路径,或者将其添加到系统环境变量中。",pandocPath:"Pandoc 路径",defaultFolderForExportedFile:"默认的导出文件夹",openExportedFileLocation:"打开导出文件所在目录",sameFolderWithCurrentFile:"与原文件同一目录下",openExportedFile:"打开导出文件",pandocPathPlaceholder:"(自动检测)",editCommandTemplate:"编辑命令模板",chooseCommandTemplate:"选择模板",afterExport:"导出后",command:"命令",arguments:"参数",auto:"自动",reset:"重置",add:"添加",remove:"移除",rename:"重命名",targetFileExtensions:"目标文件扩展名",targetFileExtensionsTip:"(用空格分开)",showCommandOutput:"显示命令行输出",runCommand:"运行自定义命令",extraArguments:"自定义参数",save:"保存",new:"新建",template:"模板",advanced:"高级",environmentVariables:"环境变量",environmentVariablesDesc:"定义导出的环境变量.",ShowExportProgressBar:"显示导出进度条"}},Tc={exportToOo:"Export to...",exportSuccessNotice:L`Export file ${0} success!`,exportCommandOutputMessage:L`Command: ${0}`,exportErrorOutputMessage:L`Command: ${0},Error:${1}`,exportWithPrevious:"Export with Previous",pleaseOpenFile:"Please open a file first.",preparing:L`generating "${0}"...`,exportDialog:{exportTo:"Export to",fileName:"File Name",title:L`Export to ${0}`,export:"Export",selectExportFolder:"Please select an export folder.",overwriteConfirmation:"Overwrite confirmation",type:"Type"},messageBox:{yes:"Yes",no:"No",ok:"Ok",cancel:"Cancel"},overwriteConfirmationDialog:{replace:"Replace",title:L`"${0}" already exists. Do you want to replace it?`,message:L`A file or folder with the same name already exists in the folder "${0}". Replacing it will overwrite its current contents.`},settingTab:{general:"General",name:"Name",title:"Export Settings",pandocVersion:L`Version: ${0}`,pandocVersionWithWarning:L`Version: ${0}, please upgrade version to ${1}`,pandocNotFound:"Pandoc not found, please fill in the Pandoc file path, or add it to the system environment variables.",defaultFolderForExportedFile:"Default Folder for Exported File",openExportedFileLocation:"Open exported file location",ShowExportProgressBar:"Show export progress bar",openExportedFile:"Open exported file",pandocPath:"Pandoc path",pandocPathPlaceholder:"(Auto Detect)",editCommandTemplate:"Edit Command Template",chooseCommandTemplate:"Choose template",customLocation:"Custom location",template:"Template",command:"Command",reset:"Reset",auto:"Auto",add:"Add",remove:"Remove",rename:"Rename",sameFolderWithCurrentFile:"Same folder with current file",afterExport:"After Export",targetFileExtensions:"Target file extensions",targetFileExtensionsTip:"(Separated by whitespace)",showCommandOutput:"Show command output",runCommand:"Run command",extraArguments:"Extra arguments",save:"Save",new:"New",arguments:"Arguments",advanced:"Advanced",environmentVariables:"Environment Variables",environmentVariablesDesc:"Define the Environment Variables for exporting."}},$c={exportToOo:"Export to...",exportSuccessNotice:L`Export der Datei ${0} erfolgreich!`,exportCommandOutputMessage:L`Command: ${0}`,exportErrorOutputMessage:L`Command: ${0},Fehler:${1}`,exportWithPrevious:"Exportiere mit Vorherigem",pleaseOpenFile:"Bitte öffne zunächst eine Datei.",preparing:L`generating "${0}"...`,exportDialog:{exportTo:"Exportiere nach",fileName:"Dateiname",title:L`Export to ${0}`,export:"Export",selectExportFolder:"Zielordner auswählen",overwriteConfirmation:"Überschreibe den Zielordner",type:"Typ"},messageBox:{yes:"Ja",no:"Nein",ok:"Ok",cancel:"Abbrechen"},overwriteConfirmationDialog:{replace:"Ersetze",title:L`"${0}" existiert bereits. Soll er ersetzt werden?`,message:L`Eine Datei oder ein Ordner mit dem gleichen Namen existiert bereits im Ordner "${0}". Das Ersetzen wird die jetzigen Inhalte überschreiben.`},settingTab:{general:"Allgemein",name:"Name",title:"Export-Einstellungen",pandocVersion:L`Version: ${0}`,pandocVersionWithWarning:L`Version: ${0}, please upgrade version to ${1}`,pandocNotFound:"Pandoc.exe wurde nicht gefunden. Bitte geben Sie den Pfad zur Pandoc.exe ein oder fügen Sie ihn den Window Systemumgebungsvariablen hinzu.",defaultFolderForExportedFile:"Standardordner für exportierte Dateien",openExportedFileLocation:"Speicherort der exportierten Datei öffnen",openExportedFile:"Exportierte Datei öffnen",pandocPath:"Pfad zur Datei Pandoc.exe",pandocPathPlaceholder:"(Automatische Erkennung)",editCommandTemplate:"‘Befehlsvorlage bearbeiten",chooseCommandTemplate:"Vorlage auswählen",customLocation:"Benutzerdefinierter Speicherort",template:"Vorlage",command:"Befehl",reset:"Zurücksetzen",auto:"Auto",add:"Hinzufügen",remove:"Entfernen",rename:"Umbenennen",sameFolderWithCurrentFile:"Der gleiche Ordner mit der aktuellen Datei",afterExport:"Nach dem Export",targetFileExtensions:"Dateinamenserweiterung der Zieldatei",targetFileExtensionsTip:"(Mit Leerzeichen getrennt)",showCommandOutput:"Zeige die Ausgabe des Befehls",runCommand:"Starte den Befehl",extraArguments:"Zusätzliche Parameter",save:"Speichern",new:"Neu",arguments:"Parameter",advanced:"Advanced",environmentVariables:"Environment Variables",environmentVariablesDesc:"Define the Environment Variables for exporting.",ShowExportProgressBar:"Show export progressBar"}},Nn={"de-DE":$c,"en-US":Tc,"zh-CN":Lc,get current(){const e=Object.keys(this),t=We.moment.locale().toLowerCase();let l=e.find(c=>c.toLowerCase()===t.toLowerCase());if(l)return this[l];const n=t.split("-")[0];return l=e.find(c=>c.toLowerCase().startsWith(n)),l?this[l]:this["en-US"]}};class Kl extends We.Modal{constructor(t,l,n){super(t),this.options=typeof l=="string"?{message:l,buttons:"Ok",title:n}:l,this.lang=Nn.current}onOpen(){const{titleEl:t,contentEl:l,lang:n,options:{message:c,title:i,buttons:s,callback:a,buttonsLabel:r,buttonsClass:C}}=this;switch(i&&t.setText(i),l.createDiv({text:c}),s){case"Yes":l.createEl("div",{cls:["modal-button-container"],parent:l},u=>{u.createEl("button",{text:(r==null?void 0:r.yes)??n.messageBox.yes,cls:["mod-cta",C==null?void 0:C.yes],parent:u}).onclick=()=>this.call(a==null?void 0:a.yes)});break;case"YesNo":l.createEl("div",{cls:["modal-button-container"],parent:l},u=>{u.createEl("button",{text:(r==null?void 0:r.yes)??n.messageBox.yes,cls:["mod-cta",C==null?void 0:C.yes],parent:u}).onclick=()=>this.call(a==null?void 0:a.yes),u.createEl("button",{text:(r==null?void 0:r.no)??n.messageBox.no,cls:["mod-cta",C==null?void 0:C.no],parent:u}).onclick=()=>this.call(a==null?void 0:a.no)});break;case"Ok":l.createEl("div",{cls:["modal-button-container"],parent:l},u=>{u.createEl("button",{text:(r==null?void 0:r.ok)??n.messageBox.ok,cls:["mod-cta",C==null?void 0:C.no],parent:u}).onclick=()=>this.call(a==null?void 0:a.ok)});break;case"OkCancel":l.createEl("div",{cls:["modal-button-container"],parent:l},u=>{u.createEl("button",{text:(r==null?void 0:r.ok)??n.messageBox.ok,cls:["mod-cta",C==null?void 0:C.ok],parent:u}).onclick=()=>this.call(a==null?void 0:a.ok),u.createEl("button",{text:(r==null?void 0:r.cancel)??n.messageBox.cancel,cls:["mod-cta",C==null?void 0:C.cancel],parent:u}).onclick=()=>this.call(a==null?void 0:a.cancel)});break}}call(t){t&&t(),this.close()}onClose(){const{contentEl:t}=this;t.empty()}}var Mc=me('
');const Oc=e=>(()=>{var t=Mc(),l=t.firstChild,n=e.ref;return typeof n=="function"?kt(n,t):e.ref=t,se(l,()=>e.message),t})(),Pc=e=>Te(t=>{let l=!1;const n=()=>{l||(l=!0,t())};let c;return se(document.body,()=>G(Oc,{ref(i){var s=c;typeof s=="function"?s(i):c=i},message:e})),_e(()=>{c instanceof Node&&document.body.contains(c)&&document.body.removeChild(c)}),n}),Dc={show:Pc};function _c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dl={exports:{}};const qc="2.0.0",ei=256,ti=Number.MAX_SAFE_INTEGER||9007199254740991,li=16,ni=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var wt={MAX_LENGTH:ei,MAX_SAFE_COMPONENT_LENGTH:li,MAX_SAFE_INTEGER:ti,RELEASE_TYPES:ni,SEMVER_SPEC_VERSION:qc,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const ci=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Et=ci;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:l}=wt,n=Et;t=e.exports={};const c=t.re=[],i=t.src=[],s=t.t={};let a=0;const r=(C,u,h)=>{const Y=a++;n(C,Y,u),s[C]=Y,i[Y]=u,c[Y]=new RegExp(u,h?"g":void 0)};r("NUMERICIDENTIFIER","0|[1-9]\\d*"),r("NUMERICIDENTIFIERLOOSE","[0-9]+"),r("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),r("MAINVERSION",`(${i[s.NUMERICIDENTIFIER]})\\.(${i[s.NUMERICIDENTIFIER]})\\.(${i[s.NUMERICIDENTIFIER]})`),r("MAINVERSIONLOOSE",`(${i[s.NUMERICIDENTIFIERLOOSE]})\\.(${i[s.NUMERICIDENTIFIERLOOSE]})\\.(${i[s.NUMERICIDENTIFIERLOOSE]})`),r("PRERELEASEIDENTIFIER",`(?:${i[s.NUMERICIDENTIFIER]}|${i[s.NONNUMERICIDENTIFIER]})`),r("PRERELEASEIDENTIFIERLOOSE",`(?:${i[s.NUMERICIDENTIFIERLOOSE]}|${i[s.NONNUMERICIDENTIFIER]})`),r("PRERELEASE",`(?:-(${i[s.PRERELEASEIDENTIFIER]}(?:\\.${i[s.PRERELEASEIDENTIFIER]})*))`),r("PRERELEASELOOSE",`(?:-?(${i[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[s.PRERELEASEIDENTIFIERLOOSE]})*))`),r("BUILDIDENTIFIER","[0-9A-Za-z-]+"),r("BUILD",`(?:\\+(${i[s.BUILDIDENTIFIER]}(?:\\.${i[s.BUILDIDENTIFIER]})*))`),r("FULLPLAIN",`v?${i[s.MAINVERSION]}${i[s.PRERELEASE]}?${i[s.BUILD]}?`),r("FULL",`^${i[s.FULLPLAIN]}$`),r("LOOSEPLAIN",`[v=\\s]*${i[s.MAINVERSIONLOOSE]}${i[s.PRERELEASELOOSE]}?${i[s.BUILD]}?`),r("LOOSE",`^${i[s.LOOSEPLAIN]}$`),r("GTLT","((?:<|>)?=?)"),r("XRANGEIDENTIFIERLOOSE",`${i[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),r("XRANGEIDENTIFIER",`${i[s.NUMERICIDENTIFIER]}|x|X|\\*`),r("XRANGEPLAIN",`[v=\\s]*(${i[s.XRANGEIDENTIFIER]})(?:\\.(${i[s.XRANGEIDENTIFIER]})(?:\\.(${i[s.XRANGEIDENTIFIER]})(?:${i[s.PRERELEASE]})?${i[s.BUILD]}?)?)?`),r("XRANGEPLAINLOOSE",`[v=\\s]*(${i[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[s.XRANGEIDENTIFIERLOOSE]})(?:${i[s.PRERELEASELOOSE]})?${i[s.BUILD]}?)?)?`),r("XRANGE",`^${i[s.GTLT]}\\s*${i[s.XRANGEPLAIN]}$`),r("XRANGELOOSE",`^${i[s.GTLT]}\\s*${i[s.XRANGEPLAINLOOSE]}$`),r("COERCE",`(^|[^\\d])(\\d{1,${l}})(?:\\.(\\d{1,${l}}))?(?:\\.(\\d{1,${l}}))?(?:$|[^\\d])`),r("COERCERTL",i[s.COERCE],!0),r("LONETILDE","(?:~>?)"),r("TILDETRIM",`(\\s*)${i[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",r("TILDE",`^${i[s.LONETILDE]}${i[s.XRANGEPLAIN]}$`),r("TILDELOOSE",`^${i[s.LONETILDE]}${i[s.XRANGEPLAINLOOSE]}$`),r("LONECARET","(?:\\^)"),r("CARETTRIM",`(\\s*)${i[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",r("CARET",`^${i[s.LONECARET]}${i[s.XRANGEPLAIN]}$`),r("CARETLOOSE",`^${i[s.LONECARET]}${i[s.XRANGEPLAINLOOSE]}$`),r("COMPARATORLOOSE",`^${i[s.GTLT]}\\s*(${i[s.LOOSEPLAIN]})$|^$`),r("COMPARATOR",`^${i[s.GTLT]}\\s*(${i[s.FULLPLAIN]})$|^$`),r("COMPARATORTRIM",`(\\s*)${i[s.GTLT]}\\s*(${i[s.LOOSEPLAIN]}|${i[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",r("HYPHENRANGE",`^\\s*(${i[s.XRANGEPLAIN]})\\s+-\\s+(${i[s.XRANGEPLAIN]})\\s*$`),r("HYPHENRANGELOOSE",`^\\s*(${i[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[s.XRANGEPLAINLOOSE]})\\s*$`),r("STAR","(<|>)?=?\\s*\\*"),r("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),r("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(dl,dl.exports);var mt=dl.exports;const ii=Object.freeze({loose:!0}),si=Object.freeze({}),ai=e=>e?typeof e!="object"?ii:e:si;var Il=ai;const Ql=/^[0-9]+$/,vn=(e,t)=>{const l=Ql.test(e),n=Ql.test(t);return l&&n&&(e=+e,t=+t),e===t?0:l&&!n?-1:n&&!l?1:evn(t,e);var Sn={compareIdentifiers:vn,rcompareIdentifiers:ri};const ht=Et,{MAX_LENGTH:zl,MAX_SAFE_INTEGER:It}=wt,{re:Ul,t:jl}=mt,oi=Il,{compareIdentifiers:je}=Sn;let di=class Xe{constructor(t,l){if(l=oi(l),t instanceof Xe){if(t.loose===!!l.loose&&t.includePrerelease===!!l.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>zl)throw new TypeError(`version is longer than ${zl} characters`);ht("SemVer",t,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const n=t.trim().match(l.loose?Ul[jl.LOOSE]:Ul[jl.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>It||this.major<0)throw new TypeError("Invalid major version");if(this.minor>It||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>It||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(c=>{if(/^[0-9]+$/.test(c)){const i=+c;if(i>=0&&i=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(l===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(c)}}if(l){let i=[l,c];n===!1&&(i=[l]),je(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.format(),this.raw=this.version,this}};var re=di;const Ll=re,gi=(e,t,l=!1)=>{if(e instanceof Ll)return e;try{return new Ll(e,t)}catch(n){if(!l)return null;throw n}};var et=gi;const ui=et,bi=(e,t)=>{const l=ui(e,t);return l?l.version:null};var Zi=bi;const mi=et,Gi=(e,t)=>{const l=mi(e.trim().replace(/^[=v]+/,""),t);return l?l.version:null};var hi=Gi;const Tl=re,Ii=(e,t,l,n,c)=>{typeof l=="string"&&(c=n,n=l,l=void 0);try{return new Tl(e instanceof Tl?e.version:e,l).inc(t,n,c).version}catch{return null}};var Ci=Ii;const $l=et,Wi=(e,t)=>{const l=$l(e,null,!0),n=$l(t,null,!0),c=l.compare(n);if(c===0)return null;const i=c>0,s=i?l:n,a=i?n:l,r=!!s.prerelease.length,C=r?"pre":"";return l.major!==n.major?C+"major":l.minor!==n.minor?C+"minor":l.patch!==n.patch?C+"patch":r?"prerelease":a.patch?"patch":a.minor?"minor":"major"};var pi=Wi;const fi=re,Xi=(e,t)=>new fi(e,t).major;var Ri=Xi;const Vi=re,Ai=(e,t)=>new Vi(e,t).minor;var Yi=Ai;const xi=re,yi=(e,t)=>new xi(e,t).patch;var Ji=yi;const Bi=et,Fi=(e,t)=>{const l=Bi(e,t);return l&&l.prerelease.length?l.prerelease:null};var Hi=Fi;const Ml=re,Ni=(e,t,l)=>new Ml(e,l).compare(new Ml(t,l));var pe=Ni;const vi=pe,Si=(e,t,l)=>vi(t,e,l);var ki=Si;const wi=pe,Ei=(e,t)=>wi(e,t,!0);var Ki=Ei;const Ol=re,Qi=(e,t,l)=>{const n=new Ol(e,l),c=new Ol(t,l);return n.compare(c)||n.compareBuild(c)};var Cl=Qi;const zi=Cl,Ui=(e,t)=>e.sort((l,n)=>zi(l,n,t));var ji=Ui;const Li=Cl,Ti=(e,t)=>e.sort((l,n)=>Li(n,l,t));var $i=Ti;const Mi=pe,Oi=(e,t,l)=>Mi(e,t,l)>0;var Kt=Oi;const Pi=pe,Di=(e,t,l)=>Pi(e,t,l)<0;var Wl=Di;const _i=pe,qi=(e,t,l)=>_i(e,t,l)===0;var kn=qi;const es=pe,ts=(e,t,l)=>es(e,t,l)!==0;var wn=ts;const ls=pe,ns=(e,t,l)=>ls(e,t,l)>=0;var pl=ns;const cs=pe,is=(e,t,l)=>cs(e,t,l)<=0;var fl=is;const ss=kn,as=wn,rs=Kt,os=pl,ds=Wl,gs=fl,us=(e,t,l,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof l=="object"&&(l=l.version),e===l;case"!==":return typeof e=="object"&&(e=e.version),typeof l=="object"&&(l=l.version),e!==l;case"":case"=":case"==":return ss(e,l,n);case"!=":return as(e,l,n);case">":return rs(e,l,n);case">=":return os(e,l,n);case"<":return ds(e,l,n);case"<=":return gs(e,l,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var En=us;const bs=re,Zs=et,{re:Ct,t:Wt}=mt,ms=(e,t)=>{if(e instanceof bs)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let l=null;if(!t.rtl)l=e.match(Ct[Wt.COERCE]);else{let n;for(;(n=Ct[Wt.COERCERTL].exec(e))&&(!l||l.index+l[0].length!==e.length);)(!l||n.index+n[0].length!==l.index+l[0].length)&&(l=n),Ct[Wt.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Ct[Wt.COERCERTL].lastIndex=-1}return l===null?null:Zs(`${l[2]}.${l[3]||"0"}.${l[4]||"0"}`,t)};var Gs=ms,Ot,Pl;function hs(){return Pl||(Pl=1,Ot=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Ot}var Is=U;U.Node=Ke;U.create=U;function U(e){var t=this;if(t instanceof U||(t=new U),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(c){t.push(c)});else if(arguments.length>0)for(var l=0,n=arguments.length;l1)l=t;else if(this.head)n=this.head.next,l=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var c=0;n!==null;c++)l=e(l,n.value,c),n=n.next;return l};U.prototype.reduceReverse=function(e,t){var l,n=this.tail;if(arguments.length>1)l=t;else if(this.tail)n=this.tail.prev,l=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var c=this.length-1;n!==null;c--)l=e(l,n.value,c),n=n.prev;return l};U.prototype.toArray=function(){for(var e=new Array(this.length),t=0,l=this.head;l!==null;t++)e[t]=l.value,l=l.next;return e};U.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,l=this.tail;l!==null;t++)e[t]=l.value,l=l.prev;return e};U.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var l=new U;if(tthis.length&&(t=this.length);for(var n=0,c=this.head;c!==null&&nthis.length&&(t=this.length);for(var n=this.length,c=this.tail;c!==null&&n>t;n--)c=c.prev;for(;c!==null&&n>e;n--,c=c.prev)l.push(c.value);return l};U.prototype.splice=function(e,t,...l){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,c=this.head;c!==null&&n1;class Xs{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[we]=t.max||1/0;const l=t.length||Pt;if(this[Le]=typeof l!="function"?Pt:l,this[at]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Ee]=t.maxAge||0,this[xe]=t.dispose,this[Dl]=t.noDisposeOnSet||!1,this[Kn]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[we]=t||1/0,lt(this)}get max(){return this[we]}set allowStale(t){this[at]=!!t}get allowStale(){return this[at]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Ee]=t,lt(this)}get maxAge(){return this[Ee]}set lengthCalculator(t){typeof t!="function"&&(t=Pt),t!==this[Le]&&(this[Le]=t,this[ye]=0,this[ee].forEach(l=>{l.length=this[Le](l.value,l.key),this[ye]+=l.length})),lt(this)}get lengthCalculator(){return this[Le]}get length(){return this[ye]}get itemCount(){return this[ee].length}rforEach(t,l){l=l||this;for(let n=this[ee].tail;n!==null;){const c=n.prev;_l(this,t,n,l),n=c}}forEach(t,l){l=l||this;for(let n=this[ee].head;n!==null;){const c=n.next;_l(this,t,n,l),n=c}}keys(){return this[ee].toArray().map(t=>t.key)}values(){return this[ee].toArray().map(t=>t.value)}reset(){this[xe]&&this[ee]&&this[ee].length&&this[ee].forEach(t=>this[xe](t.key,t.value)),this[Ie]=new Map,this[ee]=new fs,this[ye]=0}dump(){return this[ee].map(t=>Jt(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[ee]}set(t,l,n){if(n=n||this[Ee],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const c=n?Date.now():0,i=this[Le](l,t);if(this[Ie].has(t)){if(i>this[we])return $e(this,this[Ie].get(t)),!1;const r=this[Ie].get(t).value;return this[xe]&&(this[Dl]||this[xe](t,r.value)),r.now=c,r.maxAge=n,r.value=l,this[ye]+=i-r.length,r.length=i,this.get(t),lt(this),!0}const s=new Rs(t,l,i,c,n);return s.length>this[we]?(this[xe]&&this[xe](t,l),!1):(this[ye]+=s.length,this[ee].unshift(s),this[Ie].set(t,this[ee].head),lt(this),!0)}has(t){if(!this[Ie].has(t))return!1;const l=this[Ie].get(t).value;return!Jt(this,l)}get(t){return Dt(this,t,!0)}peek(t){return Dt(this,t,!1)}pop(){const t=this[ee].tail;return t?($e(this,t),t.value):null}del(t){$e(this,this[Ie].get(t))}load(t){this.reset();const l=Date.now();for(let n=t.length-1;n>=0;n--){const c=t[n],i=c.e||0;if(i===0)this.set(c.k,c.v);else{const s=i-l;s>0&&this.set(c.k,c.v,s)}}}prune(){this[Ie].forEach((t,l)=>Dt(this,l,!1))}}const Dt=(e,t,l)=>{const n=e[Ie].get(t);if(n){const c=n.value;if(Jt(e,c)){if($e(e,n),!e[at])return}else l&&(e[Kn]&&(n.value.now=Date.now()),e[ee].unshiftNode(n));return c.value}},Jt=(e,t)=>{if(!t||!t.maxAge&&!e[Ee])return!1;const l=Date.now()-t.now;return t.maxAge?l>t.maxAge:e[Ee]&&l>e[Ee]},lt=e=>{if(e[ye]>e[we])for(let t=e[ee].tail;e[ye]>e[we]&&t!==null;){const l=t.prev;$e(e,t),t=l}},$e=(e,t)=>{if(t){const l=t.value;e[xe]&&e[xe](l.key,l.value),e[ye]-=l.length,e[Ie].delete(l.key),e[ee].removeNode(t)}};class Rs{constructor(t,l,n,c,i){this.key=t,this.value=l,this.length=n,this.now=c,this.maxAge=i||0}}const _l=(e,t,l,n)=>{let c=l.value;Jt(e,c)&&($e(e,l),e[at]||(c=void 0)),c&&t.call(n,c.value,c.key,e)};var Vs=Xs,_t,ql;function fe(){if(ql)return _t;ql=1;class e{constructor(m,H){if(H=n(H),m instanceof e)return m.loose===!!H.loose&&m.includePrerelease===!!H.includePrerelease?m:new e(m.raw,H);if(m instanceof c)return this.raw=m.value,this.set=[[m]],this.format(),this;if(this.options=H,this.loose=!!H.loose,this.includePrerelease=!!H.includePrerelease,this.raw=m,this.set=m.split("||").map(B=>this.parseRange(B.trim())).filter(B=>B.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${m}`);if(this.set.length>1){const B=this.set[0];if(this.set=this.set.filter(F=>!M(F[0])),this.set.length===0)this.set=[B];else if(this.set.length>1){for(const F of this.set)if(F.length===1&&O(F[0])){this.set=[F];break}}}this.format()}format(){return this.range=this.set.map(m=>m.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(m){m=m.trim();const B=((this.options.includePrerelease&&Y)|(this.options.loose&&X))+":"+m,F=l.get(B);if(F)return F;const x=this.options.loose,v=x?a[r.HYPHENRANGELOOSE]:a[r.HYPHENRANGE];m=m.replace(v,N(this.options.includePrerelease)),i("hyphen replace",m),m=m.replace(a[r.COMPARATORTRIM],C),i("comparator trim",m),m=m.replace(a[r.TILDETRIM],u),m=m.replace(a[r.CARETTRIM],h),m=m.split(/\s+/).join(" ");let E=m.split(" ").map(V=>j(V,this.options)).join(" ").split(/\s+/).map(V=>R(V,this.options));x&&(E=E.filter(V=>(i("loose invalid filter",V,this.options),!!V.match(a[r.COMPARATORLOOSE])))),i("range list",E);const S=new Map,K=E.map(V=>new c(V,this.options));for(const V of K){if(M(V))return[V];S.set(V.value,V)}S.size>1&&S.has("")&&S.delete("");const te=[...S.values()];return l.set(B,te),te}intersects(m,H){if(!(m instanceof e))throw new TypeError("a Range is required");return this.set.some(B=>b(B,H)&&m.set.some(F=>b(F,H)&&B.every(x=>F.every(v=>x.intersects(v,H)))))}test(m){if(!m)return!1;if(typeof m=="string")try{m=new s(m,this.options)}catch{return!1}for(let H=0;HI.value==="<0.0.0-0",O=I=>I.value==="",b=(I,m)=>{let H=!0;const B=I.slice();let F=B.pop();for(;H&&B.length;)H=B.every(x=>F.intersects(x,m)),F=B.pop();return H},j=(I,m)=>(i("comp",I,m),I=w(I,m),i("caret",I),I=z(I,m),i("tildes",I),I=Ze(I,m),i("xrange",I),I=f(I,m),i("stars",I),I),k=I=>!I||I.toLowerCase()==="x"||I==="*",z=(I,m)=>I.trim().split(/\s+/).map(H=>$(H,m)).join(" "),$=(I,m)=>{const H=m.loose?a[r.TILDELOOSE]:a[r.TILDE];return I.replace(H,(B,F,x,v,E)=>{i("tilde",I,B,F,x,v,E);let S;return k(F)?S="":k(x)?S=`>=${F}.0.0 <${+F+1}.0.0-0`:k(v)?S=`>=${F}.${x}.0 <${F}.${+x+1}.0-0`:E?(i("replaceTilde pr",E),S=`>=${F}.${x}.${v}-${E} <${F}.${+x+1}.0-0`):S=`>=${F}.${x}.${v} <${F}.${+x+1}.0-0`,i("tilde return",S),S})},w=(I,m)=>I.trim().split(/\s+/).map(H=>be(H,m)).join(" "),be=(I,m)=>{i("caret",I,m);const H=m.loose?a[r.CARETLOOSE]:a[r.CARET],B=m.includePrerelease?"-0":"";return I.replace(H,(F,x,v,E,S)=>{i("caret",I,F,x,v,E,S);let K;return k(x)?K="":k(v)?K=`>=${x}.0.0${B} <${+x+1}.0.0-0`:k(E)?x==="0"?K=`>=${x}.${v}.0${B} <${x}.${+v+1}.0-0`:K=`>=${x}.${v}.0${B} <${+x+1}.0.0-0`:S?(i("replaceCaret pr",S),x==="0"?v==="0"?K=`>=${x}.${v}.${E}-${S} <${x}.${v}.${+E+1}-0`:K=`>=${x}.${v}.${E}-${S} <${x}.${+v+1}.0-0`:K=`>=${x}.${v}.${E}-${S} <${+x+1}.0.0-0`):(i("no pr"),x==="0"?v==="0"?K=`>=${x}.${v}.${E}${B} <${x}.${v}.${+E+1}-0`:K=`>=${x}.${v}.${E}${B} <${x}.${+v+1}.0-0`:K=`>=${x}.${v}.${E} <${+x+1}.0.0-0`),i("caret return",K),K})},Ze=(I,m)=>(i("replaceXRanges",I,m),I.split(/\s+/).map(H=>p(H,m)).join(" ")),p=(I,m)=>{I=I.trim();const H=m.loose?a[r.XRANGELOOSE]:a[r.XRANGE];return I.replace(H,(B,F,x,v,E,S)=>{i("xRange",I,B,F,x,v,E,S);const K=k(x),te=K||k(v),V=te||k(E),Ge=V;return F==="="&&Ge&&(F=""),S=m.includePrerelease?"-0":"",K?F===">"||F==="<"?B="<0.0.0-0":B="*":F&&Ge?(te&&(v=0),E=0,F===">"?(F=">=",te?(x=+x+1,v=0,E=0):(v=+v+1,E=0)):F==="<="&&(F="<",te?x=+x+1:v=+v+1),F==="<"&&(S="-0"),B=`${F+x}.${v}.${E}${S}`):te?B=`>=${x}.0.0${S} <${+x+1}.0.0-0`:V&&(B=`>=${x}.${v}.0${S} <${x}.${+v+1}.0-0`),i("xRange return",B),B})},f=(I,m)=>(i("replaceStars",I,m),I.trim().replace(a[r.STAR],"")),R=(I,m)=>(i("replaceGTE0",I,m),I.trim().replace(a[m.includePrerelease?r.GTE0PRE:r.GTE0],"")),N=I=>(m,H,B,F,x,v,E,S,K,te,V,Ge,ce)=>(k(B)?H="":k(F)?H=`>=${B}.0.0${I?"-0":""}`:k(x)?H=`>=${B}.${F}.0${I?"-0":""}`:v?H=`>=${H}`:H=`>=${H}${I?"-0":""}`,k(K)?S="":k(te)?S=`<${+K+1}.0.0-0`:k(V)?S=`<${K}.${+te+1}.0-0`:Ge?S=`<=${K}.${te}.${V}-${Ge}`:I?S=`<${K}.${te}.${+V+1}-0`:S=`<=${S}`,`${H} ${S}`.trim()),_=(I,m,H)=>{for(let B=0;B0){const F=I[B].semver;if(F.major===m.major&&F.minor===m.minor&&F.patch===m.patch)return!0}return!1}return!0};return _t}var qt,en;function Qt(){if(en)return qt;en=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,h){if(h=l(h),u instanceof t){if(u.loose===!!h.loose)return u;u=u.value}s("comparator",u,h),this.options=h,this.loose=!!h.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const h=this.options.loose?n[c.COMPARATORLOOSE]:n[c.COMPARATOR],Y=u.match(h);if(!Y)throw new TypeError(`Invalid comparator: ${u}`);this.operator=Y[1]!==void 0?Y[1]:"",this.operator==="="&&(this.operator=""),Y[2]?this.semver=new a(Y[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return i(u,this.operator,this.semver,this.options)}intersects(u,h){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new r(u.value,h).test(this.value):u.operator===""?u.value===""?!0:new r(this.value,h).test(u.semver):(h=l(h),h.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!h.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||i(this.semver,"<",u.semver,h)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,h)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}qt=t;const l=Il,{re:n,t:c}=mt,i=En,s=Et,a=re,r=fe();return qt}const As=fe(),Ys=(e,t,l)=>{try{t=new As(t,l)}catch{return!1}return t.test(e)};var zt=Ys;const xs=fe(),ys=(e,t)=>new xs(e,t).set.map(l=>l.map(n=>n.value).join(" ").trim().split(" "));var Js=ys;const Bs=re,Fs=fe(),Hs=(e,t,l)=>{let n=null,c=null,i=null;try{i=new Fs(t,l)}catch{return null}return e.forEach(s=>{i.test(s)&&(!n||c.compare(s)===-1)&&(n=s,c=new Bs(n,l))}),n};var Ns=Hs;const vs=re,Ss=fe(),ks=(e,t,l)=>{let n=null,c=null,i=null;try{i=new Ss(t,l)}catch{return null}return e.forEach(s=>{i.test(s)&&(!n||c.compare(s)===1)&&(n=s,c=new vs(n,l))}),n};var ws=ks;const el=re,Es=fe(),tn=Kt,Ks=(e,t)=>{e=new Es(e,t);let l=new el("0.0.0");if(e.test(l)||(l=new el("0.0.0-0"),e.test(l)))return l;l=null;for(let n=0;n{const a=new el(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||tn(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),i&&(!l||tn(l,i))&&(l=i)}return l&&e.test(l)?l:null};var Qs=Ks;const zs=fe(),Us=(e,t)=>{try{return new zs(e,t).range||"*"}catch{return null}};var js=Us;const Ls=re,Qn=Qt(),{ANY:Ts}=Qn,$s=fe(),Ms=zt,ln=Kt,nn=Wl,Os=fl,Ps=pl,Ds=(e,t,l,n)=>{e=new Ls(e,n),t=new $s(t,n);let c,i,s,a,r;switch(l){case">":c=ln,i=Os,s=nn,a=">",r=">=";break;case"<":c=nn,i=Ps,s=ln,a="<",r="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ms(e,t,n))return!1;for(let C=0;C{X.semver===Ts&&(X=new Qn(">=0.0.0")),h=h||X,Y=Y||X,c(X.semver,h.semver,n)?h=X:s(X.semver,Y.semver,n)&&(Y=X)}),h.operator===a||h.operator===r||(!Y.operator||Y.operator===a)&&i(e,Y.semver))return!1;if(Y.operator===r&&s(e,Y.semver))return!1}return!0};var Xl=Ds;const _s=Xl,qs=(e,t,l)=>_s(e,t,">",l);var ea=qs;const ta=Xl,la=(e,t,l)=>ta(e,t,"<",l);var na=la;const cn=fe(),ca=(e,t,l)=>(e=new cn(e,l),t=new cn(t,l),e.intersects(t,l));var ia=ca;const sa=zt,aa=pe;var ra=(e,t,l)=>{const n=[];let c=null,i=null;const s=e.sort((u,h)=>aa(u,h,l));for(const u of s)sa(u,t,l)?(i=u,c||(c=u)):(i&&n.push([c,i]),i=null,c=null);c&&n.push([c,null]);const a=[];for(const[u,h]of n)u===h?a.push(u):!h&&u===s[0]?a.push("*"):h?u===s[0]?a.push(`<=${h}`):a.push(`${u} - ${h}`):a.push(`>=${u}`);const r=a.join(" || "),C=typeof t.raw=="string"?t.raw:String(t);return r.length{if(e===t)return!0;e=new sn(e,l),t=new sn(t,l);let n=!1;e:for(const c of e.set){for(const i of t.set){const s=ga(c,i,l);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},da=[new Rl(">=0.0.0-0")],an=[new Rl(">=0.0.0")],ga=(e,t,l)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===tl){if(t.length===1&&t[0].semver===tl)return!0;l.includePrerelease?e=da:e=an}if(t.length===1&&t[0].semver===tl){if(l.includePrerelease)return!0;t=an}const n=new Set;let c,i;for(const X of e)X.operator===">"||X.operator===">="?c=rn(c,X,l):X.operator==="<"||X.operator==="<="?i=on(i,X,l):n.add(X.semver);if(n.size>1)return null;let s;if(c&&i){if(s=Vl(c.semver,i.semver,l),s>0)return null;if(s===0&&(c.operator!==">="||i.operator!=="<="))return null}for(const X of n){if(c&&!nt(X,String(c),l)||i&&!nt(X,String(i),l))return null;for(const M of t)if(!nt(X,String(M),l))return!1;return!0}let a,r,C,u,h=i&&!l.includePrerelease&&i.semver.prerelease.length?i.semver:!1,Y=c&&!l.includePrerelease&&c.semver.prerelease.length?c.semver:!1;h&&h.prerelease.length===1&&i.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(const X of t){if(u=u||X.operator===">"||X.operator===">=",C=C||X.operator==="<"||X.operator==="<=",c){if(Y&&X.semver.prerelease&&X.semver.prerelease.length&&X.semver.major===Y.major&&X.semver.minor===Y.minor&&X.semver.patch===Y.patch&&(Y=!1),X.operator===">"||X.operator===">="){if(a=rn(c,X,l),a===X&&a!==c)return!1}else if(c.operator===">="&&!nt(c.semver,String(X),l))return!1}if(i){if(h&&X.semver.prerelease&&X.semver.prerelease.length&&X.semver.major===h.major&&X.semver.minor===h.minor&&X.semver.patch===h.patch&&(h=!1),X.operator==="<"||X.operator==="<="){if(r=on(i,X,l),r===X&&r!==i)return!1}else if(i.operator==="<="&&!nt(i.semver,String(X),l))return!1}if(!X.operator&&(i||c)&&s!==0)return!1}return!(c&&C&&!i&&s!==0||i&&u&&!c&&s!==0||Y||h)},rn=(e,t,l)=>{if(!e)return t;const n=Vl(e.semver,t.semver,l);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},on=(e,t,l)=>{if(!e)return t;const n=Vl(e.semver,t.semver,l);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var ua=oa;const ll=mt,dn=wt,ba=re,gn=Sn,Za=et,ma=Zi,Ga=hi,ha=Ci,Ia=pi,Ca=Ri,Wa=Yi,pa=Ji,fa=Hi,Xa=pe,Ra=ki,Va=Ki,Aa=Cl,Ya=ji,xa=$i,ya=Kt,Ja=Wl,Ba=kn,Fa=wn,Ha=pl,Na=fl,va=En,Sa=Gs,ka=Qt(),wa=fe(),Ea=zt,Ka=Js,Qa=Ns,za=ws,Ua=Qs,ja=js,La=Xl,Ta=ea,$a=na,Ma=ia,Oa=ra,Pa=ua;var Da={parse:Za,valid:ma,clean:Ga,inc:ha,diff:Ia,major:Ca,minor:Wa,patch:pa,prerelease:fa,compare:Xa,rcompare:Ra,compareLoose:Va,compareBuild:Aa,sort:Ya,rsort:xa,gt:ya,lt:Ja,eq:Ba,neq:Fa,gte:Ha,lte:Na,cmp:va,coerce:Sa,Comparator:ka,Range:wa,satisfies:Ea,toComparators:Ka,maxSatisfying:Qa,minSatisfying:za,minVersion:Ua,validRange:ja,outside:La,gtr:Ta,ltr:$a,intersects:Ma,simplifyRange:Oa,subset:Pa,SemVer:ba,re:ll.re,src:ll.src,tokens:ll.t,SEMVER_SPEC_VERSION:dn.SEMVER_SPEC_VERSION,RELEASE_TYPES:dn.RELEASE_TYPES,compareIdentifiers:gn.compareIdentifiers,rcompareIdentifiers:gn.rcompareIdentifiers},_a=Da;const qa=_c(_a),zn=e=>e!=null&&e.includes(" ")?`"${e}"`:`${e??"pandoc"}`;async function er(e,t){e=zn(e);let l=await cl(`${e} --version`,{env:t});l=l.substring(0,l.indexOf(` -`)).replace("pandoc.exe","").replace("pandoc","").trim();let n=[...l].filter(c=>c===".").length;if(n===1)l=`${l}.0`;else for(;n>2;)l=l.substring(0,l.lastIndexOf(".")),n-=1;return qa.parse(l,!0)}const tr="3.1.7",Vt={normalizePath:zn,getVersion:er,requiredVersion:tr};async function Un(e,t,l,n,c,i,s,a,r,C){const{settings:u,lang:h,manifest:Y,app:{vault:{adapter:X,config:M},metadataCache:O}}=e;if(!n){const ce=hn(c);n=`${t.basename}${ce}`}i==null&&(i=u.showOverwriteConfirmation);const b=u.showExportProgressBar,j=X.getBasePath(),k=`${j}/${Y.dir}`,z=`${k}/lua`,$=l,w=`${$}/${n}`,be=n.substring(0,n.lastIndexOf(".")),Ze=n,p=X.getFullPath(t.path),f=de.dirname(p),R=t.basename,N=t.name;let _=M.attachmentFolderPath??"/";_==="/"?_=j:_.startsWith(".")?_=de.join(f,_.substring(1)):_=de.join(j,_);let I=null;try{I=O.getCache(t.path).frontmatter}catch(ce){console.error(ce)}const m={pluginDir:k,luaDir:z,outputDir:$,outputPath:w,outputFileName:be,outputFileFullName:Ze,currentDir:f,currentPath:p,currentFileName:R,currentFileFullName:N,attachmentFolderPath:_,vaultDir:j,metadata:I,options:s,fromFormat:app.vault.config.useMarkdownLinks?"markdown":"markdown+wikilinks_title_after_pipe"},H=c.type==="custom"&&c.showCommandOutput,B=c.openExportedFileLocation??u.openExportedFileLocation,F=c.openExportedFile??u.openExportedFile;if(i&&Ut.existsSync(w)){const ce=await Se.remote.dialog.showSaveDialog({title:h.overwriteConfirmationDialog.title(Ze),defaultPath:w,properties:["showOverwriteConfirmation","createDirectory"]});if(ce.canceled)return;m.outputPath=ce.filePath,m.outputDir=de.dirname(m.outputPath),m.outputFileFullName=de.basename(m.outputPath),m.outputFileName=de.basename(m.outputFileFullName,de.extname(m.outputFileFullName))}let x;b&&(x=Dc.show(h.preparing(m.outputFileFullName)));const v=m.env=In(ue(u.env)??{},m);let E=Vt.normalizePath(ue(u.pandocPath));if(Nt.platform==="win32"){E=E.replaceAll("\\","/");const ce=["pluginDir","luaDir","outputDir","outputPath","currentDir","currentPath","attachmentFolderPath","vaultDir"];for(const Ve of ce){const Qe=m[Ve];m[Ve]=Qe.replaceAll("\\","/")}}const S=c.type==="pandoc"?`${E} "\${currentPath}" ${c.arguments??""} ${c.customArguments??""}`:c.command,K=il(S,m),te=Zt(K.match(/(?:[^\s"]+|"[^"]*")+/g),{alias:{output:["o"]}}),V=de.normalize(cc(te.output)),Ge=de.dirname(V);Ut.existsSync(Ge)||Ut.mkdirSync(Ge);try{console.log(`[${e.manifest.name}]: export command and options:`,{cmd:K,options:{cwd:m.currentDir,env:v}}),await cl(K,{cwd:m.currentDir,env:v}),x==null||x();const ce=async()=>{if(B&&setTimeout(()=>{Se.remote.shell.showItemInFolder(V)},1e3),F&&await Se.remote.shell.openPath(V),c.type==="pandoc"&&c.runCommand===!0&&c.command){const Ve=il(c.command,m);await cl(Ve,{cwd:m.currentDir,env:v})}a&&a()};if(H){const Ve=new Kl(app,h.exportCommandOutputMessage(K));Ve.onClose=ce,Ve.open()}else new We.Notice(h.exportSuccessNotice(m.outputFileFullName),1500),await ce()}catch(ce){x==null||x(),new Kl(app,h.exportErrorOutputMessage(K,ce)).open(),r&&r()}}const gl=e=>{const t=new We.Modal(e.app);let l=[],n=!1;return Fe(()=>{se(t.titleEl,()=>e.title)}),Fe(()=>{se(t.contentEl,()=>e.children)}),Fe(()=>{const c=Object.entries(e.classList??{}).filter(([,i])=>i).map(([i])=>i);l.length>0&&t.containerEl.removeClasses(l),c.length>0&&t.containerEl.addClasses(c),l=c}),Fe(()=>{t.containerEl.style.display=e.hidden?"None":""}),t.onClose=()=>{n||(n=!0,e.onClose())},pn(()=>t.open()),_e(()=>{n||t.close()}),document.createTextNode("")};var lr=me("