Files
urbanLifeline/dify/web/public/vs/base/worker/workerMain.js

31 lines
368 KiB
JavaScript
Raw Normal View History

2025-12-01 17:21:38 +08:00
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/(function(){var J=["require","exports","vs/editor/common/core/range","vs/base/common/errors","vs/editor/common/core/position","vs/editor/common/core/offsetRange","vs/base/common/strings","vs/base/common/arrays","vs/base/common/lifecycle","vs/base/common/event","vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm","vs/base/common/platform","vs/base/common/assert","vs/editor/common/core/lineRange","vs/base/common/uri","vs/base/common/arraysFind","vs/editor/common/diff/defaultLinesDiffComputer/utils","vs/editor/common/diff/rangeMapping","vs/base/common/functional","vs/base/common/iterator","vs/base/common/linkedList","vs/base/common/map","vs/base/common/stopwatch","vs/base/common/cancellation","vs/base/common/diff/diff","vs/base/common/types","vs/base/common/codiconsUtil","vs/base/common/objects","vs/base/common/uint","vs/editor/common/core/characterClassifier","vs/editor/common/core/textLength","vs/editor/common/core/wordHelper","vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm","vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence","vs/editor/common/diff/linesDiffComputer","vs/nls.messages","vs/nls","vs/base/common/path","vs/base/common/network","vs/base/common/cache","vs/base/common/color","vs/base/common/diff/diffChange","vs/base/common/keyCodes","vs/base/common/lazy","vs/base/common/hash","vs/base/common/symbols","vs/base/common/codiconsLibrary","vs/base/common/codicons","vs/editor/common/core/selection","vs/editor/common/core/positionToOffset","vs/editor/common/core/textEdit","vs/editor/common/core/wordCharacterClassifier","vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations","vs/editor/common/diff/defaultLinesDiffComputer/lineSequence","vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing","vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines","vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer","vs/editor/common/diff/legacyLinesDiffComputer","vs/editor/common/diff/linesDiffComputers","vs/editor/common/languages/defaultDocumentColorsComputer","vs/editor/common/languages/linkComputer","vs/editor/common/languages/supports/inplaceReplaceSupport","vs/editor/common/model","vs/editor/common/model/prefixSumComputer","vs/editor/common/model/mirrorTextModel","vs/editor/common/model/textModelSearch","vs/editor/common/services/editorWorkerHost","vs/editor/common/services/findSectionHeaders","vs/editor/common/services/unicodeTextModelHighlighter","vs/editor/common/standalone/standaloneEnums","vs/editor/common/tokenizationRegistry","vs/base/common/async","vs/base/common/process","vs/editor/common/languages","vs/editor/common/services/editorBaseApi","vs/editor/common/services/textModelSync/textModelSync.impl","vs/base/common/worker/simpleWorker","vs/editor/common/services/editorSimpleWorker"],Z=function(W){for(var n=[],i=0,x=W.length;i<x;i++)n[i]=J[W[i]];return n};const Re=this,Me=typeof global=="object"?global:{};var ie;(function(W){W.global=Re;class n{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=n._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 W.global.importScripts=="function",this._isElectronNodeIntegrationWebWorker=this._isWebWorker&&typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.electron<"u"&&process.type===
//# sourceURL=${m}`,(r?self.eval(r.createScript("",o)):new Function(o)).call(self),e()}).then(void 0,h);return}try{r&&(m=r.createScriptURL(m)),importScripts(m),e()}catch(o){h(o)}}}}class d{constructor(a){this._env=a,this._didInitialize=!1,this._didPatchNodeRequire=!1}_init(a){this._didInitialize||(this._didInitialize=!0,this._fs=a("fs"),this._vm=a("vm"),this._path=a("path"),this._crypto=a("crypto"))}_initNodeRequire(a,m){const{nodeCachedData:e}=m.getConfig().getOptionsLiteral();if(!e||this._didPatchNodeRequire)return;this._didPatchNodeRequire=!0;const h=this,r=a("module");function s(o){const u=o.constructor;let S=function(N){try{return o.require(N)}finally{}};return S.resolve=function(N,P){return u._resolveFilename(N,o,!1,P)},S.resolve.paths=function(N){return u._resolveLookupPaths(N,o)},S.main=process.mainModule,S.extensions=u._extensions,S.cache=u._cache,S}r.prototype._compile=function(o,u){const S=r.wrap(o.replace(/^#!.*/,"")),L=m.getRecorder(),N=h._getCachedDataPath(e,u),P={filename:u};let E;try{const y=h._fs.readFileSync(N);E=y.slice(0,16),P.cachedData=y.slice(16),L.record(60,N)}catch{L.record(61,N)}const v=new h._vm.Script(S,P),l=v.runInThisContext(P),b=h._path.dirname(u),g=s(this),w=[this.exports,g,this,u,b,process,Me,Buffer],M=l.apply(this.exports,w);return h._handleCachedData(v,S,N,!P.cachedData,m),h._verifyCachedData(v,S,N,E,m),M}}load(a,m,e,h){const r=a.getConfig().getOptionsLiteral(),s=f(a.getRecorder(),r.nodeRequire||W.global.nodeRequire),o=r.nodeInstrumenter||function(S){return S};this._init(s),this._initNodeRequire(s,a);let u=a.getRecorder();if(/^node\|/.test(m)){let S=m.split("|"),L=null;try{L=s(S[1])}catch(N){h(N);return}a.enqueueDefineAnonymousModule([],()=>L),e()}else{m=W.Utilities.fileUriToFilePath(this._env.isWindows,m);const S=this._path.normalize(m),L=this._getElectronRendererScriptPathOrUri(S),N=!!r.nodeCachedData,P=N?this._getCachedDataPath(r.nodeCachedData,m):void 0;this._readSourceAndCachedData(S,P,u,(E,v,l,b)=>{if(E){h(E);return}let g;v.charCodeAt(0)===d._BOM?g=d._PREFIX+v.substring(1)+d._SUFFIX:g=d._PREFIX+v+d._SUFFIX,g=o(g,S);const w={filename:L,cachedData:l},M=this._createAndEvalScript(a,g,w,e,h);this._handleCachedData(M,g,P,N&&!l,a),this._verifyCachedData(M,g,P,b,a)})}}_createAndEvalScript(a,m,e,h,r){const s=a.getRecorder();s.record(31,e.filename);const o=new this._vm.Script(m,e),u=o.runInThisContext(e),S=a.getGlobalAMDDefineFunc();let L=!1;const N=function(){return L=!0,S.apply(null,arguments)};return N.amd=S.amd,u.call(W.global,a.getGlobalAMDRequireFunc(),N,e.filename,this._path.dirname(e.filename)),s.record(32,e.filename),L?h():r(new Error(`Didn't receive define call in ${e.filename}!`)),o}_getElectronRendererScriptPathOrUri(a){if(!this._env.isElectronRenderer)return a;let m=a.match(/^([a-z])\:(.*)/i);return m?`file:///${(m[1].toUpperCase()+":"+m[2]).replace(/\\/g,"/")}`:`file://${a}`}_getCachedDataPath(a,m){const e=this._crypto.createHash("md5").update(m,"utf8").update(a.seed,"utf8").update(process.arch,"").digest("hex"),h=this._path.basename(m).replace(/\.js$/,"");return this._path.join(a.path,`${h}-${e}.code`)}_handleCachedData(a,m,e,h,r){a.cachedDataRejected?this._fs.unlink(e,s=>{r.getRecorder().record(62,e),this._createAndWriteCachedData(a,m,e,r),s&&r.getConfig().onError(s)}):h&&this._createAndWriteCachedData(a,m,e,r)}_createAndWriteCachedData(a,m,e,h){let r=Math.ceil(h.getConfig().getOptionsLiteral().nodeCachedData.writeDelay*(1+Math.random())),s=-1,o=0,u;const S=()=>{setTimeout(()=>{u||(u=this._crypto.createHash("md5").update(m,"utf8").digest());const L=a.createCachedData();if(!(L.length===0||L.length===s||o>=5)){if(L.length<s){S();return}s=L.length,this._fs.writeFile(e,Buffer.concat([u,L]),N=>{N&&h.getConfig().onError(N),h.getRecorder().record(63,e),S()})}},r*Math.pow(4,o++))};S()}_readSourceAndCachedData(a,m,e,h){if(!m)this._fs.readFile(a,{encoding:"utf8"},h);else{let r,s,o,u=2;const S=L=>{L?h(L):--u===0&&h(void 0,r,s,o)};this._fs.readFile(a,{encoding:"utf8"},(L,N)=>{r=N,S(L)}),this._fs.readFile(m,(L,N)=>{!L&&N&&N.length>0?(o=N.slice(0,16),s=N.slice(16),e.record(60,m)):e.recor
});`;function f(c,a){if(a.__$__isRecorded)return a;const m=function(h){c.record(33,h);try{return a(h)}finally{c.record(34,h)}};return m.__$__isRecorded=!0,m}W.ensureRecordedNodeRequire=f;function p(c){return new n(c)}W.createScriptLoader=p})(ie||(ie={}));var ie;(function(W){class n{constructor(c){let a=c.lastIndexOf("/");a!==-1?this.fromModulePath=c.substr(0,a+1):this.fromModulePath=""}static _normalizeModuleId(c){let a=c,m;for(m=/\/\.\//;m.test(a);)a=a.replace(m,"/");for(a=a.replace(/^\.\//g,""),m=/\/(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//;m.test(a);)a=a.replace(m,"/");return a=a.replace(/^(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//,""),a}resolveModule(c){let a=c;return W.Utilities.isAbsolutePath(a)||(W.Utilities.startsWith(a,"./")||W.Utilities.startsWith(a,"../"))&&(a=n._normalizeModuleId(this.fromModulePath+a)),a}}n.ROOT=new n(""),W.ModuleIdResolver=n;class i{constructor(c,a,m,e,h,r){this.id=c,this.strId=a,this.dependencies=m,this._callback=e,this._errorback=h,this.moduleIdResolver=r,this.exports={},this.error=null,this.exportsPassedIn=!1,this.unresolvedDependenciesCount=this.dependencies.length,this._isComplete=!1}static _safeInvokeFunction(c,a){try{return{returnedValue:c.apply(W.global,a),producedError:null}}catch(m){return{returnedValue:null,producedError:m}}}static _invokeFactory(c,a,m,e){return c.shouldInvokeFactory(a)?c.shouldCatchError()?this._safeInvokeFunction(m,e):{returnedValue:m.apply(W.global,e),producedError:null}:{returnedValue:null,producedError:null}}complete(c,a,m,e){this._isComplete=!0;let h=null;if(this._callback)if(typeof this._callback=="function"){c.record(21,this.strId);let r=i._invokeFactory(a,this.strId,this._callback,m);h=r.producedError,c.record(22,this.strId),!h&&typeof r.returnedValue<"u"&&(!this.exportsPassedIn||W.Utilities.isEmpty(this.exports))&&(this.exports=r.returnedValue)}else this.exports=this._callback;if(h){let r=W.ensureError(h);r.phase="factory",r.moduleId=this.strId,r.neededBy=e(this.id),this.error=r,a.onError(r)}this.dependencies=null,this._callback=null,this._errorback=null,this.moduleIdResolver=null}onDependencyError(c){return this._isComplete=!0,this.error=c,this._errorback?(this._errorback(c),!0):!1}isComplete(){return this._isComplete}}W.Module=i;class x{constructor(){this._nextId=0,this._strModuleIdToIntModuleId=new Map,this._intModuleIdToStrModuleId=[],this.getModuleId("exports"),this.getModuleId("module"),this.getModuleId("require")}getMaxModuleId(){return this._nextId}getModuleId(c){let a=this._strModuleIdToIntModuleId.get(c);return typeof a>"u"&&(a=this._nextId++,this._strModuleIdToIntModuleId.set(c,a),this._intModuleIdToStrModuleId[a]=c),a}getStrModuleId(c){return this._intModuleIdToStrModuleId[c]}}class A{constructor(c){this.id=c}}A.EXPORTS=new A(0),A.MODULE=new A(1),A.REQUIRE=new A(2),W.RegularDependency=A;class d{constructor(c,a,m){this.id=c,this.pluginId=a,this.pluginParam=m}}W.PluginDependency=d;class f{constructor(c,a,m,e,h=0){this._env=c,this._scriptLoader=a,this._loaderAvailableTimestamp=h,this._defineFunc=m,this._requireFunc=e,this._moduleIdProvider=new x,this._config=new W.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 f(this._env,this._scriptLoader,this._defineFunc,this._requireFunc,this._loaderAvailableTimestamp)}getGlobalAMDDefineFunc(){return this._defineFunc}getGlobalAMDRequireFunc(){return this._requireFunc}static _findRelevantLocationInStack(c,a){let m=r=>r.replace(/\\/g,"/"),e=m(c),h=a.split(/\n/);for(let r=0;r<h.length;r++){let s=h[r].match(/(.*):(\d+):(\d+)\)?$/);if(s){let o=s[1],u=s[2],S=s[3],L=Math.max(o.lastIndexOf(" ")+1,o.lastIndexOf("(")+1);if(o=o.substr(L),o=m(o),o===e){let N={line:parseInt(u,10),col:parseInt(S,10)};return N.line===1&&(N.col-=53),N}}}throw new Error("Could no
`)),c.unresolvedDependenciesCount--;continue}if(this._inverseDependencies2[h.id]=this._inverseDependencies2[h.id]||[],this._inverseDependencies2[h.id].push(c.id),h instanceof d){let s=this._modules2[h.pluginId];if(s&&s.isComplete()){this._loadPluginDependency(s.exports,h);continue}let o=this._inversePluginDependencies2.get(h.pluginId);o||(o=[],this._inversePluginDependencies2.set(h.pluginId,o)),o.push(h),this._loadModule(h.pluginId);continue}this._loadModule(h.id)}c.unresolvedDependenciesCount===0&&this._onModuleComplete(c)}_onModuleComplete(c){let a=this.getRecorder();if(c.isComplete())return;let m=c.dependencies,e=[];if(m)for(let o=0,u=m.length;o<u;o++){let S=m[o];if(S===A.EXPORTS){e[o]=c.exports;continue}if(S===A.MODULE){e[o]={id:c.strId,config:()=>this._config.getConfigForModule(c.strId)};continue}if(S===A.REQUIRE){e[o]=this._createRequire(c.moduleIdResolver);continue}let L=this._modules2[S.id];if(L){e[o]=L.exports;continue}e[o]=null}const h=o=>(this._inverseDependencies2[o]||[]).map(u=>this._moduleIdProvider.getStrModuleId(u));c.complete(a,this._config,e,h);let r=this._inverseDependencies2[c.id];if(this._inverseDependencies2[c.id]=null,r)for(let o=0,u=r.length;o<u;o++){let S=r[o],L=this._modules2[S];L.unresolvedDependenciesCount--,L.unresolvedDependenciesCount===0&&this._onModuleComplete(L)}let s=this._inversePluginDependencies2.get(c.id);if(s){this._inversePluginDependencies2.delete(c.id);for(let o=0,u=s.length;o<u;o++)this._loadPluginDependency(c.exports,s[o])}}}W.ModuleManager=f})(ie||(ie={}));var X,ie;(function(W){const n=new W.Environment;let i=null;const x=function(p,c,a){typeof p!="string"&&(a=c,c=p,p=null),(typeof c!="object"||!Array.isArray(c))&&(a=c,c=null),c||(c=["require","exports","module"]),p?i.defineModule(p,c,a,null,null):i.enqueueDefineAnonymousModule(c,a)};x.amd={jQuery:!0};const A=function(p,c=!1){i.configure(p,c)},d=function(){if(arguments.length===1){if(arguments[0]instanceof Object&&!Array.isArray(arguments[0])){A(arguments[0]);return}if(typeof arguments[0]=="string")return i.synchronousRequire(arguments[0])}if((arguments.length===2||arguments.length===3)&&Array.isArray(arguments[0])){i.defineModule(W.Utilities.generateAnonymousModule(),arguments[0],arguments[1],arguments[2],null);return}throw new Error("Unrecognized require call")};d.config=A,d.getConfig=function(){return i.getConfig().getOptionsLiteral()},d.reset=function(){i=i.reset()},d.getBuildInfo=function(){return i.getBuildInfo()},d.getStats=function(){return i.getLoaderEvents()},d.define=x;function f(){if(typeof W.global.require<"u"||typeof require<"u"){const p=W.global.require||require;if(typeof p=="function"&&typeof p.resolve=="function"){const c=W.ensureRecordedNodeRequire(i.getRecorder(),p);W.global.nodeRequire=c,d.nodeRequire=c,d.__$__nodeRequire=c}}n.isNode&&!n.isElectronRenderer&&!n.isElectronNodeIntegrationWebWorker?module.exports=d:(n.isElectronRenderer||(W.global.define=x),W.global.require=d)}W.init=f,(typeof W.global.define!="function"||!W.global.define.amd)&&(i=new W.ModuleManager(n,W.createScriptLoader(n),x,d,W.Utilities.getHighPerformanceTimestamp()),typeof W.global.require<"u"&&typeof W.global.require!="function"&&d.config(W.global.require),X=function(){return x.apply(null,arguments)},X.amd=x.amd,typeof doNotInitLoader>"u"&&f())})(ie||(ie={})),function(){const W=globalThis.MonacoEnvironment,n=W&&W.baseUrl?W.baseUrl:"../../../";function i(e,h){if(W?.createTrustedTypesPolicy)try{return W.createTrustedTypesPolicy(e,h)}catch(r){console.warn(r);return}try{return self.trustedTypes?.createPolicy(e,h)}catch(r){console.warn(r);return}}const x=i("amdLoader",{createScriptURL:e=>e,createScript:(e,...h)=>{const r=h.slice(0,-1).join(","),s=h.pop().toString();return`(function anonymous(${r}) { ${s}
})`}});function A(){try{return(x?globalThis.eval(x.createScript("","true")):new Function("true")).call(globalThis),!0}catch{return!1}}function d(){return new Promise((e,h)=>{if(typeof globalThis.define=="function"&&globalThis.define.amd)return e();const r=n+"vs/loader.js";if(!(/^((http:)|(https:)|(file:))/.test(r)&&r.substring(0,globalThis.origin.length)!==globalThis.origin)&&A()){fetch(r).then(o=>{if(o.status!==200)throw new Error(o.statusText);return o.text()}).then(o=>{o=`${o}
//# sourceURL=${r}`,(x?globalThis.eval(x.createScript("",o)):new Function(o)).call(globalThis),e()}).then(void 0,h);return}x?importScripts(x.createScriptURL(r)):importScripts(r),e()})}function f(){require.config({baseUrl:n,catchError:!0,trustedTypesPolicy:x,amdModulesPattern:/^vs\//})}function p(e){return d().then(()=>(f(),new Promise((h,r)=>{require([e],h,r)})))}function c(e){setTimeout(function(){const h=e.create((r,s)=>{globalThis.postMessage(r,s)});for(self.onmessage=r=>h.onmessage(r.data,r.ports);m.length>0;)self.onmessage(m.shift())},0)}typeof globalThis.define=="function"&&globalThis.define.amd&&f();let a=!0;const m=[];globalThis.onmessage=e=>{if(!a){m.push(e);return}a=!1,p(e.data).then(h=>{c(h)},h=>{console.error(h)})}}(),X(J[7],Z([0,1]),function(W,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Permutation=n.CallbackIterable=n.ArrayQueue=n.booleanComparator=n.numberComparator=n.CompareResult=void 0,n.tail=i,n.tail2=x,n.equals=A,n.removeFastWithoutKeepingOrder=d,n.binarySearch=f,n.binarySearch2=p,n.quickSelect=c,n.groupBy=a,n.groupAdjacentBy=m,n.forEachAdjacent=e,n.forEachWithNeighbors=h,n.coalesce=r,n.coalesceInPlace=s,n.isFalsyOrEmpty=o,n.isNonEmptyArray=u,n.distinct=S,n.firstOrDefault=L,n.range=N,n.arrayInsert=P,n.pushToStart=E,n.pushToEnd=v,n.pushMany=l,n.asArray=b,n.insertInto=g,n.splice=w,n.compareBy=_,n.tieBreakComparators=C,n.reverseOrder=T;function i(F,q=0){return F[F.length-(1+q)]}function x(F){if(F.length===0)throw new Error("Invalid tail call");return[F.slice(0,F.length-1),F[F.length-1]]}function A(F,q,B=(G,$)=>G===$){if(F===q)return!0;if(!F||!q||F.length!==q.length)return!1;for(let G=0,$=F.length;G<$;G++)if(!B(F[G],q[G]))return!1;return!0}function d(F,q){const B=F.length-1;q<B&&(F[q]=F[B]),F.pop()}function f(F,q,B){return p(F.length,G=>B(F[G],q))}function p(F,q){let B=0,G=F-1;for(;B<=G;){const $=(B+G)/2|0,U=q($);if(U<0)B=$+1;else if(U>0)G=$-1;else return $}return-(B+1)}function c(F,q,B){if(F=F|0,F>=q.length)throw new TypeError("invalid index");const G=q[Math.floor(q.length*Math.random())],$=[],U=[],ee=[];for(const re of q){const ue=B(re,G);ue<0?$.push(re):ue>0?U.push(re):ee.push(re)}return F<$.length?c(F,$,B):F<$.length+ee.length?ee[0]:c(F-($.length+ee.length),U,B)}function a(F,q){const B=[];let G;for(const $ of F.slice(0).sort(q))!G||q(G[0],$)!==0?(G=[$],B.push(G)):G.push($);return B}function*m(F,q){let B,G;for(const $ of F)G!==void 0&&q(G,$)?B.push($):(B&&(yield B),B=[$]),G=$;B&&(yield B)}function e(F,q){for(let B=0;B<=F.length;B++)q(B===0?void 0:F[B-1],B===F.length?void 0:F[B])}function h(F,q){for(let B=0;B<F.length;B++)q(B===0?void 0:F[B-1],F[B],B+1===F.length?void 0:F[B+1])}function r(F){return F.filter(q=>!!q)}function s(F){let q=0;for(let B=0;B<F.length;B++)F[B]&&(F[q]=F[B],q+=1);F.length=q}function o(F){return!Array.isArray(F)||F.length===0}function u(F){return Array.isArray(F)&&F.length>0}function S(F,q=B=>B){const B=new Set;return F.filter(G=>{const $=q(G);return B.has($)?!1:(B.add($),!0)})}function L(F,q){return F.length>0?F[0]:q}function N(F,q){let B=typeof q=="number"?F:0;typeof q=="number"?B=F:(B=0,q=F);const G=[];if(B<=q)for(let $=B;$<q;$++)G.push($);else for(let $=B;$>q;$--)G.push($);return G}function P(F,q,B){const G=F.slice(0,q),$=F.slice(q);return G.concat(B,$)}function E(F,q){const B=F.indexOf(q);B>-1&&(F.splice(B,1),F.unshift(q))}function v(F,q){const B=F.indexOf(q);B>-1&&(F.splice(B,1),F.push(q))}function l(F,q){for(const B of q)F.push(B)}function b(F){return Array.isArray(F)?F:[F]}function g(F,q,B){const G=M(F,q),$=F.length,U=B.length;F.length=$+U;for(let ee=$-1;ee>=G;ee--)F[ee+U]=F[ee];for(let ee=0;ee<U;ee++)F[ee+G]=B[ee]}function w(F,q,B,G){const $=M(F,q);let U=F.splice($,B);return U===void 0&&(U=[]),g(F,$,G),U}function M(F,q){return q<0?Math.max(q+F.length,0):Math.min(q,F.length)}var y;(function(F){function q(U){return U<0}F.isLessThan=q;function B(U){return U<=0}F.isLessThanOrEqual=B;function G(U){return U>0}F.isGreaterThan=G;function $(U){return U===0}F.isNeitherLessOrGreaterThan=$,F.greaterThan=1,F.lessThan=-1,F.neitherLessOrGreaterThan=0})(y||(n.Compa
`+u.stack):new Error(u.message+`
`+u.stack):u},0)}}emit(u){this.listeners.forEach(S=>{S(u)})}onUnexpectedError(u){this.unexpectedErrorHandler(u),this.emit(u)}onUnexpectedExternalError(u){this.unexpectedErrorHandler(u)}}n.ErrorHandler=i,n.errorHandler=new i;function x(o){p(o)||n.errorHandler.onUnexpectedError(o)}function A(o){p(o)||n.errorHandler.onUnexpectedExternalError(o)}function d(o){if(o instanceof Error){const{name:u,message:S}=o,L=o.stacktrace||o.stack;return{$isError:!0,name:u,message:S,stack:L,noTelemetry:r.isErrorNoTelemetry(o)}}return o}const f="Canceled";function p(o){return o instanceof c?!0:o instanceof Error&&o.name===f&&o.message===f}class c extends Error{constructor(){super(f),this.name=this.message}}n.CancellationError=c;function a(){const o=new Error(f);return o.name=o.message,o}function m(o){return o?new Error(`Illegal argument: ${o}`):new Error("Illegal argument")}function e(o){return o?new Error(`Illegal state: ${o}`):new Error("Illegal state")}class h extends Error{constructor(u){super("NotSupported"),u&&(this.message=u)}}n.NotSupportedError=h;class r extends Error{constructor(u){super(u),this.name="CodeExpectedError"}static fromError(u){if(u instanceof r)return u;const S=new r;return S.message=u.message,S.stack=u.stack,S}static isErrorNoTelemetry(u){return u.name==="CodeExpectedError"}}n.ErrorNoTelemetry=r;class s extends Error{constructor(u){super(u||"An unexpected bug occurred."),Object.setPrototypeOf(this,s.prototype)}}n.BugIndicatingError=s}),X(J[12],Z([0,1,3]),function(W,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ok=x,n.assertNever=A,n.softAssert=d,n.assertFn=f,n.checkAdjacentItems=p;function x(c,a){if(!c)throw new Error(a?`Assertion failed (${a})`:"Assertion Failed")}function A(c,a="Unreachable"){throw new Error(a)}function d(c){c||(0,i.onUnexpectedError)(new i.BugIndicatingError("Soft Assertion Failed"))}function f(c){if(!c()){debugger;c(),(0,i.onUnexpectedError)(new i.BugIndicatingError("Assertion Failed"))}}function p(c,a){let m=0;for(;m<c.length-1;){const e=c[m],h=c[m+1];if(!a(e,h))return!1;m++}return!0}}),X(J[18],Z([0,1]),function(W,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.createSingleCallFunction=i;function i(x,A){const d=this;let f=!1,p;return function(){if(f)return p;if(f=!0,A)try{p=x.apply(d,arguments)}finally{A()}else p=x.apply(d,arguments);return p}}}),X(J[19],Z([0,1]),function(W,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Iterable=void 0;var i;(function(x){function A(l){return l&&typeof l=="object"&&typeof l[Symbol.iterator]=="function"}x.is=A;const d=Object.freeze([]);function f(){return d}x.empty=f;function*p(l){yield l}x.single=p;function c(l){return A(l)?l:p(l)}x.wrap=c;function a(l){return l||d}x.from=a;function*m(l){for(let b=l.length-1;b>=0;b--)yield l[b]}x.reverse=m;function e(l){return!l||l[Symbol.iterator]().next().done===!0}x.isEmpty=e;function h(l){return l[Symbol.iterator]().next().value}x.first=h;function r(l,b){let g=0;for(const w of l)if(b(w,g++))return!0;return!1}x.some=r;function s(l,b){for(const g of l)if(b(g))return g}x.find=s;function*o(l,b){for(const g of l)b(g)&&(yield g)}x.filter=o;function*u(l,b){let g=0;for(const w of l)yield b(w,g++)}x.map=u;function*S(l,b){let g=0;for(const w of l)yield*b(w,g++)}x.flatMap=S;function*L(...l){for(const b of l)yield*b}x.concat=L;function N(l,b,g){let w=g;for(const M of l)w=b(w,M);return w}x.reduce=N;function*P(l,b,g=l.length){for(b<0&&(b+=l.length),g<0?g+=l.length:g>l.length&&(g=l.length);b<g;b++)yield l[b]}x.slice=P;function E(l,b=Number.POSITIVE_INFINITY){const g=[];if(b===0)return[g,l];const w=l[Symbol.iterator]();for(let M=0;M<b;M++){const y=w.next();if(y.done)return[g,x.empty()];g.push(y.value)}return[g,{[Symbol.iterator](){return w}}]}x.consume=E;async function v(l){const b=[];for await(const g of l)b.push(g);return Promise.resolve(b)}x.asyncToArray=v})(i||(n.Iterable=i={}))}),X(J[42],Z([0,1]),function(W,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.KeyCodeUtils=n.IMMUTABLE_KEY_CODE_TO_CODE=n.IMMUTABLE_CODE_TO_KEY_CODE=n.NATIVE_WINDOWS_KEY_CODE_TO_KEY_C
`).slice(2).join(`
`))}}class o extends Error{constructor(R,D){super(R),this.name="ListenerLeakError",this.stack=D}}n.ListenerLeakError=o;class u extends Error{constructor(R,D){super(R),this.name="ListenerRefusalError",this.stack=D}}n.ListenerRefusalError=u;class S{constructor(R){this.value=R}}const L=2,N=(C,R)=>{if(C instanceof S)R(C);else for(let D=0;D<C.length;D++){const T=C[D];T&&R(T)}};let P;if(p){const C=[];setInterval(()=>{C.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(C.join(`
`)),C.length=0)},3e3),P=new FinalizationRegistry(R=>{typeof R=="string"&&C.push(R)})}class E{constructor(R){this._size=0,this._options=R,this._leakageMon=h>0||this._options?.leakWarningThreshold?new r(R?.onListenerError??i.onUnexpectedError,this._options?.leakWarningThreshold??h):void 0,this._perfMon=this._options?._profName?new e(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(c){const R=this._listeners;queueMicrotask(()=>{N(R,D=>D.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(R,D,T)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const q=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(q);const B=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],G=new u(`${q}. HINT: Stack shows most frequent listener (${B[1]}-times)`,B[0]);return(this._options?.onListenerError||i.onUnexpectedError)(G),A.Disposable.None}if(this._disposed)return A.Disposable.None;D&&(R=R.bind(D));const O=new S(R);let z,j;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(O.stack=s.create(),z=this._leakageMon.check(O.stack,this._size+1)),c&&(O.stack=j??s.create()),this._listeners?this._listeners instanceof S?(this._deliveryQueue??=new l,this._listeners=[this._listeners,O]):this._listeners.push(O):(this._options?.onWillAddFirstListener?.(this),this._listeners=O,this._options?.onDidAddFirstListener?.(this)),this._size++;const F=(0,A.toDisposable)(()=>{P?.unregister(F),z?.(),this._removeListener(O)});if(T instanceof A.DisposableStore?T.add(F):Array.isArray(T)&&T.push(F),P){const q=new Error().stack.split(`
`).slice(2,3).join(`
`).trim(),B=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(q);P.register(F,B?.[2]??q,F)}return F},this._event}_removeListener(R){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const D=this._listeners,T=D.indexOf(R);if(T===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,D[T]=void 0;const O=this._deliveryQueue.current===this;if(this._size*L<=D.length){let z=0;for(let j=0;j<D.length;j++)D[j]?D[z++]=D[j]:O&&(this._deliveryQueue.end--,z<this._deliveryQueue.i&&this._deliveryQueue.i--);D.length=z}}_deliver(R,D){if(!R)return;const T=this._options?.onListenerError||i.onUnexpectedError;if(!T){R.value(D);return}try{R.value(D)}catch(O){T(O)}}_deliverQueue(R){const D=R.current._listeners;for(;R.i<R.end;)this._deliver(D[R.i++],R.value);R.reset()}fire(R){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof S)this._deliver(this._listeners,R);else{const D=this._deliveryQueue;D.enqueue(this,R,this._listeners.length),this._deliverQueue(D)}this._perfMon?.stop()}hasListeners(){return this._size>0}}n.Emitter=E;const v=()=>new l;n.createEventDeliveryQueue=v;class l{constructor(){this.i=-1,this.end=0}enqueue(R,D,T){this.i=0,this.end=T,this.current=R,this.value=D}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class b extends E{constructor(R){super(R),this._isPaused=0,this._eventQueue=new d.LinkedList,this._mergeFn=R?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const R=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(R))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(R){this._size&&(this._isPaused!==0?this._eventQueue.push(R):super.fire(R))}}n.PauseableEmitter=b;class g extends b{constructor(R){super(R),this._delay=R.delay??100}fire(R){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(R)}}n.DebounceEmitter=g;class w extends E{constructor(R){super(R),this._queuedEvents=[],this._mergeFn=R?.merge}fire(R){this.hasListeners()&&(this._queuedEvents.push(R),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(D=>super.fire(D)),this._queuedEvents=[]}))}}n.MicrotaskEmitter=w;class M{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new E({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(R){const D={event:R,listener:null};this.events.push(D),this.hasListeners&&this.hook(D);const T=()=>{this.hasListeners&&this.unhook(D);const O=this.events.indexOf(D);this.events.splice(O,1)};return(0,A.toDisposable)((0,x.createSingleCallFunction)(T))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(R=>this.hook(R))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(R=>this.unhook(R))}hook(R){R.listener=R.event(D=>this.emitter.fire(D))}unhook(R){R.listener?.dispose(),R.listener=null}dispose(){this.emitter.dispose();for(const R of this.events)R.listener?.dispose();this.events=[]}}n.EventMultiplexer=M;class y{constructor(){this.data=[]}wrapEvent(R,D,T){return(O,z,j)=>R(F=>{const q=this.data[this.data.length-1];if(!D){q?q.buffers.push(()=>O.call(z,F)):O.call(z,F);return}const B=q;if(!B){O.call(z,D(T,F));return}B.items??=[],B.items.push(F),B.buffers.length===0&&q.buffers.push(()=>{B.reducedResult??=T?B.items.reduce(D,T):B.items.reduce(D),O.call(z,B.reducedResult)})},void 0,j)}bufferEvents(R){const D={buffers:new Array};this.data.push(D);const T=R();return this.data.pop(),D.buffers.forEach(O=>O()),T}}n
`?(p++,c=0):c++;return new A(p,c)}constructor(f,p){this.lineCount=f,this.columnCount=p}isGreaterThanOrEqualTo(f){return this.lineCount!==f.lineCount?this.lineCount>f.lineCount:this.columnCount>=f.columnCount}createRange(f){return this.lineCount===0?new x.Range(f.lineNumber,f.column,f.lineNumber,f.column+this.columnCount):new x.Range(f.lineNumber,f.column,f.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(f){return this.lineCount===0?new i.Position(f.lineNumber,f.column+this.columnCount):new i.Position(f.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}}n.TextLength=A}),X(J[49],Z([0,1,5,30]),function(W,n,i,x){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PositionOffsetTransformer=void 0;class A{constructor(f){this.text=f,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let p=0;p<f.length;p++)f.charAt(p)===`
`&&this.lineStartOffsetByLineIdx.push(p+1)}getOffset(f){return this.lineStartOffsetByLineIdx[f.lineNumber-1]+f.column-1}getOffsetRange(f){return new i.OffsetRange(this.getOffset(f.getStartPosition()),this.getOffset(f.getEndPosition()))}get textLength(){const f=this.lineStartOffsetByLineIdx.length-1;return new x.TextLength(f,this.text.length-this.lineStartOffsetByLineIdx[f])}}n.PositionOffsetTransformer=A}),X(J[50],Z([0,1,12,3,4,49,2,30]),function(W,n,i,x,A,d,f,p){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.StringText=n.AbstractText=n.SingleTextEdit=n.TextEdit=void 0;class c{constructor(s){this.edits=s,(0,i.assertFn)(()=>(0,i.checkAdjacentItems)(s,(o,u)=>o.range.getEndPosition().isBeforeOrEqual(u.range.getStartPosition())))}apply(s){let o="",u=new A.Position(1,1);for(const L of this.edits){const N=L.range,P=N.getStartPosition(),E=N.getEndPosition(),v=m(u,P);v.isEmpty()||(o+=s.getValueOfRange(v)),o+=L.text,u=E}const S=m(u,s.endPositionExclusive);return S.isEmpty()||(o+=s.getValueOfRange(S)),o}applyToString(s){const o=new h(s);return this.apply(o)}getNewRanges(){const s=[];let o=0,u=0,S=0;for(const L of this.edits){const N=p.TextLength.ofText(L.text),P=A.Position.lift({lineNumber:L.range.startLineNumber+u,column:L.range.startColumn+(L.range.startLineNumber===o?S:0)}),E=N.createRange(P);s.push(E),u=E.endLineNumber-L.range.endLineNumber,S=E.endColumn-L.range.endColumn,o=L.range.endLineNumber}return s}}n.TextEdit=c;class a{constructor(s,o){this.range=s,this.text=o}toSingleEditOperation(){return{range:this.range,text:this.text}}}n.SingleTextEdit=a;function m(r,s){if(r.lineNumber===s.lineNumber&&r.column===Number.MAX_SAFE_INTEGER)return f.Range.fromPositions(s,s);if(!r.isBeforeOrEqual(s))throw new x.BugIndicatingError("start must be before end");return new f.Range(r.lineNumber,r.column,s.lineNumber,s.column)}class e{get endPositionExclusive(){return this.length.addToPosition(new A.Position(1,1))}}n.AbstractText=e;class h extends e{constructor(s){super(),this.value=s,this._t=new d.PositionOffsetTransformer(this.value)}getValueOfRange(s){return this._t.getOffsetRange(s).substring(this.value)}get length(){return this._t.textLength}}n.StringText=h}),X(J[51],Z([0,1,21,29]),function(W,n,i,x){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.WordCharacterClassifier=void 0,n.getMapForWordSeparators=f;class A extends x.CharacterClassifier{constructor(c,a){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=a,this.intlSegmenterLocales.length>0?this._segmenter=new Intl.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let m=0,e=c.length;m<e;m++)this.set(c.charCodeAt(m),2);this.set(32,1),this.set(9,1)}findPrevIntlWordBeforeOrAtOffset(c,a){let m=null;for(const e of this._getIntlSegmenterWordsOnLine(c)){if(e.index>a)break;m=e}return m}findNextIntlWordAtOrAfterOffset(c,a){for(const m of this._getIntlSegmenterWordsOnLine(c))if(!(m.index<a))return m;return null}_getIntlSegmenterWordsOnLine(c){return this._segmenter?this._cachedLine===c?this._cachedSegments:(this._cachedLine=c,this._cachedSegments=this._filterWordSegments(this._segmenter.segment(c)),this._cachedSegments):[]}_filterWordSegments(c){const a=[];for(const m of c)this._isWordLike(m)&&a.push(m);return a}_isWordLike(c){return!!c.isWordLike}}n.WordCharacterClassifier=A;const d=new i.LRUCache(10);function f(p,c){const a=`${p}/${c.join(",")}`;let m=d.get(a);return m||(m=new A(p,c),d.set(a,m)),m}}),X(J[31],Z([0,1,19,20]),function(W,n,i,x){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_WORD_REGEXP=n.USUAL_WORD_SEPARATORS=void 0,n.ensureValidWordDefinition=d,n.getWordAtText=p,n.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function A(a=""){let m="(-?\\d*\\.\\d\\w*)|([^";for(const e of n.USUAL_WORD_SEPARATORS)a.indexOf(e)>=0||(m+="\\"+e);return m+="\\s]+)",new RegExp(m,"g")}n.DEFAULT_WORD_REGEXP=A();function d(a){let m=n.DEFAULT_WORD_REGEXP;if(a&&a instanceof RegExp)if(a.global)m=a;else{let e="g";a.ignoreCase&&(e+="i"),a.multiline&&(e+="m"),a
`)}isStronglyEqual(d,f){return this.lines[d]===this.lines[f]}}n.LineSequence=i;function x(A){let d=0;for(;d<A.length&&(A.charCodeAt(d)===32||A.charCodeAt(d)===9);)d++;return d}}),X(J[16],Z([0,1]),function(W,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.LineRangeFragment=n.Array2D=void 0,n.isSpace=x;class i{constructor(f,p){this.width=f,this.height=p,this.array=[],this.array=new Array(f*p)}get(f,p){return this.array[f+p*this.width]}set(f,p,c){this.array[f+p*this.width]=c}}n.Array2D=i;function x(d){return d===32||d===9}class A{static{this.chrKeys=new Map}static getKey(f){let p=this.chrKeys.get(f);return p===void 0&&(p=this.chrKeys.size,this.chrKeys.set(f,p)),p}constructor(f,p,c){this.range=f,this.lines=p,this.source=c,this.histogram=[];let a=0;for(let m=f.startLineNumber-1;m<f.endLineNumberExclusive-1;m++){const e=p[m];for(let r=0;r<e.length;r++){a++;const s=e[r],o=A.getKey(s);this.histogram[o]=(this.histogram[o]||0)+1}a++;const h=A.getKey(`
`);this.histogram[h]=(this.histogram[h]||0)+1}this.totalCount=a}computeSimilarity(f){let p=0;const c=Math.max(this.histogram.length,f.histogram.length);for(let a=0;a<c;a++)p+=Math.abs((this.histogram[a]??0)-(f.histogram[a]??0));return 1-p/(this.totalCount+f.totalCount)}}n.LineRangeFragment=A}),X(J[54],Z([0,1,5,10,16]),function(W,n,i,x,A){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DynamicProgrammingDiffing=void 0;class d{compute(p,c,a=x.InfiniteTimeout.instance,m){if(p.length===0||c.length===0)return x.DiffAlgorithmResult.trivial(p,c);const e=new A.Array2D(p.length,c.length),h=new A.Array2D(p.length,c.length),r=new A.Array2D(p.length,c.length);for(let P=0;P<p.length;P++)for(let E=0;E<c.length;E++){if(!a.isValid())return x.DiffAlgorithmResult.trivialTimedOut(p,c);const v=P===0?0:e.get(P-1,E),l=E===0?0:e.get(P,E-1);let b;p.getElement(P)===c.getElement(E)?(P===0||E===0?b=0:b=e.get(P-1,E-1),P>0&&E>0&&h.get(P-1,E-1)===3&&(b+=r.get(P-1,E-1)),b+=m?m(P,E):1):b=-1;const g=Math.max(v,l,b);if(g===b){const w=P>0&&E>0?r.get(P-1,E-1):0;r.set(P,E,w+1),h.set(P,E,3)}else g===v?(r.set(P,E,0),h.set(P,E,1)):g===l&&(r.set(P,E,0),h.set(P,E,2));e.set(P,E,g)}const s=[];let o=p.length,u=c.length;function S(P,E){(P+1!==o||E+1!==u)&&s.push(new x.SequenceDiff(new i.OffsetRange(P+1,o),new i.OffsetRange(E+1,u))),o=P,u=E}let L=p.length-1,N=c.length-1;for(;L>=0&&N>=0;)h.get(L,N)===3?(S(L,N),L--,N--):h.get(L,N)===1?L--:N--;return S(-1,-1),s.reverse(),new x.DiffAlgorithmResult(s,!1)}}n.DynamicProgrammingDiffing=d}),X(J[33],Z([0,1,15,5,4,2,16]),function(W,n,i,x,A,d,f){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.LinesSliceCharSequence=void 0;class p{constructor(r,s,o){this.lines=r,this.range=s,this.considerWhitespaceChanges=o,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let u=this.range.startLineNumber;u<=this.range.endLineNumber;u++){let S=r[u-1],L=0;u===this.range.startLineNumber&&this.range.startColumn>1&&(L=this.range.startColumn-1,S=S.substring(L)),this.lineStartOffsets.push(L);let N=0;if(!o){const E=S.trimStart();N=S.length-E.length,S=E.trimEnd()}this.trimmedWsLengthsByLineIdx.push(N);const P=u===this.range.endLineNumber?Math.min(this.range.endColumn-1-L-N,S.length):S.length;for(let E=0;E<P;E++)this.elements.push(S.charCodeAt(E));u<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new x.OffsetRange(0,this.length))}getText(r){return this.elements.slice(r.start,r.endExclusive).map(s=>String.fromCharCode(s)).join("")}getElement(r){return this.elements[r]}get length(){return this.elements.length}getBoundaryScore(r){const s=e(r>0?this.elements[r-1]:-1),o=e(r<this.elements.length?this.elements[r]:-1);if(s===7&&o===8)return 0;if(s===8)return 150;let u=0;return s!==o&&(u+=10,s===0&&o===1&&(u+=1)),u+=m(s),u+=m(o),u}translateOffset(r,s="right"){const o=(0,i.findLastIdxMonotonous)(this.firstElementOffsetByLineIdx,S=>S<=r),u=r-this.firstElementOffsetByLineIdx[o];return new A.Position(this.range.startLineNumber+o,1+this.lineStartOffsets[o]+u+(u===0&&s==="left"?0:this.trimmedWsLengthsByLineIdx[o]))}translateRange(r){const s=this.translateOffset(r.start,"right"),o=this.translateOffset(r.endExclusive,"left");return o.isBefore(s)?d.Range.fromPositions(o,o):d.Range.fromPositions(s,o)}findWordContaining(r){if(r<0||r>=this.elements.length||!c(this.elements[r]))return;let s=r;for(;s>0&&c(this.elements[s-1]);)s--;let o=r;for(;o<this.elements.length&&c(this.elements[o]);)o++;return new x.OffsetRange(s,o)}countLinesIn(r){return this.translateOffset(r.endExclusive).lineNumber-this.translateOffset(r.start).lineNumber}isStronglyEqual(r,s){return this.elements[r]===this.elements[s]}extendToFullLines(r){const s=(0,i.findLastMonotonous)(this.firstElementOffsetByLineIdx,u=>u<=r.start)??0,o=(0,i.findFirstMonotonous)(this.firstElementOffsetByLineIdx,u=>r.endExclusive<=u)??this.elements.length;return n
`).length>=15&&r(C,D=>D.length>=2)>=2}),g=L(N,g),g}function r(N,P){let E=0;for(const v of N)P(v)&&E++;return E}function s(N,P,E,v){const l=[],b=N.filter(M=>M.modified.isEmpty&&M.original.length>=3).map(M=>new a.LineRangeFragment(M.original,P,M)),g=new Set(N.filter(M=>M.original.isEmpty&&M.modified.length>=3).map(M=>new a.LineRangeFragment(M.modified,E,M))),w=new Set;for(const M of b){let y=-1,_;for(const C of g){const R=M.computeSimilarity(C);R>y&&(y=R,_=C)}if(y>.9&&_&&(g.delete(_),l.push(new x.LineRangeMapping(M.range,_.range)),w.add(M.source),w.add(_.source)),!v.isValid())return{moves:l,excludedChanges:w}}return{moves:l,excludedChanges:w}}function o(N,P,E,v,l,b){const g=[],w=new f.SetMap;for(const R of N)for(let D=R.original.startLineNumber;D<R.original.endLineNumberExclusive-2;D++){const T=`${P[D-1]}:${P[D+1-1]}:${P[D+2-1]}`;w.add(T,{range:new p.LineRange(D,D+3)})}const M=[];N.sort((0,A.compareBy)(R=>R.modified.startLineNumber,A.numberComparator));for(const R of N){let D=[];for(let T=R.modified.startLineNumber;T<R.modified.endLineNumberExclusive-2;T++){const O=`${E[T-1]}:${E[T+1-1]}:${E[T+2-1]}`,z=new p.LineRange(T,T+3),j=[];w.forEach(O,({range:F})=>{for(const B of D)if(B.originalLineRange.endLineNumberExclusive+1===F.endLineNumberExclusive&&B.modifiedLineRange.endLineNumberExclusive+1===z.endLineNumberExclusive){B.originalLineRange=new p.LineRange(B.originalLineRange.startLineNumber,F.endLineNumberExclusive),B.modifiedLineRange=new p.LineRange(B.modifiedLineRange.startLineNumber,z.endLineNumberExclusive),j.push(B);return}const q={modifiedLineRange:z,originalLineRange:F};M.push(q),j.push(q)}),D=j}if(!b.isValid())return[]}M.sort((0,A.reverseOrder)((0,A.compareBy)(R=>R.modifiedLineRange.length,A.numberComparator)));const y=new p.LineRangeSet,_=new p.LineRangeSet;for(const R of M){const D=R.modifiedLineRange.startLineNumber-R.originalLineRange.startLineNumber,T=y.subtractFrom(R.modifiedLineRange),O=_.subtractFrom(R.originalLineRange).getWithDelta(D),z=T.getIntersection(O);for(const j of z.ranges){if(j.length<3)continue;const F=j,q=j.delta(-D);g.push(new x.LineRangeMapping(q,F)),y.addRange(F),_.addRange(q)}}g.sort((0,A.compareBy)(R=>R.original.startLineNumber,A.numberComparator));const C=new d.MonotonousArray(N);for(let R=0;R<g.length;R++){const D=g[R],T=C.findLastMonotonous($=>$.original.startLineNumber<=D.original.startLineNumber),O=(0,d.findLastMonotonous)(N,$=>$.modified.startLineNumber<=D.modified.startLineNumber),z=Math.max(D.original.startLineNumber-T.original.startLineNumber,D.modified.startLineNumber-O.modified.startLineNumber),j=C.findLastMonotonous($=>$.original.startLineNumber<D.original.endLineNumberExclusive),F=(0,d.findLastMonotonous)(N,$=>$.modified.startLineNumber<D.modified.endLineNumberExclusive),q=Math.max(j.original.endLineNumberExclusive-D.original.endLineNumberExclusive,F.modified.endLineNumberExclusive-D.modified.endLineNumberExclusive);let B;for(B=0;B<z;B++){const $=D.original.startLineNumber-B-1,U=D.modified.startLineNumber-B-1;if($>v.length||U>l.length||y.contains(U)||_.contains($)||!u(v[$-1],l[U-1],b))break}B>0&&(_.addRange(new p.LineRange(D.original.startLineNumber-B,D.original.startLineNumber)),y.addRange(new p.LineRange(D.modified.startLineNumber-B,D.modified.startLineNumber)));let G;for(G=0;G<q;G++){const $=D.original.endLineNumberExclusive+G,U=D.modified.endLineNumberExclusive+G;if($>v.length||U>l.length||y.contains(U)||_.contains($)||!u(v[$-1],l[U-1],b))break}G>0&&(_.addRange(new p.LineRange(D.original.endLineNumberExclusive,D.original.endLineNumberExclusive+G)),y.addRange(new p.LineRange(D.modified.endLineNumberExclusive,D.modified.endLineNumberExclusive+G))),(B>0||G>0)&&(g[R]=new x.LineRangeMapping(new p.LineRange(D.original.startLineNumber-B,D.original.endLineNumberExclusive+G),new p.LineRange(D.modified.startLineNumber-B,D.modified.endLineNumberExclusive+G)))}return g}function u(N,P,E){if(N.trim()===P.trim())return!0;if(N.length>300&&P.length>300)return!1;const l=new m.MyersDiffAlgorithm().compute(new c.LinesSliceCharSequence([N],new e.Range(1,1,1,N.length),!1),new c.LinesSliceCharSe
`)>=0;let N=null;try{N=i.createRegExp(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:L,global:!0,unicode:!0})}catch{return null}if(!N)return null;let P=!this.isRegex&&!L;return P&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(P=this.matchCase),new f.SearchData(N,this.wordSeparators?(0,x.getMapForWordSeparators)(this.wordSeparators,[]):null,P?this.searchString:null)}}n.SearchParams=c;function a(S){if(!S||S.length===0)return!1;for(let L=0,N=S.length;L<N;L++){const P=S.charCodeAt(L);if(P===10)return!0;if(P===92){if(L++,L>=N)break;const E=S.charCodeAt(L);if(E===110||E===114||E===87)return!0}}return!1}function m(S,L,N){if(!N)return new f.FindMatch(S,null);const P=[];for(let E=0,v=L.length;E<v;E++)P[E]=L[E];return new f.FindMatch(S,P)}class e{constructor(L){const N=[];let P=0;for(let E=0,v=L.length;E<v;E++)L.charCodeAt(E)===10&&(N[P++]=E);this._lineFeedsOffsets=N}findLineFeedCountBeforeOffset(L){const N=this._lineFeedsOffsets;let P=0,E=N.length-1;if(E===-1||L<=N[0])return 0;for(;P<E;){const v=P+((E-P)/2>>0);N[v]>=L?E=v-1:N[v+1]>=L?(P=v,E=v):P=v+1}return P+1}}class h{static findMatches(L,N,P,E,v){const l=N.parseSearchRequest();return l?l.regex.multiline?this._doFindMatchesMultiline(L,P,new u(l.wordSeparators,l.regex),E,v):this._doFindMatchesLineByLine(L,P,l,E,v):[]}static _getMultilineMatchRange(L,N,P,E,v,l){let b,g=0;E?(g=E.findLineFeedCountBeforeOffset(v),b=N+v+g):b=N+v;let w;if(E){const C=E.findLineFeedCountBeforeOffset(v+l.length)-g;w=b+l.length+C}else w=b+l.length;const M=L.getPositionAt(b),y=L.getPositionAt(w);return new d.Range(M.lineNumber,M.column,y.lineNumber,y.column)}static _doFindMatchesMultiline(L,N,P,E,v){const l=L.getOffsetAt(N.getStartPosition()),b=L.getValueInRange(N,1),g=L.getEOL()===`\r
`?new e(b):null,w=[];let M=0,y;for(P.reset(0);y=P.next(b);)if(w[M++]=m(this._getMultilineMatchRange(L,l,b,g,y.index,y[0]),y,E),M>=v)return w;return w}static _doFindMatchesLineByLine(L,N,P,E,v){const l=[];let b=0;if(N.startLineNumber===N.endLineNumber){const w=L.getLineContent(N.startLineNumber).substring(N.startColumn-1,N.endColumn-1);return b=this._findMatchesInLine(P,w,N.startLineNumber,N.startColumn-1,b,l,E,v),l}const g=L.getLineContent(N.startLineNumber).substring(N.startColumn-1);b=this._findMatchesInLine(P,g,N.startLineNumber,N.startColumn-1,b,l,E,v);for(let w=N.startLineNumber+1;w<N.endLineNumber&&b<v;w++)b=this._findMatchesInLine(P,L.getLineContent(w),w,0,b,l,E,v);if(b<v){const w=L.getLineContent(N.endLineNumber).substring(0,N.endColumn-1);b=this._findMatchesInLine(P,w,N.endLineNumber,0,b,l,E,v)}return l}static _findMatchesInLine(L,N,P,E,v,l,b,g){const w=L.wordSeparators;if(!b&&L.simpleSearch){const _=L.simpleSearch,C=_.length,R=N.length;let D=-C;for(;(D=N.indexOf(_,D+C))!==-1;)if((!w||o(w,N,R,D,C))&&(l[v++]=new f.FindMatch(new d.Range(P,D+1+E,P,D+1+C+E),null),v>=g))return v;return v}const M=new u(L.wordSeparators,L.regex);let y;M.reset(0);do if(y=M.next(N),y&&(l[v++]=m(new d.Range(P,y.index+1+E,P,y.index+1+y[0].length+E),y,b),v>=g))return v;while(y);return v}static findNextMatch(L,N,P,E){const v=N.parseSearchRequest();if(!v)return null;const l=new u(v.wordSeparators,v.regex);return v.regex.multiline?this._doFindNextMatchMultiline(L,P,l,E):this._doFindNextMatchLineByLine(L,P,l,E)}static _doFindNextMatchMultiline(L,N,P,E){const v=new A.Position(N.lineNumber,1),l=L.getOffsetAt(v),b=L.getLineCount(),g=L.getValueInRange(new d.Range(v.lineNumber,v.column,b,L.getLineMaxColumn(b)),1),w=L.getEOL()===`\r
`?new e(g):null;P.reset(N.column-1);const M=P.next(g);return M?m(this._getMultilineMatchRange(L,l,g,w,M.index,M[0]),M,E):N.lineNumber!==1||N.column!==1?this._doFindNextMatchMultiline(L,new A.Position(1,1),P,E):null}static _doFindNextMatchLineByLine(L,N,P,E){const v=L.getLineCount(),l=N.lineNumber,b=L.getLineContent(l),g=this._findFirstMatchInLine(P,b,l,N.column,E);if(g)return g;for(let w=1;w<=v;w++){const M=(l+w-1)%v,y=L.getLineContent(M+1),_=this._findFirstMatchInLine(P,y,M+1,1,E);if(_)return _}return null}static _findFirstMatchInLine(L,N,P,E,v){L.reset(E-1);const l=L.next(N);return l?m(new d.Range(P,l.index+1,P,l.index+1+l[0].length),l,v):null}static findPreviousMatch(L,N,P,E){const v=N.parseSearchRequest();if(!v)return null;const l=new u(v.wordSeparators,v.regex);return v.regex.multiline?this._doFindPreviousMatchMultiline(L,P,l,E):this._doFindPreviousMatchLineByLine(L,P,l,E)}static _doFindPreviousMatchMultiline(L,N,P,E){const v=this._doFindMatchesMultiline(L,new d.Range(1,1,N.lineNumber,N.column),P,E,10*p);if(v.length>0)return v[v.length-1];const l=L.getLineCount();return N.lineNumber!==l||N.column!==L.getLineMaxColumn(l)?this._doFindPreviousMatchMultiline(L,new A.Position(l,L.getLineMaxColumn(l)),P,E):null}static _doFindPreviousMatchLineByLine(L,N,P,E){const v=L.getLineCount(),l=N.lineNumber,b=L.getLineContent(l).substring(0,N.column-1),g=this._findLastMatchInLine(P,b,l,E);if(g)return g;for(let w=1;w<=v;w++){const M=(v+l-w-1)%v,y=L.getLineContent(M+1),_=this._findLastMatchInLine(P,y,M+1,E);if(_)return _}return null}static _findLastMatchInLine(L,N,P,E){let v=null,l;for(L.reset(0);l=L.next(N);)v=m(new d.Range(P,l.index+1,P,l.index+1+l[0].length),l,E);return v}}n.TextModelSearch=h;function r(S,L,N,P,E){if(P===0)return!0;const v=L.charCodeAt(P-1);if(S.get(v)!==0||v===13||v===10)return!0;if(E>0){const l=L.charCodeAt(P);if(S.get(l)!==0)return!0}return!1}function s(S,L,N,P,E){if(P+E===N)return!0;const v=L.charCodeAt(P+E);if(S.get(v)!==0||v===13||v===10)return!0;if(E>0){const l=L.charCodeAt(P+E-1);if(S.get(l)!==0)return!0}return!1}function o(S,L,N,P,E){return r(S,L,N,P,E)&&s(S,L,N,P,E)}class u{constructor(L,N){this._wordSeparators=L,this._searchRegex=N,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(L){this._searchRegex.lastIndex=L,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(L){const N=L.length;let P;do{if(this._prevMatchStartIndex+this._prevMatchLength===N||(P=this._searchRegex.exec(L),!P))return null;const E=P.index,v=P[0].length;if(E===this._prevMatchStartIndex&&v===this._prevMatchLength){if(v===0){i.getNextCodePoint(L,N,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=E,this._prevMatchLength=v,!this._wordSeparators||o(this._wordSeparators,L,N,E,v))return P}while(P);return null}}n.Searcher=u}),X(J[66],Z([0,1]),function(W,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.EditorWorkerHost=void 0;class i{static{this.CHANNEL_NAME="editorWorkerHost"}static getChannel(A){return A.getChannel(i.CHANNEL_NAME)}static setChannel(A,d){A.setChannel(i.CHANNEL_NAME,d)}}n.EditorWorkerHost=i}),X(J[67],Z([0,1]),function(W,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.findSectionHeaders=A;const i=new RegExp("\\bMARK:\\s*(.*)$","d"),x=/^-+|-+$/g;function A(a,m){let e=[];if(m.findRegionSectionHeaders&&m.foldingRules?.markers){const h=d(a,m);e=e.concat(h)}if(m.findMarkSectionHeaders){const h=f(a);e=e.concat(h)}return e}function d(a,m){const e=[],h=a.getLineCount();for(let r=1;r<=h;r++){const s=a.getLineContent(r),o=s.match(m.foldingRules.markers.start);if(o){const u={startLineNumber:r,startColumn:o[0].length+1,endLineNumber:r,endColumn:s.length+1};if(u.endColumn>u.startColumn){const S={range:u,...c(s.substring(o[0].length)),shouldBeInComments:!1};(S.text||S.hasSeparatorLine)&&e.push(S)}}}return e}function f(a){const m=[],e=a.getLineCount();for(let h=1;h<=e;h++){const r=a.getLineContent(h);p(r,h,m)}return m}function p(a,m,e){i.lastIndex=0;const h=i.exec(a);if(h){const r=h.indices[1][0]
`||e===" "}}),X(J[69],Z([0,1]),function(W,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.WrappingIndent=n.TrackedRangeStickiness=n.TextEditorCursorStyle=n.TextEditorCursorBlinkingStyle=n.SymbolTag=n.SymbolKind=n.SignatureHelpTriggerKind=n.ShowLightbulbIconMode=n.SelectionDirection=n.ScrollbarVisibility=n.ScrollType=n.RenderMinimap=n.RenderLineNumbersType=n.PositionAffinity=n.PartialAcceptTriggerKind=n.OverviewRulerLane=n.OverlayWidgetPositionPreference=n.NewSymbolNameTriggerKind=n.NewSymbolNameTag=n.MouseTargetType=n.MinimapSectionHeaderStyle=n.MinimapPosition=n.MarkerTag=n.MarkerSeverity=n.KeyCode=n.InlineEditTriggerKind=n.InlineCompletionTriggerKind=n.InlayHintKind=n.InjectedTextCursorStops=n.IndentAction=n.HoverVerbosityAction=n.GlyphMarginLane=n.EndOfLineSequence=n.EndOfLinePreference=n.EditorOption=n.EditorAutoIndentStrategy=n.DocumentHighlightKind=n.DefaultEndOfLine=n.CursorChangeReason=n.ContentWidgetPositionPreference=n.CompletionTriggerKind=n.CompletionItemTag=n.CompletionItemKind=n.CompletionItemInsertTextRule=n.CodeActionTriggerType=n.AccessibilitySupport=void 0;var i;(function(t){t[t.Unknown=0]="Unknown",t[t.Disabled=1]="Disabled",t[t.Enabled=2]="Enabled"})(i||(n.AccessibilitySupport=i={}));var x;(function(t){t[t.Invoke=1]="Invoke",t[t.Auto=2]="Auto"})(x||(n.CodeActionTriggerType=x={}));var A;(function(t){t[t.None=0]="None",t[t.KeepWhitespace=1]="KeepWhitespace",t[t.InsertAsSnippet=4]="InsertAsSnippet"})(A||(n.CompletionItemInsertTextRule=A={}));var d;(function(t){t[t.Method=0]="Method",t[t.Function=1]="Function",t[t.Constructor=2]="Constructor",t[t.Field=3]="Field",t[t.Variable=4]="Variable",t[t.Class=5]="Class",t[t.Struct=6]="Struct",t[t.Interface=7]="Interface",t[t.Module=8]="Module",t[t.Property=9]="Property",t[t.Event=10]="Event",t[t.Operator=11]="Operator",t[t.Unit=12]="Unit",t[t.Value=13]="Value",t[t.Constant=14]="Constant",t[t.Enum=15]="Enum",t[t.EnumMember=16]="EnumMember",t[t.Keyword=17]="Keyword",t[t.Text=18]="Text",t[t.Color=19]="Color",t[t.File=20]="File",t[t.Reference=21]="Reference",t[t.Customcolor=22]="Customcolor",t[t.Folder=23]="Folder",t[t.TypeParameter=24]="TypeParameter",t[t.User=25]="User",t[t.Issue=26]="Issue",t[t.Snippet=27]="Snippet"})(d||(n.CompletionItemKind=d={}));var f;(function(t){t[t.Deprecated=1]="Deprecated"})(f||(n.CompletionItemTag=f={}));var p;(function(t){t[t.Invoke=0]="Invoke",t[t.TriggerCharacter=1]="TriggerCharacter",t[t.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(p||(n.CompletionTriggerKind=p={}));var c;(function(t){t[t.EXACT=0]="EXACT",t[t.ABOVE=1]="ABOVE",t[t.BELOW=2]="BELOW"})(c||(n.ContentWidgetPositionPreference=c={}));var a;(function(t){t[t.NotSet=0]="NotSet",t[t.ContentFlush=1]="ContentFlush",t[t.RecoverFromMarkers=2]="RecoverFromMarkers",t[t.Explicit=3]="Explicit",t[t.Paste=4]="Paste",t[t.Undo=5]="Undo",t[t.Redo=6]="Redo"})(a||(n.CursorChangeReason=a={}));var m;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(m||(n.DefaultEndOfLine=m={}));var e;(function(t){t[t.Text=0]="Text",t[t.Read=1]="Read",t[t.Write=2]="Write"})(e||(n.DocumentHighlightKind=e={}));var h;(function(t){t[t.None=0]="None",t[t.Keep=1]="Keep",t[t.Brackets=2]="Brackets",t[t.Advanced=3]="Advanced",t[t.Full=4]="Full"})(h||(n.EditorAutoIndentStrategy=h={}));var r;(function(t){t[t.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",t[t.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",t[t.accessibilitySupport=2]="accessibilitySupport",t[t.accessibilityPageSize=3]="accessibilityPageSize",t[t.ariaLabel=4]="ariaLabel",t[t.ariaRequired=5]="ariaRequired",t[t.autoClosingBrackets=6]="autoClosingBrackets",t[t.autoClosingComments=7]="autoClosingComments",t[t.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",t[t.autoClosingDelete=9]="autoClosingDelete",t[t.autoClosingOvertype=10]="autoClosingOvertype",t[t.autoClosingQuotes=11]="autoClosingQuotes",t[t.autoIndent=12]="autoIndent",t[t.automaticLayout=13]="automaticLayout",t[t.autoSurround=14]="autoSurround",t[t.bracketPairColorization=15]="bracketPairColorization",
//# sourceMappingURL=../../../../min-maps/vs/base/worker/workerMain.js.map