"use strict";var ht=(e,l,t)=>{if(!l.has(e))throw TypeError("Cannot "+t)};var Jt=(e,l,t)=>(ht(e,l,"read from private field"),t?t.call(e):l.get(e)),St=(e,l,t)=>{if(l.has(e))throw TypeError("Cannot add the same private member more than once");l instanceof WeakSet?l.add(e):l.set(e,t)},Ft=(e,l,t,c)=>(ht(e,l,"write to private field"),c?c.call(e,t):l.set(e,t),t);/*! 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 be=require("obsidian"),_c=require("child_process"),dc=require("process"),oc=require("electron"),ac=require("fs"),oe=require("path"),en=require("util");function Zt(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(l,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return l.default=e,Object.freeze(l)}const ln=Zt(be),Qe=Zt(oc),Kl=Zt(ac),Gl={Markdown:{name:"Markdown",type:"pandoc",arguments:'-f markdown --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 markdown --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 markdown --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 markdown --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 markdown --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 markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/pdf.lua" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } --embed-resources --standalone -s -o "${outputPath}" -t pdf',customArguments:"--pdf-engine=pdflatex",optionsMeta:{textemplate:"preset:textemplate"},extension:".pdf"},"Word (.docx)":{name:"Word (.docx)",type:"pandoc",arguments:'-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t docx',extension:".docx"},OpenOffice:{name:"OpenOffice",type:"pandoc",arguments:'-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t odt',extension:".odt"},RTF:{name:"RTF",type:"pandoc",arguments:'-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t rtf',extension:".rtf"},Epub:{name:"Epub",type:"pandoc",arguments:'-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t epub',extension:".epub"},Latex:{name:"Latex",type:"pandoc",arguments:'-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } -s -o "${outputPath}" -t latex',optionsMeta:{textemplate:"preset:textemplate"},extension:".latex"},"Media Wiki":{name:"Media Wiki",type:"pandoc",arguments:'-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t mediawiki',extension:".mediawiki"},reStructuredText:{name:"reStructuredText",type:"pandoc",arguments:'-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t rst',extension:".rst"},Textile:{name:"Textile",type:"pandoc",arguments:'-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t textile',extension:".textile"},OPML:{name:"OPML",type:"pandoc",arguments:'-f markdown --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t opml',extension:".opml"},"Bibliography (.bib)":{name:"Bibliography",type:"pandoc",arguments:'-f markdown --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 xe(e,l,t){return typeof l=="string"&&l.trim()===""&&(l=void 0),t instanceof Array?t.reduce((c,n)=>xe(c,l,n),e):(t??(t=dc.platform),{...e??{},[t]:l})}function ae(e,l){e??(e={});const t=e[l??dc.platform],c=e["*"];return c&&typeof c=="object"?Object.assign({},c,t):t??c}function P(e,...l){return function(...t){const c=t[t.length-1]||{},n=[e[0]];return l.forEach(function(I,i){const g=Number.isInteger(I)?t[I]:c[I];n.push(g,e[i+1])}),n.join("")}}function lt(e,l){return l=l??{},new Promise((t,c)=>{_c.exec(e,l,(n,I,i)=>{if(n){c(n);return}if(i&&i!==""){c(i);return}t(I)})})}function tt(e,l={}){for(;;)try{const t=Object.keys(l).filter(tn),c=t.map(n=>l[n]);return new Function(...t,`{ return \`${e.replaceAll("\\","\\\\")}\` }`).bind(l)(...c)}catch(t){if(t instanceof ReferenceError&&t.message.endsWith("is not defined")){const c=t.message.substring(0,t.message.indexOf(" ")),n=Object.keys(l).filter(I=>I.toLowerCase()===c.toLowerCase()).map(I=>l[I])[0]??`\${${c}}`;l[c]=n}else throw t}}const tn=e=>{if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0},cn={textemplate:{title:"Latex Template",type:"dropdown",options:[{name:"None",value:null},{name:"Dissertation",value:"dissertation.tex"},{name:"Academic Paper",value:"neurips.tex"}]}},Cl=(()=>{let e={};return e=xe(e,{HOME:"${HOME}",PATH:"${PATH}",TEXINPUTS:"${pluginDir}/textemplate/:"},"*"),e=xe(e,{TEXINPUTS:"${pluginDir}/textemplate/;"},"win32"),e=xe(e,{PATH:"/usr/local/bin:/Library/TeX/texbin:${PATH}"},"darwin"),e})(),_e={items:Object.values(Gl).filter(e=>e.type!=="custom"),pandocPath:void 0,defaultExportDirectoryMode:"Auto",openExportedFile:!0,env:Cl,showExportProgressBar:!0};function sc(e){var l;return e.type==="pandoc"?e.extension:e.type==="custom"?(l=e.targetFileExtensions)==null?void 0:l.split(",")[0]:""}function Wc(e,l){return e=Object.assign({},ae(Cl),e),l=Object.assign({HOME:process.env.HOME??process.env.USERPROFILE},process.env,l??{}),Object.fromEntries(Object.entries(e).map(([t,c])=>[t,tt(c,l)]))}function nn(e){return e?Object.fromEntries(Object.entries(e).map(([l,t])=>[l,typeof t=="string"?cn[t.startsWith("preset:")?t.substring(7):""]:t])):{}}const In=(e,l)=>e===l,Je=Symbol("solid-proxy"),ct=Symbol("solid-track"),gn=Symbol("solid-dev-component"),Sl={equals:In};let mc=Gc;const Be=1,Fl=2,Xc={owned:null,cleanups:null,context:null,owner:null};var O=null;let Hl=null,_=null,Ie=null,ue=null,xl=0;function Il(e,l){const t=_,c=O,n=e.length===0,I=l===void 0?c:l,i=n?Xc:{owned:null,cleanups:null,context:I?I.context:null,owner:I},g=n?e:()=>e(()=>$(()=>Bl(i)));O=i,_=null;try{return qe(g,!0)}finally{_=t,O=c}}function Ve(e,l){l=l?Object.assign({},Sl,l):Sl;const t={value:e,observers:null,observerSlots:null,comparator:l.equals||void 0},c=n=>(typeof n=="function"&&(n=n(t.value)),rc(t,n));return[Ac.bind(t),c]}function ce(e,l,t){const c=dt(e,l,!1,Be);ol(c)}function Ye(e,l,t){mc=on;const c=dt(e,l,!1,Be);(!t||!t.render)&&(c.user=!0),ue?ue.push(c):ol(c)}function te(e,l,t){t=t?Object.assign({},Sl,t):Sl;const c=dt(e,l,!0,0);return c.observers=null,c.observerSlots=null,c.comparator=t.equals||void 0,ol(c),Ac.bind(c)}function hl(e){return qe(e,!1)}function $(e){if(_===null)return e();const l=_;_=null;try{return e()}finally{_=l}}function bc(e){Ye(()=>$(e))}function dl(e){return O===null||(O.cleanups===null?O.cleanups=[e]:O.cleanups.push(e)),e}function nt(){return _}function Cn(e,l){const t=Symbol("context");return{id:t,Provider:sn(t),defaultValue:e}}function Vn(e){return O&&O.context&&O.context[e.id]!==void 0?O.context[e.id]:e.defaultValue}function Rc(e){const l=te(e),t=te(()=>It(l()));return t.toArray=()=>{const c=t();return Array.isArray(c)?c:c!=null?[c]:[]},t}function Ac(){if(this.sources&&this.state)if(this.state===Be)ol(this);else{const e=Ie;Ie=null,qe(()=>Ul(this),!1),Ie=e}if(_){const e=this.observers?this.observers.length:0;_.sources?(_.sources.push(this),_.sourceSlots.push(e)):(_.sources=[this],_.sourceSlots=[e]),this.observers?(this.observers.push(_),this.observerSlots.push(_.sources.length-1)):(this.observers=[_],this.observerSlots=[_.sources.length-1])}return this.value}function rc(e,l,t){let c=e.value;return(!e.comparator||!e.comparator(c,l))&&(e.value=l,e.observers&&e.observers.length&&qe(()=>{for(let n=0;n1e6)throw Ie=[],new Error},!1)),l}function ol(e){if(!e.fn)return;Bl(e);const l=O,t=_,c=xl;_=O=e,Zn(e,e.value,c),_=t,O=l}function Zn(e,l,t){let c;try{c=e.fn(l)}catch(n){return e.pure&&(e.state=Be,e.owned&&e.owned.forEach(Bl),e.owned=null),e.updatedAt=t+1,Jc(n)}(!e.updatedAt||e.updatedAt<=t)&&(e.updatedAt!=null&&"observers"in e?rc(e,c):e.value=c,e.updatedAt=t)}function dt(e,l,t,c=Be,n){const I={fn:e,state:c,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:l,owner:O,context:O?O.context:null,pure:t};return O===null||O!==Xc&&(O.owned?O.owned.push(I):O.owned=[I]),I}function pl(e){if(e.state===0)return;if(e.state===Fl)return Ul(e);if(e.suspense&&$(e.suspense.inFallback))return e.suspense.effects.push(e);const l=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;t--)if(e=l[t],e.state===Be)ol(e);else if(e.state===Fl){const c=Ie;Ie=null,qe(()=>Ul(e,l[0]),!1),Ie=c}}function qe(e,l){if(Ie)return e();let t=!1;l||(Ie=[]),ue?t=!0:ue=[],xl++;try{const c=e();return dn(t),c}catch(c){t||(ue=null),Ie=null,Jc(c)}}function dn(e){if(Ie&&(Gc(Ie),Ie=null),e)return;const l=ue;ue=null,l.length&&qe(()=>mc(l),!1)}function Gc(e){for(let l=0;l=0;l--)Bl(e.owned[l]);e.owned=null}if(e.cleanups){for(l=e.cleanups.length-1;l>=0;l--)e.cleanups[l]();e.cleanups=null}e.state=0}function an(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Jc(e,l=O){throw an(e)}function It(e){if(typeof e=="function"&&!e.length)return It(e());if(Array.isArray(e)){const l=[];for(let t=0;tn=$(()=>(O.context={...O.context,[e]:c.value},Rc(()=>c.children))),void 0),n}}const Wn=Symbol("fallback");function pt(e){for(let l=0;l1?[]:null;return dl(()=>pt(I)),()=>{let C=e()||[],a,d;return C[ct],$(()=>{let N=C.length,A,U,w,s,z,Q,E,v,K;if(N===0)i!==0&&(pt(I),I=[],c=[],n=[],i=0,g&&(g=[])),t.fallback&&(c=[Wn],n[0]=Il(Ce=>(I[0]=Ce,t.fallback())),i=1);else if(i===0){for(n=new Array(N),d=0;d=Q&&v>=Q&&c[E]===C[v];E--,v--)w[v]=n[E],s[v]=I[E],g&&(z[v]=g[E]);for(A=new Map,U=new Array(v+1),d=v;d>=Q;d--)K=C[d],a=A.get(K),U[d]=a===void 0?-1:a,A.set(K,d);for(a=Q;a<=E;a++)K=c[a],d=A.get(K),d!==void 0&&d!==-1?(w[d]=n[a],s[d]=I[a],g&&(z[d]=g[a]),d=U[d],A.set(K,d)):I[a]();for(d=Q;de(l||{}))}function ml(){return!0}const Ut={get(e,l,t){return l===Je?t:e.get(l)},has(e,l){return l===Je?!0:e.has(l)},set:ml,deleteProperty:ml,getOwnPropertyDescriptor(e,l){return{configurable:!0,enumerable:!0,get(){return e.get(l)},set:ml,deleteProperty:ml}},ownKeys(e){return e.keys()}};function Xn(e,...l){if(Je in e){const n=new Set(l.length>1?l.flat():l[0]),I=l.map(i=>new Proxy({get(g){return i.includes(g)?e[g]:void 0},has(g){return i.includes(g)&&g in e},keys(){return i.filter(g=>g in e)}},Ut));return I.push(new Proxy({get(i){return n.has(i)?void 0:e[i]},has(i){return n.has(i)?!1:i in e},keys(){return Object.keys(e).filter(i=>!n.has(i))}},Ut)),I}const t={},c=l.map(()=>({}));for(const n of Object.getOwnPropertyNames(e)){const I=Object.getOwnPropertyDescriptor(e,n),i=!I.get&&!I.set&&I.enumerable&&I.writable&&I.configurable;let g=!1,C=0;for(const a of l)a.includes(n)&&(g=!0,i?c[C][n]=I.value:Object.defineProperty(c[C],n,I)),++C;g||(i?t[n]=I.value:Object.defineProperty(t,n,I))}return[...c,t]}const Sc=e=>`Stale read from <${e}>.`;function Fc(e){const l="fallback"in e&&{fallback:()=>e.fallback};return te(mn(()=>e.each,e.children,l||void 0))}function Jl(e){const l=e.keyed,t=te(()=>e.when,void 0,{equals:(c,n)=>l?c===n:!c==!n});return te(()=>{const c=t();if(c){const n=e.children;return typeof n=="function"&&n.length>0?$(()=>n(l?c:()=>{if(!$(t))throw Sc("Show");return e.when})):n}return e.fallback},void 0,void 0)}function bn(e){let l=!1;const t=(I,i)=>I[0]===i[0]&&(l?I[1]===i[1]:!I[1]==!i[1])&&I[2]===i[2],c=Rc(()=>e.children),n=te(()=>{let I=c();Array.isArray(I)||(I=[I]);for(let i=0;i{const[I,i,g]=n();if(I<0)return e.fallback;const C=g.children;return typeof C=="function"&&C.length>0?$(()=>C(l?i:()=>{if($(n)[0]!==I)throw Sc("Match");return g.when})):C},void 0,void 0)}function Nt(e){return e}const Rn=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],An=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Rn]),rn=new Set(["innerHTML","textContent","innerText","children"]),Gn=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),hn=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 Jn(e,l){const t=hn[e];return typeof t=="object"?t[l]?t.$:void 0:t}const Sn=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Fn=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","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"]),pn={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Un(e,l,t){let c=t.length,n=l.length,I=c,i=0,g=0,C=l[n-1].nextSibling,a=null;for(;id-g){const U=l[i];for(;g{const i=document.createElement("template");return i.innerHTML=e,t?i.content.firstChild.firstChild:i.content.firstChild},I=l?()=>$(()=>document.importNode(c||(c=n()),!0)):()=>(c||(c=n())).cloneNode(!0);return I.cloneNode=I,I}function ot(e,l=window.document){const t=l[Yt]||(l[Yt]=new Set);for(let c=0,n=e.length;cn.call(e,t[1],I))}else e.addEventListener(l,t)}function Yn(e,l,t={}){const c=Object.keys(l||{}),n=Object.keys(t);let I,i;for(I=0,i=n.length;In.children=De(e,l.children,n.children)),ce(()=>l.ref&&l.ref(e)),ce(()=>kn(e,l,t,!0,n,!0)),n}function Uc(e,l,t){return $(()=>e(l,t))}function Ze(e,l,t,c){if(t!==void 0&&!c&&(c=[]),typeof l!="function")return De(e,l,c,t);ce(n=>De(e,l(),n,t),c)}function kn(e,l,t,c,n={},I=!1){l||(l={});for(const i in n)if(!(i in l)){if(i==="children")continue;n[i]=kt(e,i,null,n[i],t,I)}for(const i in l){if(i==="children"){c||De(e,l.children);continue}const g=l[i];n[i]=kt(e,i,g,n[i],t,I)}}function xn(e){return e.toLowerCase().replace(/-([a-z])/g,(l,t)=>t.toUpperCase())}function ut(e,l,t){const c=l.trim().split(/\s+/);for(let n=0,I=c.length;n-1&&pn[l.split(":")[0]];m?Nn(e,m,l,t):ke(e,Gn[l]||l,t)}return t}function Bn(e){const l=`$$${e.type}`;let t=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==t&&Object.defineProperty(e,"target",{configurable:!0,value:t}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}});t;){const c=t[l];if(c&&!t.disabled){const n=t[`${l}Data`];if(n!==void 0?c.call(t,n,e):c.call(t,e),e.cancelBubble)return}t=t._$host||t.parentNode||t.host}}function De(e,l,t,c,n){for(;typeof t=="function";)t=t();if(l===t)return t;const I=typeof l,i=c!==void 0;if(e=i&&t[0]&&t[0].parentNode||e,I==="string"||I==="number")if(I==="number"&&(l=l.toString()),i){let g=t[0];g&&g.nodeType===3?g.data=l:g=document.createTextNode(l),t=Me(e,t,c,g)}else t!==""&&typeof t=="string"?t=e.firstChild.data=l:t=e.textContent=l;else if(l==null||I==="boolean")t=Me(e,t,c);else{if(I==="function")return ce(()=>{let g=l();for(;typeof g=="function";)g=g();t=De(e,g,t,c)}),()=>t;if(Array.isArray(l)){const g=[],C=t&&Array.isArray(t);if(gt(g,l,t,n))return ce(()=>t=De(e,g,t,c,!0)),()=>t;if(g.length===0){if(t=Me(e,t,c),i)return t}else C?t.length===0?xt(e,g,c):Un(e,t,g):(t&&Me(e),xt(e,g));t=g}else if(l.nodeType){if(Array.isArray(t)){if(i)return t=Me(e,t,c,l);Me(e,t,null,l)}else t==null||t===""||!e.firstChild?e.appendChild(l):e.replaceChild(l,e.firstChild);t=l}else console.warn("Unrecognized value. Skipped inserting",l)}return t}function gt(e,l,t,c){let n=!1;for(let I=0,i=l.length;I=0;i--){const g=l[i];if(n!==g){const C=g.parentNode===e;!I&&!i?C?e.replaceChild(n,g):e.insertBefore(n,t):C&&g.remove()}else I=!0}}else e.insertBefore(n,t);return[n]}const yn="http://www.w3.org/2000/svg";function fn(e,l=!1){return l?document.createElementNS(yn,e):document.createElement(e)}function Tn(e){const[l,t]=Xn(e,["component"]),c=te(()=>l.component);return te(()=>{const n=c();switch(typeof n){case"function":return Object.assign(n,{[gn]:!0}),$(()=>n(t));case"string":const I=Fn.has(n),i=fn(n,I);return un(i,t,I),i}})}/** * @license * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */function tl(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let t="",c=!1;const n=e.match(/^-+/);for(let I=n?n[0].length:0;I0?c+=`${l}${t.charAt(n)}`:c+=i}return c}function Yc(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 Qn(e){if(Array.isArray(e))return e.map(i=>typeof i!="string"?i+"":i);e=e.trim();let l=0,t=null,c=null,n=null;const I=[];for(let i=0;i{typeof o=="number"&&(s.nargs[V]=o,s.keys.push(V))}),typeof c.coerce=="object"&&Object.entries(c.coerce).forEach(([V,o])=>{typeof o=="function"&&(s.coercions[V]=o,s.keys.push(V))}),typeof c.config<"u"&&(Array.isArray(c.config)||typeof c.config=="string"?[].concat(c.config).filter(Boolean).forEach(function(V){s.configs[V]=!0}):typeof c.config=="object"&&Object.entries(c.config).forEach(([V,o])=>{(typeof o=="boolean"||typeof o=="function")&&(s.configs[V]=o)})),q(c.key,i,c.default,s.arrays),Object.keys(C).forEach(function(V){(s.aliases[V]||[]).forEach(function(o){C[o]=C[V]})});let E=null;$c();let v=[];const K=Object.assign(Object.create(null),{_:[]}),Ce={};for(let V=0;V=3&&(S(F[1],s.arrays)?V=b(V,F[1],n,F[2]):S(F[1],s.nargs)!==!1?V=y(V,F[1],n,F[2]):G(F[1],F[2],!0));else if(o.match(Q)&&g["boolean-negation"])F=o.match(Q),F!==null&&Array.isArray(F)&&F.length>=2&&(Z=F[1],G(Z,S(Z,s.arrays)?[!1]:!1));else if(o.match(/^--.+/)||!g["short-option-groups"]&&o.match(/^-[^-]+/))F=o.match(/^--?(.+)/),F!==null&&Array.isArray(F)&&F.length>=2&&(Z=F[1],S(Z,s.arrays)?V=b(V,Z,n):S(Z,s.nargs)!==!1?V=y(V,Z,n):(k=n[V+1],k!==void 0&&(!k.match(/^-/)||k.match(z))&&!S(Z,s.bools)&&!S(Z,s.counts)||/^(true|false)$/.test(k)?(G(Z,k),V++):G(Z,He(Z))));else if(o.match(/^-.\..+=/))F=o.match(/^-([^=]+)=([\s\S]*)$/),F!==null&&Array.isArray(F)&&F.length>=3&&G(F[1],F[2]);else if(o.match(/^-.\..+/)&&!o.match(z))k=n[V+1],F=o.match(/^-(.\..+)/),F!==null&&Array.isArray(F)&&F.length>=2&&(Z=F[1],k!==void 0&&!k.match(/^-/)&&!S(Z,s.bools)&&!S(Z,s.counts)?(G(Z,k),V++):G(Z,He(Z)));else if(o.match(/^-[^-]+/)&&!o.match(z)){Y=o.slice(1,-1).split(""),W=!1;for(let ge=0;geV!=="--"&&V.includes("-")).forEach(V=>{delete K[V]}),g["strip-aliased"]&&[].concat(...Object.keys(i).map(V=>i[V])).forEach(V=>{g["camel-case-expansion"]&&V.includes("-")&&delete K[V.split(".").map(o=>tl(o)).join(".")],delete K[V]});function J(V){const o=r("_",V);(typeof o=="string"||typeof o=="number")&&K._.push(o)}function y(V,o,R,W){let Z,Y=S(o,s.nargs);if(Y=typeof Y!="number"||isNaN(Y)?1:Y,Y===0)return Se(W)||(E=Error(w("Argument unexpected for: %s",o))),G(o,He(o)),V;let F=Se(W)?0:1;if(g["nargs-eats-options"])R.length-(V+1)+F0&&(G(o,W),k--),Z=V+1;Z0||F&&typeof F=="number"&&Z.length>=F||(Y=R[k],/^-/.test(Y)&&!z.test(Y)&&!Wl(Y)));k++)V=k,Z.push(D(o,Y,I))}return typeof F=="number"&&(F&&Z.length1&&g["dot-notation"]&&(s.aliases[Z[0]]||[]).forEach(function(Y){let F=Y.split(".");const k=[].concat(Z);k.shift(),F=F.concat(k),(s.aliases[V]||[]).includes(F.join("."))||H(K,F,W)}),S(V,s.normalize)&&!S(V,s.arrays)&&[V].concat(s.aliases[V]||[]).forEach(function(F){Object.defineProperty(Ce,F,{enumerable:!0,get(){return o},set(k){o=typeof k=="string"?Fe.normalize(k):k}})})}function Ge(V,o){s.aliases[V]&&s.aliases[V].length||(s.aliases[V]=[o],A[o]=!0),s.aliases[o]&&s.aliases[o].length||Ge(o,V)}function D(V,o,R){R&&(o=Hn(o)),(S(V,s.bools)||S(V,s.counts))&&typeof o=="string"&&(o=o==="true");let W=Array.isArray(o)?o.map(function(Z){return r(V,Z)}):r(V,o);return S(V,s.counts)&&(Se(W)||typeof W=="boolean")&&(W=Ml()),S(V,s.normalize)&&S(V,s.arrays)&&(Array.isArray(o)?W=o.map(Z=>Fe.normalize(Z)):W=Fe.normalize(o)),W}function r(V,o){return!g["parse-positional-numbers"]&&V==="_"||!S(V,s.strings)&&!S(V,s.bools)&&!Array.isArray(o)&&(Yc(o)&&g["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${o}`)))||!Se(o)&&S(V,s.numbers))&&(o=Number(o)),o}function h(V){const o=Object.create(null);j(o,s.aliases,C),Object.keys(s.configs).forEach(function(R){const W=V[R]||o[R];if(W)try{let Z=null;const Y=Fe.resolve(Fe.cwd(),W),F=s.configs[R];if(typeof F=="function"){try{Z=F(Y)}catch(k){Z=k}if(Z instanceof Error){E=Z;return}}else Z=Fe.require(Y);p(Z)}catch(Z){Z.name==="PermissionDenied"?E=Z:V[R]&&(E=Error(w("Invalid JSON config file: %s",W)))}})}function p(V,o){Object.keys(V).forEach(function(R){const W=V[R],Z=o?o+"."+R:R;typeof W=="object"&&W!==null&&!Array.isArray(W)&&g["dot-notation"]?p(W,Z):(!T(K,Z.split("."))||S(Z,s.arrays)&&g["combine-arrays"])&&G(Z,W)})}function x(){typeof a<"u"&&a.forEach(function(V){p(V)})}function B(V,o){if(typeof d>"u")return;const R=typeof d=="string"?d:"",W=Fe.env();Object.keys(W).forEach(function(Z){if(R===""||Z.lastIndexOf(R,0)===0){const Y=Z.split("__").map(function(F,k){return k===0&&(F=F.substring(R.length)),tl(F)});(o&&s.configs[Y.join(".")]||!o)&&!T(V,Y)&&G(Y.join("."),W[Z])}})}function u(V){let o;const R=new Set;Object.keys(V).forEach(function(W){if(!R.has(W)&&(o=S(W,s.coercions),typeof o=="function"))try{const Z=r(W,o(V[W]));[].concat(s.aliases[W]||[],W).forEach(Y=>{R.add(Y),V[Y]=Z})}catch(Z){E=Z}})}function f(V){return s.keys.forEach(o=>{~o.indexOf(".")||typeof V[o]>"u"&&(V[o]=void 0)}),V}function j(V,o,R,W=!1){Object.keys(R).forEach(function(Z){T(V,Z.split("."))||(H(V,Z.split("."),R[Z]),W&&(U[Z]=!0),(o[Z]||[]).forEach(function(Y){T(V,Y.split("."))||H(V,Y.split("."),R[Z])}))})}function T(V,o){let R=V;g["dot-notation"]||(o=[o.join(".")]),o.slice(0,-1).forEach(function(Z){R=R[Z]||{}});const W=o[o.length-1];return typeof R!="object"?!1:W in R}function H(V,o,R){let W=V;g["dot-notation"]||(o=[o.join(".")]),o.slice(0,-1).forEach(function(ee){ee=Bt(ee),typeof W=="object"&&W[ee]===void 0&&(W[ee]={}),typeof W[ee]!="object"||Array.isArray(W[ee])?(Array.isArray(W[ee])?W[ee].push({}):W[ee]=[W[ee],{}],W=W[ee][W[ee].length-1]):W=W[ee]});const Z=Bt(o[o.length-1]),Y=S(o.join("."),s.arrays),F=Array.isArray(R);let k=g["duplicate-arguments-array"];!k&&S(Z,s.nargs)&&(k=!0,(!Se(W[Z])&&s.nargs[Z]===1||Array.isArray(W[Z])&&W[Z].length===s.nargs[Z])&&(W[Z]=void 0)),R===Ml()?W[Z]=Ml(W[Z]):Array.isArray(W[Z])?k&&Y&&F?W[Z]=g["flatten-duplicate-arrays"]?W[Z].concat(R):(Array.isArray(W[Z][0])?W[Z]:[W[Z]]).concat([R]):!k&&!!Y==!!F?W[Z]=R:W[Z]=W[Z].concat([R]):W[Z]===void 0&&Y?W[Z]=F?R:[R]:k&&!(W[Z]===void 0||S(Z,s.counts)||S(Z,s.bools))?W[Z]=[W[Z],R]:W[Z]=R}function q(...V){V.forEach(function(o){Object.keys(o||{}).forEach(function(R){s.aliases[R]||(s.aliases[R]=[].concat(i[R]||[]),s.aliases[R].concat(R).forEach(function(W){if(/-/.test(W)&&g["camel-case-expansion"]){const Z=tl(W);Z!==R&&s.aliases[R].indexOf(Z)===-1&&(s.aliases[R].push(Z),A[Z]=!0)}}),s.aliases[R].concat(R).forEach(function(W){if(W.length>1&&/[A-Z]/.test(W)&&g["camel-case-expansion"]){const Z=Nc(W,"-");Z!==R&&s.aliases[R].indexOf(Z)===-1&&(s.aliases[R].push(Z),A[Z]=!0)}}),s.aliases[R].forEach(function(W){s.aliases[W]=[R].concat(s.aliases[R].filter(function(Z){return W!==Z}))}))})})}function S(V,o){const R=[].concat(s.aliases[V]||[],V),W=Object.keys(o),Z=R.find(Y=>W.includes(Y));return Z?o[Z]:!1}function se(V){const o=Object.keys(s);return[].concat(o.map(W=>s[W])).some(function(W){return Array.isArray(W)?W.includes(V):W[V]})}function ne(V,...o){return[].concat(...o).some(function(W){const Z=V.match(W);return Z&&se(Z[1])})}function Ke(V){if(V.match(z)||!V.match(/^-[^-]+/))return!1;let o=!0,R;const W=V.slice(1).split("");for(let Z=0;ZS(V,s.arrays)?(E=Error(w("Invalid configuration: %s, opts.count excludes opts.array.",V)),!0):S(V,s.nargs)?(E=Error(w("Invalid configuration: %s, opts.count excludes opts.narg.",V)),!0):!1)}return{aliases:Object.assign({},s.aliases),argv:Object.assign(Ce,K),configuration:g,defaulted:Object.assign({},U),error:E,newAliases:Object.assign({},A)}}}function Kn(e){const l=[],t=Object.create(null);let c=!0;for(Object.keys(e).forEach(function(n){l.push([].concat(e[n],n))});c;){c=!1;for(let n=0;nMn,format:en.format,normalize:oe.normalize,resolve:oe.resolve,require:e=>{if(typeof require<"u")return require(e);if(e.match(/\.json$/))return JSON.parse(ac.readFileSync(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),al=function(l,t){return uc.parse(l.slice(),t).argv};al.detailed=function(e,l){return uc.parse(e.slice(),l)};al.camelCase=tl;al.decamelize=Nc;al.looksLikeNumber=Yc;const zn={exportToOo:"导出为......",exportWithPrevious:"使用上一次设置导出",exportSuccessNotice:P`导出文件 ${0} 成功!`,exportCommandOutputMessage:P`命令:${0}`,exportErrorOutputMessage:P`命令 ${0},错误:${1}`,pleaseOpenFile:"请打开一个文件先。",preparing:P`正在生成 "${0}" ......`,exportDialog:{fileName:"文件名",type:"类型",exportTo:"导出到",title:P`导出为 ${0}`,export:"导出",selectExportFolder:"请选择导出文件夹",overwriteConfirmation:"覆盖提示"},messageBox:{yes:"是",no:"否",ok:"确认",cancel:"取消"},overwriteConfirmationDialog:{replace:"替换",title:P`"${0}" 已经存在。您要替换它吗?`,message:P`"${0}" 文件夹中已有相同的文件或文件夹,若替换,则会覆盖其当前内容。`},settingTab:{title:"导出设置",general:"通用",name:"名称",customLocation:"自定义",version:P`版本: ${0}`,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:"显示导出进度条"}},jn={exportToOo:"Export to...",exportSuccessNotice:P`Export file ${0} success!`,exportCommandOutputMessage:P`Command: ${0}`,exportErrorOutputMessage:P`Command: ${0},Error:${1}`,exportWithPrevious:"Export with Previous",pleaseOpenFile:"Please open a file first.",preparing:P`generating "${0}"...`,exportDialog:{exportTo:"Export to",fileName:"File Name",title:P`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:P`"${0}" already exists. Do you want to replace it?`,message:P`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",version:P`Version: ${0}`,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."}},wn={exportToOo:"Export to...",exportSuccessNotice:P`Export der Datei ${0} erfolgreich!`,exportCommandOutputMessage:P`Command: ${0}`,exportErrorOutputMessage:P`Command: ${0},Fehler:${1}`,exportWithPrevious:"Exportiere mit Vorherigem",pleaseOpenFile:"Bitte öffne zunächst eine Datei.",preparing:P`generating "${0}"...`,exportDialog:{exportTo:"Exportiere nach",fileName:"Dateiname",title:P`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:P`"${0}" existiert bereits. Soll er ersetzt werden?`,message:P`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",version:P`Version: ${0}`,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"}},kc={"de-DE":wn,"en-US":jn,"zh-CN":zn,get current(){const e=Object.keys(this),l=be.moment.locale().toLowerCase();let t=e.find(n=>n.toLowerCase()===l.toLowerCase());if(t)return this[t];const c=l.split("-")[0];return t=e.find(n=>n.toLowerCase().startsWith(c)),t?this[t]:this["en-US"]}};class Tt extends be.Modal{constructor(l,t,c){super(l),this.options=typeof t=="string"?{message:t,buttons:"Ok",title:c}:t,this.lang=kc.current}onOpen(){const{titleEl:l,contentEl:t,lang:c,options:{message:n,title:I,buttons:i,callback:g,buttonsLabel:C,buttonsClass:a}}=this;switch(I&&l.setText(I),t.createDiv({text:n}),i){case"Yes":t.createEl("div",{cls:["modal-button-container"],parent:t},d=>{d.createEl("button",{text:(C==null?void 0:C.yes)??c.messageBox.yes,cls:["mod-cta",a==null?void 0:a.yes],parent:d}).onclick=()=>this.call(g==null?void 0:g.yes)});break;case"YesNo":t.createEl("div",{cls:["modal-button-container"],parent:t},d=>{d.createEl("button",{text:(C==null?void 0:C.yes)??c.messageBox.yes,cls:["mod-cta",a==null?void 0:a.yes],parent:d}).onclick=()=>this.call(g==null?void 0:g.yes),d.createEl("button",{text:(C==null?void 0:C.no)??c.messageBox.no,cls:["mod-cta",a==null?void 0:a.no],parent:d}).onclick=()=>this.call(g==null?void 0:g.no)});break;case"Ok":t.createEl("div",{cls:["modal-button-container"],parent:t},d=>{d.createEl("button",{text:(C==null?void 0:C.ok)??c.messageBox.ok,cls:["mod-cta",a==null?void 0:a.no],parent:d}).onclick=()=>this.call(g==null?void 0:g.ok)});break;case"OkCancel":t.createEl("div",{cls:["modal-button-container"],parent:t},d=>{d.createEl("button",{text:(C==null?void 0:C.ok)??c.messageBox.ok,cls:["mod-cta",a==null?void 0:a.ok],parent:d}).onclick=()=>this.call(g==null?void 0:g.ok),d.createEl("button",{text:(C==null?void 0:C.cancel)??c.messageBox.cancel,cls:["mod-cta",a==null?void 0:a.cancel],parent:d}).onclick=()=>this.call(g==null?void 0:g.cancel)});break}}call(l){l&&l(),this.close()}onClose(){const{contentEl:l}=this;l.empty()}}async function xc(e,l,t,c,n,I,i,g,C,a){const{settings:d,lang:m,manifest:N,app:{vault:{adapter:A,config:U},loadProgress:w,fileManager:s}}=e;if(!c){const ne=sc(n);c=`${l.basename}${ne}`}I==null&&(I=d.showOverwriteConfirmation);const z=d.showExportProgressBar,Q=A.getBasePath(),E=`${Q}/${N.dir}`,v=`${E}/lua`,K=t,Ce=`${K}/${c}`,J=c.substring(0,c.lastIndexOf(".")),y=c,b=A.getFullPath(l.path),G=oe.dirname(b),Ge=l.basename,D=l.name;let r=U.attachmentFolderPath??"/";r==="/"?r=Q:r.startsWith(".")&&(r=oe.join(G,r.substring(1)));let h=null;try{await s.processFrontMatter(l,ne=>h=ne)}catch(ne){console.error(ne)}const p={pluginDir:E,luaDir:v,outputDir:K,outputPath:Ce,outputFileName:J,outputFileFullName:y,currentDir:G,currentPath:b,currentFileName:Ge,currentFileFullName:D,attachmentFolderPath:r,vaultDir:Q,metadata:h,options:i},x=n.type==="custom"&&n.showCommandOutput,B=n.openExportedFileLocation??d.openExportedFileLocation,u=n.openExportedFile??d.openExportedFile;if(I&&Kl.existsSync(Ce)){const ne=await Qe.remote.dialog.showSaveDialog({title:m.overwriteConfirmationDialog.title(y),defaultPath:Ce,properties:["showOverwriteConfirmation","createDirectory"]});if(ne.canceled)return;p.outputPath=ne.filePath,p.outputDir=oe.dirname(p.outputPath),p.outputFileFullName=oe.basename(p.outputPath),p.outputFileName=oe.basename(p.outputFileFullName,oe.extname(p.outputFileFullName))}z&&(w.setMessage(m.preparing(p.outputFileFullName)),a==null||a(),w.show());const f=p.env=Wc(ae(d.env)??{},p),j=ae(d.pandocPath)??"pandoc",T=n.type==="pandoc"?`${j} ${n.arguments??""} ${n.customArguments??""} "${b}"`:n.command,H=tt(T,p),q=al(H.match(/(?:[^\s"]+|"[^"]*")+/g),{alias:{output:["o"]}}),S=oe.normalize(q.output.startsWith('"')&&q.output.endsWith('"')||q.output.startsWith("'")&&q.output.endsWith("'")?q.output.substring(1,q.output.length-1):q.output),se=oe.dirname(S);Kl.existsSync(se)||Kl.mkdirSync(se);try{console.log(`[${e.manifest.name}]: export command and options:`,{cmd:H,options:{cwd:p.currentDir,env:f}}),await lt(H,{cwd:p.currentDir,env:f}),z&&w.hide();const ne=async()=>{if(B&&setTimeout(()=>{Qe.remote.shell.showItemInFolder(S)},1e3),u&&await Qe.remote.shell.openPath(S),n.type==="pandoc"&&n.runCommand===!0&&n.command){const Ke=tt(n.command,p);await lt(Ke,{cwd:p.currentDir,env:f})}g&&g()};if(x){const Ke=new Tt(app,m.exportCommandOutputMessage(H));Ke.onClose=ne,Ke.open()}else new be.Notice(m.exportSuccessNotice(p.outputFileFullName),1500),await ne()}catch(ne){w.hide(),new Tt(app,m.exportErrorOutputMessage(H,ne)).open(),C&&C()}}const it=e=>{const l=new be.Modal(e.app);let t=[],c=!1;return Ye(()=>{Ze(l.titleEl,()=>e.title)}),Ye(()=>{Ze(l.contentEl,()=>e.children)}),Ye(()=>{const n=Object.entries(e.classList??{}).filter(([,I])=>I).map(([I])=>I);t.length>0&&l.containerEl.removeClasses(t),n.length>0&&l.containerEl.addClasses(n),t=n}),Ye(()=>{l.containerEl.style.display=e.hidden?"None":""}),l.onClose=()=>{c||(c=!0,e.onClose())},bc(()=>l.open()),dl(()=>{c||l.close()}),document.createTextNode("")},Ln=Re("