/*!----------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.23.0(82e8ea39fc101d639262435542c7d43bc20d8aa2) * Released under the MIT license * https://github.com/microsoft/vscode/blob/main/LICENSE.txt *-----------------------------------------------------------*/(function(){var z=["require","exports","vs/base/common/platform","vs/editor/common/core/position","vs/base/common/errors","vs/base/common/strings","vs/editor/common/core/range","vs/base/common/lifecycle","vs/base/common/stopwatch","vs/base/common/event","vs/base/common/diff/diff","vs/base/common/types","vs/base/common/uint","vs/base/common/uri","vs/base/common/arrays","vs/base/common/diff/diffChange","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/editor/common/core/characterClassifier","vs/editor/common/core/selection","vs/editor/common/core/token","vs/editor/common/diff/diffComputer","vs/editor/common/model/wordHelper","vs/editor/common/modes/linkComputer","vs/editor/common/modes/supports/inplaceReplaceSupport","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"],G=function(I){for(var t=[],p=0,P=I.length;p
=0?!0:typeof process!="undefined"?process.platform==="win32":!1},p}();I.Environment=t})(X||(X={}));var X;(function(I){var t=function(){function E(u,d,l){this.type=u,this.detail=d,this.timestamp=l}return E}();I.LoaderEvent=t;var p=function(){function E(u){this._events=[new t(1,"",u)]}return E.prototype.record=function(u,d){this._events.push(new t(u,d,I.Utilities.getHighPerformanceTimestamp()))},E.prototype.getEvents=function(){return this._events},E}();I.LoaderEventRecorder=p;var P=function(){function E(){}return E.prototype.record=function(u,d){},E.prototype.getEvents=function(){return[]},E.INSTANCE=new E,E}();I.NullLoaderEventRecorder=P})(X||(X={}));var X;(function(I){var t=function(){function p(){}return p.fileUriToFilePath=function(P,E){if(E=decodeURI(E).replace(/%23/g,"#"),P){if(/^file:\/\/\//.test(E))return E.substr(8);if(/^file:\/\//.test(E))return E.substr(5)}else if(/^file:\/\//.test(E))return E.substr(7);return E},p.startsWith=function(P,E){return P.length>=E.length&&P.substr(0,E.length)===E},p.endsWith=function(P,E){return P.length>=E.length&&P.substr(P.length-E.length)===E},p.containsQueryString=function(P){return/^[^\#]*\?/gi.test(P)},p.isAbsolutePath=function(P){return/^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(P)},p.forEachProperty=function(P,E){if(P){var u=void 0;for(u in P)P.hasOwnProperty(u)&&E(u,P[u])}},p.isEmpty=function(P){var E=!0;return p.forEachProperty(P,function(){E=!1}),E},p.recursiveClone=function(P){if(!P||typeof P!="object"||P instanceof RegExp||!Array.isArray(P)&&Object.getPrototypeOf(P)!==Object.prototype)return P;var E=Array.isArray(P)?[]:{};return p.forEachProperty(P,function(u,d){d&&typeof d=="object"?E[u]=p.recursiveClone(d):E[u]=d}),E},p.generateAnonymousModule=function(){return"===anonymous"+p.NEXT_ANONYMOUS_ID+++"==="},p.isAnonymousModule=function(P){return p.startsWith(P,"===anonymous")},p.getHighPerformanceTimestamp=function(){return this.PERFORMANCE_NOW_PROBED||(this.PERFORMANCE_NOW_PROBED=!0,this.HAS_PERFORMANCE_NOW=I.global.performance&&typeof I.global.performance.now=="function"),this.HAS_PERFORMANCE_NOW?I.global.performance.now():Date.now()},p.NEXT_ANONYMOUS_ID=1,p.PERFORMANCE_NOW_PROBED=!1,p.HAS_PERFORMANCE_NOW=!1,p}();I.Utilities=t})(X||(X={}));var X;(function(I){function t(E){if(E instanceof Error)return E;var u=new Error(E.message||String(E)||"Unknown Error");return E.stack&&(u.stack=E.stack),u}I.ensureError=t;var p=function(){function E(){}return E.validateConfigurationOptions=function(u){function d(s){if(s.phase==="loading"){console.error('Loading "'+s.moduleId+'" failed'),console.error(s),console.error("Here are the modules that depend on it:"),console.error(s.neededBy);return}if(s.phase==="factory"){console.error('The factory method of "'+s.moduleId+'" has thrown an exception'),console.error(s);return}}if(u=u||{},typeof u.baseUrl!="string"&&(u.baseUrl=""),typeof u.isBuild!="boolean"&&(u.isBuild=!1),typeof u.paths!="object"&&(u.paths={}),typeof u.config!="object"&&(u.config={}),typeof u.catchError=="undefined"&&(u.catchError=!1),typeof u.recordStats=="undefined"&&(u.recordStats=!1),typeof u.urlArgs!="string"&&(u.urlArgs=""),typeof u.onError!="function"&&(u.onError=d),Array.isArray(u.ignoreDuplicateModules)||(u.ignoreDuplicateModules=[]),u.baseUrl.length>0&&(I.Utilities.endsWith(u.baseUrl,"/")||(u.baseUrl+="/")),typeof u.cspNonce!="string"&&(u.cspNonce=""),typeof u.preferScriptTags=="undefined"&&(u.preferScriptTags=!1),Array.isArray(u.nodeModules)||(u.nodeModules=[]),u.nodeCachedData&&typeof u.nodeCachedData=="object"&&(typeof u.nodeCachedData.seed!="string"&&(u.nodeCachedData.seed="seed"),(typeof u.nodeCachedData.writeDelay!="number"||u.nodeCachedData.writeDelay<0)&&(u.nodeCachedData.writeDelay=1e3*7),!u.nodeCachedData.path||typeof u.nodeCachedData.path!="string")){var l=t(new Error("INVALID cached data configuration, 'path' MUST be set"));l.phase="configuration",u.onError(l),u.nodeCachedData=void 0}return u},E.mergeConfigurationOptions=function(u,d){u===void 0&&(u=null),d===void 0&&(d=null);var l=I.Utilities.recursiveClone(d||{});return I.Utilities.forEachProperty(u,function(s,h){s==="ignoreDuplicateModules"&&typeof l.ignoreDuplicateModules!="undefined"?l.ignoreDuplicateModules=l.ignoreDuplicateModules.concat(h):s==="paths"&&typeof l.paths!="undefined"?I.Utilities.forEachProperty(h,function(w,a){return l.paths[w]=a}):s==="config"&&typeof l.config!="undefined"?I.Utilities.forEachProperty(h,function(w,a){return l.config[w]=a}):l[s]=I.Utilities.recursiveClone(h)}),E.validateConfigurationOptions(l)},E}();I.ConfigurationOptionsUtil=p;var P=function(){function E(u,d){if(this._env=u,this.options=p.mergeConfigurationOptions(d),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 l=this.options.nodeRequire.main.filename,s=Math.max(l.lastIndexOf("/"),l.lastIndexOf("\\"));this.options.baseUrl=l.substring(0,s+1)}if(this.options.nodeMain&&this._env.isNode){var l=this.options.nodeMain,s=Math.max(l.lastIndexOf("/"),l.lastIndexOf("\\"));this.options.baseUrl=l.substring(0,s+1)}}}return E.prototype._createIgnoreDuplicateModulesMap=function(){this.ignoreDuplicateModulesMap={};for(var u=0;u
`)),s.unresolvedDependenciesCount--;continue}if(this._inverseDependencies2[v.id]=this._inverseDependencies2[v.id]||[],this._inverseDependencies2[v.id].push(s.id),v instanceof u){var r=this._modules2[v.pluginId];if(r&&r.isComplete()){this._loadPluginDependency(r.exports,v);continue}var m=this._inversePluginDependencies2.get(v.pluginId);m||(m=[],this._inversePluginDependencies2.set(v.pluginId,m)),m.push(v),this._loadModule(v.pluginId);continue}this._loadModule(v.id)}s.unresolvedDependenciesCount===0&&this._onModuleComplete(s)},l.prototype._onModuleComplete=function(s){var h=this,w=this.getRecorder();if(!s.isComplete()){var a=s.dependencies,S=[];if(a)for(var v=0,C=a.length;vte)return 1}const J=q-W,x=Y-j;return J
x?1:0}t.compareSubstringIgnoreCase=b;function N(y){return y>=97&&y<=122}t.isLowerAsciiLetter=N;function c(y){return y>=65&&y<=90}t.isUpperAsciiLetter=c;function g(y){return N(y)||c(y)}function L(y,U){return y.length===U.length&&A(y,U)}t.equalsIgnoreCase=L;function A(y,U,W=y.length){for(let q=0;q
1){const q=y.charCodeAt(U-2);if(T(q))return k(q,W)}return W}function e(y,U){const W=ee.getInstance(),q=U,j=y.length,Y=F(y,j,U);U+=Y>=65536?2:1;let J=W.getGraphemeBreakType(Y);for(;U
this._lines.length)f=this._lines.length,b=this._lines[f-1].length+1,N=!0;else{let c=this._lines[f-1].length+1;b<1?(b=1,N=!0):b>c&&(b=c,N=!0)}return N?{lineNumber:f,column:b}:i}}class m{constructor(i,f){this._host=i,this._models=Object.create(null),this._foreignModuleFactory=f,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(i){return this._models[i]}_getModels(){let i=[];return Object.keys(this._models).forEach(f=>i.push(this._models[f])),i}acceptNewModel(i){this._models[i.url]=new r(u.URI.parse(i.url),i.lines,i.EOL,i.versionId)}acceptModelChanged(i,f){!this._models[i]||this._models[i].onEvents(f)}acceptRemovedModel(i){!this._models[i]||delete this._models[i]}computeDiff(i,f,b,N){return ne(this,void 0,void 0,function*(){const c=this._getModel(i),g=this._getModel(f);if(!c||!g)return null;const L=c.getLinesContent(),A=g.getLinesContent(),R=new s.DiffComputer(L,A,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:b,shouldMakePrettyDiff:!0,maxComputationTime:N}).computeDiff(),D=R.changes.length>0?!1:this._modelsAreIdentical(c,g);return{quitEarly:R.quitEarly,identical:D,changes:R.changes}})}_modelsAreIdentical(i,f){const b=i.getLineCount(),N=f.getLineCount();if(b!==N)return!1;for(let c=1;c<=b;c++){const g=i.getLineContent(c),L=f.getLineContent(c);if(g!==L)return!1}return!0}computeMoreMinimalEdits(i,f){return ne(this,void 0,void 0,function*(){const b=this._getModel(i);if(!b)return f;const N=[];let c;f=p.mergeSort(f,(g,L)=>{if(g.range&&L.range)return l.Range.compareRangesUsingStarts(g.range,L.range);let A=g.range?0:1,M=L.range?0:1;return A-M});for(let{range:g,text:L,eol:A}of f)if(typeof A=="number"&&(c=A),!(l.Range.isEmpty(g)&&!L)){const M=b.getValueInRange(g);if(L=L.replace(/\r\n|\n|\r/g,b.eol),M!==L){if(Math.max(L.length,M.length)>m._diffLimit){N.push({range:g,text:L});continue}const R=P.stringDiff(M,L,!1),D=b.offsetAt(l.Range.lift(g).getStartPosition());for(const T of R){const $=b.positionAt(D+T.originalStart),k=b.positionAt(D+T.originalStart+T.originalLength),F={text:L.substr(T.modifiedStart,T.modifiedLength),range:{startLineNumber:$.lineNumber,startColumn:$.column,endLineNumber:k.lineNumber,endColumn:k.column}};b.getValueInRange(F.range)!==F.text&&N.push(F)}}}return typeof c=="number"&&N.push({eol:c,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),N})}computeLinks(i){return ne(this,void 0,void 0,function*(){let f=this._getModel(i);return f?a.computeLinks(f):null})}textualSuggest(i,f,b,N){return ne(this,void 0,void 0,function*(){const c=new n.StopWatch(!0),g=new RegExp(b,N),L=new Set;e:for(let A of i){const M=this._getModel(A);if(!!M){for(let R of M.words(g))if(!(R===f||!isNaN(Number(R)))&&(L.add(R),L.size>m._suggestionsLimit))break e}}return{words:Array.from(L),duration:c.elapsed()}})}computeWordRanges(i,f,b,N){return ne(this,void 0,void 0,function*(){let c=this._getModel(i);if(!c)return Object.create(null);const g=new RegExp(b,N),L=Object.create(null);for(let A=f.startLineNumber;A