From 0f37fc051960d2368888c657eb6227d24aa88438 Mon Sep 17 00:00:00 2001 From: oskar Date: Sun, 15 Feb 2026 19:22:09 +0100 Subject: [PATCH] MacBook-Pro-de-Oscar.local 2026-2-15:19:22:8 --- .obsidian/community-plugins.json | 4 +- .../obsidian-enhancing-export/data.json | 63 + .../lua/citefilter.lua | 6 + .../lua/markdown+hugo.lua | 5 + .../lua/markdown.lua | 237 ++++ .../lua/math_block.lua | 68 + .../lua/newline_to_para.lua | 18 + .../obsidian-enhancing-export/lua/pdf.lua | 50 + .../lua/polyfill.lua | 61 + .../lua/shift_headings.lua | 9 + .../obsidian-enhancing-export/lua/url.lua | 18 + .../plugins/obsidian-enhancing-export/main.js | 32 + .../obsidian-enhancing-export/manifest.json | 10 + .../obsidian-enhancing-export/styles.css | 1 + .../textemplate/dissertation.tex | 1210 +++++++++++++++++ .../textemplate/neurips.sty | 373 +++++ .../textemplate/neurips.tex | 187 +++ .obsidian/plugins/obsidian-pandoc/data.json | 2 +- test conversion en word.md | 11 + 19 files changed, 2363 insertions(+), 2 deletions(-) create mode 100644 .obsidian/plugins/obsidian-enhancing-export/data.json create mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/citefilter.lua create mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/markdown+hugo.lua create mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/markdown.lua create mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/math_block.lua create mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/newline_to_para.lua create mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/pdf.lua create mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/polyfill.lua create mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/shift_headings.lua create mode 100644 .obsidian/plugins/obsidian-enhancing-export/lua/url.lua create mode 100644 .obsidian/plugins/obsidian-enhancing-export/main.js create mode 100644 .obsidian/plugins/obsidian-enhancing-export/manifest.json create mode 100644 .obsidian/plugins/obsidian-enhancing-export/styles.css create mode 100644 .obsidian/plugins/obsidian-enhancing-export/textemplate/dissertation.tex create mode 100644 .obsidian/plugins/obsidian-enhancing-export/textemplate/neurips.sty create mode 100644 .obsidian/plugins/obsidian-enhancing-export/textemplate/neurips.tex create mode 100644 test conversion en word.md diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index d498d5d5..a80688b9 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -40,5 +40,7 @@ "obsidian-pandoc-reference-list", "excalibrain", "obsidian-daily-note-outline", - "obsidian-kanban" + "obsidian-kanban", + "obsidian-pandoc", + "obsidian-enhancing-export" ] \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-enhancing-export/data.json b/.obsidian/plugins/obsidian-enhancing-export/data.json new file mode 100644 index 00000000..4be98f1c --- /dev/null +++ b/.obsidian/plugins/obsidian-enhancing-export/data.json @@ -0,0 +1,63 @@ +{ + "items": [ + { + "name": "Markdown" + }, + { + "name": "Markdown (Hugo)" + }, + { + "name": "Html" + }, + { + "name": "TextBundle" + }, + { + "name": "Typst" + }, + { + "name": "PDF" + }, + { + "name": "Word (.docx)" + }, + { + "name": "OpenOffice" + }, + { + "name": "RTF" + }, + { + "name": "Epub" + }, + { + "name": "Latex" + }, + { + "name": "Media Wiki" + }, + { + "name": "reStructuredText" + }, + { + "name": "Textile" + }, + { + "name": "OPML" + }, + { + "name": "Bibliography" + }, + { + "name": "PowerPoint (.pptx)" + } + ], + "defaultExportDirectoryMode": "Custom", + "openExportedFile": true, + "env": {}, + "showExportProgressBar": true, + "lastExportDirectory": { + "darwin": "/Users/oscarplaisant/Downloads" + }, + "lastExportType": "Word (.docx)" +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/citefilter.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/citefilter.lua new file mode 100644 index 00000000..01700edd --- /dev/null +++ b/.obsidian/plugins/obsidian-enhancing-export/lua/citefilter.lua @@ -0,0 +1,6 @@ +-- credits to tarleb — StackExchange: https://tex.stackexchange.com/questions/392070/pandoc-markdown-create-self-contained-bib-file-from-cited-references +function Pandoc(d) + d.meta.references = pandoc.utils.references(d) + d.meta.bibliography = nil + return d +end diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/markdown+hugo.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/markdown+hugo.lua new file mode 100644 index 00000000..9341fd9f --- /dev/null +++ b/.obsidian/plugins/obsidian-enhancing-export/lua/markdown+hugo.lua @@ -0,0 +1,5 @@ +package.path=package.path..";" ..debug.getinfo(1).source:match("(.*[/\\])"):sub(2) .. "?.lua" + +Mode='hugo' + +require('markdown') \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/markdown.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/markdown.lua new file mode 100644 index 00000000..60711482 --- /dev/null +++ b/.obsidian/plugins/obsidian-enhancing-export/lua/markdown.lua @@ -0,0 +1,237 @@ +package.path=debug.getinfo(1).source:gsub('@',''):sub(0):match('(.*[/\\])'):sub(0) .. '?.lua' .. ';' .. package.path + +require("polyfill") +local url = require('url') + +local pandoc=pandoc +local PANDOC_STATE=PANDOC_STATE + +PANDOC_VERSION:must_be_at_least '3.1.7' + +os.text = pandoc.text + +local PATH = pandoc.path +local doc_dir = nil +local media_dir = nil + +if Mode == nil then + Mode = 'default' +end + +-- print("Mode: "..Mode) + +if PANDOC_STATE.output_file then + local output_file = PANDOC_STATE.output_file + doc_dir = PATH.directory(output_file) + if PANDOC_WRITER_OPTIONS.variables["media_dir"] then + media_dir = tostring(PANDOC_WRITER_OPTIONS.variables["media_dir"]) + else + media_dir = PATH.split_extension(output_file) + if Mode ~= 'hugo' then + media_dir = media_dir .. '-media' + end + end +end +assert(doc_dir, "doc_dir is nil") +assert(media_dir, "media_dir is nil") + + +local function get_absolute_path(file_path) + if PATH.is_absolute(file_path) then + return file_path + end + for _, dir in pairs(PANDOC_STATE.resource_path) do + local full_path = PATH.join({dir, file_path}) + if os.exists(full_path) then + return full_path + end + end + for _, file in pairs(PANDOC_STATE.input_files) do + if not PATH.is_absolute(file) then + file = PATH.join({pandoc.system.get_working_directory(), file_path}) + end + local dir = PATH.directory(file) + local full_path = PATH.join({dir, file_path}) + if os.exists(full_path) then + return full_path + end + end + return nil +end + +local function get_output_file(file_path) + if media_dir then + local new_file_name = pandoc.utils.sha1(file_path) + local _, new_file_ext = PATH.split_extension(file_path) + file_path = new_file_name .. new_file_ext + local full_path = PATH.join({media_dir, file_path}) + return full_path + else + return nil + end +end + +local function extract_media(file_path) + os.mkdir(media_dir) + file_path = url.decode(file_path) + local abs_path = get_absolute_path(file_path) + local file = get_output_file(file_path) + if abs_path and file then + if not os.exists(file) then + os.copy(abs_path, file) + end + local rel_path = PATH.make_relative(file, doc_dir, false) + local parts = PATH.split(rel_path) + for i,v in ipairs(parts) do + parts[i] = url.encode(v) + end + local encoded_rel_path = table.concat(parts, "/") + if Mode == 'hugo' then + encoded_rel_path = '../' .. encoded_rel_path + end + return encoded_rel_path + end +end + +local function raw(s) + return pandoc.RawInline('markdown', s) +end + +function Image(el) + local src = extract_media(el.src) + if src then + el.src = src + end + return el +end + +function Space() + return raw(' ') +end + +function SoftBreak() + return raw('\n') +end + +function RawInline(el) + if el.format == "html" then + el.format = 'markdown' + el.text = string.gsub(el.text, ']+>', function(img) + return string.gsub(img, 'src="([^"]+)"', function(url) + if string.find(url, '^[Hh][Tt][Tt][Pp][Ss]?://') == nil then + local extract_media_url = extract_media(url) + if extract_media_url then + return 'src="' .. extract_media_url .. '"' + end + return '123' + end + return 'src="' .. url .. '"' + end) + end) + end + return el +end + +function RawBlock(el) + if el.format == "html" then + el.format = 'markdown' + end + return el +end + +function Math(el) + if Mode == 'hugo' then + if el.mathtype == 'DisplayMath' then + return raw('{{< mathjax >}}\n$$' .. el.text .. '$$\n{{}}') + else + el.text = string.gsub(el.text, '\\[\\{\\}]', function (v) + return '\\' .. v + end) + el.text = string.gsub(el.text, '_', function (v) + return '\\' .. v + end) + end + end + return el +end + +local function headerLink(input) + -- github style section link + return "#"..input:gsub(' ', '-') +end + + +local function insertLink(content, linkDescription) + local descriptionText = table.concat(linkDescription, "") + + if string.find(descriptionText, '|') then + local target, desc = descriptionText:match("(.*)|(.*)") + table.insert(content, pandoc.Link(desc, headerLink(target))) + else + table.insert(content, pandoc.Link(descriptionText, headerLink(descriptionText))) + end +end + +function Para(el) + local content = el.content + content = ProcessMath(content) + content = ProcessInternalLinks(content) + el.content = content + return el +end + +function ProcessMath(elements) + local content = {} + local in_display_math = false + for _, item in pairs(elements) do + if item.t == 'Str'and item.text == "$$" then + in_display_math = not in_display_math + else + if in_display_math then + if item.t == 'RawInline' and item.format == 'tex' then + local n = pandoc.Math('DisplayMath', '\n' .. item.text .. '\n') + table.insert(content, Math(n)) + else + table.insert(content, item) + end + else + table.insert(content, item) + end + end + end + return content +end + +function ProcessInternalLinks(elements) + local content = {} + local in_section_link = false + local linkDescription = {} + + for _, item in pairs(elements) do + if item.t == 'Str' and string.starts_with(item.text, '[[#') then + in_section_link = true + table.insert(linkDescription, string.sub(item.text, 4)) + elseif in_section_link then + if string.ends_with(item.text, ']]') then + table.insert(linkDescription, string.sub(item.text, 1, -3)) + insertLink(content, linkDescription) + in_section_link = false + linkDescription = {} + else + table.insert(linkDescription, item.text) + end + else + table.insert(content, item) + end + end + return content +end + +function Plain(el) + el.content = ProcessInternalLinks(el.content) + return el +end + +function Pandoc(el) + return el +end diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/math_block.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/math_block.lua new file mode 100644 index 00000000..380d96a9 --- /dev/null +++ b/.obsidian/plugins/obsidian-enhancing-export/lua/math_block.lua @@ -0,0 +1,68 @@ +traverse = 'topdown' + +math_block_text = nil +function process(el) + + -- MathBlock start or end + if el.t == 'Str' and el.text == '$$' then + if math_block_text == nil then -- start + math_block_text = '' + else -- end + local math_block = pandoc.Math('DisplayMath', '\n' .. math_block_text .. '\n') + math_block_text = nil + return math_block + end + return {} + end + + if math_block_text then + if (el.t == 'RawInline' or el.t == 'RawBlock') and el.format == 'tex' then + math_block_text = math_block_text .. el.text + return {} + elseif el.t == 'Str' then + math_block_text = math_block_text .. el.text + return {} + elseif el.t == 'SoftBreak' or el.t == 'BulletList' then + return {} + end + end + return el +end + +function RawInline(el) + return process(el) +end + +function RawBlock(el) + return process(el) +end + +function Str(el) + return process(el) +end + +function SoftBreak(el) + return process(el) +end + +function Header(el) + return process(el) +end + +function Para(el) + return process(el) +end + +function Plain(el) + return process(el) +end + +function BulletList(el) + return process(el) +end + + + + + + diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/newline_to_para.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/newline_to_para.lua new file mode 100644 index 00000000..da3a0ebe --- /dev/null +++ b/.obsidian/plugins/obsidian-enhancing-export/lua/newline_to_para.lua @@ -0,0 +1,18 @@ +function Para(el) + local blocks = {} + local inlines = {} + for _, inline in ipairs(el.content) do + if inline.t == "SoftBreak" or inline.t == "LineBreak" then + if #inlines > 0 then + table.insert(blocks, pandoc.Para(inlines)) + inlines = {} + end + else + table.insert(inlines, inline) + end + end + if #inlines > 0 then + table.insert(blocks, pandoc.Para(inlines)) + end + return blocks +end diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/pdf.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/pdf.lua new file mode 100644 index 00000000..bf4276f8 --- /dev/null +++ b/.obsidian/plugins/obsidian-enhancing-export/lua/pdf.lua @@ -0,0 +1,50 @@ +-- minimum supported version for full environment +-- support is 3.8.unkown yet to be released but probably 3 +local environment_fully_supported_version = pandoc.types.Version('3.8.3') +local environment_partially_supported_version = pandoc.types.Version('3.8.0') +local is_partially_supported = PANDOC_VERSION >= environment_partially_supported_version +local problamatic_environments = { + displaymath = true, + math = true, + equation = true, + ["equation*"] = true, + gather = true, + ["gather*"] = true, + multline = true, + ["multline*"] = true, + eqnarray = true, + ["eqnarray*"] = true, + align = true, + ["align*"] = true, + alignat = true, + ["alignat*"] = true, + flalign = true, + ["flalign*"] = true, +} +if is_partially_supported then + return { + { + Math = function(elem) + if elem.text:find("^%s*\\begin{") ~= nil then + local replacement = pandoc.text:gsub(elem.text, "^%s*\\begin{(.-)}", "\\begin{%1}"):gsub("\\end{(.-)}%s*$", "\\end{%1}") + return pandoc.Math(replacement, elem.mathtype) + else + return elem + end + end, + } + } +elseif not environment_fully_supported_version then + return { + { + Math = function(elem) + local result = elem.text:match("^%s*\\begin{(%a+%*?)}") + if result ~= nil and problamatic_environments[result] ~= nil then + return pandoc.RawInline('tex', elem.text) + else + return elem + end + end, + } + } +end diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/polyfill.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/polyfill.lua new file mode 100644 index 00000000..1e8f3e55 --- /dev/null +++ b/.obsidian/plugins/obsidian-enhancing-export/lua/polyfill.lua @@ -0,0 +1,61 @@ +os.platform = nil +if os.platform == nil then + local libExt = package.cpath:match("%p[\\|/]?\\.%p(%a+)") + if libExt == 'dll' then + os.platform = "Windows" + elseif libExt == 'so' then + os.platform = "Linux" + elseif libExt == 'dylib' then + os.platform = "MacOS" + end +end + + +os.copy = function(src, dest) + if os.platform == "Windows" then + src = string.gsub(src, "/", "\\") + src = os.text.toencoding(src) + dest = os.text.toencoding(dest) + os.execute('copy "' .. src .. '" "' .. dest .. '" >NUL') + else + os.execute('cp "' .. src .. '" "' .. dest .. '"') + end +end + +os.mkdir = function(dir) + if os.exists(dir) then + return + end + if os.platform == "Windows" then + dir = os.text.toencoding(dir) + os.execute('mkdir "' .. dir .. '"') + else + os.execute('mkdir -p "' .. dir .. '"') + end +end + +os.exists = function(path) + if os.platform == "Windows" then + path = string.gsub(path, "/", "\\") + path = os.text.toencoding(path) + local _, _, code = os.execute('if exist "' .. path .. '" (exit 0) else (exit 1)') + return code == 0 + else + local _, _, code = os.execute('test -e "' .. path .. '"') + return code == 0 + end +end + +string.starts_with = function(str, start) + return str:sub(1, #start) == start +end + +string.ends_with = function(str, ending) + return ending == "" or str:sub(-#ending) == ending +end + + +return { + os = os, + string = string +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/shift_headings.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/shift_headings.lua new file mode 100644 index 00000000..ba6c9a02 --- /dev/null +++ b/.obsidian/plugins/obsidian-enhancing-export/lua/shift_headings.lua @@ -0,0 +1,9 @@ +function Header(el) + if el.level == 1 then + return pandoc.Div(pandoc.Para(el.content), {['custom-style'] = 'Title'}) + elseif el.level > 1 then + el.level = el.level - 1 + return el + end + return el +end diff --git a/.obsidian/plugins/obsidian-enhancing-export/lua/url.lua b/.obsidian/plugins/obsidian-enhancing-export/lua/url.lua new file mode 100644 index 00000000..47981462 --- /dev/null +++ b/.obsidian/plugins/obsidian-enhancing-export/lua/url.lua @@ -0,0 +1,18 @@ +local function encode (str) + str = string.gsub (str, "([^0-9a-zA-Z !'()*._~-])", -- locale independent + function (c) return string.format ("%%%02X", string.byte(c)) end) + str = string.gsub (str, " ", "%%20") + return str + end + + +local function decode (str) + str = string.gsub (str, "%%20", " ") + str = string.gsub (str, "%%(%x%x)", function(h) return string.char(tonumber(h,16)) end) + return str +end + +return { + encode = encode, + decode = decode +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-enhancing-export/main.js b/.obsidian/plugins/obsidian-enhancing-export/main.js new file mode 100644 index 00000000..0888da6c --- /dev/null +++ b/.obsidian/plugins/obsidian-enhancing-export/main.js @@ -0,0 +1,32 @@ +"use strict";var bl=e=>{throw TypeError(e)};var Zl=(e,l,t)=>l.has(e)||bl("Cannot "+t);var ml=(e,l,t)=>(Zl(e,l,"read from private field"),t?t.call(e):l.get(e)),ul=(e,l,t)=>l.has(e)?bl("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(e):l.set(e,t),Gl=(e,l,t,n)=>(Zl(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 Ze=require("obsidian"),Sn=require("child_process"),Xt=require("process"),_l=require("electron"),ql=require("fs"),ne=require("path"),wn=require("util");function qt(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=qt(Ze),Fe=qt(_l),Ft=qt(ql),bt={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"},"PowerPoint (.pptx)":{name:"PowerPoint (.pptx)",type:"pandoc",arguments:'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -o "${outputPath}" -t pptx',extension:".pptx"},Custom:{name:"Custom",type:"custom",command:"your command",targetFileExtensions:".ext"}};function Ye(e,l,t){return typeof l=="string"&&l.trim()===""&&(l=void 0),t instanceof Array?t.reduce((n,c)=>Ye(n,l,c),e):(t??(t=Xt.platform),{...e??{},[t]:l})}function be(e,l){e??(e={});const t=e[l??Xt.platform],n=e["*"];return n&&typeof n=="object"?Object.assign({},n,t):t??n}function j(e,...l){return function(...t){const n=t[t.length-1]||{},c=[e[0]];return l.forEach(function(i,s){const o=Number.isInteger(i)?t[i]:n[i];c.push(o,e[s+1])}),c.join("")}}function jt(e,l){return l=l??{},new Promise((t,n)=>{Sn.exec(e,l,(c,i,s)=>{if(c){n(c),console.error(i,c);return}if(s&&s!==""){n(s),console.error(i,c);return}(i==null?void 0:i.trim().length)===0&&localStorage.getItem("debug-plugin")==="1"&&console.log(i),t(i)})})}function Kn(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.substring(1,e.length-1):e}function Lt(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"}]}},qe=(()=>{let e={};return e=Ye(e,{HOME:"${HOME}",PATH:"${PATH}",TEXINPUTS:"${pluginDir}/textemplate/:"},"*"),e=Ye(e,{TEXINPUTS:"${pluginDir}/textemplate/;",PATH:"${HOME}\\AppData\\Local\\Pandoc;${PATH}"},"win32"),e=Ye(e,{PATH:"/opt/homebrew/bin:/usr/local/bin:/Library/TeX/texbin:${PATH}"},"darwin"),e})(),Me={items:Object.values(bt).filter(e=>e.type!=="custom"),pandocPath:void 0,defaultExportDirectoryMode:"Auto",openExportedFile:!0,env:qe,showExportProgressBar:!0};function en(e){var l;return e.type==="pandoc"?e.extension:e.type==="custom"?(l=e.targetFileExtensions)==null?void 0:l.split(",")[0]:""}function tn(e,l){return e=Object.assign({},be(qe),e),l=Object.assign({HOME:process.env.HOME??process.env.USERPROFILE},process.env,l??{}),Object.fromEntries(Object.entries(e).map(([t,n])=>[t,Lt(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,fe=Symbol("solid-proxy"),Mt=Symbol("solid-track"),ut={equals:jn};let ln=rn;const He=1,Gt=2,nn={owned:null,cleanups:null,context:null,owner:null};var $=null;let Ht=null,Ln=null,D=null,ce=null,xe=null,ft=0;function we(e,l){const t=D,n=$,c=e.length===0,i=n,s=c?nn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},o=c?e:()=>e(()=>P(()=>Rt(s)));$=s,D=null;try{return je(o,!0)}finally{D=t,$=n}}function re(e,l){l=l?Object.assign({},ut,l):ut;const t={value:e,observers:null,observerSlots:null,comparator:l.equals||void 0},n=c=>(typeof c=="function"&&(c=c(t.value)),an(t,c));return[sn.bind(t),n]}function te(e,l,t){const n=el(e,l,!1,He);nt(n)}function Je(e,l,t){ln=Pn;const n=el(e,l,!1,He);n.user=!0,xe?xe.push(n):nt(n)}function ee(e,l,t){t=t?Object.assign({},ut,t):ut;const n=el(e,l,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=t.equals||void 0,nt(n),sn.bind(n)}function Zt(e){return je(e,!1)}function P(e){if(D===null)return e();const l=D;D=null;try{return e()}finally{D=l}}function cn(e){Je(()=>P(e))}function Ue(e){return $===null||($.cleanups===null?$.cleanups=[e]:$.cleanups.push(e)),e}function Tt(){return D}function Mn(e,l){const t=Symbol("context");return{id:t,Provider:_n(t),defaultValue:e}}function Tn(e){let l;return $&&$.context&&(l=$.context[e.id])!==void 0?l:e.defaultValue}function on(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 sn(){if(this.sources&&this.state)if(this.state===He)nt(this);else{const e=ce;ce=null,je(()=>Ct(this),!1),ce=e}if(D){const e=this.observers?this.observers.length:0;D.sources?(D.sources.push(this),D.sourceSlots.push(e)):(D.sources=[this],D.sourceSlots=[e]),this.observers?(this.observers.push(D),this.observerSlots.push(D.sources.length-1)):(this.observers=[D],this.observerSlots=[D.sources.length-1])}return this.value}function an(e,l,t){let n=e.value;return(!e.comparator||!e.comparator(n,l))&&(e.value=l,e.observers&&e.observers.length&&je(()=>{for(let c=0;c1e6)throw ce=[],new Error},!1)),l}function nt(e){if(!e.fn)return;Rt(e);const l=ft;$n(e,e.value,l)}function $n(e,l,t){let n;const c=$,i=D;D=$=e;try{n=e.fn(l)}catch(s){return e.pure&&(e.state=He,e.owned&&e.owned.forEach(Rt),e.owned=null),e.updatedAt=t+1,dn(s)}finally{D=i,$=c}(!e.updatedAt||e.updatedAt<=t)&&(e.updatedAt!=null&&"observers"in e?an(e,n):e.value=n,e.updatedAt=t)}function el(e,l,t,n=He,c){const i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:l,owner:$,context:$?$.context:null,pure:t};return $===null||$!==nn&&($.owned?$.owned.push(i):$.owned=[i]),i}function It(e){if(e.state===0)return;if(e.state===Gt)return Ct(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===He)nt(e);else if(e.state===Gt){const n=ce;ce=null,je(()=>Ct(e,l[0]),!1),ce=n}}function je(e,l){if(ce)return e();let t=!1;l||(ce=[]),xe?t=!0:xe=[],ft++;try{const n=e();return On(t),n}catch(n){t||(xe=null),ce=null,dn(n)}}function On(e){if(ce&&(rn(ce),ce=null),e)return;const l=xe;xe=null,l.length&&je(()=>ln(l),!1)}function rn(e){for(let l=0;l=0;l--)Rt(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 dn(e,l=$){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(()=>($.context={...$.context,[e]:n.value},on(()=>n.children))),void 0),c}}const qn=Symbol("fallback");function Il(e){for(let l=0;l1?[]:null;return Ue(()=>Il(i)),()=>{let a=e()||[],d=a.length,u,Z;return a[Mt],P(()=>{let f,J,z,m,M,k,E,T,K;if(d===0)s!==0&&(Il(i),i=[],n=[],c=[],s=0,o&&(o=[])),t.fallback&&(n=[qn],c[0]=we(oe=>(i[0]=oe,t.fallback())),s=1);else if(s===0){for(c=new Array(d),Z=0;Z=k&&T>=k&&n[E]===a[T];E--,T--)z[T]=c[E],m[T]=i[E],o&&(M[T]=o[E]);for(f=new Map,J=new Array(T+1),Z=T;Z>=k;Z--)K=a[Z],u=f.get(K),J[Z]=u===void 0?-1:u,f.set(K,Z);for(u=k;u<=E;u++)K=n[u],Z=f.get(K),Z!==void 0&&Z!==-1?(z[Z]=c[u],m[Z]=i[u],o&&(M[Z]=o[u]),Z=J[Z],f.set(K,Z)):i[u]();for(Z=k;Ze(l||{}))}function ot(){return!0}const Cl={get(e,l,t){return l===fe?t:e.get(l)},has(e,l){return l===fe?!0:e.has(l)},set:ot,deleteProperty:ot,getOwnPropertyDescriptor(e,l){return{configurable:!0,enumerable:!0,get(){return e.get(l)},set:ot,deleteProperty:ot}},ownKeys(e){return e.keys()}};function tc(e,...l){if(fe in e){const c=new Set(l.length>1?l.flat():l[0]),i=l.map(s=>new Proxy({get(o){return s.includes(o)?e[o]:void 0},has(o){return s.includes(o)&&o in e},keys(){return s.filter(o=>o in e)}},Cl));return i.push(new Proxy({get(s){return c.has(s)?void 0:e[s]},has(s){return c.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!c.has(s))}},Cl)),i}const t={},n=l.map(()=>({}));for(const c of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,c),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let o=!1,a=0;for(const d of l)d.includes(c)&&(o=!0,s?n[a][c]=i.value:Object.defineProperty(n[a],c,i)),++a;o||(s?t[c]=i.value:Object.defineProperty(t,c,i))}return[...n,t]}const bn=e=>`Stale read from <${e}>.`;function Zn(e){const l="fallback"in e&&{fallback:()=>e.fallback};return ee(ec(()=>e.each,e.children,l||void 0))}function De(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 bn("Show");return e.when})):c}return e.fallback},void 0,void 0)}function lc(e){let l=!1;const t=(i,s)=>(l?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],n=on(()=>e.children),c=ee(()=>{let i=n();Array.isArray(i)||(i=[i]);for(let s=0;s{const[i,s,o]=c();if(i<0)return e.fallback;const a=o.children;return typeof a=="function"&&a.length>0?P(()=>a(l?s:()=>{if(P(c)[0]!==i)throw bn("Match");return o.when})):a},void 0,void 0)}function Wl(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"]),oc=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),sc=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=sc[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"]),gc=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"]),dc={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,s=0,o=0,a=l[c-1].nextSibling,d=null;for(;su-o){const J=l[s];for(;o{const s=document.createElement("template");return s.innerHTML=e,s.content.firstChild},i=()=>(n||(n=c())).cloneNode(!0);return i.cloneNode=i,i}function tl(e,l=window.document){const t=l[hl]||(l[hl]=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,s;for(i=0,s=c.length;ic.children=et(e,l.children,c.children)),te(()=>typeof l.ref=="function"&&Vt(l.ref,e)),te(()=>Gc(e,l,t,!0,c,!0)),c}function Vt(e,l,t){return P(()=>e(l,t))}function ie(e,l,t,n){if(t!==void 0&&!n&&(n=[]),typeof l!="function")return et(e,l,n,t);te(c=>et(e,l(),c,t),n)}function Gc(e,l,t,n,c={},i=!1){l||(l={});for(const s in c)if(!(s in l)){if(s==="children")continue;c[s]=Xl(e,s,null,c[s],t,i)}for(const s in l){if(s==="children")continue;const o=l[s];c[s]=Xl(e,s,o,c[s],t,i)}}function Ic(e){return e.toLowerCase().replace(/-([a-z])/g,(l,t)=>t.toUpperCase())}function pl(e,l,t){const n=l.trim().split(/\s+/);for(let c=0,i=n.length;c-1&&dc[l.split(":")[0]];Z?Zc(e,Z,l,t):Be(e,oc[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 et(e,l,t,n,c){for(;typeof t=="function";)t=t();if(l===t)return t;const i=typeof l,s=n!==void 0;if(e=s&&t[0]&&t[0].parentNode||e,i==="string"||i==="number"){if(i==="number"&&(l=l.toString(),l===t))return t;if(s){let o=t[0];o&&o.nodeType===3?o.data!==l&&(o.data=l):o=document.createTextNode(l),t=ke(e,t,n,o)}else t!==""&&typeof t=="string"?t=e.firstChild.data=l:t=e.textContent=l}else if(l==null||i==="boolean")t=ke(e,t,n);else{if(i==="function")return te(()=>{let o=l();for(;typeof o=="function";)o=o();t=et(e,o,t,n)}),()=>t;if(Array.isArray(l)){const o=[],a=t&&Array.isArray(t);if(Ot(o,l,t,c))return te(()=>t=et(e,o,t,n,!0)),()=>t;if(o.length===0){if(t=ke(e,t,n),s)return t}else a?t.length===0?fl(e,o,n):bc(e,t,o):(t&&ke(e),fl(e,o));t=o}else if(l.nodeType){if(Array.isArray(t)){if(s)return t=ke(e,t,n,l);ke(e,t,null,l)}else t==null||t===""||!e.firstChild?e.appendChild(l):e.replaceChild(l,e.firstChild);t=l}}return t}function Ot(e,l,t,n){let c=!1;for(let i=0,s=l.length;i=0;s--){const o=l[s];if(c!==o){const a=o.parentNode===e;!i&&!s?a?e.replaceChild(c,o):e.insertBefore(c,t):a&&o.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=gc.has(c),s=hc(c,i);return uc(s,t,i),s}})}/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */function $e(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+=s}return n}function Gn(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(s=>typeof s!="string"?s+"":s);e=e.trim();let l=0,t=null,n=null,c=null;const i=[];for(let s=0;s{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)})),_(n.key,s,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 T=[];const K=Object.assign(Object.create(null),{_:[]}),oe={};for(let r=0;r=3&&(A(Y[1],m.arrays)?r=v(r,Y[1],c,Y[2]):A(Y[1],m.nargs)!==!1?r=h(r,Y[1],c,Y[2]):R(Y[1],Y[2],!0));else if(b.match(k)&&o["boolean-negation"])Y=b.match(k),Y!==null&&Array.isArray(Y)&&Y.length>=2&&(g=Y[1],R(g,A(g,m.arrays)?[!1]:!1));else if(b.match(/^--.+/)||!o["short-option-groups"]&&b.match(/^-[^-]+/))Y=b.match(/^--?(.+)/),Y!==null&&Array.isArray(Y)&&Y.length>=2&&(g=Y[1],A(g,m.arrays)?r=v(r,g,c):A(g,m.nargs)!==!1?r=h(r,g,c):(B=c[r+1],B!==void 0&&(!B.match(/^-/)||B.match(M))&&!A(g,m.bools)&&!A(g,m.counts)||/^(true|false)$/.test(B)?(R(g,B),r++):R(g,se(g))));else if(b.match(/^-.\..+=/))Y=b.match(/^-([^=]+)=([\s\S]*)$/),Y!==null&&Array.isArray(Y)&&Y.length>=3&&R(Y[1],Y[2]);else if(b.match(/^-.\..+/)&&!b.match(M))B=c[r+1],Y=b.match(/^-(.\..+)/),Y!==null&&Array.isArray(Y)&&Y.length>=2&&(g=Y[1],B!==void 0&&!B.match(/^-/)&&!A(g,m.bools)&&!A(g,m.counts)?(R(g,B),r++):R(g,se(g)));else if(b.match(/^-[^-]+/)&&!b.match(M)){x=b.slice(1,-1).split(""),G=!1;for(let ae=0;aer!=="--"&&r.includes("-")).forEach(r=>{delete K[r]}),o["strip-aliased"]&&[].concat(...Object.keys(s).map(r=>s[r])).forEach(r=>{o["camel-case-expansion"]&&r.includes("-")&&delete K[r.split(".").map(b=>$e(b)).join(".")],delete K[r]});function ue(r){const b=C("_",r);(typeof b=="string"||typeof b=="number")&&K._.push(b)}function h(r,b,X,G){let g,x=A(b,m.nargs);if(x=typeof x!="number"||isNaN(x)?1:x,x===0)return Re(G)||(E=Error(z("Argument unexpected for: %s",b))),R(b,se(b)),r;let Y=Re(G)?0:1;if(o["nargs-eats-options"])X.length-(r+1)+Y0&&(R(b,G),B--),g=r+1;g0||Y&&typeof Y=="number"&&g.length>=Y||(x=X[B],/^-/.test(x)&&!M.test(x)&&!O(x)));B++)r=B,g.push(le(b,x,i))}return typeof Y=="number"&&(Y&&g.length1&&o["dot-notation"]&&(m.aliases[g[0]]||[]).forEach(function(x){let Y=x.split(".");const B=[].concat(g);B.shift(),Y=Y.concat(B),(m.aliases[r]||[]).includes(Y.join("."))||Q(K,Y,G)}),A(r,m.normalize)&&!A(r,m.arrays)&&[r].concat(m.aliases[r]||[]).forEach(function(Y){Object.defineProperty(oe,Y,{enumerable:!0,get(){return b},set(B){b=typeof B=="string"?Ve.normalize(B):B}})})}function W(r,b){m.aliases[r]&&m.aliases[r].length||(m.aliases[r]=[b],f[b]=!0),m.aliases[b]&&m.aliases[b].length||W(b,r)}function le(r,b,X){X&&(b=Vc(b)),(A(r,m.bools)||A(r,m.counts))&&typeof b=="string"&&(b=b==="true");let G=Array.isArray(b)?b.map(function(g){return C(r,g)}):C(r,b);return A(r,m.counts)&&(Re(G)||typeof G=="boolean")&&(G=Nt()),A(r,m.normalize)&&A(r,m.arrays)&&(Array.isArray(b)?G=b.map(g=>Ve.normalize(g)):G=Ve.normalize(b)),G}function C(r,b){return!o["parse-positional-numbers"]&&r==="_"||!A(r,m.strings)&&!A(r,m.bools)&&!Array.isArray(b)&&(Gn(b)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${b}`)))||!Re(b)&&A(r,m.numbers))&&(b=Number(b)),b}function p(r){const b=Object.create(null);L(b,m.aliases,a),Object.keys(m.configs).forEach(function(X){const G=r[X]||b[X];if(G)try{let g=null;const x=Ve.resolve(Ve.cwd(),G),Y=m.configs[X];if(typeof Y=="function"){try{g=Y(x)}catch(B){g=B}if(g instanceof Error){E=g;return}}else g=Ve.require(x);H(g)}catch(g){g.name==="PermissionDenied"?E=g:r[X]&&(E=Error(z("Invalid JSON config file: %s",G)))}})}function H(r,b){Object.keys(r).forEach(function(X){const G=r[X],g=b?b+"."+X:X;typeof G=="object"&&G!==null&&!Array.isArray(G)&&o["dot-notation"]?H(G,g):(!w(K,g.split("."))||A(g,m.arrays)&&o["combine-arrays"])&&R(g,G)})}function y(){typeof d<"u"&&d.forEach(function(r){H(r)})}function N(r,b){if(typeof u>"u")return;const X=typeof u=="string"?u:"",G=Ve.env();Object.keys(G).forEach(function(g){if(X===""||g.lastIndexOf(X,0)===0){const x=g.split("__").map(function(Y,B){return B===0&&(Y=Y.substring(X.length)),$e(Y)});(b&&m.configs[x.join(".")]||!b)&&!w(r,x)&&R(x.join("."),G[g])}})}function V(r){let b;const X=new Set;Object.keys(r).forEach(function(G){if(!X.has(G)&&(b=A(G,m.coercions),typeof b=="function"))try{const g=C(G,b(r[G]));[].concat(m.aliases[G]||[],G).forEach(x=>{X.add(x),r[x]=g})}catch(g){E=g}})}function S(r){return m.keys.forEach(b=>{~b.indexOf(".")||typeof r[b]>"u"&&(r[b]=void 0)}),r}function L(r,b,X,G=!1){Object.keys(X).forEach(function(g){w(r,g.split("."))||(Q(r,g.split("."),X[g]),G&&(J[g]=!0),(b[g]||[]).forEach(function(x){w(r,x.split("."))||Q(r,x.split("."),X[g])}))})}function w(r,b){let X=r;o["dot-notation"]||(b=[b.join(".")]),b.slice(0,-1).forEach(function(g){X=X[g]||{}});const G=b[b.length-1];return typeof X!="object"?!1:G in X}function Q(r,b,X){let G=r;o["dot-notation"]||(b=[b.join(".")]),b.slice(0,-1).forEach(function(q){q=Rl(q),typeof G=="object"&&G[q]===void 0&&(G[q]={}),typeof G[q]!="object"||Array.isArray(G[q])?(Array.isArray(G[q])?G[q].push({}):G[q]=[G[q],{}],G=G[q][G[q].length-1]):G=G[q]});const g=Rl(b[b.length-1]),x=A(b.join("."),m.arrays),Y=Array.isArray(X);let B=o["duplicate-arguments-array"];!B&&A(g,m.nargs)&&(B=!0,(!Re(G[g])&&m.nargs[g]===1||Array.isArray(G[g])&&G[g].length===m.nargs[g])&&(G[g]=void 0)),X===Nt()?G[g]=Nt(G[g]):Array.isArray(G[g])?B&&x&&Y?G[g]=o["flatten-duplicate-arrays"]?G[g].concat(X):(Array.isArray(G[g][0])?G[g]:[G[g]]).concat([X]):!B&&!!x==!!Y?G[g]=X:G[g]=G[g].concat([X]):G[g]===void 0&&x?G[g]=Y?X:[X]:B&&!(G[g]===void 0||A(g,m.counts)||A(g,m.bools))?G[g]=[G[g],X]:G[g]=X}function _(...r){r.forEach(function(b){Object.keys(b||{}).forEach(function(X){m.aliases[X]||(m.aliases[X]=[].concat(s[X]||[]),m.aliases[X].concat(X).forEach(function(G){if(/-/.test(G)&&o["camel-case-expansion"]){const g=$e(G);g!==X&&m.aliases[X].indexOf(g)===-1&&(m.aliases[X].push(g),f[g]=!0)}}),m.aliases[X].concat(X).forEach(function(G){if(G.length>1&&/[A-Z]/.test(G)&&o["camel-case-expansion"]){const g=un(G,"-");g!==X&&m.aliases[X].indexOf(g)===-1&&(m.aliases[X].push(g),f[g]=!0)}}),m.aliases[X].forEach(function(G){m.aliases[G]=[X].concat(m.aliases[X].filter(function(g){return G!==g}))}))})})}function A(r,b){const X=[].concat(m.aliases[r]||[],r),G=Object.keys(b),g=X.find(x=>G.includes(x));return g?b[g]:!1}function he(r){const b=Object.keys(m);return[].concat(b.map(G=>m[G])).some(function(G){return Array.isArray(G)?G.includes(r):G[r]})}function Ne(r,...b){return[].concat(...b).some(function(G){const g=r.match(G);return g&&he(g[1])})}function yt(r){if(r.match(M)||!r.match(/^-[^-]+/))return!1;let b=!0,X;const G=r.slice(1).split("");for(let g=0;gA(r,m.arrays)?(E=Error(z("Invalid configuration: %s, opts.count excludes opts.array.",r)),!0):A(r,m.nargs)?(E=Error(z("Invalid configuration: %s, opts.count excludes opts.narg.",r)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(oe,K),configuration:o,defaulted:Object.assign({},J),error:E,newAliases:Object.assign({},f)}}}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:ne.normalize,resolve:ne.resolve,require:e=>{if(typeof require<"u")return require(e);if(e.match(/\.json$/))return JSON.parse(ql.readFileSync(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),ct=function(l,t){return In.parse(l.slice(),t).argv};ct.detailed=function(e,l){return In.parse(e.slice(),l)};ct.camelCase=$e;ct.decamelize=un;ct.looksLikeNumber=Gn;const Yc={exportToOo:"导出为......",exportWithPrevious:"使用上一次设置导出",exportSuccessNotice:j`导出文件 ${0} 成功!`,exportCommandOutputMessage:j`命令:${0}`,exportErrorOutputMessage:j`命令 ${0},错误:${1}`,pleaseOpenFile:"请打开一个文件先。",preparing:j`正在生成 "${0}" ......`,exportDialog:{fileName:"文件名",type:"类型",exportTo:"导出到",title:j`导出为 ${0}`,export:"导出",selectExportFolder:"请选择导出文件夹",overwriteConfirmation:"覆盖提示",extraArguments:"自定义参数"},messageBox:{yes:"是",no:"否",ok:"确认",cancel:"取消"},overwriteConfirmationDialog:{replace:"替换",title:j`"${0}" 已经存在。您要替换它吗?`,message:j`"${0}" 文件夹中已有相同的文件或文件夹,若替换,则会覆盖其当前内容。`},settingTab:{title:"导出设置",general:"通用",name:"名称",customLocation:"自定义",pandocVersion:j`版本: ${0}`,pandocVersionWithWarning:j`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:j`Export file ${0} success!`,exportCommandOutputMessage:j`Command: ${0}`,exportErrorOutputMessage:j`Command: ${0},Error:${1}`,exportWithPrevious:"Export with Previous",pleaseOpenFile:"Please open a file first.",preparing:j`generating "${0}"...`,exportDialog:{exportTo:"Export to",fileName:"File Name",title:j`Export to ${0}`,export:"Export",selectExportFolder:"Please select an export folder.",overwriteConfirmation:"Overwrite confirmation",type:"Type",extraArguments:"Extra arguments"},messageBox:{yes:"Yes",no:"No",ok:"Ok",cancel:"Cancel"},overwriteConfirmationDialog:{replace:"Replace",title:j`"${0}" already exists. Do you want to replace it?`,message:j`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:j`Version: ${0}`,pandocVersionWithWarning:j`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:j`Export der Datei ${0} erfolgreich!`,exportCommandOutputMessage:j`Command: ${0}`,exportErrorOutputMessage:j`Command: ${0},Fehler:${1}`,exportWithPrevious:"Exportiere mit Vorherigem",pleaseOpenFile:"Bitte öffne zunächst eine Datei.",preparing:j`generating "${0}"...`,exportDialog:{exportTo:"Exportiere nach",fileName:"Dateiname",title:j`Export to ${0}`,export:"Export",selectExportFolder:"Zielordner auswählen",overwriteConfirmation:"Überschreibe den Zielordner",type:"Typ",extraArguments:"Zusätzliche Parameter"},messageBox:{yes:"Ja",no:"Nein",ok:"Ok",cancel:"Abbrechen"},overwriteConfirmationDialog:{replace:"Ersetze",title:j`"${0}" existiert bereits. Soll er ersetzt werden?`,message:j`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:j`Version: ${0}`,pandocVersionWithWarning:j`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"}},Bc={exportToOo:"Экспорт в...",exportSuccessNotice:j`Файл ${0} успешно экспортирован!`,exportCommandOutputMessage:j`Команда: ${0}`,exportErrorOutputMessage:j`Команда: ${0}, Ошибка: ${1}`,exportWithPrevious:"Экспортировать как предыдущий",pleaseOpenFile:"Пожалуйста, сначала откройте файл.",preparing:j`генерируется "${0}"...`,exportDialog:{exportTo:"Экспорт в",fileName:"Имя файла",title:j`Экспорт в ${0}`,export:"Экспорт",selectExportFolder:"Пожалуйста, выберите папку для экспорта.",overwriteConfirmation:"Подтверждение перезаписи",type:"Тип",extraArguments:"Дополнительные аргументы"},messageBox:{yes:"Да",no:"Нет",ok:"Ок",cancel:"Отменить"},overwriteConfirmationDialog:{replace:"Заменить",title:j`"${0}" уже существует. Хотите заменить его?`,message:j`Файл или папка с таким же именем уже существует в папке "${0}". Замена перезапишет его содержимое.`},settingTab:{general:"Основные",name:"Название",title:"Export Settings",pandocVersion:j`Версия: ${0}`,pandocVersionWithWarning:j`Версия: ${0}, пожалуйста обновите версию до ${1}`,pandocNotFound:"Pandoc не найден, пожалуйста укажите путь к файлу Pandoc или добавьте его в переменные системного окружения.",defaultFolderForExportedFile:"Папка по умолчанию для экспортированного файла",openExportedFileLocation:"Открыть расположение экспортированного файла",ShowExportProgressBar:"Показывать прогресс экспорта",openExportedFile:"Открыть экспортированный файл",pandocPath:"Путь к Pandoc",pandocPathPlaceholder:"(Автоматическое определение)",editCommandTemplate:"Редактирование шаблонов команд",chooseCommandTemplate:"Выберите шаблон",customLocation:"Пользовательское расположение",template:"Шаблон",command:"Команда",reset:"Сбросить",auto:"Авто",add:"Добавить",remove:"Удалить",rename:"Переименовать",sameFolderWithCurrentFile:"Та же папка, что и исходный файл",afterExport:"После экспорта",targetFileExtensions:"Расширения целевого файла",targetFileExtensionsTip:"(Разделённые пробелом)",showCommandOutput:"Показывать вывод команд",runCommand:"Запустить команду",extraArguments:"Дополнительные аргументы",save:"Сохранить",new:"Новый",arguments:"Аргументы",advanced:"Расширенные",environmentVariables:"Переменные окружения",environmentVariablesDesc:"Определить переменные окружения для экспорта."}},Cn={"de-DE":xc,"en-US":Jc,"zh-CN":Yc,"ru-RU":Bc,get current(){const e=Object.keys(this),l=Ze.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 Yl extends Ze.Modal{constructor(l,t,n){super(l),this.options=typeof t=="string"?{message:t,buttons:"Ok",title:n}:t,this.lang=Cn.current}onOpen(){const{titleEl:l,contentEl:t,lang:n,options:{message:c,title:i,buttons:s,callback:o,buttonsLabel:a,buttonsClass:d}}=this;switch(i&&l.setText(i),t.createDiv({text:c}),s){case"Yes":t.createEl("div",{cls:["modal-button-container"],parent:t},u=>{u.createEl("button",{text:(a==null?void 0:a.yes)??n.messageBox.yes,cls:["mod-cta",d==null?void 0:d.yes],parent:u}).onclick=()=>this.call(o==null?void 0:o.yes)});break;case"YesNo":t.createEl("div",{cls:["modal-button-container"],parent:t},u=>{u.createEl("button",{text:(a==null?void 0:a.yes)??n.messageBox.yes,cls:["mod-cta",d==null?void 0:d.yes],parent:u}).onclick=()=>this.call(o==null?void 0:o.yes),u.createEl("button",{text:(a==null?void 0:a.no)??n.messageBox.no,cls:["mod-cta",d==null?void 0:d.no],parent:u}).onclick=()=>this.call(o==null?void 0:o.no)});break;case"Ok":t.createEl("div",{cls:["modal-button-container"],parent:t},u=>{u.createEl("button",{text:(a==null?void 0:a.ok)??n.messageBox.ok,cls:["mod-cta",d==null?void 0:d.no],parent:u}).onclick=()=>this.call(o==null?void 0:o.ok)});break;case"OkCancel":t.createEl("div",{cls:["modal-button-container"],parent:t},u=>{u.createEl("button",{text:(a==null?void 0:a.ok)??n.messageBox.ok,cls:["mod-cta",d==null?void 0:d.ok],parent:u}).onclick=()=>this.call(o==null?void 0:o.ok),u.createEl("button",{text:(a==null?void 0:a.cancel)??n.messageBox.cancel,cls:["mod-cta",d==null?void 0:d.cancel],parent:u}).onclick=()=>this.call(o==null?void 0:o.cancel)});break}}call(l){l&&l(),this.close()}onClose(){const{contentEl:l}=this;l.empty()}}var yc=me('
');const Fc=e=>(()=>{var l=yc(),t=l.firstChild,n=e.ref;return typeof n=="function"?Vt(n,l):e.ref=l,ie(t,()=>e.message),l})(),Hc=e=>we(l=>{let t=!1;const n=()=>{t||(t=!0,l())};let c;return ie(document.body,()=>I(Fc,{ref(i){var s=c;typeof s=="function"?s(i):c=i},message:e})),Ue(()=>{c instanceof Node&&document.body.contains(c)&&document.body.removeChild(c)}),n}),Nc={show:Hc};function vc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pt={exports:{}};const kc="2.0.0",Wn=256,Sc=Number.MAX_SAFE_INTEGER||9007199254740991,wc=16,Ec=Wn-6,Kc=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var At={MAX_LENGTH:Wn,MAX_SAFE_COMPONENT_LENGTH:wc,MAX_SAFE_BUILD_LENGTH:Ec,MAX_SAFE_INTEGER:Sc,RELEASE_TYPES:Kc,SEMVER_SPEC_VERSION:kc,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Qc=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Yt=Qc;(function(e,l){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:c}=At,i=Yt;l=e.exports={};const s=l.re=[],o=l.safeRe=[],a=l.src=[],d=l.t={};let u=0;const Z="[a-zA-Z0-9-]",F=[["\\s",1],["\\d",c],[Z,n]],f=z=>{for(const[m,M]of F)z=z.split(`${m}*`).join(`${m}{0,${M}}`).split(`${m}+`).join(`${m}{1,${M}}`);return z},J=(z,m,M)=>{const k=f(m),E=u++;i(z,E,m),d[z]=E,a[E]=m,s[E]=new RegExp(m,M?"g":void 0),o[E]=new RegExp(k,M?"g":void 0)};J("NUMERICIDENTIFIER","0|[1-9]\\d*"),J("NUMERICIDENTIFIERLOOSE","\\d+"),J("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Z}*`),J("MAINVERSION",`(${a[d.NUMERICIDENTIFIER]})\\.(${a[d.NUMERICIDENTIFIER]})\\.(${a[d.NUMERICIDENTIFIER]})`),J("MAINVERSIONLOOSE",`(${a[d.NUMERICIDENTIFIERLOOSE]})\\.(${a[d.NUMERICIDENTIFIERLOOSE]})\\.(${a[d.NUMERICIDENTIFIERLOOSE]})`),J("PRERELEASEIDENTIFIER",`(?:${a[d.NUMERICIDENTIFIER]}|${a[d.NONNUMERICIDENTIFIER]})`),J("PRERELEASEIDENTIFIERLOOSE",`(?:${a[d.NUMERICIDENTIFIERLOOSE]}|${a[d.NONNUMERICIDENTIFIER]})`),J("PRERELEASE",`(?:-(${a[d.PRERELEASEIDENTIFIER]}(?:\\.${a[d.PRERELEASEIDENTIFIER]})*))`),J("PRERELEASELOOSE",`(?:-?(${a[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[d.PRERELEASEIDENTIFIERLOOSE]})*))`),J("BUILDIDENTIFIER",`${Z}+`),J("BUILD",`(?:\\+(${a[d.BUILDIDENTIFIER]}(?:\\.${a[d.BUILDIDENTIFIER]})*))`),J("FULLPLAIN",`v?${a[d.MAINVERSION]}${a[d.PRERELEASE]}?${a[d.BUILD]}?`),J("FULL",`^${a[d.FULLPLAIN]}$`),J("LOOSEPLAIN",`[v=\\s]*${a[d.MAINVERSIONLOOSE]}${a[d.PRERELEASELOOSE]}?${a[d.BUILD]}?`),J("LOOSE",`^${a[d.LOOSEPLAIN]}$`),J("GTLT","((?:<|>)?=?)"),J("XRANGEIDENTIFIERLOOSE",`${a[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),J("XRANGEIDENTIFIER",`${a[d.NUMERICIDENTIFIER]}|x|X|\\*`),J("XRANGEPLAIN",`[v=\\s]*(${a[d.XRANGEIDENTIFIER]})(?:\\.(${a[d.XRANGEIDENTIFIER]})(?:\\.(${a[d.XRANGEIDENTIFIER]})(?:${a[d.PRERELEASE]})?${a[d.BUILD]}?)?)?`),J("XRANGEPLAINLOOSE",`[v=\\s]*(${a[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[d.XRANGEIDENTIFIERLOOSE]})(?:${a[d.PRERELEASELOOSE]})?${a[d.BUILD]}?)?)?`),J("XRANGE",`^${a[d.GTLT]}\\s*${a[d.XRANGEPLAIN]}$`),J("XRANGELOOSE",`^${a[d.GTLT]}\\s*${a[d.XRANGEPLAINLOOSE]}$`),J("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),J("COERCE",`${a[d.COERCEPLAIN]}(?:$|[^\\d])`),J("COERCEFULL",a[d.COERCEPLAIN]+`(?:${a[d.PRERELEASE]})?(?:${a[d.BUILD]})?(?:$|[^\\d])`),J("COERCERTL",a[d.COERCE],!0),J("COERCERTLFULL",a[d.COERCEFULL],!0),J("LONETILDE","(?:~>?)"),J("TILDETRIM",`(\\s*)${a[d.LONETILDE]}\\s+`,!0),l.tildeTrimReplace="$1~",J("TILDE",`^${a[d.LONETILDE]}${a[d.XRANGEPLAIN]}$`),J("TILDELOOSE",`^${a[d.LONETILDE]}${a[d.XRANGEPLAINLOOSE]}$`),J("LONECARET","(?:\\^)"),J("CARETTRIM",`(\\s*)${a[d.LONECARET]}\\s+`,!0),l.caretTrimReplace="$1^",J("CARET",`^${a[d.LONECARET]}${a[d.XRANGEPLAIN]}$`),J("CARETLOOSE",`^${a[d.LONECARET]}${a[d.XRANGEPLAINLOOSE]}$`),J("COMPARATORLOOSE",`^${a[d.GTLT]}\\s*(${a[d.LOOSEPLAIN]})$|^$`),J("COMPARATOR",`^${a[d.GTLT]}\\s*(${a[d.FULLPLAIN]})$|^$`),J("COMPARATORTRIM",`(\\s*)${a[d.GTLT]}\\s*(${a[d.LOOSEPLAIN]}|${a[d.XRANGEPLAIN]})`,!0),l.comparatorTrimReplace="$1$2$3",J("HYPHENRANGE",`^\\s*(${a[d.XRANGEPLAIN]})\\s+-\\s+(${a[d.XRANGEPLAIN]})\\s*$`),J("HYPHENRANGELOOSE",`^\\s*(${a[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[d.XRANGEPLAINLOOSE]})\\s*$`),J("STAR","(<|>)?=?\\s*\\*"),J("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),J("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Pt,Pt.exports);var it=Pt.exports;const zc=Object.freeze({loose:!0}),Uc=Object.freeze({}),jc=e=>e?typeof e!="object"?zc:e:Uc;var cl=jc;const Jl=/^[0-9]+$/,hn=(e,l)=>{const t=Jl.test(e),n=Jl.test(l);return t&&n&&(e=+e,l=+l),e===l?0:t&&!n?-1:n&&!t?1:ehn(l,e);var pn={compareIdentifiers:hn,rcompareIdentifiers:Lc};const st=Yt,{MAX_LENGTH:xl,MAX_SAFE_INTEGER:at}=At,{safeRe:Bl,t:yl}=it,Mc=cl,{compareIdentifiers:Se}=pn;let Tc=class Xe{constructor(l,t){if(t=Mc(t),l instanceof Xe){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>xl)throw new TypeError(`version is longer than ${xl} characters`);st("SemVer",l,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=l.trim().match(t.loose?Bl[yl.LOOSE]:Bl[yl.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>at||this.major<0)throw new TypeError("Invalid major version");if(this.minor>at||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>at||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]),Se(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 ge=Tc;const Fl=ge,$c=(e,l,t=!1)=>{if(e instanceof Fl)return e;try{return new Fl(e,l)}catch(n){if(!t)return null;throw n}};var Le=$c;const Oc=Le,Pc=(e,l)=>{const t=Oc(e,l);return t?t.version:null};var Dc=Pc;const _c=Le,qc=(e,l)=>{const t=_c(e.trim().replace(/^[=v]+/,""),l);return t?t.version:null};var ei=qc;const Hl=ge,ti=(e,l,t,n,c)=>{typeof t=="string"&&(c=n,n=t,t=void 0);try{return new Hl(e instanceof Hl?e.version:e,t).inc(l,n,c).version}catch{return null}};var li=ti;const Nl=Le,ni=(e,l)=>{const t=Nl(e,null,!0),n=Nl(l,null,!0),c=t.compare(n);if(c===0)return null;const i=c>0,s=i?t:n,o=i?n:t,a=!!s.prerelease.length;if(!!o.prerelease.length&&!a)return!o.patch&&!o.minor?"major":s.patch?"patch":s.minor?"minor":"major";const u=a?"pre":"";return t.major!==n.major?u+"major":t.minor!==n.minor?u+"minor":t.patch!==n.patch?u+"patch":"prerelease"};var ci=ni;const ii=ge,oi=(e,l)=>new ii(e,l).major;var si=oi;const ai=ge,ri=(e,l)=>new ai(e,l).minor;var gi=ri;const di=ge,bi=(e,l)=>new di(e,l).patch;var Zi=bi;const mi=Le,ui=(e,l)=>{const t=mi(e,l);return t&&t.prerelease.length?t.prerelease:null};var Gi=ui;const vl=ge,Ii=(e,l,t)=>new vl(e,t).compare(new vl(l,t));var Ce=Ii;const Ci=Ce,Wi=(e,l,t)=>Ci(l,e,t);var hi=Wi;const pi=Ce,Xi=(e,l)=>pi(e,l,!0);var fi=Xi;const kl=ge,Ri=(e,l,t)=>{const n=new kl(e,t),c=new kl(l,t);return n.compare(c)||n.compareBuild(c)};var il=Ri;const Vi=il,Ai=(e,l)=>e.sort((t,n)=>Vi(t,n,l));var Yi=Ai;const Ji=il,xi=(e,l)=>e.sort((t,n)=>Ji(n,t,l));var Bi=xi;const yi=Ce,Fi=(e,l,t)=>yi(e,l,t)>0;var Jt=Fi;const Hi=Ce,Ni=(e,l,t)=>Hi(e,l,t)<0;var ol=Ni;const vi=Ce,ki=(e,l,t)=>vi(e,l,t)===0;var Xn=ki;const Si=Ce,wi=(e,l,t)=>Si(e,l,t)!==0;var fn=wi;const Ei=Ce,Ki=(e,l,t)=>Ei(e,l,t)>=0;var sl=Ki;const Qi=Ce,zi=(e,l,t)=>Qi(e,l,t)<=0;var al=zi;const Ui=Xn,ji=fn,Li=Jt,Mi=sl,Ti=ol,$i=al,Oi=(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 Ui(e,t,n);case"!=":return ji(e,t,n);case">":return Li(e,t,n);case">=":return Mi(e,t,n);case"<":return Ti(e,t,n);case"<=":return $i(e,t,n);default:throw new TypeError(`Invalid operator: ${l}`)}};var Rn=Oi;const Pi=ge,Di=Le,{safeRe:rt,t:gt}=it,_i=(e,l)=>{if(e instanceof Pi)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?rt[gt.COERCEFULL]:rt[gt.COERCE]);else{const a=l.includePrerelease?rt[gt.COERCERTLFULL]:rt[gt.COERCERTL];let d;for(;(d=a.exec(e))&&(!t||t.index+t[0].length!==e.length);)(!t||d.index+d[0].length!==t.index+t[0].length)&&(t=d),a.lastIndex=d.index+d[1].length+d[2].length;a.lastIndex=-1}if(t===null)return null;const n=t[2],c=t[3]||"0",i=t[4]||"0",s=l.includePrerelease&&t[5]?`-${t[5]}`:"",o=l.includePrerelease&&t[6]?`+${t[6]}`:"";return Di(`${n}.${c}.${i}${s}${o}`,l)};var qi=_i;class eo{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 to=eo,wt,Sl;function We(){if(Sl)return wt;Sl=1;class e{constructor(p,H){if(H=n(H),p instanceof e)return p.loose===!!H.loose&&p.includePrerelease===!!H.includePrerelease?p:new e(p.raw,H);if(p instanceof c)return this.raw=p.value,this.set=[[p]],this.format(),this;if(this.options=H,this.loose=!!H.loose,this.includePrerelease=!!H.includePrerelease,this.raw=p.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(y=>this.parseRange(y.trim())).filter(y=>y.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const y=this.set[0];if(this.set=this.set.filter(N=>!J(N[0])),this.set.length===0)this.set=[y];else if(this.set.length>1){for(const N of this.set)if(N.length===1&&z(N[0])){this.set=[N];break}}}this.format()}format(){return this.range=this.set.map(p=>p.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(p){const y=((this.options.includePrerelease&&F)|(this.options.loose&&f))+":"+p,N=t.get(y);if(N)return N;const V=this.options.loose,S=V?o[a.HYPHENRANGELOOSE]:o[a.HYPHENRANGE];p=p.replace(S,W(this.options.includePrerelease)),i("hyphen replace",p),p=p.replace(o[a.COMPARATORTRIM],d),i("comparator trim",p),p=p.replace(o[a.TILDETRIM],u),i("tilde trim",p),p=p.replace(o[a.CARETTRIM],Z),i("caret trim",p);let L=p.split(" ").map(A=>M(A,this.options)).join(" ").split(/\s+/).map(A=>R(A,this.options));V&&(L=L.filter(A=>(i("loose invalid filter",A,this.options),!!A.match(o[a.COMPARATORLOOSE])))),i("range list",L);const w=new Map,Q=L.map(A=>new c(A,this.options));for(const A of Q){if(J(A))return[A];w.set(A.value,A)}w.size>1&&w.has("")&&w.delete("");const _=[...w.values()];return t.set(y,_),_}intersects(p,H){if(!(p instanceof e))throw new TypeError("a Range is required");return this.set.some(y=>m(y,H)&&p.set.some(N=>m(N,H)&&y.every(V=>N.every(S=>V.intersects(S,H)))))}test(p){if(!p)return!1;if(typeof p=="string")try{p=new s(p,this.options)}catch{return!1}for(let H=0;HC.value==="<0.0.0-0",z=C=>C.value==="",m=(C,p)=>{let H=!0;const y=C.slice();let N=y.pop();for(;H&&y.length;)H=y.every(V=>N.intersects(V,p)),N=y.pop();return H},M=(C,p)=>(i("comp",C,p),C=K(C,p),i("caret",C),C=E(C,p),i("tildes",C),C=ue(C,p),i("xrange",C),C=v(C,p),i("stars",C),C),k=C=>!C||C.toLowerCase()==="x"||C==="*",E=(C,p)=>C.trim().split(/\s+/).map(H=>T(H,p)).join(" "),T=(C,p)=>{const H=p.loose?o[a.TILDELOOSE]:o[a.TILDE];return C.replace(H,(y,N,V,S,L)=>{i("tilde",C,y,N,V,S,L);let w;return k(N)?w="":k(V)?w=`>=${N}.0.0 <${+N+1}.0.0-0`:k(S)?w=`>=${N}.${V}.0 <${N}.${+V+1}.0-0`:L?(i("replaceTilde pr",L),w=`>=${N}.${V}.${S}-${L} <${N}.${+V+1}.0-0`):w=`>=${N}.${V}.${S} <${N}.${+V+1}.0-0`,i("tilde return",w),w})},K=(C,p)=>C.trim().split(/\s+/).map(H=>oe(H,p)).join(" "),oe=(C,p)=>{i("caret",C,p);const H=p.loose?o[a.CARETLOOSE]:o[a.CARET],y=p.includePrerelease?"-0":"";return C.replace(H,(N,V,S,L,w)=>{i("caret",C,N,V,S,L,w);let Q;return k(V)?Q="":k(S)?Q=`>=${V}.0.0${y} <${+V+1}.0.0-0`:k(L)?V==="0"?Q=`>=${V}.${S}.0${y} <${V}.${+S+1}.0-0`:Q=`>=${V}.${S}.0${y} <${+V+1}.0.0-0`:w?(i("replaceCaret pr",w),V==="0"?S==="0"?Q=`>=${V}.${S}.${L}-${w} <${V}.${S}.${+L+1}-0`:Q=`>=${V}.${S}.${L}-${w} <${V}.${+S+1}.0-0`:Q=`>=${V}.${S}.${L}-${w} <${+V+1}.0.0-0`):(i("no pr"),V==="0"?S==="0"?Q=`>=${V}.${S}.${L}${y} <${V}.${S}.${+L+1}-0`:Q=`>=${V}.${S}.${L}${y} <${V}.${+S+1}.0-0`:Q=`>=${V}.${S}.${L} <${+V+1}.0.0-0`),i("caret return",Q),Q})},ue=(C,p)=>(i("replaceXRanges",C,p),C.split(/\s+/).map(H=>h(H,p)).join(" ")),h=(C,p)=>{C=C.trim();const H=p.loose?o[a.XRANGELOOSE]:o[a.XRANGE];return C.replace(H,(y,N,V,S,L,w)=>{i("xRange",C,y,N,V,S,L,w);const Q=k(V),_=Q||k(S),A=_||k(L),he=A;return N==="="&&he&&(N=""),w=p.includePrerelease?"-0":"",Q?N===">"||N==="<"?y="<0.0.0-0":y="*":N&&he?(_&&(S=0),L=0,N===">"?(N=">=",_?(V=+V+1,S=0,L=0):(S=+S+1,L=0)):N==="<="&&(N="<",_?V=+V+1:S=+S+1),N==="<"&&(w="-0"),y=`${N+V}.${S}.${L}${w}`):_?y=`>=${V}.0.0${w} <${+V+1}.0.0-0`:A&&(y=`>=${V}.${S}.0${w} <${V}.${+S+1}.0-0`),i("xRange return",y),y})},v=(C,p)=>(i("replaceStars",C,p),C.trim().replace(o[a.STAR],"")),R=(C,p)=>(i("replaceGTE0",C,p),C.trim().replace(o[p.includePrerelease?a.GTE0PRE:a.GTE0],"")),W=C=>(p,H,y,N,V,S,L,w,Q,_,A,he)=>(k(y)?H="":k(N)?H=`>=${y}.0.0${C?"-0":""}`:k(V)?H=`>=${y}.${N}.0${C?"-0":""}`:S?H=`>=${H}`:H=`>=${H}${C?"-0":""}`,k(Q)?w="":k(_)?w=`<${+Q+1}.0.0-0`:k(A)?w=`<${Q}.${+_+1}.0-0`:he?w=`<=${Q}.${_}.${A}-${he}`:C?w=`<${Q}.${_}.${+A+1}-0`:w=`<=${w}`,`${H} ${w}`.trim()),le=(C,p,H)=>{for(let y=0;y0){const N=C[y].semver;if(N.major===p.major&&N.minor===p.minor&&N.patch===p.patch)return!0}return!1}return!0};return wt}var Et,wl;function xt(){if(wl)return Et;wl=1;const e=Symbol("SemVer ANY");class l{static get ANY(){return e}constructor(u,Z){if(Z=t(Z),u instanceof l){if(u.loose===!!Z.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,Z),this.options=Z,this.loose=!!Z.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const Z=this.options.loose?n[c.COMPARATORLOOSE]:n[c.COMPARATOR],F=u.match(Z);if(!F)throw new TypeError(`Invalid comparator: ${u}`);this.operator=F[1]!==void 0?F[1]:"",this.operator==="="&&(this.operator=""),F[2]?this.semver=new o(F[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new o(u,this.options)}catch{return!1}return i(u,this.operator,this.semver,this.options)}intersects(u,Z){if(!(u instanceof l))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new a(u.value,Z).test(this.value):u.operator===""?u.value===""?!0:new a(this.value,Z).test(u.semver):(Z=t(Z),Z.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!Z.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||i(this.semver,"<",u.semver,Z)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,Z)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Et=l;const t=cl,{safeRe:n,t:c}=it,i=Rn,s=Yt,o=ge,a=We();return Et}const lo=We(),no=(e,l,t)=>{try{l=new lo(l,t)}catch{return!1}return l.test(e)};var Bt=no;const co=We(),io=(e,l)=>new co(e,l).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));var oo=io;const so=ge,ao=We(),ro=(e,l,t)=>{let n=null,c=null,i=null;try{i=new ao(l,t)}catch{return null}return e.forEach(s=>{i.test(s)&&(!n||c.compare(s)===-1)&&(n=s,c=new so(n,t))}),n};var go=ro;const bo=ge,Zo=We(),mo=(e,l,t)=>{let n=null,c=null,i=null;try{i=new Zo(l,t)}catch{return null}return e.forEach(s=>{i.test(s)&&(!n||c.compare(s)===1)&&(n=s,c=new bo(n,t))}),n};var uo=mo;const Kt=ge,Go=We(),El=Jt,Io=(e,l)=>{e=new Go(e,l);let t=new Kt("0.0.0");if(e.test(t)||(t=new Kt("0.0.0-0"),e.test(t)))return t;t=null;for(let n=0;n{const o=new Kt(s.semver.version);switch(s.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!i||El(o,i))&&(i=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),i&&(!t||El(t,i))&&(t=i)}return t&&e.test(t)?t:null};var Co=Io;const Wo=We(),ho=(e,l)=>{try{return new Wo(e,l).range||"*"}catch{return null}};var po=ho;const Xo=ge,Vn=xt(),{ANY:fo}=Vn,Ro=We(),Vo=Bt,Kl=Jt,Ql=ol,Ao=al,Yo=sl,Jo=(e,l,t,n)=>{e=new Xo(e,n),l=new Ro(l,n);let c,i,s,o,a;switch(t){case">":c=Kl,i=Ao,s=Ql,o=">",a=">=";break;case"<":c=Ql,i=Yo,s=Kl,o="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Vo(e,l,n))return!1;for(let d=0;d{f.semver===fo&&(f=new Vn(">=0.0.0")),Z=Z||f,F=F||f,c(f.semver,Z.semver,n)?Z=f:s(f.semver,F.semver,n)&&(F=f)}),Z.operator===o||Z.operator===a||(!F.operator||F.operator===o)&&i(e,F.semver))return!1;if(F.operator===a&&s(e,F.semver))return!1}return!0};var rl=Jo;const xo=rl,Bo=(e,l,t)=>xo(e,l,">",t);var yo=Bo;const Fo=rl,Ho=(e,l,t)=>Fo(e,l,"<",t);var No=Ho;const zl=We(),vo=(e,l,t)=>(e=new zl(e,t),l=new zl(l,t),e.intersects(l,t));var ko=vo;const So=Bt,wo=Ce;var Eo=(e,l,t)=>{const n=[];let c=null,i=null;const s=e.sort((u,Z)=>wo(u,Z,t));for(const u of s)So(u,l,t)?(i=u,c||(c=u)):(i&&n.push([c,i]),i=null,c=null);c&&n.push([c,null]);const o=[];for(const[u,Z]of n)u===Z?o.push(u):!Z&&u===s[0]?o.push("*"):Z?u===s[0]?o.push(`<=${Z}`):o.push(`${u} - ${Z}`):o.push(`>=${u}`);const a=o.join(" || "),d=typeof l.raw=="string"?l.raw:String(l);return a.length{if(e===l)return!0;e=new Ul(e,t),l=new Ul(l,t);let n=!1;e:for(const c of e.set){for(const i of l.set){const s=zo(c,i,t);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Qo=[new gl(">=0.0.0-0")],jl=[new gl(">=0.0.0")],zo=(e,l,t)=>{if(e===l)return!0;if(e.length===1&&e[0].semver===Qt){if(l.length===1&&l[0].semver===Qt)return!0;t.includePrerelease?e=Qo:e=jl}if(l.length===1&&l[0].semver===Qt){if(t.includePrerelease)return!0;l=jl}const n=new Set;let c,i;for(const f of e)f.operator===">"||f.operator===">="?c=Ll(c,f,t):f.operator==="<"||f.operator==="<="?i=Ml(i,f,t):n.add(f.semver);if(n.size>1)return null;let s;if(c&&i){if(s=dl(c.semver,i.semver,t),s>0)return null;if(s===0&&(c.operator!==">="||i.operator!=="<="))return null}for(const f of n){if(c&&!Te(f,String(c),t)||i&&!Te(f,String(i),t))return null;for(const J of l)if(!Te(f,String(J),t))return!1;return!0}let o,a,d,u,Z=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1,F=c&&!t.includePrerelease&&c.semver.prerelease.length?c.semver:!1;Z&&Z.prerelease.length===1&&i.operator==="<"&&Z.prerelease[0]===0&&(Z=!1);for(const f of l){if(u=u||f.operator===">"||f.operator===">=",d=d||f.operator==="<"||f.operator==="<=",c){if(F&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===F.major&&f.semver.minor===F.minor&&f.semver.patch===F.patch&&(F=!1),f.operator===">"||f.operator===">="){if(o=Ll(c,f,t),o===f&&o!==c)return!1}else if(c.operator===">="&&!Te(c.semver,String(f),t))return!1}if(i){if(Z&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===Z.major&&f.semver.minor===Z.minor&&f.semver.patch===Z.patch&&(Z=!1),f.operator==="<"||f.operator==="<="){if(a=Ml(i,f,t),a===f&&a!==i)return!1}else if(i.operator==="<="&&!Te(i.semver,String(f),t))return!1}if(!f.operator&&(i||c)&&s!==0)return!1}return!(c&&d&&!i&&s!==0||i&&u&&!c&&s!==0||F||Z)},Ll=(e,l,t)=>{if(!e)return l;const n=dl(e.semver,l.semver,t);return n>0?e:n<0||l.operator===">"&&e.operator===">="?l:e},Ml=(e,l,t)=>{if(!e)return l;const n=dl(e.semver,l.semver,t);return n<0?e:n>0||l.operator==="<"&&e.operator==="<="?l:e};var Uo=Ko;const zt=it,Tl=At,jo=ge,$l=pn,Lo=Le,Mo=Dc,To=ei,$o=li,Oo=ci,Po=si,Do=gi,_o=Zi,qo=Gi,es=Ce,ts=hi,ls=fi,ns=il,cs=Yi,is=Bi,os=Jt,ss=ol,as=Xn,rs=fn,gs=sl,ds=al,bs=Rn,Zs=qi,ms=xt(),us=We(),Gs=Bt,Is=oo,Cs=go,Ws=uo,hs=Co,ps=po,Xs=rl,fs=yo,Rs=No,Vs=ko,As=Eo,Ys=Uo;var Js={parse:Lo,valid:Mo,clean:To,inc:$o,diff:Oo,major:Po,minor:Do,patch:_o,prerelease:qo,compare:es,rcompare:ts,compareLoose:ls,compareBuild:ns,sort:cs,rsort:is,gt:os,lt:ss,eq:as,neq:rs,gte:gs,lte:ds,cmp:bs,coerce:Zs,Comparator:ms,Range:us,satisfies:Gs,toComparators:Is,maxSatisfying:Cs,minSatisfying:Ws,minVersion:hs,validRange:ps,outside:Xs,gtr:fs,ltr:Rs,intersects:Vs,simplifyRange:As,subset:Ys,SemVer:jo,re:zt.re,src:zt.src,tokens:zt.t,SEMVER_SPEC_VERSION:Tl.SEMVER_SPEC_VERSION,RELEASE_TYPES:Tl.RELEASE_TYPES,compareIdentifiers:$l.compareIdentifiers,rcompareIdentifiers:$l.rcompareIdentifiers},xs=Js;const Bs=vc(xs),An=e=>e!=null&&e.includes(" ")?`"${e}"`:`${e??"pandoc"}`;async function ys(e,l){e=An(e);let t=await jt(`${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 Bs.parse(t,!0)}const Fs="3.1.7",mt={normalizePath:An,getVersion:ys,requiredVersion:Fs};async function Yn(e,l,t,n,c,i,s,o,a,d,u){const{settings:Z,lang:F,manifest:f,app:{vault:{adapter:J,config:z},metadataCache:m}}=e;if(!n){const O=en(c);n=`${l.basename}${O}`}i==null&&(i=Z.showOverwriteConfirmation);const M=Z.showExportProgressBar,k=J.getBasePath(),E=`${k}/${f.dir}`,T=`${E}/lua`,K=t,oe=`${K}/${n}`,ue=n.substring(0,n.lastIndexOf(".")),h=n,v=J.getFullPath(l.path),R=ne.dirname(v),W=l.basename,le=l.name;let C=z.attachmentFolderPath??"/";C==="/"?C=k:C.startsWith(".")?C=ne.join(R,C.substring(1)):C=ne.join(k,C);let p=null;try{p=m.getCache(l.path).frontmatter}catch(O){console.error(O)}let H=null;try{H=m.getCache(l.path).embeds}catch(O){console.error(O)}let y=[];for(const O of H||[]){const pe=O.link,se=m.getFirstLinkpathDest(pe,l.path);se instanceof Ze.TFile?y.push(ne.join(k,ne.dirname(se.path))):se===null&&console.warn(`Could not resolve embedded file: ${pe}`)}y=[...new Set(y)];const N=y.join(ne.delimiter),V={pluginDir:E,luaDir:T,outputDir:K,outputPath:oe,outputFileName:ue,outputFileFullName:h,currentDir:R,currentPath:v,currentFileName:W,currentFileFullName:le,attachmentFolderPath:C,vaultDir:k,metadata:p,embedDirs:N,options:s,fromFormat:app.vault.config.useMarkdownLinks?"markdown":"markdown+wikilinks_title_after_pipe"},S=c.type==="custom"&&c.showCommandOutput,L=c.openExportedFileLocation??Z.openExportedFileLocation,w=c.openExportedFile??Z.openExportedFile;if(i&&Ft.existsSync(oe)){const O=await Fe.remote.dialog.showSaveDialog({title:F.overwriteConfirmationDialog.title(h),defaultPath:oe,properties:["showOverwriteConfirmation","createDirectory"]});if(O.canceled)return;V.outputPath=O.filePath,V.outputDir=ne.dirname(V.outputPath),V.outputFileFullName=ne.basename(V.outputPath),V.outputFileName=ne.basename(V.outputFileFullName,ne.extname(V.outputFileFullName))}let Q;M&&(Q=Nc.show(F.preparing(V.outputFileFullName)));const _=V.env=tn(be(Z.env)??{},V);let A=mt.normalizePath(be(Z.pandocPath));if(Xt.platform==="win32"){A=A.replaceAll("\\","/");const O=["pluginDir","luaDir","outputDir","outputPath","currentDir","currentPath","attachmentFolderPath","vaultDir","embedDirs"];for(const pe of O){const se=V[pe];V[pe]=se.replaceAll("\\","/")}}const he=c.type==="pandoc"?`${A} "\${currentPath}" ${c.arguments??""} ${c.customArguments??""} ${o??""}`:c.command,Ne=Lt(he,V),yt=ct(Ne.match(/(?:[^\s"]+|"[^"]*")+/g),{alias:{output:["o"]}});try{const O=ne.normalize(Kn(yt.output)),pe=ne.dirname(O);Ft.existsSync(pe)||Ft.mkdirSync(pe),console.log(`[${e.manifest.name}]: export command and options:`,{cmd:Ne,options:{cwd:V.currentDir,env:_}}),await jt(Ne,{cwd:V.currentDir,env:_}),Q==null||Q();const se=async()=>{if(L&&setTimeout(()=>{Fe.remote.shell.showItemInFolder(O)},1e3),w&&await Fe.remote.shell.openPath(O),c.type==="pandoc"&&c.runCommand===!0&&c.command){const ve=Lt(c.command,V);await jt(ve,{cwd:V.currentDir,env:_})}a&&a()};if(S){const ve=new Yl(app,F.exportCommandOutputMessage(Ne));ve.onClose=se,ve.open()}else new Ze.Notice(F.exportSuccessNotice(V.outputFileFullName),1500),await se()}catch(O){Q==null||Q(),new Yl(app,F.exportErrorOutputMessage(Ne,O)).open(),d&&d()}}const Dt=e=>{const l=new Ze.Modal(e.app);let t=[],n=!1;return Je(()=>{ie(l.titleEl,()=>e.title)}),Je(()=>{ie(l.contentEl,()=>e.children)}),Je(()=>{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}),Je(()=>{l.containerEl.style.display=e.hidden?"None":""}),l.onClose=()=>{n||(n=!0,e.onClose())},cn(()=>l.open()),Ue(()=>{n||l.close()}),document.createTextNode("")};var Hs=me("