"use strict";var dl=e=>{throw TypeError(e)};var gl=(e,l,t)=>l.has(e)||dl("Cannot "+t);var bl=(e,l,t)=>(gl(e,l,"read from private field"),t?t.call(e):l.get(e)),Zl=(e,l,t)=>l.has(e)?dl("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(e):l.set(e,t),ml=(e,l,t,n)=>(gl(e,l,"write to private field"),n?n.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 Ie=require("obsidian"),Sn=require("child_process"),pt=require("process"),Pl=require("electron"),Dl=require("fs"),ae=require("path"),wn=require("util");function Dt(e){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(l,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return l.default=e,Object.freeze(l)}const En=Dt(Ie),Be=Dt(Pl),yt=Dt(Dl),dt={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 Ae(e,l,t){return typeof l=="string"&&l.trim()===""&&(l=void 0),t instanceof Array?t.reduce((n,c)=>Ae(n,l,c),e):(t??(t=pt.platform),{...e??{},[t]:l})}function de(e,l){e??(e={});const t=e[l??pt.platform],n=e["*"];return n&&typeof n=="object"?Object.assign({},n,t):t??n}function $(e,...l){return function(...t){const n=t[t.length-1]||{},c=[e[0]];return l.forEach(function(i,o){const s=Number.isInteger(i)?t[i]:n[i];c.push(s,e[o+1])}),c.join("")}}function zt(e,l){return l=l??{},new Promise((t,n)=>{Sn.exec(e,l,(c,i,o)=>{if(c){n(c),console.error(i,c);return}if(o&&o!==""){n(o),console.error(i,c);return}(i==null?void 0:i.trim().length)===0&&localStorage.getItem("debug-plugin")==="1"&&console.log(i),t(i)})})}function Kn(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.substring(1,e.length-1):e}function Ut(e,l={}){for(;;)try{const t=Object.keys(l).filter(Qn),n=t.map(c=>l[c]);return new Function(...t,`{ return \`${e.replaceAll("\\","\\\\")}\` }`).bind(l)(...n)}catch(t){if(t instanceof ReferenceError&&t.message.endsWith("is not defined")){const n=t.message.substring(0,t.message.indexOf(" ")),c=Object.keys(l).filter(i=>i.toLowerCase()===n.toLowerCase()).map(i=>l[i])[0]??`\${${n}}`;l[n]=c}else throw t}}const Qn=e=>{if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0},zn={textemplate:{title:"Latex Template",type:"dropdown",options:[{name:"None",value:null},{name:"Dissertation",value:"dissertation.tex"},{name:"Academic Paper",value:"neurips.tex"}]}},De=(()=>{let e={};return e=Ae(e,{HOME:"${HOME}",PATH:"${PATH}",TEXINPUTS:"${pluginDir}/textemplate/:"},"*"),e=Ae(e,{TEXINPUTS:"${pluginDir}/textemplate/;",PATH:"${HOME}\\AppData\\Local\\Pandoc;${PATH}"},"win32"),e=Ae(e,{PATH:"/opt/homebrew/bin:/usr/local/bin:/Library/TeX/texbin:${PATH}"},"darwin"),e})(),Le={items:Object.values(dt).filter(e=>e.type!=="custom"),pandocPath:void 0,defaultExportDirectoryMode:"Auto",openExportedFile:!0,env:De,showExportProgressBar:!0};function _l(e){var l;return e.type==="pandoc"?e.extension:e.type==="custom"?(l=e.targetFileExtensions)==null?void 0:l.split(",")[0]:""}function ql(e,l){return e=Object.assign({},de(De),e),l=Object.assign({HOME:process.env.HOME??process.env.USERPROFILE},process.env,l??{}),Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Ut(n,l)]))}function Un(e){return e?Object.fromEntries(Object.entries(e).map(([l,t])=>[l,typeof t=="string"?zn[t.startsWith("preset:")?t.substring(7):""]:t])):{}}const jn=(e,l)=>e===l,pe=Symbol("solid-proxy"),jt=Symbol("solid-track"),mt={equals:jn};let en=on;const Fe=1,ut=2,tn={owned:null,cleanups:null,context:null,owner:null};var T=null;let Bt=null,Ln=null,O=null,le=null,Je=null,Xt=0;function Se(e,l){const t=O,n=T,c=e.length===0,i=n,o=c?tn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},s=c?e:()=>e(()=>P(()=>ft(o)));T=o,O=null;try{return Ue(s,!0)}finally{O=t,T=n}}function oe(e,l){l=l?Object.assign({},mt,l):mt;const t={value:e,observers:null,observerSlots:null,comparator:l.equals||void 0},n=c=>(typeof c=="function"&&(c=c(t.value)),sn(t,c));return[cn.bind(t),n]}function te(e,l,t){const n=_t(e,l,!1,Fe);tt(n)}function Ye(e,l,t){en=Pn;const n=_t(e,l,!1,Fe);n.user=!0,Je?Je.push(n):tt(n)}function ee(e,l,t){t=t?Object.assign({},mt,t):mt;const n=_t(e,l,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=t.equals||void 0,tt(n),cn.bind(n)}function gt(e){return Ue(e,!1)}function P(e){if(O===null)return e();const l=O;O=null;try{return e()}finally{O=l}}function ln(e){Ye(()=>P(e))}function ze(e){return T===null||(T.cleanups===null?T.cleanups=[e]:T.cleanups.push(e)),e}function Lt(){return O}function $n(e,l){const t=Symbol("context");return{id:t,Provider:_n(t),defaultValue:e}}function Tn(e){return T&&T.context&&T.context[e.id]!==void 0?T.context[e.id]:e.defaultValue}function nn(e){const l=ee(e),t=ee(()=>$t(l()));return t.toArray=()=>{const n=t();return Array.isArray(n)?n:n!=null?[n]:[]},t}function cn(){if(this.sources&&this.state)if(this.state===Fe)tt(this);else{const e=le;le=null,Ue(()=>It(this),!1),le=e}if(O){const e=this.observers?this.observers.length:0;O.sources?(O.sources.push(this),O.sourceSlots.push(e)):(O.sources=[this],O.sourceSlots=[e]),this.observers?(this.observers.push(O),this.observerSlots.push(O.sources.length-1)):(this.observers=[O],this.observerSlots=[O.sources.length-1])}return this.value}function sn(e,l,t){let n=e.value;return(!e.comparator||!e.comparator(n,l))&&(e.value=l,e.observers&&e.observers.length&&Ue(()=>{for(let c=0;c1e6)throw le=[],new Error},!1)),l}function tt(e){if(!e.fn)return;ft(e);const l=Xt;Mn(e,e.value,l)}function Mn(e,l,t){let n;const c=T,i=O;O=T=e;try{n=e.fn(l)}catch(o){return e.pure&&(e.state=Fe,e.owned&&e.owned.forEach(ft),e.owned=null),e.updatedAt=t+1,rn(o)}finally{O=i,T=c}(!e.updatedAt||e.updatedAt<=t)&&(e.updatedAt!=null&&"observers"in e?sn(e,n):e.value=n,e.updatedAt=t)}function _t(e,l,t,n=Fe,c){const i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:l,owner:T,context:T?T.context:null,pure:t};return T===null||T!==tn&&(T.owned?T.owned.push(i):T.owned=[i]),i}function Gt(e){if(e.state===0)return;if(e.state===ut)return It(e);if(e.suspense&&P(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===Fe)tt(e);else if(e.state===ut){const n=le;le=null,Ue(()=>It(e,l[0]),!1),le=n}}function Ue(e,l){if(le)return e();let t=!1;l||(le=[]),Je?t=!0:Je=[],Xt++;try{const n=e();return On(t),n}catch(n){t||(Je=null),le=null,rn(n)}}function On(e){if(le&&(on(le),le=null),e)return;const l=Je;Je=null,l.length&&Ue(()=>en(l),!1)}function on(e){for(let l=0;l=0;l--)ft(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 Dn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function rn(e,l=T){throw Dn(e)}function $t(e){if(typeof e=="function"&&!e.length)return $t(e());if(Array.isArray(e)){const l=[];for(let t=0;tc=P(()=>(T.context={...T.context,[e]:n.value},nn(()=>n.children))),void 0),c}}const qn=Symbol("fallback");function ul(e){for(let l=0;l1?[]:null;return ze(()=>ul(i)),()=>{let a=e()||[],Z,g;return a[jt],P(()=>{let x=a.length,p,Y,L,m,K,w,E,M,Q;if(x===0)o!==0&&(ul(i),i=[],n=[],c=[],o=0,s&&(s=[])),t.fallback&&(n=[qn],c[0]=Se(ge=>(i[0]=ge,t.fallback())),o=1);else if(o===0){for(c=new Array(x),g=0;g=w&&M>=w&&n[E]===a[M];E--,M--)L[M]=c[E],m[M]=i[E],s&&(K[M]=s[E]);for(p=new Map,Y=new Array(M+1),g=M;g>=w;g--)Q=a[g],Z=p.get(Q),Y[g]=Z===void 0?-1:Z,p.set(Q,g);for(Z=w;Z<=E;Z++)Q=n[Z],g=p.get(Q),g!==void 0&&g!==-1?(L[g]=c[Z],m[g]=i[Z],s&&(K[g]=s[Z]),g=Y[g],p.set(Q,g)):i[Z]();for(g=w;ge(l||{}))}function ct(){return!0}const Gl={get(e,l,t){return l===pe?t:e.get(l)},has(e,l){return l===pe?!0:e.has(l)},set:ct,deleteProperty:ct,getOwnPropertyDescriptor(e,l){return{configurable:!0,enumerable:!0,get(){return e.get(l)},set:ct,deleteProperty:ct}},ownKeys(e){return e.keys()}};function tc(e,...l){if(pe in e){const c=new Set(l.length>1?l.flat():l[0]),i=l.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},Gl));return i.push(new Proxy({get(o){return c.has(o)?void 0:e[o]},has(o){return c.has(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!c.has(o))}},Gl)),i}const t={},n=l.map(()=>({}));for(const c of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,c),o=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let s=!1,a=0;for(const Z of l)Z.includes(c)&&(s=!0,o?n[a][c]=i.value:Object.defineProperty(n[a],c,i)),++a;s||(o?t[c]=i.value:Object.defineProperty(t,c,i))}return[...n,t]}const dn=e=>`Stale read from <${e}>.`;function gn(e){const l="fallback"in e&&{fallback:()=>e.fallback};return ee(ec(()=>e.each,e.children,l||void 0))}function bt(e){const l=e.keyed,t=ee(()=>e.when,void 0,{equals:(n,c)=>l?n===c:!n==!c});return ee(()=>{const n=t();if(n){const c=e.children;return typeof c=="function"&&c.length>0?P(()=>c(l?n:()=>{if(!P(t))throw dn("Show");return e.when})):c}return e.fallback},void 0,void 0)}function lc(e){let l=!1;const t=(i,o)=>(l?i[1]===o[1]:!i[1]==!o[1])&&i[2]===o[2],n=nn(()=>e.children),c=ee(()=>{let i=n();Array.isArray(i)||(i=[i]);for(let o=0;o{const[i,o,s]=c();if(i<0)return e.fallback;const a=s.children;return typeof a=="function"&&a.length>0?P(()=>a(l?o:()=>{if(P(c)[0]!==i)throw dn("Match");return s.when})):a},void 0,void 0)}function Il(e){return e}const nc=["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"],cc=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...nc]),ic=new Set(["innerHTML","textContent","innerText","children"]),sc=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),oc=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,l){const t=oc[e];return typeof t=="object"?t[l]?t.$:void 0:t}const rc=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),dc=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"]),gc={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function bc(e,l,t){let n=t.length,c=l.length,i=n,o=0,s=0,a=l[c-1].nextSibling,Z=null;for(;og-s){const Y=l[o];for(;s{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},i=()=>(n||(n=c())).cloneNode(!0);return i.cloneNode=i,i}function qt(e,l=window.document){const t=l[Cl]||(l[Cl]=new Set);for(let n=0,c=e.length;nc.call(e,t[1],i))}else e.addEventListener(l,t)}function mc(e,l,t={}){const n=Object.keys(l||{}),c=Object.keys(t);let i,o;for(i=0,o=c.length;ic.children=_e(e,l.children,c.children)),te(()=>typeof l.ref=="function"?Rt(l.ref,e):l.ref=e),te(()=>Gc(e,l,t,!0,c,!0)),c}function Rt(e,l,t){return P(()=>e(l,t))}function ne(e,l,t,n){if(t!==void 0&&!n&&(n=[]),typeof l!="function")return _e(e,l,n,t);te(c=>_e(e,l(),c,t),n)}function Gc(e,l,t,n,c={},i=!1){l||(l={});for(const o in c)if(!(o in l)){if(o==="children")continue;c[o]=hl(e,o,null,c[o],t,i)}for(const o in l){if(o==="children")continue;const s=l[o];c[o]=hl(e,o,s,c[o],t,i)}}function Ic(e){return e.toLowerCase().replace(/-([a-z])/g,(l,t)=>t.toUpperCase())}function Wl(e,l,t){const n=l.trim().split(/\s+/);for(let c=0,i=n.length;c-1&&gc[l.split(":")[0]];I?Zc(e,I,l,t):xe(e,sc[l]||l,t)}return t}function Cc(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 n=t[l];if(n&&!t.disabled){const c=t[`${l}Data`];if(c!==void 0?n.call(t,c,e):n.call(t,e),e.cancelBubble)return}t=t._$host||t.parentNode||t.host}}function _e(e,l,t,n,c){for(;typeof t=="function";)t=t();if(l===t)return t;const i=typeof l,o=n!==void 0;if(e=o&&t[0]&&t[0].parentNode||e,i==="string"||i==="number"){if(i==="number"&&(l=l.toString(),l===t))return t;if(o){let s=t[0];s&&s.nodeType===3?s.data!==l&&(s.data=l):s=document.createTextNode(l),t=ve(e,t,n,s)}else t!==""&&typeof t=="string"?t=e.firstChild.data=l:t=e.textContent=l}else if(l==null||i==="boolean")t=ve(e,t,n);else{if(i==="function")return te(()=>{let s=l();for(;typeof s=="function";)s=s();t=_e(e,s,t,n)}),()=>t;if(Array.isArray(l)){const s=[],a=t&&Array.isArray(t);if(Tt(s,l,t,c))return te(()=>t=_e(e,s,t,n,!0)),()=>t;if(s.length===0){if(t=ve(e,t,n),o)return t}else a?t.length===0?pl(e,s,n):bc(e,t,s):(t&&ve(e),pl(e,s));t=s}else if(l.nodeType){if(Array.isArray(t)){if(o)return t=ve(e,t,n,l);ve(e,t,null,l)}else t==null||t===""||!e.firstChild?e.appendChild(l):e.replaceChild(l,e.firstChild);t=l}}return t}function Tt(e,l,t,n){let c=!1;for(let i=0,o=l.length;i=0;o--){const s=l[o];if(c!==s){const a=s.parentNode===e;!i&&!o?a?e.replaceChild(c,s):e.insertBefore(c,t):a&&s.remove()}else i=!0}}else e.insertBefore(c,t);return[c]}const Wc="http://www.w3.org/2000/svg";function hc(e,l=!1){return l?document.createElementNS(Wc,e):document.createElement(e)}function pc(e){const[l,t]=tc(e,["component"]),n=ee(()=>l.component);return ee(()=>{const c=n();switch(typeof c){case"function":return P(()=>c(t));case"string":const i=dc.has(c),o=hc(c,i);return uc(o,t,i),o}})}/** * @license * Copyright (c) 2016, Contributors * SPDX-License-Identifier: ISC */function Te(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let t="",n=!1;const c=e.match(/^-+/);for(let i=c?c[0].length:0;i0?n+=`${l}${t.charAt(c)}`:n+=o}return n}function mn(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 Xc(e){if(Array.isArray(e))return e.map(o=>typeof o!="string"?o+"":o);e=e.trim();let l=0,t=null,n=null,c=null;const i=[];for(let o=0;o{typeof b=="number"&&(m.nargs[r]=b,m.keys.push(r))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([r,b])=>{typeof b=="function"&&(m.coercions[r]=b,m.keys.push(r))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(r){m.configs[r]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([r,b])=>{(typeof b=="boolean"||typeof b=="function")&&(m.configs[r]=b)})),q(n.key,o,n.default,m.arrays),Object.keys(a).forEach(function(r){(m.aliases[r]||[]).forEach(function(b){a[b]=a[r]})});let E=null;kn();let M=[];const Q=Object.assign(Object.create(null),{_:[]}),ge={};for(let r=0;r=3&&(V(A[1],m.arrays)?r=f(r,A[1],c,A[2]):V(A[1],m.nargs)!==!1?r=X(r,A[1],c,A[2]):R(A[1],A[2],!0));else if(b.match(w)&&s["boolean-negation"])A=b.match(w),A!==null&&Array.isArray(A)&&A.length>=2&&(d=A[1],R(d,V(d,m.arrays)?[!1]:!1));else if(b.match(/^--.+/)||!s["short-option-groups"]&&b.match(/^-[^-]+/))A=b.match(/^--?(.+)/),A!==null&&Array.isArray(A)&&A.length>=2&&(d=A[1],V(d,m.arrays)?r=f(r,d,c):V(d,m.nargs)!==!1?r=X(r,d,c):(B=c[r+1],B!==void 0&&(!B.match(/^-/)||B.match(K))&&!V(d,m.bools)&&!V(d,m.counts)||/^(true|false)$/.test(B)?(R(d,B),r++):R(d,Ne(d))));else if(b.match(/^-.\..+=/))A=b.match(/^-([^=]+)=([\s\S]*)$/),A!==null&&Array.isArray(A)&&A.length>=3&&R(A[1],A[2]);else if(b.match(/^-.\..+/)&&!b.match(K))B=c[r+1],A=b.match(/^-(.\..+)/),A!==null&&Array.isArray(A)&&A.length>=2&&(d=A[1],B!==void 0&&!B.match(/^-/)&&!V(d,m.bools)&&!V(d,m.counts)?(R(d,B),r++):R(d,Ne(d)));else if(b.match(/^-[^-]+/)&&!b.match(K)){y=b.slice(1,-1).split(""),u=!1;for(let ie=0;ier!=="--"&&r.includes("-")).forEach(r=>{delete Q[r]}),s["strip-aliased"]&&[].concat(...Object.keys(o).map(r=>o[r])).forEach(r=>{s["camel-case-expansion"]&&r.includes("-")&&delete Q[r.split(".").map(b=>Te(b)).join(".")],delete Q[r]});function be(r){const b=W("_",r);(typeof b=="string"||typeof b=="number")&&Q._.push(b)}function X(r,b,h,u){let d,y=V(b,m.nargs);if(y=typeof y!="number"||isNaN(y)?1:y,y===0)return fe(u)||(E=Error(L("Argument unexpected for: %s",b))),R(b,Ne(b)),r;let A=fe(u)?0:1;if(s["nargs-eats-options"])h.length-(r+1)+A0&&(R(b,u),B--),d=r+1;d0||A&&typeof A=="number"&&d.length>=A||(y=h[B],/^-/.test(y)&&!K.test(y)&&!He(y)));B++)r=B,d.push(D(b,y,i))}return typeof A=="number"&&(A&&d.length1&&s["dot-notation"]&&(m.aliases[d[0]]||[]).forEach(function(y){let A=y.split(".");const B=[].concat(d);B.shift(),A=A.concat(B),(m.aliases[r]||[]).includes(A.join("."))||U(Q,A,u)}),V(r,m.normalize)&&!V(r,m.arrays)&&[r].concat(m.aliases[r]||[]).forEach(function(A){Object.defineProperty(ge,A,{enumerable:!0,get(){return b},set(B){b=typeof B=="string"?Re.normalize(B):B}})})}function v(r,b){m.aliases[r]&&m.aliases[r].length||(m.aliases[r]=[b],p[b]=!0),m.aliases[b]&&m.aliases[b].length||v(b,r)}function D(r,b,h){h&&(b=Vc(b)),(V(r,m.bools)||V(r,m.counts))&&typeof b=="string"&&(b=b==="true");let u=Array.isArray(b)?b.map(function(d){return W(r,d)}):W(r,b);return V(r,m.counts)&&(fe(u)||typeof u=="boolean")&&(u=Ft()),V(r,m.normalize)&&V(r,m.arrays)&&(Array.isArray(b)?u=b.map(d=>Re.normalize(d)):u=Re.normalize(b)),u}function W(r,b){return!s["parse-positional-numbers"]&&r==="_"||!V(r,m.strings)&&!V(r,m.bools)&&!Array.isArray(b)&&(mn(b)&&s["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${b}`)))||!fe(b)&&V(r,m.numbers))&&(b=Number(b)),b}function C(r){const b=Object.create(null);z(b,m.aliases,a),Object.keys(m.configs).forEach(function(h){const u=r[h]||b[h];if(u)try{let d=null;const y=Re.resolve(Re.cwd(),u),A=m.configs[h];if(typeof A=="function"){try{d=A(y)}catch(B){d=B}if(d instanceof Error){E=d;return}}else d=Re.require(y);N(d)}catch(d){d.name==="PermissionDenied"?E=d:r[h]&&(E=Error(L("Invalid JSON config file: %s",u)))}})}function N(r,b){Object.keys(r).forEach(function(h){const u=r[h],d=b?b+"."+h:h;typeof u=="object"&&u!==null&&!Array.isArray(u)&&s["dot-notation"]?N(u,d):(!S(Q,d.split("."))||V(d,m.arrays)&&s["combine-arrays"])&&R(d,u)})}function F(){typeof Z<"u"&&Z.forEach(function(r){N(r)})}function H(r,b){if(typeof g>"u")return;const h=typeof g=="string"?g:"",u=Re.env();Object.keys(u).forEach(function(d){if(h===""||d.lastIndexOf(h,0)===0){const y=d.split("__").map(function(A,B){return B===0&&(A=A.substring(h.length)),Te(A)});(b&&m.configs[y.join(".")]||!b)&&!S(r,y)&&R(y.join("."),u[d])}})}function J(r){let b;const h=new Set;Object.keys(r).forEach(function(u){if(!h.has(u)&&(b=V(u,m.coercions),typeof b=="function"))try{const d=W(u,b(r[u]));[].concat(m.aliases[u]||[],u).forEach(y=>{h.add(y),r[y]=d})}catch(d){E=d}})}function k(r){return m.keys.forEach(b=>{~b.indexOf(".")||typeof r[b]>"u"&&(r[b]=void 0)}),r}function z(r,b,h,u=!1){Object.keys(h).forEach(function(d){S(r,d.split("."))||(U(r,d.split("."),h[d]),u&&(Y[d]=!0),(b[d]||[]).forEach(function(y){S(r,y.split("."))||U(r,y.split("."),h[d])}))})}function S(r,b){let h=r;s["dot-notation"]||(b=[b.join(".")]),b.slice(0,-1).forEach(function(d){h=h[d]||{}});const u=b[b.length-1];return typeof h!="object"?!1:u in h}function U(r,b,h){let u=r;s["dot-notation"]||(b=[b.join(".")]),b.slice(0,-1).forEach(function(_){_=Xl(_),typeof u=="object"&&u[_]===void 0&&(u[_]={}),typeof u[_]!="object"||Array.isArray(u[_])?(Array.isArray(u[_])?u[_].push({}):u[_]=[u[_],{}],u=u[_][u[_].length-1]):u=u[_]});const d=Xl(b[b.length-1]),y=V(b.join("."),m.arrays),A=Array.isArray(h);let B=s["duplicate-arguments-array"];!B&&V(d,m.nargs)&&(B=!0,(!fe(u[d])&&m.nargs[d]===1||Array.isArray(u[d])&&u[d].length===m.nargs[d])&&(u[d]=void 0)),h===Ft()?u[d]=Ft(u[d]):Array.isArray(u[d])?B&&y&&A?u[d]=s["flatten-duplicate-arrays"]?u[d].concat(h):(Array.isArray(u[d][0])?u[d]:[u[d]]).concat([h]):!B&&!!y==!!A?u[d]=h:u[d]=u[d].concat([h]):u[d]===void 0&&y?u[d]=A?h:[h]:B&&!(u[d]===void 0||V(d,m.counts)||V(d,m.bools))?u[d]=[u[d],h]:u[d]=h}function q(...r){r.forEach(function(b){Object.keys(b||{}).forEach(function(h){m.aliases[h]||(m.aliases[h]=[].concat(o[h]||[]),m.aliases[h].concat(h).forEach(function(u){if(/-/.test(u)&&s["camel-case-expansion"]){const d=Te(u);d!==h&&m.aliases[h].indexOf(d)===-1&&(m.aliases[h].push(d),p[d]=!0)}}),m.aliases[h].concat(h).forEach(function(u){if(u.length>1&&/[A-Z]/.test(u)&&s["camel-case-expansion"]){const d=Zn(u,"-");d!==h&&m.aliases[h].indexOf(d)===-1&&(m.aliases[h].push(d),p[d]=!0)}}),m.aliases[h].forEach(function(u){m.aliases[u]=[h].concat(m.aliases[h].filter(function(d){return u!==d}))}))})})}function V(r,b){const h=[].concat(m.aliases[r]||[],r),u=Object.keys(b),d=h.find(y=>u.includes(y));return d?b[d]:!1}function me(r){const b=Object.keys(m);return[].concat(b.map(u=>m[u])).some(function(u){return Array.isArray(u)?u.includes(r):u[r]})}function ce(r,...b){return[].concat(...b).some(function(u){const d=r.match(u);return d&&me(d[1])})}function Xe(r){if(r.match(K)||!r.match(/^-[^-]+/))return!1;let b=!0,h;const u=r.slice(1).split("");for(let d=0;dV(r,m.arrays)?(E=Error(L("Invalid configuration: %s, opts.count excludes opts.array.",r)),!0):V(r,m.nargs)?(E=Error(L("Invalid configuration: %s, opts.count excludes opts.narg.",r)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(ge,Q),configuration:s,defaulted:Object.assign({},Y),error:E,newAliases:Object.assign({},p)}}}function Rc(e){const l=[],t=Object.create(null);let n=!0;for(Object.keys(e).forEach(function(c){l.push([].concat(e[c],c))});n;){n=!1;for(let c=0;cAc,format:wn.format,normalize:ae.normalize,resolve:ae.resolve,require:e=>{if(typeof require<"u")return require(e);if(e.match(/\.json$/))return JSON.parse(Dl.readFileSync(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),lt=function(l,t){return un.parse(l.slice(),t).argv};lt.detailed=function(e,l){return un.parse(e.slice(),l)};lt.camelCase=Te;lt.decamelize=Zn;lt.looksLikeNumber=mn;const Yc={exportToOo:"导出为......",exportWithPrevious:"使用上一次设置导出",exportSuccessNotice:$`导出文件 ${0} 成功!`,exportCommandOutputMessage:$`命令:${0}`,exportErrorOutputMessage:$`命令 ${0},错误:${1}`,pleaseOpenFile:"请打开一个文件先。",preparing:$`正在生成 "${0}" ......`,exportDialog:{fileName:"文件名",type:"类型",exportTo:"导出到",title:$`导出为 ${0}`,export:"导出",selectExportFolder:"请选择导出文件夹",overwriteConfirmation:"覆盖提示"},messageBox:{yes:"是",no:"否",ok:"确认",cancel:"取消"},overwriteConfirmationDialog:{replace:"替换",title:$`"${0}" 已经存在。您要替换它吗?`,message:$`"${0}" 文件夹中已有相同的文件或文件夹,若替换,则会覆盖其当前内容。`},settingTab:{title:"导出设置",general:"通用",name:"名称",customLocation:"自定义",pandocVersion:$`版本: ${0}`,pandocVersionWithWarning:$`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:"显示导出进度条"}},Jc={exportToOo:"Export to...",exportSuccessNotice:$`Export file ${0} success!`,exportCommandOutputMessage:$`Command: ${0}`,exportErrorOutputMessage:$`Command: ${0},Error:${1}`,exportWithPrevious:"Export with Previous",pleaseOpenFile:"Please open a file first.",preparing:$`generating "${0}"...`,exportDialog:{exportTo:"Export to",fileName:"File Name",title:$`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:$`"${0}" already exists. Do you want to replace it?`,message:$`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:$`Version: ${0}`,pandocVersionWithWarning:$`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."}},xc={exportToOo:"Export to...",exportSuccessNotice:$`Export der Datei ${0} erfolgreich!`,exportCommandOutputMessage:$`Command: ${0}`,exportErrorOutputMessage:$`Command: ${0},Fehler:${1}`,exportWithPrevious:"Exportiere mit Vorherigem",pleaseOpenFile:"Bitte öffne zunächst eine Datei.",preparing:$`generating "${0}"...`,exportDialog:{exportTo:"Exportiere nach",fileName:"Dateiname",title:$`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:$`"${0}" existiert bereits. Soll er ersetzt werden?`,message:$`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:$`Version: ${0}`,pandocVersionWithWarning:$`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"}},Gn={"de-DE":xc,"en-US":Jc,"zh-CN":Yc,get current(){const e=Object.keys(this),l=Ie.moment.locale().toLowerCase();let t=e.find(c=>c.toLowerCase()===l.toLowerCase());if(t)return this[t];const n=l.split("-")[0];return t=e.find(c=>c.toLowerCase().startsWith(n)),t?this[t]:this["en-US"]}};class Vl extends Ie.Modal{constructor(l,t,n){super(l),this.options=typeof t=="string"?{message:t,buttons:"Ok",title:n}:t,this.lang=Gn.current}onOpen(){const{titleEl:l,contentEl:t,lang:n,options:{message:c,title:i,buttons:o,callback:s,buttonsLabel:a,buttonsClass:Z}}=this;switch(i&&l.setText(i),t.createDiv({text:c}),o){case"Yes":t.createEl("div",{cls:["modal-button-container"],parent:t},g=>{g.createEl("button",{text:(a==null?void 0:a.yes)??n.messageBox.yes,cls:["mod-cta",Z==null?void 0:Z.yes],parent:g}).onclick=()=>this.call(s==null?void 0:s.yes)});break;case"YesNo":t.createEl("div",{cls:["modal-button-container"],parent:t},g=>{g.createEl("button",{text:(a==null?void 0:a.yes)??n.messageBox.yes,cls:["mod-cta",Z==null?void 0:Z.yes],parent:g}).onclick=()=>this.call(s==null?void 0:s.yes),g.createEl("button",{text:(a==null?void 0:a.no)??n.messageBox.no,cls:["mod-cta",Z==null?void 0:Z.no],parent:g}).onclick=()=>this.call(s==null?void 0:s.no)});break;case"Ok":t.createEl("div",{cls:["modal-button-container"],parent:t},g=>{g.createEl("button",{text:(a==null?void 0:a.ok)??n.messageBox.ok,cls:["mod-cta",Z==null?void 0:Z.no],parent:g}).onclick=()=>this.call(s==null?void 0:s.ok)});break;case"OkCancel":t.createEl("div",{cls:["modal-button-container"],parent:t},g=>{g.createEl("button",{text:(a==null?void 0:a.ok)??n.messageBox.ok,cls:["mod-cta",Z==null?void 0:Z.ok],parent:g}).onclick=()=>this.call(s==null?void 0:s.ok),g.createEl("button",{text:(a==null?void 0:a.cancel)??n.messageBox.cancel,cls:["mod-cta",Z==null?void 0:Z.cancel],parent:g}).onclick=()=>this.call(s==null?void 0:s.cancel)});break}}call(l){l&&l(),this.close()}onClose(){const{contentEl:l}=this;l.empty()}}var yc=Ze('
');const Bc=e=>(()=>{var l=yc(),t=l.firstChild,n=e.ref;return typeof n=="function"?Rt(n,l):e.ref=l,ne(t,()=>e.message),l})(),Fc=e=>Se(l=>{let t=!1;const n=()=>{t||(t=!0,l())};let c;return ne(document.body,()=>G(Bc,{ref(i){var o=c;typeof o=="function"?o(i):c=i},message:e})),ze(()=>{c instanceof Node&&document.body.contains(c)&&document.body.removeChild(c)}),n}),Hc={show:Fc};function Nc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mt={exports:{}};const vc="2.0.0",In=256,kc=Number.MAX_SAFE_INTEGER||9007199254740991,Sc=16,wc=In-6,Ec=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Vt={MAX_LENGTH:In,MAX_SAFE_COMPONENT_LENGTH:Sc,MAX_SAFE_BUILD_LENGTH:wc,MAX_SAFE_INTEGER:kc,RELEASE_TYPES:Ec,SEMVER_SPEC_VERSION:vc,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Kc=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var At=Kc;(function(e,l){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:c}=Vt,i=At;l=e.exports={};const o=l.re=[],s=l.safeRe=[],a=l.src=[],Z=l.t={};let g=0;const I="[a-zA-Z0-9-]",x=[["\\s",1],["\\d",c],[I,n]],p=L=>{for(const[m,K]of x)L=L.split(`${m}*`).join(`${m}{0,${K}}`).split(`${m}+`).join(`${m}{1,${K}}`);return L},Y=(L,m,K)=>{const w=p(m),E=g++;i(L,E,m),Z[L]=E,a[E]=m,o[E]=new RegExp(m,K?"g":void 0),s[E]=new RegExp(w,K?"g":void 0)};Y("NUMERICIDENTIFIER","0|[1-9]\\d*"),Y("NUMERICIDENTIFIERLOOSE","\\d+"),Y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${I}*`),Y("MAINVERSION",`(${a[Z.NUMERICIDENTIFIER]})\\.(${a[Z.NUMERICIDENTIFIER]})\\.(${a[Z.NUMERICIDENTIFIER]})`),Y("MAINVERSIONLOOSE",`(${a[Z.NUMERICIDENTIFIERLOOSE]})\\.(${a[Z.NUMERICIDENTIFIERLOOSE]})\\.(${a[Z.NUMERICIDENTIFIERLOOSE]})`),Y("PRERELEASEIDENTIFIER",`(?:${a[Z.NUMERICIDENTIFIER]}|${a[Z.NONNUMERICIDENTIFIER]})`),Y("PRERELEASEIDENTIFIERLOOSE",`(?:${a[Z.NUMERICIDENTIFIERLOOSE]}|${a[Z.NONNUMERICIDENTIFIER]})`),Y("PRERELEASE",`(?:-(${a[Z.PRERELEASEIDENTIFIER]}(?:\\.${a[Z.PRERELEASEIDENTIFIER]})*))`),Y("PRERELEASELOOSE",`(?:-?(${a[Z.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[Z.PRERELEASEIDENTIFIERLOOSE]})*))`),Y("BUILDIDENTIFIER",`${I}+`),Y("BUILD",`(?:\\+(${a[Z.BUILDIDENTIFIER]}(?:\\.${a[Z.BUILDIDENTIFIER]})*))`),Y("FULLPLAIN",`v?${a[Z.MAINVERSION]}${a[Z.PRERELEASE]}?${a[Z.BUILD]}?`),Y("FULL",`^${a[Z.FULLPLAIN]}$`),Y("LOOSEPLAIN",`[v=\\s]*${a[Z.MAINVERSIONLOOSE]}${a[Z.PRERELEASELOOSE]}?${a[Z.BUILD]}?`),Y("LOOSE",`^${a[Z.LOOSEPLAIN]}$`),Y("GTLT","((?:<|>)?=?)"),Y("XRANGEIDENTIFIERLOOSE",`${a[Z.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),Y("XRANGEIDENTIFIER",`${a[Z.NUMERICIDENTIFIER]}|x|X|\\*`),Y("XRANGEPLAIN",`[v=\\s]*(${a[Z.XRANGEIDENTIFIER]})(?:\\.(${a[Z.XRANGEIDENTIFIER]})(?:\\.(${a[Z.XRANGEIDENTIFIER]})(?:${a[Z.PRERELEASE]})?${a[Z.BUILD]}?)?)?`),Y("XRANGEPLAINLOOSE",`[v=\\s]*(${a[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[Z.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[Z.XRANGEIDENTIFIERLOOSE]})(?:${a[Z.PRERELEASELOOSE]})?${a[Z.BUILD]}?)?)?`),Y("XRANGE",`^${a[Z.GTLT]}\\s*${a[Z.XRANGEPLAIN]}$`),Y("XRANGELOOSE",`^${a[Z.GTLT]}\\s*${a[Z.XRANGEPLAINLOOSE]}$`),Y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),Y("COERCE",`${a[Z.COERCEPLAIN]}(?:$|[^\\d])`),Y("COERCEFULL",a[Z.COERCEPLAIN]+`(?:${a[Z.PRERELEASE]})?(?:${a[Z.BUILD]})?(?:$|[^\\d])`),Y("COERCERTL",a[Z.COERCE],!0),Y("COERCERTLFULL",a[Z.COERCEFULL],!0),Y("LONETILDE","(?:~>?)"),Y("TILDETRIM",`(\\s*)${a[Z.LONETILDE]}\\s+`,!0),l.tildeTrimReplace="$1~",Y("TILDE",`^${a[Z.LONETILDE]}${a[Z.XRANGEPLAIN]}$`),Y("TILDELOOSE",`^${a[Z.LONETILDE]}${a[Z.XRANGEPLAINLOOSE]}$`),Y("LONECARET","(?:\\^)"),Y("CARETTRIM",`(\\s*)${a[Z.LONECARET]}\\s+`,!0),l.caretTrimReplace="$1^",Y("CARET",`^${a[Z.LONECARET]}${a[Z.XRANGEPLAIN]}$`),Y("CARETLOOSE",`^${a[Z.LONECARET]}${a[Z.XRANGEPLAINLOOSE]}$`),Y("COMPARATORLOOSE",`^${a[Z.GTLT]}\\s*(${a[Z.LOOSEPLAIN]})$|^$`),Y("COMPARATOR",`^${a[Z.GTLT]}\\s*(${a[Z.FULLPLAIN]})$|^$`),Y("COMPARATORTRIM",`(\\s*)${a[Z.GTLT]}\\s*(${a[Z.LOOSEPLAIN]}|${a[Z.XRANGEPLAIN]})`,!0),l.comparatorTrimReplace="$1$2$3",Y("HYPHENRANGE",`^\\s*(${a[Z.XRANGEPLAIN]})\\s+-\\s+(${a[Z.XRANGEPLAIN]})\\s*$`),Y("HYPHENRANGELOOSE",`^\\s*(${a[Z.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[Z.XRANGEPLAINLOOSE]})\\s*$`),Y("STAR","(<|>)?=?\\s*\\*"),Y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),Y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Mt,Mt.exports);var nt=Mt.exports;const Qc=Object.freeze({loose:!0}),zc=Object.freeze({}),Uc=e=>e?typeof e!="object"?Qc:e:zc;var ll=Uc;const Al=/^[0-9]+$/,Cn=(e,l)=>{const t=Al.test(e),n=Al.test(l);return t&&n&&(e=+e,l=+l),e===l?0:t&&!n?-1:n&&!t?1:eCn(l,e);var Wn={compareIdentifiers:Cn,rcompareIdentifiers:jc};const it=At,{MAX_LENGTH:Yl,MAX_SAFE_INTEGER:st}=Vt,{safeRe:Jl,t:xl}=nt,Lc=ll,{compareIdentifiers:ke}=Wn;let $c=class he{constructor(l,t){if(t=Lc(t),l instanceof he){if(l.loose===!!t.loose&&l.includePrerelease===!!t.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>Yl)throw new TypeError(`version is longer than ${Yl} characters`);it("SemVer",l,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=l.trim().match(t.loose?Jl[xl.LOOSE]:Jl[xl.FULL]);if(!n)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>st||this.major<0)throw new TypeError("Invalid major version");if(this.minor>st||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>st||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(t===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(c)}}if(t){let i=[t,c];n===!1&&(i=[t]),ke(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var se=$c;const yl=se,Tc=(e,l,t=!1)=>{if(e instanceof yl)return e;try{return new yl(e,l)}catch(n){if(!t)return null;throw n}};var je=Tc;const Mc=je,Oc=(e,l)=>{const t=Mc(e,l);return t?t.version:null};var Pc=Oc;const Dc=je,_c=(e,l)=>{const t=Dc(e.trim().replace(/^[=v]+/,""),l);return t?t.version:null};var qc=_c;const Bl=se,ei=(e,l,t,n,c)=>{typeof t=="string"&&(c=n,n=t,t=void 0);try{return new Bl(e instanceof Bl?e.version:e,t).inc(l,n,c).version}catch{return null}};var ti=ei;const Fl=je,li=(e,l)=>{const t=Fl(e,null,!0),n=Fl(l,null,!0),c=t.compare(n);if(c===0)return null;const i=c>0,o=i?t:n,s=i?n:t,a=!!o.prerelease.length;if(!!s.prerelease.length&&!a)return!s.patch&&!s.minor?"major":o.patch?"patch":o.minor?"minor":"major";const g=a?"pre":"";return t.major!==n.major?g+"major":t.minor!==n.minor?g+"minor":t.patch!==n.patch?g+"patch":"prerelease"};var ni=li;const ci=se,ii=(e,l)=>new ci(e,l).major;var si=ii;const oi=se,ai=(e,l)=>new oi(e,l).minor;var ri=ai;const di=se,gi=(e,l)=>new di(e,l).patch;var bi=gi;const Zi=je,mi=(e,l)=>{const t=Zi(e,l);return t&&t.prerelease.length?t.prerelease:null};var ui=mi;const Hl=se,Gi=(e,l,t)=>new Hl(e,t).compare(new Hl(l,t));var Ce=Gi;const Ii=Ce,Ci=(e,l,t)=>Ii(l,e,t);var Wi=Ci;const hi=Ce,pi=(e,l)=>hi(e,l,!0);var Xi=pi;const Nl=se,fi=(e,l,t)=>{const n=new Nl(e,t),c=new Nl(l,t);return n.compare(c)||n.compareBuild(c)};var nl=fi;const Ri=nl,Vi=(e,l)=>e.sort((t,n)=>Ri(t,n,l));var Ai=Vi;const Yi=nl,Ji=(e,l)=>e.sort((t,n)=>Yi(n,t,l));var xi=Ji;const yi=Ce,Bi=(e,l,t)=>yi(e,l,t)>0;var Yt=Bi;const Fi=Ce,Hi=(e,l,t)=>Fi(e,l,t)<0;var cl=Hi;const Ni=Ce,vi=(e,l,t)=>Ni(e,l,t)===0;var hn=vi;const ki=Ce,Si=(e,l,t)=>ki(e,l,t)!==0;var pn=Si;const wi=Ce,Ei=(e,l,t)=>wi(e,l,t)>=0;var il=Ei;const Ki=Ce,Qi=(e,l,t)=>Ki(e,l,t)<=0;var sl=Qi;const zi=hn,Ui=pn,ji=Yt,Li=il,$i=cl,Ti=sl,Mi=(e,l,t,n)=>{switch(l){case"===":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e===t;case"!==":return typeof e=="object"&&(e=e.version),typeof t=="object"&&(t=t.version),e!==t;case"":case"=":case"==":return zi(e,t,n);case"!=":return Ui(e,t,n);case">":return ji(e,t,n);case">=":return Li(e,t,n);case"<":return $i(e,t,n);case"<=":return Ti(e,t,n);default:throw new TypeError(`Invalid operator: ${l}`)}};var Xn=Mi;const Oi=se,Pi=je,{safeRe:ot,t:at}=nt,Di=(e,l)=>{if(e instanceof Oi)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;l=l||{};let t=null;if(!l.rtl)t=e.match(l.includePrerelease?ot[at.COERCEFULL]:ot[at.COERCE]);else{const a=l.includePrerelease?ot[at.COERCERTLFULL]:ot[at.COERCERTL];let Z;for(;(Z=a.exec(e))&&(!t||t.index+t[0].length!==e.length);)(!t||Z.index+Z[0].length!==t.index+t[0].length)&&(t=Z),a.lastIndex=Z.index+Z[1].length+Z[2].length;a.lastIndex=-1}if(t===null)return null;const n=t[2],c=t[3]||"0",i=t[4]||"0",o=l.includePrerelease&&t[5]?`-${t[5]}`:"",s=l.includePrerelease&&t[6]?`+${t[6]}`:"";return Pi(`${n}.${c}.${i}${o}${s}`,l)};var _i=Di;class qi{constructor(){this.max=1e3,this.map=new Map}get(l){const t=this.map.get(l);if(t!==void 0)return this.map.delete(l),this.map.set(l,t),t}delete(l){return this.map.delete(l)}set(l,t){if(!this.delete(l)&&t!==void 0){if(this.map.size>=this.max){const c=this.map.keys().next().value;this.delete(c)}this.map.set(l,t)}return this}}var es=qi,kt,vl;function We(){if(vl)return kt;vl=1;class e{constructor(C,N){if(N=n(N),C instanceof e)return C.loose===!!N.loose&&C.includePrerelease===!!N.includePrerelease?C:new e(C.raw,N);if(C instanceof c)return this.raw=C.value,this.set=[[C]],this.format(),this;if(this.options=N,this.loose=!!N.loose,this.includePrerelease=!!N.includePrerelease,this.raw=C.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(F=>this.parseRange(F.trim())).filter(F=>F.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const F=this.set[0];if(this.set=this.set.filter(H=>!Y(H[0])),this.set.length===0)this.set=[F];else if(this.set.length>1){for(const H of this.set)if(H.length===1&&L(H[0])){this.set=[H];break}}}this.format()}format(){return this.range=this.set.map(C=>C.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(C){const F=((this.options.includePrerelease&&x)|(this.options.loose&&p))+":"+C,H=t.get(F);if(H)return H;const J=this.options.loose,k=J?s[a.HYPHENRANGELOOSE]:s[a.HYPHENRANGE];C=C.replace(k,v(this.options.includePrerelease)),i("hyphen replace",C),C=C.replace(s[a.COMPARATORTRIM],Z),i("comparator trim",C),C=C.replace(s[a.TILDETRIM],g),i("tilde trim",C),C=C.replace(s[a.CARETTRIM],I),i("caret trim",C);let z=C.split(" ").map(V=>K(V,this.options)).join(" ").split(/\s+/).map(V=>R(V,this.options));J&&(z=z.filter(V=>(i("loose invalid filter",V,this.options),!!V.match(s[a.COMPARATORLOOSE])))),i("range list",z);const S=new Map,U=z.map(V=>new c(V,this.options));for(const V of U){if(Y(V))return[V];S.set(V.value,V)}S.size>1&&S.has("")&&S.delete("");const q=[...S.values()];return t.set(F,q),q}intersects(C,N){if(!(C instanceof e))throw new TypeError("a Range is required");return this.set.some(F=>m(F,N)&&C.set.some(H=>m(H,N)&&F.every(J=>H.every(k=>J.intersects(k,N)))))}test(C){if(!C)return!1;if(typeof C=="string")try{C=new o(C,this.options)}catch{return!1}for(let N=0;NW.value==="<0.0.0-0",L=W=>W.value==="",m=(W,C)=>{let N=!0;const F=W.slice();let H=F.pop();for(;N&&F.length;)N=F.every(J=>H.intersects(J,C)),H=F.pop();return N},K=(W,C)=>(i("comp",W,C),W=Q(W,C),i("caret",W),W=E(W,C),i("tildes",W),W=be(W,C),i("xrange",W),W=f(W,C),i("stars",W),W),w=W=>!W||W.toLowerCase()==="x"||W==="*",E=(W,C)=>W.trim().split(/\s+/).map(N=>M(N,C)).join(" "),M=(W,C)=>{const N=C.loose?s[a.TILDELOOSE]:s[a.TILDE];return W.replace(N,(F,H,J,k,z)=>{i("tilde",W,F,H,J,k,z);let S;return w(H)?S="":w(J)?S=`>=${H}.0.0 <${+H+1}.0.0-0`:w(k)?S=`>=${H}.${J}.0 <${H}.${+J+1}.0-0`:z?(i("replaceTilde pr",z),S=`>=${H}.${J}.${k}-${z} <${H}.${+J+1}.0-0`):S=`>=${H}.${J}.${k} <${H}.${+J+1}.0-0`,i("tilde return",S),S})},Q=(W,C)=>W.trim().split(/\s+/).map(N=>ge(N,C)).join(" "),ge=(W,C)=>{i("caret",W,C);const N=C.loose?s[a.CARETLOOSE]:s[a.CARET],F=C.includePrerelease?"-0":"";return W.replace(N,(H,J,k,z,S)=>{i("caret",W,H,J,k,z,S);let U;return w(J)?U="":w(k)?U=`>=${J}.0.0${F} <${+J+1}.0.0-0`:w(z)?J==="0"?U=`>=${J}.${k}.0${F} <${J}.${+k+1}.0-0`:U=`>=${J}.${k}.0${F} <${+J+1}.0.0-0`:S?(i("replaceCaret pr",S),J==="0"?k==="0"?U=`>=${J}.${k}.${z}-${S} <${J}.${k}.${+z+1}-0`:U=`>=${J}.${k}.${z}-${S} <${J}.${+k+1}.0-0`:U=`>=${J}.${k}.${z}-${S} <${+J+1}.0.0-0`):(i("no pr"),J==="0"?k==="0"?U=`>=${J}.${k}.${z}${F} <${J}.${k}.${+z+1}-0`:U=`>=${J}.${k}.${z}${F} <${J}.${+k+1}.0-0`:U=`>=${J}.${k}.${z} <${+J+1}.0.0-0`),i("caret return",U),U})},be=(W,C)=>(i("replaceXRanges",W,C),W.split(/\s+/).map(N=>X(N,C)).join(" ")),X=(W,C)=>{W=W.trim();const N=C.loose?s[a.XRANGELOOSE]:s[a.XRANGE];return W.replace(N,(F,H,J,k,z,S)=>{i("xRange",W,F,H,J,k,z,S);const U=w(J),q=U||w(k),V=q||w(z),me=V;return H==="="&&me&&(H=""),S=C.includePrerelease?"-0":"",U?H===">"||H==="<"?F="<0.0.0-0":F="*":H&&me?(q&&(k=0),z=0,H===">"?(H=">=",q?(J=+J+1,k=0,z=0):(k=+k+1,z=0)):H==="<="&&(H="<",q?J=+J+1:k=+k+1),H==="<"&&(S="-0"),F=`${H+J}.${k}.${z}${S}`):q?F=`>=${J}.0.0${S} <${+J+1}.0.0-0`:V&&(F=`>=${J}.${k}.0${S} <${J}.${+k+1}.0-0`),i("xRange return",F),F})},f=(W,C)=>(i("replaceStars",W,C),W.trim().replace(s[a.STAR],"")),R=(W,C)=>(i("replaceGTE0",W,C),W.trim().replace(s[C.includePrerelease?a.GTE0PRE:a.GTE0],"")),v=W=>(C,N,F,H,J,k,z,S,U,q,V,me)=>(w(F)?N="":w(H)?N=`>=${F}.0.0${W?"-0":""}`:w(J)?N=`>=${F}.${H}.0${W?"-0":""}`:k?N=`>=${N}`:N=`>=${N}${W?"-0":""}`,w(U)?S="":w(q)?S=`<${+U+1}.0.0-0`:w(V)?S=`<${U}.${+q+1}.0-0`:me?S=`<=${U}.${q}.${V}-${me}`:W?S=`<${U}.${q}.${+V+1}-0`:S=`<=${S}`,`${N} ${S}`.trim()),D=(W,C,N)=>{for(let F=0;F0){const H=W[F].semver;if(H.major===C.major&&H.minor===C.minor&&H.patch===C.patch)return!0}return!1}return!0};return kt}var St,kl;function Jt(){if(kl)return St;kl=1;const e=Symbol("SemVer ANY");class l{static get ANY(){return e}constructor(g,I){if(I=t(I),g instanceof l){if(g.loose===!!I.loose)return g;g=g.value}g=g.trim().split(/\s+/).join(" "),o("comparator",g,I),this.options=I,this.loose=!!I.loose,this.parse(g),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(g){const I=this.options.loose?n[c.COMPARATORLOOSE]:n[c.COMPARATOR],x=g.match(I);if(!x)throw new TypeError(`Invalid comparator: ${g}`);this.operator=x[1]!==void 0?x[1]:"",this.operator==="="&&(this.operator=""),x[2]?this.semver=new s(x[2],this.options.loose):this.semver=e}toString(){return this.value}test(g){if(o("Comparator.test",g,this.options.loose),this.semver===e||g===e)return!0;if(typeof g=="string")try{g=new s(g,this.options)}catch{return!1}return i(g,this.operator,this.semver,this.options)}intersects(g,I){if(!(g instanceof l))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new a(g.value,I).test(this.value):g.operator===""?g.value===""?!0:new a(this.value,I).test(g.semver):(I=t(I),I.includePrerelease&&(this.value==="<0.0.0-0"||g.value==="<0.0.0-0")||!I.includePrerelease&&(this.value.startsWith("<0.0.0")||g.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&g.operator.startsWith(">")||this.operator.startsWith("<")&&g.operator.startsWith("<")||this.semver.version===g.semver.version&&this.operator.includes("=")&&g.operator.includes("=")||i(this.semver,"<",g.semver,I)&&this.operator.startsWith(">")&&g.operator.startsWith("<")||i(this.semver,">",g.semver,I)&&this.operator.startsWith("<")&&g.operator.startsWith(">")))}}St=l;const t=ll,{safeRe:n,t:c}=nt,i=Xn,o=At,s=se,a=We();return St}const ts=We(),ls=(e,l,t)=>{try{l=new ts(l,t)}catch{return!1}return l.test(e)};var xt=ls;const ns=We(),cs=(e,l)=>new ns(e,l).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));var is=cs;const ss=se,os=We(),as=(e,l,t)=>{let n=null,c=null,i=null;try{i=new os(l,t)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||c.compare(o)===-1)&&(n=o,c=new ss(n,t))}),n};var rs=as;const ds=se,gs=We(),bs=(e,l,t)=>{let n=null,c=null,i=null;try{i=new gs(l,t)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||c.compare(o)===1)&&(n=o,c=new ds(n,t))}),n};var Zs=bs;const wt=se,ms=We(),Sl=Yt,us=(e,l)=>{e=new ms(e,l);let t=new wt("0.0.0");if(e.test(t)||(t=new wt("0.0.0-0"),e.test(t)))return t;t=null;for(let n=0;n{const s=new wt(o.semver.version);switch(o.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!i||Sl(s,i))&&(i=s);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!t||Sl(t,i))&&(t=i)}return t&&e.test(t)?t:null};var Gs=us;const Is=We(),Cs=(e,l)=>{try{return new Is(e,l).range||"*"}catch{return null}};var Ws=Cs;const hs=se,fn=Jt(),{ANY:ps}=fn,Xs=We(),fs=xt,wl=Yt,El=cl,Rs=sl,Vs=il,As=(e,l,t,n)=>{e=new hs(e,n),l=new Xs(l,n);let c,i,o,s,a;switch(t){case">":c=wl,i=Rs,o=El,s=">",a=">=";break;case"<":c=El,i=Vs,o=wl,s="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(fs(e,l,n))return!1;for(let Z=0;Z{p.semver===ps&&(p=new fn(">=0.0.0")),I=I||p,x=x||p,c(p.semver,I.semver,n)?I=p:o(p.semver,x.semver,n)&&(x=p)}),I.operator===s||I.operator===a||(!x.operator||x.operator===s)&&i(e,x.semver))return!1;if(x.operator===a&&o(e,x.semver))return!1}return!0};var ol=As;const Ys=ol,Js=(e,l,t)=>Ys(e,l,">",t);var xs=Js;const ys=ol,Bs=(e,l,t)=>ys(e,l,"<",t);var Fs=Bs;const Kl=We(),Hs=(e,l,t)=>(e=new Kl(e,t),l=new Kl(l,t),e.intersects(l,t));var Ns=Hs;const vs=xt,ks=Ce;var Ss=(e,l,t)=>{const n=[];let c=null,i=null;const o=e.sort((g,I)=>ks(g,I,t));for(const g of o)vs(g,l,t)?(i=g,c||(c=g)):(i&&n.push([c,i]),i=null,c=null);c&&n.push([c,null]);const s=[];for(const[g,I]of n)g===I?s.push(g):!I&&g===o[0]?s.push("*"):I?g===o[0]?s.push(`<=${I}`):s.push(`${g} - ${I}`):s.push(`>=${g}`);const a=s.join(" || "),Z=typeof l.raw=="string"?l.raw:String(l);return a.length{if(e===l)return!0;e=new Ql(e,t),l=new Ql(l,t);let n=!1;e:for(const c of e.set){for(const i of l.set){const o=Ks(c,i,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Es=[new al(">=0.0.0-0")],zl=[new al(">=0.0.0")],Ks=(e,l,t)=>{if(e===l)return!0;if(e.length===1&&e[0].semver===Et){if(l.length===1&&l[0].semver===Et)return!0;t.includePrerelease?e=Es:e=zl}if(l.length===1&&l[0].semver===Et){if(t.includePrerelease)return!0;l=zl}const n=new Set;let c,i;for(const p of e)p.operator===">"||p.operator===">="?c=Ul(c,p,t):p.operator==="<"||p.operator==="<="?i=jl(i,p,t):n.add(p.semver);if(n.size>1)return null;let o;if(c&&i){if(o=rl(c.semver,i.semver,t),o>0)return null;if(o===0&&(c.operator!==">="||i.operator!=="<="))return null}for(const p of n){if(c&&!$e(p,String(c),t)||i&&!$e(p,String(i),t))return null;for(const Y of l)if(!$e(p,String(Y),t))return!1;return!0}let s,a,Z,g,I=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1,x=c&&!t.includePrerelease&&c.semver.prerelease.length?c.semver:!1;I&&I.prerelease.length===1&&i.operator==="<"&&I.prerelease[0]===0&&(I=!1);for(const p of l){if(g=g||p.operator===">"||p.operator===">=",Z=Z||p.operator==="<"||p.operator==="<=",c){if(x&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===x.major&&p.semver.minor===x.minor&&p.semver.patch===x.patch&&(x=!1),p.operator===">"||p.operator===">="){if(s=Ul(c,p,t),s===p&&s!==c)return!1}else if(c.operator===">="&&!$e(c.semver,String(p),t))return!1}if(i){if(I&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===I.major&&p.semver.minor===I.minor&&p.semver.patch===I.patch&&(I=!1),p.operator==="<"||p.operator==="<="){if(a=jl(i,p,t),a===p&&a!==i)return!1}else if(i.operator==="<="&&!$e(i.semver,String(p),t))return!1}if(!p.operator&&(i||c)&&o!==0)return!1}return!(c&&Z&&!i&&o!==0||i&&g&&!c&&o!==0||x||I)},Ul=(e,l,t)=>{if(!e)return l;const n=rl(e.semver,l.semver,t);return n>0?e:n<0||l.operator===">"&&e.operator===">="?l:e},jl=(e,l,t)=>{if(!e)return l;const n=rl(e.semver,l.semver,t);return n<0?e:n>0||l.operator==="<"&&e.operator==="<="?l:e};var Qs=ws;const Kt=nt,Ll=Vt,zs=se,$l=Wn,Us=je,js=Pc,Ls=qc,$s=ti,Ts=ni,Ms=si,Os=ri,Ps=bi,Ds=ui,_s=Ce,qs=Wi,eo=Xi,to=nl,lo=Ai,no=xi,co=Yt,io=cl,so=hn,oo=pn,ao=il,ro=sl,go=Xn,bo=_i,Zo=Jt(),mo=We(),uo=xt,Go=is,Io=rs,Co=Zs,Wo=Gs,ho=Ws,po=ol,Xo=xs,fo=Fs,Ro=Ns,Vo=Ss,Ao=Qs;var Yo={parse:Us,valid:js,clean:Ls,inc:$s,diff:Ts,major:Ms,minor:Os,patch:Ps,prerelease:Ds,compare:_s,rcompare:qs,compareLoose:eo,compareBuild:to,sort:lo,rsort:no,gt:co,lt:io,eq:so,neq:oo,gte:ao,lte:ro,cmp:go,coerce:bo,Comparator:Zo,Range:mo,satisfies:uo,toComparators:Go,maxSatisfying:Io,minSatisfying:Co,minVersion:Wo,validRange:ho,outside:po,gtr:Xo,ltr:fo,intersects:Ro,simplifyRange:Vo,subset:Ao,SemVer:zs,re:Kt.re,src:Kt.src,tokens:Kt.t,SEMVER_SPEC_VERSION:Ll.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ll.RELEASE_TYPES,compareIdentifiers:$l.compareIdentifiers,rcompareIdentifiers:$l.rcompareIdentifiers},Jo=Yo;const xo=Nc(Jo),Rn=e=>e!=null&&e.includes(" ")?`"${e}"`:`${e??"pandoc"}`;async function yo(e,l){e=Rn(e);let t=await zt(`${e} --version`,{env:l});t=t.substring(0,t.indexOf(` `)).replace("pandoc.exe","").replace("pandoc","").trim();let n=[...t].filter(c=>c===".").length;if(n===1)t=`${t}.0`;else for(;n>2;)t=t.substring(0,t.lastIndexOf(".")),n-=1;return xo.parse(t,!0)}const Bo="3.1.7",Zt={normalizePath:Rn,getVersion:yo,requiredVersion:Bo};async function Vn(e,l,t,n,c,i,o,s,a,Z){const{settings:g,lang:I,manifest:x,app:{vault:{adapter:p,config:Y},metadataCache:L}}=e;if(!n){const ce=_l(c);n=`${l.basename}${ce}`}i==null&&(i=g.showOverwriteConfirmation);const m=g.showExportProgressBar,K=p.getBasePath(),w=`${K}/${x.dir}`,E=`${w}/lua`,M=t,Q=`${M}/${n}`,ge=n.substring(0,n.lastIndexOf(".")),be=n,X=p.getFullPath(l.path),f=ae.dirname(X),R=l.basename,v=l.name;let D=Y.attachmentFolderPath??"/";D==="/"?D=K:D.startsWith(".")?D=ae.join(f,D.substring(1)):D=ae.join(K,D);let W=null;try{W=L.getCache(l.path).frontmatter}catch(ce){console.error(ce)}const C={pluginDir:w,luaDir:E,outputDir:M,outputPath:Q,outputFileName:ge,outputFileFullName:be,currentDir:f,currentPath:X,currentFileName:R,currentFileFullName:v,attachmentFolderPath:D,vaultDir:K,metadata:W,options:o,fromFormat:app.vault.config.useMarkdownLinks?"markdown":"markdown+wikilinks_title_after_pipe"},N=c.type==="custom"&&c.showCommandOutput,F=c.openExportedFileLocation??g.openExportedFileLocation,H=c.openExportedFile??g.openExportedFile;if(i&&yt.existsSync(Q)){const ce=await Be.remote.dialog.showSaveDialog({title:I.overwriteConfirmationDialog.title(be),defaultPath:Q,properties:["showOverwriteConfirmation","createDirectory"]});if(ce.canceled)return;C.outputPath=ce.filePath,C.outputDir=ae.dirname(C.outputPath),C.outputFileFullName=ae.basename(C.outputPath),C.outputFileName=ae.basename(C.outputFileFullName,ae.extname(C.outputFileFullName))}let J;m&&(J=Hc.show(I.preparing(C.outputFileFullName)));const k=C.env=ql(de(g.env)??{},C);let z=Zt.normalizePath(de(g.pandocPath));if(pt.platform==="win32"){z=z.replaceAll("\\","/");const ce=["pluginDir","luaDir","outputDir","outputPath","currentDir","currentPath","attachmentFolderPath","vaultDir"];for(const Xe of ce){const He=C[Xe];C[Xe]=He.replaceAll("\\","/")}}const S=c.type==="pandoc"?`${z} "\${currentPath}" ${c.arguments??""} ${c.customArguments??""}`:c.command,U=Ut(S,C),q=lt(U.match(/(?:[^\s"]+|"[^"]*")+/g),{alias:{output:["o"]}}),V=ae.normalize(Kn(q.output)),me=ae.dirname(V);yt.existsSync(me)||yt.mkdirSync(me);try{console.log(`[${e.manifest.name}]: export command and options:`,{cmd:U,options:{cwd:C.currentDir,env:k}}),await zt(U,{cwd:C.currentDir,env:k}),J==null||J();const ce=async()=>{if(F&&setTimeout(()=>{Be.remote.shell.showItemInFolder(V)},1e3),H&&await Be.remote.shell.openPath(V),c.type==="pandoc"&&c.runCommand===!0&&c.command){const Xe=Ut(c.command,C);await zt(Xe,{cwd:C.currentDir,env:k})}s&&s()};if(N){const Xe=new Vl(app,I.exportCommandOutputMessage(U));Xe.onClose=ce,Xe.open()}else new Ie.Notice(I.exportSuccessNotice(C.outputFileFullName),1500),await ce()}catch(ce){J==null||J(),new Vl(app,I.exportErrorOutputMessage(U,ce)).open(),a&&a()}}const Ot=e=>{const l=new Ie.Modal(e.app);let t=[],n=!1;return Ye(()=>{ne(l.titleEl,()=>e.title)}),Ye(()=>{ne(l.contentEl,()=>e.children)}),Ye(()=>{const c=Object.entries(e.classList??{}).filter(([,i])=>i).map(([i])=>i);t.length>0&&l.containerEl.removeClasses(t),c.length>0&&l.containerEl.addClasses(c),t=c}),Ye(()=>{l.containerEl.style.display=e.hidden?"None":""}),l.onClose=()=>{n||(n=!0,e.onClose())},ln(()=>l.open()),ze(()=>{n||l.close()}),document.createTextNode("")};var Fo=Ze("