@zuplo/editor 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/client/assets/local-editor-C-tz9jAp.js +2048 -0
  2. package/dist/client/assets/local-editor-DTOl6Htj.css +1 -0
  3. package/dist/client/burglar.png +0 -0
  4. package/dist/client/dot-pattern.png +0 -0
  5. package/dist/client/example-image.png +0 -0
  6. package/dist/client/favicon.ico +0 -0
  7. package/dist/client/favicon.png +0 -0
  8. package/dist/client/frame0.png +0 -0
  9. package/dist/client/icons/arrow_head_down.svg +7 -0
  10. package/dist/client/icons/arrow_head_up.svg +7 -0
  11. package/dist/client/icons/arrow_line.svg +7 -0
  12. package/dist/client/icons/arrow_picker_black.svg +3 -0
  13. package/dist/client/icons/arrow_picker_pink.svg +3 -0
  14. package/dist/client/icons/discord.svg +10 -0
  15. package/dist/client/icons/drag-handle-minor.svg +1 -0
  16. package/dist/client/icons/drag_2x8.svg +28 -0
  17. package/dist/client/icons/edit_mode.svg +4 -0
  18. package/dist/client/local-editor.html +19 -0
  19. package/dist/client/manifest.json +25 -0
  20. package/dist/client/monaco/min/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  21. package/dist/client/monaco/min/vs/base/common/worker/simpleWorker.nls.de.js +8 -0
  22. package/dist/client/monaco/min/vs/base/common/worker/simpleWorker.nls.es.js +8 -0
  23. package/dist/client/monaco/min/vs/base/common/worker/simpleWorker.nls.fr.js +8 -0
  24. package/dist/client/monaco/min/vs/base/common/worker/simpleWorker.nls.it.js +8 -0
  25. package/dist/client/monaco/min/vs/base/common/worker/simpleWorker.nls.ja.js +8 -0
  26. package/dist/client/monaco/min/vs/base/common/worker/simpleWorker.nls.js +8 -0
  27. package/dist/client/monaco/min/vs/base/common/worker/simpleWorker.nls.ko.js +8 -0
  28. package/dist/client/monaco/min/vs/base/common/worker/simpleWorker.nls.ru.js +8 -0
  29. package/dist/client/monaco/min/vs/base/common/worker/simpleWorker.nls.zh-cn.js +8 -0
  30. package/dist/client/monaco/min/vs/base/common/worker/simpleWorker.nls.zh-tw.js +8 -0
  31. package/dist/client/monaco/min/vs/base/worker/workerMain.js +30 -0
  32. package/dist/client/monaco/min/vs/basic-languages/abap/abap.js +10 -0
  33. package/dist/client/monaco/min/vs/basic-languages/apex/apex.js +10 -0
  34. package/dist/client/monaco/min/vs/basic-languages/azcli/azcli.js +10 -0
  35. package/dist/client/monaco/min/vs/basic-languages/bat/bat.js +10 -0
  36. package/dist/client/monaco/min/vs/basic-languages/bicep/bicep.js +11 -0
  37. package/dist/client/monaco/min/vs/basic-languages/cameligo/cameligo.js +10 -0
  38. package/dist/client/monaco/min/vs/basic-languages/clojure/clojure.js +10 -0
  39. package/dist/client/monaco/min/vs/basic-languages/coffee/coffee.js +10 -0
  40. package/dist/client/monaco/min/vs/basic-languages/cpp/cpp.js +10 -0
  41. package/dist/client/monaco/min/vs/basic-languages/csharp/csharp.js +10 -0
  42. package/dist/client/monaco/min/vs/basic-languages/csp/csp.js +10 -0
  43. package/dist/client/monaco/min/vs/basic-languages/css/css.js +12 -0
  44. package/dist/client/monaco/min/vs/basic-languages/cypher/cypher.js +10 -0
  45. package/dist/client/monaco/min/vs/basic-languages/dart/dart.js +10 -0
  46. package/dist/client/monaco/min/vs/basic-languages/dockerfile/dockerfile.js +10 -0
  47. package/dist/client/monaco/min/vs/basic-languages/ecl/ecl.js +10 -0
  48. package/dist/client/monaco/min/vs/basic-languages/elixir/elixir.js +10 -0
  49. package/dist/client/monaco/min/vs/basic-languages/flow9/flow9.js +10 -0
  50. package/dist/client/monaco/min/vs/basic-languages/freemarker2/freemarker2.js +12 -0
  51. package/dist/client/monaco/min/vs/basic-languages/fsharp/fsharp.js +10 -0
  52. package/dist/client/monaco/min/vs/basic-languages/go/go.js +10 -0
  53. package/dist/client/monaco/min/vs/basic-languages/graphql/graphql.js +10 -0
  54. package/dist/client/monaco/min/vs/basic-languages/handlebars/handlebars.js +10 -0
  55. package/dist/client/monaco/min/vs/basic-languages/hcl/hcl.js +10 -0
  56. package/dist/client/monaco/min/vs/basic-languages/html/html.js +10 -0
  57. package/dist/client/monaco/min/vs/basic-languages/ini/ini.js +10 -0
  58. package/dist/client/monaco/min/vs/basic-languages/java/java.js +10 -0
  59. package/dist/client/monaco/min/vs/basic-languages/javascript/javascript.js +10 -0
  60. package/dist/client/monaco/min/vs/basic-languages/julia/julia.js +10 -0
  61. package/dist/client/monaco/min/vs/basic-languages/kotlin/kotlin.js +10 -0
  62. package/dist/client/monaco/min/vs/basic-languages/less/less.js +11 -0
  63. package/dist/client/monaco/min/vs/basic-languages/lexon/lexon.js +10 -0
  64. package/dist/client/monaco/min/vs/basic-languages/liquid/liquid.js +10 -0
  65. package/dist/client/monaco/min/vs/basic-languages/lua/lua.js +10 -0
  66. package/dist/client/monaco/min/vs/basic-languages/m3/m3.js +10 -0
  67. package/dist/client/monaco/min/vs/basic-languages/markdown/markdown.js +10 -0
  68. package/dist/client/monaco/min/vs/basic-languages/mdx/mdx.js +10 -0
  69. package/dist/client/monaco/min/vs/basic-languages/mips/mips.js +10 -0
  70. package/dist/client/monaco/min/vs/basic-languages/msdax/msdax.js +10 -0
  71. package/dist/client/monaco/min/vs/basic-languages/mysql/mysql.js +10 -0
  72. package/dist/client/monaco/min/vs/basic-languages/objective-c/objective-c.js +10 -0
  73. package/dist/client/monaco/min/vs/basic-languages/pascal/pascal.js +10 -0
  74. package/dist/client/monaco/min/vs/basic-languages/pascaligo/pascaligo.js +10 -0
  75. package/dist/client/monaco/min/vs/basic-languages/perl/perl.js +10 -0
  76. package/dist/client/monaco/min/vs/basic-languages/pgsql/pgsql.js +10 -0
  77. package/dist/client/monaco/min/vs/basic-languages/php/php.js +10 -0
  78. package/dist/client/monaco/min/vs/basic-languages/pla/pla.js +10 -0
  79. package/dist/client/monaco/min/vs/basic-languages/postiats/postiats.js +10 -0
  80. package/dist/client/monaco/min/vs/basic-languages/powerquery/powerquery.js +10 -0
  81. package/dist/client/monaco/min/vs/basic-languages/powershell/powershell.js +10 -0
  82. package/dist/client/monaco/min/vs/basic-languages/protobuf/protobuf.js +11 -0
  83. package/dist/client/monaco/min/vs/basic-languages/pug/pug.js +10 -0
  84. package/dist/client/monaco/min/vs/basic-languages/python/python.js +10 -0
  85. package/dist/client/monaco/min/vs/basic-languages/qsharp/qsharp.js +10 -0
  86. package/dist/client/monaco/min/vs/basic-languages/r/r.js +10 -0
  87. package/dist/client/monaco/min/vs/basic-languages/razor/razor.js +10 -0
  88. package/dist/client/monaco/min/vs/basic-languages/redis/redis.js +10 -0
  89. package/dist/client/monaco/min/vs/basic-languages/redshift/redshift.js +10 -0
  90. package/dist/client/monaco/min/vs/basic-languages/restructuredtext/restructuredtext.js +10 -0
  91. package/dist/client/monaco/min/vs/basic-languages/ruby/ruby.js +10 -0
  92. package/dist/client/monaco/min/vs/basic-languages/rust/rust.js +10 -0
  93. package/dist/client/monaco/min/vs/basic-languages/sb/sb.js +10 -0
  94. package/dist/client/monaco/min/vs/basic-languages/scala/scala.js +10 -0
  95. package/dist/client/monaco/min/vs/basic-languages/scheme/scheme.js +10 -0
  96. package/dist/client/monaco/min/vs/basic-languages/scss/scss.js +12 -0
  97. package/dist/client/monaco/min/vs/basic-languages/shell/shell.js +10 -0
  98. package/dist/client/monaco/min/vs/basic-languages/solidity/solidity.js +10 -0
  99. package/dist/client/monaco/min/vs/basic-languages/sophia/sophia.js +10 -0
  100. package/dist/client/monaco/min/vs/basic-languages/sparql/sparql.js +10 -0
  101. package/dist/client/monaco/min/vs/basic-languages/sql/sql.js +10 -0
  102. package/dist/client/monaco/min/vs/basic-languages/st/st.js +10 -0
  103. package/dist/client/monaco/min/vs/basic-languages/swift/swift.js +13 -0
  104. package/dist/client/monaco/min/vs/basic-languages/systemverilog/systemverilog.js +10 -0
  105. package/dist/client/monaco/min/vs/basic-languages/tcl/tcl.js +10 -0
  106. package/dist/client/monaco/min/vs/basic-languages/twig/twig.js +10 -0
  107. package/dist/client/monaco/min/vs/basic-languages/typescript/typescript.js +10 -0
  108. package/dist/client/monaco/min/vs/basic-languages/typespec/typespec.js +10 -0
  109. package/dist/client/monaco/min/vs/basic-languages/vb/vb.js +10 -0
  110. package/dist/client/monaco/min/vs/basic-languages/wgsl/wgsl.js +307 -0
  111. package/dist/client/monaco/min/vs/basic-languages/xml/xml.js +10 -0
  112. package/dist/client/monaco/min/vs/basic-languages/yaml/yaml.js +10 -0
  113. package/dist/client/monaco/min/vs/editor/editor.main.css +8 -0
  114. package/dist/client/monaco/min/vs/editor/editor.main.js +768 -0
  115. package/dist/client/monaco/min/vs/editor/editor.main.nls.de.js +17 -0
  116. package/dist/client/monaco/min/vs/editor/editor.main.nls.es.js +17 -0
  117. package/dist/client/monaco/min/vs/editor/editor.main.nls.fr.js +15 -0
  118. package/dist/client/monaco/min/vs/editor/editor.main.nls.it.js +15 -0
  119. package/dist/client/monaco/min/vs/editor/editor.main.nls.ja.js +17 -0
  120. package/dist/client/monaco/min/vs/editor/editor.main.nls.js +15 -0
  121. package/dist/client/monaco/min/vs/editor/editor.main.nls.ko.js +15 -0
  122. package/dist/client/monaco/min/vs/editor/editor.main.nls.ru.js +17 -0
  123. package/dist/client/monaco/min/vs/editor/editor.main.nls.zh-cn.js +17 -0
  124. package/dist/client/monaco/min/vs/editor/editor.main.nls.zh-tw.js +15 -0
  125. package/dist/client/monaco/min/vs/language/css/cssMode.js +13 -0
  126. package/dist/client/monaco/min/vs/language/css/cssWorker.js +77 -0
  127. package/dist/client/monaco/min/vs/language/html/htmlMode.js +13 -0
  128. package/dist/client/monaco/min/vs/language/html/htmlWorker.js +454 -0
  129. package/dist/client/monaco/min/vs/language/json/jsonMode.js +19 -0
  130. package/dist/client/monaco/min/vs/language/json/jsonWorker.js +42 -0
  131. package/dist/client/monaco/min/vs/language/typescript/tsMode.js +20 -0
  132. package/dist/client/monaco/min/vs/language/typescript/tsWorker.js +51328 -0
  133. package/dist/client/monaco/min/vs/loader.js +11 -0
  134. package/dist/client/old_z.svg +25 -0
  135. package/dist/client/question_mark.svg +19 -0
  136. package/dist/client/robots.txt +2 -0
  137. package/dist/client/z_slice_spinner.svg +25 -0
  138. package/dist/client/z_spinner.svg +46 -0
  139. package/dist/client/zuplo.apng +0 -0
  140. package/dist/client/zuplo.svg +11 -0
  141. package/dist/client/zuplo_black.svg +11 -0
  142. package/dist/client/zuplo_white.svg +11 -0
  143. package/dist/index.d.ts +2 -0
  144. package/dist/index.d.ts.map +1 -0
  145. package/dist/index.js +2 -0
  146. package/dist/index.js.map +1 -0
  147. package/dist/routes/files.d.ts +3 -0
  148. package/dist/routes/files.d.ts.map +1 -0
  149. package/dist/routes/files.js +10 -0
  150. package/dist/routes/files.js.map +1 -0
  151. package/dist/routes/fs.d.ts +7 -0
  152. package/dist/routes/fs.d.ts.map +1 -0
  153. package/dist/routes/fs.js +232 -0
  154. package/dist/routes/fs.js.map +1 -0
  155. package/dist/routes/modules.d.ts +3 -0
  156. package/dist/routes/modules.d.ts.map +1 -0
  157. package/dist/routes/modules.js +47 -0
  158. package/dist/routes/modules.js.map +1 -0
  159. package/dist/routes/types.d.ts +7 -0
  160. package/dist/routes/types.d.ts.map +1 -0
  161. package/dist/routes/types.js +37 -0
  162. package/dist/routes/types.js.map +1 -0
  163. package/dist/server.d.ts +35 -0
  164. package/dist/server.d.ts.map +1 -0
  165. package/dist/server.js +163 -0
  166. package/dist/server.js.map +1 -0
  167. package/package.json +54 -0
