code-server
Version:
Run VS Code on a remote server.
10 lines (9 loc) • 265 kB
JavaScript
/*!--------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/(function(){var x=["require","exports","vs/base/common/platform","vs/base/common/strings","vs/editor/common/core/position","vs/editor/common/core/range","vs/base/common/errors","vs/base/common/event","vs/base/common/types","vs/base/common/functional","vs/base/common/lifecycle","vs/base/common/stopwatch","vs/base/common/diff/diff","vs/base/common/uint","vs/base/common/uri","vs/editor/common/core/characterClassifier","vs/base/common/diff/diffChange","vs/base/common/arrays","vs/base/common/iterator","vs/base/common/keyCodes","vs/base/common/linkedList","vs/base/common/process","vs/base/common/path","vs/base/common/cancellation","vs/base/common/hash","vs/base/common/objects","vs/editor/common/controller/wordCharacterClassifier","vs/editor/common/core/selection","vs/editor/common/core/token","vs/editor/common/diff/diffComputer","vs/editor/common/model","vs/editor/common/model/textModelSearch","vs/editor/common/model/wordHelper","vs/editor/common/modes/linkComputer","vs/editor/common/modes/supports/inplaceReplaceSupport","vs/editor/common/modes/unicodeTextModelHighlighter","vs/editor/common/standalone/standaloneEnums","vs/editor/common/standalone/standaloneBase","vs/editor/common/viewModel/prefixSumComputer","vs/editor/common/model/mirrorTextModel","vs/base/common/worker/simpleWorker","vs/editor/common/services/editorSimpleWorker"],ee=function(k){for(var t=[],D=0,S=k.length;D<S;D++)t[D]=x[k[D]];return t},Pe=this,Fe=typeof global=="object"?global:{},oe;(function(k){k.global=Pe;var t=function(){function D(){this._detected=!1,this._isWindows=!1,this._isNode=!1,this._isElectronRenderer=!1,this._isWebWorker=!1,this._isElectronNodeIntegrationWebWorker=!1}return Object.defineProperty(D.prototype,"isWindows",{get:function(){return this._detect(),this._isWindows},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"isNode",{get:function(){return this._detect(),this._isNode},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"isElectronRenderer",{get:function(){return this._detect(),this._isElectronRenderer},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"isWebWorker",{get:function(){return this._detect(),this._isWebWorker},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"isElectronNodeIntegrationWebWorker",{get:function(){return this._detect(),this._isElectronNodeIntegrationWebWorker},enumerable:!1,configurable:!0}),D.prototype._detect=function(){this._detected||(this._detected=!0,this._isWindows=D._isWindows(),this._isNode=typeof module!="undefined"&&!!module.exports,this._isElectronRenderer=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.electron!="undefined"&&process.type==="renderer",this._isWebWorker=typeof k.global.importScripts=="function",this._isElectronNodeIntegrationWebWorker=this._isWebWorker&&typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.electron!="undefined"&&process.type==="worker")},D._isWindows=function(){return typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.indexOf("Windows")>=0?!0:typeof process!="undefined"?process.platform==="win32":!1},D}();k.Environment=t})(oe||(oe={}));var oe;(function(k){var t=function(){function F(o,M,m){this.type=o,this.detail=M,this.timestamp=m}return F}();k.LoaderEvent=t;var D=function(){function F(o){this._events=[new t(1,"",o)]}return F.prototype.record=function(o,M){this._events.push(new t(o,M,k.Utilities.getHighPerformanceTimestamp()))},F.prototype.getEvents=function(){return this._events},F}();k.LoaderEventRecorder=D;var S=function(){function F(){}return F.prototype.record=function(o,M){},F.prototype.getEvents=function(){return[]},F.INSTANCE=new F,F}();k.NullLoaderEventRecorder=S})(oe||(oe={}));var oe;(function(k){var t=function(){function D(){}return D.fileUriToFilePath=function(S,F){if(F=decodeURI(F).replace(/%23/g,"#"),S){if(/^file:\/\/\//.test(F))return F.substr(8);if(/^file:\/\//.test(F))return F.substr(5)}else if(/^file:\/\//.test(F))return F.substr(7);return F},D.startsWith=function(S,F){return S.length>=F.length&&S.substr(0,F.length)===F},D.endsWith=function(S,F){return S.length>=F.length&&S.substr(S.length-F.length)===F},D.containsQueryString=function(S){return/^[^\#]*\?/gi.test(S)},D.isAbsolutePath=function(S){return/^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(S)},D.forEachProperty=function(S,F){if(S){var o=void 0;for(o in S)S.hasOwnProperty(o)&&F(o,S[o])}},D.isEmpty=function(S){var F=!0;return D.forEachProperty(S,function(){F=!1}),F},D.recursiveClone=function(S){if(!S||typeof S!="object"||S instanceof RegExp||!Array.isArray(S)&&Object.getPrototypeOf(S)!==Object.prototype)return S;var F=Array.isArray(S)?[]:{};return D.forEachProperty(S,function(o,M){M&&typeof M=="object"?F[o]=D.recursiveClone(M):F[o]=M}),F},D.generateAnonymousModule=function(){return"===anonymous"+D.NEXT_ANONYMOUS_ID+++"==="},D.isAnonymousModule=function(S){return D.startsWith(S,"===anonymous")},D.getHighPerformanceTimestamp=function(){return this.PERFORMANCE_NOW_PROBED||(this.PERFORMANCE_NOW_PROBED=!0,this.HAS_PERFORMANCE_NOW=k.global.performance&&typeof k.global.performance.now=="function"),this.HAS_PERFORMANCE_NOW?k.global.performance.now():Date.now()},D.NEXT_ANONYMOUS_ID=1,D.PERFORMANCE_NOW_PROBED=!1,D.HAS_PERFORMANCE_NOW=!1,D}();k.Utilities=t})(oe||(oe={}));var oe;(function(k){function t(F){if(F instanceof Error)return F;var o=new Error(F.message||String(F)||"Unknown Error");return F.stack&&(o.stack=F.stack),o}k.ensureError=t;var D=function(){function F(){}return F.validateConfigurationOptions=function(o){function M(u){if(u.phase==="loading"){console.error('Loading "'+u.moduleId+'" failed'),console.error(u),console.error("Here are the modules that depend on it:"),console.error(u.neededBy);return}if(u.phase==="factory"){console.error('The factory method of "'+u.moduleId+'" has thrown an exception'),console.error(u);return}}if(o=o||{},typeof o.baseUrl!="string"&&(o.baseUrl=""),typeof o.isBuild!="boolean"&&(o.isBuild=!1),typeof o.paths!="object"&&(o.paths={}),typeof o.config!="object"&&(o.config={}),typeof o.catchError=="undefined"&&(o.catchError=!1),typeof o.recordStats=="undefined"&&(o.recordStats=!1),typeof o.urlArgs!="string"&&(o.urlArgs=""),typeof o.onError!="function"&&(o.onError=M),Array.isArray(o.ignoreDuplicateModules)||(o.ignoreDuplicateModules=[]),o.baseUrl.length>0&&(k.Utilities.endsWith(o.baseUrl,"/")||(o.baseUrl+="/")),typeof o.cspNonce!="string"&&(o.cspNonce=""),typeof o.preferScriptTags=="undefined"&&(o.preferScriptTags=!1),Array.isArray(o.nodeModules)||(o.nodeModules=[]),o.nodeCachedData&&typeof o.nodeCachedData=="object"&&(typeof o.nodeCachedData.seed!="string"&&(o.nodeCachedData.seed="seed"),(typeof o.nodeCachedData.writeDelay!="number"||o.nodeCachedData.writeDelay<0)&&(o.nodeCachedData.writeDelay=1e3*7),!o.nodeCachedData.path||typeof o.nodeCachedData.path!="string")){var m=t(new Error("INVALID cached data configuration, 'path' MUST be set"));m.phase="configuration",o.onError(m),o.nodeCachedData=void 0}return o},F.mergeConfigurationOptions=function(o,M){o===void 0&&(o=null),M===void 0&&(M=null);var m=k.Utilities.recursiveClone(M||{});return k.Utilities.forEachProperty(o,function(u,c){u==="ignoreDuplicateModules"&&typeof m.ignoreDuplicateModules!="undefined"?m.ignoreDuplicateModules=m.ignoreDuplicateModules.concat(c):u==="paths"&&typeof m.paths!="undefined"?k.Utilities.forEachProperty(c,function(L,A){return m.paths[L]=A}):u==="config"&&typeof m.config!="undefined"?k.Utilities.forEachProperty(c,function(L,A){return m.config[L]=A}):m[u]=k.Utilities.recursiveClone(c)}),F.validateConfigurationOptions(m)},F}();k.ConfigurationOptionsUtil=D;var S=function(){function F(o,M){if(this._env=o,this.options=D.mergeConfigurationOptions(M),this._createIgnoreDuplicateModulesMap(),this._createNodeModulesMap(),this._createSortedPathsRules(),this.options.baseUrl===""){if(this.options.nodeRequire&&this.options.nodeRequire.main&&this.options.nodeRequire.main.filename&&this._env.isNode){var m=this.options.nodeRequire.main.filename,u=Math.max(m.lastIndexOf("/"),m.lastIndexOf("\\"));this.options.baseUrl=m.substring(0,u+1)}if(this.options.nodeMain&&this._env.isNode){var m=this.options.nodeMain,u=Math.max(m.lastIndexOf("/"),m.lastIndexOf("\\"));this.options.baseUrl=m.substring(0,u+1)}}}return F.prototype._createIgnoreDuplicateModulesMap=function(){this.ignoreDuplicateModulesMap={};for(var o=0;o<this.options.ignoreDuplicateModules.length;o++)this.ignoreDuplicateModulesMap[this.options.ignoreDuplicateModules[o]]=!0},F.prototype._createNodeModulesMap=function(){this.nodeModulesMap=Object.create(null);for(var o=0,M=this.options.nodeModules;o<M.length;o++){var m=M[o];this.nodeModulesMap[m]=!0}},F.prototype._createSortedPathsRules=function(){var o=this;this.sortedPathsRules=[],k.Utilities.forEachProperty(this.options.paths,function(M,m){Array.isArray(m)?o.sortedPathsRules.push({from:M,to:m}):o.sortedPathsRules.push({from:M,to:[m]})}),this.sortedPathsRules.sort(function(M,m){return m.from.length-M.from.length})},F.prototype.cloneAndMerge=function(o){return new F(this._env,D.mergeConfigurationOptions(o,this.options))},F.prototype.getOptionsLiteral=function(){return this.options},F.prototype._applyPaths=function(o){for(var M,m=0,u=this.sortedPathsRules.length;m<u;m++)if(M=this.sortedPathsRules[m],k.Utilities.startsWith(o,M.from)){for(var c=[],L=0,A=M.to.length;L<A;L++)c.push(M.to[L]+o.substr(M.from.length));return c}return[o]},F.prototype._addUrlArgsToUrl=function(o){return k.Utilities.containsQueryString(o)?o+"&"+this.options.urlArgs:o+"?"+this.options.urlArgs},F.prototype._addUrlArgsIfNecessaryToUrl=function(o){return this.options.urlArgs?this._addUrlArgsToUrl(o):o},F.prototype._addUrlArgsIfNecessaryToUrls=function(o){if(this.options.urlArgs)for(var M=0,m=o.length;M<m;M++)o[M]=this._addUrlArgsToUrl(o[M]);return o},F.prototype.moduleIdToPaths=function(o){if(this._env.isNode){var M=this.nodeModulesMap[o]===!0||this.options.amdModulesPattern instanceof RegExp&&!this.options.amdModulesPattern.test(o);if(M)return this.isBuild()?["empty:"]:["node|"+o]}var m=o,u;if(!k.Utilities.endsWith(m,".js")&&!k.Utilities.isAbsolutePath(m)){u=this._applyPaths(m);for(var c=0,L=u.length;c<L;c++)this.isBuild()&&u[c]==="empty:"||(k.Utilities.isAbsolutePath(u[c])||(u[c]=this.options.baseUrl+u[c]),!k.Utilities.endsWith(u[c],".js")&&!k.Utilities.containsQueryString(u[c])&&(u[c]=u[c]+".js"))}else!k.Utilities.endsWith(m,".js")&&!k.Utilities.containsQueryString(m)&&(m=m+".js"),u=[m];return this._addUrlArgsIfNecessaryToUrls(u)},F.prototype.requireToUrl=function(o){var M=o;return k.Utilities.isAbsolutePath(M)||(M=this._applyPaths(M)[0],k.Utilities.isAbsolutePath(M)||(M=this.options.baseUrl+M)),this._addUrlArgsIfNecessaryToUrl(M)},F.prototype.isBuild=function(){return this.options.isBuild},F.prototype.isDuplicateMessageIgnoredFor=function(o){return this.ignoreDuplicateModulesMap.hasOwnProperty(o)},F.prototype.getConfigForModule=function(o){if(this.options.config)return this.options.config[o]},F.prototype.shouldCatchError=function(){return this.options.catchError},F.prototype.shouldRecordStats=function(){return this.options.recordStats},F.prototype.onError=function(o){this.options.onError(o)},F}();k.Configuration=S})(oe||(oe={}));var oe;(function(k){var t=function(){function u(c){this._env=c,this._scriptLoader=null,this._callbackMap={}}return u.prototype.load=function(c,L,A,_){var g=this;if(!this._scriptLoader)if(this._env.isWebWorker)this._scriptLoader=new F;else if(this._env.isElectronRenderer){var e=c.getConfig().getOptionsLiteral().preferScriptTags;e?this._scriptLoader=new D:this._scriptLoader=new o(this._env)}else this._env.isNode?this._scriptLoader=new o(this._env):this._scriptLoader=new D;var b={callback:A,errorback:_};if(this._callbackMap.hasOwnProperty(L)){this._callbackMap[L].push(b);return}this._callbackMap[L]=[b],this._scriptLoader.load(c,L,function(){return g.triggerCallback(L)},function(E){return g.triggerErrorback(L,E)})},u.prototype.triggerCallback=function(c){var L=this._callbackMap[c];delete this._callbackMap[c];for(var A=0;A<L.length;A++)L[A].callback()},u.prototype.triggerErrorback=function(c,L){var A=this._callbackMap[c];delete this._callbackMap[c];for(var _=0;_<A.length;_++)A[_].errorback(L)},u}(),D=function(){function u(){}return u.prototype.attachListeners=function(c,L,A){var _=function(){c.removeEventListener("load",g),c.removeEventListener("error",e)},g=function(b){_(),L()},e=function(b){_(),A(b)};c.addEventListener("load",g),c.addEventListener("error",e)},u.prototype.load=function(c,L,A,_){if(/^node\|/.test(L)){var g=c.getConfig().getOptionsLiteral(),e=M(c.getRecorder(),g.nodeRequire||k.global.nodeRequire),b=L.split("|"),E=null;try{E=e(b[1])}catch(i){_(i);return}c.enqueueDefineAnonymousModule([],function(){return E}),A()}else{var N=document.createElement("script");N.setAttribute("async","async"),N.setAttribute("type","text/javascript"),this.attachListeners(N,A,_);var v=c.getConfig().getOptionsLiteral().trustedTypesPolicy;v&&(L=v.createScriptURL(L)),N.setAttribute("src",L);var r=c.getConfig().getOptionsLiteral().cspNonce;r&&N.setAttribute("nonce",r),document.getElementsByTagName("head")[0].appendChild(N)}},u}();function S(u){var c=u.getConfig().getOptionsLiteral().trustedTypesPolicy;try{var L=c?self.eval(c.createScript("","true")):new Function("true");return L.call(self),!0}catch(A){return!1}}var F=function(){function u(){this._cachedCanUseEval=null}return u.prototype._canUseEval=function(c){return this._cachedCanUseEval===null&&(this._cachedCanUseEval=S(c)),this._cachedCanUseEval},u.prototype.load=function(c,L,A,_){if(/^node\|/.test(L)){var g=c.getConfig().getOptionsLiteral(),e=M(c.getRecorder(),g.nodeRequire||k.global.nodeRequire),b=L.split("|"),E=null;try{E=e(b[1])}catch(r){_(r);return}c.enqueueDefineAnonymousModule([],function(){return E}),A()}else{var N=c.getConfig().getOptionsLiteral().trustedTypesPolicy,v=/^((http:)|(https:)|(file:))/.test(L)&&L.substring(0,self.origin.length)!==self.origin;if(!v&&this._canUseEval(c)){fetch(L).then(function(r){if(r.status!==200)throw new Error(r.statusText);return r.text()}).then(function(r){r=r+`
//# sourceURL=`+L;var i=N?self.eval(N.createScript("",r)):new Function(r);i.call(self),A()}).then(void 0,_);return}try{N&&(L=N.createScriptURL(L)),importScripts(L),A()}catch(r){_(r)}}},u}(),o=function(){function u(c){this._env=c,this._didInitialize=!1,this._didPatchNodeRequire=!1}return u.prototype._init=function(c){this._didInitialize||(this._didInitialize=!0,this._fs=c("fs"),this._vm=c("vm"),this._path=c("path"),this._crypto=c("crypto"))},u.prototype._initNodeRequire=function(c,L){var A=L.getConfig().getOptionsLiteral().nodeCachedData;if(!A||this._didPatchNodeRequire)return;this._didPatchNodeRequire=!0;var _=this,g=c("module");function e(b){var E=b.constructor,N=function(r){try{return b.require(r)}finally{}};return N.resolve=function(r,i){return E._resolveFilename(r,b,!1,i)},N.resolve.paths=function(r){return E._resolveLookupPaths(r,b)},N.main=process.mainModule,N.extensions=E._extensions,N.cache=E._cache,N}g.prototype._compile=function(b,E){var N=g.wrap(b.replace(/^#!.*/,"")),v=L.getRecorder(),r=_._getCachedDataPath(A,E),i={filename:E},s;try{var a=_._fs.readFileSync(r);s=a.slice(0,16),i.cachedData=a.slice(16),v.record(60,r)}catch(R){v.record(61,r)}var d=new _._vm.Script(N,i),h=d.runInThisContext(i),f=_._path.dirname(E),l=e(this),w=[this.exports,l,this,E,f,process,Fe,Buffer],P=h.apply(this.exports,w);return _._handleCachedData(d,N,r,!i.cachedData,L),_._verifyCachedData(d,N,r,s,L),P}},u.prototype.load=function(c,L,A,_){var g=this,e=c.getConfig().getOptionsLiteral(),b=M(c.getRecorder(),e.nodeRequire||k.global.nodeRequire),E=e.nodeInstrumenter||function(h){return h};this._init(b),this._initNodeRequire(b,c);var N=c.getRecorder();if(/^node\|/.test(L)){var v=L.split("|"),r=null;try{r=b(v[1])}catch(h){_(h);return}c.enqueueDefineAnonymousModule([],function(){return r}),A()}else{L=k.Utilities.fileUriToFilePath(this._env.isWindows,L);var i=this._path.normalize(L),s=this._getElectronRendererScriptPathOrUri(i),a=Boolean(e.nodeCachedData),d=a?this._getCachedDataPath(e.nodeCachedData,L):void 0;this._readSourceAndCachedData(i,d,N,function(h,f,l,w){if(h){_(h);return}var P;f.charCodeAt(0)===u._BOM?P=u._PREFIX+f.substring(1)+u._SUFFIX:P=u._PREFIX+f+u._SUFFIX,P=E(P,i);var R={filename:s,cachedData:l},I=g._createAndEvalScript(c,P,R,A,_);g._handleCachedData(I,P,d,a&&!l,c),g._verifyCachedData(I,P,d,w,c)})}},u.prototype._createAndEvalScript=function(c,L,A,_,g){var e=c.getRecorder();e.record(31,A.filename);var b=new this._vm.Script(L,A),E=b.runInThisContext(A),N=c.getGlobalAMDDefineFunc(),v=!1,r=function(){return v=!0,N.apply(null,arguments)};return r.amd=N.amd,E.call(k.global,c.getGlobalAMDRequireFunc(),r,A.filename,this._path.dirname(A.filename)),e.record(32,A.filename),v?_():g(new Error("Didn't receive define call in "+A.filename+"!")),b},u.prototype._getElectronRendererScriptPathOrUri=function(c){if(!this._env.isElectronRenderer)return c;var L=c.match(/^([a-z])\:(.*)/i);return L?"file:///"+(L[1].toUpperCase()+":"+L[2]).replace(/\\/g,"/"):"file://"+c},u.prototype._getCachedDataPath=function(c,L){var A=this._crypto.createHash("md5").update(L,"utf8").update(c.seed,"utf8").update(process.arch,"").digest("hex"),_=this._path.basename(L).replace(/\.js$/,"");return this._path.join(c.path,_+"-"+A+".code")},u.prototype._handleCachedData=function(c,L,A,_,g){var e=this;c.cachedDataRejected?this._fs.unlink(A,function(b){g.getRecorder().record(62,A),e._createAndWriteCachedData(c,L,A,g),b&&g.getConfig().onError(b)}):_&&this._createAndWriteCachedData(c,L,A,g)},u.prototype._createAndWriteCachedData=function(c,L,A,_){var g=this,e=Math.ceil(_.getConfig().getOptionsLiteral().nodeCachedData.writeDelay*(1+Math.random())),b=-1,E=0,N=void 0,v=function(){setTimeout(function(){N||(N=g._crypto.createHash("md5").update(L,"utf8").digest());var r=c.createCachedData();if(!(r.length===0||r.length===b||E>=5)){if(r.length<b){v();return}b=r.length,g._fs.writeFile(A,Buffer.concat([N,r]),function(i){i&&_.getConfig().onError(i),_.getRecorder().record(63,A),v()})}},e*Math.pow(4,E++))};v()},u.prototype._readSourceAndCachedData=function(c,L,A,_){if(!L)this._fs.readFile(c,{encoding:"utf8"},_);else{var g=void 0,e=void 0,b=void 0,E=2,N=function(v){v?_(v):--E==0&&_(void 0,g,e,b)};this._fs.readFile(c,{encoding:"utf8"},function(v,r){g=r,N(v)}),this._fs.readFile(L,function(v,r){!v&&r&&r.length>0?(b=r.slice(0,16),e=r.slice(16),A.record(60,L)):A.record(61,L),N()})}},u.prototype._verifyCachedData=function(c,L,A,_,g){var e=this;!_||c.cachedDataRejected||setTimeout(function(){var b=e._crypto.createHash("md5").update(L,"utf8").digest();_.equals(b)||(g.getConfig().onError(new Error("FAILED TO VERIFY CACHED DATA, deleting stale '"+A+"' now, but a RESTART IS REQUIRED")),e._fs.unlink(A,function(E){E&&g.getConfig().onError(E)}))},Math.ceil(5e3*(1+Math.random())))},u._BOM=65279,u._PREFIX="(function (require, define, __filename, __dirname) { ",u._SUFFIX=`
});`,u}();function M(u,c){if(c.__$__isRecorded)return c;var L=function(_){u.record(33,_);try{return c(_)}finally{u.record(34,_)}};return L.__$__isRecorded=!0,L}k.ensureRecordedNodeRequire=M;function m(u){return new t(u)}k.createScriptLoader=m})(oe||(oe={}));var oe;(function(k){var t=function(){function m(u){var c=u.lastIndexOf("/");c!==-1?this.fromModulePath=u.substr(0,c+1):this.fromModulePath=""}return m._normalizeModuleId=function(u){var c=u,L;for(L=/\/\.\//;L.test(c);)c=c.replace(L,"/");for(c=c.replace(/^\.\//g,""),L=/\/(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//;L.test(c);)c=c.replace(L,"/");return c=c.replace(/^(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//,""),c},m.prototype.resolveModule=function(u){var c=u;return k.Utilities.isAbsolutePath(c)||(k.Utilities.startsWith(c,"./")||k.Utilities.startsWith(c,"../"))&&(c=m._normalizeModuleId(this.fromModulePath+c)),c},m.ROOT=new m(""),m}();k.ModuleIdResolver=t;var D=function(){function m(u,c,L,A,_,g){this.id=u,this.strId=c,this.dependencies=L,this._callback=A,this._errorback=_,this.moduleIdResolver=g,this.exports={},this.error=null,this.exportsPassedIn=!1,this.unresolvedDependenciesCount=this.dependencies.length,this._isComplete=!1}return m._safeInvokeFunction=function(u,c){try{return{returnedValue:u.apply(k.global,c),producedError:null}}catch(L){return{returnedValue:null,producedError:L}}},m._invokeFactory=function(u,c,L,A){return u.isBuild()&&!k.Utilities.isAnonymousModule(c)?{returnedValue:null,producedError:null}:u.shouldCatchError()?this._safeInvokeFunction(L,A):{returnedValue:L.apply(k.global,A),producedError:null}},m.prototype.complete=function(u,c,L){this._isComplete=!0;var A=null;if(this._callback)if(typeof this._callback=="function"){u.record(21,this.strId);var _=m._invokeFactory(c,this.strId,this._callback,L);A=_.producedError,u.record(22,this.strId),!A&&typeof _.returnedValue!="undefined"&&(!this.exportsPassedIn||k.Utilities.isEmpty(this.exports))&&(this.exports=_.returnedValue)}else this.exports=this._callback;if(A){var g=k.ensureError(A);g.phase="factory",g.moduleId=this.strId,this.error=g,c.onError(g)}this.dependencies=null,this._callback=null,this._errorback=null,this.moduleIdResolver=null},m.prototype.onDependencyError=function(u){return this._isComplete=!0,this.error=u,this._errorback?(this._errorback(u),!0):!1},m.prototype.isComplete=function(){return this._isComplete},m}();k.Module=D;var S=function(){function m(){this._nextId=0,this._strModuleIdToIntModuleId=new Map,this._intModuleIdToStrModuleId=[],this.getModuleId("exports"),this.getModuleId("module"),this.getModuleId("require")}return m.prototype.getMaxModuleId=function(){return this._nextId},m.prototype.getModuleId=function(u){var c=this._strModuleIdToIntModuleId.get(u);return typeof c=="undefined"&&(c=this._nextId++,this._strModuleIdToIntModuleId.set(u,c),this._intModuleIdToStrModuleId[c]=u),c},m.prototype.getStrModuleId=function(u){return this._intModuleIdToStrModuleId[u]},m}(),F=function(){function m(u){this.id=u}return m.EXPORTS=new m(0),m.MODULE=new m(1),m.REQUIRE=new m(2),m}();k.RegularDependency=F;var o=function(){function m(u,c,L){this.id=u,this.pluginId=c,this.pluginParam=L}return m}();k.PluginDependency=o;var M=function(){function m(u,c,L,A,_){_===void 0&&(_=0),this._env=u,this._scriptLoader=c,this._loaderAvailableTimestamp=_,this._defineFunc=L,this._requireFunc=A,this._moduleIdProvider=new S,this._config=new k.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=[]}return m.prototype.reset=function(){return new m(this._env,this._scriptLoader,this._defineFunc,this._requireFunc,this._loaderAvailableTimestamp)},m.prototype.getGlobalAMDDefineFunc=function(){return this._defineFunc},m.prototype.getGlobalAMDRequireFunc=function(){return this._requireFunc},m._findRelevantLocationInStack=function(u,c){for(var L=function(i){return i.replace(/\\/g,"/")},A=L(u),_=c.split(/\n/),g=0;g<_.length;g++){var e=_[g].match(/(.*):(\d+):(\d+)\)?$/);if(e){var b=e[1],E=e[2],N=e[3],v=Math.max(b.lastIndexOf(" ")+1,b.lastIndexOf("(")+1);if(b=b.substr(v),b=L(b),b===A){var r={line:parseInt(E,10),col:parseInt(N,10)};return r.line===1&&(r.col-="(function (require, define, __filename, __dirname) { ".length),r}}}throw new Error("Could not correlate define call site for needle "+u)},m.prototype.getBuildInfo=function(){if(!this._config.isBuild())return null;for(var u=[],c=0,L=0,A=this._modules2.length;L<A;L++){var _=this._modules2[L];if(!!_){var g=this._buildInfoPath[_.id]||null,e=this._buildInfoDefineStack[_.id]||null,b=this._buildInfoDependencies[_.id];u[c++]={id:_.strId,path:g,defineLocation:g&&e?m._findRelevantLocationInStack(g,e):null,dependencies:b,shim:null,exports:_.exports}}}return u},m.prototype.getRecorder=function(){return this._recorder||(this._config.shouldRecordStats()?this._recorder=new k.LoaderEventRecorder(this._loaderAvailableTimestamp):this._recorder=k.NullLoaderEventRecorder.INSTANCE),this._recorder},m.prototype.getLoaderEvents=function(){return this.getRecorder().getEvents()},m.prototype.enqueueDefineAnonymousModule=function(u,c){if(this._currentAnonymousDefineCall!==null)throw new Error("Can only have one anonymous define call per script file");var L=null;this._config.isBuild()&&(L=new Error("StackLocation").stack||null),this._currentAnonymousDefineCall={stack:L,dependencies:u,callback:c}},m.prototype.defineModule=function(u,c,L,A,_,g){var e=this;g===void 0&&(g=new t(u));var b=this._moduleIdProvider.getModuleId(u);if(this._modules2[b]){this._config.isDuplicateMessageIgnoredFor(u)||console.warn("Duplicate definition of module '"+u+"'");return}var E=new D(b,u,this._normalizeDependencies(c,g),L,A,g);this._modules2[b]=E,this._config.isBuild()&&(this._buildInfoDefineStack[b]=_,this._buildInfoDependencies[b]=(E.dependencies||[]).map(function(N){return e._moduleIdProvider.getStrModuleId(N.id)})),this._resolve(E)},m.prototype._normalizeDependency=function(u,c){if(u==="exports")return F.EXPORTS;if(u==="module")return F.MODULE;if(u==="require")return F.REQUIRE;var L=u.indexOf("!");if(L>=0){var A=c.resolveModule(u.substr(0,L)),_=c.resolveModule(u.substr(L+1)),g=this._moduleIdProvider.getModuleId(A+"!"+_),e=this._moduleIdProvider.getModuleId(A);return new o(g,e,_)}return new F(this._moduleIdProvider.getModuleId(c.resolveModule(u)))},m.prototype._normalizeDependencies=function(u,c){for(var L=[],A=0,_=0,g=u.length;_<g;_++)L[A++]=this._normalizeDependency(u[_],c);return L},m.prototype._relativeRequire=function(u,c,L,A){if(typeof c=="string")return this.synchronousRequire(c,u);this.defineModule(k.Utilities.generateAnonymousModule(),c,L,A,null,u)},m.prototype.synchronousRequire=function(u,c){c===void 0&&(c=new t(u));var L=this._normalizeDependency(u,c),A=this._modules2[L.id];if(!A)throw new Error("Check dependency list! Synchronous require cannot resolve module '"+u+"'. This is the first mention of this module!");if(!A.isComplete())throw new Error("Check dependency list! Synchronous require cannot resolve module '"+u+"'. This module has not been resolved completely yet.");if(A.error)throw A.error;return A.exports},m.prototype.configure=function(u,c){var L=this._config.shouldRecordStats();c?this._config=new k.Configuration(this._env,u):this._config=this._config.cloneAndMerge(u),this._config.shouldRecordStats()&&!L&&(this._recorder=null)},m.prototype.getConfig=function(){return this._config},m.prototype._onLoad=function(u){if(this._currentAnonymousDefineCall!==null){var c=this._currentAnonymousDefineCall;this._currentAnonymousDefineCall=null,this.defineModule(this._moduleIdProvider.getStrModuleId(u),c.dependencies,c.callback,null,c.stack)}},m.prototype._createLoadError=function(u,c){var L=this,A=this._moduleIdProvider.getStrModuleId(u),_=(this._inverseDependencies2[u]||[]).map(function(e){return L._moduleIdProvider.getStrModuleId(e)}),g=k.ensureError(c);return g.phase="loading",g.moduleId=A,g.neededBy=_,g},m.prototype._onLoadError=function(u,c){var L=this._createLoadError(u,c);this._modules2[u]||(this._modules2[u]=new D(u,this._moduleIdProvider.getStrModuleId(u),[],function(){},null,null));for(var A=[],_=0,g=this._moduleIdProvider.getMaxModuleId();_<g;_++)A[_]=!1;var e=!1,b=[];for(b.push(u),A[u]=!0;b.length>0;){var E=b.shift(),N=this._modules2[E];N&&(e=N.onDependencyError(L)||e);var v=this._inverseDependencies2[E];if(v)for(var _=0,g=v.length;_<g;_++){var r=v[_];A[r]||(b.push(r),A[r]=!0)}}e||this._config.onError(L)},m.prototype._hasDependencyPath=function(u,c){var L=this._modules2[u];if(!L)return!1;for(var A=[],_=0,g=this._moduleIdProvider.getMaxModuleId();_<g;_++)A[_]=!1;var e=[];for(e.push(L),A[u]=!0;e.length>0;){var b=e.shift(),E=b.dependencies;if(E)for(var _=0,g=E.length;_<g;_++){var N=E[_];if(N.id===c)return!0;var v=this._modules2[N.id];v&&!A[N.id]&&(A[N.id]=!0,e.push(v))}}return!1},m.prototype._findCyclePath=function(u,c,L){if(u===c||L===50)return[u];var A=this._modules2[u];if(!A)return null;var _=A.dependencies;if(_)for(var g=0,e=_.length;g<e;g++){var b=this._findCyclePath(_[g].id,c,L+1);if(b!==null)return b.push(u),b}return null},m.prototype._createRequire=function(u){var c=this,L=function(A,_,g){return c._relativeRequire(u,A,_,g)};return L.toUrl=function(A){return c._config.requireToUrl(u.resolveModule(A))},L.getStats=function(){return c.getLoaderEvents()},L.hasDependencyCycle=function(){return c._hasDependencyCycle},L.config=function(A,_){_===void 0&&(_=!1),c.configure(A,_)},L.__$__nodeRequire=k.global.nodeRequire,L},m.prototype._loadModule=function(u){var c=this;if(!(this._modules2[u]||this._knownModules2[u])){this._knownModules2[u]=!0;var L=this._moduleIdProvider.getStrModuleId(u),A=this._config.moduleIdToPaths(L),_=/^@[^\/]+\/[^\/]+$/;this._env.isNode&&(L.indexOf("/")===-1||_.test(L))&&A.push("node|"+L);var g=-1,e=function(b){if(g++,g>=A.length)c._onLoadError(u,b);else{var E=A[g],N=c.getRecorder();if(c._config.isBuild()&&E==="empty:"){c._buildInfoPath[u]=E,c.defineModule(c._moduleIdProvider.getStrModuleId(u),[],null,null,null),c._onLoad(u);return}N.record(10,E),c._scriptLoader.load(c,E,function(){c._config.isBuild()&&(c._buildInfoPath[u]=E),N.record(11,E),c._onLoad(u)},function(v){N.record(12,E),e(v)})}};e(null)}},m.prototype._loadPluginDependency=function(u,c){var L=this;if(!(this._modules2[c.id]||this._knownModules2[c.id])){this._knownModules2[c.id]=!0;var A=function(_){L.defineModule(L._moduleIdProvider.getStrModuleId(c.id),[],_,null,null)};A.error=function(_){L._config.onError(L._createLoadError(c.id,_))},u.load(c.pluginParam,this._createRequire(t.ROOT),A,this._config.getOptionsLiteral())}},m.prototype._resolve=function(u){var c=this,L=u.dependencies;if(L)for(var A=0,_=L.length;A<_;A++){var g=L[A];if(g===F.EXPORTS){u.exportsPassedIn=!0,u.unresolvedDependenciesCount--;continue}if(g===F.MODULE){u.unresolvedDependenciesCount--;continue}if(g===F.REQUIRE){u.unresolvedDependenciesCount--;continue}var e=this._modules2[g.id];if(e&&e.isComplete()){if(e.error){u.onDependencyError(e.error);return}u.unresolvedDependenciesCount--;continue}if(this._hasDependencyPath(g.id,u.id)){this._hasDependencyCycle=!0,console.warn("There is a dependency cycle between '"+this._moduleIdProvider.getStrModuleId(g.id)+"' and '"+this._moduleIdProvider.getStrModuleId(u.id)+"'. The cyclic path follows:");var b=this._findCyclePath(g.id,u.id,0)||[];b.reverse(),b.push(g.id),console.warn(b.map(function(v){return c._moduleIdProvider.getStrModuleId(v)}).join(` =>
`)),u.unresolvedDependenciesCount--;continue}if(this._inverseDependencies2[g.id]=this._inverseDependencies2[g.id]||[],this._inverseDependencies2[g.id].push(u.id),g instanceof o){var E=this._modules2[g.pluginId];if(E&&E.isComplete()){this._loadPluginDependency(E.exports,g);continue}var N=this._inversePluginDependencies2.get(g.pluginId);N||(N=[],this._inversePluginDependencies2.set(g.pluginId,N)),N.push(g),this._loadModule(g.pluginId);continue}this._loadModule(g.id)}u.unresolvedDependenciesCount===0&&this._onModuleComplete(u)},m.prototype._onModuleComplete=function(u){var c=this,L=this.getRecorder();if(!u.isComplete()){var A=u.dependencies,_=[];if(A)for(var g=0,e=A.length;g<e;g++){var b=A[g];if(b===F.EXPORTS){_[g]=u.exports;continue}if(b===F.MODULE){_[g]={id:u.strId,config:function(){return c._config.getConfigForModule(u.strId)}};continue}if(b===F.REQUIRE){_[g]=this._createRequire(u.moduleIdResolver);continue}var E=this._modules2[b.id];if(E){_[g]=E.exports;continue}_[g]=null}u.complete(L,this._config,_);var N=this._inverseDependencies2[u.id];if(this._inverseDependencies2[u.id]=null,N)for(var g=0,e=N.length;g<e;g++){var v=N[g],r=this._modules2[v];r.unresolvedDependenciesCount--,r.unresolvedDependenciesCount===0&&this._onModuleComplete(r)}var i=this._inversePluginDependencies2.get(u.id);if(i){this._inversePluginDependencies2.delete(u.id);for(var g=0,e=i.length;g<e;g++)this._loadPluginDependency(u.exports,i[g])}}},m}();k.ModuleManager=M})(oe||(oe={}));var J,oe;(function(k){var t=new k.Environment,D=null,S=function(m,u,c){typeof m!="string"&&(c=u,u=m,m=null),(typeof u!="object"||!Array.isArray(u))&&(c=u,u=null),u||(u=["require","exports","module"]),m?D.defineModule(m,u,c,null,null):D.enqueueDefineAnonymousModule(u,c)};S.amd={jQuery:!0};var F=function(m,u){u===void 0&&(u=!1),D.configure(m,u)},o=function(){if(arguments.length===1){if(arguments[0]instanceof Object&&!Array.isArray(arguments[0])){F(arguments[0]);return}if(typeof arguments[0]=="string")return D.synchronousRequire(arguments[0])}if((arguments.length===2||arguments.length===3)&&Array.isArray(arguments[0])){D.defineModule(k.Utilities.generateAnonymousModule(),arguments[0],arguments[1],arguments[2],null);return}throw new Error("Unrecognized require call")};o.config=F,o.getConfig=function(){return D.getConfig().getOptionsLiteral()},o.reset=function(){D=D.reset()},o.getBuildInfo=function(){return D.getBuildInfo()},o.getStats=function(){return D.getLoaderEvents()},o.define=S;function M(){if(typeof k.global.require!="undefined"||typeof require!="undefined"){var m=k.global.require||require;if(typeof m=="function"&&typeof m.resolve=="function"){var u=k.ensureRecordedNodeRequire(D.getRecorder(),m);k.global.nodeRequire=u,o.nodeRequire=u,o.__$__nodeRequire=u}}t.isNode&&!t.isElectronRenderer&&!t.isElectronNodeIntegrationWebWorker?(module.exports=o,require=o):(t.isElectronRenderer||(k.global.define=S),k.global.require=o)}k.init=M,(typeof k.global.define!="function"||!k.global.define.amd)&&(D=new k.ModuleManager(t,k.createScriptLoader(t),S,o,k.Utilities.getHighPerformanceTimestamp()),typeof k.global.require!="undefined"&&typeof k.global.require!="function"&&o.config(k.global.require),J=function(){return S.apply(null,arguments)},J.amd=S.amd,typeof doNotInitLoader=="undefined"&&M())})(oe||(oe={}));var De=this,Ae;(function(k){var t=De||{},D=t.Plugin&&t.Plugin.Resources?t.Plugin.Resources:void 0,S=t&&t.document&&t.document.location&&t.document.location.hash.indexOf("pseudo=true")>=0;function F(c,L){var A;return L.length===0?A=c:A=c.replace(/\{(\d+)\}/g,function(_,g){var e=g[0];return typeof L[e]!="undefined"?L[e]:_}),S&&(A="\uFF3B"+A.replace(/[aouei]/g,"$&$&")+"\uFF3D"),A}function o(c,L){var A=c[L];return A||(A=c["*"],A)?A:null}function M(c,L){for(var A=[],_=0;_<arguments.length-2;_++)A[_]=arguments[_+2];return F(L,A)}function m(c){return function(L,A){var _=Array.prototype.slice.call(arguments,2);return F(c[L],_)}}var u=function(){function c(){this.localize=M}return c.prototype.setPseudoTranslation=function(L){S=L},c.prototype.create=function(L,A){return{localize:m(A[L])}},c.prototype.load=function(L,A,_,g){if(g=g||{},!L||L.length===0)_({localize:M});else{var e=void 0;if(D&&D.getString)e=".nls.keys",A([L+e],function(N){_({localize:function(v,r){if(!N[v])return"NLS error: unknown key "+v;var i=N[v].keys;if(r>=i.length)return"NLS error unknown index "+r;var s=i[r],a=[];a[0]=v+"_"+s;for(var d=0;d<arguments.length-2;d++)a[d+1]=arguments[d+2];return D.getString.apply(D,a)}})});else if(g.isBuild)A([L+".nls",L+".nls.keys"],function(N,v){c.BUILD_MAP[L]=N,c.BUILD_MAP_KEYS[L]=v,_(N)});else{var b=g["vs/nls"]||{},E=b.availableLanguages?o(b.availableLanguages,L):null;e=".nls",E!==null&&E!==c.DEFAULT_TAG&&(e=e+"."+E),A([L+e],function(N){Array.isArray(N)?N.localize=m(N):N.localize=m(N[L]),_(N)})}}},c.prototype._getEntryPointsMap=function(){return t.nlsPluginEntryPoints=t.nlsPluginEntryPoints||{},t.nlsPluginEntryPoints},c.prototype.write=function(L,A,_){var g=_.getEntryPoint(),e=this._getEntryPointsMap();e[g]=e[g]||[],e[g].push(A),A!==g&&_.asModule(L+"!"+A,"define(['vs/nls', 'vs/nls!"+g+`'], function(nls, data) { return nls.create("`+A+'", data); });')},c.prototype.writeFile=function(L,A,_,g,e){var b=this._getEntryPointsMap();if(b.hasOwnProperty(A)){for(var E=_.toUrl(A+".nls.js"),N=["/*---------------------------------------------------------"," * Copyright (c) Microsoft Corporation. All rights reserved."," *--------------------------------------------------------*/"],v=b[A],r={},i=0;i<v.length;i++)r[v[i]]=c.BUILD_MAP[v[i]];N.push('define("'+A+'.nls", '+JSON.stringify(r,null," ")+");"),g(E,N.join(`\r
`))}},c.prototype.finishBuild=function(L){L("nls.metadata.json",JSON.stringify({keys:c.BUILD_MAP_KEYS,messages:c.BUILD_MAP,bundles:this._getEntryPointsMap()},null," "))},c.DEFAULT_TAG="i-default",c.BUILD_MAP={},c.BUILD_MAP_KEYS={},c}();k.NLSPlugin=u,function(){J("vs/nls",new u)}()})(Ae||(Ae={})),J(x[16],ee([0,1]),function(k,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiffChange=void 0;class D{constructor(F,o,M,m){this.originalStart=F,this.originalLength=o,this.modifiedStart=M,this.modifiedLength=m}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}t.DiffChange=D}),J(x[6],ee([0,1]),function(k,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createErrorWithActions=t.isErrorWithActions=t.ExpectedError=t.NotSupportedError=t.NotImplementedError=t.getErrorMessage=t.disposed=t.readonly=t.illegalState=t.illegalArgument=t.canceled=t.CancellationError=t.isPromiseCanceledError=t.transformErrorForSerialization=t.onUnexpectedExternalError=t.onUnexpectedError=t.setUnexpectedErrorHandler=t.errorHandler=t.ErrorHandler=void 0;class D{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(a){setTimeout(()=>{throw a.stack?new Error(a.message+`
`+a.stack):a},0)}}addListener(a){return this.listeners.push(a),()=>{this._removeListener(a)}}emit(a){this.listeners.forEach(d=>{d(a)})}_removeListener(a){this.listeners.splice(this.listeners.indexOf(a),1)}setUnexpectedErrorHandler(a){this.unexpectedErrorHandler=a}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(a){this.unexpectedErrorHandler(a),this.emit(a)}onUnexpectedExternalError(a){this.unexpectedErrorHandler(a)}}t.ErrorHandler=D,t.errorHandler=new D;function S(s){t.errorHandler.setUnexpectedErrorHandler(s)}t.setUnexpectedErrorHandler=S;function F(s){u(s)||t.errorHandler.onUnexpectedError(s)}t.onUnexpectedError=F;function o(s){u(s)||t.errorHandler.onUnexpectedExternalError(s)}t.onUnexpectedExternalError=o;function M(s){if(s instanceof Error){let{name:a,message:d}=s;const h=s.stacktrace||s.stack;return{$isError:!0,name:a,message:d,stack:h}}return s}t.transformErrorForSerialization=M;const m="Canceled";function u(s){return s instanceof Error&&s.name===m&&s.message===m}t.isPromiseCanceledError=u;class c extends Error{constructor(){super(m);this.name=this.message}}t.CancellationError=c;function L(){const s=new Error(m);return s.name=s.message,s}t.canceled=L;function A(s){return s?new Error(`Illegal argument: ${s}`):new Error("Illegal argument")}t.illegalArgument=A;function _(s){return s?new Error(`Illegal state: ${s}`):new Error("Illegal state")}t.illegalState=_;function g(s){return s?new Error(`readonly property '${s} cannot be changed'`):new Error("readonly property cannot be changed")}t.readonly=g;function e(s){const a=new Error(`${s} has been disposed`);return a.name="DISPOSED",a}t.disposed=e;function b(s){return s?s.message?s.message:s.stack?s.stack.split(`
`)[0]:String(s):"Error"}t.getErrorMessage=b;class E extends Error{constructor(a){super("NotImplemented");a&&(this.message=a)}}t.NotImplementedError=E;class N extends Error{constructor(a){super("NotSupported");a&&(this.message=a)}}t.NotSupportedError=N;class v extends Error{constructor(){super(...arguments);this.isExpected=!0}}t.ExpectedError=v;function r(s){const a=s;return a instanceof Error&&Array.isArray(a.actions)}t.isErrorWithActions=r;function i(s,a=Object.create(null)){const d=new Error(s);return a.actions&&(d.actions=a.actions),d}t.createErrorWithActions=i}),J(x[17],ee([0,1,6]),function(k,t,D){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayQueue=t.maxIndex=t.minIndex=t.splice=t.insertInto=t.mapFind=t.getRandomElement=t.asArray=t.mapArrayOrNot=t.pushToEnd=t.pushToStart=t.shuffle=t.arrayInsert=t.remove=t.insert=t.index=t.range=t.flatten=t.commonPrefixLength=t.firstOrDefault=t.lastIndex=t.findLast=t.uniqueFilter=t.distinct=t.isNonEmptyArray=t.isFalsyOrEmpty=t.move=t.coalesceInPlace=t.coalesce=t.topAsync=t.top=t.delta=t.sortedDiff=t.groupBy=t.quickSelect=t.findFirstInSorted=t.binarySearch=t.equals=t.tail2=t.tail=void 0;function S(T,C=0){return T[T.length-(1+C)]}t.tail=S;function F(T){if(T.length===0)throw new Error("Invalid tail call");return[T.slice(0,T.length-1),T[T.length-1]]}t.tail2=F;function o(T,C,O=(W,H)=>W===H){if(T===C)return!0;if(!T||!C||T.length!==C.length)return!1;for(let W=0,H=T.length;W<H;W++)if(!O(T[W],C[W]))return!1;return!0}t.equals=o;function M(T,C,O){let W=0,H=T.length-1;for(;W<=H;){const te=(W+H)/2|0,K=O(T[te],C);if(K<0)W=te+1;else if(K>0)H=te-1;else return te}return-(W+1)}t.binarySearch=M;function m(T,C){let O=0,W=T.length;if(W===0)return 0;for(;O<W;){const H=Math.floor((O+W)/2);C(T[H])?W=H:O=H+1}return O}t.findFirstInSorted=m;function u(T,C,O){if(T=T|0,T>=C.length)throw new TypeError("invalid index");let W=C[Math.floor(C.length*Math.random())],H=[],te=[],K=[];for(let ce of C){const he=O(ce,W);he<0?H.push(ce):he>0?te.push(ce):K.push(ce)}return T<H.length?u(T,H,O):T<H.length+K.length?K[0]:u(T-(H.length+K.length),te,O)}t.quickSelect=u;function c(T,C){const O=[];let W;for(const H of T.slice(0).sort(C))!W||C(W[0],H)!==0?(W=[H],O.push(W)):W.push(H);return O}t.groupBy=c;function L(T,C,O){const W=[];function H(ce,he,de){if(he===0&&de.length===0)return;const me=W[W.length-1];me&&me.start+me.deleteCount===ce?(me.deleteCount+=he,me.toInsert.push(...de)):W.push({start:ce,deleteCount:he,toInsert:de})}let te=0,K=0;for(;;){if(te===T.length){H(te,0,C.slice(K));break}if(K===C.length){H(te,T.length-te,[]);break}const ce=T[te],he=C[K],de=O(ce,he);de===0?(te+=1,K+=1):de<0?(H(te,1,[]),te+=1):de>0&&(H(te,0,[he]),K+=1)}return W}t.sortedDiff=L;function A(T,C,O){const W=L(T,C,O),H=[],te=[];for(const K of W)H.push(...T.slice(K.start,K.start+K.deleteCount)),te.push(...K.toInsert);return{removed:H,added:te}}t.delta=A;function _(T,C,O){if(O===0)return[];const W=T.slice(0,O).sort(C);return e(T,C,W,O,T.length),W}t.top=_;function g(T,C,O,W,H){return O===0?Promise.resolve([]):new Promise((te,K)=>{(async()=>{const ce=T.length,he=T.slice(0,O).sort(C);for(let de=O,me=Math.min(O+W,ce);de<ce;de=me,me=Math.min(me+W,ce)){if(de>O&&await new Promise(we=>setTimeout(we)),H&&H.isCancellationRequested)throw(0,D.canceled)();e(T,C,he,de,me)}return he})().then(te,K)})}t.topAsync=g;function e(T,C,O,W,H){for(const te=O.length;W<H;W++){const K=T[W];if(C(K,O[te-1])<0){O.pop();const ce=m(O,he=>C(K,he)<0);O.splice(ce,0,K)}}}function b(T){return T.filter(C=>!!C)}t.coalesce=b;function E(T){let C=0;for(let O=0;O<T.length;O++)T[O]&&(T[C]=T[O],C+=1);T.length=C}t.coalesceInPlace=E;function N(T,C,O){T.splice(O,0,T.splice(C,1)[0])}t.move=N;function v(T){return!Array.isArray(T)||T.length===0}t.isFalsyOrEmpty=v;function r(T){return Array.isArray(T)&&T.length>0}t.isNonEmptyArray=r;function i(T,C=O=>O){const O=new Set;return T.filter(W=>{const H=C(W);return O.has(H)?!1:(O.add(H),!0)})}t.distinct=i;function s(T){const C=Object.create(null);return O=>{const W=T(O);return C[W]?!1:(C[W]=!0,!0)}}t.uniqueFilter=s;function a(T,C){const O=d(T,C);if(O!==-1)return T[O]}t.findLast=a;function d(T,C){for(let O=T.length-1;O>=0;O--){const W=T[O];if(C(W))return O}return-1}t.lastIndex=d;function h(T,C){return T.length>0?T[0]:C}t.firstOrDefault=h;function f(T,C,O=(W,H)=>W===H){let W=0;for(let H=0,te=Math.min(T.length,C.length);H<te&&O(T[H],C[H]);H++)W++;return W}t.commonPrefixLength=f;function l(T){return[].concat(...T)}t.flatten=l;function w(T,C){let O=typeof C=="number"?T:0;typeof C=="number"?O=T:(O=0,C=T);const W=[];if(O<=C)for(let H=O;H<C;H++)W.push(H);else for(let H=O;H>C;H--)W.push(H);return W}t.range=w;function P(T,C,O){return T.reduce((W,H)=>(W[C(H)]=O?O(H):H,W),Object.create(null))}t.index=P;function R(T,C){return T.push(C),()=>I(T,C)}t.insert=R;function I(T,C){const O=T.indexOf(C);if(O>-1)return T.splice(O,1),C}t.remove=I;function U(T,C,O){const W=T.slice(0,C),H=T.slice(C);return W.concat(O,H)}t.arrayInsert=U;function q(T,C){let O;if(typeof C=="number"){let W=C;O=()=>{const H=Math.sin(W++)*179426549;return H-Math.floor(H)}}else O=Math.random;for(let W=T.length-1;W>0;W-=1){const H=Math.floor(O()*(W+1)),te=T[W];T[W]=T[H],T[H]=te}}t.shuffle=q;function j(T,C){const O=T.indexOf(C);O>-1&&(T.splice(O,1),T.unshift(C))}t.pushToStart=j;function G(T,C){const O=T.indexOf(C);O>-1&&(T.splice(O,1),T.push(C))}t.pushToEnd=G;function Y(T,C){return Array.isArray(T)?T.map(C):C(T)}t.mapArrayOrNot=Y;function se(T){return Array.isArray(T)?T:[T]}t.asArray=se;function n(T){return T[Math.floor(Math.random()*T.length)]}t.getRandomElement=n;function $(T,C){for(const O of T){const W=C(O);if(W!==void 0)return W}}t.mapFind=$;function V(T,C,O){const W=Z(T,C),H=T.length,te=O.length;T.length=H+te;for(let K=H-1;K>=W;K--)T[K+te]=T[K];for(let K=0;K<te;K++)T[K+W]=O[K]}t.insertInto=V;function X(T,C,O,W){const H=Z(T,C),te=T.splice(H,O);return V(T,H,W),te}t.splice=X;function Z(T,C){return C<0?Math.max(C+T.length,0):Math.min(C,T.length)}function ne(T,C){let O=Number.MAX_SAFE_INTEGER,W=0;return T.forEach((H,te)=>{const K=C(H);K<O&&(O=K,W=te)}),W}t.minIndex=ne;function ie(T,C){let O=Number.MIN_SAFE_INTEGER,W=0;return T.forEach((H,te)=>{const K=C(H);K>O&&(O=K,W=te)}),W}t.maxIndex=ie;class ue{constructor(C){this.items=C,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(C){let O=this.firstIdx;for(;O<this.items.length&&C(this.items[O]);)O++;const W=O===this.firstIdx?null:this.items.slice(this.firstIdx,O);return this.firstIdx=O,W}takeFromEndWhile(C){let O=this.lastIdx;for(;O>=0&&C(this.items[O]);)O--;const W=O===this.lastIdx?null:this.items.slice(O+1,this.lastIdx+1);return this.lastIdx=O,W}peek(){return this.items[this.firstIdx]}dequeue(){const C=this.items[this.firstIdx];return this.firstIdx++,C}takeCount(C){const O=this.items.slice(this.firstIdx,this.firstIdx+C);return this.firstIdx+=C,O}}t.ArrayQueue=ue}),J(x[9],ee([0,1]),function(k,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.once=void 0;function D(S){const F=this;let o=!1,M;return function(){return o||(o=!0,M=S.apply(F,arguments)),M}}t.once=D}),J(x[18],ee([0,1]),function(k,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Iterable=void 0;var D;(function(S){function F(s){return s&&typeof s=="object"&&typeof s[Symbol.iterator]=="function"}S.is=F;const o=Object.freeze([]);function M(){return o}S.empty=M;function*m(s){yield s}S.single=m;function u(s){return s||o}S.from=u;function c(s){return!s||s[Symbol.iterator]().next().done===!0}S.isEmpty=c;function L(s){return s[Symbol.iterator]().next().value}S.first=L;function A(s,a){for(const d of s)if(a(d))return!0;return!1}S.some=A;function _(s,a){for(const d of s)if(a(d))return d}S.find=_;function*g(s,a){for(const d of s)a(d)&&(yield d)}S.filter=g;function*e(s,a){let d=0;for(const h of s)yield a(h,d++)}S.map=e;function*b(...s){for(const a of s)for(const d of a)yield d}S.concat=b;function*E(s){for(const a of s)for(const d of a)yield d}S.concatNested=E;function N(s,a,d){let h=d;for(const f of s)h=a(h,f);return h}S.reduce=N;function*v(s,a,d=s.length){for(a<0&&(a+=s.length),d<0?d+=s.length:d>s.length&&(d=s.length);a<d;a++)yield s[a]}S.slice=v;function r(s,a=Number.POSITIVE_INFINITY){const d=[];if(a===0)return[d,s];const h=s[Symbol.iterator]();for(let f=0;f<a;f++){const l=h.next();if(l.done)return[d,S.empty()];d.push(l.value)}return[d,{[Symbol.iterator](){return h}}]}S.consume=r;function i(s,a,d=(h,f)=>h===f){const h=s[Symbol.iterator](),f=a[Symbol.iterator]();for(;;){const l=h.next(),w=f.next();if(l.done!==w.done)return!1;if(l.done)return!0;if(!d(l.value,w.value))return!1}}S.equals=i})(D=t.Iterable||(t.Iterable={}))}),J(x[19],ee([0,1]),function(k,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyChord=t.KeyMod=t.KeyCodeUtils=t.IMMUTABLE_KEY_CODE_TO_CODE=t.IMMUTABLE_CODE_TO_KEY_CODE=t.ScanCodeUtils=t.NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE=t.EVENT_KEY_CODE_MAP=t.ScanCode=t.KeyCode=void 0;var D;(function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e