var qe=Object.defineProperty;var Ve=(e,t,i)=>t in e?qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var C=(e,t,i)=>(Ve(e,typeof t!="symbol"?t+"":t,i),i);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const b of c)if(b.type==="childList")for(const y of b.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&l(y)}).observe(document,{childList:!0,subtree:!0});function i(c){const b={};return c.integrity&&(b.integrity=c.integrity),c.referrerPolicy&&(b.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?b.credentials="include":c.crossOrigin==="anonymous"?b.credentials="omit":b.credentials="same-origin",b}function l(c){if(c.ep)return;c.ep=!0;const b=i(c);fetch(c.href,b)}})();const Ge="monaco-editor",Ye="Zuoqiu Yingyi",Xe="https://github.com/Zuoqiu-Yingyi/siyuan-plugin-monaco-editor",Ke="0.2.5",Ze="3.0.12",Je=["代码","代碼","程式碼","code","visual","studio","vscode","monaco","编辑器","編輯器","editor","vditor","文件","資料","file","文件夹","文件夾","資料夾","folder","管理","manage","资源管理器","資源管理器","explorer","markdown","所见即所得","所見即所得","wysiwyg","下载","下載","download","上传","上傳","upload"],Qe=["all"],et=["desktop","desktop-window","browser-desktop"],tt={default:"Integrated Edit Environment",zh_CN:"集成编辑环境",zh_CHT:"集成編輯環境"},it={default:"A file editing tool integrating Monaco Editor.",zh_CN:"一个集成了 Monaco Editor 的文件编辑工具。",zh_CHT:"一個集成了 Monaco Editor 的文件編輯工具。"},ot={default:"README.md",zh_CN:"README_zh_CN.md",zh_CHT:"README_zh_CN.md"},rt={openCollective:"",patreon:"",github:"",custom:["https://afdian.net/a/zuoqiu","https://ko-fi.com/zuoqiu"]},ai={name:Ge,author:Ye,url:Xe,version:Ke,minAppVersion:Ze,keywords:Je,backends:Qe,frontends:et,displayName:tt,description:it,readme:ot,funding:rt},at={fullscreen:{ariaLabel:"Fullscreen"},realTime:{ariaLabel:"Save changes in real time"},workspace:{text:"Workspace"}},nt="Integrated Edit Environment",st={collapse:{ariaLabel:"Collapse All Folder"},inline:{ariaLabel:`markdown: Edit standard markdown kramdown: Inline elements use tags`},kramdown:{ariaLabel:"Edit with kramdown"},refresh:{ariaLabel:"Save changes in real time"},title:"Code Edit"},lt={action:{save:{label:"Save"},saveAs:{label:"Save As"},setModelLanguage:{label:"Set Editor Model Language"},toggleWordWrap:{label:"Toggle Word Wrap"}},tooltip:{siyuanBlockHyperlink:{label:"SiYuan block hyperlink"},siyuanBlockID:{label:"SiYuan block ID"},siyuanBlockReference:{label:"SiYuan block reference"}}},ct={count:{ariaLabel:"Number of Resources"},file:{ariaLabel:"File"},fold:{ariaLabel:"Collapse"},folder:{ariaLabel:"Folder"},lastUpdated:{text:"Last Updated"},menu:{ariaLabel:"Menu"},refresh:{ariaLabel:"Refresh Explorer"},symlink:{ariaLabel:"Symbolic Link"},title:"File Explorer",toggle:{ariaLabel:"Collapse/Expand"},tooltips:{paths:[["conf","Configuration directory"],["conf/appearance","Appearance directory"],["conf/appearance/boot","Boot window directory"],["conf/appearance/emojis","Emojis directory"],["conf/appearance/icons","Interface icons directory"],["conf/appearance/langs","Localization directory"],["conf/appearance/themes","Themes directory"],["conf/conf.json","Configuration file"],["conf/windowState.json","Window state file"],["data","Data directory"],["data/.siyuan","Metadata directory"],["data/.siyuan/filesys_status_check","File system status check temporary file directory"],["data/.siyuan/conf.json","Data directory state file"],["data/.siyuan/syncignore","Data snapshot ignore configuration file"],["data/assets","Resources file directory"],["data/assets/ocr-texts.json","Image OCR results"],["data/emojis","Custom emojis file directory"],["data/plugins","Plugins directory"],["data/public","Public file directory"],["data/snippets","Code snippets directory"],["data/snippets/conf.json","Code snippets list"],["data/storage","Data storage directory"],["data/storage/av","Attribute view directory"],["data/storage/petal","Plugin data directory"],["data/storage/petal/petals.json","Plugin status directory"],["data/storage/riff","Flashcard data directory"],["data/storage/criteria.json","Search configuration"],["data/storage/local.json","Local interface configuration"],["data/storage/recent-doc.json","Recently opened documents"],["data/templates","Template directory"],["data/widgets","Widgets directory"],["history","History data directory"],["repo","Data snapshot directory"],["temp","Temporary file directory"],["temp/blocktree","Content block structure index directory"],["temp/os","System information directory"],["temp/pandoc","Pandoc directory"],["temp/pandoc/bin","Pandoc executable file directory"],["temp/history.db","Historical document index database file"],["temp/history.db-shm","Historical document index database shared memory file"],["temp/history.db-wal","Historical document index database write-ahead log file"],["temp/siyuan.db","Content block index database file"],["temp/siyuan.db-shm","Content block index database shared memory file"],["temp/siyuan.db-wal","Content block index database write-ahead log file"],["temp/siyuan.log","Kernel log file"],[".lock","Workspace occupied flag"]],siyuanDoc:"Document file",siyuanDocCustomSort:"Document customized sort file",siyuanDocDir:"Document directory",siyuanNotebook:"Notebook directory",siyuanNotebookConfig:"Notebook configuration file",siyuanNotebookMetadataDir:"Notebook metadata directory"},unfold:{ariaLabel:"Expand"},workspace:{name:"Workspace"}},dt={charset:{label:"Character set",placeholder:"The name of the character set",text:"Open the file with encoding"},confirm:{placeholder:"The full path to the resource",text:"Warning: You are operating on a protected resource ${1} !
Your subsequent activities may lead to data loss or damage!

If you want to continue the operation, please enter the complete path of the resource ${2} in the text box below",tips:{pleaseEnter:"Please enter the complete path of the resource",warn:"Are you sure you want to continue operating the resource ${1}?"},title:"⚠️ High-risk operation confirmation"},copy:{label:"Copy"},copyDownloadHyperlink:{label:"Copy Download Hyperlink"},copyEditHyperlink:{label:"Copy Edit Hyperlink"},copyExportHyperlink:{label:"Copy Export Hyperlink"},copyFullPath:{label:"Copy Absolute Path"},copyMarkdownHyperlink:{label:"Copy Markdown Hyperlink"},copyName:{label:"Copy Name"},copyPreviewHyperlink:{label:"Copy Preview Hyperlink"},copyReferencePath:{label:"Copy Reference Path"},copyRelativePath:{label:"Copy Relative Path"},copyURL:{label:"Copy URL"},delete:{label:"Delete"},deleteFile:{label:"Delete File",text:"Make sure you want to delete the file ${1} ?
The complete path of the file is ${2}"},deleteFolder:{label:"Delete Folder",text:"Make sure you want to delete the folder ${1} ?
The complete path of the folder is ${2}"},diffEdit:{label:"Compare and Edit"},diffView:{label:"Compare and View"},download:{label:"Download"},editAssetFile:{label:"Edit Asset File"},editLocalFile:{label:"Edit Local File"},export:{accelerator:"Export",label:"Export..."},exportFile:{label:"File Export",message:"File ${1} has exported to ${2}, does you reveal it in explorer?",title:"Export file ${1}"},exportFolder:{label:"Folder Export",message:"Folder ${1} has exported to ${2}, does you reveal it in explorer?",title:"Export folder ${1}"},import:{label:"Import"},importFile:{label:"Files Import...",title:"Import files to ${1}"},importFolder:{label:"Folders Import...",title:"Import folders to ${1}"},move:{text:"Move ${1}
from ${2}
to  、 ${3}?",title:"Move ${1}"},new:{label:"New"},newFile:{label:"New File...",placeholder:"File name",text:"Create a new file in the folder ${1}",tips:{empty:"The file name cannot be empty",exist:"${2} already exists under folder ${1}, please enter a different name",invalid:"Name ${1} is an invalid file name, please enter a different name",normal:"Create a new file ${1} ?",pleaseEnter:"Please enter a file name"}},newFolder:{label:"New Folder...",placeholder:"Folder name",text:"Create a new folder in the folder ${1}",tips:{empty:"The folder name cannot be empty",exist:"${2} already exists under folder ${1}, please enter a different name",invalid:"Name ${1} is an invalid folder name, please enter a different name",normal:"Create a new folder ${1} ?",pleaseEnter:"Please enter a folder name"}},open:{label:"Open"},openByNewWindow:{label:"Open with New Window"},openFile:{label:"Open File"},openFileInEditor:{label:"Open File in Text Editor"},openFileInPreviewer:{label:"Open File in File Previewer"},openInNewTab:{label:"Open in New Tab"},openTabBackground:{label:"Open in background tab"},openTabBottom:{label:"Open Below the Tab"},openTabRight:{label:"Open Right the Tab"},openWithDefaultProgram:{label:"Open with Default Program"},refresh:{label:"Refresh"},refreshDirectory:{label:"Refresh the Directory"},refreshDirectoryDeeply:{label:"Refresh the Directory Deeply"},rename:{label:"Rename..."},renameFile:{label:"Rename File",placeholder:"File name",text:"Rename file ${1}",tips:{empty:"The file name cannot be empty",exist:"${2} already exists under folder ${1}, please enter a different name",invalid:"Name ${1} is an invalid file name, please enter a different name",normal:"Rename file ${1} to ${2}?",pleaseEnter:"Please enter a new file name",same:"The file name has not changed"}},renameFolder:{label:"Rename Folder",placeholder:"Folder name",text:"Create a new folder in the folder ${1}",tips:{empty:"The folder name cannot be empty",exist:"${2} already exists under folder ${1}, please enter a different name",invalid:"Name ${1} is an invalid folder name, please enter a different name",normal:"Rename folder ${1} to ${2}?",pleaseEnter:"Please enter a new folder name",same:"The folder name has not changed"}},revealInExplorer:{label:"Reveal In Explorer"},standard:{accelerator:"Standard"},upload:{label:"Upload",tips:{confirm:"Confirm",reUpload:"Retry",startUpload:"Upload",statusInfo:"Number of files uploaded: ${1}/${2}   Size of files uploaded: ${3}/${4} Byte"}},uploadFile:{label:"Files Upload..."},uploadFolder:{label:"Folders Upload..."},viewNetworkFile:{label:"View Network File"}},ut={binaryError:"The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding.",openAnyway:"Open Anyway?"},bt={editorSettings:{globalTab:{defaultEditor:{markdown:{description:"Set the default editor for opening *.md files",options:{monaco:"Monaco Editor",vditor:"Vditor Editor"},title:"Default Editor for Markdown Files"}},title:"Global Settings"},monacoTab:{title:"Monaco Editor",wordWrap:{description:"The word wrapping solution used in the editor",options:{bounded:"[bounded] Wrap at the minimum of custom column width and viewport width",off:"[off] Do not wrap",on:"[on] Wrap at the visible viewport",wordWrapColumn:"[wordWrapColumn] Wrap at the custom column width"},title:"Editor Word Wrapping Solution wordWrap"}},title:"Editor Settings",vditorTab:{assetsDirPath:{description:"Set the directory for saving resource files, the specific directory depends on the Resource File Saving Scheme setting",title:"Resource File Saving Directory"},assetsUploadMode:{description:"Save resource files to a specific directory, the specific directory depends on the Resource File Saving Directory setting.
Upload to data/assets directory: Upload files to the workspace/data/assets directory, the specific directory is specified by the Resource File Saving Directory setting.
Use relative path to specify directory: Upload files to the directory specified by the Resource File Saving Directory setting, with the working directory being the current file directory.
Use absolute path to specify directory: Upload files to the directory specified by the Resource File Saving Directory setting, with the working directory being the workspace directory.",options:{absolute:"Use absolute path to specify directory",assets:"Upload to data/assets directory",relative:"Use relative path to specify directory"},title:"Resource File Saving Scheme"},title:"Vditor Editor"}},generalSettings:{editor:{description:"Enable text editor sidebar panel",title:"Text Editor"},explorer:{description:"Enable explorer sidebar panel",title:"Explorer"},reset:{description:"Reset all settings options to default (page will refresh after reset)",text:"Reset",title:"Reset Settings"},safeMode:{description:"Whether to disable dangerous operations under the important directory",title:"Safe Mode"},title:"General Settings"},menuSettings:{history1:{description:"Context menu for file history panel",title:"File History Menu"},history2:{description:"Context menu for document history panel",title:"Document History Menu"},shorthand:{description:"Context menu for shorthand collection",title:"Shorthand Menu"},snapshot:{description:"Context menu for snapshot panel",title:"Snapshot Panel Menu"},snippet:{description:"Context menu for code snippets",title:"Code Snippets Menu"},title:"Menu Settings"}},ni={button:at,displayName:nt,dock:st,editor:lt,explorer:ct,menu:dt,message:ut,settings:bt},pt={get light(){return window.matchMedia("(prefers-color-scheme: light)")},get dark(){return window.matchMedia("(prefers-color-scheme: dark)")}},ft=vt(),ht=_t(),mt=Et();$e();kt();function wt(){return!!globalThis.require}function gt(){return!!globalThis.process}function yt(){var e,t;return!!((t=(e=globalThis.process)==null?void 0:e.versions)!=null&&t.hasOwnProperty("electron"))}function vt(){return gt()&&wt()&&yt()}function _t(){return globalThis.self!==globalThis.top}function Et(){return!globalThis.opener}function $e(){var i,l,c,b,y,E;switch((c=(l=(i=globalThis==null?void 0:globalThis.document)==null?void 0:i.documentElement)==null?void 0:l.dataset)==null?void 0:c.themeMode){case"light":return!0;case"dark":return!1}switch((E=(y=(b=globalThis==null?void 0:globalThis.siyuan)==null?void 0:b.config)==null?void 0:y.appearance)==null?void 0:E.mode){case 0:return!0;case 1:return!1}return pt.light.matches}function kt(){return!$e()}var xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pe={exports:{}};(function(e,t){(function(i,l){var c="1.0.37",b="",y="?",E="function",M="undefined",v="object",N="string",k="major",r="model",n="name",o="type",a="vendor",s="version",x="architecture",I="console",p="mobile",f="tablet",_="smarttv",F="wearable",ie="embedded",oe=500,V="Amazon",j="Apple",ge="ASUS",ye="BlackBerry",R="Browser",G="Chrome",Ue="Edge",Y="Firefox",X="Google",ve="Huawei",re="LG",ae="Microsoft",_e="Motorola",K="Opera",Z="Samsung",Ee="Sharp",J="Sony",ne="Xiaomi",se="Zebra",ke="Facebook",xe="Chromium OS",Te="Mac OS",We=function(h,w){var u={};for(var g in h)w[g]&&w[g].length%2===0?u[g]=w[g].concat(h[g]):u[g]=h[g];return u},Q=function(h){for(var w={},u=0;u0?m.length===2?typeof m[1]==E?this[m[0]]=m[1].call(this,A):this[m[0]]=m[1]:m.length===3?typeof m[1]===E&&!(m[1].exec&&m[1].test)?this[m[0]]=A?m[1].call(this,A,m[2]):l:this[m[0]]=A?A.replace(m[1],m[2]):l:m.length===4&&(this[m[0]]=A?m[3].call(this,A.replace(m[1],m[2])):l):this[m]=A||l;u+=2}},ce=function(h,w){for(var u in w)if(typeof w[u]===v&&w[u].length>0){for(var g=0;g2&&(d[r]="iPad",d[o]=f),d},this.getEngine=function(){var d={};return d[n]=l,d[s]=l,W.call(d,g,S.engine),d},this.getOS=function(){var d={};return d[n]=l,d[s]=l,W.call(d,g,S.os),m&&!d[n]&&O&&O.platform!="Unknown"&&(d[n]=O.platform.replace(/chrome os/i,xe).replace(/macos/i,Te)),d},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return g},this.setUA=function(d){return g=typeof d===N&&d.length>oe?le(d,oe):d,this},this.setUA(g),this};T.VERSION=c,T.BROWSER=Q([n,s,k]),T.CPU=Q([x]),T.DEVICE=Q([r,a,o,I,p,_,f,F,ie]),T.ENGINE=T.OS=Q([n,s]),e.exports&&(t=e.exports=T),t.UAParser=T;var L=typeof i!==M&&(i.jQuery||i.Zepto);if(L&&!L.ua){var ee=new T;L.ua=ee.getResult(),L.ua.get=function(){return ee.getUA()},L.ua.set=function(h){ee.setUA(h);var w=ee.getResult();for(var u in w)L.ua[u]=w[u]}}})(typeof window=="object"?window:xt)})(pe,pe.exports);var St=pe.exports;const At=new St.UAParser,Ne=At.getResult();class si{constructor(t,i=!0){C(this,"FLAG_FIREFOX");this.label=t,this.collapsed=i,this.FLAG_FIREFOX=Ne.browser.name==="Firefox"||Ne.engine.name==="Gecko"}stdout(t,i,...l){const c=this.FLAG_FIREFOX?`[${this.label}] - <${t.name.toUpperCase()}>`:`[\x1B[4m${this.label}\x1B[0m] - <\x1B[1m${t.name.toUpperCase()}\x1B[0m>`;if(this.collapsed?globalThis.console.groupCollapsed(c):globalThis.console.group(c),i)for(const b of l)Array.isArray(b)?t(...b):t(b);else t(...l);globalThis.console.trace(),globalThis.console.groupEnd()}clear(...t){this.stdout(globalThis.console.clear,!1,...t)}countReset(...t){this.stdout(globalThis.console.countReset,!1,...t)}count(...t){this.stdout(globalThis.console.count,!1,...t)}counts(...t){this.stdout(globalThis.console.count,!0,...t)}assert(...t){this.stdout(globalThis.console.assert,!1,...t)}asserts(...t){this.stdout(globalThis.console.assert,!0,...t)}dir(...t){this.stdout(globalThis.console.dir,!1,...t)}dirs(...t){this.stdout(globalThis.console.dir,!0,...t)}dirxml(...t){this.stdout(globalThis.console.dirxml,!1,...t)}dirxmls(...t){this.stdout(globalThis.console.dirxml,!0,...t)}table(...t){this.stdout(globalThis.console.table,!1,...t)}tables(...t){this.stdout(globalThis.console.table,!0,...t)}debug(...t){this.stdout(globalThis.console.debug,!1,...t)}debugs(...t){this.stdout(globalThis.console.debug,!0,...t)}info(...t){this.stdout(globalThis.console.info,!1,...t)}infos(...t){this.stdout(globalThis.console.info,!0,...t)}log(...t){this.stdout(globalThis.console.log,!1,...t)}logs(...t){this.stdout(globalThis.console.log,!0,...t)}warn(...t){this.stdout(globalThis.console.warn,!1,...t)}warns(...t){this.stdout(globalThis.console.warn,!0,...t)}error(...t){this.stdout(globalThis.console.error,!1,...t)}errors(...t){this.stdout(globalThis.console.error,!0,...t)}}function fe(){}function Pe(e){return e()}function Re(){return Object.create(null)}function te(e){e.forEach(Pe)}function ze(e){return typeof e=="function"}function li(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Mt(e){return Object.keys(e).length===0}function ci(e,t,i){e.insertBefore(t,i||null)}function Ot(e){e.parentNode&&e.parentNode.removeChild(e)}function di(e){return document.createElement(e)}function ui(e,t,i){i==null?e.removeAttribute(t):e.getAttribute(t)!==i&&e.setAttribute(t,i)}function Nt(e){return Array.from(e.childNodes)}function bi(e,t,i){e.classList.toggle(t,!!i)}function Rt(e,t,{bubbles:i=!1,cancelable:l=!1}={}){return new CustomEvent(e,{detail:t,bubbles:i,cancelable:l})}let B;function H(e){B=e}function we(){if(!B)throw new Error("Function called outside component initialization");return B}function pi(e){we().$$.on_mount.push(e)}function fi(e){we().$$.on_destroy.push(e)}function hi(){const e=we();return(t,i,{cancelable:l=!1}={})=>{const c=e.$$.callbacks[t];if(c){const b=Rt(t,i,{cancelable:l});return c.slice().forEach(y=>{y.call(e,b)}),!b.defaultPrevented}return!0}}const P=[],Ce=[];let z=[];const Fe=[],Ct=Promise.resolve();let he=!1;function Ft(){he||(he=!0,Ct.then(De))}function me(e){z.push(e)}const ue=new Set;let $=0;function De(){if($!==0)return;const e=B;do{try{for(;$e.indexOf(l)===-1?t.push(l):i.push(l)),i.forEach(l=>l()),z=t}const Pt=new Set;function zt(e,t){e&&e.i&&(Pt.delete(e),e.i(t))}function Dt(e,t,i){const{fragment:l,after_update:c}=e.$$;l&&l.m(t,i),me(()=>{const b=e.$$.on_mount.map(Pe).filter(ze);e.$$.on_destroy?e.$$.on_destroy.push(...b):te(b),e.$$.on_mount=[]}),c.forEach(me)}function It(e,t){const i=e.$$;i.fragment!==null&&($t(i.after_update),te(i.on_destroy),i.fragment&&i.fragment.d(t),i.on_destroy=i.fragment=null,i.ctx=[])}function jt(e,t){e.$$.dirty[0]===-1&&(P.push(e),Ft(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const o=n.length?n[0]:r;return v.ctx&&c(v.ctx[k],v.ctx[k]=o)&&(!v.skip_bound&&v.bound[k]&&v.bound[k](o),N&&jt(e,k)),r}):[],v.update(),N=!0,te(v.before_update),v.fragment=l?l(v.ctx):!1,t.target){if(t.hydrate){const k=Nt(t.target);v.fragment&&v.fragment.l(k),k.forEach(Ot)}else v.fragment&&v.fragment.c();t.intro&&zt(e.$$.fragment),Dt(e,t.target,t.anchor),De()}H(M)}class wi{constructor(){C(this,"$$");C(this,"$$set")}$destroy(){It(this,1),this.$destroy=fe}$on(t,i){if(!ze(i))return fe;const l=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return l.push(i),()=>{const c=l.indexOf(i);c!==-1&&l.splice(c,1)}}$set(t){this.$$set&&!Mt(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ut="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ut);var Wt=function(t){return Ht(t)&&!Bt(t)};function Ht(e){return!!e&&typeof e=="object"}function Bt(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Gt(e)}var qt=typeof Symbol=="function"&&Symbol.for,Vt=qt?Symbol.for("react.element"):60103;function Gt(e){return e.$$typeof===Vt}function Yt(e){return Array.isArray(e)?[]:{}}function q(e,t){return t.clone!==!1&&t.isMergeableObject(e)?D(Yt(e),e,t):e}function Xt(e,t,i){return e.concat(t).map(function(l){return q(l,i)})}function Kt(e,t){if(!t.customMerge)return D;var i=t.customMerge(e);return typeof i=="function"?i:D}function Zt(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Le(e){return Object.keys(e).concat(Zt(e))}function Ie(e,t){try{return t in e}catch{return!1}}function Jt(e,t){return Ie(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function Qt(e,t,i){var l={};return i.isMergeableObject(e)&&Le(e).forEach(function(c){l[c]=q(e[c],i)}),Le(t).forEach(function(c){Jt(e,c)||(Ie(e,c)&&i.isMergeableObject(t[c])?l[c]=Kt(c,i)(e[c],t[c],i):l[c]=q(t[c],i))}),l}function D(e,t,i){i=i||{},i.arrayMerge=i.arrayMerge||Xt,i.isMergeableObject=i.isMergeableObject||Wt,i.cloneUnlessOtherwiseSpecified=q;var l=Array.isArray(t),c=Array.isArray(e),b=l===c;return b?l?i.arrayMerge(e,t,i):Qt(e,t,i):q(t,i)}D.all=function(t,i){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(l,c){return D(l,c,i)},{})};var ei=D,ti=ei;const ii=Tt(ti);function gi(...e){return ii.all(e)}function je(e=globalThis.navigator.language,t=[]){switch(e=e.replaceAll("_","-").toLowerCase(),!0){case e in t:break;case e.startsWith("zh-chs"):case e.startsWith("zh-cns"):e="zh-Hans";break;case e.startsWith("zh-cht"):case e.startsWith("zh-cnt"):e="zh-Hant";break;case e.startsWith("zh-hans"):case e.startsWith("zh-cn"):case e.startsWith("zh-sg"):e="zh-Hans";break;case e.startsWith("zh-hant"):case e.startsWith("zh-tw"):case e.startsWith("zh-hk"):case e.startsWith("zh-mo"):e="zh-Hant";break;case e.startsWith("zh"):e="zh-Hans";break;case e.startsWith("en"):e="en";break;case e.startsWith("es"):e="es";break;case e.startsWith("fr"):e="fr";break}return e}function yi(e){switch(je(e)){case"zh-Hans":return"zh-cn";case"zh-Hant":return"zh-tw";case"de":return"de";case"es":return"es";case"fr":return"fr";case"it":return"it";case"ja":return"ja";case"ko":return"ko";case"ru":return"ru";case"en":default:return""}}function vi(e){switch(je(e)){case"zh-Hans":return"zh_CN";case"zh-Hant":return"zh_TW";case"fr":return"fr_FR";case"ja":return"ja_JP";case"ko":return"ko_KR";case"pt":return"pt_BR";case"ru":return"ru_RU";case"sv":return"sv_SE";case"en":default:return"en_US"}}function oi(){var i,l,c,b,y,E;switch((c=(l=(i=globalThis==null?void 0:globalThis.document)==null?void 0:i.documentElement)==null?void 0:l.dataset)==null?void 0:c.themeMode){case"dark":return!0;case"light":return!1}switch((E=(y=(b=globalThis==null?void 0:globalThis.siyuan)==null?void 0:b.config)==null?void 0:y.appearance)==null?void 0:E.mode){case 1:return!0;case 0:return!1}return window.matchMedia("(prefers-color-scheme: dark)").matches}function _i(){return!oi()}const be={INIT_CHANNEL_NAME:"monaco-editor-init",MESSAGE_EVENT_NAME:"message",ID_PREFIX_MATERIAL:"#icon-monaco-editor-material",ID_PREFIX_MATERIAL_LIGHT:"#icon-monaco-editor-material-light"};class Ei{constructor(t=()=>{}){C(this,"port");C(this,"_listeners",new Map);C(this,"initEventListener",(t,i)=>{this.port=t.ports[0],this.port.start(),t instanceof MessageEvent?this.oninited(t.data):this.oninited(i)});switch(this.oninited=t,!0){case ft:{const{ipcRenderer:i}=globalThis.require("electron");i.once(be.INIT_CHANNEL_NAME,this.initEventListener);break}case ht:case mt:default:globalThis.addEventListener("message",this.initEventListener,{once:!0});break}}addEventListener(t,i,l){if(this._listeners.has(i))return!1;{const c=b=>{var y;((y=b==null?void 0:b.data)==null?void 0:y.channel)===t&&(l!=null&&l.once&&this.removeEventListener(t,i),i(b))};return this._listeners.set(i,c),this.port.addEventListener(be.MESSAGE_EVENT_NAME,c),!0}}removeEventListener(t,i){return this._listeners.has(i)?(this.port.removeEventListener(be.MESSAGE_EVENT_NAME,this._listeners.get(i)),this._listeners.delete(i),!0):!1}}export{Ei as B,ft as F,si as L,wi as S,mi as a,ui as b,xt as c,ci as d,di as e,Ot as f,Tt as g,hi as h,_i as i,ht as j,gi as k,Ce as l,yi as m,fe as n,pi as o,ai as p,mt as q,ni as r,li as s,bi as t,fi as u,vi as v};