@@ -0,0 +1,11 @@
1
+ "use strict";/*!-----------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Version: 0.50.0(c321d0fbecb50ab8a5365fa1965476b0ae63fc87)
4
+ * Released under the MIT license
5
+ * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
+ *-----------------------------------------------------------*/const _amdLoaderGlobal=this,_commonjsGlobal=typeof global=="object"?global:{};var AMDLoader;(function(u){u.global=_amdLoaderGlobal;class y{get isWindows(){return this._detect(),this._isWindows}get isNode(){return this._detect(),this._isNode}get isElectronRenderer(){return this._detect(),this._isElectronRenderer}get isWebWorker(){return this._detect(),this._isWebWorker}get isElectronNodeIntegrationWebWorker(){return this._detect(),this._isElectronNodeIntegrationWebWorker}constructor(){this._detected=!1,this._isWindows=!1,this._isNode=!1,this._isElectronRenderer=!1,this._isWebWorker=!1,this._isElectronNodeIntegrationWebWorker=!1}_detect(){this._detected||(this._detected=!0,this._isWindows=y._isWindows(),this._isNode=typeof module<"u"&&!!module.exports,this._isElectronRenderer=typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.electron<"u"&&process.type==="renderer",this._isWebWorker=typeof u.global.importScripts=="function",this._isElectronNodeIntegrationWebWorker=this._isWebWorker&&typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.electron<"u"&&process.type==="worker")}static _isWindows(){return typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.indexOf("Windows")>=0?!0:typeof process<"u"?process.platform==="win32":!1}}u.Environment=y})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(u){class y{constructor(r,c,a){this.type=r,this.detail=c,this.timestamp=a}}u.LoaderEvent=y;class m{constructor(r){this._events=[new y(1,"",r)]}record(r,c){this._events.push(new y(r,c,u.Utilities.getHighPerformanceTimestamp()))}getEvents(){return this._events}}u.LoaderEventRecorder=m;class p{record(r,c){}getEvents(){return[]}}p.INSTANCE=new p,u.NullLoaderEventRecorder=p})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(u){class y{static fileUriToFilePath(p,h){if(h=decodeURI(h).replace(/%23/g,"#"),p){if(/^file:\/\/\//.test(h))return h.substr(8);if(/^file:\/\//.test(h))return h.substr(5)}else if(/^file:\/\//.test(h))return h.substr(7);return h}static startsWith(p,h){return p.length>=h.length&&p.substr(0,h.length)===h}static endsWith(p,h){return p.length>=h.length&&p.substr(p.length-h.length)===h}static containsQueryString(p){return/^[^\#]*\?/gi.test(p)}static isAbsolutePath(p){return/^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(p)}static forEachProperty(p,h){if(p){let r;for(r in p)p.hasOwnProperty(r)&&h(r,p[r])}}static isEmpty(p){let h=!0;return y.forEachProperty(p,()=>{h=!1}),h}static recursiveClone(p){if(!p||typeof p!="object"||p instanceof RegExp||!Array.isArray(p)&&Object.getPrototypeOf(p)!==Object.prototype)return p;let h=Array.isArray(p)?[]:{};return y.forEachProperty(p,(r,c)=>{c&&typeof c=="object"?h[r]=y.recursiveClone(c):h[r]=c}),h}static generateAnonymousModule(){return"===anonymous"+y.NEXT_ANONYMOUS_ID+++"==="}static isAnonymousModule(p){return y.startsWith(p,"===anonymous")}static getHighPerformanceTimestamp(){return this.PERFORMANCE_NOW_PROBED||(this.PERFORMANCE_NOW_PROBED=!0,this.HAS_PERFORMANCE_NOW=u.global.performance&&typeof u.global.performance.now=="function"),this.HAS_PERFORMANCE_NOW?u.global.performance.now():Date.now()}}y.NEXT_ANONYMOUS_ID=1,y.PERFORMANCE_NOW_PROBED=!1,y.HAS_PERFORMANCE_NOW=!1,u.Utilities=y})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(u){function y(h){if(h instanceof Error)return h;const r=new Error(h.message||String(h)||"Unknown Error");return h.stack&&(r.stack=h.stack),r}u.ensureError=y;class m{static validateConfigurationOptions(r){function c(a){if(a.phase==="loading"){console.error('Loading "'+a.moduleId+'" failed'),console.error(a),console.error("Here are the modules that depend on it:"),console.error(a.neededBy);return}if(a.phase==="factory"){console.error('The factory function of "'+a.moduleId+'" has thrown an exception'),console.error(a),console.error("Here are the modules that depend on it:"),console.error(a.neededBy);return}}if(r=r||{},typeof r.baseUrl!="string"&&(r.baseUrl=""),typeof r.isBuild!="boolean"&&(r.isBuild=!1),typeof r.paths!="object"&&(r.paths={}),typeof r.config!="object"&&(r.config={}),typeof r.catchError>"u"&&(r.catchError=!1),typeof r.recordStats>"u"&&(r.recordStats=!1),typeof r.urlArgs!="string"&&(r.urlArgs=""),typeof r.onError!="function"&&(r.onError=c),Array.isArray(r.ignoreDuplicateModules)||(r.ignoreDuplicateModules=[]),r.baseUrl.length>0&&(u.Utilities.endsWith(r.baseUrl,"/")||(r.baseUrl+="/")),typeof r.cspNonce!="string"&&(r.cspNonce=""),typeof r.preferScriptTags>"u"&&(r.preferScriptTags=!1),r.nodeCachedData&&typeof r.nodeCachedData=="object"&&(typeof r.nodeCachedData.seed!="string"&&(r.nodeCachedData.seed="seed"),(typeof r.nodeCachedData.writeDelay!="number"||r.nodeCachedData.writeDelay<0)&&(r.nodeCachedData.writeDelay=1e3*7),!r.nodeCachedData.path||typeof r.nodeCachedData.path!="string")){const a=y(new Error("INVALID cached data configuration, 'path' MUST be set"));a.phase="configuration",r.onError(a),r.nodeCachedData=void 0}return r}static mergeConfigurationOptions(r=null,c=null){let a=u.Utilities.recursiveClone(c||{});return u.Utilities.forEachProperty(r,(t,e)=>{t==="ignoreDuplicateModules"&&typeof a.ignoreDuplicateModules<"u"?a.ignoreDuplicateModules=a.ignoreDuplicateModules.concat(e):t==="paths"&&typeof a.paths<"u"?u.Utilities.forEachProperty(e,(i,s)=>a.paths[i]=s):t==="config"&&typeof a.config<"u"?u.Utilities.forEachProperty(e,(i,s)=>a.config[i]=s):a[t]=u.Utilities.recursiveClone(e)}),m.validateConfigurationOptions(a)}}u.ConfigurationOptionsUtil=m;class p{constructor(r,c){if(this._env=r,this.options=m.mergeConfigurationOptions(c),this._createIgnoreDuplicateModulesMap(),this._createSortedPathsRules(),this.options.baseUrl===""&&this.options.nodeRequire&&this.options.nodeRequire.main&&this.options.nodeRequire.main.filename&&this._env.isNode){let a=this.options.nodeRequire.main.filename,t=Math.max(a.lastIndexOf("/"),a.lastIndexOf("\\"));this.options.baseUrl=a.substring(0,t+1)}}_createIgnoreDuplicateModulesMap(){this.ignoreDuplicateModulesMap={};for(let r=0;r<this.options.ignoreDuplicateModules.length;r++)this.ignoreDuplicateModulesMap[this.options.ignoreDuplicateModules[r]]=!0}_createSortedPathsRules(){this.sortedPathsRules=[],u.Utilities.forEachProperty(this.options.paths,(r,c)=>{Array.isArray(c)?this.sortedPathsRules.push({from:r,to:c}):this.sortedPathsRules.push({from:r,to:[c]})}),this.sortedPathsRules.sort((r,c)=>c.from.length-r.from.length)}cloneAndMerge(r){return new p(this._env,m.mergeConfigurationOptions(r,this.options))}getOptionsLiteral(){return this.options}_applyPaths(r){let c;for(let a=0,t=this.sortedPathsRules.length;a<t;a++)if(c=this.sortedPathsRules[a],u.Utilities.startsWith(r,c.from)){let e=[];for(let i=0,s=c.to.length;i<s;i++)e.push(c.to[i]+r.substr(c.from.length));return e}return[r]}_addUrlArgsToUrl(r){return u.Utilities.containsQueryString(r)?r+"&"+this.options.urlArgs:r+"?"+this.options.urlArgs}_addUrlArgsIfNecessaryToUrl(r){return this.options.urlArgs?this._addUrlArgsToUrl(r):r}_addUrlArgsIfNecessaryToUrls(r){if(this.options.urlArgs)for(let c=0,a=r.length;c<a;c++)r[c]=this._addUrlArgsToUrl(r[c]);return r}moduleIdToPaths(r){if(this._env.isNode&&this.options.amdModulesPattern instanceof RegExp&&!this.options.amdModulesPattern.test(r))return this.isBuild()?["empty:"]:["node|"+r];let c=r,a;if(!u.Utilities.endsWith(c,".js")&&!u.Utilities.isAbsolutePath(c)){a=this._applyPaths(c);for(let t=0,e=a.length;t<e;t++)this.isBuild()&&a[t]==="empty:"||(u.Utilities.isAbsolutePath(a[t])||(a[t]=this.options.baseUrl+a[t]),!u.Utilities.endsWith(a[t],".js")&&!u.Utilities.containsQueryString(a[t])&&(a[t]=a[t]+".js"))}else!u.Utilities.endsWith(c,".js")&&!u.Utilities.containsQueryString(c)&&(c=c+".js"),a=[c];return this._addUrlArgsIfNecessaryToUrls(a)}requireToUrl(r){let c=r;return u.Utilities.isAbsolutePath(c)||(c=this._applyPaths(c)[0],u.Utilities.isAbsolutePath(c)||(c=this.options.baseUrl+c)),this._addUrlArgsIfNecessaryToUrl(c)}isBuild(){return this.options.isBuild}shouldInvokeFactory(r){return!!(!this.options.isBuild||u.Utilities.isAnonymousModule(r)||this.options.buildForceInvokeFactory&&this.options.buildForceInvokeFactory[r])}isDuplicateMessageIgnoredFor(r){return this.ignoreDuplicateModulesMap.hasOwnProperty(r)}getConfigForModule(r){if(this.options.config)return this.options.config[r]}shouldCatchError(){return this.options.catchError}shouldRecordStats(){return this.options.recordStats}onError(r){this.options.onError(r)}}u.Configuration=p})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(u){class y{constructor(e){this._env=e,this._scriptLoader=null,this._callbackMap={}}load(e,i,s,n){if(!this._scriptLoader)if(this._env.isWebWorker)this._scriptLoader=new h;else if(this._env.isElectronRenderer){const{preferScriptTags:d}=e.getConfig().getOptionsLiteral();d?this._scriptLoader=new m:this._scriptLoader=new r(this._env)}else this._env.isNode?this._scriptLoader=new r(this._env):this._scriptLoader=new m;let l={callback:s,errorback:n};if(this._callbackMap.hasOwnProperty(i)){this._callbackMap[i].push(l);return}this._callbackMap[i]=[l],this._scriptLoader.load(e,i,()=>this.triggerCallback(i),d=>this.triggerErrorback(i,d))}triggerCallback(e){let i=this._callbackMap[e];delete this._callbackMap[e];for(let s=0;s<i.length;s++)i[s].callback()}triggerErrorback(e,i){let s=this._callbackMap[e];delete this._callbackMap[e];for(let n=0;n<s.length;n++)s[n].errorback(i)}}class m{attachListeners(e,i,s){let n=()=>{e.removeEventListener("load",l),e.removeEventListener("error",d)},l=o=>{n(),i()},d=o=>{n(),s(o)};e.addEventListener("load",l),e.addEventListener("error",d)}load(e,i,s,n){if(/^node\|/.test(i)){let l=e.getConfig().getOptionsLiteral(),d=c(e.getRecorder(),l.nodeRequire||u.global.nodeRequire),o=i.split("|"),_=null;try{_=d(o[1])}catch(f){n(f);return}e.enqueueDefineAnonymousModule([],()=>_),s()}else{let l=document.createElement("script");l.setAttribute("async","async"),l.setAttribute("type","text/javascript"),this.attachListeners(l,s,n);const{trustedTypesPolicy:d}=e.getConfig().getOptionsLiteral();d&&(i=d.createScriptURL(i)),l.setAttribute("src",i);const{cspNonce:o}=e.getConfig().getOptionsLiteral();o&&l.setAttribute("nonce",o),document.getElementsByTagName("head")[0].appendChild(l)}}}function p(t){const{trustedTypesPolicy:e}=t.getConfig().getOptionsLiteral();try{return(e?self.eval(e.createScript("","true")):new Function("true")).call(self),!0}catch{return!1}}class h{constructor(){this._cachedCanUseEval=null}_canUseEval(e){return this._cachedCanUseEval===null&&(this._cachedCanUseEval=p(e)),this._cachedCanUseEval}load(e,i,s,n){if(/^node\|/.test(i)){const l=e.getConfig().getOptionsLiteral(),d=c(e.getRecorder(),l.nodeRequire||u.global.nodeRequire),o=i.split("|");let _=null;try{_=d(o[1])}catch(f){n(f);return}e.enqueueDefineAnonymousModule([],function(){return _}),s()}else{const{trustedTypesPolicy:l}=e.getConfig().getOptionsLiteral();if(!(/^((http:)|(https:)|(file:))/.test(i)&&i.substring(0,self.origin.length)!==self.origin)&&this._canUseEval(e)){fetch(i).then(o=>{if(o.status!==200)throw new Error(o.statusText);return o.text()}).then(o=>{o=`${o}
7
+ //# sourceURL=${i}`,(l?self.eval(l.createScript("",o)):new Function(o)).call(self),s()}).then(void 0,n);return}try{l&&(i=l.createScriptURL(i)),importScripts(i),s()}catch(o){n(o)}}}}class r{constructor(e){this._env=e,this._didInitialize=!1,this._didPatchNodeRequire=!1}_init(e){this._didInitialize||(this._didInitialize=!0,this._fs=e("fs"),this._vm=e("vm"),this._path=e("path"),this._crypto=e("crypto"))}_initNodeRequire(e,i){const{nodeCachedData:s}=i.getConfig().getOptionsLiteral();if(!s||this._didPatchNodeRequire)return;this._didPatchNodeRequire=!0;const n=this,l=e("module");function d(o){const _=o.constructor;let f=function(v){try{return o.require(v)}finally{}};return f.resolve=function(v,E){return _._resolveFilename(v,o,!1,E)},f.resolve.paths=function(v){return _._resolveLookupPaths(v,o)},f.main=process.mainModule,f.extensions=_._extensions,f.cache=_._cache,f}l.prototype._compile=function(o,_){const f=l.wrap(o.replace(/^#!.*/,"")),g=i.getRecorder(),v=n._getCachedDataPath(s,_),E={filename:_};let I;try{const D=n._fs.readFileSync(v);I=D.slice(0,16),E.cachedData=D.slice(16),g.record(60,v)}catch{g.record(61,v)}const C=new n._vm.Script(f,E),P=C.runInThisContext(E),w=n._path.dirname(_),R=d(this),U=[this.exports,R,this,_,w,process,_commonjsGlobal,Buffer],b=P.apply(this.exports,U);return n._handleCachedData(C,f,v,!E.cachedData,i),n._verifyCachedData(C,f,v,I,i),b}}load(e,i,s,n){const l=e.getConfig().getOptionsLiteral(),d=c(e.getRecorder(),l.nodeRequire||u.global.nodeRequire),o=l.nodeInstrumenter||function(f){return f};this._init(d),this._initNodeRequire(d,e);let _=e.getRecorder();if(/^node\|/.test(i)){let f=i.split("|"),g=null;try{g=d(f[1])}catch(v){n(v);return}e.enqueueDefineAnonymousModule([],()=>g),s()}else{i=u.Utilities.fileUriToFilePath(this._env.isWindows,i);const f=this._path.normalize(i),g=this._getElectronRendererScriptPathOrUri(f),v=!!l.nodeCachedData,E=v?this._getCachedDataPath(l.nodeCachedData,i):void 0;this._readSourceAndCachedData(f,E,_,(I,C,P,w)=>{if(I){n(I);return}let R;C.charCodeAt(0)===r._BOM?R=r._PREFIX+C.substring(1)+r._SUFFIX:R=r._PREFIX+C+r._SUFFIX,R=o(R,f);const U={filename:g,cachedData:P},b=this._createAndEvalScript(e,R,U,s,n);this._handleCachedData(b,R,E,v&&!P,e),this._verifyCachedData(b,R,E,w,e)})}}_createAndEvalScript(e,i,s,n,l){const d=e.getRecorder();d.record(31,s.filename);const o=new this._vm.Script(i,s),_=o.runInThisContext(s),f=e.getGlobalAMDDefineFunc();let g=!1;const v=function(){return g=!0,f.apply(null,arguments)};return v.amd=f.amd,_.call(u.global,e.getGlobalAMDRequireFunc(),v,s.filename,this._path.dirname(s.filename)),d.record(32,s.filename),g?n():l(new Error(`Didn't receive define call in ${s.filename}!`)),o}_getElectronRendererScriptPathOrUri(e){if(!this._env.isElectronRenderer)return e;let i=e.match(/^([a-z])\:(.*)/i);return i?`file:///${(i[1].toUpperCase()+":"+i[2]).replace(/\\/g,"/")}`:`file://${e}`}_getCachedDataPath(e,i){const s=this._crypto.createHash("md5").update(i,"utf8").update(e.seed,"utf8").update(process.arch,"").digest("hex"),n=this._path.basename(i).replace(/\.js$/,"");return this._path.join(e.path,`${n}-${s}.code`)}_handleCachedData(e,i,s,n,l){e.cachedDataRejected?this._fs.unlink(s,d=>{l.getRecorder().record(62,s),this._createAndWriteCachedData(e,i,s,l),d&&l.getConfig().onError(d)}):n&&this._createAndWriteCachedData(e,i,s,l)}_createAndWriteCachedData(e,i,s,n){let l=Math.ceil(n.getConfig().getOptionsLiteral().nodeCachedData.writeDelay*(1+Math.random())),d=-1,o=0,_;const f=()=>{setTimeout(()=>{_||(_=this._crypto.createHash("md5").update(i,"utf8").digest());const g=e.createCachedData();if(!(g.length===0||g.length===d||o>=5)){if(g.length<d){f();return}d=g.length,this._fs.writeFile(s,Buffer.concat([_,g]),v=>{v&&n.getConfig().onError(v),n.getRecorder().record(63,s),f()})}},l*Math.pow(4,o++))};f()}_readSourceAndCachedData(e,i,s,n){if(!i)this._fs.readFile(e,{encoding:"utf8"},n);else{let l,d,o,_=2;const f=g=>{g?n(g):--_===0&&n(void 0,l,d,o)};this._fs.readFile(e,{encoding:"utf8"},(g,v)=>{l=v,f(g)}),this._fs.readFile(i,(g,v)=>{!g&&v&&v.length>0?(o=v.slice(0,16),d=v.slice(16),s.record(60,i)):s.record(61,i),f()})}}_verifyCachedData(e,i,s,n,l){n&&(e.cachedDataRejected||setTimeout(()=>{const d=this._crypto.createHash("md5").update(i,"utf8").digest();n.equals(d)||(l.getConfig().onError(new Error(`FAILED TO VERIFY CACHED DATA, deleting stale '${s}' now, but a RESTART IS REQUIRED`)),this._fs.unlink(s,o=>{o&&l.getConfig().onError(o)}))},Math.ceil(5e3*(1+Math.random()))))}}r._BOM=65279,r._PREFIX="(function (require, define, __filename, __dirname) { ",r._SUFFIX=`
8
+ });`;function c(t,e){if(e.__$__isRecorded)return e;const i=function(n){t.record(33,n);try{return e(n)}finally{t.record(34,n)}};return i.__$__isRecorded=!0,i}u.ensureRecordedNodeRequire=c;function a(t){return new y(t)}u.createScriptLoader=a})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(u){class y{constructor(t){let e=t.lastIndexOf("/");e!==-1?this.fromModulePath=t.substr(0,e+1):this.fromModulePath=""}static _normalizeModuleId(t){let e=t,i;for(i=/\/\.\//;i.test(e);)e=e.replace(i,"/");for(e=e.replace(/^\.\//g,""),i=/\/(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//;i.test(e);)e=e.replace(i,"/");return e=e.replace(/^(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//,""),e}resolveModule(t){let e=t;return u.Utilities.isAbsolutePath(e)||(u.Utilities.startsWith(e,"./")||u.Utilities.startsWith(e,"../"))&&(e=y._normalizeModuleId(this.fromModulePath+e)),e}}y.ROOT=new y(""),u.ModuleIdResolver=y;class m{constructor(t,e,i,s,n,l){this.id=t,this.strId=e,this.dependencies=i,this._callback=s,this._errorback=n,this.moduleIdResolver=l,this.exports={},this.error=null,this.exportsPassedIn=!1,this.unresolvedDependenciesCount=this.dependencies.length,this._isComplete=!1}static _safeInvokeFunction(t,e){try{return{returnedValue:t.apply(u.global,e),producedError:null}}catch(i){return{returnedValue:null,producedError:i}}}static _invokeFactory(t,e,i,s){return t.shouldInvokeFactory(e)?t.shouldCatchError()?this._safeInvokeFunction(i,s):{returnedValue:i.apply(u.global,s),producedError:null}:{returnedValue:null,producedError:null}}complete(t,e,i,s){this._isComplete=!0;let n=null;if(this._callback)if(typeof this._callback=="function"){t.record(21,this.strId);let l=m._invokeFactory(e,this.strId,this._callback,i);n=l.producedError,t.record(22,this.strId),!n&&typeof l.returnedValue<"u"&&(!this.exportsPassedIn||u.Utilities.isEmpty(this.exports))&&(this.exports=l.returnedValue)}else this.exports=this._callback;if(n){let l=u.ensureError(n);l.phase="factory",l.moduleId=this.strId,l.neededBy=s(this.id),this.error=l,e.onError(l)}this.dependencies=null,this._callback=null,this._errorback=null,this.moduleIdResolver=null}onDependencyError(t){return this._isComplete=!0,this.error=t,this._errorback?(this._errorback(t),!0):!1}isComplete(){return this._isComplete}}u.Module=m;class p{constructor(){this._nextId=0,this._strModuleIdToIntModuleId=new Map,this._intModuleIdToStrModuleId=[],this.getModuleId("exports"),this.getModuleId("module"),this.getModuleId("require")}getMaxModuleId(){return this._nextId}getModuleId(t){let e=this._strModuleIdToIntModuleId.get(t);return typeof e>"u"&&(e=this._nextId++,this._strModuleIdToIntModuleId.set(t,e),this._intModuleIdToStrModuleId[e]=t),e}getStrModuleId(t){return this._intModuleIdToStrModuleId[t]}}class h{constructor(t){this.id=t}}h.EXPORTS=new h(0),h.MODULE=new h(1),h.REQUIRE=new h(2),u.RegularDependency=h;class r{constructor(t,e,i){this.id=t,this.pluginId=e,this.pluginParam=i}}u.PluginDependency=r;class c{constructor(t,e,i,s,n=0){this._env=t,this._scriptLoader=e,this._loaderAvailableTimestamp=n,this._defineFunc=i,this._requireFunc=s,this._moduleIdProvider=new p,this._config=new u.Configuration(this._env),this._hasDependencyCycle=!1,this._modules2=[],this._knownModules2=[],this._inverseDependencies2=[],this._inversePluginDependencies2=new Map,this._currentAnonymousDefineCall=null,this._recorder=null,this._buildInfoPath=[],this._buildInfoDefineStack=[],this._buildInfoDependencies=[],this._requireFunc.moduleManager=this}reset(){return new c(this._env,this._scriptLoader,this._defineFunc,this._requireFunc,this._loaderAvailableTimestamp)}getGlobalAMDDefineFunc(){return this._defineFunc}getGlobalAMDRequireFunc(){return this._requireFunc}static _findRelevantLocationInStack(t,e){let i=l=>l.replace(/\\/g,"/"),s=i(t),n=e.split(/\n/);for(let l=0;l<n.length;l++){let d=n[l].match(/(.*):(\d+):(\d+)\)?$/);if(d){let o=d[1],_=d[2],f=d[3],g=Math.max(o.lastIndexOf(" ")+1,o.lastIndexOf("(")+1);if(o=o.substr(g),o=i(o),o===s){let v={line:parseInt(_,10),col:parseInt(f,10)};return v.line===1&&(v.col-=53),v}}}throw new Error("Could not correlate define call site for needle "+t)}getBuildInfo(){if(!this._config.isBuild())return null;let t=[],e=0;for(let i=0,s=this._modules2.length;i<s;i++){let n=this._modules2[i];if(!n)continue;let l=this._buildInfoPath[n.id]||null,d=this._buildInfoDefineStack[n.id]||null,o=this._buildInfoDependencies[n.id];t[e++]={id:n.strId,path:l,defineLocation:l&&d?c._findRelevantLocationInStack(l,d):null,dependencies:o,shim:null,exports:n.exports}}return t}getRecorder(){return this._recorder||(this._config.shouldRecordStats()?this._recorder=new u.LoaderEventRecorder(this._loaderAvailableTimestamp):this._recorder=u.NullLoaderEventRecorder.INSTANCE),this._recorder}getLoaderEvents(){return this.getRecorder().getEvents()}enqueueDefineAnonymousModule(t,e){if(this._currentAnonymousDefineCall!==null)throw new Error("Can only have one anonymous define call per script file");let i=null;this._config.isBuild()&&(i=new Error("StackLocation").stack||null),this._currentAnonymousDefineCall={stack:i,dependencies:t,callback:e}}defineModule(t,e,i,s,n,l=new y(t)){let d=this._moduleIdProvider.getModuleId(t);if(this._modules2[d]){this._config.isDuplicateMessageIgnoredFor(t)||console.warn("Duplicate definition of module '"+t+"'");return}let o=new m(d,t,this._normalizeDependencies(e,l),i,s,l);this._modules2[d]=o,this._config.isBuild()&&(this._buildInfoDefineStack[d]=n,this._buildInfoDependencies[d]=(o.dependencies||[]).map(_=>this._moduleIdProvider.getStrModuleId(_.id))),this._resolve(o)}_normalizeDependency(t,e){if(t==="exports")return h.EXPORTS;if(t==="module")return h.MODULE;if(t==="require")return h.REQUIRE;let i=t.indexOf("!");if(i>=0){let s=e.resolveModule(t.substr(0,i)),n=e.resolveModule(t.substr(i+1)),l=this._moduleIdProvider.getModuleId(s+"!"+n),d=this._moduleIdProvider.getModuleId(s);return new r(l,d,n)}return new h(this._moduleIdProvider.getModuleId(e.resolveModule(t)))}_normalizeDependencies(t,e){let i=[],s=0;for(let n=0,l=t.length;n<l;n++)i[s++]=this._normalizeDependency(t[n],e);return i}_relativeRequire(t,e,i,s){if(typeof e=="string")return this.synchronousRequire(e,t);this.defineModule(u.Utilities.generateAnonymousModule(),e,i,s,null,t)}synchronousRequire(t,e=new y(t)){let i=this._normalizeDependency(t,e),s=this._modules2[i.id];if(!s)throw new Error("Check dependency list! Synchronous require cannot resolve module '"+t+"'. This is the first mention of this module!");if(!s.isComplete())throw new Error("Check dependency list! Synchronous require cannot resolve module '"+t+"'. This module has not been resolved completely yet.");if(s.error)throw s.error;return s.exports}configure(t,e){let i=this._config.shouldRecordStats();e?this._config=new u.Configuration(this._env,t):this._config=this._config.cloneAndMerge(t),this._config.shouldRecordStats()&&!i&&(this._recorder=null)}getConfig(){return this._config}_onLoad(t){if(this._currentAnonymousDefineCall!==null){let e=this._currentAnonymousDefineCall;this._currentAnonymousDefineCall=null,this.defineModule(this._moduleIdProvider.getStrModuleId(t),e.dependencies,e.callback,null,e.stack)}}_createLoadError(t,e){let i=this._moduleIdProvider.getStrModuleId(t),s=(this._inverseDependencies2[t]||[]).map(l=>this._moduleIdProvider.getStrModuleId(l));const n=u.ensureError(e);return n.phase="loading",n.moduleId=i,n.neededBy=s,n}_onLoadError(t,e){const i=this._createLoadError(t,e);this._modules2[t]||(this._modules2[t]=new m(t,this._moduleIdProvider.getStrModuleId(t),[],()=>{},null,null));let s=[];for(let d=0,o=this._moduleIdProvider.getMaxModuleId();d<o;d++)s[d]=!1;let n=!1,l=[];for(l.push(t),s[t]=!0;l.length>0;){let d=l.shift(),o=this._modules2[d];o&&(n=o.onDependencyError(i)||n);let _=this._inverseDependencies2[d];if(_)for(let f=0,g=_.length;f<g;f++){let v=_[f];s[v]||(l.push(v),s[v]=!0)}}n||this._config.onError(i)}_hasDependencyPath(t,e){let i=this._modules2[t];if(!i)return!1;let s=[];for(let l=0,d=this._moduleIdProvider.getMaxModuleId();l<d;l++)s[l]=!1;let n=[];for(n.push(i),s[t]=!0;n.length>0;){let d=n.shift().dependencies;if(d)for(let o=0,_=d.length;o<_;o++){let f=d[o];if(f.id===e)return!0;let g=this._modules2[f.id];g&&!s[f.id]&&(s[f.id]=!0,n.push(g))}}return!1}_findCyclePath(t,e,i){if(t===e||i===50)return[t];let s=this._modules2[t];if(!s)return null;let n=s.dependencies;if(n)for(let l=0,d=n.length;l<d;l++){let o=this._findCyclePath(n[l].id,e,i+1);if(o!==null)return o.push(t),o}return null}_createRequire(t){let e=(i,s,n)=>this._relativeRequire(t,i,s,n);return e.toUrl=i=>this._config.requireToUrl(t.resolveModule(i)),e.getStats=()=>this.getLoaderEvents(),e.hasDependencyCycle=()=>this._hasDependencyCycle,e.config=(i,s=!1)=>{this.configure(i,s)},e.__$__nodeRequire=u.global.nodeRequire,e}_loadModule(t){if(this._modules2[t]||this._knownModules2[t])return;this._knownModules2[t]=!0;let e=this._moduleIdProvider.getStrModuleId(t),i=this._config.moduleIdToPaths(e),s=/^@[^\/]+\/[^\/]+$/;this._env.isNode&&(e.indexOf("/")===-1||s.test(e))&&i.push("node|"+e);let n=-1,l=d=>{if(n++,n>=i.length)this._onLoadError(t,d);else{let o=i[n],_=this.getRecorder();if(this._config.isBuild()&&o==="empty:"){this._buildInfoPath[t]=o,this.defineModule(this._moduleIdProvider.getStrModuleId(t),[],null,null,null),this._onLoad(t);return}_.record(10,o),this._scriptLoader.load(this,o,()=>{this._config.isBuild()&&(this._buildInfoPath[t]=o),_.record(11,o),this._onLoad(t)},f=>{_.record(12,o),l(f)})}};l(null)}_loadPluginDependency(t,e){if(this._modules2[e.id]||this._knownModules2[e.id])return;this._knownModules2[e.id]=!0;let i=s=>{this.defineModule(this._moduleIdProvider.getStrModuleId(e.id),[],s,null,null)};i.error=s=>{this._config.onError(this._createLoadError(e.id,s))},t.load(e.pluginParam,this._createRequire(y.ROOT),i,this._config.getOptionsLiteral())}_resolve(t){let e=t.dependencies;if(e)for(let i=0,s=e.length;i<s;i++){let n=e[i];if(n===h.EXPORTS){t.exportsPassedIn=!0,t.unresolvedDependenciesCount--;continue}if(n===h.MODULE){t.unresolvedDependenciesCount--;continue}if(n===h.REQUIRE){t.unresolvedDependenciesCount--;continue}let l=this._modules2[n.id];if(l&&l.isComplete()){if(l.error){t.onDependencyError(l.error);return}t.unresolvedDependenciesCount--;continue}if(this._hasDependencyPath(n.id,t.id)){this._hasDependencyCycle=!0,console.warn("There is a dependency cycle between '"+this._moduleIdProvider.getStrModuleId(n.id)+"' and '"+this._moduleIdProvider.getStrModuleId(t.id)+"'. The cyclic path follows:");let d=this._findCyclePath(n.id,t.id,0)||[];d.reverse(),d.push(n.id),console.warn(d.map(o=>this._moduleIdProvider.getStrModuleId(o)).join(` =>
9
+ `)),t.unresolvedDependenciesCount--;continue}if(this._inverseDependencies2[n.id]=this._inverseDependencies2[n.id]||[],this._inverseDependencies2[n.id].push(t.id),n instanceof r){let d=this._modules2[n.pluginId];if(d&&d.isComplete()){this._loadPluginDependency(d.exports,n);continue}let o=this._inversePluginDependencies2.get(n.pluginId);o||(o=[],this._inversePluginDependencies2.set(n.pluginId,o)),o.push(n),this._loadModule(n.pluginId);continue}this._loadModule(n.id)}t.unresolvedDependenciesCount===0&&this._onModuleComplete(t)}_onModuleComplete(t){let e=this.getRecorder();if(t.isComplete())return;let i=t.dependencies,s=[];if(i)for(let o=0,_=i.length;o<_;o++){let f=i[o];if(f===h.EXPORTS){s[o]=t.exports;continue}if(f===h.MODULE){s[o]={id:t.strId,config:()=>this._config.getConfigForModule(t.strId)};continue}if(f===h.REQUIRE){s[o]=this._createRequire(t.moduleIdResolver);continue}let g=this._modules2[f.id];if(g){s[o]=g.exports;continue}s[o]=null}const n=o=>(this._inverseDependencies2[o]||[]).map(_=>this._moduleIdProvider.getStrModuleId(_));t.complete(e,this._config,s,n);let l=this._inverseDependencies2[t.id];if(this._inverseDependencies2[t.id]=null,l)for(let o=0,_=l.length;o<_;o++){let f=l[o],g=this._modules2[f];g.unresolvedDependenciesCount--,g.unresolvedDependenciesCount===0&&this._onModuleComplete(g)}let d=this._inversePluginDependencies2.get(t.id);if(d){this._inversePluginDependencies2.delete(t.id);for(let o=0,_=d.length;o<_;o++)this._loadPluginDependency(t.exports,d[o])}}}u.ModuleManager=c})(AMDLoader||(AMDLoader={}));var define,AMDLoader;(function(u){const y=new u.Environment;let m=null;const p=function(a,t,e){typeof a!="string"&&(e=t,t=a,a=null),(typeof t!="object"||!Array.isArray(t))&&(e=t,t=null),t||(t=["require","exports","module"]),a?m.defineModule(a,t,e,null,null):m.enqueueDefineAnonymousModule(t,e)};p.amd={jQuery:!0};const h=function(a,t=!1){m.configure(a,t)},r=function(){if(arguments.length===1){if(arguments[0]instanceof Object&&!Array.isArray(arguments[0])){h(arguments[0]);return}if(typeof arguments[0]=="string")return m.synchronousRequire(arguments[0])}if((arguments.length===2||arguments.length===3)&&Array.isArray(arguments[0])){m.defineModule(u.Utilities.generateAnonymousModule(),arguments[0],arguments[1],arguments[2],null);return}throw new Error("Unrecognized require call")};r.config=h,r.getConfig=function(){return m.getConfig().getOptionsLiteral()},r.reset=function(){m=m.reset()},r.getBuildInfo=function(){return m.getBuildInfo()},r.getStats=function(){return m.getLoaderEvents()},r.define=p;function c(){if(typeof u.global.require<"u"||typeof require<"u"){const a=u.global.require||require;if(typeof a=="function"&&typeof a.resolve=="function"){const t=u.ensureRecordedNodeRequire(m.getRecorder(),a);u.global.nodeRequire=t,r.nodeRequire=t,r.__$__nodeRequire=t}}y.isNode&&!y.isElectronRenderer&&!y.isElectronNodeIntegrationWebWorker?module.exports=r:(y.isElectronRenderer||(u.global.define=p),u.global.require=r)}u.init=c,(typeof u.global.define!="function"||!u.global.define.amd)&&(m=new u.ModuleManager(y,u.createScriptLoader(y),p,r,u.Utilities.getHighPerformanceTimestamp()),typeof u.global.require<"u"&&typeof u.global.require!="function"&&r.config(u.global.require),define=function(){return p.apply(null,arguments)},define.amd=p.amd,typeof doNotInitLoader>"u"&&c())})(AMDLoader||(AMDLoader={}));
10
+
11
+ //# sourceMappingURL=../../min-maps/vs/loader.js.map
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="358px" height="358px" viewBox="0 0 358 358" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Logo Copy</title>
4
+ <defs>
5
+ <linearGradient x1="17.0510404%" y1="5.61100624%" x2="84.3781223%" y2="94.7995993%" id="linearGradient-1">
6
+ <stop stop-color="#FC1FFB" offset="0%"></stop>
7
+ <stop stop-color="#FF2020" offset="100%"></stop>
8
+ </linearGradient>
9
+ <linearGradient x1="22.4756694%" y1="5.61100624%" x2="78.7181998%" y2="94.7995993%" id="linearGradient-2">
10
+ <stop stop-color="#A458A3" offset="0%"></stop>
11
+ <stop stop-color="#8E3F3F" stop-opacity="0" offset="100%"></stop>
12
+ </linearGradient>
13
+ </defs>
14
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
15
+ <g id="Logo-Copy" transform="translate(0.000000, -2.000000)">
16
+ <circle id="Oval" fill="url(#linearGradient-1)" cx="179" cy="181" r="179"></circle>
17
+ <path d="M249.10428,79.1468067 L357.869163,187.907785 C354.392347,279.536402 282.041653,353.527239 191.099886,359.597492 L101.542351,270.038246 L158.082602,169.279238 L105.112911,116.309547 L249.10428,79.1468067 Z" id="Combined-Shape" fill="url(#linearGradient-2)"></path>
18
+ <g id="Group" transform="translate(92.000000, 0.000000)" fill="#FFFFFF" font-family="Avenir-Black, Avenir" font-size="269.533679" font-weight="700">
19
+ <text id="Z">
20
+ <tspan x="0" y="270">Z</tspan>
21
+ </text>
22
+ </g>
23
+ </g>
24
+ </g>
25
+ </svg>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="358px" height="358px" viewBox="0 0 358 358" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Slice</title>
4
+ <defs>
5
+ <linearGradient x1="17.0510404%" y1="5.61100624%" x2="83.240272%" y2="93.2922821%" id="linearGradient-1">
6
+ <stop stop-color="#ABFF90" offset="0%"></stop>
7
+ <stop stop-color="#F7CE36" offset="100%"></stop>
8
+ </linearGradient>
9
+ <linearGradient x1="18.7645028%" y1="5.61100624%" x2="78.6834489%" y2="77.0426305%" id="linearGradient-2">
10
+ <stop stop-color="#D640D5" offset="0%"></stop>
11
+ <stop stop-color="#5E0606" stop-opacity="0.477535648" offset="100%"></stop>
12
+ </linearGradient>
13
+ </defs>
14
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
15
+ <circle id="Oval" fill="url(#linearGradient-1)" cx="179" cy="179" r="179"></circle>
16
+ <path d="M239.969238,94.6894531 L293.694336,148.655762 L355.282863,210.242429 C342.994444,280.0552 290.247918,335.923487 222.118052,352.772521 L139.635742,270.290039 L167.448,244.648453 L140.799065,218 L159.216,184.943453 L104,128.891791 L126.914062,94.6894531 L239.969238,94.6894531 Z" id="Combined-Shape" fill="url(#linearGradient-2)"></path>
17
+ <path d="M179.700935,218 L179.700935,195.05597 C205.168224,195.05597 223.918224,190.787313 235.950935,182.25 C247.983645,173.712687 254,161.173507 254,144.632463 L254,128.891791 C254,118.39801 251.196262,109.060323 245.588785,100.878731 C239.981308,92.6971393 231.570093,86.3386194 220.35514,81.8031716 C209.140187,77.2677239 195.121495,75 178.299065,75 C162.64486,75 148.626168,76.4673507 136.242991,79.4020522 C123.859813,82.3367537 113.11215,85.9384328 104,90.2070896 L104,128.891791 C114.046729,126.223881 126.780374,117.686567 136.242991,116.085821 C145.705607,114.485075 152.481308,110.483209 162.528037,110.483209 C175.61215,110.483209 185.483645,112.350746 192.142523,116.085821 C198.801402,119.820896 202.130841,126.223881 202.130841,135.294776 L202.130841,143.83209 C202.130841,152.191542 198.976636,157.838619 192.668224,160.773321 C186.359813,163.708022 177.247664,165.175373 165.331776,165.175373 L140.799065,165.175373 L140.799065,218 L179.700935,218 Z M175.258224,272 C177.588268,272 179.452303,271.645688 180.850329,270.937063 C182.248355,270.228438 182.947368,268.811189 182.947368,266.685315 L182.947368,266.685315 L182.947368,239.58042 C182.947368,235.86014 180.38432,234 175.258224,234 L175.258224,234 L145.550164,234 C140.657072,234 138.210526,235.86014 138.210526,239.58042 L138.210526,239.58042 L138.210526,266.685315 C138.210526,270.228438 140.657072,272 145.550164,272 L145.550164,272 L175.258224,272 Z" id="?" fill="#FFFFFF" fill-rule="nonzero"></path>
18
+ </g>
19
+ </svg>
@@ -0,0 +1,2 @@
1
+ User-agent: *
2
+ Disallow: /
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="358px" height="358px" viewBox="0 0 358 358" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>z_slice_spinner</title>
4
+ <defs>
5
+ <linearGradient x1="17.0510404%" y1="5.61100624%" x2="83.9990304%" y2="94.297414%" id="linearGradient-1">
6
+ <stop stop-color="#C942FF" offset="0%"></stop>
7
+ <stop stop-color="#FB0202" offset="100%"></stop>
8
+ </linearGradient>
9
+ <linearGradient x1="22.5026412%" y1="5.61100624%" x2="78.690058%" y2="94.7995993%" id="linearGradient-2">
10
+ <stop stop-color="#530E52" offset="0%"></stop>
11
+ <stop stop-color="#A20000" stop-opacity="0.625928759" offset="100%"></stop>
12
+ </linearGradient>
13
+ </defs>
14
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
15
+ <circle id="gradient-circle-background" fill="url(#linearGradient-1)" cx="179" cy="179" r="170"></circle>
16
+ <path d="M245.889958,83 L348.999962,186.157513 C345.703608,273.064118 277.115242,343.241871 190.902415,348.999859 L106,264.055397 L159.600636,168.488187 L109.384922,118.24786 L245.889958,83 Z" id="z-shadow" fill="url(#linearGradient-2)"></path>
17
+ <text id="letter-z" font-family="Avenir-Black, Avenir" font-size="255.655251" font-weight="700" fill="#FFFFFF">
18
+ <tspan x="96" y="264">Z</tspan>
19
+ </text>
20
+ <path d="M179,-1 L179,179 L179.43,178.467 L179.430507,179 L358,179.605015 L358.106179,160.949045 C358.697321,166.885857 359,172.907581 359,179 C359,278.411255 278.411255,359 179,359 C79.588745,359 -1,278.411255 -1,179 C-1,79.588745 79.588745,-1 179,-1 Z" id="Combined-Shape" fill="#E6E7EB">
21
+ <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 179.5 179.5" to="360 179.5 179.5" dur=".75s" additive="sum" repeatCount="indefinite" />
22
+
23
+ </path>
24
+ </g>
25
+ </svg>
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="245px" height="245px" viewBox="0 0 245 245" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Slice</title>
4
+ <defs>
5
+ <linearGradient x1="17.0510404%" y1="6.49434722%" x2="84.3781223%" y2="93.9080873%" id="linearGradient-1">
6
+ <stop stop-color="#FC1FFB" offset="0%"></stop>
7
+ <stop stop-color="#FF2020" offset="100%"></stop>
8
+ </linearGradient>
9
+ <ellipse id="path-2" cx="100" cy="100.106878" rx="100" ry="99"></ellipse>
10
+ <filter x="-14.2%" y="-14.4%" width="131.5%" height="131.8%" filterUnits="objectBoundingBox" id="filter-3">
11
+ <feMorphology radius="2.5" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
12
+ <feOffset dx="3" dy="3" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
13
+ <feGaussianBlur stdDeviation="7.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
14
+ <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.195831512 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
15
+ </filter>
16
+ <linearGradient x1="21.9540108%" y1="5.61100624%" x2="79.2624853%" y2="94.7995993%" id="linearGradient-4">
17
+ <stop stop-color="#A458A3" offset="0%"></stop>
18
+ <stop stop-color="#8E3F3F" stop-opacity="0" offset="100%"></stop>
19
+ </linearGradient>
20
+ <linearGradient x1="50%" y1="0.338723776%" x2="50%" y2="100%" id="linearGradient-5">
21
+ <stop stop-color="#FD1FF0" offset="0%"></stop>
22
+ <stop stop-color="#FF2066" offset="100%"></stop>
23
+ </linearGradient>
24
+ <circle id="path-6" cx="122.5" cy="122.5" r="122.5"></circle>
25
+ <mask id="mask-7" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="0" y="0" width="245" height="245" fill="white">
26
+ <use xlink:href="#path-6"></use>
27
+ </mask>
28
+ </defs>
29
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
30
+ <g id="Logo-Copy" transform="translate(22.000000, 22.000000)">
31
+ <g id="Oval">
32
+ <use fill="black" fill-opacity="1" filter="url(#filter-3)" xlink:href="#path-2"></use>
33
+ <use fill="url(#linearGradient-1)" fill-rule="evenodd" xlink:href="#path-2"></use>
34
+ </g>
35
+ <path d="M139.164402,43.802948 L199.926914,103.995361 C197.984643,154.706404 157.565088,195.655983 106.759447,199.015378 L56.7275703,149.44976 L88.3143025,93.6857715 L58.7222968,64.3702667 L139.164402,43.802948 Z" id="Combined-Shape" fill="url(#linearGradient-4)"></path>
36
+ <g id="Group" transform="translate(51.396648, 0.000000)" fill="#FFFFFF" font-family="Avenir-Black, Avenir" font-size="149.170512" font-weight="700">
37
+ <text id="Z">
38
+ <tspan x="0" y="149">Z</tspan>
39
+ </text>
40
+ </g>
41
+ </g>
42
+ <use id="Spinner" stroke="url(#linearGradient-5)" mask="url(#mask-7)" stroke-width="24" stroke-linecap="square" stroke-dasharray="50,769" stroke-dashoffset="0" xlink:href="#path-6">
43
+ <animate attributeName="stroke-dashoffset" values="0;769" dur="2.5s" repeatCount="indefinite" />
44
+ </use>
45
+ </g>
46
+ </svg>
Binary file
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="308px" height="308px" viewBox="0 0 308 308" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>zuplo</title>
4
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="zuplo" fill-rule="nonzero">
6
+ <rect id="Rectangle" x="0" y="0" width="308" height="308"></rect>
7
+ <path d="M214.523,182.007 L140.435,182.007 L219.374,102.931 C220.118,102.186 220.624,101.235 220.83,100.201 C221.035,99.167 220.93,98.095 220.527,97.12 C220.124,96.146 219.442,95.313 218.567,94.727 C217.692,94.141 216.663,93.828 215.61,93.828 L90.239,93.828 L90.239,41.364 L227.754,41.364 C237.849,41.241 247.771,43.987 256.371,49.286 C264.97,54.584 271.894,62.216 276.338,71.297 C280.926,81.009 282.401,91.906 280.559,102.491 C278.717,113.077 273.649,122.831 266.051,130.415 L214.523,182.007 Z" id="Path" fill="#FF00BD"></path>
8
+ <path d="M90.24,119.097 L164.332,119.097 L85.551,198.014 C84.795,198.773 84.279,199.74 84.071,200.792 C83.862,201.844 83.97,202.935 84.379,203.926 C84.789,204.917 85.482,205.764 86.372,206.36 C87.262,206.957 88.309,207.276 89.38,207.277 L214.397,207.277 L214.397,259.741 L77.016,259.741 C66.921,259.863 56.999,257.116 48.4,251.818 C39.801,246.52 32.877,238.888 28.432,229.807 C23.844,220.095 22.37,209.198 24.213,198.613 C26.055,188.027 31.124,178.273 38.723,170.689 L90.24,119.097 Z" id="Path" fill="#FF00BD"></path>
9
+ </g>
10
+ </g>
11
+ </svg>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="308px" height="308px" viewBox="0 0 308 308" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>zuplo_black</title>
4
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="zuplo_black" fill-rule="nonzero">
6
+ <rect id="Rectangle" x="0" y="0" width="308" height="308"></rect>
7
+ <path d="M214.523,182.007 L140.435,182.007 L219.374,102.931 C220.118,102.186 220.624,101.235 220.83,100.201 C221.035,99.167 220.93,98.095 220.527,97.12 C220.124,96.146 219.442,95.313 218.567,94.727 C217.692,94.141 216.663,93.828 215.61,93.828 L90.239,93.828 L90.239,41.364 L227.754,41.364 C237.849,41.241 247.771,43.987 256.371,49.286 C264.97,54.584 271.894,62.216 276.338,71.297 C280.926,81.009 282.401,91.906 280.559,102.491 C278.717,113.077 273.649,122.831 266.051,130.415 L214.523,182.007 Z" id="Path" fill="#000000"></path>
8
+ <path d="M90.24,119.097 L164.332,119.097 L85.551,198.014 C84.795,198.773 84.279,199.74 84.071,200.792 C83.862,201.844 83.97,202.935 84.379,203.926 C84.789,204.917 85.482,205.764 86.372,206.36 C87.262,206.957 88.309,207.276 89.38,207.277 L214.397,207.277 L214.397,259.741 L77.016,259.741 C66.921,259.863 56.999,257.116 48.4,251.818 C39.801,246.52 32.877,238.888 28.432,229.807 C23.844,220.095 22.37,209.198 24.213,198.613 C26.055,188.027 31.124,178.273 38.723,170.689 L90.24,119.097 Z" id="Path" fill="#000000"></path>
9
+ </g>
10
+ </g>
11
+ </svg>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="308px" height="308px" viewBox="0 0 308 308" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>zuplo_white</title>
4
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="zuplo_white" fill-rule="nonzero">
6
+ <rect id="Rectangle" x="0" y="0" width="308" height="308"></rect>
7
+ <path d="M214.523,182.007 L140.435,182.007 L219.374,102.931 C220.118,102.186 220.624,101.235 220.83,100.201 C221.035,99.167 220.93,98.095 220.527,97.12 C220.124,96.146 219.442,95.313 218.567,94.727 C217.692,94.141 216.663,93.828 215.61,93.828 L90.239,93.828 L90.239,41.364 L227.754,41.364 C237.849,41.241 247.771,43.987 256.371,49.286 C264.97,54.584 271.894,62.216 276.338,71.297 C280.926,81.009 282.401,91.906 280.559,102.491 C278.717,113.077 273.649,122.831 266.051,130.415 L214.523,182.007 Z" id="Path" fill="#FFFFFF"></path>
8
+ <path d="M90.24,119.097 L164.332,119.097 L85.551,198.014 C84.795,198.773 84.279,199.74 84.071,200.792 C83.862,201.844 83.97,202.935 84.379,203.926 C84.789,204.917 85.482,205.764 86.372,206.36 C87.262,206.957 88.309,207.276 89.38,207.277 L214.397,207.277 L214.397,259.741 L77.016,259.741 C66.921,259.863 56.999,257.116 48.4,251.818 C39.801,246.52 32.877,238.888 28.432,229.807 C23.844,220.095 22.37,209.198 24.213,198.613 C26.055,188.027 31.124,178.273 38.723,170.689 L90.24,119.097 Z" id="Path" fill="#FFFFFF"></path>
9
+ </g>
10
+ </g>
11
+ </svg>
@@ -0,0 +1,2 @@
1
+ export { LocalEditorServer } from "./server.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { LocalEditorServer } from "./server.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Router } from "express";
2
+ export declare function createFilesRoutes(_workingDir: string): Router;
3
+ //# sourceMappingURL=files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/routes/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAKjC,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAO7D"}
@@ -0,0 +1,10 @@
1
+ import { Router } from "express";
2
+ // Currently no additional file routes needed beyond fs routes
3
+ // This file is kept for future expansion
4
+ export function createFilesRoutes(_workingDir) {
5
+ const router = Router();
6
+ // File operations are now handled by fs.ts
7
+ // Future routes can be added here
8
+ return router;
9
+ }
10
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/routes/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,8DAA8D;AAC9D,yCAAyC;AAEzC,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;IAExB,2CAA2C;IAC3C,kCAAkC;IAElC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { FastifyInstance, FastifyPluginOptions } from "fastify";
2
+ interface FsRoutesOptions extends FastifyPluginOptions {
3
+ workingDir: string;
4
+ }
5
+ export declare function createFsRoutes(fastify: FastifyInstance, options: FsRoutesOptions): Promise<void>;
6
+ export {};
7
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/routes/fs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAsBrE,UAAU,eAAgB,SAAQ,oBAAoB;IACpD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAgQf"}
@@ -0,0 +1,232 @@
1
+ import fs, { readdir } from "node:fs/promises";
2
+ import path from "node:path";
3
+ async function fileExists(filepath) {
4
+ try {
5
+ await fs.access(filepath);
6
+ return true;
7
+ }
8
+ catch {
9
+ return false;
10
+ }
11
+ }
12
+ async function dirExists(dirpath) {
13
+ try {
14
+ const stat = await fs.stat(dirpath);
15
+ return stat.isDirectory();
16
+ }
17
+ catch {
18
+ return false;
19
+ }
20
+ }
21
+ export async function createFsRoutes(fastify, options) {
22
+ const { workingDir } = options;
23
+ // Match portal's file API shape but simplified for local: /api/fs/dir
24
+ fastify.get("/dir", async (request, reply) => {
25
+ try {
26
+ const requestPath = request.query.path || "/";
27
+ const recursive = request.query.recursive === "true";
28
+ const fileTree = [];
29
+ // Helper function to recursively read directory
30
+ const readDirRecursive = async (dirPath, basePath = "") => {
31
+ try {
32
+ const entries = await readdir(dirPath, { withFileTypes: true });
33
+ for (const entry of entries) {
34
+ const relativePath = basePath
35
+ ? `${basePath}/${entry.name}`
36
+ : entry.name;
37
+ // Always prepend / to match portal's path format
38
+ const normalizedPath = relativePath.startsWith("/")
39
+ ? relativePath
40
+ : `/${relativePath}`;
41
+ const fullPath = path.join(dirPath, entry.name);
42
+ if (entry.isDirectory()) {
43
+ // Type 2 = Directory
44
+ fileTree.push([normalizedPath, 2]);
45
+ if (recursive) {
46
+ await readDirRecursive(fullPath, relativePath);
47
+ }
48
+ }
49
+ else if (entry.isFile()) {
50
+ // Type 1 = File
51
+ fileTree.push([normalizedPath, 1]);
52
+ }
53
+ }
54
+ }
55
+ catch (err) {
56
+ // Silently skip directories that can't be read
57
+ console.warn(`Warning: Could not read directory ${dirPath}: ${err.message}`);
58
+ }
59
+ };
60
+ if (requestPath === "/") {
61
+ // Read all directories - add parent dirs first
62
+ const configPath = path.join(workingDir, "config");
63
+ if (await dirExists(configPath)) {
64
+ fileTree.push(["/config", 2]);
65
+ await readDirRecursive(configPath, "config");
66
+ }
67
+ const modulesPath = path.join(workingDir, "modules");
68
+ if (await dirExists(modulesPath)) {
69
+ fileTree.push(["/modules", 2]);
70
+ await readDirRecursive(modulesPath, "modules");
71
+ }
72
+ const schemasPath = path.join(workingDir, "schemas");
73
+ if (await dirExists(schemasPath)) {
74
+ fileTree.push(["/schemas", 2]);
75
+ await readDirRecursive(schemasPath, "schemas");
76
+ }
77
+ }
78
+ else {
79
+ // Read specific directory
80
+ const fullPath = path.join(workingDir, requestPath);
81
+ if (await dirExists(fullPath)) {
82
+ await readDirRecursive(fullPath, requestPath);
83
+ }
84
+ }
85
+ // Return in backend's format: { path: string, result: FileList }
86
+ reply.status(200).send({
87
+ path: requestPath,
88
+ result: fileTree,
89
+ });
90
+ }
91
+ catch (err) {
92
+ reply.status(500).send({
93
+ message: `Error reading directory: ${err.message}`,
94
+ });
95
+ }
96
+ });
97
+ // Match portal's file API shape but simplified for local: /api/fs/file
98
+ fastify.get("/file", async (request, reply) => {
99
+ const filePath = request.query.path;
100
+ if (!filePath) {
101
+ return reply.status(400).send("File path is required");
102
+ }
103
+ // Remove leading slash for path.join to work correctly
104
+ const relativePath = filePath.startsWith("/")
105
+ ? filePath.slice(1)
106
+ : filePath;
107
+ const fullPath = path.join(workingDir, relativePath);
108
+ if (!(await fileExists(fullPath))) {
109
+ return reply.status(404).send(`Cannot find file: ${filePath}`);
110
+ }
111
+ try {
112
+ const content = await fs.readFile(fullPath, "utf-8");
113
+ // Return raw content as text (matching portal API)
114
+ reply.status(200).type("text/plain").send(content);
115
+ }
116
+ catch (err) {
117
+ reply.status(500).send(`Error reading file: ${err.message}`);
118
+ }
119
+ });
120
+ // Write/create a file: POST /file?path=...
121
+ fastify.post("/file", async (request, reply) => {
122
+ const filePath = request.query.path;
123
+ if (!filePath) {
124
+ return reply.status(400).send("File path is required");
125
+ }
126
+ // Remove leading slash for path.join to work correctly
127
+ const relativePath = filePath.startsWith("/")
128
+ ? filePath.slice(1)
129
+ : filePath;
130
+ const fullPath = path.join(workingDir, relativePath);
131
+ try {
132
+ // Ensure parent directory exists
133
+ const dir = path.dirname(fullPath);
134
+ await fs.mkdir(dir, { recursive: true });
135
+ // Get the raw body content - handle text content type
136
+ const content = typeof request.body === "string"
137
+ ? request.body
138
+ : JSON.stringify(request.body);
139
+ await fs.writeFile(fullPath, content, "utf-8");
140
+ // Match backend API response format
141
+ reply.status(200).send({ buildId: "local-build-" + Date.now() });
142
+ }
143
+ catch (err) {
144
+ if (err.code === "ENOENT") {
145
+ return reply.status(404).send({
146
+ type: "https://zup.fail/directory-does-not-exist",
147
+ title: "Directory does not exist",
148
+ status: 404,
149
+ });
150
+ }
151
+ reply.status(500).send({
152
+ type: "https://zup.fail/file-write-failed",
153
+ title: "File write failed",
154
+ status: 500,
155
+ });
156
+ }
157
+ });
158
+ // Rename a file: PATCH /api/fs/file?path=...
159
+ fastify.patch("/file", async (request, reply) => {
160
+ const oldPath = request.query.path;
161
+ const { newPath } = request.body;
162
+ if (!oldPath || !newPath) {
163
+ return reply.status(400).send("Both path and newPath are required");
164
+ }
165
+ // Remove leading slashes
166
+ const oldRelativePath = oldPath.startsWith("/")
167
+ ? oldPath.slice(1)
168
+ : oldPath;
169
+ const newRelativePath = newPath.startsWith("/")
170
+ ? newPath.slice(1)
171
+ : newPath;
172
+ const oldFullPath = path.join(workingDir, oldRelativePath);
173
+ const newFullPath = path.join(workingDir, newRelativePath);
174
+ if (!(await fileExists(oldFullPath))) {
175
+ return reply.status(404).send(`Cannot find file: ${oldPath}`);
176
+ }
177
+ try {
178
+ await fs.rename(oldFullPath, newFullPath);
179
+ reply.status(200).send({
180
+ status: "redeploy successful",
181
+ buildId: "local-build-" + Date.now(),
182
+ });
183
+ }
184
+ catch (err) {
185
+ reply.status(500).send(`Error renaming file: ${err.message}`);
186
+ }
187
+ });
188
+ // Delete a file: DELETE /api/fs/delete?path=...
189
+ fastify.delete("/delete", async (request, reply) => {
190
+ const filePath = request.query.path;
191
+ if (!filePath) {
192
+ return reply.status(400).send("File path is required");
193
+ }
194
+ // Remove leading slash
195
+ const relativePath = filePath.startsWith("/")
196
+ ? filePath.slice(1)
197
+ : filePath;
198
+ const fullPath = path.join(workingDir, relativePath);
199
+ if (!(await fileExists(fullPath))) {
200
+ return reply.status(404).send(`Cannot find file: ${filePath}`);
201
+ }
202
+ try {
203
+ await fs.unlink(fullPath);
204
+ reply.status(200).send({ buildId: "local-build-" + Date.now() });
205
+ }
206
+ catch (err) {
207
+ reply
208
+ .status(500)
209
+ .send(`Error deleting file: ${err.message}`);
210
+ }
211
+ });
212
+ // Create a directory: POST /api/fs/dir?path=...
213
+ fastify.post("/dir", async (request, reply) => {
214
+ const dirPath = request.query.path;
215
+ if (!dirPath) {
216
+ return reply.status(400).send("Directory path is required");
217
+ }
218
+ // Remove leading slash
219
+ const relativePath = dirPath.startsWith("/") ? dirPath.slice(1) : dirPath;
220
+ const fullPath = path.join(workingDir, relativePath);
221
+ try {
222
+ await fs.mkdir(fullPath, { recursive: true });
223
+ reply.status(201).send();
224
+ }
225
+ catch (err) {
226
+ reply
227
+ .status(500)
228
+ .send(`Error creating directory: ${err.message}`);
229
+ }
230
+ });
231
+ }
232
+ //# sourceMappingURL=fs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/routes/fs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,KAAK,UAAU,UAAU,CAAC,QAAgB;IACxC,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,OAAe;IACtC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;I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AEnC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAC9D,CAAC;QAED,uBAAuB;QACvB,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;QAErD,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC9C,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,KAAK;iBACF,MAAM,CAAC,GAAG,CAAC;iBACX,IAAI,CAAC,6BAA8B,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QACjE,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Router } from "express";
2
+ export declare function createModulesRoutes(workingDir: string): Router;
3
+ //# sourceMappingURL=modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/routes/modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,MAAM,EAAE,MAAM,SAAS,CAAC;AAwB9D,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CA8C9D"}
@@ -0,0 +1,47 @@
1
+ import { Router } from "express";
2
+ import fs, { readdir } from "node:fs/promises";
3
+ import path from "node:path";
4
+ async function dirExists(dirpath) {
5
+ try {
6
+ const stat = await fs.stat(dirpath);
7
+ return stat.isDirectory();
8
+ }
9
+ catch {
10
+ return false;
11
+ }
12
+ }
13
+ export function createModulesRoutes(workingDir) {
14
+ const router = Router();
15
+ router.get("/modules", async (_req, res) => {
16
+ const modulesPath = path.join(workingDir, "modules");
17
+ if (!(await dirExists(modulesPath))) {
18
+ return res.status(200).json([]);
19
+ }
20
+ const moduleFileNames = (await readdir(modulesPath)).filter((fileName) => fileName.endsWith(".ts") ||
21
+ fileName.endsWith(".js") ||
22
+ fileName.endsWith(".mts") ||
23
+ fileName.endsWith(".mjs"));
24
+ const results = [];
25
+ for (const moduleFileName of moduleFileNames) {
26
+ const moduleFilePath = path.join(modulesPath, moduleFileName);
27
+ const moduleContent = await fs.readFile(moduleFilePath, "utf-8");
28
+ const exportRegex = /export\s+(async\s+)?function\s+(\w+)/g;
29
+ let match;
30
+ const exports = [];
31
+ while ((match = exportRegex.exec(moduleContent)) !== null) {
32
+ exports.push({
33
+ name: match[2],
34
+ isHandlerInvocable: true,
35
+ });
36
+ }
37
+ results.push({
38
+ name: moduleFileName,
39
+ filepath: `./modules/${moduleFileName}`,
40
+ methods: exports,
41
+ });
42
+ }
43
+ res.status(200).json(results);
44
+ });
45
+ return router;
46
+ }
47
+ //# sourceMappingURL=modules.js.map